]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/protected-scm.cc
(transform_heads): replace
[lilypond.git] / lily / protected-scm.cc
index db784cbac6f1033a465372ff1c64b14aa6c0b72a..9e682104f9a50063c117b1646ca6478c885a8af0 100644 (file)
@@ -3,11 +3,11 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--2003 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"
 
 Protected_scm::Protected_scm ()
 {
@@ -16,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 & 
@@ -33,23 +40,14 @@ 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;
 }
 
 Protected_scm&
 Protected_scm::operator = (Protected_scm const &s)
 {
-  return operator= (s.object_);
-}
-
-
-Protected_scm::~Protected_scm ()
-{
-  if (SCM_NIMP (object_))
-    {
-      scm_gc_unprotect_object (object_);
-    }
+  return operator = (s.object_);
 }
 
 Protected_scm::operator SCM () const