From 1bf2062b6126102e7e66ed954a3be9906894ec1b Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 19 Sep 2006 12:33:53 +0000 Subject: [PATCH] (get_curve): always use scm_is_pair() looping scheme lists. Backportme. --- ChangeLog | 7 +++++++ VERSION | 2 +- lily/axis-group-interface.cc | 2 +- lily/book.cc | 4 ++-- lily/dispatcher-scheme.cc | 2 +- lily/dispatcher.cc | 4 ++-- lily/grob-property.cc | 2 +- lily/grob.cc | 2 +- lily/ligature-engraver.cc | 2 +- lily/mensural-ligature.cc | 2 +- lily/page-breaking.cc | 2 +- lily/paper-book.cc | 6 +++--- lily/slur.cc | 2 +- lily/tie.cc | 2 +- 14 files changed, 24 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00f225c192..66a2ce59fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-09-19 Han-Wen Nienhuys + + * lily/*.cc: idem. + + * lily/slur.cc (get_curve): always use scm_is_pair() looping + scheme lists. Backportme. + 2006-09-18 Graham Percival * Documentation/user/basic-notation.itely: add bug diff --git a/VERSION b/VERSION index 9d5789cd29..b3d86410a5 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=9 -PATCH_LEVEL=18 +PATCH_LEVEL=19 MY_PATCH_LEVEL= diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index 1d509f04d1..d74bf880e6 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -27,7 +27,7 @@ Axis_group_interface::add_element (Grob *me, Grob *e) if (!scm_is_pair (axes)) programming_error ("axes should be nonempty"); - for (SCM ax = axes; ax != SCM_EOL; ax = scm_cdr (ax)) + for (SCM ax = axes; scm_is_pair (ax); ax = scm_cdr (ax)) { Axis a = (Axis) scm_to_int (scm_car (ax)); diff --git a/lily/book.cc b/lily/book.cc index 114ef0cdf2..06b10135ac 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -118,7 +118,7 @@ Paper_book * Book::process (Output_def *default_paper, Output_def *default_layout) { - for (SCM s = scores_; s != SCM_EOL; s = scm_cdr (s)) + for (SCM s = scores_; scm_is_pair (s); s = scm_cdr (s)) if (Score *score = unsmob_score (scm_car (s))) if (score->error_found_) return 0; @@ -140,7 +140,7 @@ Book::process (Output_def *default_paper, paper_book->header_ = header_; /* Render in order of parsing. */ - for (SCM s = scm_reverse (scores_); s != SCM_EOL; s = scm_cdr (s)) + for (SCM s = scm_reverse (scores_); scm_is_pair (s); s = scm_cdr (s)) { if (Score *score = unsmob_score (scm_car (s))) { diff --git a/lily/dispatcher-scheme.cc b/lily/dispatcher-scheme.cc index a8a2b273a1..2a2720656c 100644 --- a/lily/dispatcher-scheme.cc +++ b/lily/dispatcher-scheme.cc @@ -38,7 +38,7 @@ LY_DEFINE (ly_add_listener, "ly:add-listener", SCM_ASSERT_TYPE (l, list, SCM_ARG1, __FUNCTION__, "listener"); SCM_ASSERT_TYPE (d, disp, SCM_ARG2, __FUNCTION__, "dispatcher"); - for (int arg=SCM_ARG3; cl != SCM_EOL; cl = scm_cdr (cl), arg++) + for (int arg=SCM_ARG3; scm_is_pair (cl); cl = scm_cdr (cl), arg++) { SCM_ASSERT_TYPE (scm_symbol_p (cl), cl, arg, __FUNCTION__, "symbol"); d->add_listener (*l, scm_car (cl)); diff --git a/lily/dispatcher.cc b/lily/dispatcher.cc index b86d045bc1..fb3df2a40f 100644 --- a/lily/dispatcher.cc +++ b/lily/dispatcher.cc @@ -223,7 +223,7 @@ Dispatcher::remove_listener (Listener l, SCM ev_class) else if (!scm_is_pair (list)) { /* Unregister with all dispatchers. */ - for (SCM disp = dispatchers_; disp != SCM_EOL; disp = scm_cdr (disp)) + for (SCM disp = dispatchers_; scm_is_pair (disp); disp = scm_cdr (disp)) { Dispatcher *d = unsmob_dispatcher (scm_caar (disp)); d->remove_listener (GET_LISTENER (dispatch), ev_class); @@ -248,7 +248,7 @@ Dispatcher::register_as_listener (Dispatcher *disp) dispatchers_ = scm_acons (disp->self_scm (), scm_int2num (priority), dispatchers_); Listener list = GET_LISTENER (dispatch); - for (SCM cl = listen_classes_; cl != SCM_EOL; cl = scm_cdr (cl)) + for (SCM cl = listen_classes_; scm_is_pair (cl); cl = scm_cdr (cl)) { disp->internal_add_listener (list, scm_car (cl), priority); } diff --git a/lily/grob-property.cc b/lily/grob-property.cc index 8d7ecc0c19..cfa21832d8 100644 --- a/lily/grob-property.cc +++ b/lily/grob-property.cc @@ -191,7 +191,7 @@ Grob::internal_get_object (SCM sym) const bool Grob::is_live () const { - return immutable_property_alist_ != SCM_EOL; + return scm_is_pair (immutable_property_alist_); } diff --git a/lily/grob.cc b/lily/grob.cc index 72b46376c6..3e98a5b90a 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -135,7 +135,7 @@ Grob::get_print_stencil () const /* color support... see interpret_stencil_expression () for more... */ SCM color = get_property ("color"); - if (color != SCM_EOL) + if (scm_is_pair (color)) { SCM expr = scm_list_3 (ly_symbol2scm ("color"), color, diff --git a/lily/ligature-engraver.cc b/lily/ligature-engraver.cc index 98e840b1ff..81523a0109 100644 --- a/lily/ligature-engraver.cc +++ b/lily/ligature-engraver.cc @@ -189,7 +189,7 @@ Ligature_engraver::acknowledge_note_head (Grob_info info) if (ligature_) { primitives_.push_back (info); - if (info.grob () && (brew_ligature_primitive_proc != SCM_EOL)) + if (info.grob () && brew_ligature_primitive_proc != SCM_EOL) { info.grob ()->set_property ("stencil", brew_ligature_primitive_proc); } diff --git a/lily/mensural-ligature.cc b/lily/mensural-ligature.cc index c327da0b55..936f64b877 100644 --- a/lily/mensural-ligature.cc +++ b/lily/mensural-ligature.cc @@ -167,7 +167,7 @@ internal_brew_primitive (Grob *me) SCM join_right_scm = me->get_property ("join-right-amount"); - if (join_right_scm != SCM_EOL) + if (scm_is_pair (join_right_scm)) { int join_right = scm_to_int (join_right_scm); if (join_right) diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index b1fd686e2b..528b61b854 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -224,7 +224,7 @@ void Page_breaking::create_system_list () { SCM specs = book_->get_system_specs (); - for (SCM s = specs; s != SCM_EOL; s = scm_cdr (s)) + for (SCM s = specs; scm_is_pair (s); s = scm_cdr (s)) { if (Paper_score *ps = dynamic_cast (unsmob_music_output (scm_car (s)))) { diff --git a/lily/paper-book.cc b/lily/paper-book.cc index 81376da0a4..c16870f30d 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -279,7 +279,7 @@ Paper_book::get_system_specs () paper_->self_scm ()); SCM header = SCM_EOL; - for (SCM s = scm_reverse (scores_); s != SCM_EOL; s = scm_cdr (s)) + for (SCM s = scm_reverse (scores_); scm_is_pair (s); s = scm_cdr (s)) { if (ly_is_module (scm_car (s))) { @@ -358,7 +358,7 @@ Paper_book::systems () int i = 0; Prob *last = 0; - for (SCM s = systems_; s != SCM_EOL; s = scm_cdr (s)) + for (SCM s = systems_; scm_is_pair (s); s = scm_cdr (s)) { Prob *ps = unsmob_prob (scm_car (s)); ps->set_property ("number", scm_from_int (++i)); @@ -387,7 +387,7 @@ Paper_book::pages () if (systems_ == SCM_BOOL_F) { systems_ = SCM_EOL; - for (SCM p = pages_; p != SCM_EOL; p = scm_cdr (p)) + for (SCM p = pages_; scm_is_pair (p); p = scm_cdr (p)) { Prob *page = unsmob_prob (scm_car (p)); SCM systems = page->get_property ("lines"); diff --git a/lily/slur.cc b/lily/slur.cc index 0c68a6137e..df529f7713 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -165,7 +165,7 @@ Slur::get_curve (Grob *me) { Bezier b; int i = 0; - for (SCM s = me->get_property ("control-points"); s != SCM_EOL; + for (SCM s = me->get_property ("control-points"); scm_is_pair (s); s = scm_cdr (s)) b.control_[i++] = ly_scm2offset (scm_car (s)); diff --git a/lily/tie.cc b/lily/tie.cc index f6561fa576..b4b5206386 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -235,7 +235,7 @@ Tie::print (SCM smob) Bezier b; int i = 0; - for (SCM s = cp; s != SCM_EOL; s = scm_cdr (s)) + for (SCM s = cp; scm_is_pair (s); s = scm_cdr (s)) { b.control_[i] = ly_scm2offset (scm_car (s)); i++; -- 2.39.5