diff options
author | David Kastrup <dak@gnu.org> | 2014-09-29 19:39:22 +0200 |
---|---|---|
committer | David Kastrup <dak@gnu.org> | 2014-10-06 09:31:20 +0200 |
commit | f5e923a6ce8cebb7ef893c03ce56aa5e598002c9 (patch) | |
tree | 88085718f43d5b43130cc095adb8d4820f0469df | |
parent | 2558bbf111c416f0c7093f7f8a3129533310cf37 (diff) |
Issue4141/2: Use Xxx:is_smob instead of Xxx:unsmob when used in boolean contexts
This saves a memory access and comparison and leads to better code
even when unsmob is called afterwards anyway.
73 files changed, 172 insertions, 172 deletions
diff --git a/lily/accidental-placement.cc b/lily/accidental-placement.cc index edc176a520..c00c5574fe 100644 --- a/lily/accidental-placement.cc +++ b/lily/accidental-placement.cc @@ -87,7 +87,7 @@ Accidental_placement::split_accidentals (Grob *accs, { Grob *a = Grob::unsmob (scm_car (s)); - if (Grob::unsmob (a->get_object ("tie")) + if (Grob::is_smob (a->get_object ("tie")) && !to_boolean (a->get_property ("forced"))) break_reminder->push_back (a); else diff --git a/lily/ambitus-engraver.cc b/lily/ambitus-engraver.cc index 972ca2932c..f7b18b5901 100644 --- a/lily/ambitus-engraver.cc +++ b/lily/ambitus-engraver.cc @@ -143,7 +143,7 @@ Ambitus_engraver::acknowledge_note_head (Grob_info info) If the engraver is added to a percussion context, filter out unpitched note heads. */ - if (!Pitch::unsmob (p)) + if (!Pitch::is_smob (p)) return; Pitch pitch = *Pitch::unsmob (p); Drul_array<bool> expands = pitch_interval_.add_point (pitch); diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index 8c24ef86a3..a09fd04af3 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -141,7 +141,7 @@ Axis_group_engraver::process_acknowledged () for (vsize i = 0; i < elts_.size (); i++) { - if (!Grob::unsmob (elts_[i]->get_object ("axis-group-parent-Y"))) + if (!Grob::is_smob (elts_[i]->get_object ("axis-group-parent-Y"))) { if (staffline_->get_parent (Y_AXIS) && staffline_->get_parent (Y_AXIS) == elts_[i]) diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index e27ce099c5..7e8e1b8bb4 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -421,7 +421,7 @@ Axis_group_interface::combine_skylines (SCM smob) for (vsize i = 0; i < elements.size (); i++) { SCM skyline_scm = elements[i]->get_property ("vertical-skylines"); - if (Skyline_pair::unsmob (skyline_scm)) + if (Skyline_pair::is_smob (skyline_scm)) { Real offset = elements[i]->relative_coordinate (y_common, Y_AXIS); Skyline_pair other = *Skyline_pair::unsmob (skyline_scm); diff --git a/lily/bar-check-iterator.cc b/lily/bar-check-iterator.cc index 848736b8d4..79e346365d 100644 --- a/lily/bar-check-iterator.cc +++ b/lily/bar-check-iterator.cc @@ -73,7 +73,7 @@ Bar_check_iterator::process (Moment m) else { SCM lf = tr->get_property ("barCheckLastFail"); - if (Moment::unsmob (lf) + if (Moment::is_smob (lf) && *Moment::unsmob (lf) == *where) warn = false; else diff --git a/lily/beam-collision-engraver.cc b/lily/beam-collision-engraver.cc index dd03c7be0c..d2fde8419c 100644 --- a/lily/beam-collision-engraver.cc +++ b/lily/beam-collision-engraver.cc @@ -121,7 +121,7 @@ Beam_collision_engraver::finalize () { // Do not consider note heads attached to the beam. if (Stem::has_interface (covered_grob)) - if (Grob::unsmob (covered_grob->get_object ("beam"))) + if (Grob::is_smob (covered_grob->get_object ("beam"))) continue; if (Grob *stem = Grob::unsmob (covered_grob->get_object ("stem"))) diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index c73f91fbc8..ab98dd50bc 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -371,7 +371,7 @@ void Beam_scoring_problem::init_instance_variables (Grob *me, Drul_array<Real> y - my_y; Real factor = parameters_.STEM_COLLISION_FACTOR; - if (!Grob::unsmob (s->get_object ("beam"))) + if (!Grob::is_smob (s->get_object ("beam"))) factor = 1.0; add_collision (x, y, factor); } diff --git a/lily/book.cc b/lily/book.cc index 21fb405c85..a6750d78cb 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -240,7 +240,7 @@ Book::process_score (SCM s, Paper_book *output_paper_book, Output_def *layout) } } else if (Text_interface::is_markup_list (scm_car (s)) - || Page_marker::unsmob (scm_car (s))) + || Page_marker::is_smob (scm_car (s))) output_paper_book->add_score (scm_car (s)); else assert (0); diff --git a/lily/break-alignment-interface.cc b/lily/break-alignment-interface.cc index 1744c60214..f9993b0892 100644 --- a/lily/break-alignment-interface.cc +++ b/lily/break-alignment-interface.cc @@ -189,7 +189,7 @@ Break_alignment_interface::calc_positioning_done (SCM smob) sym_string = ly_symbol2string (rsym); string orig_string; - if (Grob::unsmob (l->get_property ("cause"))) + if (Grob::is_smob (l->get_property ("cause"))) orig_string = Grob::unsmob (l->get_property ("cause"))->name (); programming_error (to_string ("No spacing entry from %s to `%s'", diff --git a/lily/break-substitution.cc b/lily/break-substitution.cc index e0b0fadfcd..094411f7d1 100644 --- a/lily/break-substitution.cc +++ b/lily/break-substitution.cc @@ -101,7 +101,7 @@ do_break_substitution (SCM src) { again: - if (Grob::unsmob (src)) + if (Grob::is_smob (src)) { Grob *new_ptr = substitute_grob (Grob::unsmob (src)); return new_ptr ? new_ptr->self_scm () : SCM_UNDEFINED; @@ -408,7 +408,7 @@ Spanner::fast_substitute_grob_array (SCM sym, set_break_subsititution (l ? l->self_scm () : SCM_UNDEFINED); SCM newval = sc->internal_get_object (sym); - if (!Grob_array::unsmob (newval)) + if (!Grob_array::is_smob (newval)) { newval = Grob_array::make_array (); sc->set_object (sym, newval); @@ -511,7 +511,7 @@ Spanner::substitute_one_mutable_property (SCM sym, if (grob_array) { SCM newval = sc->internal_get_object (sym); - if (!Grob_array::unsmob (newval)) + if (!Grob_array::is_smob (newval)) { newval = Grob_array::make_array (); sc->set_object (sym, newval); diff --git a/lily/chord-name-engraver.cc b/lily/chord-name-engraver.cc index dba699c8f4..ded53c5534 100644 --- a/lily/chord-name-engraver.cc +++ b/lily/chord-name-engraver.cc @@ -96,7 +96,7 @@ Chord_name_engraver::process_music () { Stream_event *n = notes_[i]; SCM p = n->get_property ("pitch"); - if (!Pitch::unsmob (p)) + if (!Pitch::is_smob (p)) continue; if (n->get_property ("bass") == SCM_BOOL_T) diff --git a/lily/context-property.cc b/lily/context-property.cc index 7dba9d6e85..45b5d496c1 100644 --- a/lily/context-property.cc +++ b/lily/context-property.cc @@ -59,7 +59,7 @@ typecheck_grob (SCM symbol, SCM value) return typecheck_grob (symbol, upc->unpure_part ()) && typecheck_grob (symbol, upc->pure_part ()); return ly_is_procedure (value) - || Simple_closure::unsmob (value) + || Simple_closure::is_smob (value) || type_check_assignment (symbol, value, ly_symbol2scm ("backend-type?")); } diff --git a/lily/context.cc b/lily/context.cc index e43c10dc2a..3128f5955a 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -741,7 +741,7 @@ measure_length (Context const *context) { SCM l = context->get_property ("measureLength"); Rational length (1); - if (Moment::unsmob (l)) + if (Moment::is_smob (l)) length = Moment::unsmob (l)->main_part_; return length; } @@ -752,7 +752,7 @@ measure_position (Context const *context) SCM sm = context->get_property ("measurePosition"); Moment m = 0; - if (Moment::unsmob (sm)) + if (Moment::is_smob (sm)) { m = *Moment::unsmob (sm); diff --git a/lily/dots-engraver.cc b/lily/dots-engraver.cc index c8883e8d37..2efd2215b8 100644 --- a/lily/dots-engraver.cc +++ b/lily/dots-engraver.cc @@ -43,7 +43,7 @@ Dots_engraver::acknowledge_rhythmic_head (Grob_info gi) return; Grob *note = gi.grob (); - if (Grob::unsmob (note->get_object ("dot"))) + if (Grob::is_smob (note->get_object ("dot"))) return; Duration *dur = Duration::unsmob (cause->get_property ("duration")); diff --git a/lily/engraver-scheme.cc b/lily/engraver-scheme.cc index 5596a2f2f8..8bdea635db 100644 --- a/lily/engraver-scheme.cc +++ b/lily/engraver-scheme.cc @@ -27,7 +27,7 @@ LY_DEFINE (ly_engraver_make_grob, "ly:engraver-make-grob", " @var{cause} should either be another grob" " or a music event.") { - LY_ASSERT_TYPE (Engraver::unsmob, engraver, 1); + LY_ASSERT_SMOB (Engraver, engraver, 1); LY_ASSERT_TYPE (ly_is_symbol, grob_name, 2); LY_ASSERT_TYPE (ly_is_grob_cause, cause, 3); @@ -45,7 +45,7 @@ LY_DEFINE (ly_engraver_announce_end_grob, "ly:engraver-announce-end-grob", " @var{grob} being a grob. @var{cause} should either" " be another grob or a music event.") { - LY_ASSERT_TYPE (Engraver::unsmob, engraver, 1); + LY_ASSERT_SMOB (Engraver, engraver, 1); LY_ASSERT_SMOB (Grob, grob, 2); LY_ASSERT_TYPE (ly_is_grob_cause, cause, 3); diff --git a/lily/engraver.cc b/lily/engraver.cc index e6d3142b14..681c646f42 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -57,7 +57,7 @@ Engraver::make_grob_info (Grob *e, SCM cause) cause = m->to_event ()->unprotect (); } if (e->get_property ("cause") == SCM_EOL - && (Stream_event::unsmob (cause) || Grob::unsmob (cause))) + && (Stream_event::is_smob (cause) || Grob::is_smob (cause))) e->set_property ("cause", cause); return Grob_info (this, e); @@ -174,7 +174,7 @@ Engraver::internal_make_spanner (SCM x, SCM cause, char const *name, bool ly_is_grob_cause (SCM obj) { - return Grob::unsmob (obj) || Stream_event::unsmob (obj) || (obj == SCM_EOL); + return Grob::is_smob (obj) || Stream_event::is_smob (obj) || (obj == SCM_EOL); } #include "translator.icc" diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index 5e4241d531..f14b9d62d4 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -101,7 +101,7 @@ Fingering_engraver::make_script (Direction d, Stream_event *r, int i) junkme. */ SCM pitch = r->get_property ("pitch"); - if (Pitch::unsmob (pitch)) + if (Pitch::is_smob (pitch)) fingering->set_property ("pitch", pitch); /* diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc index 9cddf41b74..2d8f6be8e4 100644 --- a/lily/function-documentation.cc +++ b/lily/function-documentation.cc @@ -103,15 +103,15 @@ void init_func_doc () { ly_add_type_predicate ((void *) &is_direction, "direction"); - ly_add_type_predicate ((void *) &Music_function::unsmob, "Music_function"); + ly_add_type_predicate ((void *) &Music_function::is_smob, "Music_function"); ly_add_type_predicate ((void *) &ly_is_port, "port"); ly_add_type_predicate ((void *) &ly_cheap_is_list, "list"); - ly_add_type_predicate ((void *) &Global_context::unsmob, "Global_context"); - ly_add_type_predicate ((void *) &Input::unsmob, "Input"); - ly_add_type_predicate ((void *) &Moment::unsmob, "Moment"); - ly_add_type_predicate ((void *) &Paper_score::unsmob, "Paper_score"); - ly_add_type_predicate ((void *) &Performance::unsmob, "Performance"); - ly_add_type_predicate ((void *) &Unpure_pure_container::unsmob, "unpure pure container"); + ly_add_type_predicate ((void *) &Global_context::is_smob, "Global_context"); + ly_add_type_predicate ((void *) &Input::is_smob, "Input"); + ly_add_type_predicate ((void *) &Moment::is_smob, "Moment"); + ly_add_type_predicate ((void *) &Paper_score::is_smob, "Paper_score"); + ly_add_type_predicate ((void *) &Performance::is_smob, "Performance"); + ly_add_type_predicate ((void *) &Unpure_pure_container::is_smob, "unpure pure container"); ly_add_type_predicate ((void *) &is_axis, "axis"); ly_add_type_predicate ((void *) &is_number_pair, "number pair"); ly_add_type_predicate ((void *) &ly_is_list, "list"); @@ -124,10 +124,10 @@ init_func_doc () ly_add_type_predicate ((void *) &scm_is_rational, "rational"); ly_add_type_predicate ((void *) &scm_is_string, "string"); ly_add_type_predicate ((void *) &scm_is_vector, "vector"); - ly_add_type_predicate ((void *) &Item::unsmob, "Item"); - ly_add_type_predicate ((void *) &Music::unsmob, "Music"); - ly_add_type_predicate ((void *) &Spanner::unsmob, "Spanner"); - ly_add_type_predicate ((void *) &Stream_event::unsmob, "Stream_event"); + ly_add_type_predicate ((void *) &Item::is_smob, "Item"); + ly_add_type_predicate ((void *) &Music::is_smob, "Music"); + ly_add_type_predicate ((void *) &Spanner::is_smob, "Spanner"); + ly_add_type_predicate ((void *) &Stream_event::is_smob, "Stream_event"); } ADD_SCM_INIT_FUNC (func_doc, init_func_doc); diff --git a/lily/global-context-scheme.cc b/lily/global-context-scheme.cc index 7af3e4ed57..dc7ff6e560 100644 --- a/lily/global-context-scheme.cc +++ b/lily/global-context-scheme.cc @@ -36,7 +36,7 @@ LY_DEFINE (ly_format_output, "ly:format-output", { Global_context *g = dynamic_cast<Global_context *> (Context::unsmob (context)); - LY_ASSERT_TYPE (Global_context::unsmob, context, 1); + LY_ASSERT_SMOB (Global_context, context, 1); SCM output = g->get_output (); progress_indication ("\n"); @@ -53,7 +53,7 @@ LY_DEFINE (ly_make_global_translator, "ly:make-global-translator", " @var{global}. The translator group is returned.") { Global_context *g = dynamic_cast<Global_context *> (Context::unsmob (global)); - LY_ASSERT_TYPE (Global_context::unsmob, global, 1); + LY_ASSERT_SMOB (Global_context, global, 1); Translator_group *tg = new Translator_group (); tg->connect_to_context (g); @@ -87,7 +87,7 @@ LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression", " @var{ctx}. The context is returned in its final state.") { LY_ASSERT_SMOB (Music, mus, 1); - LY_ASSERT_TYPE (Global_context::unsmob, ctx, 2); + LY_ASSERT_SMOB (Global_context, ctx, 2); Music *music = Music::unsmob (mus); if (!music) diff --git a/lily/grob-closure.cc b/lily/grob-closure.cc index 03c68684c7..ee4d1b0407 100644 --- a/lily/grob-closure.cc +++ b/lily/grob-closure.cc @@ -33,13 +33,13 @@ add_offset_callback (Grob *g, SCM proc, Axis a) SCM data = g->get_property_data (axis_offset_symbol (a)); if (!scm_is_number (data) && !ly_is_procedure (data) - && !Simple_closure::unsmob (data)) + && !Simple_closure::is_smob (data)) { g->set_property (axis_offset_symbol (a), proc); return; } - if (ly_is_procedure (data) || Unpure_pure_container::unsmob (data)) + if (ly_is_procedure (data) || Unpure_pure_container::is_smob (data)) data = Simple_closure::make_smob (scm_list_1 (data)); else if (Simple_closure *sc = Simple_closure::unsmob (data)) data = sc->expression (); @@ -67,7 +67,7 @@ chain_callback (Grob *g, SCM proc, SCM sym) { SCM data = g->get_property_data (sym); - if (ly_is_procedure (data) || Unpure_pure_container::unsmob (data)) + if (ly_is_procedure (data) || Unpure_pure_container::is_smob (data)) data = Simple_closure::make_smob (scm_list_1 (data)); else if (Simple_closure *sc = Simple_closure::unsmob (data)) data = sc->expression (); diff --git a/lily/grob-info.cc b/lily/grob-info.cc index 3a90b8c896..419b7ff4fc 100644 --- a/lily/grob-info.cc +++ b/lily/grob-info.cc @@ -90,7 +90,7 @@ Stream_event * Grob_info::ultimate_event_cause () const { SCM cause = grob_->self_scm (); - while (Grob::unsmob (cause)) + while (Grob::is_smob (cause)) { cause = Grob::unsmob (cause)->get_property ("cause"); } diff --git a/lily/grob-property.cc b/lily/grob-property.cc index 2c099a256b..779f0e91cb 100644 --- a/lily/grob-property.cc +++ b/lily/grob-property.cc @@ -123,8 +123,8 @@ Grob::internal_set_value_on_alist (SCM *alist, SCM sym, SCM v) if (do_internal_type_checking_global) { if (!ly_is_procedure (v) - && !Simple_closure::unsmob (v) - && !Unpure_pure_container::unsmob (v) + && !Simple_closure::is_smob (v) + && !Unpure_pure_container::is_smob (v) && v != ly_symbol2scm ("calculation-in-progress")) type_check_assignment (sym, v, ly_symbol2scm ("backend-type?")); @@ -151,8 +151,8 @@ Grob::internal_get_property_data (SCM sym) const if (do_internal_type_checking_global && scm_is_pair (handle)) { SCM val = scm_cdr (handle); - if (!ly_is_procedure (val) && !Simple_closure::unsmob (val) - && !Unpure_pure_container::unsmob (val)) + if (!ly_is_procedure (val) && !Simple_closure::is_smob (val) + && !Unpure_pure_container::is_smob (val)) type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")); check_interfaces_for_property (this, sym); @@ -184,7 +184,7 @@ Grob::internal_get_property (SCM sym) const val = upc->unpure_part (); if (ly_is_procedure (val) - || Simple_closure::unsmob (val)) + || Simple_closure::is_smob (val)) { Grob *me = ((Grob *)this); val = me->try_callback_on_alist (&me->mutable_property_alist_, sym, val); @@ -304,8 +304,8 @@ Grob::internal_get_object (SCM sym) const { SCM val = scm_cdr (s); if (ly_is_procedure (val) - || Simple_closure::unsmob (val) - || Unpure_pure_container::unsmob (val)) + || Simple_closure::is_smob (val) + || Unpure_pure_container::is_smob (val)) { Grob *me = ((Grob *)this); val = me->try_callback_on_alist (&me->object_alist_, sym, val); diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc index 3c9d1bb241..8273061ebf 100644 --- a/lily/grob-scheme.cc +++ b/lily/grob-scheme.cc @@ -51,7 +51,7 @@ LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!", LY_ASSERT_TYPE (ly_is_symbol, sym, 2); if (!ly_is_procedure (val) - && !Simple_closure::unsmob (val) + && !Simple_closure::is_smob (val) && !type_check_assignment (sym, val, ly_symbol2scm ("backend-type?"))) error ("typecheck failed"); @@ -451,7 +451,7 @@ LY_DEFINE (ly_grob_chain_callback, "ly:grob-chain-callback", Grob *gr = Grob::unsmob (grob); LY_ASSERT_SMOB (Grob, grob, 1); - SCM_ASSERT_TYPE (ly_is_procedure (proc) || Unpure_pure_container::unsmob (proc), proc, SCM_ARG2, __FUNCTION__, "procedure or unpure pure container"); + SCM_ASSERT_TYPE (ly_is_procedure (proc) || Unpure_pure_container::is_smob (proc), proc, SCM_ARG2, __FUNCTION__, "procedure or unpure pure container"); LY_ASSERT_TYPE (ly_is_symbol, sym, 3); chain_callback (gr, proc, sym); diff --git a/lily/grob.cc b/lily/grob.cc index e4c1fd4a89..a41ac5d006 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -855,7 +855,7 @@ SCM Grob::pure_stencil_height (SCM smob, SCM /* beg */, SCM /* end */) { Grob *me = Grob::unsmob (smob); - if (Stencil::unsmob (me->get_property_data ("stencil"))) + if (Stencil::is_smob (me->get_property_data ("stencil"))) return grob_stencil_extent (me, Y_AXIS); return ly_interval2scm (Interval ()); diff --git a/lily/include/lily-guile-macros.hh b/lily/include/lily-guile-macros.hh index 1bdf9aa7bc..a858a0a2ed 100644 --- a/lily/include/lily-guile-macros.hh +++ b/lily/include/lily-guile-macros.hh @@ -216,6 +216,6 @@ void ly_check_name (const string &cxx, const string &fname); } \ } -#define LY_ASSERT_SMOB(klass, var, number) LY_ASSERT_TYPE(klass::unsmob, var, number) +#define LY_ASSERT_SMOB(klass, var, number) LY_ASSERT_TYPE(klass::is_smob, var, number) #endif /* LILY_GUILE_MACROS_HH */ diff --git a/lily/include/smobs.tcc b/lily/include/smobs.tcc index c2616b3216..eaec076de3 100644 --- a/lily/include/smobs.tcc +++ b/lily/include/smobs.tcc @@ -121,7 +121,7 @@ void Smob_base<Super>::init () fundoc); scm_c_export (Super::type_p_name_, NULL); } - ly_add_type_predicate ((void *) unsmob, smob_name_.c_str ()); + ly_add_type_predicate ((void *) is_smob, smob_name_.c_str ()); if (Super::smob_proc != 0) scm_set_smob_apply (smob_tag_, (scm_t_subr)Super::smob_proc, diff --git a/lily/input-scheme.cc b/lily/input-scheme.cc index f8bef3bda8..37b7524fd7 100644 --- a/lily/input-scheme.cc +++ b/lily/input-scheme.cc @@ -27,7 +27,7 @@ LY_DEFINE (ly_input_warning, "ly:input-warning", 2, 0, 1, (SCM sip, SCM msg, SCM { Input *ip = Input::unsmob (sip); - LY_ASSERT_TYPE (Input::unsmob, sip, 1); + LY_ASSERT_SMOB (Input, sip, 1); LY_ASSERT_TYPE (scm_is_string, msg, 2); msg = scm_simple_format (SCM_BOOL_F, msg, rest); @@ -45,7 +45,7 @@ LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 1, (SCM sip, SCM msg, SCM { Input *ip = Input::unsmob (sip); - LY_ASSERT_TYPE (Input::unsmob, sip, 1); + LY_ASSERT_SMOB (Input, sip, 1); LY_ASSERT_TYPE (scm_is_string, msg, 2); msg = scm_simple_format (SCM_BOOL_F, msg, rest); @@ -62,7 +62,7 @@ LY_DEFINE (ly_input_file_line_char_column, "Return input location in @var{sip} as" " @code{(file-name line char column)}.") { - LY_ASSERT_TYPE (Input::unsmob, sip, 1); + LY_ASSERT_SMOB (Input, sip, 1); Input *ip = Input::unsmob (sip); int l, ch, col, offset = 0; @@ -80,7 +80,7 @@ LY_DEFINE (ly_input_both_locations, " @code{(file-name first-line first-column last-line last-column)}.") { - LY_ASSERT_TYPE (Input::unsmob, sip, 1); + LY_ASSERT_SMOB (Input, sip, 1); Input *ip = Input::unsmob (sip); return scm_list_5 (ly_string2scm (ip->file_string ()), diff --git a/lily/item-scheme.cc b/lily/item-scheme.cc index 0887ac3d9a..58b98b29f5 100644 --- a/lily/item-scheme.cc +++ b/lily/item-scheme.cc @@ -35,7 +35,7 @@ LY_DEFINE (ly_item_break_dir, "ly:item-break-dir", " end of line, @code{0}@tie{}unbroken, and" " @code{1}@tie{}beginning of line.") { - LY_ASSERT_TYPE (Item::unsmob, it, 1); + LY_ASSERT_SMOB (Item, it, 1); Item *me = Item::unsmob (it); return scm_from_int (me->break_status_dir ()); } diff --git a/lily/lexer.ll b/lily/lexer.ll index f242158df7..63776c9a9c 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -1013,7 +1013,7 @@ Lily_lexer::scan_bare_word (const string &str) if (scm_is_pair (handle)) { yylval = scm_cdr (handle); - if (Pitch::unsmob (yylval)) + if (Pitch::is_smob (yylval)) return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH; else if (scm_is_symbol (yylval)) return DRUM_PITCH; @@ -1097,7 +1097,7 @@ Lily_lexer::eval_scm (SCM readerdata, Input hi, char extra_token) SCM v = scm_car (p); if (Music *m = Music::unsmob (v)) { - if (!Input::unsmob (m->get_property ("origin"))) + if (!Input::is_smob (m->get_property ("origin"))) m->set_spot (override_input (here_input ())); } @@ -1122,7 +1122,7 @@ Lily_lexer::eval_scm (SCM readerdata, Input hi, char extra_token) if (Music *m = Music::unsmob (sval)) { - if (!Input::unsmob (m->get_property ("origin"))) + if (!Input::is_smob (m->get_property ("origin"))) m->set_spot (override_input (here_input ())); } diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index c02143da4c..dac09f1cc1 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -123,7 +123,7 @@ Lily_lexer::Lily_lexer (Lily_lexer const &src, Lily_parser *parser, main_input_level_ = 0; extra_tokens_ = SCM_EOL; - if (Input::unsmob (override_input)) + if (Input::is_smob (override_input)) override_input_ = *Input::unsmob (override_input); smobify_self (); diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 8d653d0c16..c8a0525d66 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -191,7 +191,7 @@ calc_measure_duration_log (Grob *me, bool paranoid) { SCM sml = dynamic_cast<Spanner *> (me)->get_bound (LEFT) ->get_property ("measure-length"); - Rational ml = (Moment::unsmob (sml)) ? Moment::unsmob (sml)->main_part_ + Rational ml = (Moment::is_smob (sml)) ? Moment::unsmob (sml)->main_part_ : Rational (1); double measure_duration = ml.Rational::to_double (); bool force_round_up = to_boolean (scm_list_p (scm_member (scm_cons (scm_from_int64 (ml.numerator ()), diff --git a/lily/music-function-scheme.cc b/lily/music-function-scheme.cc index 016b96700d..3afb1099f0 100644 --- a/lily/music-function-scheme.cc +++ b/lily/music-function-scheme.cc @@ -4,7 +4,7 @@ LY_DEFINE (ly_music_function_extract, "ly:music-function-extract", 1, 0, 0, (SCM x), "Return the Scheme function inside@tie{}@var{x}.") { - LY_ASSERT_TYPE (Music_function::unsmob, x, 1); + LY_ASSERT_SMOB (Music_function, x, 1); return Music_function::unsmob (x)->get_function (); } @@ -13,7 +13,7 @@ LY_DEFINE (ly_music_function_signature, "ly:music-function-signature", 1, 0, 0, (SCM x), "Return the function signature inside@tie{}@var{x}.") { - LY_ASSERT_TYPE (Music_function::unsmob, x, 1); + LY_ASSERT_SMOB (Music_function, x, 1); return Music_function::unsmob (x)->get_signature (); } diff --git a/lily/music-scheme.cc b/lily/music-scheme.cc index 42b6b50950..ffd7c5cdd8 100644 --- a/lily/music-scheme.cc +++ b/lily/music-scheme.cc @@ -28,7 +28,7 @@ LY_DEFINE (ly_music_length, "ly:music-length", "Get the length of music expression @var{mus} and return" " it as a @code{Moment} object.") { - LY_ASSERT_TYPE (Music::unsmob, mus, 1); + LY_ASSERT_SMOB (Music, mus, 1); Music *sc = Music::unsmob (mus); return sc->get_length ().smobbed_copy (); } @@ -39,7 +39,7 @@ LY_DEFINE (ly_music_property, "ly:music-property", " @var{mus}. If no value is found, return @var{val} or" " @code{'()} if @var{val} is not specified.") { - LY_ASSERT_TYPE (Music::unsmob, mus, 1); + LY_ASSERT_SMOB (Music, mus, 1); return ly_prob_property (mus, sym, val); } @@ -48,7 +48,7 @@ LY_DEFINE (ly_music_set_property_x, "ly:music-set-property!", "Set property @var{sym} in music expression @var{mus} to" " @var{val}.") { - LY_ASSERT_TYPE (Music::unsmob, mus, 1); + LY_ASSERT_SMOB (Music, mus, 1); return ly_prob_set_property_x (mus, sym, val); } @@ -71,7 +71,7 @@ LY_DEFINE (ly_music_p, "ly:music?", 1, 0, 0, (SCM obj), "Is @var{obj} a music object?") { - return scm_from_bool (Music::unsmob (obj)); + return ly_bool2scm (Music::is_smob (obj)); } LY_DEFINE (ly_event_p, "ly:event?", @@ -92,7 +92,7 @@ LY_DEFINE (ly_music_mutable_properties, "ly:music-mutable-properties", " The immutable properties are not available, since they are" " constant and initialized by the @code{make-music} function.") { - LY_ASSERT_TYPE (Music::unsmob, mus, 1); + LY_ASSERT_SMOB (Music, mus, 1); Music *m = Music::unsmob (mus); return m->get_property_alist (true); } @@ -106,7 +106,7 @@ LY_DEFINE (ly_music_list_p, "ly:music-list?", while (scm_is_pair (lst)) { - if (!Music::unsmob (scm_car (lst))) + if (!Music::is_smob (scm_car (lst))) return SCM_BOOL_F; lst = scm_cdr (lst); } @@ -120,7 +120,7 @@ LY_DEFINE (ly_music_deep_copy, "ly:music-deep-copy", " @var{m} may be an arbitrary type; cons cells and music" " are copied recursively.") { - if (Music::unsmob (m)) + if (Music::is_smob (m)) return Music::unsmob (m)->clone ()->unprotect (); if (scm_is_pair (m)) { @@ -147,7 +147,7 @@ LY_DEFINE (ly_music_transpose, "ly:music-transpose", "Transpose @var{m} such that central@tie{}C is mapped" " to@tie{}@var{p}. Return@tie{}@var{m}.") { - LY_ASSERT_TYPE (Music::unsmob, m, 1); + LY_ASSERT_SMOB (Music, m, 1); LY_ASSERT_SMOB (Pitch, p, 2); Music *sc = Music::unsmob (m); @@ -165,8 +165,8 @@ LY_DEFINE (ly_music_compress, "ly:music-compress", 2, 0, 0, (SCM m, SCM factor), "Compress music object@tie{}@var{m} by moment @var{factor}.") { - LY_ASSERT_TYPE (Music::unsmob, m, 1); - LY_ASSERT_TYPE (Moment::unsmob, factor, 2); + LY_ASSERT_SMOB (Music, m, 1); + LY_ASSERT_SMOB (Moment, factor, 2); Music *sc = Music::unsmob (m); sc->compress (*Moment::unsmob (factor)); @@ -178,8 +178,8 @@ LY_DEFINE (ly_make_music_relative_x, "ly:make-music-relative!", "Make @var{music} relative to @var{pitch}," " return final pitch.") { - LY_ASSERT_TYPE (Music::unsmob, music, 1); - LY_ASSERT_TYPE (Pitch::unsmob, pitch, 2); + LY_ASSERT_SMOB (Music, music, 1); + LY_ASSERT_SMOB (Pitch, pitch, 2); Pitch start = *Pitch::unsmob (pitch); Music *m = Music::unsmob (music); @@ -193,7 +193,7 @@ LY_DEFINE (ly_music_duration_length, "ly:music-duration-length", 1, 0, 0, "Extract the duration field from @var{mus} and return the" " length.") { - LY_ASSERT_TYPE (Music::unsmob, mus, 1); + LY_ASSERT_SMOB (Music, mus, 1); Music *m = Music::unsmob (mus); Duration *d = Duration::unsmob (m->get_property ("duration")); @@ -211,7 +211,7 @@ LY_DEFINE (ly_music_duration_compress, "ly:music-duration-compress", 2, 0, 0, "Compress @var{mus} by factor @var{fact}, which is a" " @code{Moment}.") { - LY_ASSERT_TYPE (Music::unsmob, mus, 1); + LY_ASSERT_SMOB (Music, mus, 1); LY_ASSERT_SMOB (Moment, fact, 2); Music *m = Music::unsmob (mus); diff --git a/lily/music.cc b/lily/music.cc index c19c56a1ae..46376ee5ed 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -90,7 +90,7 @@ Moment Music::get_length () const { SCM lst = get_property ("length"); - if (Moment::unsmob (lst)) + if (Moment::is_smob (lst)) return *Moment::unsmob (lst); if (ly_is_procedure (length_callback_)) diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc index 3db7d7010c..e8612d13c0 100644 --- a/lily/new-fingering-engraver.cc +++ b/lily/new-fingering-engraver.cc @@ -281,10 +281,10 @@ New_fingering_engraver::position_scripts (SCM orientations, f->set_parent (ft.head_, Y_AXIS); f->set_property ("avoid-slur", ly_symbol2scm ("inside")); if (hordir == LEFT - && Grob::unsmob (ft.head_->get_object ("accidental-grob"))) + && Grob::is_smob (ft.head_->get_object ("accidental-grob"))) Side_position_interface::add_support (f, Grob::unsmob (ft.head_->get_object ("accidental-grob"))); - else if (Grob::unsmob (ft.head_->get_object ("dot"))) + else if (Grob::is_smob (ft.head_->get_object ("dot"))) Side_position_interface::add_support (f, Grob::unsmob (ft.head_->get_object ("dot"))); diff --git a/lily/note-column.cc b/lily/note-column.cc index dcca364e17..e8eb8012d5 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -43,7 +43,7 @@ using namespace std; bool Note_column::has_rests (Grob *me) { - return Grob::unsmob (me->get_object ("rest")); + return Grob::is_smob (me->get_object ("rest")); } bool @@ -141,7 +141,7 @@ Note_column::add_head (Grob *me, Grob *h) } else if (Note_head::has_interface (h)) { - if (Grob::unsmob (me->get_object ("rest"))) + if (Grob::is_smob (me->get_object ("rest"))) both = true; Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-heads"), h); } diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 1b46789e76..f2d2159f77 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -100,7 +100,7 @@ Note_heads_engraver::process_music () { SCM scm_tonic = get_property ("tonic"); Pitch tonic; - if (Pitch::unsmob (scm_tonic)) + if (Pitch::is_smob (scm_tonic)) tonic = *Pitch::unsmob (scm_tonic); unsigned int delta = (pit->get_notename () - tonic.get_notename () + 7) % 7; diff --git a/lily/note-performer.cc b/lily/note-performer.cc index 2ab1178472..cd9a3046cb 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -54,7 +54,7 @@ Note_performer::process_music () Pitch transposing; SCM prop = get_property ("instrumentTransposition"); - if (Pitch::unsmob (prop)) + if (Pitch::is_smob (prop)) transposing = *Pitch::unsmob (prop); for (vsize i = 0; i < note_evs_.size (); i++) diff --git a/lily/note-spacing-engraver.cc b/lily/note-spacing-engraver.cc index b3d60bb7bf..769b22b968 100644 --- a/lily/note-spacing-engraver.cc +++ b/lily/note-spacing-engraver.cc @@ -101,7 +101,7 @@ Note_spacing_engraver::finalize () Grob *last_spacing = last_spacings_[parent]; if (last_spacing - && !Grob_array::unsmob (last_spacing->get_object ("right-items"))) + && !Grob_array::is_smob (last_spacing->get_object ("right-items"))) { Grob *col = Grob::unsmob (get_property ("currentCommandColumn")); diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc index 471a5be7c1..780dd4dfa4 100644 --- a/lily/page-layout-problem.cc +++ b/lily/page-layout-problem.cc @@ -297,7 +297,7 @@ Page_layout_problem::add_footnotes_to_lines (SCM lines, int counter, Paper_book in_text_stencil = Text_interface::interpret_markup (layout, props, in_text_annotation); - if (!Stencil::unsmob (in_text_stencil)) + if (!Stencil::is_smob (in_text_stencil)) in_text_stencil = SCM_EOL; annotation.translate_axis ((footnote_stencil.extent (Y_AXIS)[UP] + number_raise @@ -433,7 +433,7 @@ Page_layout_problem::Page_layout_problem (Paper_book *pb, SCM page_scm, SCM syst markup_markup_spacing = paper->c_variable ("markup-markup-spacing"); last_bottom_spacing = paper->c_variable ("last-bottom-spacing"); top_system_spacing = paper->c_variable ("top-system-spacing"); - if (scm_is_pair (systems) && Prob::unsmob (scm_car (systems))) + if (scm_is_pair (systems) && Prob::is_smob (scm_car (systems))) top_system_spacing = paper->c_variable ("top-markup-spacing"); // Note: the page height here does _not_ reserve space for headers and diff --git a/lily/paper-book.cc b/lily/paper-book.cc index f1423ef3b6..9cf318416c 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -285,7 +285,7 @@ Paper_book::book_title () paper_->self_scm (), scopes); - if (Stencil::unsmob (tit)) + if (Stencil::is_smob (tit)) title = *Stencil::unsmob (tit); if (!title.is_empty ()) @@ -314,7 +314,7 @@ Paper_book::score_title (SCM header) paper_->self_scm (), scopes); - if (Stencil::unsmob (tit)) + if (Stencil::is_smob (tit)) title = *Stencil::unsmob (tit); if (!title.is_empty ()) @@ -474,7 +474,7 @@ Paper_book::get_system_specs () if (scm_is_pair (system_specs)) set_system_penalty (scm_car (system_specs), header); - if (Prob::unsmob (title)) + if (Prob::is_smob (title)) { system_specs = scm_cons (title, system_specs); Prob::unsmob (title)->unprotect (); diff --git a/lily/paper-column-engraver.cc b/lily/paper-column-engraver.cc index 97884e2643..e25e83510d 100644 --- a/lily/paper-column-engraver.cc +++ b/lily/paper-column-engraver.cc @@ -239,7 +239,7 @@ Paper_column_engraver::stop_translation_timestep () if (!elem->get_parent (X_AXIS)) elem->set_parent (col, X_AXIS); - if (!Grob::unsmob (elem->get_object ("axis-group-parent-X"))) + if (!Grob::is_smob (elem->get_object ("axis-group-parent-X"))) elem->set_object ("axis-group-parent-X", col->self_scm ()); if (Accidental_placement::has_interface (elem) @@ -279,7 +279,7 @@ Paper_column_engraver::stop_translation_timestep () SCM mpos = get_property ("measurePosition"); SCM barnum = get_property ("internalBarNumber"); - if (Moment::unsmob (mpos) + if (Moment::is_smob (mpos) && scm_is_integer (barnum)) { SCM where = scm_cons (barnum, diff --git a/lily/paper-column.cc b/lily/paper-column.cc index c6f8f0d742..f6e26ec6a1 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -288,7 +288,7 @@ Paper_column::print (SCM p) scm_is_pair (s); s = scm_cdr (s)) { Spring *sp = Spring::unsmob (scm_caar (s)); - if (!Grob::unsmob (scm_cdar (s)) + if (!Grob::is_smob (scm_cdar (s)) || !Grob::unsmob (scm_cdar (s))->get_system ()) continue; diff --git a/lily/paper-score-scheme.cc b/lily/paper-score-scheme.cc index 081ff686ae..40ea72fd2f 100644 --- a/lily/paper-score-scheme.cc +++ b/lily/paper-score-scheme.cc @@ -25,7 +25,7 @@ LY_DEFINE (ly_paper_score_paper_systems, "ly:paper-score-paper-systems", "Return vector of @code{paper_system} objects from" " @var{paper-score}.") { - LY_ASSERT_TYPE (Paper_score::unsmob, paper_score, 1); + LY_ASSERT_SMOB (Paper_score, paper_score, 1); Paper_score *pscore = dynamic_cast<Paper_score *> (Music_output::unsmob (paper_score)); return pscore->get_paper_systems (); diff --git a/lily/parser.yy b/lily/parser.yy index 388ce46e51..9b67e65193 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -444,7 +444,7 @@ toplevel_expression: { SCM proc = parser->lexer_->lookup_identifier ("toplevel-text-handler"); scm_call_2 (proc, parser->self_scm (), out); - } else if (Score::unsmob ($1)) + } else if (Score::is_smob ($1)) { SCM proc = parser->lexer_->lookup_identifier ("toplevel-score-handler"); scm_call_2 (proc, parser->self_scm (), $1); @@ -583,9 +583,9 @@ embedded_lilypond: | multiplied_duration | music_embedded music_embedded music_list { $3 = scm_reverse_x ($3, SCM_EOL); - if (Music::unsmob ($2)) + if (Music::is_smob ($2)) $3 = scm_cons ($2, $3); - if (Music::unsmob ($1)) + if (Music::is_smob ($1)) $3 = scm_cons ($1, $3); $$ = MAKE_SYNTAX ("sequential-music", @$, $3); } @@ -747,7 +747,7 @@ context_def_spec_body: $$ = Context_def::make_scm (); td = Context_def::unsmob ($$); } - if (Music::unsmob ($2)) { + if (Music::is_smob ($2)) { SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler"); $2 = scm_call_2 (proc, parser->self_scm (), $2); } @@ -828,7 +828,7 @@ book_body: { SCM proc = parser->lexer_->lookup_identifier ("book-text-handler"); scm_call_2 (proc, $1, out); - } else if (Score::unsmob ($2)) + } else if (Score::is_smob ($2)) { SCM proc = parser->lexer_->lookup_identifier ("book-score-handler"); scm_call_2 (proc, $1, $2); @@ -909,7 +909,7 @@ bookpart_body: { SCM proc = parser->lexer_->lookup_identifier ("bookpart-text-handler"); scm_call_2 (proc, $1, out); - } else if (Score::unsmob ($2)) + } else if (Score::is_smob ($2)) { SCM proc = parser->lexer_->lookup_identifier ("bookpart-score-handler"); scm_call_2 (proc, $1, $2); @@ -950,7 +950,7 @@ score_block: score_body: score_items { - if (!Score::unsmob ($1)) { + if (!Score::is_smob ($1)) { parser->parser_error (@1, _("Missing music in \\score")); $$ = (new Score)->unprotect (); if (scm_is_pair ($1) && ly_is_module (scm_car ($1))) @@ -992,12 +992,12 @@ score_items: od = 0; $2 = SCM_UNSPECIFIED; } - } else if (!Score::unsmob ($$)) { - if (Music::unsmob ($2)) { + } else if (!Score::is_smob ($$)) { + if (Music::is_smob ($2)) { SCM scorify = ly_lily_module_constant ("scorify-music"); $2 = scm_call_2 (scorify, $2, parser->self_scm ()); } - if (Score::unsmob ($2)) + if (Score::is_smob ($2)) { $$ = $2; $2 = SCM_UNSPECIFIED; @@ -1137,10 +1137,10 @@ output_def_body: } else $1 = scm_car ($1); } - if (Context_def::unsmob ($2)) + if (Context_def::is_smob ($2)) assign_context_def (Output_def::unsmob ($1), $2); // Seems unlikely, but let's be complete: - else if (Music::unsmob ($2)) + else if (Music::is_smob ($2)) { SCM proc = parser->lexer_->lookup_identifier ("output-def-music-handler"); @@ -1165,7 +1165,7 @@ output_def_body: } music_or_context_def { parser->lexer_->pop_state (); - if (Context_def::unsmob ($3)) + if (Context_def::is_smob ($3)) assign_context_def (Output_def::unsmob ($1), $3); else { @@ -1201,7 +1201,7 @@ music_list: $$ = SCM_EOL; } | music_list music_embedded { - if (Music::unsmob ($2)) + if (Music::is_smob ($2)) $$ = scm_cons ($2, $1); } | music_list error { @@ -1229,7 +1229,7 @@ pitch_as_music: pitch_or_music { $$ = make_music_from_simple (parser, @1, $1); - if (!Music::unsmob ($$)) + if (!Music::is_smob ($$)) { parser->parser_error (@1, _ ("music expected")); $$ = MAKE_SYNTAX ("void-music", @$); @@ -1351,11 +1351,11 @@ context_modification: } | WITH context_modification_arg { - if (Music::unsmob ($2)) { + if (Music::is_smob ($2)) { SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler"); $2 = scm_call_2 (proc, parser->self_scm (), $2); } - if (Context_mod::unsmob ($2)) + if (Context_mod::is_smob ($2)) $$ = $2; else { parser->parser_error (@2, _ ("not a context mod")); @@ -1395,11 +1395,11 @@ context_mod_list: | context_mod_list context_mod_arg { if (scm_is_eq ($2, SCM_UNSPECIFIED)) ; - else if (Music::unsmob ($2)) { + else if (Music::is_smob ($2)) { SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler"); $2 = scm_call_2 (proc, parser->self_scm (), $2); } - if (Context_mod::unsmob ($2)) + if (Context_mod::is_smob ($2)) Context_mod::unsmob ($$)->add_context_mods (Context_mod::unsmob ($2)->get_mods ()); else { @@ -3257,7 +3257,7 @@ pitch_or_music: if (!parser->lexer_->is_chord_state ()) parser->parser_error (@1, _ ("have to be in Chord mode for chords")); if (scm_is_pair ($2)) { - if (Pitch::unsmob ($1)) + if (Pitch::is_smob ($1)) $1 = make_chord_elements (@1, $1, parser->default_duration_.smobbed_copy (), @@ -3266,7 +3266,7 @@ pitch_or_music: SCM elts = ly_append2 ($1, scm_reverse_x ($2, SCM_EOL)); $$ = MAKE_SYNTAX ("event-chord", @1, elts); - } else if (!Pitch::unsmob ($1)) + } else if (!Pitch::is_smob ($1)) $$ = MAKE_SYNTAX ("event-chord", @1, $1); // A mere pitch drops through. } %prec ':' @@ -3709,7 +3709,7 @@ otherwise, we have to import music classes into the lexer. int Lily_lexer::try_special_identifiers (SCM *destination, SCM sid) { - if (Book::unsmob (sid)) { + if (Book::is_smob (sid)) { Book *book = Book::unsmob (sid)->clone (); *destination = book->self_scm (); book->unprotect (); @@ -3718,11 +3718,11 @@ Lily_lexer::try_special_identifiers (SCM *destination, SCM sid) } else if (scm_is_number (sid)) { *destination = sid; return NUMBER_IDENTIFIER; - } else if (Context_def::unsmob (sid)) + } else if (Context_def::is_smob (sid)) { *destination = Context_def::unsmob (sid)->clone ()->unprotect (); return SCM_IDENTIFIER; - } else if (Context_mod::unsmob (sid)) { + } else if (Context_mod::is_smob (sid)) { *destination = Context_mod::unsmob (sid)->smobbed_copy (); return CONTEXT_MOD_IDENTIFIER; } else if (Music *mus = Music::unsmob (sid)) { @@ -3731,16 +3731,16 @@ Lily_lexer::try_special_identifiers (SCM *destination, SCM sid) bool is_event = mus->is_mus_type ("post-event"); mus->unprotect (); return is_event ? EVENT_IDENTIFIER : MUSIC_IDENTIFIER; - } else if (Pitch::unsmob (sid)) { + } else if (Pitch::is_smob (sid)) { *destination = Pitch::unsmob (sid)->smobbed_copy (); return PITCH_IDENTIFIER; - } else if (Duration::unsmob (sid)) { + } else if (Duration::is_smob (sid)) { *destination = Duration::unsmob (sid)->smobbed_copy (); return DURATION_IDENTIFIER; - } else if (Output_def::unsmob (sid)) { + } else if (Output_def::is_smob (sid)) { *destination = Output_def::unsmob (sid)->clone ()->unprotect (); return SCM_IDENTIFIER; - } else if (Score::unsmob (sid)) { + } else if (Score::is_smob (sid)) { *destination = Score::unsmob (sid)->clone ()->unprotect (); return SCM_IDENTIFIER; } @@ -3877,7 +3877,7 @@ is_regular_identifier (SCM id, bool multiple) SCM make_music_from_simple (Lily_parser *parser, Input loc, SCM simple) { - if (Music::unsmob (simple)) + if (Music::is_smob (simple)) return simple; if (parser->lexer_->is_note_state ()) { if (scm_is_symbol (simple)) { @@ -3886,7 +3886,7 @@ make_music_from_simple (Lily_parser *parser, Input loc, SCM simple) n->set_property ("drum-type", simple); return n->unprotect (); } - if (Pitch::unsmob (simple)) { + if (Pitch::is_smob (simple)) { Music *n = MY_MAKE_MUSIC ("NoteEvent", loc); n->set_property ("duration", parser->default_duration_.smobbed_copy ()); n->set_property ("pitch", simple); @@ -3898,7 +3898,7 @@ make_music_from_simple (Lily_parser *parser, Input loc, SCM simple) return MAKE_SYNTAX ("lyric-event", loc, simple, parser->default_duration_.smobbed_copy ()); } else if (parser->lexer_->is_chord_state ()) { - if (Pitch::unsmob (simple)) + if (Pitch::is_smob (simple)) return MAKE_SYNTAX ("event-chord", loc, diff --git a/lily/performance-scheme.cc b/lily/performance-scheme.cc index 874f44038c..e1c31a4146 100644 --- a/lily/performance-scheme.cc +++ b/lily/performance-scheme.cc @@ -23,7 +23,7 @@ LY_DEFINE (ly_performance_write, "ly:performance-write", 2, 0, 0, (SCM performance, SCM filename), "Write @var{performance} to @var{filename}.") { - LY_ASSERT_TYPE (Performance::unsmob, performance, 1); + LY_ASSERT_SMOB (Performance, performance, 1); LY_ASSERT_TYPE (scm_is_string, filename, 2); Performance::unsmob (performance)->write_output (ly_scm2string (filename)); diff --git a/lily/pitched-trill-engraver.cc b/lily/pitched-trill-engraver.cc index 40f1fc9bd2..68897e2987 100644 --- a/lily/pitched-trill-engraver.cc +++ b/lily/pitched-trill-engraver.cc @@ -88,7 +88,7 @@ Pitched_trill_engraver::acknowledge_trill_spanner (Grob_info info) if (ev && ev->in_event_class ("trill-span-event") && to_dir (ev->get_property ("span-direction")) == START - && Pitch::unsmob (ev->get_property ("pitch"))) + && Pitch::is_smob (ev->get_property ("pitch"))) make_trill (ev); } diff --git a/lily/pointer-group-interface-scheme.cc b/lily/pointer-group-interface-scheme.cc index 930fe7175b..42ff535f54 100644 --- a/lily/pointer-group-interface-scheme.cc +++ b/lily/pointer-group-interface-scheme.cc @@ -24,9 +24,9 @@ LY_DEFINE (ly_pointer_group_interface__add_grob, "ly:pointer-group-interface::ad 3, 0, 0, (SCM grob, SCM sym, SCM grob_element), "Add @var{grob-element} to @var{grob}'s @var{sym} grob array.") { - LY_ASSERT_TYPE (Grob::unsmob, grob, 1); + LY_ASSERT_SMOB (Grob, grob, 1); LY_ASSERT_TYPE (ly_is_symbol, sym, 2); - LY_ASSERT_TYPE (Grob::unsmob, grob_element, 3); + LY_ASSERT_SMOB (Grob, grob_element, 3); Pointer_group_interface::add_grob (Grob::unsmob (grob), sym, diff --git a/lily/prob.cc b/lily/prob.cc index 490ae2f0c5..8829529b7a 100644 --- a/lily/prob.cc +++ b/lily/prob.cc @@ -62,7 +62,7 @@ Prob::equal_p (SCM sa, SCM sb) SCM aval = scm_cdar (aprop); SCM bval = scm_cdar (bprop); if (scm_caar (aprop) != scm_caar (bprop) - || (!(Input::unsmob (aval) && Input::unsmob (bval)) + || (!(Input::is_smob (aval) && Input::is_smob (bval)) && !to_boolean (scm_equal_p (aval, bval)))) return SCM_BOOL_F; diff --git a/lily/pure-from-neighbor-interface.cc b/lily/pure-from-neighbor-interface.cc index fc3f238e3b..a24c761480 100644 --- a/lily/pure-from-neighbor-interface.cc +++ b/lily/pure-from-neighbor-interface.cc @@ -42,7 +42,7 @@ Pure_from_neighbor_interface::calc_pure_relevant_grobs (SCM smob) new_elts.insert (new_elts.end (), elts.begin (), elts.end ()); SCM neighbors_scm = me->get_object ("neighbors"); - if (Grob_array::unsmob (neighbors_scm)) + if (Grob_array::is_smob (neighbors_scm)) { vector<Grob *> &arr = Grob_array::unsmob (neighbors_scm)->array_reference (); diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index 1944b537e1..d946f2964a 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -80,7 +80,7 @@ Scheme_hash_table::mark_smob () int Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state *) { - assert (unsmob (s)); + assert (is_smob (s)); scm_puts ("#<Scheme_hash_table ", p); Scheme_hash_table *me = (Scheme_hash_table *) SCM_CELL_WORD_1 (s); scm_display (me->hash_tab_, p); diff --git a/lily/score.cc b/lily/score.cc index 88d87e9aeb..6ebad7db9d 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -154,7 +154,7 @@ Score::book_rendering (Output_def *layoutbook, void Score::set_music (SCM music) { - if (Music::unsmob (music_)) + if (Music::is_smob (music_)) { Music::unsmob (music)->origin ()->error (_ ("already have music in score")); Music::unsmob (music_)->origin ()->error (_ ("this is the previous music")); diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index cb77eda02f..ee4b94570a 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -212,7 +212,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i pure, start, end); - if (Skyline_pair::unsmob (skyp)) + if (Skyline_pair::is_smob (skyp)) { // for spanner pure heights, we don't know horizontal spacing, // so a spanner can never have a meaningful x coordiante @@ -271,7 +271,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i start, end); - if (Skyline_pair::unsmob (sp)) + if (Skyline_pair::is_smob (sp)) { Real xc = pure && dynamic_cast<Spanner *> (e) ? e->get_parent (X_AXIS)->relative_coordinate (common[X_AXIS], X_AXIS) diff --git a/lily/simple-closure.cc b/lily/simple-closure.cc index a4204cddc4..74845f5859 100644 --- a/lily/simple-closure.cc +++ b/lily/simple-closure.cc @@ -50,7 +50,7 @@ evaluate_with_simple_closure (SCM delayed_argument, if (Simple_closure *sc = Simple_closure::unsmob (expr)) { SCM inside = sc->expression (); - SCM proc = !pure && Unpure_pure_container::unsmob (scm_car (inside)) + SCM proc = !pure && Unpure_pure_container::is_smob (scm_car (inside)) ? Unpure_pure_container::unsmob (scm_car (inside))->unpure_part () : scm_car (inside); SCM args = scm_cons (delayed_argument, @@ -66,10 +66,10 @@ evaluate_with_simple_closure (SCM delayed_argument, return expr; else if (scm_car (expr) == ly_symbol2scm ("quote")) return scm_cadr (expr); - else if (Unpure_pure_container::unsmob (scm_car (expr)) + else if (Unpure_pure_container::is_smob (scm_car (expr)) || ly_is_procedure (scm_car (expr))) { - SCM proc = !pure && Unpure_pure_container::unsmob (scm_car (expr)) + SCM proc = !pure && Unpure_pure_container::is_smob (scm_car (expr)) ? Unpure_pure_container::unsmob (scm_car (expr))->unpure_part () : scm_car (expr); SCM args = evaluate_args (delayed_argument, scm_cdr (expr), pure, start, end); diff --git a/lily/slur.cc b/lily/slur.cc index 9313437279..d0184b5ebc 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -219,7 +219,7 @@ Slur::replace_breakable_encompass_objects (Grob *me) } SCM encompass_scm = me->get_object ("encompass-objects"); - if (Grob_array::unsmob (encompass_scm)) + if (Grob_array::is_smob (encompass_scm)) { vector<Grob *> &arr = Grob_array::unsmob (encompass_scm)->array_reference (); diff --git a/lily/spaceable-grob.cc b/lily/spaceable-grob.cc index 0153e6d804..278e8dabea 100644 --- a/lily/spaceable-grob.cc +++ b/lily/spaceable-grob.cc @@ -86,7 +86,7 @@ Spaceable_grob::get_spring (Grob *this_col, Grob *next_col) { if (scm_is_pair (scm_car (s)) && Grob::unsmob (scm_cdar (s)) == next_col - && Spring::unsmob (scm_caar (s))) + && Spring::is_smob (scm_caar (s))) spring = Spring::unsmob (scm_caar (s)); } diff --git a/lily/spacing-basic.cc b/lily/spacing-basic.cc index 53b9de3a2c..282ceae729 100644 --- a/lily/spacing-basic.cc +++ b/lily/spacing-basic.cc @@ -111,7 +111,7 @@ Spacing_spanner::note_spacing (Grob * /* me */, Moment shortest_playing_len = 0; SCM s = lc->get_property ("shortest-playing-duration"); - if (Moment::unsmob (s)) + if (Moment::is_smob (s)) shortest_playing_len = *Moment::unsmob (s); if (! shortest_playing_len.to_bool ()) diff --git a/lily/spacing-determine-loose-columns.cc b/lily/spacing-determine-loose-columns.cc index efefddba89..9796a897ec 100644 --- a/lily/spacing-determine-loose-columns.cc +++ b/lily/spacing-determine-loose-columns.cc @@ -304,9 +304,9 @@ Spacing_spanner::set_implicit_neighbor_columns (vector<Grob *> const &cols) if (!Paper_column::is_breakable (it) && !Paper_column::is_musical (it)) continue; - if (i && !Grob::unsmob (cols[i]->get_object ("left-neighbor"))) + if (i && !Grob::is_smob (cols[i]->get_object ("left-neighbor"))) cols[i]->set_object ("left-neighbor", cols[i - 1]->self_scm ()); - if (i + 1 < cols.size () && !Grob::unsmob (cols[i]->get_object ("right-neighbor"))) + if (i + 1 < cols.size () && !Grob::is_smob (cols[i]->get_object ("right-neighbor"))) cols[i]->set_object ("right-neighbor", cols[i + 1]->self_scm ()); } } diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index b0d43ec8bb..510154cd84 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -204,7 +204,7 @@ Spacing_engraver::stop_translation_timestep () ->set_object ("spacing", spacing_->self_scm ()); SCM proportional = get_property ("proportionalNotationDuration"); - if (Moment::unsmob (proportional)) + if (Moment::is_smob (proportional)) { musical_column->set_property ("shortest-playing-duration", proportional); musical_column->set_property ("shortest-starter-duration", proportional); diff --git a/lily/spanner-scheme.cc b/lily/spanner-scheme.cc index 4c77ccc01a..cee8c535f0 100644 --- a/lily/spanner-scheme.cc +++ b/lily/spanner-scheme.cc @@ -26,7 +26,7 @@ LY_DEFINE (ly_spanner_bound, "ly:spanner-bound", "Get one of the bounds of @var{spanner}. @var{dir} is @w{@code{-1}}" " for left, and @code{1} for right.") { - LY_ASSERT_TYPE (Spanner::unsmob, spanner, 1); + LY_ASSERT_SMOB (Spanner, spanner, 1); LY_ASSERT_TYPE (is_direction, dir, 2); Item *bound = Spanner::unsmob (spanner)->get_bound (to_dir (dir)); return bound ? bound->self_scm () : SCM_EOL; @@ -37,9 +37,9 @@ LY_DEFINE (ly_spanner_set_bound_x, "ly:spanner-set-bound!", "Set grob @var{item} as bound in direction @var{dir} for" " @var{spanner}.") { - LY_ASSERT_TYPE (Spanner::unsmob, spanner, 1); + LY_ASSERT_SMOB (Spanner, spanner, 1); LY_ASSERT_TYPE (is_direction, dir, 2); - LY_ASSERT_TYPE (Item::unsmob, item, 3); + LY_ASSERT_SMOB (Item, item, 3); Spanner::unsmob (spanner)->set_bound (to_dir (dir), Item::unsmob (item)); return SCM_UNSPECIFIED; diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index 85204b09d6..bf69688a9c 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -173,7 +173,7 @@ void Stem_engraver::kill_unused_flags () { for (vsize i = 0; i < maybe_flags_.size (); i++) - if (Grob::unsmob (maybe_flags_[i]->get_parent (X_AXIS)->get_object ("beam"))) + if (Grob::is_smob (maybe_flags_[i]->get_parent (X_AXIS)->get_object ("beam"))) maybe_flags_[i]->suicide (); } diff --git a/lily/stem.cc b/lily/stem.cc index b5d9f829ac..5e828fa842 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -456,7 +456,7 @@ Stem::internal_calc_stem_end_position (Grob *me, bool calc_beam) /* Tremolo stuff. */ Grob *t_flag = Grob::unsmob (me->get_object ("tremolo-flag")); - if (t_flag && (!Grob::unsmob (me->get_object ("beam")) || !calc_beam)) + if (t_flag && (!Grob::is_smob (me->get_object ("beam")) || !calc_beam)) { /* Crude hack: add extra space if tremolo flag is there. @@ -724,7 +724,7 @@ Stem::internal_height (Grob *me, bool calc_beam) If there is a beam but no stem, slope calculations depend on this routine to return where the stem end /would/ be. */ - if (calc_beam && !beam && !Stencil::unsmob (me->get_property ("stencil"))) + if (calc_beam && !beam && !Stencil::is_smob (me->get_property ("stencil"))) return Interval (); Real y1 = robust_scm2double ((calc_beam @@ -837,7 +837,7 @@ SCM Stem::calc_length (SCM smob) { Grob *me = Grob::unsmob (smob); - if (Grob::unsmob (me->get_object ("beam"))) + if (Grob::is_smob (me->get_object ("beam"))) { me->programming_error ("ly:stem::calc-length called but will not be used for beamed stem."); return scm_from_double (0.0); diff --git a/lily/stream-event-scheme.cc b/lily/stream-event-scheme.cc index 7ac17dac40..52538d4742 100644 --- a/lily/stream-event-scheme.cc +++ b/lily/stream-event-scheme.cc @@ -23,7 +23,7 @@ LY_DEFINE (ly_stream_event_p, "ly:stream-event?", 1, 0, 0, (SCM obj), "Is @code{@var{obj}} a @code{Stream_event} object?") { - return scm_from_bool (Stream_event::unsmob (obj)); + return scm_from_bool (Stream_event::is_smob (obj)); } LY_DEFINE (ly_make_stream_event, "ly:make-stream-event", @@ -49,7 +49,7 @@ LY_DEFINE (ly_event_property, "ly:event-property", " If @var{sym} is undefined, return @var{val} or" " @code{'()} if @var{val} is not specified.") { - LY_ASSERT_TYPE (Stream_event::unsmob, sev, 1) + LY_ASSERT_SMOB (Stream_event, sev, 1) return ly_prob_property (sev, sym, val); } @@ -57,7 +57,7 @@ LY_DEFINE (ly_event_set_property_x, "ly:event-set-property!", 3, 0, 0, (SCM ev, SCM sym, SCM val), "Set property @var{sym} in event @var{ev} to @var{val}.") { - LY_ASSERT_TYPE (Stream_event::unsmob, ev, 1); + LY_ASSERT_SMOB (Stream_event, ev, 1); LY_ASSERT_TYPE (ly_is_symbol, sym, 2); return ly_prob_set_property_x (ev, sym, val); diff --git a/lily/stream-event.cc b/lily/stream-event.cc index e17d6c711b..95dc13f16e 100644 --- a/lily/stream-event.cc +++ b/lily/stream-event.cc @@ -86,8 +86,8 @@ Stream_event::make_transposable () SCM prop = scm_car (entry); SCM val = scm_cdr (entry); - if ((Pitch::unsmob (val) - || (prop == ly_symbol2scm ("element") && Music::unsmob (val)) + if ((Pitch::is_smob (val) + || (prop == ly_symbol2scm ("element") && Music::is_smob (val)) || (prop == ly_symbol2scm ("elements") && scm_is_pair (val)) || (prop == ly_symbol2scm ("pitch-alist") && scm_is_pair (val))) && scm_is_false (scm_assq (prop, mutable_property_alist_))) diff --git a/lily/tempo-performer.cc b/lily/tempo-performer.cc index 410b0b6a41..01ecb4c3a0 100644 --- a/lily/tempo-performer.cc +++ b/lily/tempo-performer.cc @@ -61,7 +61,7 @@ void Tempo_performer::process_music () { SCM w = get_property ("tempoWholesPerMinute"); - if (Moment::unsmob (w) + if (Moment::is_smob (w) && !ly_is_equal (w, last_tempo_)) { Rational r = Moment::unsmob (w)->main_part_; diff --git a/lily/tie.cc b/lily/tie.cc index b2a138e1a6..8a93da7227 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -161,7 +161,7 @@ Tie::calc_direction (SCM smob) Grob *yparent = me->get_parent (Y_AXIS); if ((Tie_column::has_interface (yparent) || Semi_tie_column::has_interface (yparent)) - && Grob_array::unsmob (yparent->get_object ("ties")) + && Grob_array::is_smob (yparent->get_object ("ties")) // && Grob_array::unsmob (yparent->get_object ("ties"))->size () > 1 ) { @@ -223,7 +223,7 @@ Tie::calc_control_points (SCM smob) Grob *yparent = me->get_parent (Y_AXIS); if ((Tie_column::has_interface (yparent) || Semi_tie_column::has_interface (yparent)) - && Grob_array::unsmob (yparent->get_object ("ties"))) + && Grob_array::is_smob (yparent->get_object ("ties"))) { extract_grob_set (yparent, "ties", ties); if (me->original () && ties.size () == 1 diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 4930d35d03..e5b8f98c84 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -78,7 +78,7 @@ Timing_translator::initialize () SCM measureLength = timing->get_property ("measureLength"); - if (!Moment::unsmob (measureLength)) + if (!Moment::is_smob (measureLength)) { measureLength = Moment (ly_scm2rational @@ -115,7 +115,7 @@ Timing_translator::initialize () context ()->set_property ("beamExceptions", beamExceptions); SCM baseMoment = timing->get_property ("baseMoment"); - if (!Moment::unsmob (baseMoment)) + if (!Moment::is_smob (baseMoment)) { baseMoment = Moment (ly_scm2rational @@ -147,7 +147,7 @@ Rational Timing_translator::measure_length () const { SCM l = get_property ("measureLength"); - if (Moment::unsmob (l)) + if (Moment::is_smob (l)) return Moment::unsmob (l)->main_part_; else return Rational (1); @@ -181,7 +181,7 @@ Timing_translator::start_translation_timestep () Moment measposp; SCM s = get_property ("measurePosition"); - if (Moment::unsmob (s)) + if (Moment::is_smob (s)) measposp = *Moment::unsmob (s); else { diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 5f5e12aeba..111b61f138 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -101,7 +101,7 @@ filter_performers (SCM ell) SCM *tail = ℓ for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p)) { - if (Performer::unsmob (scm_car (*tail))) + if (Performer::is_smob (scm_car (*tail))) *tail = scm_cdr (*tail); else tail = SCM_CDRLOC (*tail); @@ -115,7 +115,7 @@ filter_engravers (SCM ell) SCM *tail = ℓ for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p)) { - if (Engraver::unsmob (scm_car (*tail))) + if (Engraver::is_smob (scm_car (*tail))) *tail = scm_cdr (*tail); else tail = SCM_CDRLOC (*tail); diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 0eca57010c..188496c0dd 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -651,7 +651,7 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy) // assume that if a script is avoiding slurs, it should not get placed // under a tuplet bracket - if (Grob::unsmob (scripts[i]->get_object ("slur"))) + if (Grob::is_smob (scripts[i]->get_object ("slur"))) continue; Interval script_x (scripts[i]->extent (commonx, X_AXIS)); diff --git a/lily/unfolded-repeat-iterator.cc b/lily/unfolded-repeat-iterator.cc index 7163027ede..b9872e9f36 100644 --- a/lily/unfolded-repeat-iterator.cc +++ b/lily/unfolded-repeat-iterator.cc @@ -42,7 +42,7 @@ Unfolded_repeat_iterator::get_music_list () const for (int i = 0; i < rep_count; i++) { - if (Music::unsmob (body)) + if (Music::is_smob (body)) *tail = scm_cons (body, SCM_EOL); tail = SCM_CDRLOC (*tail); diff --git a/lily/unpure-pure-container.cc b/lily/unpure-pure-container.cc index 5d5fe38235..4c07e31fd2 100644 --- a/lily/unpure-pure-container.cc +++ b/lily/unpure-pure-container.cc @@ -61,7 +61,7 @@ LY_DEFINE (ly_unpure_pure_container_unpure_part, "ly:unpure-pure-container-unpur 1, 0, 0, (SCM pc), "Return the unpure part of @var{pc}.") { - LY_ASSERT_TYPE (Unpure_pure_container::unsmob, pc, 1); + LY_ASSERT_SMOB (Unpure_pure_container, pc, 1); return Unpure_pure_container::unsmob (pc)->unpure_part (); } @@ -69,7 +69,7 @@ LY_DEFINE (ly_unpure_pure_container_pure_part, "ly:unpure-pure-container-pure-pa 1, 0, 0, (SCM pc), "Return the pure part of @var{pc}.") { - LY_ASSERT_TYPE (Unpure_pure_container::unsmob, pc, 1); + LY_ASSERT_SMOB (Unpure_pure_container, pc, 1); return Unpure_pure_container::unsmob (pc)->pure_part (); } diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index 2a7ee0eac6..62968c13e4 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -182,7 +182,7 @@ Vertical_align_engraver::acknowledge_axis_group (Grob_info i) else if (qualifies (i)) { Pointer_group_interface::add_grob (valign_, ly_symbol2scm ("elements"), i.grob ()); - if (!Grob::unsmob (i.grob ()->get_object ("staff-grouper"))) + if (!Grob::is_smob (i.grob ()->get_object ("staff-grouper"))) i.grob ()->set_object ("staff-grouper", valign_->self_scm ()); } } diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index f92d8f968f..7e7e65cb04 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -99,7 +99,7 @@ Volta_engraver::process_music () SCM l (get_property ("voltaSpannerDuration")); Moment now = now_mom (); - bool early_stop = Moment::unsmob (l) + bool early_stop = Moment::is_smob (l) && *Moment::unsmob (l) <= now - started_mom_; end = end || early_stop; |