]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/protected-scm.cc
*** empty log message ***
[lilypond.git] / lily / protected-scm.cc
index 1b6918bcf603d31d47c0f1ca4f76edc715cef054..56bd2def2fef8f6a190510208cef89b45eb2baf1 100644 (file)
@@ -3,12 +3,11 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 #include "protected-scm.hh"
 #include "lily-guile.hh"
-#include "main.hh"
 
 Protected_scm::Protected_scm ()
 {
@@ -17,12 +16,19 @@ Protected_scm::Protected_scm ()
 
 Protected_scm::Protected_scm (SCM s)
 {
-  object_ = SCM_NIMP (s)  ? scm_gc_protect_object (s): s;
+  object_ = SCM_NIMP (s) ? scm_gc_protect_object (s): s;
 }
 
 Protected_scm::Protected_scm (Protected_scm const &s)
 {
-  object_ = SCM_NIMP (s.object_) ? scm_gc_protect_object (s.object_) : s.object_;
+  object_ = (SCM_NIMP (s.object_) ? scm_gc_protect_object (s.object_)
+            : s.object_);
+}
+
+Protected_scm::~Protected_scm ()
+{
+  if (SCM_NIMP (object_))
+    scm_gc_unprotect_object (object_);
 }
 
 Protected_scm & 
@@ -34,7 +40,7 @@ Protected_scm::operator = (SCM s)
   if (SCM_NIMP (object_))
     scm_gc_unprotect_object (object_);
 
-  object_ =  SCM_NIMP (s) ? scm_gc_protect_object (s): s;
+  object_ = SCM_NIMP (s) ? scm_gc_protect_object (s) : s;
   return *this;
 }
 
@@ -44,15 +50,6 @@ Protected_scm::operator = (Protected_scm const &s)
   return operator= (s.object_);
 }
 
-
-Protected_scm::~Protected_scm ()
-{
-  if (SCM_NIMP (object_))
-    {
-      scm_gc_unprotect_object (object_);
-    }
-}
-
 Protected_scm::operator SCM () const
 {
   return object_;