]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/music-iterator.cc
* flower/file-path.cc:
[lilypond.git] / lily / music-iterator.cc
index 6e836ea933b5381337ff21515c0ac06704619720..00a5538dc25dd67b59c35ac9cc2a2e0d43e78247 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 /*
@@ -13,6 +13,7 @@
 #include "music-iterator.hh"
 
 #include <cstdio>
+using namespace std;
 
 #include "warn.hh"
 #include "context.hh"
@@ -78,7 +79,7 @@ Music_iterator::get_static_get_iterator (Music *m)
 
   SCM ctor = m->get_property ("iterator-ctor");
   SCM iter = SCM_EOL;
-  if (ly_c_procedure_p (ctor))
+  if (ly_is_procedure (ctor))
     {
       iter = scm_call_0 (ctor);
       p = unsmob_iterator (iter);
@@ -91,7 +92,7 @@ Music_iterator::get_static_get_iterator (Music *m)
        p = new Simple_music_iterator;
 
       iter = p->self_scm ();
-      scm_gc_unprotect_object (iter);
+      p->unprotect ();
     }
 
   p->music_ = m;
@@ -206,7 +207,7 @@ Music_iterator::print_smob (SCM sm, SCM port, scm_print_state*)
   char s[1000];
 
   Music_iterator *iter = unsmob_iterator (sm);
-  sprintf (s, "#<%s>", classname (iter));
+  sprintf (s, "#<%s>", iter->class_name ());
   scm_puts (s, port);
   return 1;
 }
@@ -220,7 +221,7 @@ void
 Music_iterator::quit ()
 {
   do_quit ();
-  handle_.quit ();
+  handle_.set_context (0);
 }
 
 void
@@ -238,9 +239,7 @@ bool
 is_child_context (Context *me, Context *child)
 {
   while (child && child != me)
-    {
-      child = child->get_parent_context ();
-    }
+    child = child->get_parent_context ();
 
   return child == me;
 }