From 9d48ae883f0dede5e7e48a1fa1ccf7b7ccc0646c Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 29 May 2005 09:56:01 +0000 Subject: [PATCH] * lily/timing-engraver.cc (process_music): robustness fix. * lily/context-def.cc (filter_engravers): bugfix. --- ChangeLog | 7 ++++++- lily/context-def.cc | 21 +++++++++------------ lily/timing-engraver.cc | 14 +++++++++----- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index b89aa6b194..94deefe4a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-05-29 Han-Wen Nienhuys + + * lily/timing-engraver.cc (process_music): robustness fix. + + * lily/context-def.cc (filter_engravers): bugfix. + 2005-05-28 Jan Nieuwenhuizen * 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 * lily/stencil-scheme.cc (LY_DEFINE): ly:stencil-in-color diff --git a/lily/context-def.cc b/lily/context-def.cc index 858ef35ff9..b5d0d940cc 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -265,14 +265,13 @@ Context_def::get_translator_names (SCM user_mod) const SCM filter_performers (SCM ell) { - for (SCM *tail = ℓ scm_is_pair (*tail); tail = SCM_CDRLOC (*tail)) + SCM *tail = ℓ + for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p)) { if (dynamic_cast (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 = ℓ - for (; scm_is_pair (*tail); tail = SCM_CDRLOC (*tail)) + for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p)) { if (dynamic_cast (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; } diff --git a/lily/timing-engraver.cc b/lily/timing-engraver.cc index 1dd76bc42d..1c30fcd34f 100644 --- a/lily/timing-engraver.cc +++ b/lily/timing-engraver.cc @@ -6,12 +6,13 @@ (c) 1997--2005 Han-Wen Nienhuys */ -#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?"); } } -- 2.39.2