]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/timing-engraver.cc (process_music): robustness fix.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 29 May 2005 09:56:01 +0000 (09:56 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 29 May 2005 09:56:01 +0000 (09:56 +0000)
* lily/context-def.cc (filter_engravers): bugfix.

ChangeLog
lily/context-def.cc
lily/timing-engraver.cc

index b89aa6b194e55c34da0220864b772132a4ae212c..94deefe4a1290aae8616a93614d19b033d5bc59c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-05-29  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/timing-engraver.cc (process_music): robustness fix.
+
+       * lily/context-def.cc (filter_engravers): bugfix.
+
 2005-05-28  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lily/lilypond.rc.in: Add ly-icon.
@@ -6,7 +12,6 @@
        * Documentation/pictures/GNUmakefile (OUT_DIST_FILES): Add ly-icon
        rules.
 
-       
 2005-05-28  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * lily/stencil-scheme.cc (LY_DEFINE): ly:stencil-in-color
index 858ef35ff94264b337e1031e43604cf9d88d78f6..b5d0d940cc8f0fd7e76a6c043f96a39a22e61dc1 100644 (file)
@@ -265,14 +265,13 @@ Context_def::get_translator_names (SCM user_mod) const
 SCM
 filter_performers (SCM ell)
 {
-  for (SCM *tail = &ell; scm_is_pair (*tail); tail = SCM_CDRLOC (*tail))
+  SCM *tail = &ell;
+  for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p))
     {
       if (dynamic_cast<Performer *> (unsmob_translator (scm_car (*tail))))
-       {
-         *tail = scm_cdr (*tail);
-         if (!scm_is_pair (*tail))
-           break;
-       }
+       *tail = scm_cdr (*tail);
+      else
+       tail = SCM_CDRLOC(*tail);
     }
   return ell;
 }
@@ -281,14 +280,12 @@ SCM
 filter_engravers (SCM ell)
 {
   SCM *tail = &ell;
-  for (; scm_is_pair (*tail); tail = SCM_CDRLOC (*tail))
+  for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p))
     {
       if (dynamic_cast<Engraver *> (unsmob_translator (scm_car (*tail))))
-       {
-         *tail = scm_cdr (*tail);
-         if (!scm_is_pair (*tail))
-           break;
-       }
+       *tail = scm_cdr (*tail);
+      else
+       tail = SCM_CDRLOC(*tail);
     }
   return ell;
 }
index 1dd76bc42d394551138e5724a7a52d28b5fe7a3e..1c30fcd34f085bb5ba56a07d408e7d1f7648dd01 100644 (file)
@@ -6,12 +6,13 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "context.hh"
-#include "multi-measure-rest.hh"
 #include "timing-translator.hh"
 #include "engraver.hh"
-#include "grob.hh"
 
+#include "context.hh"
+#include "multi-measure-rest.hh"
+#include "grob.hh"
+#include "warn.hh"
 
 
 class Timing_engraver : public Timing_translator, public Engraver
@@ -62,8 +63,11 @@ Timing_engraver::process_music ()
   if (start_of_measure)
     {
       Moment mlen = Moment (measure_length ());
-      unsmob_grob (get_property ("currentCommandColumn"))
-       ->set_property ("measure-length", mlen.smobbed_copy ());
+      Grob * column = unsmob_grob (get_property ("currentCommandColumn"));
+      if (column)
+       column->set_property ("measure-length", mlen.smobbed_copy ());
+      else
+       programming_error("No command column?");
     }
 }