diff --git a/lily/include/lily-guile-macros.hh b/lily/include/lily-guile-macros.hh index 7002c0f..dcb0a13 100644 --- a/lily/include/lily-guile-macros.hh +++ b/lily/include/lily-guile-macros.hh @@ -29,6 +29,14 @@ #endif #ifdef CACHE_SYMBOLS +/* this lets us "overload" macros such as get_property to take + symbols as well as strings */ +inline SCM +scm_or_str2symbol (char const *c) { return scm_str2symbol (c); } + +inline SCM +scm_or_str2symbol (SCM s) { return s; } + /* Using this trick we cache the value of scm_str2symbol ("fooo") where "fooo" is a constant string. This is done at the cost of one static variable per ly_symbol2scm() use, and one boolean evaluation for @@ -43,10 +51,10 @@ #define ly_symbol2scm(x) \ if (__builtin_constant_p ((x))) \ { \ if (!cached) \ - value = cached = scm_gc_protect_object (scm_str2symbol ((x))); \ + value = cached = scm_gc_protect_object (scm_or_str2symbol (x)); \ } \ else \ - value = scm_str2symbol ((char *) (x)); \ + value = scm_or_str2symbol (x); \ value; \ }) #else diff --git a/lily/tweak-engraver.cc b/lily/tweak-engraver.cc index a479935..1749228 100644 --- a/lily/tweak-engraver.cc +++ b/lily/tweak-engraver.cc @@ -33,7 +33,7 @@ Tweak_engraver::acknowledge_grob (Grob_i for (SCM s = music->get_property ("tweaks"); scm_is_pair (s); s = scm_cdr (s)) { - info.grob ()->internal_set_property (scm_caar (s), scm_cdar (s), __FILE__, __LINE__); + info.grob ()->set_property (scm_caar (s), scm_cdar (s)); } } }