X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fcontext-def.cc;h=72ddf6d37b32e816b0bf585a2fede4f41b429915;hb=97a0169312a260933246ab224e4f8b0969871dd5;hp=ec80878b2d9ae1e07a0c86d36192e8c9e1721d0e;hpb=8cd6c7945283badb27640b3a0020808ace14a27a;p=lilypond.git diff --git a/lily/context-def.cc b/lily/context-def.cc index ec80878b2d..72ddf6d37b 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2000--2014 Han-Wen Nienhuys + Copyright (C) 2000--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -50,10 +50,11 @@ Context_def::Context_def () Input * Context_def::origin () const { - return Input::unsmob (input_location_); + return unsmob (input_location_); } Context_def::Context_def (Context_def const &s) + : Smob () { context_aliases_ = SCM_EOL; translator_group_type_ = SCM_EOL; @@ -81,10 +82,10 @@ Context_def::~Context_def () { } -const char Context_def::type_p_name_[] = "ly:context-def?"; +const char * const Context_def::type_p_name_ = "ly:context-def?"; int -Context_def::print_smob (SCM port, scm_print_state *) +Context_def::print_smob (SCM port, scm_print_state *) const { scm_puts ("# accepteds; for (SCM s = accepted; scm_is_pair (s); s = scm_cdr (s)) - if (Context_def *t = Context_def::unsmob (find_context_def (odef, + if (Context_def *t = unsmob (find_context_def (odef, scm_car (s)))) accepteds.push_back (t); @@ -288,13 +289,10 @@ Context_def::get_translator_names (SCM user_mod) const if (scm_is_string (arg)) arg = scm_string_to_symbol (arg); - if (ly_symbol2scm ("consists") == tag) + if (scm_is_eq (tag, ly_symbol2scm ("consists"))) l1 = scm_cons (arg, l1); - else if (ly_symbol2scm ("remove") == tag - && (scm_is_pair (arg) - || ly_is_procedure (arg) - || get_translator (arg))) - l1 = scm_delete_x (arg, l1); + else if (scm_is_eq (tag, ly_symbol2scm ("remove"))) + l1 = scm_delq_x (arg, l1); } return l1; @@ -397,7 +395,7 @@ LY_DEFINE (ly_context_def_lookup, "ly:context-def-lookup", " @samp{property-ops}, @samp{context-name}, @samp{group-type}.") { LY_ASSERT_SMOB (Context_def, def, 1); - Context_def *cd = Context_def::unsmob (def); + Context_def *cd = unsmob (def); LY_ASSERT_TYPE (ly_is_symbol, sym, 2); SCM res = cd->lookup (sym); @@ -421,9 +419,9 @@ LY_DEFINE (ly_context_def_modify, "ly:context-def-modify", LY_ASSERT_SMOB (Context_def, def, 1); LY_ASSERT_SMOB (Context_mod, mod, 2); - Context_def *cd = Context_def::unsmob (def)->clone (); + Context_def *cd = unsmob (def)->clone (); - for (SCM s = Context_mod::unsmob (mod)->get_mods (); + for (SCM s = unsmob (mod)->get_mods (); scm_is_pair (s); s = scm_cdr (s)) cd->add_context_mod (scm_car (s));