From 964fddafa158a9a2e0d51ba0aed216fb00b17413 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 4 Aug 2002 17:20:11 +0000 Subject: [PATCH] cleanups --- ChangeLog | 2 +- input/bugs/melisma-tie-rest.ly | 2 +- lily/include/lily-guile.hh | 2 -- lily/include/translator.hh | 2 +- lily/lily-guile.cc | 35 ++++----------------------------- lily/parse-scm.cc | 6 +++++- lily/tab-note-heads-engraver.cc | 9 --------- 7 files changed, 12 insertions(+), 46 deletions(-) diff --git a/ChangeLog b/ChangeLog index e15c768941..f8974f3c99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2002-08-04 Han-Wen - * lily/lily-guile.cc: change gh_str02scm scm_makfrom0str. + * lily/lily-guile.cc: change gh_str02scm to scm_makfrom0str. 2002-08-04 Werner Lemberg diff --git a/input/bugs/melisma-tie-rest.ly b/input/bugs/melisma-tie-rest.ly index 08a832bb2d..435048354c 100644 --- a/input/bugs/melisma-tie-rest.ly +++ b/input/bugs/melisma-tie-rest.ly @@ -15,7 +15,7 @@ extend during a subsequent rest, and cannot be forced to stop." r2 r1 c } } - \context Lyrics = "soprano" \lyrics { + \context Lyrics = "soprano-1" \lyrics { hey __ stop? hey __ STOP!!! } diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 0abbedf613..30ccc4cfb1 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -99,7 +99,6 @@ inline SCM scm_c_make_vector (int k, SCM val) { */ SCM ly_last (SCM list); -SCM ly_str02scm (char const*c); SCM ly_write2scm (SCM s); SCM ly_deep_copy (SCM); SCM ly_truncate_list (int k, SCM l ); @@ -152,7 +151,6 @@ SCM ly_interval2scm (Drul_array); SCM ly_quote_scm (SCM s); -SCM ly_type (SCM); bool type_check_assignment (SCM val, SCM sym, SCM type_symbol) ; String print_scm_val (SCM val); SCM ly_number2string (SCM s); diff --git a/lily/include/translator.hh b/lily/include/translator.hh index bcfc75b91f..97784a82a9 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -120,7 +120,7 @@ classname::static_translator_description () const \ parse_symbol_list (grobs), static_properties); \ \ static_properties= scm_acons (ly_symbol2scm ("description"), \ - ly_str02scm (desc), static_properties); \ + scm_makfrom0str (desc), static_properties); \ \ static_properties= scm_acons (ly_symbol2scm ("interfaces-acked"), \ parse_symbol_list (acked), static_properties); \ diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 6688d5bef8..37eaf37dd6 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -145,6 +145,7 @@ ly_scm2string (SCM s) SCM index_get_cell (SCM s, Direction d) { + assert (d); return (d == LEFT) ? ly_car (s) : ly_cdr (s); } @@ -160,10 +161,9 @@ index_set_cell (SCM s, Direction d, SCM v) } LY_DEFINE(ly_warning,"ly-warn", 1, 0, 0, - (SCM str),"Scheme callable function to issue the warning @code{msg}. -") + (SCM str),"Scheme callable function to issue the warning @code{msg}.") { - assert (gh_string_p (str)); + SCM_ASSERT_TYPE (gh_string_p (str), str, SCM_ARG1, __FUNCTION__, "string"); warning ("lily-guile: " + ly_scm2string (str)); return SCM_BOOL_T; } @@ -316,33 +316,6 @@ ly_scm2offset (SCM s) gh_scm2double (ly_cdr (s))); } -SCM -ly_type (SCM exp) -{ - char const * cp = "unknown"; - if (gh_number_p (exp)) - { - cp = "number"; - } - else if (gh_string_p (exp)) - { - cp = "string"; - } - else if (gh_procedure_p (exp)) - { - cp = "procedure"; - } - else if (gh_boolean_p (exp)) - { - cp = "boolean"; - } - else if (gh_pair_p (exp)) - { - cp = "list"; - } - - return scm_makfrom0str (cp); -} /* convert without too many decimals, and leave a space at the end. @@ -355,7 +328,7 @@ LY_DEFINE(ly_number2string, "ly-number->string", 1, 0,0, leaves a space at the end. ") { - assert (gh_number_p (s)); + SCM_ASSERT_TYPE (gh_number_p (s), s, SCM_ARG1, __FUNCTION__, "number"); char str[400]; // ugh. diff --git a/lily/parse-scm.cc b/lily/parse-scm.cc index aaf3b5d35b..858c757f5d 100644 --- a/lily/parse-scm.cc +++ b/lily/parse-scm.cc @@ -16,10 +16,14 @@ SCM internal_ly_parse_scm (Parse_start * ps) { /* + This is actually pretty wasteful: we stuff the rest of the entire file down GUILE, while we usually need only a bit of it. + + TODO: implement read_only_string_port(), (preferably in GUILE ?) + */ - SCM str = ly_str02scm (ps->str); + SCM str = scm_makfrom0str (ps->str); SCM port = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, "ly_eval_scm_0str"); diff --git a/lily/tab-note-heads-engraver.cc b/lily/tab-note-heads-engraver.cc index 6c454a8cb5..28bd4b298b 100644 --- a/lily/tab-note-heads-engraver.cc +++ b/lily/tab-note-heads-engraver.cc @@ -71,15 +71,6 @@ Tab_note_heads_engraver::try_music (Music *m) void Tab_note_heads_engraver::process_music () { - /* - for (int i=0; i < tabstring_reqs_.size (); i++) { - Music * tabstring_req = tabstring_reqs_[i]; - - size_t lenp; - char* tab_string_as_string = gh_scm2newstr(tabstring_req->get_mus_property ("text"), &lenp); - } - */ - for (int i=0; i < note_reqs_.size (); i++) { SCM stringTunings = get_property ("stringTunings"); -- 2.39.2