From 08da6e274ea516076699e8e9bbdd48e5919cb526 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 12 Apr 2004 14:35:20 +0000 Subject: [PATCH] * lily/include/lily-guile.hh: is_x -> ly_c_X_p naming. * lily/include/context.hh (class Context): make members protected. (children_contexts): new accessor function. * lily/include/context.hh (class Context): make daddy_context_ private. * lily/lyric-engraver.cc (get_voice_to_lyrics): recursively go higher for finding Voice. (backportme) * lily/include/context.hh (class Context): remove find_context_below() as a method. --- lily/accidental-engraver.cc | 8 ++++---- lily/align-interface.cc | 8 ++++---- lily/ambitus.cc | 4 ++-- lily/bar-line.cc | 2 +- lily/bar-number-engraver.cc | 2 +- lily/beam-quanting.cc | 2 +- lily/beam.cc | 16 ++++++++-------- lily/chord-name-engraver.cc | 2 +- lily/clef-engraver.cc | 4 ++-- lily/cluster-engraver.cc | 2 +- lily/completion-note-heads-engraver.cc | 2 +- lily/context.cc | 8 +++++++- lily/custos-engraver.cc | 2 +- lily/dots.cc | 2 +- lily/duration.cc | 6 +++--- lily/dynamic-engraver.cc | 2 +- lily/dynamic-performer.cc | 6 +++--- lily/engraver-group-engraver.cc | 2 +- lily/engraver.cc | 4 +--- lily/event.cc | 4 ++-- lily/fingering-engraver.cc | 2 +- lily/font-metric.cc | 2 +- lily/font-size-engraver.cc | 2 +- lily/gourlay-breaking.cc | 2 +- lily/grob-scheme.cc | 2 +- lily/include/context.hh | 15 ++++++++------- lily/include/lily-guile.hh | 4 ++-- lily/key-signature-interface.cc | 2 +- lily/lily-guile.cc | 14 +++++++------- lily/line-interface.cc | 2 +- lily/lookup.cc | 6 +++--- lily/mark-engraver.cc | 4 ++-- lily/multi-measure-rest-engraver.cc | 2 +- lily/multi-measure-rest.cc | 4 ++-- lily/note-collision.cc | 4 ++-- lily/note-column.cc | 6 +++--- lily/note-head.cc | 2 +- lily/note-heads-engraver.cc | 2 +- lily/paper-book.cc | 8 ++++---- lily/parser.yy | 6 +++--- lily/performer-group-performer.cc | 2 +- lily/pitch-squash-engraver.cc | 2 +- lily/rest-engraver.cc | 2 +- lily/rest.cc | 4 ++-- lily/rhythmic-head.cc | 2 +- lily/score-context.cc | 8 ++++---- lily/score-engraver.cc | 8 ++++---- lily/script-column.cc | 2 +- lily/self-aligment-interface.cc | 4 ++-- lily/side-position-interface.cc | 4 ++-- lily/simple-spacer.cc | 2 +- lily/slur.cc | 8 ++++---- lily/staff-symbol-referencer.cc | 2 +- lily/staff-symbol.cc | 4 ++-- lily/stem-engraver.cc | 6 +++--- lily/stem-tremolo.cc | 4 ++-- lily/stem.cc | 6 +++--- lily/stencil-scheme.cc | 12 ++++++------ lily/system.cc | 2 +- lily/tab-note-heads-engraver.cc | 2 +- lily/text-engraver.cc | 2 +- lily/timing-translator.cc | 2 +- lily/translator-group.cc | 2 +- lily/tuplet-bracket.cc | 8 ++++---- lily/virtual-font-metric.cc | 2 +- 65 files changed, 143 insertions(+), 138 deletions(-) diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index ef374b5014..73314fb4ea 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -135,16 +135,16 @@ number_accidentals_from_sig (bool *different, /* If an accidental was not found or the accidental was too old */ if (prev == SCM_BOOL_F || - (is_number (lazyness) && curbarnum_i > accbarnum_i + ly_scm2int (lazyness))) + (ly_c_number_p (lazyness) && curbarnum_i > accbarnum_i + ly_scm2int (lazyness))) prev = scm_assoc (scm_int2num (n), sig); SCM prev_acc = (prev == SCM_BOOL_F) ? scm_int2num (0) : ly_cdr (prev); - int p = is_number (prev_acc) ? ly_scm2int (prev_acc) : 0; + int p = ly_c_number_p (prev_acc) ? ly_scm2int (prev_acc) : 0; int num; - if (a == p && is_number (prev_acc)) + if (a == p && ly_c_number_p (prev_acc)) num = 0; else if ( (abs (a)get_property ("stacking-dir"); - Direction stacking_dir = is_number (d) ? to_dir (d) : CENTER; + Direction stacking_dir = ly_c_number_p (d) ? to_dir (d) : CENTER; if (!stacking_dir) stacking_dir = DOWN; @@ -124,7 +124,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) SCM d = me->get_property ("stacking-dir"); - Direction stacking_dir = is_number (d) ? to_dir (d) : CENTER; + Direction stacking_dir = ly_c_number_p (d) ? to_dir (d) : CENTER; if (!stacking_dir) stacking_dir = DOWN; @@ -216,7 +216,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) FIXME: uncommenting freaks out the Y-alignment of line-of-score. */ - if (is_number (align)) + if (ly_c_number_p (align)) center_offset = total.linear_combination (ly_scm2double (align)); for (int j = 0 ; j < all_grobs.size (); j++) @@ -253,7 +253,7 @@ find_fixed_alignment_parent (Grob *g) { while (g) { - if (is_number (g->get_property ("forced-distance"))) + if (ly_c_number_p (g->get_property ("forced-distance"))) return g; g = g->get_parent (Y_AXIS); diff --git a/lily/ambitus.cc b/lily/ambitus.cc index 30c1a9f281..eb586b3a8f 100644 --- a/lily/ambitus.cc +++ b/lily/ambitus.cc @@ -100,7 +100,7 @@ number_accidentals (SCM key_signature, Pitch *pitch, prev = scm_assoc (scm_int2num (notename), key_signature); SCM prev_acc = (prev == SCM_BOOL_F) ? scm_int2num (0) : ly_cdr (prev); - int sig_alteration = is_number (prev_acc) ? ly_scm2int (prev_acc) : 0; + int sig_alteration = ly_c_number_p (prev_acc) ? ly_scm2int (prev_acc) : 0; if (alteration == sig_alteration) // no accidental at all needed return 0; @@ -195,7 +195,7 @@ Ambitus::print (SCM smob) } SCM c0 = me->get_property ("c0-position"); - if (is_number (c0)) + if (ly_c_number_p (c0)) { p_min += ly_scm2int (c0); p_max += ly_scm2int (c0); diff --git a/lily/bar-line.cc b/lily/bar-line.cc index 6f51478f33..716c776d72 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -186,7 +186,7 @@ Bar_line::get_staff_bar_size (SCM smob) Grob*me = unsmob_grob (smob); Real ss = Staff_symbol_referencer::staff_space (me); SCM size = me->get_property ("bar-size"); - if (is_number (size)) + if (ly_c_number_p (size)) return scm_make_real (ly_scm2double (size)*ss); else if (Staff_symbol_referencer::get_staff_symbol (me)) { diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 931ca71890..4788428086 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -54,7 +54,7 @@ Bar_number_engraver::process_music () { SCM bn = get_property ("currentBarNumber"); SCM proc = get_property ("barNumberVisibility"); - if (is_number (bn) && ly_c_procedure_p (proc) + if (ly_c_number_p (bn) && ly_c_procedure_p (proc) && to_boolean (scm_call_1(proc, bn))) { create_items (); diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index 3a7503bcaa..3a6f5e9aaf 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -110,7 +110,7 @@ Beam::quanting (SCM smob) Real slt = Staff_symbol_referencer::line_thickness (me) / ss; SCM sdy = me->get_property ("least-squares-dy"); - Real dy_mus = is_number (sdy) ? ly_scm2double (sdy) : 0.0; + Real dy_mus = ly_c_number_p (sdy) ? ly_scm2double (sdy) : 0.0; Real straddle = 0.0; Real sit = (thickness - slt) / 2; diff --git a/lily/beam.cc b/lily/beam.cc index 6909c464fb..0ef6741fac 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -421,7 +421,7 @@ Beam::print (SCM grob) Stencil gapped; int gap_count = 0; - if (is_number (me->get_property ("gap-count"))) + if (ly_c_number_p (me->get_property ("gap-count"))) { gap_count = ly_scm2int (me->get_property ("gap-count")); gapped = Lookup::beam (dydx, w - 2 * gap_length, thick, blot); @@ -570,7 +570,7 @@ Beam::get_default_dir (Grob *me) scm_cons (scm_int2num (total[UP]), scm_int2num (total[DOWN]))); - if (is_number (s) && ly_scm2int (s)) + if (ly_c_number_p (s) && ly_scm2int (s)) return to_dir (s); /* If dir is not determined: get default */ @@ -666,7 +666,7 @@ void Beam::consider_auto_knees (Grob* me) { SCM scm = me->get_property ("auto-knee-gap"); - if (!is_number (scm)) + if (!ly_c_number_p (scm)) return ; Real threshold = ly_scm2double (scm); @@ -1101,7 +1101,7 @@ Beam::check_concave (SCM smob) */ bool is_concave1 = false; SCM gap = me->get_property ("concaveness-gap"); - if (is_number (gap)) + if (ly_c_number_p (gap)) { Real r1 = ly_scm2double (gap); Real dy = Stem::chord_start_y (stems.top ()) @@ -1138,7 +1138,7 @@ Beam::check_concave (SCM smob) Real concaveness2 = 0; SCM thresh = me->get_property ("concaveness-threshold"); Real r2 = infinity_f; - if (!is_concave1 && is_number (thresh)) + if (!is_concave1 && ly_c_number_p (thresh)) { r2 = ly_scm2double (thresh); @@ -1297,7 +1297,7 @@ Beam::set_stem_lengths (Grob *me) bool gap = false; Real thick =0.0; - if (is_number (me->get_property ("gap-count")) + if (ly_c_number_p (me->get_property ("gap-count")) &&ly_scm2int (me->get_property ("gap-count"))) { gap = true; @@ -1455,7 +1455,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis) Grob *rest = unsmob_grob (element_smob); Axis a = (Axis) ly_scm2int (axis); - if (is_number (rest->get_property ("staff-position"))) + if (ly_c_number_p (rest->get_property ("staff-position"))) return scm_int2num (0); assert (a == Y_AXIS); @@ -1472,7 +1472,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis) Drul_array pos (0, 0); SCM s = beam->get_property ("positions"); - if (ly_c_pair_p (s) && is_number (ly_car (s))) + if (ly_c_pair_p (s) && ly_c_number_p (ly_car (s))) pos = ly_scm2interval (s); Real staff_space = Staff_symbol_referencer::staff_space (rest); diff --git a/lily/chord-name-engraver.cc b/lily/chord-name-engraver.cc index c8ba1d2beb..152ca2fdb2 100644 --- a/lily/chord-name-engraver.cc +++ b/lily/chord-name-engraver.cc @@ -86,7 +86,7 @@ Chord_name_engraver::process_music () if (inversion_event) { SCM oct = inversion_event->get_property ("octavation"); - if (is_number (oct)) + if (ly_c_number_p (oct)) { Pitch *p = unsmob_pitch (inversion_event->get_property ("pitch")); int octavation = ly_scm2int (oct); diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 361ce607fc..670dd39b4d 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -92,11 +92,11 @@ Clef_engraver::create_clef () clef_ = c; SCM cpos = get_property ("clefPosition"); - if (is_number (cpos)) + if (ly_c_number_p (cpos)) Staff_symbol_referencer::set_position (clef_, ly_scm2int (cpos)); SCM oct = get_property ("clefOctavation"); - if (is_number (oct) && ly_scm2int (oct)) + if (ly_c_number_p (oct) && ly_scm2int (oct)) { Item * g = make_item ("OctavateEight"); diff --git a/lily/cluster-engraver.cc b/lily/cluster-engraver.cc index 52f14cdfba..391d3fbd13 100644 --- a/lily/cluster-engraver.cc +++ b/lily/cluster-engraver.cc @@ -82,7 +82,7 @@ Cluster_spanner_engraver::process_music () { SCM c0scm = get_property ("middleCPosition"); - int c0 = is_number (c0scm) ? ly_scm2int (c0scm) : 0; + int c0 = ly_c_number_p (c0scm) ? ly_scm2int (c0scm) : 0; int pmax = INT_MIN; int pmin = INT_MAX; diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index 16b9e61375..4c52d88ae4 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -245,7 +245,7 @@ Completion_heads_engraver::process_music () int pos = pit->steps (); SCM c0 = get_property ("middleCPosition"); - if (is_number (c0)) + if (ly_c_number_p (c0)) pos += ly_scm2int (c0); note->set_property ("staff-position", scm_int2num (pos)); diff --git a/lily/context.cc b/lily/context.cc index fc7a17ff1f..fedc490c83 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -412,7 +412,7 @@ IMPLEMENT_TYPE_P (Context,"ly:context?"); bool Context::try_music (Music* m) { - Translator* t = unsmob_translator (implementation_); + Translator* t = implementation (); if (!t) return false; @@ -442,3 +442,9 @@ Context::get_parent_context () const { return daddy_context_; } + +Translator_group* +Context::implementation () const +{ + return dynamic_cast (unsmob_translator (implementation_)); +} diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index 5b110886c3..86dac5847e 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -108,7 +108,7 @@ Custos_engraver::process_acknowledged_grobs () int p = pitches_[i].steps (); SCM c0 = get_property ("middleCPosition"); - if (is_number (c0)) + if (ly_c_number_p (c0)) p += ly_scm2int (c0); diff --git a/lily/dots.cc b/lily/dots.cc index d4ccf97b59..d324027a1a 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -24,7 +24,7 @@ Dots::print (SCM d) SCM c = sc->get_property ("dot-count"); - if (is_number (c)) + if (ly_c_number_p (c)) { Stencil d = Font_interface::get_default_font (sc)->find_by_name (String ("dots-dot")); Real dw = d.extent (X_AXIS).length (); diff --git a/lily/duration.cc b/lily/duration.cc index b1e2d7e746..3740b09f9a 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -172,7 +172,7 @@ LY_DEFINE (make_duration, "ly:make-duration", bool compress = false; if (num != SCM_UNDEFINED) { - SCM_ASSERT_TYPE (is_number (num), length, SCM_ARG3, __FUNCTION__, "integer"); + SCM_ASSERT_TYPE (ly_c_number_p (num), length, SCM_ARG3, __FUNCTION__, "integer"); compress = true; } else @@ -180,7 +180,7 @@ LY_DEFINE (make_duration, "ly:make-duration", if (den != SCM_UNDEFINED) { - SCM_ASSERT_TYPE (is_number (den), length, SCM_ARG4, __FUNCTION__, "integer"); + SCM_ASSERT_TYPE (ly_c_number_p (den), length, SCM_ARG4, __FUNCTION__, "integer"); compress = true; } else @@ -214,7 +214,7 @@ LY_DEFINE (ly_intlog2, "ly:intlog2", 1, 0, 0, (SCM d), "The 2-logarithm of 1/@var{d}.") { - SCM_ASSERT_TYPE (is_number (d), d, SCM_ARG1, __FUNCTION__, "integer"); + SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG1, __FUNCTION__, "integer"); int log = intlog2 (ly_scm2int (d)); return scm_int2num (log); } diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index c58de021c1..3c7dc854e4 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -414,7 +414,7 @@ Dynamic_engraver::acknowledge_grob (Grob_info i) DynamicText doesn't really have a script-priority field. */ - if (is_number (p) + if (ly_c_number_p (p) && ly_scm2int (p) < ly_scm2int (script_->get_property ("script-priority"))) { Side_position_interface::add_support (line_spanner_, i.grob_); diff --git a/lily/dynamic-performer.cc b/lily/dynamic-performer.cc index 53e8a5e0d4..257708de29 100644 --- a/lily/dynamic-performer.cc +++ b/lily/dynamic-performer.cc @@ -59,12 +59,12 @@ Dynamic_performer::create_audio_elements () */ SCM min = get_property ("midiMinimumVolume"); SCM max = get_property ("midiMaximumVolume"); - if (is_number (min) || is_number (max)) + if (ly_c_number_p (min) || ly_c_number_p (max)) { Interval iv (0, 1); - if (is_number (min)) + if (ly_c_number_p (min)) iv[MIN] = ly_scm2double (min); - if (is_number (max)) + if (ly_c_number_p (max)) iv[MAX] = ly_scm2double (max); volume = iv[MIN] + iv.length () * volume; } diff --git a/lily/engraver-group-engraver.cc b/lily/engraver-group-engraver.cc index 9b33ad9398..8a2d6da214 100644 --- a/lily/engraver-group-engraver.cc +++ b/lily/engraver-group-engraver.cc @@ -157,7 +157,7 @@ void recurse_down_engravers (Context * c, Engraver_method ptr, bool context_first) { Engraver_group_engraver * tg - = dynamic_cast (unsmob_translator (c->implementation_)); + = dynamic_cast (c->implementation ()); if (!context_first) diff --git a/lily/engraver.cc b/lily/engraver.cc index 4119670e7a..fa2e68479a 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -61,7 +61,6 @@ Engraver::typeset_grob (Grob*p) } - Engraver::Engraver () { } @@ -70,8 +69,7 @@ Engraver::Engraver () Score_engraver* Engraver::get_score_engraver () const { - SCM t = get_score_context ()->implementation_; - return dynamic_cast (unsmob_translator (t)); + return dynamic_cast (get_score_context ()->implementation ()); } diff --git a/lily/event.cc b/lily/event.cc index c52a0701af..1c1112379b 100644 --- a/lily/event.cc +++ b/lily/event.cc @@ -63,7 +63,7 @@ Event::to_relative_octave (Pitch last) new_pit = new_pit.to_relative_octave (last); SCM check = get_property ("absolute-octave"); - if (is_number (check) && + if (ly_c_number_p (check) && new_pit.get_octave () != ly_scm2int (check)) { Pitch expected_pit (ly_scm2int (check), @@ -160,7 +160,7 @@ LY_DEFINE (ly_transpose_key_alist, "ly:transpose-key-alist", newlist = scm_cons (scm_cons (key, scm_int2num (orig.get_alteration ())), newlist); } - else if (is_number (key)) + else if (ly_c_number_p (key)) { Pitch orig (0, ly_scm2int (key), ly_scm2int (alter)); orig = orig.transposed (*p); diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index 3b4b9dc6fb..a281bbdf77 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -105,7 +105,7 @@ Fingering_engraver::make_script (Direction d, Music *r, int i) // Hmm int priority = 200; SCM s = fingering->get_property ("script-priority"); - if (is_number (s)) + if (ly_c_number_p (s)) priority = ly_scm2int (s); /* See script-engraver.cc */ diff --git a/lily/font-metric.cc b/lily/font-metric.cc index 6e07465592..49462f8789 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -155,7 +155,7 @@ LY_DEFINE (ly_get_glyph, "ly:get-glyph", { Font_metric *fm = unsmob_metrics (font); SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric"); - SCM_ASSERT_TYPE (is_number (index), index, SCM_ARG2, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (ly_c_number_p (index), index, SCM_ARG2, __FUNCTION__, "number"); return fm->get_ascii_char_stencil (ly_scm2int (index)).smobbed_copy (); } diff --git a/lily/font-size-engraver.cc b/lily/font-size-engraver.cc index 96846d0d18..9e68c27676 100644 --- a/lily/font-size-engraver.cc +++ b/lily/font-size-engraver.cc @@ -36,7 +36,7 @@ Font_size_engraver::acknowledge_grob (Grob_info gi) if (gi.origin_trans_->get_parent_context () != get_parent_context ()) return ; - if (is_number (sz) && ly_scm2double (sz)) + if (ly_c_number_p (sz) && ly_scm2double (sz)) { Real font_size = ly_scm2double (sz); diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index c400471739..7657efec13 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -233,7 +233,7 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev, if (pc->original_) { SCM pen = pc->get_property ("penalty"); - if (is_number (pen) && fabs (ly_scm2double (pen)) < 10000) + if (ly_c_number_p (pen) && fabs (ly_scm2double (pen)) < 10000) { break_penalties += ly_scm2double (pen); } diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc index 80d468abe6..1557d3105b 100644 --- a/lily/grob-scheme.cc +++ b/lily/grob-scheme.cc @@ -169,7 +169,7 @@ LY_DEFINE (ly_grob_translate_axis_x, "ly:grob-translate-axis!", { Grob *me = unsmob_grob (g); SCM_ASSERT_TYPE (me, g, SCM_ARG1, __FUNCTION__, "grob"); - SCM_ASSERT_TYPE (is_number (d), d, SCM_ARG2, __FUNCTION__, "dimension"); + SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG2, __FUNCTION__, "dimension"); SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG3, __FUNCTION__, "axis"); me->translate_axis (ly_scm2double (d), Axis (ly_scm2int (a))); diff --git a/lily/include/context.hh b/lily/include/context.hh index 55a4671eaa..75c7e65ac6 100644 --- a/lily/include/context.hh +++ b/lily/include/context.hh @@ -22,6 +22,11 @@ class Context void terminate (); +private: + friend class Interpretation_context_handle; + int iterator_count_; + bool init_; + protected: Context * daddy_context_; SCM definition_; @@ -29,12 +34,14 @@ protected: SCM context_list_; SCM accepts_list_; SCM aliases_; + SCM implementation_; friend class Context_def; public: SCM children_contexts () const { return context_list_; } SCM default_child_context_name () const; - + Translator_group* implementation () const; + Context * get_parent_context () const; Context (); @@ -68,12 +75,6 @@ public: Music_output_def*) const; virtual Context *get_default_interpreter (); String id_string_; - - SCM implementation_; -private: - friend class Interpretation_context_handle; - int iterator_count_; - bool init_; }; /* diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index f9b1b2072c..cf0a60f691 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -191,10 +191,10 @@ inline SCM ly_assoc_front_x(SCM alist, SCM key, SCM val) return scm_acons(key, val, scm_assoc_remove_x (alist, key)); } inline bool ly_c_pair_p (SCM x) { return SCM_NFALSEP (scm_pair_p (x)); } -inline bool ly_c_symbol_pi (SCM x) { return SCM_SYMBOLP (x); } +inline bool ly_c_symbol_p (SCM x) { return SCM_SYMBOLP (x); } inline bool ly_c_boolean_p (SCM x) { return SCM_BOOLP (x); } inline bool ly_c_char_p (SCM x) { return SCM_CHARP (x); } -inline bool is_number (SCM x) { return SCM_NUMBERP (x); } +inline bool ly_c_number_p (SCM x) { return SCM_NUMBERP (x); } inline bool ly_c_string_p (SCM x) { return SCM_STRINGP (x); } inline bool ly_c_vector_p (SCM x) { return SCM_VECTORP (x); } inline bool ly_c_list_p (SCM x) { return SCM_NFALSEP (scm_list_p (x)); } diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index 0616dcffcb..4666d4982a 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -118,7 +118,7 @@ Key_signature_interface::print (SCM smob) SCM c0s = me->get_property ("c0-position"); int c0p = 0; - if (is_number (c0s)) + if (ly_c_number_p (c0s)) c0p = ly_scm2int (c0s); /* diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index e821369ac2..1c03bf92cb 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -187,7 +187,7 @@ LY_DEFINE (ly_dir_p, "ly:dir?", 1,0, 0, (SCM s), "@code{1}, where @code{-1} represents " "left or down and @code{1} represents right or up.") { - if (is_number (s)) + if (ly_c_number_p (s)) { int i = ly_scm2int (s); return (i>= -1 && i <= 1) ? SCM_BOOL_T : SCM_BOOL_F; @@ -198,7 +198,7 @@ LY_DEFINE (ly_dir_p, "ly:dir?", 1,0, 0, (SCM s), bool is_number_pair (SCM p) { - return ly_c_pair_p (p) && is_number (ly_car (p)) && is_number (ly_cdr (p)); + return ly_c_pair_p (p) && ly_c_number_p (ly_car (p)) && ly_c_number_p (ly_cdr (p)); } typedef void (*Void_fptr) (); @@ -244,7 +244,7 @@ unsigned int ly_scm_hash (SCM s) bool is_direction (SCM s) { - if (is_number (s)) + if (ly_c_number_p (s)) { int i = ly_scm2int (s); return i>= -1 && i <= 1; @@ -256,7 +256,7 @@ is_direction (SCM s) bool is_axis (SCM s) { - if (is_number (s)) + if (ly_c_number_p (s)) { int i = ly_scm2int (s); return i== 0 || i == 1; @@ -334,7 +334,7 @@ LY_DEFINE (ly_number2string, "ly:number->string", 1, 0, 0, (SCM s), "Convert @var{num} to a string without generating many decimals.") { - SCM_ASSERT_TYPE (is_number (s), s, SCM_ARG1, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (ly_c_number_p (s), s, SCM_ARG1, __FUNCTION__, "number"); char str[400]; // ugh. @@ -699,7 +699,7 @@ int_list_to_slice (SCM l) Slice s; s.set_empty (); for (; ly_c_pair_p (l); l = ly_cdr (l)) - if (is_number (ly_car (l))) + if (ly_c_number_p (ly_car (l))) s.add_point (ly_scm2int (ly_car (l))); return s; } @@ -719,7 +719,7 @@ robust_list_ref (int i, SCM l) Real robust_scm2double (SCM k, double x) { - if (is_number (k)) + if (ly_c_number_p (k)) x = ly_scm2double (k); return x; } diff --git a/lily/line-interface.cc b/lily/line-interface.cc index cbcf9b02ed..317df83495 100644 --- a/lily/line-interface.cc +++ b/lily/line-interface.cc @@ -73,7 +73,7 @@ Line_interface::line (Grob *me, Offset from, Offset to) SCM type = me->get_property ("style"); SCM dash_fraction = me->get_property ("dash-fraction"); - if (is_number (dash_fraction) || type == ly_symbol2scm ("dotted-line")) + if (ly_c_number_p (dash_fraction) || type == ly_symbol2scm ("dotted-line")) { Real fraction diff --git a/lily/lookup.cc b/lily/lookup.cc index 7be702385a..222d7ebd0f 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -710,8 +710,8 @@ LY_DEFINE (ly_bracket ,"ly:bracket", { SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG1, __FUNCTION__, "axis") ; SCM_ASSERT_TYPE (is_number_pair (iv), iv, SCM_ARG2, __FUNCTION__, "number pair") ; - SCM_ASSERT_TYPE (is_number (t), a, SCM_ARG3, __FUNCTION__, "number") ; - SCM_ASSERT_TYPE (is_number (p), a, SCM_ARG4, __FUNCTION__, "number") ; + SCM_ASSERT_TYPE (ly_c_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ; + SCM_ASSERT_TYPE (ly_c_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ; return Lookup::bracket ((Axis)ly_scm2int (a), ly_scm2interval (iv), @@ -732,7 +732,7 @@ LY_DEFINE (ly_filled_box ,"ly:round-filled-box", { SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG1, __FUNCTION__, "number pair") ; SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG2, __FUNCTION__, "number pair") ; - SCM_ASSERT_TYPE (is_number (blot), blot, SCM_ARG3, __FUNCTION__, "number") ; + SCM_ASSERT_TYPE (ly_c_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ; return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)), ly_scm2double (blot)).smobbed_copy (); diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index 18733b0527..a7e050d92c 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -115,7 +115,7 @@ Mark_engraver::process_music () if (!Text_item::markup_p (m) && ly_c_procedure_p (proc)) { - if (!is_number (m)) + if (!ly_c_number_p (m)) m = get_property ("rehearsalMark"); if (scm_integer_p (m) == SCM_BOOL_T @@ -127,7 +127,7 @@ Mark_engraver::process_music () scm_int2num (mark_count)); } - if (is_number (m)) + if (ly_c_number_p (m)) m = scm_call_2 (proc, m, get_parent_context ()->self_scm ()); else warning ("rehearsalMark does not have integer value."); diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index d33828dc1f..3971353441 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -263,7 +263,7 @@ Multi_measure_rest_engraver::start_translation_timestep () { SCM thres = get_property ("restNumberThreshold"); int t = 1; - if (is_number (thres)) + if (ly_c_number_p (thres)) t = ly_scm2int (thres); if (num <= t) diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 81a5d4013a..61bbf1f84d 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -102,7 +102,7 @@ Multi_measure_rest::print (SCM smob) int measures = 0; SCM m (me->get_property ("measure-count")); - if (is_number (m)) + if (ly_c_number_p (m)) { measures = ly_scm2int (m); } @@ -118,7 +118,7 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space) { int measures = 0; SCM m (me->get_property ("measure-count")); - if (is_number (m)) + if (ly_c_number_p (m)) { measures = ly_scm2int (m); } diff --git a/lily/note-collision.cc b/lily/note-collision.cc index a72e72cd90..2d7c595cf1 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -371,7 +371,7 @@ Note_collision_interface::automatic_shift (Grob *me, SCM sh = clashes[i]->get_property ("horizontal-shift"); - if (is_number (sh)) + if (ly_c_number_p (sh)) shift.push (ly_scm2int (sh)); else shift.push (0); @@ -457,7 +457,7 @@ Note_collision_interface::forced_shift (Grob *me) Grob * se = unsmob_grob (ly_car (s)); SCM force = se->get_property ("force-hshift"); - if (is_number (force)) + if (ly_c_number_p (force)) { tups = scm_cons (scm_cons (se->self_scm (), force), tups); diff --git a/lily/note-column.cc b/lily/note-column.cc index bc09959fc0..2edd774257 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -35,8 +35,8 @@ Note_column::shift_compare (Grob *const &p1, Grob *const&p2) SCM s1 = p1->get_property ("horizontal-shift"); SCM s2 = p2->get_property ("horizontal-shift"); - int h1 = (is_number (s1))? ly_scm2int (s1) :0; - int h2 = (is_number (s2)) ? ly_scm2int (s2):0; + int h1 = (ly_c_number_p (s1))? ly_scm2int (s1) :0; + int h2 = (ly_c_number_p (s2)) ? ly_scm2int (s2):0; return h1 - h2; } @@ -126,7 +126,7 @@ void Note_column::translate_rests (Grob*me, int dy) { Grob * r = unsmob_grob (me->get_property ("rest")); - if (r && !is_number (r->get_property ("staff-position"))) + if (r && !ly_c_number_p (r->get_property ("staff-position"))) { r->translate_axis (dy * Staff_symbol_referencer::staff_space (r)/2.0, Y_AXIS); } diff --git a/lily/note-head.cc b/lily/note-head.cc index a7accb9c75..15841c801c 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -333,7 +333,7 @@ int Note_head::get_balltype (Grob*me) { SCM s = me->get_property ("duration-log"); - return is_number (s) ? ly_scm2int (s) steps () : 0; SCM c0 = get_property ("middleCPosition"); - if (is_number (c0)) + if (ly_c_number_p (c0)) pos += ly_scm2int (c0); note->set_property ("staff-position", scm_int2num (pos)); diff --git a/lily/paper-book.cc b/lily/paper-book.cc index 80ce79fb70..5b5f9dba4a 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -489,10 +489,10 @@ LY_DEFINE (ly_ragged_page_breaks, "ly:ragged-page-breaks", "Return a vector with line numbers of page breaks.") { SCM_ASSERT_TYPE (scm_pair_p (lines), lines, SCM_ARG1, __FUNCTION__, "list"); - SCM_ASSERT_TYPE (is_number (book), book, SCM_ARG2, __FUNCTION__, "real"); - SCM_ASSERT_TYPE (is_number (text), text, SCM_ARG2, __FUNCTION__, "real"); - SCM_ASSERT_TYPE (is_number (first), first, SCM_ARG2, __FUNCTION__, "real"); - SCM_ASSERT_TYPE (is_number (last), last, SCM_ARG2, __FUNCTION__, "real"); + SCM_ASSERT_TYPE (ly_c_number_p (book), book, SCM_ARG2, __FUNCTION__, "real"); + SCM_ASSERT_TYPE (ly_c_number_p (text), text, SCM_ARG2, __FUNCTION__, "real"); + SCM_ASSERT_TYPE (ly_c_number_p (first), first, SCM_ARG2, __FUNCTION__, "real"); + SCM_ASSERT_TYPE (ly_c_number_p (last), last, SCM_ARG2, __FUNCTION__, "real"); return c_ragged_page_breaks (lines, ly_scm2double (book), ly_scm2double (text), diff --git a/lily/parser.yy b/lily/parser.yy index f2089487d6..fa453ad70d 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1959,7 +1959,7 @@ bass_figure: Music *m = unsmob_music ($1); if ($2) { SCM salter = m->get_property ("alteration"); - int alter = is_number (salter) ? ly_scm2int (salter) : 0; + int alter = ly_c_number_p (salter) ? ly_scm2int (salter) : 0; m->set_property ("alteration", scm_int2num (alter + $2)); } else { @@ -2022,7 +2022,7 @@ simple_element: n->set_property ("pitch", $1); n->set_property ("duration", $5); - if (is_number ($4)) + if (ly_c_number_p ($4)) { int q = ly_scm2int ($4); n->set_property ("absolute-octave", scm_int2num (q-1)); @@ -2431,7 +2431,7 @@ My_lily_lexer::try_special_identifiers (SCM *destination, SCM sid) if (ly_c_string_p (sid)) { *destination = sid; return STRING_IDENTIFIER; - } else if (is_number (sid)) { + } else if (ly_c_number_p (sid)) { *destination = sid; return NUMBER_IDENTIFIER; } else if (unsmob_context_def (sid)) { diff --git a/lily/performer-group-performer.cc b/lily/performer-group-performer.cc index 0a6011df88..7319dd9223 100644 --- a/lily/performer-group-performer.cc +++ b/lily/performer-group-performer.cc @@ -28,7 +28,7 @@ Performer_group_performer::announce_element (Audio_element_info info) { announce_infos_.push (info); Translator *t - = unsmob_translator (get_parent_context ()->get_parent_context ()->implementation_); + = get_parent_context ()->get_parent_context ()->implementation (); if (Performer_group_performer * eg = dynamic_cast (t)) eg->announce_element (info); diff --git a/lily/pitch-squash-engraver.cc b/lily/pitch-squash-engraver.cc index d8a4a828de..3acff5c995 100644 --- a/lily/pitch-squash-engraver.cc +++ b/lily/pitch-squash-engraver.cc @@ -22,7 +22,7 @@ void Pitch_squash_engraver::acknowledge_grob (Grob_info i) { SCM newpos = get_property ("squashedPosition"); - if (is_number (newpos) + if (ly_c_number_p (newpos) && Note_head::has_interface (i.grob_)) { i.grob_->set_property ("staff-position", newpos); diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index a7a993e5c9..6426973f8c 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -94,7 +94,7 @@ Rest_engraver::process_music () { int pos= p->steps (); SCM c0 = get_property ("middleCPosition"); - if (is_number (c0)) + if (ly_c_number_p (c0)) pos += ly_scm2int (c0); rest_->set_property ("staff-position", scm_int2num (pos)); diff --git a/lily/rest.cc b/lily/rest.cc index 1886923037..fc1f7e2782 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -120,7 +120,7 @@ Rest::brew_internal_stencil (SCM smob) Grob* me = unsmob_grob (smob); SCM balltype_scm = me->get_property ("duration-log"); - if (!is_number (balltype_scm)) + if (!ly_c_number_p (balltype_scm)) return Stencil ().smobbed_copy (); int balltype = ly_scm2int (balltype_scm); @@ -161,7 +161,7 @@ SCM Rest::polyphonic_offset_callback (SCM smob, SCM) { Grob* me = unsmob_grob (smob); - if (is_number (me->get_property ("staff-position"))) + if (ly_c_number_p (me->get_property ("staff-position"))) return scm_make_real (0); Direction d = get_grob_direction (me); diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index ebc03a0870..b76ee9229d 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -45,7 +45,7 @@ int Rhythmic_head::duration_log (Grob*me) { SCM s = me->get_property ("duration-log"); - return is_number (s) ? ly_scm2int (s) : 0; + return ly_c_number_p (s) ? ly_scm2int (s) : 0; } ADD_INTERFACE (Rhythmic_head,"rhythmic-head-interface", diff --git a/lily/score-context.cc b/lily/score-context.cc index acabbe813f..6cbd6a5559 100644 --- a/lily/score-context.cc +++ b/lily/score-context.cc @@ -12,7 +12,7 @@ void Score_context::prepare (Moment w) { - Translator* t = unsmob_translator (implementation_); + Translator* t = implementation (); Score_translator * s = dynamic_cast (t); s->prepare (w); @@ -21,7 +21,7 @@ Score_context::prepare (Moment w) void Score_context::finish () { - Translator* t = unsmob_translator (implementation_); + Translator* t = implementation (); Score_translator * s = dynamic_cast (t); s->finish (); @@ -30,7 +30,7 @@ Score_context::finish () void Score_context::one_time_step () { - Translator* t = unsmob_translator (implementation_); + Translator* t = implementation (); Score_translator * s = dynamic_cast (t); s->one_time_step (); } @@ -38,7 +38,7 @@ Score_context::one_time_step () Music_output* Score_context::get_output () { - Translator *t = unsmob_translator (implementation_); + Translator *t = implementation (); Score_translator *s = dynamic_cast (t); return s->get_output (); } diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 3fc44c527d..e3bd20fb7c 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -267,10 +267,10 @@ Score_engraver::try_music (Music *m) if (m->is_mus_type ("break-event")) { SCM pen = command_column_->get_property ("penalty"); - Real total_penalty = is_number (pen) ? ly_scm2double (pen) : 0.0; + Real total_penalty = ly_c_number_p (pen) ? ly_scm2double (pen) : 0.0; SCM mpen = m->get_property ("penalty"); - if (is_number (mpen)) + if (ly_c_number_p (mpen)) total_penalty += ly_scm2double (mpen); command_column_->set_property ("penalty", scm_make_real (total_penalty)); @@ -280,9 +280,9 @@ Score_engraver::try_music (Music *m) forbid_breaks (); SCM page_pen = command_column_->get_property ("page-penalty"); - Real total_pp = is_number (page_pen) ? ly_scm2double (page_pen) : 0.0; + Real total_pp = ly_c_number_p (page_pen) ? ly_scm2double (page_pen) : 0.0; SCM mpage_pen = m->get_property ("page-penalty"); - if (is_number (mpage_pen)) + if (ly_c_number_p (mpage_pen)) total_pp += ly_scm2double (mpage_pen); command_column_->set_property ("page-penalty", scm_make_real (total_pp)); diff --git a/lily/script-column.cc b/lily/script-column.cc index 2f059721ab..52e5adcd0d 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -15,7 +15,7 @@ void Script_column::add_staff_sided (Grob *me, Item *i) { SCM p = i->get_property ("script-priority"); - if (!is_number (p)) + if (!ly_c_number_p (p)) return; Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"),i); diff --git a/lily/self-aligment-interface.cc b/lily/self-aligment-interface.cc index 70e2020743..870d077d6d 100644 --- a/lily/self-aligment-interface.cc +++ b/lily/self-aligment-interface.cc @@ -28,7 +28,7 @@ Self_alignment_interface::aligned_on_parent (SCM element_smob, SCM axis) SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X"): ly_symbol2scm ("self-alignment-Y"); SCM align_prop (me->internal_get_property (sym)); - if (!is_number (align_prop)) + if (!ly_c_number_p (align_prop)) return scm_int2num (0); Real x = 0.0; @@ -86,7 +86,7 @@ Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis) SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X"): ly_symbol2scm ("self-alignment-Y"); SCM align (me->internal_get_property (sym)); - if (is_number (align)) + if (ly_c_number_p (align)) { Interval ext (me->extent (me,a)); diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 82b1ff44ba..556381419a 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -73,7 +73,7 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte Grob * st = Staff_symbol_referencer::get_staff_symbol (me); bool include_staff = (st && a == Y_AXIS - && is_number (me->get_property ("staff-padding"))); + && ly_c_number_p (me->get_property ("staff-padding"))); Interval dim; if (include_staff) @@ -222,7 +222,7 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis) */ Grob * st = Staff_symbol_referencer::get_staff_symbol (me); if (st && a == Y_AXIS - && is_number (me->get_property ("staff-padding"))) + && ly_c_number_p (me->get_property ("staff-padding"))) { Real padding= Staff_symbol_referencer::staff_space (me) diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index 3682dc1443..8aab99bc4f 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -369,7 +369,7 @@ Simple_spacer::solve (Column_x_positions *positions, bool ragged) for (int i = sz; i--; ) { SCM p = positions->cols_[i]->get_property ( "penalty"); - if (is_number (p)) + if (ly_c_number_p (p)) { if (ly_scm2double (p) < -9999) break_satisfy = break_satisfy && (i == 0 || i == sz -1); diff --git a/lily/slur.cc b/lily/slur.cc index a9454eba90..3759cc75d5 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -133,7 +133,7 @@ Slur::check_slope (Grob *me) Avoid too steep slurs. */ SCM s = me->get_property ("slope-limit"); - if (is_number (s)) + if (ly_c_number_p (s)) { Array encompass = get_encompass_offsets (me); Drul_array attachment; @@ -565,7 +565,7 @@ Slur::print (SCM smob) TODO: replace dashed with generic property. */ SCM d = me->get_property ("dashed"); - if (is_number (d)) + if (ly_c_number_p (d)) a = Lookup::dashed_slur (one, thick, thick * robust_scm2double (d, 0)); else a = Lookup::slur (one, get_grob_direction (me) * base_thick * ss / 10.0, @@ -598,13 +598,13 @@ Slur::set_control_points (Grob*me) SCM ssb = me->get_property ("beautiful"); Real sb = 0; - if (is_number (ssb)) + if (ly_c_number_p (ssb)) sb = ly_scm2double (ssb); bb.minimise_enclosed_area (sb, details); SCM sbf = scm_assq (ly_symbol2scm ("force-blowfit"), details); Real bff = 1.0; - if (ly_c_pair_p (sbf) && is_number (ly_cdr (sbf))) + if (ly_c_pair_p (sbf) && ly_c_number_p (ly_cdr (sbf))) bff = ly_scm2double (ly_cdr (sbf)); bb.curve_.control_[1][Y_AXIS] *= bff; diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index ecdcc3cd0e..354c402f79 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -108,7 +108,7 @@ Staff_symbol_referencer::callback (SCM element_smob, SCM) SCM pos = me->get_property ("staff-position"); Real off = 0.0; - if (is_number (pos)) + if (ly_c_number_p (pos)) { Real space = Staff_symbol_referencer::staff_space (me); off = ly_scm2double (pos) * space / 2.0; diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index bda21ab5e4..46de293510 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -42,7 +42,7 @@ Staff_symbol::print (SCM smob) do { SCM width_scm = me->get_property ("width"); - if (d == RIGHT && is_number (width_scm)) + if (d == RIGHT && ly_c_number_p (width_scm)) { /* don't multiply by Staff_symbol_referencer::staff_space (me), @@ -95,7 +95,7 @@ int Staff_symbol::line_count (Grob*me) { SCM c = me->get_property ("line-count"); - if (is_number (c)) + if (ly_c_number_p (c)) return ly_scm2int (c); else return 0; diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index a0adf56d6d..14de1ade5c 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -83,7 +83,7 @@ Stem_engraver::acknowledge_grob (Grob_info i) int requested_type = ly_scm2int (tremolo_ev_->get_property ("tremolo-type")); SCM f = get_property ("tremoloFlags"); if (!requested_type) - if (is_number (f)) + if (ly_c_number_p (f)) requested_type = ly_scm2int (f); else requested_type = 8; @@ -149,13 +149,13 @@ Stem_engraver::stop_translation_timestep () toDO: junk these properties. */ SCM prop = get_property ("stemLeftBeamCount"); - if (is_number (prop)) + if (ly_c_number_p (prop)) { Stem::set_beaming (stem_,ly_scm2int (prop),LEFT); get_parent_context ()->unset_property (ly_symbol2scm ("stemLeftBeamCount")); } prop = get_property ("stemRightBeamCount"); - if (is_number (prop)) + if (ly_c_number_p (prop)) { Stem::set_beaming (stem_,ly_scm2int (prop), RIGHT); get_parent_context ()->unset_property (ly_symbol2scm ("stemRightBeamCount")); diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 30580422f3..4ddd2b2db1 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -92,7 +92,7 @@ Stem_tremolo::raw_stencil (Grob *me) int tremolo_flags = 0; SCM s = me->get_property ("flag-count"); - if (is_number (s)) + if (ly_c_number_p (s)) tremolo_flags = ly_scm2int (s); if (!tremolo_flags) @@ -150,7 +150,7 @@ Stem_tremolo::print (SCM grob) Real beamthickness = 0.0; SCM sbt = (beam) ? beam->get_property ("thickness") : SCM_EOL ; - if (is_number (sbt)) + if (ly_c_number_p (sbt)) { beamthickness = ly_scm2double (sbt) * ss; } diff --git a/lily/stem.cc b/lily/stem.cc index b53fac3897..cbf298745b 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -83,7 +83,7 @@ Stem::stem_end_position (Grob*me) { SCM p =me->get_property ("stem-end-position"); Real pos; - if (!is_number (p)) + if (!ly_c_number_p (p)) { pos = get_default_stem_end_position (me); me->set_property ("stem-end-position", scm_make_real (pos)); @@ -289,7 +289,7 @@ Stem::get_default_stem_end_position (Grob*me) Real length = 7; // WARNING: IN HALF SPACES SCM scm_len = me->get_property ("length"); - if (is_number (scm_len)) + if (ly_c_number_p (scm_len)) { length = ly_scm2double (scm_len); } @@ -429,7 +429,7 @@ int Stem::duration_log (Grob*me) { SCM s = me->get_property ("duration-log"); - return (is_number (s)) ? ly_scm2int (s) : 2; + return (ly_c_number_p (s)) ? ly_scm2int (s) : 2; } void diff --git a/lily/stencil-scheme.cc b/lily/stencil-scheme.cc index 44beeb4600..8c986b2a71 100644 --- a/lily/stencil-scheme.cc +++ b/lily/stencil-scheme.cc @@ -40,7 +40,7 @@ LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis", { Stencil *s = unsmob_stencil (stil); SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil"); - SCM_ASSERT_TYPE (is_number (amount), amount, SCM_ARG2, __FUNCTION__, "number pair"); + SCM_ASSERT_TYPE (ly_c_number_p (amount), amount, SCM_ARG2, __FUNCTION__, "number pair"); SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis"); SCM new_s = s->smobbed_copy (); @@ -106,13 +106,13 @@ LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge", Real p = 0.0; if (padding != SCM_UNDEFINED) { - SCM_ASSERT_TYPE (is_number (padding), padding, SCM_ARG5, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number"); p = ly_scm2double (padding); } Real m = 0.0; if (minimum != SCM_UNDEFINED) { - SCM_ASSERT_TYPE (is_number (minimum), minimum, SCM_ARG6, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number"); m = ly_scm2double (minimum); } @@ -151,13 +151,13 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge", Real p = 0.0; if (padding != SCM_UNDEFINED) { - SCM_ASSERT_TYPE (is_number (padding), padding, SCM_ARG5, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number"); p = ly_scm2double (padding); } Real m = 0.0; if (minimum != SCM_UNDEFINED) { - SCM_ASSERT_TYPE (is_number (minimum), minimum, SCM_ARG6, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number"); m = ly_scm2double (minimum); } @@ -219,7 +219,7 @@ LY_DEFINE (ly_align_to_x, "ly:stencil-align-to!", { SCM_ASSERT_TYPE (unsmob_stencil (stil), stil, SCM_ARG1, __FUNCTION__, "stencil"); SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis"); - SCM_ASSERT_TYPE (is_number (dir), dir, SCM_ARG3, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (ly_c_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number"); unsmob_stencil (stil)->align_to ((Axis)ly_scm2int (axis), ly_scm2double (dir)); diff --git a/lily/system.cc b/lily/system.cc index 87373b5de8..503a81b28b 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -369,7 +369,7 @@ System::get_line () Grob *col = it->get_column (); SCM s = col->get_property ("page-penalty"); // FIXME; page breaking is not discrete at +-10000 - if (is_number (s)) // && fabs (ly_scm2double (s)) < 10000) + if (ly_c_number_p (s)) // && fabs (ly_scm2double (s)) < 10000) penalty += ly_scm2double (s); } } diff --git a/lily/tab-note-heads-engraver.cc b/lily/tab-note-heads-engraver.cc index af564200bd..ecca3ed9e5 100644 --- a/lily/tab-note-heads-engraver.cc +++ b/lily/tab-note-heads-engraver.cc @@ -131,7 +131,7 @@ Tab_note_heads_engraver::process_music () SCM scm_pitch = event->get_property ("pitch"); SCM proc = get_property ("tablatureFormat"); SCM min_fret_scm = get_property ("minimumFret"); - int min_fret = is_number (min_fret_scm) ? ly_scm2int (min_fret_scm) : 0; + int min_fret = ly_c_number_p (min_fret_scm) ? ly_scm2int (min_fret_scm) : 0; while (!string_found) { diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index c7f87db6f8..d398f4b2e7 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -93,7 +93,7 @@ Text_engraver::process_acknowledged_grobs () // Hmm int priority = 200; SCM s = text->get_property ("script-priority"); - if (is_number (s)) + if (ly_c_number_p (s)) priority = ly_scm2int (s); /* see script-engraver.cc */ diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 15c3866a3e..cc96ec066d 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -133,7 +133,7 @@ Timing_translator::start_translation_timestep () SCM barn = get_property ("currentBarNumber"); int b = 0; - if (is_number (barn)) + if (ly_c_number_p (barn)) { b = ly_scm2int (barn); } diff --git a/lily/translator-group.cc b/lily/translator-group.cc index f4126189c7..d2514ccc8d 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -108,7 +108,7 @@ void recurse_over_translators (Context * c, Translator_method ptr, Direction dir) { Translator_group * tg - = dynamic_cast (unsmob_translator (c->implementation_)); + = dynamic_cast (c->implementation ()); /* diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index ba44e4446b..2c87802a08 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -114,7 +114,7 @@ Tuplet_bracket::print (SCM smob) SCM lp = me->get_property ("left-position"); SCM rp = me->get_property ("right-position"); - if (!is_number (rp) || !is_number (lp)) + if (!ly_c_number_p (rp) || !ly_c_number_p (lp)) after_line_breaking (smob); } @@ -487,15 +487,15 @@ Tuplet_bracket::after_line_breaking (SCM smob) SCM lp = me->get_property ("left-position"); SCM rp = me->get_property ("right-position"); - if (is_number (lp) && !is_number (rp)) + if (ly_c_number_p (lp) && !ly_c_number_p (rp)) { rp = scm_make_real (ly_scm2double (lp) + dy); } - else if (is_number (rp) && !is_number (lp)) + else if (ly_c_number_p (rp) && !ly_c_number_p (lp)) { lp = scm_make_real (ly_scm2double (rp) - dy); } - else if (!is_number (rp) && !is_number (lp)) + else if (!ly_c_number_p (rp) && !ly_c_number_p (lp)) { lp = scm_make_real (offset); rp = scm_make_real (offset +dy); diff --git a/lily/virtual-font-metric.cc b/lily/virtual-font-metric.cc index f25e6a9c16..a282476009 100644 --- a/lily/virtual-font-metric.cc +++ b/lily/virtual-font-metric.cc @@ -33,7 +33,7 @@ Virtual_font_metric::Virtual_font_metric (SCM font_list) *tail = scm_cons (ly_car (s),SCM_EOL); tail = SCM_CDRLOC (*tail); - if (!is_number (mag)) + if (!ly_c_number_p (mag)) /* Ugh. */ mag = ly_cdr (fm->description_); -- 2.39.2