X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fprogram-option-scheme.cc;h=88d16e167f94e904b99e0a6f111776e9c05d70f4;hb=8659a99f233f5c4684292728e7ad4206669b35b0;hp=405e5d17c2aeb3ec7ab2873284847567a11abefd;hpb=59a6d1a06432fc0ca88c3023c646182f389ec1b5;p=lilypond.git diff --git a/lily/program-option-scheme.cc b/lily/program-option-scheme.cc index 405e5d17c2..88d16e167f 100644 --- a/lily/program-option-scheme.cc +++ b/lily/program-option-scheme.cc @@ -21,6 +21,7 @@ #include #include +using namespace std; #include "profile.hh" #include "international.hh" @@ -29,9 +30,7 @@ #include "string-convert.hh" #include "warn.hh" #include "lily-imports.hh" - -using std::string; -using std::vector; +#include "protected-scm.hh" bool debug_skylines; bool debug_property_callbacks; @@ -47,7 +46,7 @@ bool profile_property_accesses = false; bool do_internal_type_checking_global; bool strict_infinity_checking = false; -static SCM option_hash; +static Protected_scm option_hash; void internal_set_option (SCM var, @@ -171,7 +170,7 @@ get_help_string () } string help ("Options supported by `ly:set-option':\n\n"); - vector_sort (opts, std::less ()); + vector_sort (opts, less ()); for (vsize i = 0; i < opts.size (); i++) help += opts[i]; return help; @@ -192,8 +191,8 @@ LY_DEFINE (ly_add_option, "ly:add-option", 3, 0, 0, "Add a program option @var{sym}. @var{val} is the default" " value and @var{description} is a string description.") { - if (!option_hash) - option_hash = scm_permanent_object (scm_c_make_hash_table (11)); + if (!option_hash.is_bound ()) + option_hash = scm_c_make_hash_table (11); LY_ASSERT_TYPE (ly_is_symbol, sym, 1); LY_ASSERT_TYPE (scm_is_string, description, 3);