From c2db0f999bdea83deae3f771709033d60bd73537 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 9 Jun 2005 18:05:31 +0000 Subject: [PATCH] * lily/include/lily-guile-macros.hh: don't protect exported module objects. * lily/include/lily-parser.hh (class Lily_parser): remove beam_check(). --- ChangeLog | 5 +++++ lily/include/lily-guile-macros.hh | 8 ++++++-- lily/include/lily-parser.hh | 2 -- lily/lily-parser.cc | 2 -- lily/parser.yy | 26 -------------------------- lily/scm-hash.cc | 3 +-- scm/lily.scm | 2 +- 7 files changed, 13 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6269944f8..a1bc28ea77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2005-06-09 Han-Wen Nienhuys + * lily/include/lily-guile-macros.hh: don't protect exported module + objects. + + * lily/include/lily-parser.hh (class Lily_parser): remove beam_check(). + * scm/backend-library.scm (postscript->pdf): use delete-intermediate-files iso. running-from-gui? diff --git a/lily/include/lily-guile-macros.hh b/lily/include/lily-guile-macros.hh index 2138038481..3a2f63e47c 100644 --- a/lily/include/lily-guile-macros.hh +++ b/lily/include/lily-guile-macros.hh @@ -55,7 +55,11 @@ inline SCM ly_symbol2scm (char const *x) { return scm_str2symbol ((x)); } /* TODO: rename me to ly_c_lily_module_eval + + we don't have to protect the result; it's already part of the + exports list of the module. */ + #define ly_lily_module_constant(x) \ ({ \ static SCM cached; \ @@ -64,8 +68,8 @@ inline SCM ly_symbol2scm (char const *x) { return scm_str2symbol ((x)); } if (__builtin_constant_p ((x))) \ { \ if (!cached) \ - value = cached = scm_gc_protect_object (scm_eval (scm_str2symbol (x), \ - global_lily_module)); \ + value = cached = scm_eval (scm_str2symbol (x), \ + global_lily_module); \ } \ else \ value = scm_eval (scm_str2symbol (x), global_lily_module); \ diff --git a/lily/include/lily-parser.hh b/lily/include/lily-parser.hh index 2f8810b37b..96f46d4a6f 100644 --- a/lily/include/lily-parser.hh +++ b/lily/include/lily-parser.hh @@ -47,14 +47,12 @@ public: int fatal_error_; int error_level_; bool ignore_version_b_; - SCM last_beam_start_; Lily_parser (Sources *sources); Lily_parser (Lily_parser const &); DECLARE_SCHEME_CALLBACK (layout_description, ()); - void beam_check (SCM); void do_init_file (); void do_yyparse (); void parse_file (String init, String name, String out_name); diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index cef4ed6836..1c284b4138 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -31,7 +31,6 @@ Lily_parser::Lily_parser (Sources *sources) sources_ = sources; default_duration_ = Duration (2, 0); error_level_ = 0; - last_beam_start_ = SCM_EOL; smobify_self (); } @@ -44,7 +43,6 @@ Lily_parser::Lily_parser (Lily_parser const &src) sources_ = src.sources_; default_duration_ = src.default_duration_; error_level_ = src.error_level_; - last_beam_start_ = src.last_beam_start_; smobify_self (); if (src.lexer_) diff --git a/lily/parser.yy b/lily/parser.yy index 9cfa833ddf..4d73b39b5d 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -2097,14 +2097,10 @@ optional_notemode_duration: { Duration dd = THIS->default_duration_; $$ = dd.smobbed_copy (); - - THIS->beam_check ($$); } | multiplied_duration { $$ = $1; THIS->default_duration_ = *unsmob_duration ($$); - - THIS->beam_check ($$); } ; @@ -2665,28 +2661,6 @@ Lily_parser::do_yyparse () } -/* FIXME: Should make this optional? It will also complain at - - [s4] - -which is entirely legitimate. - -Or we can scrap it. Barchecks should detect wrong durations, and -skipTypesetting speeds it up a lot. */ - -void -Lily_parser::beam_check (SCM dur) -{ - Duration *d = unsmob_duration (dur); - if (unsmob_music (last_beam_start_) && d->duration_log () <= 2) - { - Music *m = unsmob_music (last_beam_start_); - m->origin ()->warning (_f ("suspect duration in beam: %s", - d->to_string ())); - } - last_beam_start_ = SCM_EOL; -} - diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index f59adc0104..86af9a6d03 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -76,8 +76,7 @@ int Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state*) { assert (unsmob (s)); - char str[1000]; - sprintf (str, "#hash_tab_, p); scm_puts ("> ", p); diff --git a/scm/lily.scm b/scm/lily.scm index 4a3da324e5..abf238871a 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -326,7 +326,7 @@ The syntax is the same as `define*-public'." (lambda () (ly:parse-file file-name)) (lambda (x . args) (handler x file-name))) - (if #f + (if #t (dump-gc-protects))) (use-modules (scm editor)) -- 2.39.5