do_break_substitution (SCM src)
{
again:
- Grob *sc = unsmob_grob (src);
- if (sc)
+
+ if (Grob *sc = unsmob_grob (src))
{
if (SCM_INUMP (break_criterion))
{
return SCM_UNDEFINED;
}
}
- else if (ly_pair_p (src)) // SCM_CONSP (src)) // huh?
+ else if (ly_pair_p (src))
{
- SCM oldcar =ly_car (src);
/*
UGH! breaks on circular lists.
*/
- SCM newcar = do_break_substitution (oldcar);
+ SCM newcar = do_break_substitution (ly_car (src));
SCM oldcdr = ly_cdr (src);
if (newcar == SCM_UNDEFINED
/*
This is tail-recursion, ie.
- return do_break_substution (cdr, break_criterion);
+ return do_break_substution (cdr);
We don't want to rely on the compiler to do this. Without
tail-recursion, this easily crashes with a stack overflow. */
goto again;
}
- SCM newcdr = do_break_substitution (oldcdr);
- return scm_cons (newcar, newcdr);
+ return scm_cons (newcar, do_break_substitution (oldcdr));
}
else
return src;
nop.
*/
}
+
+/*
+ display stuff without using stack
+ */
+SCM
+display_list (SCM s)
+{
+ SCM p = scm_current_output_port();
+
+ scm_puts ("(", p);
+ for (; gh_pair_p(s); s =gh_cdr(s))
+ {
+ scm_display (gh_car(s), p);
+ scm_puts (" ", p);
+ }
+ scm_puts (")", p);
+ return SCM_UNSPECIFIED;
+}
(c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include <stdio.h>
+
#include "ly-smobs.icc"
#include "score.hh"
/*
TODO: junkme.
*/
-
Score::Score ()
: Input ()
{
}
+
+/*
+ should enable this to find weird mistakes?
+*/
+#define PARANOIA
+
+#ifdef PARANOIA
+#include <sys/resource.h>
+#endif
+
void
Score::run_translator (Music_output_def *odef_l)
{
+
+
+#ifdef PARANOIA
+ if (verbose_global_b)
+ {
+ struct rlimit rls;
+
+ getrlimit (RLIMIT_STACK, &rls);
+ progress_indication (_f("stack size cur %d, max %d\n" ,rls.rlim_cur, rls.rlim_max));
+ }
+#endif
+
/*
We want to know if we want to store locations, since they take a
lot of overhead.
-
- */
+ */
store_locations_global_b = (gh_eval_str ("point-and-click") != SCM_BOOL_F);
-
Cpu_timer timer;
-
-
Global_translator * trans_p = odef_l->get_global_translator_p ();
if (!trans_p)
{
trans_p->final_mom_ = music->length_mom ();
-
Music_iterator * iter = Music_iterator::static_get_iterator_p (music);
iter->init_translator (music, trans_p);