From 947454c5cc430a9627262de4f25274a64789d3c2 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 8 Mar 2004 00:24:30 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 2 + lily/accidental-engraver.cc | 26 ++++----- lily/accidental-placement.cc | 64 ++++++++++----------- lily/accidental.cc | 8 +-- lily/afm.cc | 2 +- lily/align-interface.cc | 10 ++-- lily/ambitus-engraver.cc | 6 +- lily/ambitus.cc | 10 ++-- lily/apply-context-iterator.cc | 4 +- lily/arpeggio-engraver.cc | 6 +- lily/arpeggio.cc | 6 +- lily/auto-beam-engraver.cc | 10 ++-- lily/auto-change-iterator.cc | 2 +- lily/axis-group-engraver.cc | 12 ++-- lily/balloon.cc | 2 +- lily/bar-check-iterator.cc | 12 ++-- lily/bar-engraver.cc | 8 +-- lily/bar-line.cc | 6 +- lily/bar-number-engraver.cc | 8 +-- lily/beam-engraver.cc | 32 +++++------ lily/beam-performer.cc | 6 +- lily/beam-quanting.cc | 12 ++-- lily/box.cc | 4 +- lily/break-align-engraver.cc | 10 ++-- lily/break-align-interface.cc | 28 ++++----- lily/break-substitution.cc | 60 +++++++++---------- lily/breathing-sign-engraver.cc | 6 +- lily/breathing-sign.cc | 2 +- lily/chord-name-engraver.cc | 10 ++-- lily/chord-tremolo-engraver.cc | 10 ++-- lily/chord-tremolo-iterator.cc | 8 +-- lily/clef-engraver.cc | 8 +-- lily/cluster-engraver.cc | 8 +-- lily/cluster.cc | 12 ++-- lily/coherent-ligature-engraver.cc | 14 ++--- lily/collision-engraver.cc | 4 +- lily/completion-note-heads-engraver.cc | 30 +++++----- lily/context-def.cc | 15 +++-- lily/context-specced-music-iterator.cc | 6 +- lily/context.cc | 10 ++-- lily/custos-engraver.cc | 8 +-- lily/dot-column-engraver.cc | 7 +-- lily/dot-column.cc | 2 +- lily/drum-note-engraver.cc | 8 +-- lily/drum-note-performer.cc | 6 +- lily/dynamic-engraver.cc | 22 +++---- lily/dynamic-performer.cc | 4 +- lily/engraver-group-engraver.cc | 8 +-- lily/engraver.cc | 4 +- lily/event-chord-iterator.cc | 2 +- lily/event.cc | 28 ++++----- lily/extender-engraver.cc | 6 +- lily/figured-bass-engraver.cc | 12 ++-- lily/fingering-engraver.cc | 10 ++-- lily/folded-repeat-iterator.cc | 18 +++--- lily/font-metric.cc | 24 ++++---- lily/font-size-engraver.cc | 4 +- lily/forbid-break-engraver.cc | 14 ++--- lily/function-documentation.cc | 2 +- lily/glissando-engraver.cc | 4 +- lily/gourlay-breaking.cc | 4 +- lily/grace-iterator.cc | 2 +- lily/gregorian-ligature-engraver.cc | 4 +- lily/grob-interface.cc | 12 ++-- lily/grob-pitch-tuple.cc | 2 +- lily/grob-pq-engraver.cc | 16 +++--- lily/grob-property.cc | 4 +- lily/grob.cc | 20 +++---- lily/horizontal-bracket.cc | 10 ++-- lily/include/simultaneous-music-iterator.hh | 2 +- lily/simultaneous-music-iterator.cc | 13 ++--- 71 files changed, 393 insertions(+), 388 deletions(-) diff --git a/ChangeLog b/ChangeLog index a7ec5fa80f..4bd99e88fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2004-03-08 Han-Wen Nienhuys + * lily/[a-g].cc: () style cleanup. + * Documentation/user/tutorial.itely (Automatic and manual beams): editing of tutorial. diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index b0410cb75a..51c95b99c5 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -27,10 +27,10 @@ struct Accidental_entry { Context *origin_; Grob* head_; bool tied_; - Accidental_entry(); + Accidental_entry (); }; -Accidental_entry::Accidental_entry() +Accidental_entry::Accidental_entry () { tied_ = false; done_ = false; @@ -73,10 +73,10 @@ static void set_property_on_children (Context * trans, const char * sym, SCM val) { trans->set_property (sym, val); - for (SCM p = trans->context_list_; gh_pair_p (p); p = ly_cdr(p)) + for (SCM p = trans->context_list_; gh_pair_p (p); p = ly_cdr (p)) { Context *trg = unsmob_context (ly_car (p)); - set_property_on_children(trg, sym, ly_deep_copy(val)); + set_property_on_children (trg, sym, ly_deep_copy (val)); } } @@ -115,7 +115,7 @@ number_accidentals_from_sig (bool *different, bool ignore_octave) { int n = pitch->get_notename (); - int o = pitch->get_octave(); + int o = pitch->get_octave (); int a = pitch->get_alteration (); int curbarnum_i = gh_scm2int (curbarnum); int accbarnum_i = 0; @@ -219,7 +219,7 @@ SCM Accidental_engraver::get_bar_num () { SCM barnum = get_property ("currentBarNumber"); - SCM smp = get_property("measurePosition"); + SCM smp = get_property ("measurePosition"); Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); if (mp.main_part_ < Rational (0) @@ -232,7 +232,7 @@ Accidental_engraver::get_bar_num () void Accidental_engraver::process_acknowledged_grobs () { - if (accidentals_.size () && !accidentals_.top().done_) + if (accidentals_.size () && !accidentals_.top ().done_) { SCM accidentals = get_property ("autoAccidentals"); SCM cautionaries = get_property ("autoCautionaries"); @@ -294,7 +294,7 @@ Accidental_engraver::process_acknowledged_grobs () if (!accidental_placement_) { accidental_placement_ = make_item ("AccidentalPlacement"); - announce_grob (accidental_placement_, a->self_scm()); + announce_grob (accidental_placement_, a->self_scm ()); } Accidental_placement::add_accidental (accidental_placement_, a); @@ -415,18 +415,18 @@ Accidental_engraver::stop_translation_timestep () } } - for (int i = 0; i < accidentals_.size(); i++) + for (int i = 0; i < accidentals_.size (); i++) { if (Grob *a = accidentals_[i].accidental_) typeset_grob (a); } if (accidental_placement_) - typeset_grob(accidental_placement_); + typeset_grob (accidental_placement_); accidental_placement_ = 0; - accidentals_.clear(); + accidentals_.clear (); left_objects_.clear (); right_objects_.clear (); } @@ -457,7 +457,7 @@ Accidental_engraver::acknowledge_grob (Grob_info info) { left_objects_.push (info.grob_); } - else if (info.grob_->internal_has_interface (ly_symbol2scm("finger-interface"))) + else if (info.grob_->internal_has_interface (ly_symbol2scm ("finger-interface"))) { left_objects_.push (info.grob_); } @@ -479,7 +479,7 @@ Accidental_engraver::process_music () trans_ -> set_property ("localKeySignature", ly_deep_copy (sig)); trans_ = trans_->daddy_context_; } - set_property_on_children(daddy_context_,"localKeySignature", sig); + set_property_on_children (daddy_context_,"localKeySignature", sig); last_keysig_ = sig; } diff --git a/lily/accidental-placement.cc b/lily/accidental-placement.cc index 6e9213421a..79cb293ac1 100644 --- a/lily/accidental-placement.cc +++ b/lily/accidental-placement.cc @@ -21,9 +21,9 @@ source file of the GNU LilyPond music typesetter #include "note-collision.hh" #include "accidental-interface.hh" -MAKE_SCHEME_CALLBACK(Accidental_placement,alignment_callback, 2); +MAKE_SCHEME_CALLBACK (Accidental_placement,alignment_callback, 2); SCM -Accidental_placement::alignment_callback(SCM s, SCM ) +Accidental_placement::alignment_callback (SCM s, SCM ) { Grob * me =unsmob_grob (s); @@ -43,7 +43,7 @@ Accidental_placement::add_accidental (Grob* me, Grob* a) { a->set_parent (me, X_AXIS); a->add_offset_callback (alignment_callback_proc, X_AXIS); - SCM cause = a->get_parent (Y_AXIS)->get_property("cause"); + SCM cause = a->get_parent (Y_AXIS)->get_property ("cause"); Music *mcause =unsmob_music (cause); if (!mcause) @@ -115,9 +115,9 @@ Accidental_placement::get_relevant_accidental_extent (Grob *me, which = & ra; Interval extent; - for (int i = 0; i < which->size(); i++) + for (int i = 0; i < which->size (); i++) { - extent.unite (which->elem(i)->extent (item_col, X_AXIS)); + extent.unite (which->elem (i)->extent (item_col, X_AXIS)); } if (!extent.is_empty ()) @@ -140,7 +140,7 @@ struct Accidental_placement_entry Link_array grobs_; Real offset_; int notename_; - Accidental_placement_entry() + Accidental_placement_entry () { offset_ =0.0; notename_ = -1; @@ -158,13 +158,13 @@ Real ape_priority (Accidental_placement_entry const * a) int ape_compare (Accidental_placement_entry *const &a, Accidental_placement_entry *const &b) { - return sign (ape_priority (a) - ape_priority(b)); + return sign (ape_priority (a) - ape_priority (b)); } int ape_rcompare (Accidental_placement_entry *const &a, Accidental_placement_entry *const &b) { - return -sign (ape_priority (a) - ape_priority(b)); + return -sign (ape_priority (a) - ape_priority (b)); } @@ -186,15 +186,15 @@ stagger_apes (Link_array *apes) asc.sort (&ape_compare); - apes->clear(); + apes->clear (); int i =0; int parity = 1; - while (i < asc.size()) + while (i < asc.size ()) { Accidental_placement_entry * a = 0; if (parity) - a = asc.pop(); + a = asc.pop (); else a = asc[i++]; @@ -202,7 +202,7 @@ stagger_apes (Link_array *apes) parity = !parity; } - apes->reverse(); + apes->reverse (); } @@ -210,7 +210,7 @@ stagger_apes (Link_array *apes) /* This routine computes placements of accidentals. During - add_accidental(), accidentals are already grouped by note, so that + add_accidental (), accidentals are already grouped by note, so that octaves are placed above each other; they form columns. Then the columns are sorted: the biggest columns go closest to the note. Then the columns are spaced as closely as possible (using skyline @@ -282,7 +282,7 @@ Accidental_placement::position_accidentals (Grob * me) for (int i= apes.size (); i--;) { Accidental_placement_entry * ape = apes[i]; - for (int j = ape->grobs_.size(); j--;) + for (int j = ape->grobs_.size (); j--;) { Grob * a = ape->grobs_[j]; @@ -305,7 +305,7 @@ Accidental_placement::position_accidentals (Grob * me) This is a little kludgy: to get all notes, we look if there are collisions as well. */ - for (int i = note_cols.size() ; i--;) + for (int i = note_cols.size () ; i--;) { Grob *c = note_cols[i]->get_parent (X_AXIS); if (Note_collision_interface::has_interface (c)) @@ -317,15 +317,15 @@ Accidental_placement::position_accidentals (Grob * me) } } - for (int i = note_cols.size() ; i--;) + for (int i = note_cols.size () ; i--;) { heads.concat (Pointer_group_interface__extract_grobs (note_cols[i], (Grob*)0, "note-heads")); } - heads.default_sort(); - heads.uniq(); + heads.default_sort (); + heads.uniq (); common[Y_AXIS] = common_refpoint_of_array (heads, common[Y_AXIS], Y_AXIS); @@ -335,14 +335,14 @@ Accidental_placement::position_accidentals (Grob * me) ape->left_skyline_ = empty_skyline (LEFT); ape->right_skyline_ = empty_skyline (RIGHT); - for (int j = apes[i]->grobs_.size(); j--;) + for (int j = apes[i]->grobs_.size (); j--;) { Grob * a = apes[i]->grobs_[j]; Array boxes = Accidental_interface::accurate_boxes (a, common); ape->extents_.concat (boxes); - for (int j = boxes.size(); j--;) + for (int j = boxes.size (); j--;) { insert_extent_into_skyline (&ape->left_skyline_, boxes[j], Y_AXIS, LEFT); insert_extent_into_skyline (&ape->right_skyline_ , boxes[j], Y_AXIS, RIGHT); @@ -352,11 +352,11 @@ Accidental_placement::position_accidentals (Grob * me) Interval total; - for (int i = apes.size(); i--;) + for (int i = apes.size (); i--;) { Interval y ; - for (int j = apes[i]->extents_.size(); j--;) + for (int j = apes[i]->extents_.size (); j--;) { y.unite (apes[i]->extents_[j][Y_AXIS]); } @@ -370,9 +370,9 @@ Accidental_placement::position_accidentals (Grob * me) common[X_AXIS] = common_refpoint_of_array (heads, common[X_AXIS], X_AXIS); Array head_skyline (empty_skyline (LEFT)); Array head_extents; - for (int i = heads.size(); i--;) + for (int i = heads.size (); i--;) { - Box b(heads[i]->extent (common[X_AXIS] , X_AXIS), + Box b (heads[i]->extent (common[X_AXIS] , X_AXIS), heads[i]->extent (common[Y_AXIS], Y_AXIS)); insert_extent_into_skyline (&head_skyline, b , Y_AXIS, LEFT); @@ -407,10 +407,10 @@ Accidental_placement::position_accidentals (Grob * me) left_skyline = new_left_skyline; } - for (int i = apes.size(); i--;) + for (int i = apes.size (); i--;) { Accidental_placement_entry* ape = apes[i]; - for (int j = ape->grobs_.size(); j--;) + for (int j = ape->grobs_.size (); j--;) { ape->grobs_[j]->translate_axis (ape->offset_, X_AXIS); } @@ -420,29 +420,29 @@ Accidental_placement::position_accidentals (Grob * me) Interval left_extent, right_extent; Accidental_placement_entry *ape = apes[0]; - for (int i = ape->extents_.size(); i--;) + for (int i = ape->extents_.size (); i--;) left_extent.unite (ape->offset_ + ape->extents_[i][X_AXIS]); - ape = apes.top(); - for (int i = ape->extents_.size(); i--;) + ape = apes.top (); + for (int i = ape->extents_.size (); i--;) right_extent.unite (ape->offset_ + ape->extents_[i][X_AXIS]); left_extent[LEFT] -= robust_scm2double (me->get_property ("left-padding"), 0); - Interval width(left_extent[LEFT], right_extent[RIGHT]); + Interval width (left_extent[LEFT], right_extent[RIGHT]); SCM scm_width = ly_interval2scm (width); me->set_extent (scm_width, X_AXIS); - for (int i = apes.size(); i--;) + for (int i = apes.size (); i--;) delete apes[i]; return SCM_UNSPECIFIED; } -ADD_INTERFACE(Accidental_placement, +ADD_INTERFACE (Accidental_placement, "accidental-placement-interface", "Resolve accidental collisions.", "left-padding padding right-padding accidental-grobs positioning-done") diff --git a/lily/accidental.cc b/lily/accidental.cc index b8274edf71..a5398a1573 100644 --- a/lily/accidental.cc +++ b/lily/accidental.cc @@ -91,14 +91,14 @@ Accidental_interface::accurate_boxes (Grob *a,Grob**common) */ } - if (!boxes.size()) + if (!boxes.size ()) boxes.push (b); Offset o (a->relative_coordinate (common[X_AXIS], X_AXIS), a->relative_coordinate (common[Y_AXIS], Y_AXIS)); - for(int i = boxes.size(); i--;) + for (int i = boxes.size (); i--;) { - boxes[i].translate(o); + boxes[i].translate (o); } return boxes; @@ -222,7 +222,7 @@ Accidental_interface::print (SCM smob) if (parens) mol = parenthesize (me, mol); - return mol.smobbed_copy(); + return mol.smobbed_copy (); } diff --git a/lily/afm.cc b/lily/afm.cc index db6ff87317..f79ba628bb 100644 --- a/lily/afm.cc +++ b/lily/afm.cc @@ -9,7 +9,7 @@ #include -#include "warn.hh" // error() +#include "warn.hh" // error () #include "libc-extension.hh" #include "afm.hh" #include "stencil.hh" diff --git a/lily/align-interface.cc b/lily/align-interface.cc index 53e5a1cfa8..20f07919bd 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -73,8 +73,8 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a) This is not very elegant, in that we need special support for hara-kiri. Unfortunately, the generic wiring of force_hara_kiri_callback () (extent and offset callback) is - such that we might get into a loop if we call extent() or - offset() the elements. + such that we might get into a loop if we call extent () or + offset () the elements. */ @@ -82,8 +82,8 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a) && Hara_kiri_group_spanner::has_interface (elems[j])) Hara_kiri_group_spanner::consider_suicide (elems[j]); - if (!elems[j]-> live()) - elems.del(j); + if (!elems[j]->live ()) + elems.del (j); } for (int j =0; j < elems.size (); j++) @@ -115,7 +115,7 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a) TODO: maybe we should rethink and throw out thresholding altogether. The original function has been taken over by - align_to_fixed_distance(). + align_to_fixed_distance (). */ void Align_interface::align_elements_to_extents (Grob * me, Axis a) diff --git a/lily/ambitus-engraver.cc b/lily/ambitus-engraver.cc index 4abc7fab14..8c68c84a44 100644 --- a/lily/ambitus-engraver.cc +++ b/lily/ambitus-engraver.cc @@ -63,7 +63,7 @@ class Ambitus_engraver : public Engraver { public: -TRANSLATOR_DECLARATIONS(Ambitus_engraver); +TRANSLATOR_DECLARATIONS (Ambitus_engraver); virtual void process_music (); virtual void acknowledge_grob (Grob_info); virtual void stop_translation_timestep (); @@ -186,12 +186,12 @@ Ambitus_engraver::finalize () * most probably arises from an empty voice, such as shared * global timesig/clef definitions. */ - ambitus_->suicide(); + ambitus_->suicide (); } } } -ENTER_DESCRIPTION(Ambitus_engraver, +ENTER_DESCRIPTION (Ambitus_engraver, /* descr */ "", /* creats*/ "Ambitus", /* accepts */ "", diff --git a/lily/ambitus.cc b/lily/ambitus.cc index f34c83ec5b..b785223ebb 100644 --- a/lily/ambitus.cc +++ b/lily/ambitus.cc @@ -56,8 +56,8 @@ number_accidentals (SCM key_signature, Pitch *pitch, bool ignore_octave_b, bool force_accidental) { int notename = pitch->get_notename (); - int octave = pitch->get_octave(); - int alteration = pitch->get_alteration(); + int octave = pitch->get_octave (); + int alteration = pitch->get_alteration (); if (force_accidental) // ignore key signature return 1; @@ -105,7 +105,7 @@ add_accidentals (Item *me, Stencil *head, int num_acc, { if (!num_acc) return; - if (pitch->get_alteration()) + if (pitch->get_alteration ()) { Stencil accidental (Font_interface::get_default_font (me)-> find_by_name (String ("accidentals-") + @@ -157,7 +157,7 @@ Ambitus::print (SCM smob) Pitch *pitch_min = unsmob_pitch (me->get_property ("pitch-min")); if (!pitch_min) { - me->programming_error("Ambitus: pitch_min undefined; assuming 0"); + me->programming_error ("Ambitus: pitch_min undefined; assuming 0"); p_min = 0; } else @@ -167,7 +167,7 @@ Ambitus::print (SCM smob) Pitch *pitch_max = unsmob_pitch (me->get_property ("pitch-max")); if (!pitch_max) { - me->programming_error("Ambitus: pitch_max undefined; assuming 0"); + me->programming_error ("Ambitus: pitch_max undefined; assuming 0"); p_max = 0; } else diff --git a/lily/apply-context-iterator.cc b/lily/apply-context-iterator.cc index ea01600f60..38036708c0 100644 --- a/lily/apply-context-iterator.cc +++ b/lily/apply-context-iterator.cc @@ -8,7 +8,7 @@ class Apply_context_iterator : public Simple_music_iterator { public: - DECLARE_SCHEME_CALLBACK(constructor, ()); + DECLARE_SCHEME_CALLBACK (constructor, ()); protected: virtual void process (Moment); }; @@ -19,7 +19,7 @@ Apply_context_iterator::process (Moment m) { SCM proc = get_music ()->get_property ("procedure"); - scm_call_1 (proc, get_outlet ()->self_scm()); + scm_call_1 (proc, get_outlet ()->self_scm ()); Simple_music_iterator::process (m); } diff --git a/lily/arpeggio-engraver.cc b/lily/arpeggio-engraver.cc index 6d3c7e2cb9..5ecde8437a 100644 --- a/lily/arpeggio-engraver.cc +++ b/lily/arpeggio-engraver.cc @@ -19,7 +19,7 @@ class Arpeggio_engraver : public Engraver { public: - TRANSLATOR_DECLARATIONS(Arpeggio_engraver); + TRANSLATOR_DECLARATIONS (Arpeggio_engraver); protected: virtual void acknowledge_grob (Grob_info); virtual void process_music (); @@ -82,7 +82,7 @@ Arpeggio_engraver::process_music () if (arpeggio_req_) { arpeggio_ = make_item ("Arpeggio"); - announce_grob(arpeggio_, arpeggio_req_->self_scm()); + announce_grob (arpeggio_, arpeggio_req_->self_scm ()); } } @@ -100,7 +100,7 @@ Arpeggio_engraver::stop_translation_timestep () -ENTER_DESCRIPTION(Arpeggio_engraver, +ENTER_DESCRIPTION (Arpeggio_engraver, /* descr */ "Generate an Arpeggio from a Arpeggio_req", /* creats*/ "Arpeggio", /* accepts */ "arpeggio-event", diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index c1fa6b9777..59966272ac 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -80,7 +80,7 @@ Arpeggio::print (SCM smob) if (dir) { arrow = fm->find_by_name ("scripts-arpeggio-arrow-" + to_string (dir)); - heads[dir] -= dir * arrow.extent (Y_AXIS).length(); + heads[dir] -= dir * arrow.extent (Y_AXIS).length (); } for (Real y= heads[LEFT] ; y < heads[RIGHT]; @@ -125,12 +125,12 @@ Arpeggio::brew_chord_bracket (SCM smob) Real lt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Real sp = 1.5 * Staff_symbol_referencer::staff_space (me); - Real dy = heads.length() + sp; + Real dy = heads.length () + sp; Real x = 0.7; Stencil mol (Lookup::bracket (Y_AXIS, Interval (0, dy), lt, x, lt)); mol.translate_axis (heads[LEFT] - sp/2.0, Y_AXIS); - return mol.smobbed_copy(); + return mol.smobbed_copy (); } diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index df4fb7495b..7b984c245a 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -26,7 +26,7 @@ */ class Auto_beam_engraver : public Engraver { - TRANSLATOR_DECLARATIONS(Auto_beam_engraver); + TRANSLATOR_DECLARATIONS (Auto_beam_engraver); protected: virtual void stop_translation_timestep (); virtual void start_translation_timestep (); @@ -144,7 +144,7 @@ Auto_beam_engraver::try_music (Music*m) bool Auto_beam_engraver::test_moment (Direction dir, Moment test_mom) { - Moment now = now_mom(); + Moment now = now_mom (); if (dir == START && now.grace_part_) { @@ -284,7 +284,7 @@ Auto_beam_engraver::create_beam () Beam::add_stem (beam, (*stems_)[i]); } - announce_grob(beam, SCM_EOL); + announce_grob (beam, SCM_EOL); return beam; } @@ -304,7 +304,7 @@ Auto_beam_engraver::begin_beam () beam_start_moment_ = now_mom (); beam_start_location_ = *unsmob_moment (get_property ("measurePosition")); - subdivide_beams_ = gh_scm2bool(get_property("subdivideBeams")); + subdivide_beams_ = gh_scm2bool (get_property ("subdivideBeams")); beat_length_ = *unsmob_moment (get_property ("beatLength")); } @@ -349,7 +349,7 @@ Auto_beam_engraver::typeset_beam () { if (finished_beam_) { - finished_grouping_->beamify(beat_length_, subdivide_beams_); + finished_grouping_->beamify (beat_length_, subdivide_beams_); Beam::set_beaming (finished_beam_, finished_grouping_); typeset_grob (finished_beam_); finished_beam_ = 0; diff --git a/lily/auto-change-iterator.cc b/lily/auto-change-iterator.cc index 83c2f45faf..ad5d5437b1 100644 --- a/lily/auto-change-iterator.cc +++ b/lily/auto-change-iterator.cc @@ -16,7 +16,7 @@ class Auto_change_iterator : public Music_wrapper_iterator { public: - DECLARE_SCHEME_CALLBACK(constructor, ()); + DECLARE_SCHEME_CALLBACK (constructor, ()); Auto_change_iterator (); diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index ee07b86f45..8e404c150e 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -30,7 +30,7 @@ protected: virtual Spanner* get_spanner () ; virtual void add_element (Grob*) ; public: - TRANSLATOR_DECLARATIONS(Axis_group_engraver); + TRANSLATOR_DECLARATIONS (Axis_group_engraver); }; Axis_group_engraver::Axis_group_engraver () @@ -49,7 +49,7 @@ Axis_group_engraver::process_music () staffline_->set_bound (LEFT,it); - announce_grob(staffline_, SCM_EOL); + announce_grob (staffline_, SCM_EOL); } } @@ -150,7 +150,7 @@ protected: virtual void acknowledge_grob (Grob_info); virtual void add_element (Grob *e); public: - TRANSLATOR_DECLARATIONS(Hara_kiri_engraver); + TRANSLATOR_DECLARATIONS (Hara_kiri_engraver); }; void @@ -181,11 +181,11 @@ Hara_kiri_engraver::acknowledge_grob (Grob_info i) } -Hara_kiri_engraver::Hara_kiri_engraver() +Hara_kiri_engraver::Hara_kiri_engraver () { } -ENTER_DESCRIPTION(Hara_kiri_engraver, +ENTER_DESCRIPTION (Hara_kiri_engraver, /* descr */ "Like Axis_group_engraver, but make a hara-kiri spanner, and add " "interesting items (ie. note heads, lyric syllables and normal rests) ", /* creats*/ "RemoveEmptyVerticalGroup", @@ -194,7 +194,7 @@ ENTER_DESCRIPTION(Hara_kiri_engraver, /* reads */ "", /* write */ ""); -ENTER_DESCRIPTION(Axis_group_engraver, +ENTER_DESCRIPTION (Axis_group_engraver, /* descr */ "Group all objects created in this context in a VerticalAxisGroup spanner.", /* creats*/ "VerticalAxisGroup", /* accepts */ "", diff --git a/lily/balloon.cc b/lily/balloon.cc index d00fc3d6a5..0461115008 100644 --- a/lily/balloon.cc +++ b/lily/balloon.cc @@ -72,7 +72,7 @@ Balloon_interface::print (SCM smob) for (int i = X_AXIS; i < NO_AXES; i++) { - Axis a((Axis)i); + Axis a ((Axis)i); z1[a] = box_extent [a].linear_combination (sign (off[a])); text_mol->align_to (a, -sign (off[a])); } diff --git a/lily/bar-check-iterator.cc b/lily/bar-check-iterator.cc index 343bcd229b..76fdc53675 100644 --- a/lily/bar-check-iterator.cc +++ b/lily/bar-check-iterator.cc @@ -20,20 +20,20 @@ class Bar_check_iterator : Simple_music_iterator { public: virtual void process (Moment); - Bar_check_iterator( ); - DECLARE_SCHEME_CALLBACK(constructor, ()); + Bar_check_iterator ( ); + DECLARE_SCHEME_CALLBACK (constructor, ()); }; -IMPLEMENT_CTOR_CALLBACK(Bar_check_iterator); +IMPLEMENT_CTOR_CALLBACK (Bar_check_iterator); -Bar_check_iterator::Bar_check_iterator() +Bar_check_iterator::Bar_check_iterator () { } void Bar_check_iterator::process (Moment m) { - Simple_music_iterator::process(m); + Simple_music_iterator::process (m); if (!m.to_bool ()) { Context *tr = get_outlet (); @@ -50,7 +50,7 @@ Bar_check_iterator::process (Moment m) bool warn =true; if (to_boolean (sync)) { - tr = tr->where_defined (ly_symbol2scm("measurePosition")); + tr = tr->where_defined (ly_symbol2scm ("measurePosition")); Moment zero; tr->set_property ("measurePosition", zero.smobbed_copy ()); } diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index b49572d6bd..26dd7a64b3 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -22,7 +22,7 @@ class Bar_engraver : public Engraver { public: - TRANSLATOR_DECLARATIONS( Bar_engraver ); + TRANSLATOR_DECLARATIONS (Bar_engraver); void request_bar (String type_string); protected: @@ -52,7 +52,7 @@ Bar_engraver::create_bar () if (scm_equal_p (gl, bar_->get_property ("glyph")) != SCM_BOOL_T) bar_->set_property ("glyph", gl); - announce_grob(bar_, SCM_EOL); + announce_grob (bar_, SCM_EOL); } } @@ -69,7 +69,7 @@ Bar_engraver::finalize () This is a little hairy : whichBar may be set by Repeat_acknowledge_engraver::process_music, which is at score context. This means that grobs could should be created after - process_music. We do stuff process_acknowledged_grobs(), just to be + process_music. We do stuff process_acknowledged_grobs (), just to be on the safe side. */ @@ -108,7 +108,7 @@ Bar_engraver::stop_translation_timestep () } -ENTER_DESCRIPTION(Bar_engraver, +ENTER_DESCRIPTION (Bar_engraver, /* descr */ "Create barlines. This engraver is controlled through the " "@code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point", /* creats*/ "BarLine", diff --git a/lily/bar-line.cc b/lily/bar-line.cc index aa454acac2..f7f1d7808c 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -66,9 +66,9 @@ Bar_line::compound_barline (Grob*me, String str, Real h) Real dist = ( Staff_symbol_referencer::line_count (me) & 1 ? 1 : (staff_space<2 ? 2 : .5) ) * staff_space; Stencil colon (dot); - colon.translate_axis(dist,Y_AXIS); - colon.add_stencil(dot); - colon.translate_axis(-dist/2,Y_AXIS); + colon.translate_axis (dist,Y_AXIS); + colon.add_stencil (dot); + colon.translate_axis (-dist/2,Y_AXIS); Stencil m; diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 7223ebbf6a..3aeda39292 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -34,7 +34,7 @@ protected: virtual void acknowledge_grob (Grob_info); virtual void process_music (); void create_items (); - TRANSLATOR_DECLARATIONS(Bar_number_engraver ); + TRANSLATOR_DECLARATIONS (Bar_number_engraver ); }; @@ -55,7 +55,7 @@ Bar_number_engraver::process_music () SCM bn = get_property ("currentBarNumber"); SCM proc = get_property ("barNumberVisibility"); if (gh_number_p (bn) && gh_procedure_p (proc) - && to_boolean(gh_call1(proc, bn))) + && to_boolean (gh_call1(proc, bn))) { create_items (); // guh. @@ -111,10 +111,10 @@ Bar_number_engraver::create_items () text_ = make_item ("BarNumber"); Side_position_interface::set_axis (text_,Y_AXIS); - announce_grob(text_, SCM_EOL); + announce_grob (text_, SCM_EOL); } -ENTER_DESCRIPTION(Bar_number_engraver, +ENTER_DESCRIPTION (Bar_number_engraver, /* descr */ "A bar number is created whenever measurePosition is zero. It is\n" "put on top of all staves, and appears only at left side of the staff.", /* creats*/ "BarNumber", diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 55d65a5772..e810b7052d 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -55,11 +55,11 @@ protected: virtual bool try_music (Music*); virtual void process_music (); - virtual bool valid_start_point(); + virtual bool valid_start_point (); virtual bool valid_end_point (); public: - TRANSLATOR_DECLARATIONS(Beam_engraver); + TRANSLATOR_DECLARATIONS (Beam_engraver); }; @@ -68,7 +68,7 @@ public: always nested. */ bool -Beam_engraver::valid_start_point() +Beam_engraver::valid_start_point () { Moment n = now_mom (); @@ -76,7 +76,7 @@ Beam_engraver::valid_start_point() } bool -Beam_engraver::valid_end_point() +Beam_engraver::valid_end_point () { return valid_start_point (); } @@ -152,7 +152,7 @@ Beam_engraver::process_music () beam_info_ = new Beaming_info_list; /* urg, must copy to Auto_beam_engraver too */ - announce_grob (beam_, start_ev_->self_scm()); + announce_grob (beam_, start_ev_->self_scm ()); } } @@ -163,7 +163,7 @@ Beam_engraver::typeset_beam () { if (finished_beam_) { - finished_beam_info_->beamify(beat_length_, subdivide_beams_); + finished_beam_info_->beamify (beat_length_, subdivide_beams_); Beam::set_beaming (finished_beam_, finished_beam_info_); typeset_grob (finished_beam_); delete finished_beam_info_; @@ -181,7 +181,7 @@ Beam_engraver::start_translation_timestep () { set_melisma (true); - subdivide_beams_ = to_boolean(get_property("subdivideBeams")); + subdivide_beams_ = to_boolean (get_property ("subdivideBeams")); beat_length_ = *unsmob_moment (get_property ("beatLength")); } } @@ -198,7 +198,7 @@ Beam_engraver::stop_translation_timestep () now_stop_ev_ = 0; beam_ = 0; beam_info_ = 0; - typeset_beam(); + typeset_beam (); set_melisma (false); } } @@ -230,7 +230,7 @@ Beam_engraver::acknowledge_grob (Grob_info info) } else if (Stem::has_interface (info.grob_)) { - Moment now = now_mom(); + Moment now = now_mom (); if (!valid_start_point ()) return ; @@ -239,7 +239,7 @@ Beam_engraver::acknowledge_grob (Grob_info info) if (Stem::get_beam (stem)) return; - Music* m = info.music_cause(); + Music* m = info.music_cause (); if (!m->is_mus_type ("rhythmic-event")) { String s = _ ("stem must have Rhythmic structure"); @@ -279,7 +279,7 @@ Beam_engraver::acknowledge_grob (Grob_info info) -ENTER_DESCRIPTION(Beam_engraver, +ENTER_DESCRIPTION (Beam_engraver, /* descr */ "Handles Beam events by engraving Beams. If omitted, then notes will be " "printed with flags instead of beams.", /* creats*/ "Beam", @@ -292,19 +292,19 @@ ENTER_DESCRIPTION(Beam_engraver, class Grace_beam_engraver : public Beam_engraver { public: - TRANSLATOR_DECLARATIONS(Grace_beam_engraver); + TRANSLATOR_DECLARATIONS (Grace_beam_engraver); protected: - virtual bool valid_start_point(); + virtual bool valid_start_point (); virtual bool valid_end_point (); }; -Grace_beam_engraver::Grace_beam_engraver() +Grace_beam_engraver::Grace_beam_engraver () { } bool -Grace_beam_engraver::valid_start_point() +Grace_beam_engraver::valid_start_point () { Moment n = now_mom (); @@ -320,7 +320,7 @@ Grace_beam_engraver::valid_end_point () -ENTER_DESCRIPTION(Grace_beam_engraver, +ENTER_DESCRIPTION (Grace_beam_engraver, /* descr */ "Handles Beam events by engraving Beams. If omitted, then notes will " "be printed with flags instead of beams. Only engraves beams when we " " are at grace points in time. " diff --git a/lily/beam-performer.cc b/lily/beam-performer.cc index 3deaa507ba..09f978e9b9 100644 --- a/lily/beam-performer.cc +++ b/lily/beam-performer.cc @@ -15,7 +15,7 @@ class Beam_performer : public Performer { public: - TRANSLATOR_DECLARATIONS(Beam_performer); + TRANSLATOR_DECLARATIONS (Beam_performer); protected: virtual bool try_music (Music *ev) ; @@ -84,10 +84,10 @@ Beam_performer::try_music (Music *m) return false; } -ENTER_DESCRIPTION(Beam_performer,"","", +ENTER_DESCRIPTION (Beam_performer,"","", "beam-event","","",""); -Beam_performer::Beam_performer() +Beam_performer::Beam_performer () { beam_ = false; } diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index a1fb2a94b8..c752512a76 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -143,10 +143,10 @@ Beam::quanting (SCM smob) Array base_lengths; Array stem_xposns; - Drul_array dirs_found(0,0); + Drul_array dirs_found (0,0); Grob *common[2]; for (int a = 2; a--;) - common[a] = common_refpoint_of_array (stems, me, Axis(a)); + common[a] = common_refpoint_of_array (stems, me, Axis (a)); Grob * fvs = first_visible_stem (me); Grob *lvs = last_visible_stem (me); @@ -161,7 +161,7 @@ Beam::quanting (SCM smob) stem_y != 0.0, when we're cross staff. */ - for (int i= 0; i < stems.size(); i++) + for (int i= 0; i < stems.size (); i++) { Grob*s = stems[i]; @@ -289,7 +289,7 @@ Beam::quanting (SCM smob) int i = 0; Real mindist = 1e6; - for (; i < qscores.size(); i ++) + for (; i < qscores.size (); i ++) { Real d =fabs (qscores[i].yl- ins[LEFT]) + fabs (qscores[i].yr - ins[RIGHT]); if (d < mindist) @@ -448,8 +448,8 @@ Beam::score_forbidden_quants (Real yl, Real yr, Direction ldir, Direction rdir) { Real dy = yr - yl; - Drul_array y(yl,yr); - Drul_array dirs(ldir,rdir); + Drul_array y (yl,yr); + Drul_array dirs (ldir,rdir); Real extra_demerit = SECONDARY_BEAM_DEMERIT / (beam_counts[LEFT] >? beam_counts[RIGHT]); diff --git a/lily/box.cc b/lily/box.cc index 4854743b8b..a61a8abf08 100644 --- a/lily/box.cc +++ b/lily/box.cc @@ -72,8 +72,8 @@ Box::add_point (Offset o) Offset Box::center () const { - return Offset (interval_a_[X_AXIS].center(), - interval_a_[Y_AXIS].center()); + return Offset (interval_a_[X_AXIS].center (), + interval_a_[Y_AXIS].center ()); } void Box::widen (Real x, Real y) diff --git a/lily/break-align-engraver.cc b/lily/break-align-engraver.cc index 77cfa0f9b4..45f8a85acd 100644 --- a/lily/break-align-engraver.cc +++ b/lily/break-align-engraver.cc @@ -28,7 +28,7 @@ protected: void add_column (SCM); public: - TRANSLATOR_DECLARATIONS(Break_align_engraver); + TRANSLATOR_DECLARATIONS (Break_align_engraver); }; void @@ -116,7 +116,7 @@ Break_align_engraver::acknowledge_grob (Grob_info inf) left_edge_ = make_item ("LeftEdge"); add_to_group (left_edge_->get_property ("break-align-symbol"), left_edge_); - announce_grob(left_edge_, SCM_EOL); + announce_grob (left_edge_, SCM_EOL); } add_to_group (align_name, item); @@ -124,7 +124,7 @@ Break_align_engraver::acknowledge_grob (Grob_info inf) } void -Break_align_engraver::add_to_group(SCM align_name, Item*item) +Break_align_engraver::add_to_group (SCM align_name, Item*item) { SCM s = scm_assoc (align_name, column_alist_); Item * group = 0; @@ -140,7 +140,7 @@ Break_align_engraver::add_to_group(SCM align_name, Item*item) group->set_property ("break-align-symbol", align_name); group->set_parent (align_, Y_AXIS); - announce_grob(group, item->self_scm()); + announce_grob (group, item->self_scm ()); column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm ()); @@ -148,7 +148,7 @@ Break_align_engraver::add_to_group(SCM align_name, Item*item) Axis_group_interface::add_element (group, item); } -ENTER_DESCRIPTION(Break_align_engraver, +ENTER_DESCRIPTION (Break_align_engraver, /* descr */ "Align grobs with corresponding break-align-symbols into groups, and order the groups according to breakAlignOrder", /* creats*/ "BreakAlignment BreakAlignGroup LeftEdge", /* accepts */ "", diff --git a/lily/break-align-interface.cc b/lily/break-align-interface.cc index 6fcbfa5968..b828248d23 100644 --- a/lily/break-align-interface.cc +++ b/lily/break-align-interface.cc @@ -91,24 +91,24 @@ Break_align_interface::do_alignment (Grob *me) idx++; Array offsets; - offsets.set_size (elems.size()); - for (int i= 0; i < offsets.size();i ++) + offsets.set_size (elems.size ()); + for (int i= 0; i < offsets.size ();i ++) offsets[i] = 0.0; Real extra_right_space = 0.0; int edge_idx = -1; - while (idx < elems.size()) + while (idx < elems.size ()) { int next_idx = idx+1; - while (next_idx < elems.size() && + while (next_idx < elems.size () && extents[next_idx].is_empty () ) next_idx++; Grob *l = elems[idx]; Grob *r = 0; - if (next_idx < elems.size()) + if (next_idx < elems.size ()) r = elems[next_idx]; SCM alist = SCM_EOL; @@ -124,11 +124,11 @@ Break_align_interface::do_alignment (Grob *me) if (edge_idx < 0 && elt->get_property ("break-align-symbol") - == ly_symbol2scm( "left-edge")) + == ly_symbol2scm ( "left-edge")) edge_idx = idx; SCM l =elt->get_property ("space-alist"); - if (gh_pair_p(l)) + if (gh_pair_p (l)) { alist= l; break; @@ -145,12 +145,12 @@ Break_align_interface::do_alignment (Grob *me) for (SCM s = r ? r->get_property ("elements") : SCM_EOL; !gh_symbol_p (rsym) && gh_pair_p (s); s = gh_cdr (s)) { - Grob * elt =unsmob_grob(gh_car (s)); + Grob * elt =unsmob_grob (gh_car (s)); rsym = elt->get_property ("break-align-symbol"); } - if (rsym == ly_symbol2scm("left-edge")) + if (rsym == ly_symbol2scm ("left-edge")) edge_idx = next_idx; SCM entry = SCM_EOL; @@ -161,14 +161,14 @@ Break_align_interface::do_alignment (Grob *me) if (!entry_found) { String sym_string; - if(gh_symbol_p (rsym)) + if (gh_symbol_p (rsym)) sym_string = ly_symbol2string (rsym); String orig_string ; if (unsmob_grob (l->get_property ("cause"))) orig_string = unsmob_grob (l->get_property ("cause"))->name (); - programming_error (_f("No spacing entry from %s to `%s'", + programming_error (_f ("No spacing entry from %s to `%s'", orig_string.to_str0 (), sym_string.to_str0 ())); } @@ -190,7 +190,7 @@ Break_align_interface::do_alignment (Grob *me) offsets[next_idx] = extents[idx][RIGHT] + distance - extents[next_idx][LEFT]; /* should probably junk minimum-space */ - else if (type == ly_symbol2scm("minimum-space")) + else if (type == ly_symbol2scm ("minimum-space")) offsets[next_idx] = extents[idx][RIGHT] >? distance; } else @@ -205,7 +205,7 @@ Break_align_interface::do_alignment (Grob *me) Interval total_extent; Real alignment_off =0.0; - for (int i =0 ; i < offsets.size(); i++) + for (int i =0 ; i < offsets.size (); i++) { here += offsets[i]; if (i == edge_idx) @@ -222,7 +222,7 @@ Break_align_interface::do_alignment (Grob *me) alignment_off = -total_extent[LEFT]; here = alignment_off; - for (int i =0 ; i < offsets.size(); i++) + for (int i =0 ; i < offsets.size (); i++) { here += offsets[i]; elems[i]->translate_axis (here, X_AXIS); diff --git a/lily/break-substitution.cc b/lily/break-substitution.cc index 5f2f2d81f1..59664579f7 100644 --- a/lily/break-substitution.cc +++ b/lily/break-substitution.cc @@ -45,7 +45,7 @@ substitute_grob (Grob *sc) /* now: sc && sc->get_system () == line */ if (!line) - return sc->self_scm(); + return sc->self_scm (); /* We don't return SCM_UNDEFINED for @@ -65,7 +65,7 @@ substitute_grob (Grob *sc) return SCM_UNDEFINED; } - return sc->self_scm(); + return sc->self_scm (); } @@ -151,7 +151,7 @@ substitute_grob_list (SCM grob_list) if (n != SCM_UNDEFINED) { *tail = gh_cons (n, SCM_EOL); - tail = SCM_CDRLOC(*tail); + tail = SCM_CDRLOC (*tail); } } @@ -166,8 +166,8 @@ substitute_grob_list (SCM grob_list) forall g in p (if grob-list): g := substitute (g) - for spanners since this is O(SYSTEMCOUNT * GROBCOUNT), and SYSTEMCOUNT = - O(GROBCOUNT), we have a quadratic algorithm. --for a single spanner + for spanners since this is O (SYSTEMCOUNT * GROBCOUNT), and SYSTEMCOUNT = + O (GROBCOUNT), we have a quadratic algorithm. --for a single spanner This is problematic: with large (long) scores, the costs can be significant; especially all-elements in System, can become huge. For @@ -181,15 +181,15 @@ substitute_grob_list (SCM grob_list) put grob list in array, - reorder array so spanners are separate -- O(grobcount) + reorder array so spanners are separate -- O (grobcount) find first and last indexes of grobs on a specific system - for items this is O(itemcount) + for items this is O (itemcount) - for spanners this is O(sum-of spanner-system-ranges) + for spanners this is O (sum-of spanner-system-ranges) - perform the substitution O(sum-of spanner-system-ranges) + perform the substitution O (sum-of spanner-system-ranges) The complexity is harder to determine, but should be subquadratic; @@ -216,15 +216,15 @@ spanner_system_range (Spanner* sp) { Slice rv; - if (System*st = sp->get_system()) + if (System*st = sp->get_system ()) { rv = Slice (st->rank_, st->rank_); } else { - if (sp->broken_intos_.size()) - rv = Slice (sp->broken_intos_[0]->get_system()->rank_, - sp->broken_intos_.top()->get_system()->rank_); + if (sp->broken_intos_.size ()) + rv = Slice (sp->broken_intos_[0]->get_system ()->rank_, + sp->broken_intos_.top ()->get_system ()->rank_); } return rv; } @@ -232,7 +232,7 @@ spanner_system_range (Spanner* sp) Slice item_system_range (Item* it) { - if (System*st= it->get_system()) + if (System*st= it->get_system ()) return Slice (st->rank_, st->rank_); Slice sr; @@ -240,10 +240,10 @@ item_system_range (Item* it) do { Item *bi = it->find_prebroken_piece (d); - if (bi && bi->get_system()) - sr.add_point (bi->get_system()->rank_); + if (bi && bi->get_system ()) + sr.add_point (bi->get_system ()->rank_); } - while (flip(&d)!=LEFT); + while (flip (&d)!=LEFT); return sr; } @@ -256,7 +256,7 @@ grob_system_range (Grob *g) else if (Item* it = dynamic_cast (g)) return item_system_range (it); else - return Slice(); + return Slice (); } @@ -287,7 +287,7 @@ struct Substitution_entry right_ = sr[RIGHT]; } } - Substitution_entry() + Substitution_entry () { grob_ =0; left_ = right_ = -2; @@ -304,7 +304,7 @@ struct Substitution_entry static int spanner_compare (void const * a , void const * b) { - return ((Substitution_entry*)a)->length() - + return ((Substitution_entry*)a)->length () - ((Substitution_entry*)b)->length (); } }; @@ -354,7 +354,7 @@ Spanner::fast_fubstitute_grob_list (SCM sym, int it_index = 0; for (SCM s = grob_list; gh_pair_p (s); s = gh_cdr (s)) { - Grob * g = unsmob_grob (gh_car(s)); + Grob * g = unsmob_grob (gh_car (s)); Slice sr = grob_system_range (g); sr.intersect (system_range); @@ -392,18 +392,18 @@ Spanner::fast_fubstitute_grob_list (SCM sym, is a waste of time -- the staff-spanners screw up the ordering, since they go across the entire score. */ - for (int i = sp_indices.size(); i--;) + for (int i = sp_indices.size (); i--;) sp_indices[i]= Slice (sp_index, len-1); assert (it_index <= sp_index); assert (broken_intos_.size () == system_range.length () + 1); - for (int i = 0; i < broken_intos_.size(); i++) + for (int i = 0; i < broken_intos_.size (); i++) { Grob * sc = broken_intos_[i]; System * l = sc->get_system (); - set_break_subsititution (l ? l->self_scm(): SCM_UNDEFINED); + set_break_subsititution (l ? l->self_scm (): SCM_UNDEFINED); SCM newval = SCM_EOL; SCM * tail = &newval; @@ -416,7 +416,7 @@ Spanner::fast_fubstitute_grob_list (SCM sym, { *tail = scm_cons (subs, SCM_EOL); - tail = SCM_CDRLOC(*tail); + tail = SCM_CDRLOC (*tail); } } @@ -425,7 +425,7 @@ Spanner::fast_fubstitute_grob_list (SCM sym, printf ("%d (%d), sp %d (%d)\n", it_indices [i].length (), it_index, - sp_indices[i].length() , len -sp_index); + sp_indices[i].length () , len -sp_index); { SCM l1 =substitute_grob_list (grob_list); @@ -458,7 +458,7 @@ SCM grob_list_p; we have a special function here: we want to invoke a special function for lists of grobs. These can be very long for large - orchestral scores (eg. 1M elements). do_break_substitution() can + orchestral scores (eg. 1M elements). do_break_substitution () can recurse many levels, taking lots of stack space. This becomes a problem if lily is linked against guile with @@ -474,8 +474,8 @@ substitute_mutable_property_alist (SCM alist) SCM *tail = &l; for (SCM s = alist; gh_pair_p (s); s = gh_cdr (s)) { - SCM sym = gh_caar(s); - SCM val = gh_cdar(s); + SCM sym = gh_caar (s); + SCM val = gh_cdar (s); SCM type = scm_object_property (sym, ly_symbol2scm ("backend-type?")); if (type == grob_list_p) @@ -517,7 +517,7 @@ Spanner::substitute_one_mutable_property (SCM sym, For the substitution of a single property, we tack the result onto mutable_property_alist_ ; mutable_property_alist_ is empty after Grob::Grob (Grob const&), except that System has all-elements set, - as a side product of typeset_grob() on newly copied spanners. + as a side product of typeset_grob () on newly copied spanners. Here we clear that list explicitly to free some memory and counter some of the confusion I encountered while debugging diff --git a/lily/breathing-sign-engraver.cc b/lily/breathing-sign-engraver.cc index 171cc1a63c..d5bee48285 100644 --- a/lily/breathing-sign-engraver.cc +++ b/lily/breathing-sign-engraver.cc @@ -24,7 +24,7 @@ TODO: class Breathing_sign_engraver : public Engraver { public: - TRANSLATOR_DECLARATIONS(Breathing_sign_engraver); + TRANSLATOR_DECLARATIONS (Breathing_sign_engraver); protected: virtual bool try_music (Music *req); @@ -56,7 +56,7 @@ Breathing_sign_engraver::process_acknowledged_grobs () { breathing_sign_ = make_item ("BreathingSign"); - announce_grob(breathing_sign_, breathing_sign_req_->self_scm()); + announce_grob (breathing_sign_, breathing_sign_req_->self_scm ()); breathing_sign_req_ = 0; } } @@ -73,7 +73,7 @@ Breathing_sign_engraver::stop_translation_timestep () } -ENTER_DESCRIPTION(Breathing_sign_engraver, +ENTER_DESCRIPTION (Breathing_sign_engraver, /* descr */ "", /* creats*/ "BreathingSign", /* accepts */ "breathing-event", diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 262316178b..489a32296f 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -190,6 +190,6 @@ Breathing_sign::offset_callback (SCM element_smob, SCM) return gh_double2scm (inter_f * sz * d); } -ADD_INTERFACE(Breathing_sign, "breathing-sign-interface", +ADD_INTERFACE (Breathing_sign, "breathing-sign-interface", "A breathing sign.", "direction"); diff --git a/lily/chord-name-engraver.cc b/lily/chord-name-engraver.cc index 0cfac615fa..a13f527601 100644 --- a/lily/chord-name-engraver.cc +++ b/lily/chord-name-engraver.cc @@ -21,7 +21,7 @@ class Chord_name_engraver : public Engraver { - TRANSLATOR_DECLARATIONS( Chord_name_engraver); + TRANSLATOR_DECLARATIONS ( Chord_name_engraver); protected: virtual void stop_translation_timestep (); virtual void process_music (); @@ -57,7 +57,7 @@ Chord_name_engraver::add_note (Music * n) void Chord_name_engraver::process_music () { - if (!notes_.size() ) + if (!notes_.size () ) return; SCM bass = SCM_EOL; @@ -110,8 +110,8 @@ Chord_name_engraver::process_music () SCM chord_as_scm = gh_cons (pitches, gh_cons (bass, inversion)); chord_name_ = make_item ("ChordName"); - chord_name_->set_property("text", markup); - announce_grob(chord_name_, notes_[0]->self_scm ()); + chord_name_->set_property ("text", markup); + announce_grob (chord_name_, notes_[0]->self_scm ()); SCM s = get_property ("chordChanges"); if (to_boolean (s) && gh_pair_p (last_chord_) && gh_equal_p (chord_as_scm, last_chord_)) @@ -149,7 +149,7 @@ Chord_name_engraver::stop_translation_timestep () The READs description is not strictly accurate: which properties are read depend on the chord naming function active. */ -ENTER_DESCRIPTION(Chord_name_engraver, +ENTER_DESCRIPTION (Chord_name_engraver, /* descr */ "Catch note-events " "and generate the appropriate chordname.", /* creats*/ "ChordName", diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index 8c16d48041..8ab127d5eb 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -42,7 +42,7 @@ class Chord_tremolo_engraver : public Engraver { void typeset_beam (); - TRANSLATOR_DECLARATIONS(Chord_tremolo_engraver); + TRANSLATOR_DECLARATIONS (Chord_tremolo_engraver); protected: Repeated_music * repeat_; @@ -130,14 +130,14 @@ Chord_tremolo_engraver::process_music () Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); beam_start_location_ = mp; - announce_grob(beam_, repeat_->self_scm()); + announce_grob (beam_, repeat_->self_scm ()); } else if (!sequential_body_b_ && !stem_tremolo_) { if (flags_) { stem_tremolo_ = make_item ("StemTremolo"); - announce_grob(stem_tremolo_, repeat_->self_scm()); + announce_grob (stem_tremolo_, repeat_->self_scm ()); stem_tremolo_->set_property ("flag-count", scm_int2num (flags_)); } @@ -172,7 +172,7 @@ Chord_tremolo_engraver::acknowledge_grob (Grob_info info) { Grob * s = info.grob_; - if (start_mom_ == now_mom()) + if (start_mom_ == now_mom ()) Stem::set_beaming (s, flags_, RIGHT); else Stem::set_beaming (s, flags_, LEFT); @@ -229,7 +229,7 @@ Chord_tremolo_engraver::stop_translation_timestep () -ENTER_DESCRIPTION(Chord_tremolo_engraver, +ENTER_DESCRIPTION (Chord_tremolo_engraver, /* descr */ "Generates beams for tremolo repeats.", /* creats*/ "Beam", /* accepts */ "repeated-music", diff --git a/lily/chord-tremolo-iterator.cc b/lily/chord-tremolo-iterator.cc index 050d5043ce..d9bb1f3963 100644 --- a/lily/chord-tremolo-iterator.cc +++ b/lily/chord-tremolo-iterator.cc @@ -21,7 +21,7 @@ void Chord_tremolo_iterator::construct_children () { Repeated_music * rep = dynamic_cast (get_music ()); - factor_ = Moment (Rational(1, 1)); + factor_ = Moment (Rational (1, 1)); child_iter_ = unsmob_iterator (get_iterator (rep->body ())); } @@ -32,17 +32,17 @@ Chord_tremolo_iterator::Chord_tremolo_iterator () } void -Chord_tremolo_iterator::do_quit() +Chord_tremolo_iterator::do_quit () { if (child_iter_) - child_iter_->quit(); + child_iter_->quit (); } void Chord_tremolo_iterator::derived_mark () const { if (child_iter_) - scm_gc_mark (child_iter_->self_scm()); + scm_gc_mark (child_iter_->self_scm ()); } void diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 7e2590907b..65400b8ce0 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -21,7 +21,7 @@ class Clef_engraver : public Engraver { public: - TRANSLATOR_DECLARATIONS(Clef_engraver); + TRANSLATOR_DECLARATIONS (Clef_engraver); Direction octave_dir_; @@ -87,7 +87,7 @@ Clef_engraver::create_clef () if (!clef_) { Item *c= make_item ("Clef"); - announce_grob(c, SCM_EOL); + announce_grob (c, SCM_EOL); clef_ = c; SCM cpos = get_property ("clefPosition"); @@ -113,7 +113,7 @@ Clef_engraver::create_clef () g->set_parent (clef_, X_AXIS); g->set_property ("direction", scm_int2num (dir)); octavate_ = g; - announce_grob(octavate_, SCM_EOL); + announce_grob (octavate_, SCM_EOL); } } } @@ -190,7 +190,7 @@ Clef_engraver::stop_translation_timestep () -ENTER_DESCRIPTION(Clef_engraver, +ENTER_DESCRIPTION (Clef_engraver, /* descr */ "Determine and set reference point for pitches", /* creats*/ "Clef OctavateEight", /* accepts */ "", diff --git a/lily/cluster-engraver.cc b/lily/cluster-engraver.cc index 0988829f26..c671717be1 100644 --- a/lily/cluster-engraver.cc +++ b/lily/cluster-engraver.cc @@ -17,7 +17,7 @@ class Cluster_spanner_engraver : public Engraver { protected: - TRANSLATOR_DECLARATIONS(Cluster_spanner_engraver); + TRANSLATOR_DECLARATIONS (Cluster_spanner_engraver); virtual bool try_music (Music *); virtual void process_music (); virtual void acknowledge_grob (Grob_info); @@ -78,7 +78,7 @@ Cluster_spanner_engraver::try_music (Music *m) void Cluster_spanner_engraver::process_music () { - if (cluster_notes_.size()) + if (cluster_notes_.size ()) { SCM c0scm = get_property ("centralCPosition"); @@ -122,7 +122,7 @@ Cluster_spanner_engraver::stop_translation_timestep () { typeset_grobs (); - cluster_notes_.clear(); + cluster_notes_.clear (); } @@ -136,7 +136,7 @@ Cluster_spanner_engraver::acknowledge_grob (Grob_info info) } } -ENTER_DESCRIPTION(Cluster_spanner_engraver, +ENTER_DESCRIPTION (Cluster_spanner_engraver, /* descr */ "Engraves a cluster using Spanner notation ", /* creats*/ "ClusterSpanner ClusterSpannerBeacon", /* accepts */ "cluster-note-event", diff --git a/lily/cluster.cc b/lily/cluster.cc index 6c11ff1aa6..a95467e0b0 100644 --- a/lily/cluster.cc +++ b/lily/cluster.cc @@ -48,8 +48,8 @@ brew_cluster_piece (Grob *me, Array bottom_points, Array top_poi else { programming_error ("#'style should be symbol."); - me->suicide(); - return Stencil(); + me->suicide (); + return Stencil (); } @@ -63,7 +63,7 @@ brew_cluster_piece (Grob *me, Array bottom_points, Array top_poi { Box box; box.add_point (bottom_points[i] - hvpadding); - box.add_point (Offset(top_points[i + 1][X_AXIS], + box.add_point (Offset (top_points[i + 1][X_AXIS], top_points[i][Y_AXIS]) + hvpadding); out.add_stencil (Lookup::round_filled_box (box, blotdiameter)); } @@ -73,7 +73,7 @@ brew_cluster_piece (Grob *me, Array bottom_points, Array top_poi for (int i = 0; i < size - 1; i++) { Box box; - box.add_point (Offset(bottom_points[i][X_AXIS], + box.add_point (Offset (bottom_points[i][X_AXIS], bottom_points[i + 1][Y_AXIS]) - hvpadding); box.add_point (top_points[i + 1] + hvpadding); out.add_stencil (Lookup::round_filled_box (box, blotdiameter)); @@ -134,7 +134,7 @@ Cluster::print (SCM smob) Spanner *spanner = dynamic_cast (me); if (!spanner) { - me->programming_error ("Cluster::print(): not a spanner"); + me->programming_error ("Cluster::print (): not a spanner"); return SCM_EOL; } @@ -188,7 +188,7 @@ Cluster::print (SCM smob) { Spanner *orig = dynamic_cast (spanner->original_); - if (spanner->get_break_index () < orig->broken_intos_.size()-1) + if (spanner->get_break_index () < orig->broken_intos_.size ()-1) { Spanner * next = orig->broken_intos_[spanner->get_break_index () + 1]; SCM cols = next->get_property ("columns"); diff --git a/lily/coherent-ligature-engraver.cc b/lily/coherent-ligature-engraver.cc index 956df39cbe..3c36448914 100644 --- a/lily/coherent-ligature-engraver.cc +++ b/lily/coherent-ligature-engraver.cc @@ -28,7 +28,7 @@ * * - collect all accidentals that occur within the ligature and put * them at the left side of the ligature (TODO; see function - * collect_accidentals()), + * collect_accidentals ()), * * - collapse superflous space after each ligature (TODO). * @@ -60,11 +60,11 @@ * of the ligature (to preemptively avoid collision with adjacent * notes); or maybe just additionally create a * mensural/vaticana/whatever-ligature grob (e.g. via - * Mensural_ligature::print(SCM)) that just consists of a + * Mensural_ligature::print (SCM)) that just consists of a * bounding box around all primitives of the ligature. * - * TODO: Maybe move functions fold_up_primitives() and - * join_primitives() from subclasses to here? N.B. it is not + * TODO: Maybe move functions fold_up_primitives () and + * join_primitives () from subclasses to here? N.B. it is not * appropriate to put these into Ligature_engraver, since, for * example, Ligature_bracket_engraver does not share any of this code. */ @@ -73,7 +73,7 @@ * TODO: Let superflous space after each ligature collapse. The * following code should help in doing so (though it does not yet * fully work). Just put the following code into - * Spacing_spanner::do_measure(). I put it temporarily here as memo + * Spacing_spanner::do_measure (). I put it temporarily here as memo * until it really works and I also get Han-Wen's/Jan's permission to * add it to the spacing spanner code. */ @@ -139,7 +139,7 @@ Coherent_ligature_engraver::get_set_column (Item *item, Paper_column *column) sibling_parent->warning (_f ("Coherent_ligature_engraver: " "setting `spacing-increment = " "0.01': ptr=%ul", parent)); - sibling_parent->set_property("forced-spacing", + sibling_parent->set_property ("forced-spacing", gh_double2scm (0.01)); #endif sibling->set_parent (column, X_AXIS); @@ -175,7 +175,7 @@ compute_delta_pitches (Array primitives) int prev_pitch = 0; int delta_pitch = 0; Item *prev_primitive = 0, *primitive = 0; - for (int i = 0; i < primitives.size(); i++) { + for (int i = 0; i < primitives.size (); i++) { primitive = dynamic_cast (primitives[i].grob_); Music *music_cause = primitives[i].music_cause (); int pitch = diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index 0110973933..2a0b1dea2f 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -25,7 +25,7 @@ protected: virtual void process_acknowledged_grobs (); virtual void stop_translation_timestep (); public: - TRANSLATOR_DECLARATIONS(Collision_engraver); + TRANSLATOR_DECLARATIONS (Collision_engraver); }; @@ -76,7 +76,7 @@ Collision_engraver::Collision_engraver () -ENTER_DESCRIPTION(Collision_engraver, +ENTER_DESCRIPTION (Collision_engraver, /* descr */ "", /* creats*/ "NoteCollision", /* accepts */ "", diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index f87cf8119f..c4afba07d6 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -26,7 +26,7 @@ When we catch the note, we predict the end of the note. We keep the events living until we reach the predicted end-time. - Every time process_music() is called and there are note events, we + Every time process_music () is called and there are note events, we figure out how long the note to typeset should be. It should be no longer than what's specified, than what is left to do and it should not cross barlines. @@ -54,7 +54,7 @@ class Completion_heads_engraver : public Engraver Duration find_nearest_duration (Rational length); public: - TRANSLATOR_DECLARATIONS(Completion_heads_engraver); + TRANSLATOR_DECLARATIONS (Completion_heads_engraver); protected: virtual void initialize (); @@ -79,7 +79,7 @@ Completion_heads_engraver::try_music (Music *m) first_b_ = true; Moment musiclen = m->get_length (); - Moment now = now_mom(); + Moment now = now_mom (); if (now_mom ().grace_part_) { @@ -122,7 +122,7 @@ Completion_heads_engraver::find_nearest_duration (Rational length) { int log_limit= 6; - Duration d(0,0); + Duration d (0,0); /* this could surely be done more efficient. Left to the reader as an @@ -209,7 +209,7 @@ Completion_heads_engraver::process_music () Item *note = make_item ("NoteHead"); Music * req = note_reqs_[i]; - if (scratch_note_reqs_.size()) + if (scratch_note_reqs_.size ()) { req = scratch_note_reqs_[i]; SCM pits = note_reqs_[i]->get_property ("pitch"); @@ -249,9 +249,9 @@ Completion_heads_engraver::process_music () notes_.push (note); } - if (prev_notes_.size() == notes_.size ()) + if (prev_notes_.size () == notes_.size ()) { - for (int i= 0; i < notes_.size(); i++) + for (int i= 0; i < notes_.size (); i++) { Grob * p = make_spanner ("Tie"); Tie::set_interface (p); // cannot remove yet! @@ -260,7 +260,7 @@ Completion_heads_engraver::process_music () Tie::set_head (p, RIGHT, notes_[i]); ties_.push (p); - announce_grob(p, SCM_EOL); + announce_grob (p, SCM_EOL); } } @@ -270,7 +270,7 @@ Completion_heads_engraver::process_music () don't do complicated arithmetic with grace notes. */ if (orig - && now_mom().grace_part_ ) + && now_mom ().grace_part_ ) { left_to_do_ = Rational (0,0); } @@ -281,13 +281,13 @@ Completion_heads_engraver::stop_translation_timestep () { for (int i = ties_.size (); i--;) typeset_grob (ties_[i]); - ties_.clear(); + ties_.clear (); for (int i=0; i < notes_.size (); i++) { typeset_grob (notes_[i]); } - if (notes_.size()) + if (notes_.size ()) prev_notes_ = notes_; notes_.clear (); @@ -297,12 +297,12 @@ Completion_heads_engraver::stop_translation_timestep () } dots_.clear (); - for (int i = scratch_note_reqs_.size(); i--;) + for (int i = scratch_note_reqs_.size (); i--;) { scm_gc_unprotect_object (scratch_note_reqs_[i]->self_scm () ); } - scratch_note_reqs_.clear(); + scratch_note_reqs_.clear (); } void @@ -316,11 +316,11 @@ Completion_heads_engraver::start_translation_timestep () } } -Completion_heads_engraver::Completion_heads_engraver() +Completion_heads_engraver::Completion_heads_engraver () { } -ENTER_DESCRIPTION(Completion_heads_engraver, +ENTER_DESCRIPTION (Completion_heads_engraver, /* descr */ "This engraver replaces " "@code{Note_heads_engraver}. It plays some trickery to " "break long notes and automatically tie them into the next measure.", diff --git a/lily/context-def.cc b/lily/context-def.cc index 05c19af47a..89b5536a50 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -7,6 +7,11 @@ */ +/* + TODO: should junk this class an replace by + a single list of context modifications? + */ + #include "lily-proto.hh" #include "context-def.hh" #include "translator-group.hh" @@ -53,7 +58,7 @@ Context_def::Context_def () context_name_ = SCM_EOL; description_ = SCM_EOL; - smobify_self(); + smobify_self (); } Context_def::~Context_def () @@ -71,7 +76,7 @@ Context_def::Context_def (Context_def const & s) context_name_ = SCM_EOL; description_ = SCM_EOL; - smobify_self(); + smobify_self (); description_ = s.description_; accept_mods_ = s.accept_mods_; @@ -209,7 +214,7 @@ Context_def::path_to_acceptable_context (SCM type_sym, Music_output_def* odef) c this following line was added in 1.9.3, but hsould've been there all along... Let's hope it doesn't cause nightmares. */ - best_depth = result.size(); + best_depth = result.size (); } } @@ -287,7 +292,7 @@ Context_def::clone_scm () const { Context_def * t = new Context_def (*this); - SCM x = t->self_scm(); + SCM x = t->self_scm (); scm_gc_unprotect_object (x); return x; } @@ -297,7 +302,7 @@ Context_def::make_scm () { Context_def* t = new Context_def; - SCM x =t->self_scm(); + SCM x =t->self_scm (); scm_gc_unprotect_object (x); return x; } diff --git a/lily/context-specced-music-iterator.cc b/lily/context-specced-music-iterator.cc index de231fe5c3..dc4992e36c 100644 --- a/lily/context-specced-music-iterator.cc +++ b/lily/context-specced-music-iterator.cc @@ -14,7 +14,7 @@ class Context_specced_music_iterator : public Music_wrapper_iterator { public: - DECLARE_SCHEME_CALLBACK(constructor,()); + DECLARE_SCHEME_CALLBACK (constructor,()); virtual void construct_children (); }; @@ -35,6 +35,6 @@ Context_specced_music_iterator::construct_children () if (a) set_translator (a); - Music_wrapper_iterator::construct_children(); + Music_wrapper_iterator::construct_children (); } -IMPLEMENT_CTOR_CALLBACK(Context_specced_music_iterator); +IMPLEMENT_CTOR_CALLBACK (Context_specced_music_iterator); diff --git a/lily/context.cc b/lily/context.cc index ef1d23ed6f..e704a4463b 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -68,7 +68,7 @@ Context::add_context (Context*t) Context_def * td = unsmob_context_def (t->definition_); /* - this can not move before add_context(), because \override + this can not move before add_context (), because \override operations require that we are in the hierarchy. */ td->apply_default_property_operations (t); @@ -326,7 +326,7 @@ find_context_below (Context * where, SCM Context::properties_as_alist () const { - return properties_dict()->to_alist(); + return properties_dict ()->to_alist (); } String @@ -355,7 +355,7 @@ Context::get_output_def () const ? daddy_context_->get_output_def () : 0; } -Context::~Context() +Context::~Context () { } @@ -363,7 +363,7 @@ Context::~Context() Moment Context::now_mom () const { - return daddy_context_->now_mom(); + return daddy_context_->now_mom (); } int @@ -410,7 +410,7 @@ Context::mark_smob (SCM sm) IMPLEMENT_SMOBS (Context); IMPLEMENT_DEFAULT_EQUAL_P (Context); -IMPLEMENT_TYPE_P(Context,"ly:context?"); +IMPLEMENT_TYPE_P (Context,"ly:context?"); bool Context::try_music (Music* m) diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index 08e34c082e..1b369d3c3c 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -24,7 +24,7 @@ class Custos_engraver : public Engraver { public: -TRANSLATOR_DECLARATIONS( Custos_engraver); + TRANSLATOR_DECLARATIONS (Custos_engraver); virtual void start_translation_timestep (); virtual void acknowledge_grob (Grob_info); virtual void process_acknowledged_grobs (); @@ -73,7 +73,7 @@ Custos_engraver::acknowledge_grob (Grob_info info) Item *item = dynamic_cast (info.grob_); if (item) { - Music * m = info.music_cause(); + Music * m = info.music_cause (); if (Bar_line::has_interface (info.grob_)) custos_permitted = true; else if (Note_head::has_interface (info.grob_) @@ -126,7 +126,7 @@ Custos_engraver::create_custos () { Item* custos = make_item ("Custos"); - announce_grob(custos, SCM_EOL); + announce_grob (custos, SCM_EOL); custodes_.push (custos); return custos; @@ -145,7 +145,7 @@ Custos_engraver::finalize () -ENTER_DESCRIPTION(Custos_engraver, +ENTER_DESCRIPTION (Custos_engraver, /* descr */ "", /* creats*/ "Custos", /* accepts */ "", diff --git a/lily/dot-column-engraver.cc b/lily/dot-column-engraver.cc index ae36be53b6..8ee8850614 100644 --- a/lily/dot-column-engraver.cc +++ b/lily/dot-column-engraver.cc @@ -20,8 +20,7 @@ class Dot_column_engraver : public Engraver Grob * stem_; Link_array heads_; public: - TRANSLATOR_DECLARATIONS( - Dot_column_engraver ); + TRANSLATOR_DECLARATIONS (Dot_column_engraver ); protected: virtual void acknowledge_grob (Grob_info); @@ -65,7 +64,7 @@ Dot_column_engraver::acknowledge_grob (Grob_info info) if (!dotcol_) { dotcol_ = make_item ("DotColumn"); - announce_grob(dotcol_, SCM_EOL); + announce_grob (dotcol_, SCM_EOL); } Dot_column::add_head (dotcol_, info.grob_); @@ -79,7 +78,7 @@ Dot_column_engraver::acknowledge_grob (Grob_info info) -ENTER_DESCRIPTION(Dot_column_engraver, +ENTER_DESCRIPTION (Dot_column_engraver, /* descr */ " Engraves dots on dotted notes shifted to the right of the note.\n" "If omitted, then dots appear on top of the notes.", /* creats*/ "DotColumn", diff --git a/lily/dot-column.cc b/lily/dot-column.cc index 1295dc3cb5..46448cd95f 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -41,7 +41,7 @@ Dot_column::force_shift_callback (SCM element_smob, SCM axis) return gh_double2scm (0.0); } -MAKE_SCHEME_CALLBACK(Dot_column,side_position, 2); +MAKE_SCHEME_CALLBACK (Dot_column,side_position, 2); SCM Dot_column::side_position (SCM element_smob, SCM axis) { diff --git a/lily/drum-note-engraver.cc b/lily/drum-note-engraver.cc index ac6d359874..fd0464e687 100644 --- a/lily/drum-note-engraver.cc +++ b/lily/drum-note-engraver.cc @@ -23,7 +23,7 @@ class Drum_notes_engraver : public Engraver Link_array events_; public: - TRANSLATOR_DECLARATIONS(Drum_notes_engraver); + TRANSLATOR_DECLARATIONS (Drum_notes_engraver); protected: virtual bool try_music (Music *ev) ; @@ -32,7 +32,7 @@ protected: virtual void stop_translation_timestep (); }; -Drum_notes_engraver::Drum_notes_engraver() +Drum_notes_engraver::Drum_notes_engraver () { } @@ -122,7 +122,7 @@ Drum_notes_engraver::process_music () - announce_grob (note,ev->self_scm()); + announce_grob (note,ev->self_scm ()); notes_.push (note); } } @@ -187,7 +187,7 @@ Drum_notes_engraver::stop_translation_timestep () -ENTER_DESCRIPTION(Drum_notes_engraver, +ENTER_DESCRIPTION (Drum_notes_engraver, /* descr */ "Generate noteheads.", /* creats*/ "NoteHead Dots Script", /* accepts */ "note-event busy-playing-event", diff --git a/lily/drum-note-performer.cc b/lily/drum-note-performer.cc index b2fc142b4a..e5888fcfbc 100644 --- a/lily/drum-note-performer.cc +++ b/lily/drum-note-performer.cc @@ -15,7 +15,7 @@ class Drum_note_performer : public Performer { public: - TRANSLATOR_DECLARATIONS(Drum_note_performer); + TRANSLATOR_DECLARATIONS (Drum_note_performer); protected: virtual bool try_music (Music *ev) ; @@ -109,10 +109,10 @@ Drum_note_performer::try_music (Music* ev) return false; } -ENTER_DESCRIPTION(Drum_note_performer, +ENTER_DESCRIPTION (Drum_note_performer, "Play drum notes.","", "note-event busy-playing-event","","",""); -Drum_note_performer::Drum_note_performer() +Drum_note_performer::Drum_note_performer () { } diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 68f8b56f14..bb7e3a6cb5 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -56,7 +56,7 @@ class Dynamic_engraver : public Engraver void typeset_all (); -TRANSLATOR_DECLARATIONS(Dynamic_engraver ); +TRANSLATOR_DECLARATIONS (Dynamic_engraver ); protected: virtual void finalize (); @@ -119,7 +119,7 @@ Dynamic_engraver::process_music () Music * rq = accepted_spanreqs_drul_[START]; if (script_ev_) rq = script_ev_ ; - announce_grob(line_spanner_, rq ? rq->self_scm(): SCM_EOL); + announce_grob (line_spanner_, rq ? rq->self_scm (): SCM_EOL); } } @@ -150,7 +150,7 @@ Dynamic_engraver::process_music () Axis_group_interface::add_element (line_spanner_, script_); - announce_grob(script_, script_ev_->self_scm()); + announce_grob (script_, script_ev_->self_scm ()); } Music *stop_ev = accepted_spanreqs_drul_ [STOP] ? @@ -180,7 +180,7 @@ Dynamic_engraver::process_music () } else if (accepted_spanreqs_drul_[STOP] ) { - accepted_spanreqs_drul_[STOP]->origin ()->warning(_ ("can't find start of (de)crescendo")); + accepted_spanreqs_drul_[STOP]->origin ()->warning (_ ("can't find start of (de)crescendo")); stop_ev = 0; } @@ -262,7 +262,7 @@ Dynamic_engraver::process_music () add_bound_item (line_spanner_, cresc_->get_bound (LEFT)); - announce_grob(cresc_, accepted_spanreqs_drul_[START]->self_scm()); + announce_grob (cresc_, accepted_spanreqs_drul_[START]->self_scm ()); } } } @@ -289,7 +289,7 @@ Dynamic_engraver::finalize () typeset_all (); if (line_spanner_ - && !line_spanner_->live()) + && !line_spanner_->live ()) line_spanner_ = 0; if (line_spanner_) { @@ -298,7 +298,7 @@ Dynamic_engraver::finalize () } if (cresc_ - && !cresc_->live()) + && !cresc_->live ()) cresc_ = 0; if (cresc_) { @@ -318,10 +318,10 @@ Dynamic_engraver::typeset_all () Maybe just check at typeset_grob ()? */ if (finished_cresc_ - && !finished_cresc_->live()) + && !finished_cresc_->live ()) finished_cresc_ = 0; if (finished_line_spanner_ - && !finished_line_spanner_->live()) + && !finished_line_spanner_->live ()) finished_line_spanner_ = 0; if (finished_cresc_) @@ -391,7 +391,7 @@ Dynamic_engraver::acknowledge_grob (Grob_info i) { if (line_spanner_ /* Don't refill killed spanner */ - && line_spanner_->live()) + && line_spanner_->live ()) { Side_position_interface::add_support (line_spanner_,i.grob_); add_bound_item (line_spanner_,dynamic_cast (i.grob_)); @@ -422,7 +422,7 @@ Dynamic_engraver::acknowledge_grob (Grob_info i) } } } -ENTER_DESCRIPTION(Dynamic_engraver, +ENTER_DESCRIPTION (Dynamic_engraver, /* descr */ "This engraver creates hairpins, dynamic texts, and their vertical\n" "alignments. The symbols are collected onto a DynamicLineSpanner grob\n" diff --git a/lily/dynamic-performer.cc b/lily/dynamic-performer.cc index ba604af615..97641a7297 100644 --- a/lily/dynamic-performer.cc +++ b/lily/dynamic-performer.cc @@ -21,7 +21,7 @@ class Dynamic_performer : public Performer { public: - TRANSLATOR_DECLARATIONS(Dynamic_performer); + TRANSLATOR_DECLARATIONS (Dynamic_performer); protected: virtual bool try_music (Music* req); virtual void stop_translation_timestep (); @@ -126,7 +126,7 @@ Dynamic_performer::try_music (Music* r) return false; } -ENTER_DESCRIPTION(Dynamic_performer, +ENTER_DESCRIPTION (Dynamic_performer, /*descr*/ "", /* creats*/ "", /* accepts */ "absolute-dynamic-event", diff --git a/lily/engraver-group-engraver.cc b/lily/engraver-group-engraver.cc index e82967ce34..76fd882088 100644 --- a/lily/engraver-group-engraver.cc +++ b/lily/engraver-group-engraver.cc @@ -86,7 +86,7 @@ Engraver_group_engraver::do_announces () engraver_each (get_simple_trans_list (), &Engraver::process_acknowledged_grobs); - if (!announce_infos_.size()) + if (!announce_infos_.size ()) break; acknowledge_grobs (); @@ -106,9 +106,9 @@ Engraver_group_engraver::initialize () Translator_group::initialize (); } -Engraver_group_engraver::Engraver_group_engraver() {} +Engraver_group_engraver::Engraver_group_engraver () {} -ENTER_DESCRIPTION(Engraver_group_engraver, +ENTER_DESCRIPTION (Engraver_group_engraver, /* descr */ "A group of engravers taken together", /* creats*/ "", /* accepts */ "", @@ -124,7 +124,7 @@ ENTER_DESCRIPTION(Engraver_group_engraver, bool engraver_valid (Translator*tr, SCM ifaces) { - SCM ack_ifs = scm_assoc (ly_symbol2scm ("interfaces-acked"), tr->translator_description()); + SCM ack_ifs = scm_assoc (ly_symbol2scm ("interfaces-acked"), tr->translator_description ()); ack_ifs = gh_cdr (ack_ifs); for (SCM s = ifaces; ly_pair_p (s); s = ly_cdr (s)) if (scm_memq (ly_car (s), ack_ifs) != SCM_BOOL_F) diff --git a/lily/engraver.cc b/lily/engraver.cc index 40d637ec04..886f3b199b 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -63,7 +63,7 @@ Engraver::typeset_grob (Grob*p) -Engraver::Engraver() +Engraver::Engraver () { } @@ -76,7 +76,7 @@ Engraver::get_score_engraver () const } -ENTER_DESCRIPTION(Engraver, +ENTER_DESCRIPTION (Engraver, "", "", "", "", "", ""); diff --git a/lily/event-chord-iterator.cc b/lily/event-chord-iterator.cc index 09a847bb24..08bb8fff89 100644 --- a/lily/event-chord-iterator.cc +++ b/lily/event-chord-iterator.cc @@ -53,7 +53,7 @@ Event_chord_iterator::process (Moment m) bool gotcha = try_music (mus); if (!gotcha) - mus->origin ()->warning (_f ("Junking event: `%s'", mus->name())); + mus->origin ()->warning (_f ("Junking event: `%s'", mus->name ())); } } Simple_music_iterator::process (m); diff --git a/lily/event.cc b/lily/event.cc index d7ca5581ea..3e31209692 100644 --- a/lily/event.cc +++ b/lily/event.cc @@ -89,13 +89,13 @@ Event::Event () { } -ADD_MUSIC(Event); -LY_DEFINE(ly_music_duration_length, "ly:music-duration-length", 1, 0,0, +ADD_MUSIC (Event); +LY_DEFINE (ly_music_duration_length, "ly:music-duration-length", 1, 0,0, (SCM mus), "Extract the duration field from @var{mus}, and return the length.") { - Music* m = unsmob_music(mus); - SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "Music"); + Music* m = unsmob_music (mus); + SCM_ASSERT_TYPE (m, mus, SCM_ARG1, __FUNCTION__, "Music"); Duration *d = unsmob_duration (m->get_property ("duration")); @@ -106,24 +106,24 @@ LY_DEFINE(ly_music_duration_length, "ly:music-duration-length", 1, 0,0, l = d->get_length (); } else - programming_error("Music has no duration"); - return l.smobbed_copy(); + programming_error ("Music has no duration"); + return l.smobbed_copy (); } -LY_DEFINE(ly_music_duration_compress, "ly:music-duration-compress", 2, 0,0, +LY_DEFINE (ly_music_duration_compress, "ly:music-duration-compress", 2, 0,0, (SCM mus, SCM factor), "Extract the duration field from @var{mus}, and compress it.") { - Music* m = unsmob_music(mus); + Music* m = unsmob_music (mus); Moment * f = unsmob_moment (factor); - SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "Music"); - SCM_ASSERT_TYPE(f, factor, SCM_ARG2, __FUNCTION__, "Moment"); + SCM_ASSERT_TYPE (m, mus, SCM_ARG1, __FUNCTION__, "Music"); + SCM_ASSERT_TYPE (f, factor, SCM_ARG2, __FUNCTION__, "Moment"); Duration *d = unsmob_duration (m->get_property ("duration")); if (d) - m->set_property ("duration", d->compressed (f->main_part_).smobbed_copy()); + m->set_property ("duration", d->compressed (f->main_part_).smobbed_copy ()); return SCM_UNSPECIFIED; } @@ -136,7 +136,7 @@ LY_DEFINE(ly_music_duration_compress, "ly:music-duration-compress", 2, 0,0, TODO: this should use ly:pitch. */ -LY_DEFINE(ly_transpose_key_alist, "ly:transpose-key-alist", +LY_DEFINE (ly_transpose_key_alist, "ly:transpose-key-alist", 2, 0,0, (SCM l, SCM pitch), "Make a new key alist of @var{l} transposed by pitch @var{pitch}") { @@ -167,7 +167,7 @@ LY_DEFINE(ly_transpose_key_alist, "ly:transpose-key-alist", orig = orig.transposed (*p); key =scm_int2num (orig.get_notename ()); - alter = scm_int2num (orig.get_alteration()); + alter = scm_int2num (orig.get_alteration ()); newlist = gh_cons (gh_cons (key, alter), newlist); } } @@ -179,7 +179,7 @@ Key_change_ev::transpose (Pitch p) { SCM pa = get_property ("pitch-alist"); - set_property ("pitch-alist", ly_transpose_key_alist (pa, p.smobbed_copy())); + set_property ("pitch-alist", ly_transpose_key_alist (pa, p.smobbed_copy ())); Pitch tonic = *unsmob_pitch (get_property ("tonic")); set_property ("tonic", tonic.smobbed_copy ()); diff --git a/lily/extender-engraver.cc b/lily/extender-engraver.cc index 10f677105e..e65bc5d5bd 100644 --- a/lily/extender-engraver.cc +++ b/lily/extender-engraver.cc @@ -21,7 +21,7 @@ class Extender_engraver : public Engraver Spanner* extender_; Spanner * pending_extender_; public: - TRANSLATOR_DECLARATIONS(Extender_engraver); + TRANSLATOR_DECLARATIONS (Extender_engraver); protected: virtual void acknowledge_grob (Grob_info); @@ -60,7 +60,7 @@ Extender_engraver::process_music () if (ev_) { extender_ = make_spanner ("LyricExtender"); - announce_grob (extender_, ev_->self_scm()); + announce_grob (extender_, ev_->self_scm ()); } } @@ -160,7 +160,7 @@ Extender_engraver::finalize () -ENTER_DESCRIPTION(Extender_engraver, +ENTER_DESCRIPTION (Extender_engraver, /* descr */ "Create lyric extenders", /* creats*/ "LyricExtender", /* accepts */ "extender-event", diff --git a/lily/figured-bass-engraver.cc b/lily/figured-bass-engraver.cc index aeb5c1e1fe..d5bb6aad24 100644 --- a/lily/figured-bass-engraver.cc +++ b/lily/figured-bass-engraver.cc @@ -15,7 +15,7 @@ source file of the GNU LilyPond music typesetter class Figured_bass_engraver : public Engraver { - TRANSLATOR_DECLARATIONS(Figured_bass_engraver); + TRANSLATOR_DECLARATIONS (Figured_bass_engraver); protected: Link_array figures_; Music * rest_req_; @@ -28,7 +28,7 @@ protected: }; -Figured_bass_engraver::Figured_bass_engraver() +Figured_bass_engraver::Figured_bass_engraver () { figure_ = 0; rest_req_ = 0; @@ -69,7 +69,7 @@ Figured_bass_engraver::process_music () if (rest_req_) { figure_ = make_item ("BassFigure"); - announce_grob(figure_, rest_req_->self_scm()); // todo + announce_grob (figure_, rest_req_->self_scm ()); // todo figure_->set_property ("text" , scm_makfrom0str ("-")); } else if (figures_.size ()) @@ -80,19 +80,19 @@ Figured_bass_engraver::process_music () SCM l = SCM_EOL; for (int i = 0; i self_scm(), l); + l = gh_cons (figures_[i]->self_scm (), l); SCM markup = scm_call_2 (proc, l, daddy_context_->self_scm ()); figure_ = make_item ("BassFigure"); figure_->set_property ("text", markup); - announce_grob(figure_, figures_[0]->self_scm()); // todo + announce_grob (figure_, figures_[0]->self_scm ()); // todo } } } -ENTER_DESCRIPTION(Figured_bass_engraver, +ENTER_DESCRIPTION (Figured_bass_engraver, /* descr */ "Make figured bass numbers.", /* creats*/ "BassFigure", /* accepts */ "rest-event bass-figure-event", diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index 867e93d382..1b8d53f792 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -22,7 +22,7 @@ class Fingering_engraver : public Engraver Link_array fingerings_; public: - TRANSLATOR_DECLARATIONS(Fingering_engraver); + TRANSLATOR_DECLARATIONS (Fingering_engraver); protected: virtual bool try_music (Music* m); virtual void stop_translation_timestep (); @@ -69,7 +69,7 @@ Fingering_engraver::acknowledge_grob (Grob_info inf) void Fingering_engraver::process_music () { - for (int i= reqs_.size(); i--;) + for (int i= reqs_.size (); i--;) { SCM dir = reqs_[i]->get_property ("direction"); make_script (to_dir (dir), reqs_[i], Y_AXIS, i); @@ -115,7 +115,7 @@ Fingering_engraver::make_script (Direction d, Music *r,Axis a, int i) SCM dig = r->get_property ("digit"); fingering->set_property ("text", scm_number_to_string (dig, gh_int2scm (10))); - announce_grob (fingering, r->self_scm()); + announce_grob (fingering, r->self_scm ()); fingerings_.push (fingering); } @@ -139,12 +139,12 @@ Fingering_engraver::start_translation_timestep () reqs_.clear (); } -Fingering_engraver::Fingering_engraver() +Fingering_engraver::Fingering_engraver () { } -ENTER_DESCRIPTION(Fingering_engraver, +ENTER_DESCRIPTION (Fingering_engraver, /* descr */ "Create fingering-scripts", /* creats*/ "Fingering", /* accepts */ "fingering-event", diff --git a/lily/folded-repeat-iterator.cc b/lily/folded-repeat-iterator.cc index 4767976066..8ec9103eb9 100644 --- a/lily/folded-repeat-iterator.cc +++ b/lily/folded-repeat-iterator.cc @@ -26,10 +26,10 @@ Folded_repeat_iterator::ok () const return main_iter_ || alternative_iter_; } void -Folded_repeat_iterator::do_quit() +Folded_repeat_iterator::do_quit () { - if (main_iter_)main_iter_->quit(); - if (alternative_iter_)alternative_iter_->quit(); + if (main_iter_)main_iter_->quit (); + if (alternative_iter_)alternative_iter_->quit (); } Moment @@ -82,7 +82,7 @@ Folded_repeat_iterator::process (Moment m) alternative_iter_->process (m - main_length_mom_); if (!alternative_iter_->ok ()) { - alternative_iter_->quit(); + alternative_iter_->quit (); alternative_iter_ =0; } } @@ -108,13 +108,13 @@ Folded_repeat_iterator::enter_alternative () ugh. */ Simultaneous_music_iterator * s = new Simultaneous_music_iterator; - s->separate_contexts_b_ = true; + s->create_separate_contexts_ = true; s->init_translator (mus, get_outlet ()); alternative_iter_ = s; alternative_iter_->construct_children (); - scm_gc_unprotect_object (s->self_scm()); + scm_gc_unprotect_object (s->self_scm ()); } } @@ -131,12 +131,12 @@ Folded_repeat_iterator::try_music_in_children (Music * m) const return 0; } void -Folded_repeat_iterator::derived_mark()const +Folded_repeat_iterator::derived_mark ()const { if (main_iter_) - scm_gc_mark (main_iter_->self_scm()); + scm_gc_mark (main_iter_->self_scm ()); if (alternative_iter_) - scm_gc_mark (alternative_iter_->self_scm()); + scm_gc_mark (alternative_iter_->self_scm ()); } void diff --git a/lily/font-metric.cc b/lily/font-metric.cc index 1d0428b278..915c1226a4 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -106,7 +106,7 @@ Font_metric::get_ascii_char (int) const Box Font_metric::get_indexed_char (int k) const { - return get_ascii_char(k); + return get_ascii_char (k); } @@ -133,7 +133,7 @@ Font_metric::mark_smob (SCM s) { Font_metric * m = (Font_metric*) SCM_CELL_WORD_1 (s); - m->derived_mark(); + m->derived_mark (); return m->description_; } @@ -162,15 +162,15 @@ Font_metric::find_by_name (String) const return m; } -LY_DEFINE(ly_find_glyph_by_name, "ly:find-glyph-by-name", 2 , 0, 0, +LY_DEFINE (ly_find_glyph_by_name, "ly:find-glyph-by-name", 2 , 0, 0, (SCM font, SCM name), "This function retrieves a Stencil for the glyph named @var{name} in " "@var{font}. The font must be available as an AFM file. If the glyph " "is not found, #f is returned. ") { Font_metric *fm = unsmob_metrics (font); - SCM_ASSERT_TYPE(fm, font, SCM_ARG1, __FUNCTION__, "font-metric"); - SCM_ASSERT_TYPE(gh_string_p (name), name, SCM_ARG2, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric"); + SCM_ASSERT_TYPE (gh_string_p (name), name, SCM_ARG2, __FUNCTION__, "string"); Stencil m = fm->find_by_name (ly_scm2string (name)); @@ -181,19 +181,19 @@ LY_DEFINE(ly_find_glyph_by_name, "ly:find-glyph-by-name", 2 , 0, 0, return m.smobbed_copy (); } -LY_DEFINE(ly_get_glyph, "ly:get-glyph", 2 , 0, 0, +LY_DEFINE (ly_get_glyph, "ly:get-glyph", 2 , 0, 0, (SCM font, SCM index), "This function retrieves a Stencil for the glyph numbered @var{index} in " "@var{font}. ") { Font_metric *fm = unsmob_metrics (font); - SCM_ASSERT_TYPE(fm, font, SCM_ARG1, __FUNCTION__, "font-metric"); - SCM_ASSERT_TYPE(gh_number_p (index), index, SCM_ARG2, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric"); + SCM_ASSERT_TYPE (gh_number_p (index), index, SCM_ARG2, __FUNCTION__, "number"); return fm->get_ascii_char_stencil (gh_scm2int (index)).smobbed_copy (); } -LY_DEFINE(ly_text_dimension,"ly:text-dimension", 2 , 0, 0, +LY_DEFINE (ly_text_dimension,"ly:text-dimension", 2 , 0, 0, (SCM font, SCM text), "Given the font metric in @var{font} and the string @var{text}, compute " "the extents of that text in that font. The return value is a pair of " @@ -201,12 +201,12 @@ LY_DEFINE(ly_text_dimension,"ly:text-dimension", 2 , 0, 0, { Box b; Font_metric *fm = unsmob_metrics (font); - SCM_ASSERT_TYPE(fm, font, SCM_ARG1, __FUNCTION__, "font-metric"); - SCM_ASSERT_TYPE(gh_string_p (text), text, SCM_ARG2, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric"); + SCM_ASSERT_TYPE (gh_string_p (text), text, SCM_ARG2, __FUNCTION__, "string"); b = fm->text_dimension (ly_scm2string (text)); - return gh_cons (ly_interval2scm (b[X_AXIS]), ly_interval2scm(b[Y_AXIS])); + return gh_cons (ly_interval2scm (b[X_AXIS]), ly_interval2scm (b[Y_AXIS])); } Stencil diff --git a/lily/font-size-engraver.cc b/lily/font-size-engraver.cc index 30e4fe86de..9066bee1f6 100644 --- a/lily/font-size-engraver.cc +++ b/lily/font-size-engraver.cc @@ -13,7 +13,7 @@ class Font_size_engraver : public Engraver { - TRANSLATOR_DECLARATIONS(Font_size_engraver); + TRANSLATOR_DECLARATIONS (Font_size_engraver); protected: virtual void acknowledge_grob (Grob_info gi); private: @@ -46,7 +46,7 @@ Font_size_engraver::acknowledge_grob (Grob_info gi) } -ENTER_DESCRIPTION(Font_size_engraver, +ENTER_DESCRIPTION (Font_size_engraver, /* descr */ "Puts fontSize into font-relative-size grob property.", /* creats*/ "", /* accepts */ "", diff --git a/lily/forbid-break-engraver.cc b/lily/forbid-break-engraver.cc index b2a5d802c5..a7bf47b2df 100644 --- a/lily/forbid-break-engraver.cc +++ b/lily/forbid-break-engraver.cc @@ -6,21 +6,21 @@ class Forbid_line_break_engraver : public Engraver { public: - TRANSLATOR_DECLARATIONS(Forbid_line_break_engraver); + TRANSLATOR_DECLARATIONS (Forbid_line_break_engraver); virtual void start_translation_timestep (); }; -Forbid_line_break_engraver::Forbid_line_break_engraver(){} +Forbid_line_break_engraver::Forbid_line_break_engraver (){} void -Forbid_line_break_engraver::start_translation_timestep() +Forbid_line_break_engraver::start_translation_timestep () { /* Check for running note heads. This should probably be done elsewhere. */ SCM busy = get_property ("busyGrobs"); - Moment now = now_mom(); + Moment now = now_mom (); while (gh_pair_p (busy) && unsmob_moment (gh_caar (busy))->main_part_ == now.main_part_) busy = gh_cdr (busy); @@ -30,14 +30,14 @@ Forbid_line_break_engraver::start_translation_timestep() Grob *g = unsmob_grob (gh_cdar (busy)); if (Rhythmic_head::has_interface (g)) { - get_score_engraver()->forbid_breaks(); + get_score_engraver ()->forbid_breaks (); } - busy = gh_cdr(busy); + busy = gh_cdr (busy); } } -ENTER_DESCRIPTION(Forbid_line_break_engraver, +ENTER_DESCRIPTION (Forbid_line_break_engraver, /* descr */ "Forbid line breaks when note heads are still playing at some point.", /* creats*/ "", /* accepts */ "", diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc index 46dbbfe572..b68f53c70b 100644 --- a/lily/function-documentation.cc +++ b/lily/function-documentation.cc @@ -22,7 +22,7 @@ void ly_add_function_documentation (SCM func, } -LY_DEFINE(ly_get_all_function_documentation, "ly:get-all-function-documentation", +LY_DEFINE (ly_get_all_function_documentation, "ly:get-all-function-documentation", 0,0,0, (), "Get a hash table with all lilypond Scheme extension functions.") { diff --git a/lily/glissando-engraver.cc b/lily/glissando-engraver.cc index efa2e3c159..795570866f 100644 --- a/lily/glissando-engraver.cc +++ b/lily/glissando-engraver.cc @@ -19,7 +19,7 @@ class Glissando_engraver : public Engraver { public: - TRANSLATOR_DECLARATIONS(Glissando_engraver); + TRANSLATOR_DECLARATIONS (Glissando_engraver); protected: virtual void acknowledge_grob (Grob_info); @@ -113,7 +113,7 @@ Glissando_engraver::finalize () -ENTER_DESCRIPTION(Glissando_engraver, +ENTER_DESCRIPTION (Glissando_engraver, /* descr */ "Engrave a glissandi", /* creats*/ "Glissando", /* accepts */ "glissando-event", diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 4b412a62a7..f2182e2eb5 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -167,7 +167,7 @@ Gourlay_breaking::do_solve () const /* do the last one */ if (breaks.size () % HAPPY_DOTS_I) - progress_indication (String ("[") + to_string (breaks.size()) + "]"); + progress_indication (String ("[") + to_string (breaks.size ()) + "]"); progress_indication ("\n"); @@ -197,7 +197,7 @@ Gourlay_breaking::do_solve () const Column_x_positions cp (optimal_paths[final_breaks[i]].line_config_); lines.push (cp); - if(!cp.satisfies_constraints_) + if (!cp.satisfies_constraints_) warning ("Could not find line breaking that satisfies constraints."); } return lines; diff --git a/lily/grace-iterator.cc b/lily/grace-iterator.cc index 3611d5fcac..2c000114c0 100644 --- a/lily/grace-iterator.cc +++ b/lily/grace-iterator.cc @@ -25,7 +25,7 @@ Grace_iterator::process (Moment m) Moment Grace_iterator::pending_moment () const { - Moment cp =Music_wrapper_iterator::pending_moment(); + Moment cp =Music_wrapper_iterator::pending_moment (); Moment pending; pending.grace_part_ = start_mom_.grace_part_ + cp.main_part_; diff --git a/lily/gregorian-ligature-engraver.cc b/lily/gregorian-ligature-engraver.cc index a11878c248..ed88e82def 100644 --- a/lily/gregorian-ligature-engraver.cc +++ b/lily/gregorian-ligature-engraver.cc @@ -85,7 +85,7 @@ void fix_prefix_set (int *current_set, int min_set, int max_set, Grob *primitive void check_and_fix_all_prefixes (Array primitives) { /* Check for illegal head modifier combinations */ - for (int i = 0; i < primitives.size(); i++) + for (int i = 0; i < primitives.size (); i++) { Grob *primitive = primitives[i].grob_; @@ -200,7 +200,7 @@ provide_context_info (Array primitives) int prev_prefix_set = 0; int prev_context_info = 0; int prev_pitch = 0; - for (int i = 0; i < primitives.size(); i++) { + for (int i = 0; i < primitives.size (); i++) { Grob *primitive = primitives[i].grob_; Music *music_cause = primitives[i].music_cause (); int context_info = 0; diff --git a/lily/grob-interface.cc b/lily/grob-interface.cc index 922bd0f23e..28efdfc8b5 100644 --- a/lily/grob-interface.cc +++ b/lily/grob-interface.cc @@ -15,16 +15,16 @@ void add_interface (const char * symbol, SCM l = parse_symbol_list (vars); - ly_add_interface(s,d,l); + ly_add_interface (s,d,l); } -LY_DEFINE(ly_add_interface, "ly:add-interface", 3,0,0, (SCM a, SCM b, SCM c), +LY_DEFINE (ly_add_interface, "ly:add-interface", 3,0,0, (SCM a, SCM b, SCM c), "Add an interface description.") { SCM_ASSERT_TYPE (gh_symbol_p (a), a, SCM_ARG1, __FUNCTION__, "symbol"); SCM_ASSERT_TYPE (gh_string_p (b), b, SCM_ARG2, __FUNCTION__, "string"); - SCM_ASSERT_TYPE (gh_list_p(c), c, SCM_ARG3, __FUNCTION__, "list of syms"); + SCM_ASSERT_TYPE (gh_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms"); if (!gh_vector_p (all_ifaces)) { all_ifaces = scm_make_vector (gh_int2scm (40), SCM_EOL); @@ -39,7 +39,7 @@ LY_DEFINE(ly_add_interface, "ly:add-interface", 3,0,0, (SCM a, SCM b, SCM c), } -LY_DEFINE(ly_all_grob_interfaces, "ly:all-grob-interfaces", +LY_DEFINE (ly_all_grob_interfaces, "ly:all-grob-interfaces", 0,0,0, (), "Get a hash table with all interface descriptions.") { @@ -66,7 +66,7 @@ check_interfaces_for_property (Grob const *me, SCM sym) if (iface == SCM_BOOL_F) { String msg = to_string ("Unknown interface `%s'", - ly_symbol2string (gh_car(ifs)).to_str0 ()); + ly_symbol2string (gh_car (ifs)).to_str0 ()); programming_error (msg); continue; } @@ -78,7 +78,7 @@ check_interfaces_for_property (Grob const *me, SCM sym) { String str = to_string ("Grob %s has no interface for property %s", me->name ().to_str0 (), - ly_symbol2string(sym).to_str0 ()); + ly_symbol2string (sym).to_str0 ()); programming_error (str); } } diff --git a/lily/grob-pitch-tuple.cc b/lily/grob-pitch-tuple.cc index e6b4f9cd73..fd3f9953c1 100644 --- a/lily/grob-pitch-tuple.cc +++ b/lily/grob-pitch-tuple.cc @@ -46,5 +46,5 @@ int Grob_pitch_tuple::time_compare (Grob_pitch_tuple const&h1, Grob_pitch_tuple const &h2) { - return Moment::compare(h1.end_, h2.end_); + return Moment::compare (h1.end_, h2.end_); } diff --git a/lily/grob-pq-engraver.cc b/lily/grob-pq-engraver.cc index db2abd46bd..abfa2af037 100644 --- a/lily/grob-pq-engraver.cc +++ b/lily/grob-pq-engraver.cc @@ -14,7 +14,7 @@ class Grob_pq_engraver: public Engraver { public: - TRANSLATOR_DECLARATIONS(Grob_pq_engraver); + TRANSLATOR_DECLARATIONS (Grob_pq_engraver); protected: virtual void initialize (); virtual void acknowledge_grob (Grob_info); @@ -23,7 +23,7 @@ protected: }; -Grob_pq_engraver::Grob_pq_engraver() +Grob_pq_engraver::Grob_pq_engraver () { } @@ -33,7 +33,7 @@ Grob_pq_engraver::initialize () daddy_context_->set_property ("busyGrobs", SCM_EOL); } -LY_DEFINE(ly_grob_pq_less_p, "ly:grob-pq-less?", +LY_DEFINE (ly_grob_pq_less_p, "ly:grob-pq-less?", 2, 0 ,0, (SCM a, SCM b), "Compare 2 Grob PQ entries. Internal") { @@ -66,7 +66,7 @@ Grob_pq_engraver::acknowledge_grob (Grob_info gi) Moment end = n + l; SCM lst = scm_acons (end.smobbed_copy (), - gi.grob_->self_scm(), + gi.grob_->self_scm (), SCM_EOL); SCM busy= get_property ("busyGrobs"); @@ -94,7 +94,7 @@ Grob_pq_engraver::stop_translation_timestep () void Grob_pq_engraver::start_translation_timestep () { - Moment now = now_mom(); + Moment now = now_mom (); SCM start_busy = get_property ("busyGrobs"); SCM busy = start_busy; @@ -104,9 +104,9 @@ Grob_pq_engraver::start_translation_timestep () Todo: do something sensible. The grob-pq-engraver is not water tight, and stuff like tupletSpannerDuration confuses it. */ - programming_error (_f("Skipped something?\nGrob %s ended before " + programming_error (_f ("Skipped something?\nGrob %s ended before " "I expected it to end.", - unsmob_grob (gh_cdar (busy))->name().to_str0())); + unsmob_grob (gh_cdar (busy))->name ().to_str0())); busy = gh_cdr (busy); } @@ -117,7 +117,7 @@ Grob_pq_engraver::start_translation_timestep () } -ENTER_DESCRIPTION(Grob_pq_engraver, +ENTER_DESCRIPTION (Grob_pq_engraver, /* descr */ "Administrate when certain grobs (eg. note heads) stop playing; this \ engraver is a sort-of a failure, since it doesn't handle all sorts of \ diff --git a/lily/grob-property.cc b/lily/grob-property.cc index ec83ef75b5..fd45e40c34 100644 --- a/lily/grob-property.cc +++ b/lily/grob-property.cc @@ -34,7 +34,7 @@ Grob::get_property_alist_chain (SCM def) const set_prop (name,cons (thing, get_prop (name))) - since it can reuse the handle returned by scm_assq(). + since it can reuse the handle returned by scm_assq (). */ void Grob::add_to_list_property (SCM sym, SCM thing) @@ -54,7 +54,7 @@ Grob::add_to_list_property (SCM sym, SCM thing) mutable prop list. */ handle = scm_sloppy_assq (sym, immutable_property_alist_); - SCM tail = (handle != SCM_BOOL_F) ? gh_cdr(handle) : SCM_EOL; + SCM tail = (handle != SCM_BOOL_F) ? gh_cdr (handle) : SCM_EOL; SCM val = gh_cons (thing, tail); mutable_property_alist_ = gh_cons (gh_cons (sym, val), diff --git a/lily/grob.cc b/lily/grob.cc index 255438c1a7..9bd0bfb389 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -53,9 +53,9 @@ Grob::Grob (SCM basicprops) mutable_property_alist_ = SCM_EOL; /* - We do smobify_self() as the first step. Since the object lives on + We do smobify_self () as the first step. Since the object lives on the heap, none of its SCM variables are protected from GC. After - smobify_self(), they are. + smobify_self (), they are. */ smobify_self (); @@ -74,7 +74,7 @@ Grob::Grob (SCM basicprops) */ bool itc = internal_type_checking_global_b; internal_type_checking_global_b = false; - internal_set_property (ly_symbol2scm ("interfaces"), gh_cdr(ifs)); + internal_set_property (ly_symbol2scm ("interfaces"), gh_cdr (ifs)); internal_type_checking_global_b = itc; } @@ -204,7 +204,7 @@ Grob::calculate_dependencies (int final, int busy, SCM funcname) Stencil * Grob::get_stencil () const { - if (!live()) + if (!live ()) { return 0; } @@ -310,8 +310,8 @@ Grob::handle_broken_dependencies () because some Spanners have enormously long lists in their properties. */ - for (SCM s = mutable_property_alist_; gh_pair_p(s); - s = gh_cdr(s)) + for (SCM s = mutable_property_alist_; gh_pair_p (s); + s = gh_cdr (s)) { sp->substitute_one_mutable_property (gh_caar (s), gh_cdar (s)); @@ -357,7 +357,7 @@ Grob::suicide () return; #if 0 // see below. - String nm = name(); + String nm = name (); #endif mutable_property_alist_ = SCM_EOL; @@ -572,7 +572,7 @@ common_refpoint_of_list (SCM elist, Grob *common, Axis a) Grob * common_refpoint_of_array (Link_array const &arr, Grob *common, Axis a) { - for (int i = arr.size() ; i--; ) + for (int i = arr.size () ; i--; ) { Grob * s = arr[i]; if (!s) @@ -671,7 +671,7 @@ Grob::fixup_refpoint (SCM smob) void Grob::warning (String s)const { - SCM cause = self_scm(); + SCM cause = self_scm (); while (Grob * g = unsmob_grob (cause)) { cause = g->get_property ("cause"); @@ -679,7 +679,7 @@ Grob::warning (String s)const if (Music *m = unsmob_music (cause)) { - m->origin()->warning (s); + m->origin ()->warning (s); } else ::warning (s); diff --git a/lily/horizontal-bracket.cc b/lily/horizontal-bracket.cc index 0164092e81..fdbdd05879 100644 --- a/lily/horizontal-bracket.cc +++ b/lily/horizontal-bracket.cc @@ -30,7 +30,7 @@ struct Horizontal_bracket */ -MAKE_SCHEME_CALLBACK(Horizontal_bracket, print, 1); +MAKE_SCHEME_CALLBACK (Horizontal_bracket, print, 1); SCM Horizontal_bracket::print (SCM smob) @@ -39,16 +39,16 @@ Horizontal_bracket::print (SCM smob) Spanner *sp = dynamic_cast (me); Link_array gs = Pointer_group_interface__extract_grobs (me,(Grob*)0, "columns"); - if (!gs.size()) + if (!gs.size ()) { - me->suicide(); + me->suicide (); return SCM_EOL; } Grob * cx = common_refpoint_of_array (gs, me, X_AXIS); cx = cx->common_refpoint (sp->get_bound (LEFT), X_AXIS); cx = cx->common_refpoint (sp->get_bound (RIGHT),X_AXIS); - Interval ext = gs.top()->extent (cx, X_AXIS); + Interval ext = gs.top ()->extent (cx, X_AXIS); ext.unite (gs[0]->extent (cx, X_AXIS)); Direction d = get_grob_direction (me); @@ -60,7 +60,7 @@ Horizontal_bracket::print (SCM smob) b.translate_axis ( - sp->get_bound (LEFT)->relative_coordinate (cx, X_AXIS), X_AXIS); - return b.smobbed_copy(); + return b.smobbed_copy (); } ADD_INTERFACE (Horizontal_bracket,"horizontal-bracket-interface", diff --git a/lily/include/simultaneous-music-iterator.hh b/lily/include/simultaneous-music-iterator.hh index a351ef50aa..0fdb31e688 100644 --- a/lily/include/simultaneous-music-iterator.hh +++ b/lily/include/simultaneous-music-iterator.hh @@ -22,7 +22,7 @@ public: DECLARE_SCHEME_CALLBACK(constructor, ()); /// make a new context for every child. - bool separate_contexts_b_; + bool create_separate_contexts_; virtual void construct_children (); virtual Moment pending_moment () const; diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc index 864473b135..ab35920c21 100644 --- a/lily/simultaneous-music-iterator.cc +++ b/lily/simultaneous-music-iterator.cc @@ -15,19 +15,19 @@ Simultaneous_music_iterator::Simultaneous_music_iterator () { - separate_contexts_b_ = false; + create_separate_contexts_ = false; children_list_ = SCM_EOL; } void -Simultaneous_music_iterator::derived_mark()const +Simultaneous_music_iterator::derived_mark () const { scm_gc_mark (children_list_); } void -Simultaneous_music_iterator::derived_substitute(Context *f,Context *t) +Simultaneous_music_iterator::derived_substitute (Context *f,Context *t) { for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr(s)) unsmob_iterator (gh_car (s))-> substitute_outlet (f,t); @@ -49,11 +49,11 @@ Simultaneous_music_iterator::construct_children () SCM scm_iter = get_static_get_iterator (mus); Music_iterator * mi = unsmob_iterator (scm_iter); - /* if separate_contexts_b_ is set, create a new context with the + /* if create_separate_contexts_ is set, create a new context with the number number as name */ SCM name = unsmob_context_def (get_outlet ()->definition_)->get_context_name (); - Context * t = (j && separate_contexts_b_) + Context * t = (j && create_separate_contexts_) ? get_outlet ()->find_create_context (name, to_string (j), SCM_EOL) : get_outlet (); @@ -77,7 +77,7 @@ void Simultaneous_music_iterator::process (Moment until) { SCM *proc = &children_list_; - while(gh_pair_p (*proc)) + while (gh_pair_p (*proc)) { Music_iterator * i = unsmob_iterator (gh_car (*proc)); if (i->run_always () @@ -155,5 +155,4 @@ Simultaneous_music_iterator::do_quit () unsmob_iterator (gh_car (s))->quit(); } - IMPLEMENT_CTOR_CALLBACK (Simultaneous_music_iterator); -- 2.39.2