source file of the GNU LilyPond music typesetter
- (c) 2001--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ (c) 2001--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include <cstdio>
#include <cstdlib>
using namespace std;
-#include "grob-array.hh"
#include "item.hh"
#include "system.hh"
+#include "grob-array.hh"
static SCM break_criterion;
void
/*
Perform substitution on GROB_LIST using a constant amount of stack.
*/
-Link_array__Grob_ temporary_substition_array;
+vector<Grob*> 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<Grob*> &old_grobs (grob_arr->array_reference ());
+ vector<Grob*> *new_grobs (new_arr == grob_arr
? & temporary_substition_array
: &new_arr->array_reference ());
struct Substitution_entry
{
Grob *grob_;
+
+ /* Assumption: we have less than 32k paper columns. */
short left_;
short right_;
/*
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;
qsort (vec, item_index,
sizeof (Substitution_entry), &Substitution_entry::item_compare);
- std::vector<Slice> item_indices;
- std::vector<Slice> spanner_indices;
+ vector<Slice> item_indices;
+ vector<Slice> 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<Slice> *arrs[]
+ vector<Slice> *arrs[]
= {
&item_indices, &spanner_indices
};
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);
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);
}
}
}