X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbreak-substitution.cc;h=8326cee5eeb8f045a3bf1cbc46158c6432c2848a;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=2c822f8548e3cf8029dc7297bd8a16b14df2cfc9;hpb=9d4a5bbc9687aef811a60aabd9cb839412984e96;p=lilypond.git diff --git a/lily/break-substitution.cc b/lily/break-substitution.cc index 2c822f8548..8326cee5ee 100644 --- a/lily/break-substitution.cc +++ b/lily/break-substitution.cc @@ -3,16 +3,16 @@ source file of the GNU LilyPond music typesetter - (c) 2001--2006 Han-Wen Nienhuys + (c) 2001--2008 Han-Wen Nienhuys */ #include #include using namespace std; -#include "grob-array.hh" #include "item.hh" #include "system.hh" +#include "grob-array.hh" static SCM break_criterion; void @@ -139,12 +139,12 @@ do_break_substitution (SCM src) /* Perform substitution on GROB_LIST using a constant amount of stack. */ -Link_array__Grob_ temporary_substition_array; +vector temporary_substition_array; void substitute_grob_array (Grob_array *grob_arr, Grob_array *new_arr) { - Link_array__Grob_ &old_grobs (grob_arr->array_reference ()); - Link_array__Grob_ *new_grobs (new_arr == grob_arr + vector &old_grobs (grob_arr->array_reference ()); + vector *new_grobs (new_arr == grob_arr ? & temporary_substition_array : &new_arr->array_reference ()); @@ -263,6 +263,8 @@ grob_system_range (Grob *g) struct Substitution_entry { Grob *grob_; + + /* Assumption: we have less than 32k paper columns. */ short left_; short right_; @@ -322,6 +324,8 @@ Spanner::fast_substitute_grob_array (SCM sym, /* We store items on the left, spanners on the right in this vector. + + FIXME: will not multithread. */ static Substitution_entry *vec; static int vec_room; @@ -356,15 +360,15 @@ Spanner::fast_substitute_grob_array (SCM sym, qsort (vec, item_index, sizeof (Substitution_entry), &Substitution_entry::item_compare); - std::vector item_indices; - std::vector spanner_indices; + vector item_indices; + vector spanner_indices; for (int i = 0; i <= system_range.length (); i++) { item_indices.push_back (Slice (len, 0)); spanner_indices.push_back (Slice (len, 0)); } - std::vector *arrs[] + vector *arrs[] = { &item_indices, &spanner_indices }; @@ -397,7 +401,7 @@ Spanner::fast_substitute_grob_array (SCM sym, if (!unsmob_grob_array (newval)) { newval = Grob_array::make_array (); - sc->internal_set_object (sym, newval); + sc->set_object (sym, newval); } Grob_array *new_array = unsmob_grob_array (newval); @@ -500,14 +504,14 @@ Spanner::substitute_one_mutable_property (SCM sym, if (!unsmob_grob_array (newval)) { newval = Grob_array::make_array (); - sc->internal_set_object (sym, newval); + sc->set_object (sym, newval); } substitute_grob_array (grob_array, unsmob_grob_array (newval)); } else { SCM newval = do_break_substitution (val); - sc->internal_set_object (sym, newval); + sc->set_object (sym, newval); } } }