From: Jan Nieuwenhuizen Date: Fri, 12 Aug 2005 00:04:47 +0000 (+0000) Subject: (parse_symbol_list): Bugfix. X-Git-Tag: release/2.7.5~18 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2c22efe5a46a37065b10c3f51c5d7db00d07d318;p=lilypond.git (parse_symbol_list): Bugfix. --- diff --git a/ChangeLog b/ChangeLog index f87cd78f6f..a7fa1361bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2005-08-12 Jan Nieuwenhuizen + * Remove obsolete files. Nitpick run. + * lily/lily-guile.cc (parse_symbol_list): Bugfix. 2005-08-11 Jan Nieuwenhuizen diff --git a/buildscripts/fixcc.py b/buildscripts/fixcc.py index 1075a52229..dc00e573c7 100644 --- a/buildscripts/fixcc.py +++ b/buildscripts/fixcc.py @@ -78,6 +78,9 @@ rules = { ('(return|=) (\*|&|-|!) ([\w\(])', '\\1 \\2\\3'), # space after `operator' ('(\Woperator) *([^\w\s])', '\\1 \\2'), + # delete gratuitous block + ('''\n( |\t)\s*{\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''', + '\n\\2;'), # dangling brace close ('\n[ \t]*(\n[ \t]*})', '\\1'), # dangling newline @@ -92,7 +95,7 @@ rules = { # dangling semicolon ('\n[ \t]*;', ';'), # delete gratuitous blocks - ('''(?ux)\n([ ]|\t\s*){\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''', + ('''xx\n([ ]|\t)\s*{\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''', '\n\\2;'), # brace open ('(\w)[ \t]*([^\s]*){([ \t]*\n)', '\\1\\2\n{\n'), @@ -595,22 +598,9 @@ i { if (foo) { - a = 1; + a = 1; } } - - if (prev_delta_pitch < - 1) - { - glyph_name = "svaticana.reverse.plica"; - } - if (prev_delta_pitch < - 1) - { - glyph_name = svaticana.reverse.plica; - } - if (prev_delta_pitch < - 1) - { - glyph_name = "2"; - } ''' def test (): diff --git a/flower/file-cookie.cc b/flower/file-cookie.cc index b216b8a1e4..c173b087bc 100644 --- a/flower/file-cookie.cc +++ b/flower/file-cookie.cc @@ -54,5 +54,4 @@ extern "C" { buf[0] = (char) c; return Memory_out_stream::writer (file, buf, 1); } - } /* extern C */ diff --git a/flower/file-name.cc b/flower/file-name.cc index ea36d4802b..af0cac2c2c 100644 --- a/flower/file-name.cc +++ b/flower/file-name.cc @@ -79,7 +79,6 @@ File_name::to_string () const return s; } - File_name::File_name (String file_name) { #ifdef __CYGWIN__ diff --git a/flower/file-path.cc b/flower/file-path.cc index ddadfaca5b..7803618483 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -55,8 +55,8 @@ is_file (String file_name) struct stat sbuf; if (stat (file_name.to_str0 (), &sbuf) != 0) return false; - - if (!(sbuf.st_mode & __S_IFREG)) + + if (! (sbuf.st_mode & __S_IFREG)) return false; #endif @@ -64,7 +64,7 @@ is_file (String file_name) struct stat sbuf; if (stat (file_name.to_str0 (), &sbuf) != 0) return false; - + return !S_ISDIR (sbuf.st_mode); #endif @@ -73,7 +73,7 @@ is_file (String file_name) fclose (f); return true; } - + return false; } @@ -84,7 +84,7 @@ is_dir (String file_name) struct stat sbuf; if (stat (file_name.to_str0 (), &sbuf) != 0) return false; - + return S_ISDIR (sbuf.st_mode); #endif @@ -120,7 +120,7 @@ File_path::find (String name) const File_name file_name (name); if (file_name.dir_[0] == DIRSEP && is_file (file_name.to_string ())) return file_name.to_string (); - + for (int i = 0; i < dirs_.size (); i++) { File_name file_name (name); @@ -129,7 +129,7 @@ File_path::find (String name) const dir.root_ = ""; if (file_name.dir_.is_empty ()) file_name.dir_ = dir.to_string (); - else if (!dir.to_string ().is_empty()) + else if (!dir.to_string ().is_empty ()) file_name.dir_ = dir.to_string () + ::to_string (DIRSEP) + file_name.dir_; if (is_file (file_name.to_string ())) @@ -141,7 +141,7 @@ File_path::find (String name) const /* Try to find - file.EXT, + file.EXT, where EXT is from EXTENSIONS. */ @@ -163,7 +163,7 @@ File_path::find (String name, char const *extensions[]) if (!find (file_name.to_string ()).is_empty ()) break; } - + /* Reshuffle extension */ file_name = File_name (file_name.to_string ()); } @@ -191,7 +191,7 @@ File_path::to_string () const for (int i = 0; i < dirs_.size (); i++) { s = s + dirs_[i]; - if (i < dirs_.size() - 1) + if (i < dirs_.size () - 1) s += ::to_string (PATHSEP); } return s; diff --git a/flower/getopt-long.cc b/flower/getopt-long.cc index f97b0bb2c4..5db40734be 100644 --- a/flower/getopt-long.cc +++ b/flower/getopt-long.cc @@ -241,9 +241,7 @@ Getopt_long::operator () () return parseshort (); } else - { - return 0; - } + return 0; } } diff --git a/flower/include/file-cookie.hh b/flower/include/file-cookie.hh index 571e4a74db..3945df90ed 100644 --- a/flower/include/file-cookie.hh +++ b/flower/include/file-cookie.hh @@ -2,14 +2,13 @@ extern "C" { #endif - #include #include #if (! defined (__off64_t) && ! defined (__off64_t_defined)) || ! defined (__cplusplus) #define off64_t unsigned long long #endif - + typedef struct { ssize_t (*read) (void *, char *, size_t); @@ -18,7 +17,6 @@ extern "C" { int (*close) (void *); } lily_cookie_io_functions_t; - void *lily_fopencookie (void *cookie, char const *modes, lily_cookie_io_functions_t io_funcs); diff --git a/flower/include/file-path.hh b/flower/include/file-path.hh index 918b981cf3..780b74c0dd 100644 --- a/flower/include/file-path.hh +++ b/flower/include/file-path.hh @@ -23,7 +23,7 @@ class File_path { - Array dirs_; + Array dirs_; public: Array directories () const; String find (String name) const; diff --git a/flower/include/guile-compatibility.hh b/flower/include/guile-compatibility.hh index a3a1a511f0..6fa3b32b88 100644 --- a/flower/include/guile-compatibility.hh +++ b/flower/include/guile-compatibility.hh @@ -24,7 +24,7 @@ inline SCM scm_car (SCM x) abort (); return SCM_CAR (x); } -#define SCM_I_CONSP(x) SCM_CONSP(x) +#define SCM_I_CONSP(x) SCM_CONSP (x) inline SCM scm_caar (SCM x) { return SCM_CAAR (x); } inline SCM scm_cdar (SCM x) { return SCM_CDAR (x); } inline SCM scm_cadr (SCM x) { return SCM_CADR (x); } diff --git a/flower/include/interval.hh b/flower/include/interval.hh index a6a92f204d..2d3bf41281 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -74,7 +74,7 @@ struct Interval_t : public Drul_array : Drul_array (src) { } - + Interval_t (T m, T M) : Drul_array (m, M) { } diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index 9aa70e4f19..6426b90b02 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -102,7 +102,6 @@ Interval_t::intersect (Interval_t h) } - template String Interval_t::to_string () const diff --git a/flower/include/libc-extension.hh b/flower/include/libc-extension.hh index 470eff774a..ff85fef841 100644 --- a/flower/include/libc-extension.hh +++ b/flower/include/libc-extension.hh @@ -36,7 +36,6 @@ int isinf (double x); #endif #endif - #if ! HAVE_MEMRCHR unsigned char *memrchr (unsigned char const *p, int n, char c); #endif diff --git a/flower/include/parray.hh b/flower/include/parray.hh index ee39225855..3e2c9bdd75 100644 --- a/flower/include/parray.hh +++ b/flower/include/parray.hh @@ -104,9 +104,7 @@ public: if (new_p) elem_ref (i) = new_p; else - { - unordered_del (i); - } + unordered_del (i); } void default_sort () { diff --git a/flower/include/parse-afm.hh b/flower/include/parse-afm.hh index 7f6a7c2125..3003339ee9 100644 --- a/flower/include/parse-afm.hh +++ b/flower/include/parse-afm.hh @@ -171,8 +171,8 @@ typedef struct _t_ligature */ typedef struct { - int code, /* key: C */ - wx, /* key: WX */ + int code, /* key: C */ + wx, /* key: WX */ wy; /* together wx and wy are associated with key: W */ char *name; /* key: N */ AFM_BBox charBBox; /* key: B */ diff --git a/flower/include/pqueue.hh b/flower/include/pqueue.hh index 548f663724..ae750e5ac8 100644 --- a/flower/include/pqueue.hh +++ b/flower/include/pqueue.hh @@ -73,10 +73,7 @@ public: j = i / 2; } else - - { - break; - } + break; } elt (i) = v; OK (); diff --git a/flower/include/real.hh b/flower/include/real.hh index 8a62bbceb9..966406f608 100644 --- a/flower/include/real.hh +++ b/flower/include/real.hh @@ -28,13 +28,11 @@ template inline int sign (T x) return 0; } - template inline T sqr (T x) { return x * x; } - inline Real distance (Real x, Real y) { diff --git a/flower/include/virtual-methods.hh b/flower/include/virtual-methods.hh index 47113cc06d..c7746c84f8 100644 --- a/flower/include/virtual-methods.hh +++ b/flower/include/virtual-methods.hh @@ -24,10 +24,10 @@ demangle_classname (std::type_info const &); VIRTUAL_COPY_CONSTRUCTOR (Baseclass, Foo); }; */ -#define VIRTUAL_COPY_CONSTRUCTOR(Base, name) \ - virtual Base *clone () const \ - { \ - return new name (*this); \ +#define VIRTUAL_COPY_CONSTRUCTOR(Base, name) \ + virtual Base *clone () const \ + { \ + return new name (*this); \ } #endif /* VIRTUAL_METHODS_HH */ diff --git a/flower/parse-afm.cc b/flower/parse-afm.cc index ffb7440809..60f553b588 100644 --- a/flower/parse-afm.cc +++ b/flower/parse-afm.cc @@ -1171,9 +1171,7 @@ AFM_free (AFM_Font_info *fi) { free (fi->ccd[i].ccName); for (j = 0; j < fi->ccd[i].numOfPieces; j++) - { - free (fi->ccd[i].pieces[j].AFM_PccName); - } + free (fi->ccd[i].pieces[j].AFM_PccName); free (fi->ccd[i].pieces); } free (fi->ccd); diff --git a/flower/rational.cc b/flower/rational.cc index 9ab8dcc4cd..5bcf7b3960 100644 --- a/flower/rational.cc +++ b/flower/rational.cc @@ -24,7 +24,6 @@ Rational::operator bool () const return sign_ && num_; } - #ifdef STREAM_SUPPORT ostream & operator << (ostream &o, Rational r) @@ -171,7 +170,7 @@ Rational::operator += (Rational r) *this = r; else { - int lcm = (den_ / gcd (r.den_, den_)) * r.den_; + int lcm = (den_ / gcd (r.den_, den_)) * r.den_; int n = sign_ * num_ * (lcm / den_) + r.sign_ * r.num_ * (lcm / r.den_); int d = lcm; sign_ = ::sign (n) * ::sign (d); diff --git a/flower/string.cc b/flower/string.cc index 8f34cf44ad..24ba1e2fea 100644 --- a/flower/string.cc +++ b/flower/string.cc @@ -132,7 +132,6 @@ String::to_bytes () const } - Byte * String::get_bytes () { @@ -262,9 +261,7 @@ String::index_any (String set) const { char *found = (char *) memchr (me, set[i], n); if (found) - { - return found - (char const *)me; - } + return found - (char const *)me; } return -1; } diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index 6786e26b3b..eb4efce0e9 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -52,7 +52,7 @@ class Accidental_engraver : public Engraver void create_accidental (Accidental_entry *entry, bool, bool); Grob *make_standard_accidental (Music *note, Grob *note_head, Engraver *trans); Grob *make_suggested_accidental (Music *note, Grob *note_head, Engraver *trans); - + protected: TRANSLATOR_DECLARATIONS (Accidental_engraver); void process_music (); @@ -61,7 +61,7 @@ protected: void acknowledge_arpeggio (Grob_info); void acknowledge_rhythmic_head (Grob_info); void acknowledge_finger (Grob_info); - + void stop_translation_timestep (); virtual void initialize (); void process_acknowledged (); @@ -84,7 +84,6 @@ public: Array accidentals_; Link_array ties_; - }; /* @@ -362,9 +361,7 @@ Accidental_engraver::process_acknowledged () /* Cannot look for ties: it's not guaranteed that they reach us before the notes. */ if (num) - { - create_accidental (&accidentals_[i], num > 1, cautionary); - } + create_accidental (&accidentals_[i], num > 1, cautionary); } } } @@ -377,15 +374,14 @@ Accidental_engraver::create_accidental (Accidental_entry *entry, Music *note = entry->melodic_; Grob *support = entry->head_; Pitch *pitch = unsmob_pitch (note->get_property ("pitch")); - - + bool as_suggestion = to_boolean (entry->origin_->get_property ("suggestAccidentals")); Grob *a = 0; if (as_suggestion) a = make_suggested_accidental (note, support, entry->origin_engraver_); else a = make_standard_accidental (note, support, entry->origin_engraver_); - + SCM accs = scm_cons (scm_from_int (pitch->get_alteration ()), SCM_EOL); if (restore_natural) @@ -393,12 +389,11 @@ Accidental_engraver::create_accidental (Accidental_entry *entry, if (to_boolean (get_property ("extraNatural"))) accs = scm_cons (scm_from_int (0), accs); } - + /* TODO: add cautionary option in accidental. */ if (cautionary) a->set_property ("cautionary", SCM_BOOL_T); - a->set_property ("accidentals", accs); entry->accidental_ = a; } @@ -408,7 +403,7 @@ Accidental_engraver::make_standard_accidental (Music *note, Grob *support, Engraver *trans) { - + /* We construct the accidentals at the originating Voice level, so that we get the property settings for @@ -435,25 +430,23 @@ Accidental_engraver::make_standard_accidental (Music *note, accidental_placement_ = make_item ("AccidentalPlacement", a->self_scm ()); Accidental_placement::add_accidental (accidental_placement_, a); - + support->set_object ("accidental-grob", a->self_scm ()); return a; } - Grob * Accidental_engraver::make_suggested_accidental (Music *note, - Grob *note_head, Engraver *trans) + Grob *note_head, Engraver *trans) { - + Grob *a = make_grob_from_properties (trans, ly_symbol2scm ("AccidentalSuggestion"), note->self_scm (), "AccidentalSuggestion"); - Side_position_interface::add_support (a, note_head); if (Grob *stem = unsmob_grob (a->get_object ("stem"))) { @@ -464,7 +457,6 @@ Accidental_engraver::make_suggested_accidental (Music *note, return a; } - void Accidental_engraver::finalize () { @@ -556,10 +548,10 @@ Accidental_engraver::acknowledge_rhythmic_head (Grob_info info) { /* String harmonics usually don't have accidentals. - */ + */ if (to_boolean (get_property ("harmonicAccidentals")) || !ly_is_equal (info.grob ()->get_property ("style"), - ly_symbol2scm ("harmonic"))) + ly_symbol2scm ("harmonic"))) { Accidental_entry entry; entry.head_ = info.grob (); @@ -600,7 +592,6 @@ Accidental_engraver::process_music () update_local_key_signature (); } - ADD_ACKNOWLEDGER (Accidental_engraver, arpeggio); ADD_ACKNOWLEDGER (Accidental_engraver, finger); ADD_ACKNOWLEDGER (Accidental_engraver, rhythmic_head); diff --git a/lily/accidental-placement.cc b/lily/accidental-placement.cc index 92c7e98c99..5265461bee 100644 --- a/lily/accidental-placement.cc +++ b/lily/accidental-placement.cc @@ -337,9 +337,7 @@ Accidental_placement::position_accidentals (Grob *me) Interval y; for (int j = apes[i]->extents_.size (); j--;) - { - y.unite (apes[i]->extents_[j][Y_AXIS]); - } + y.unite (apes[i]->extents_[j][Y_AXIS]); apes[i]->vertical_extent_ = y; total.unite (y); } @@ -390,9 +388,7 @@ Accidental_placement::position_accidentals (Grob *me) { Accidental_placement_entry *ape = apes[i]; for (int j = ape->grobs_.size (); j--;) - { - ape->grobs_[j]->translate_axis (ape->offset_, X_AXIS); - } + ape->grobs_[j]->translate_axis (ape->offset_, X_AXIS); } Interval left_extent, right_extent; diff --git a/lily/align-interface.cc b/lily/align-interface.cc index 2f9a52aae9..b7fe37c475 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -23,9 +23,7 @@ Align_interface::alignment_callback (SCM element_smob, SCM axis) Axis ax = (Axis)scm_to_int (axis); Grob *par = me->get_parent (ax); if (par && !to_boolean (par->get_property ("positioning-done"))) - { - Align_interface::align_elements_to_extents (par, ax); - } + Align_interface::align_elements_to_extents (par, ax); return scm_from_double (0.0); } @@ -37,9 +35,7 @@ Align_interface::fixed_distance_alignment_callback (SCM element_smob, SCM axis) Axis ax = (Axis)scm_to_int (axis); Grob *par = me->get_parent (ax); if (par && !to_boolean (par->get_property ("positioning-done"))) - { - Align_interface::align_to_fixed_distance (par, ax); - } + Align_interface::align_to_fixed_distance (par, ax); return scm_from_double (0.0); } @@ -61,8 +57,8 @@ Align_interface::align_to_fixed_distance (Grob *me, Axis a) extract_grob_set (me, "elements", elem_source); - Link_array elems (elem_source); // writable.. - + Link_array elems (elem_source); // writable.. + Real where_f = 0; Interval v; @@ -99,9 +95,7 @@ Align_interface::align_to_fixed_distance (Grob *me, Axis a) TODO: support self-alignment-{Y, X} */ for (int i = 0; i < translates.size (); i++) - { - elems[i]->translate_axis (translates[i] - v.center (), a); - } + elems[i]->translate_axis (translates[i] - v.center (), a); } /* @@ -127,9 +121,9 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a) && me_spanner && me_spanner->get_bound (LEFT)->break_status_dir () == CENTER) { - me_spanner->warning (_("vertical alignment called before line-breaking. Only do cross-staff spanners with PianoStaff.")); + me_spanner->warning (_ ("vertical alignment called before line-breaking. Only do cross-staff spanners with PianoStaff.")); } - + me->set_property ("positioning-done", SCM_BOOL_T); SCM d = me->get_property ("stacking-dir"); @@ -212,9 +206,7 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a) while (j < all_grobs.size ()) { if (i < elems.size () && all_grobs[j] == elems[i]) - { - w = translates[i++]; - } + w = translates[i++]; all_translates.push (w); j++; } @@ -257,7 +249,6 @@ Align_interface::set_axis (Grob *me, Axis a) } ga->set_ordered (true); - } /* diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index bc21a30ea8..abe7c742bb 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -76,7 +76,7 @@ All_font_metrics::find_pango_font (PangoFontDescription *description, { if (be_verbose_global) progress_indication ("[" + String (pango_fn)); - + Pango_font *pf = new Pango_font (pango_ft2_fontmap_, RIGHT, description, diff --git a/lily/ambitus-engraver.cc b/lily/ambitus-engraver.cc index 9ab212e710..803598ff3f 100644 --- a/lily/ambitus-engraver.cc +++ b/lily/ambitus-engraver.cc @@ -58,7 +58,7 @@ Ambitus_engraver::create_ambitus () accidentals_[d] = make_item ("AmbitusAccidental", SCM_EOL); accidentals_[d]->set_parent (heads_[d], Y_AXIS); heads_[d]->set_object ("accidental-grob", - accidentals_[d]->self_scm ()); + accidentals_[d]->self_scm ()); Axis_group_interface::add_element (group_, heads_[d]); Axis_group_interface::add_element (group_, accidentals_[d]); Side_position_interface::add_support (accidentals_[d], heads_[d]); @@ -148,7 +148,7 @@ Ambitus_engraver::finalize () int sig_alter = (handle != SCM_BOOL_F) ? scm_to_int (scm_cdr (handle)) : 0; - + if (sig_alter == p.get_alteration ()) { accidentals_[d]->suicide (); @@ -158,13 +158,12 @@ Ambitus_engraver::finalize () { SCM l = scm_list_1 (scm_from_int (p.get_alteration ())); accidentals_[d]->set_property ("accidentals", l); - } } while (flip (&d) != DOWN); ambitus_->set_object ("note-heads", scm_list_2 (heads_[DOWN]->self_scm (), - heads_[UP]->self_scm ())); + heads_[UP]->self_scm ())); } else { @@ -180,7 +179,6 @@ Ambitus_engraver::finalize () } } - ADD_ACKNOWLEDGER (Ambitus_engraver, note_head); ADD_TRANSLATOR (Ambitus_engraver, /* doc */ "", diff --git a/lily/arpeggio-engraver.cc b/lily/arpeggio-engraver.cc index 39748228e2..5c82930b4f 100644 --- a/lily/arpeggio-engraver.cc +++ b/lily/arpeggio-engraver.cc @@ -76,7 +76,7 @@ Arpeggio_engraver::acknowledge_rhythmic_head (Grob_info info) Side_position_interface::add_support (arpeggio_, info.grob ()); } } - + void Arpeggio_engraver::acknowledge_note_column (Grob_info info) { @@ -103,12 +103,12 @@ Arpeggio_engraver::stop_translation_timestep () } ADD_ACKNOWLEDGER (Arpeggio_engraver, stem) -ADD_ACKNOWLEDGER (Arpeggio_engraver, rhythmic_head) -ADD_ACKNOWLEDGER (Arpeggio_engraver, note_column) - -ADD_TRANSLATOR (Arpeggio_engraver, - /* doc */ "Generate an Arpeggio symbol", - /* create */ "Arpeggio", - /* accept */ "arpeggio-event", - /* read */ "", - /* write */ ""); + ADD_ACKNOWLEDGER (Arpeggio_engraver, rhythmic_head) + ADD_ACKNOWLEDGER (Arpeggio_engraver, note_column) + + ADD_TRANSLATOR (Arpeggio_engraver, + /* doc */ "Generate an Arpeggio symbol", + /* create */ "Arpeggio", + /* accept */ "arpeggio-event", + /* read */ "", + /* write */ ""); diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index 5ca16b5053..a2757706a2 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -26,7 +26,7 @@ Arpeggio::print (SCM smob) Grob *common = me; extract_grob_set (me, "stems", stems); - for (int i = 0; i < stems.size(); i++) + for (int i = 0; i < stems.size (); i++) { Grob *stem = stems[i]; common = common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem), @@ -44,7 +44,7 @@ Arpeggio::print (SCM smob) Interval heads; Real my_y = me->relative_coordinate (common, Y_AXIS); - for (int i = 0; i < stems.size(); i++) + for (int i = 0; i < stems.size (); i++) { Grob *stem = stems[i]; Grob *ss = Staff_symbol_referencer::get_staff_symbol (stem); @@ -100,9 +100,9 @@ Arpeggio::brew_chord_bracket (SCM smob) { Grob *me = unsmob_grob (smob); Grob *common = me; - + extract_grob_set (me, "stems", stems); - for (int i = 0; i < stems.size(); i++) + for (int i = 0; i < stems.size (); i++) { Grob *stem = stems[i]; common = common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem), @@ -112,7 +112,7 @@ Arpeggio::brew_chord_bracket (SCM smob) Interval heads; Real my_y = me->relative_coordinate (common, Y_AXIS); - for (int i = 0; i < stems.size(); i++) + for (int i = 0; i < stems.size (); i++) { Grob *stem = stems[i]; Grob *ss = Staff_symbol_referencer::get_staff_symbol (stem); @@ -141,7 +141,7 @@ Arpeggio::width_callback (SCM smob, SCM axis) { Grob *me = unsmob_grob (smob); (void) axis; - + assert (scm_to_int (axis) == X_AXIS); Stencil arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts.arpeggio"); diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index ea763dff2e..2a90c3e3c5 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -20,7 +20,6 @@ #include "translator.icc" - class Auto_beam_engraver : public Engraver { TRANSLATOR_DECLARATIONS (Auto_beam_engraver); @@ -32,12 +31,12 @@ protected: virtual bool try_music (Music *); virtual void finalize (); virtual void derived_mark () const; - + DECLARE_ACKNOWLEDGER (rest); DECLARE_ACKNOWLEDGER (beam); DECLARE_ACKNOWLEDGER (bar_line); DECLARE_ACKNOWLEDGER (stem); - + void process_acknowledged (); private: @@ -80,14 +79,12 @@ private: void check_bar_property (); }; - void Auto_beam_engraver::derived_mark () const { scm_gc_mark (beam_settings_); } - void Auto_beam_engraver::check_bar_property () { @@ -152,7 +149,7 @@ Auto_beam_engraver::test_moment (Direction dir, Moment test) test.smobbed_copy ()) != SCM_BOOL_F; } - + void Auto_beam_engraver::consider_begin (Moment test_mom) { @@ -192,7 +189,7 @@ Auto_beam_engraver::create_beam () /* Can't use make_spanner_from_properties() because we have to use beam_settings_. - */ + */ Spanner *beam = new Spanner (beam_settings_, context ()->get_grob_key ("Beam")); @@ -285,9 +282,7 @@ Auto_beam_engraver::start_translation_timestep () { Moment now = now_mom (); if (extend_mom_ < now) - { - end_beam (); - } + end_beam (); } forbid_ = 0; } @@ -310,7 +305,6 @@ Auto_beam_engraver::finalize () - void Auto_beam_engraver::acknowledge_beam (Grob_info info) { @@ -321,7 +315,7 @@ Auto_beam_engraver::acknowledge_beam (Grob_info info) end_beam (); } } - + void Auto_beam_engraver::acknowledge_bar_line (Grob_info info) { @@ -407,7 +401,7 @@ void Auto_beam_engraver::process_acknowledged () { if (extend_mom_ > now_mom ()) - return ; + return; if (!process_acknowledged_count_) { @@ -421,23 +415,19 @@ Auto_beam_engraver::process_acknowledged () Moment now = now_mom (); if ((extend_mom_ < now) || ((extend_mom_ == now) && (last_add_mom_ != now))) - { - end_beam (); - } + end_beam (); else if (!stems_->size ()) - { - junk_beam (); - } + junk_beam (); } } process_acknowledged_count_++; } -ADD_ACKNOWLEDGER (Auto_beam_engraver,stem); -ADD_ACKNOWLEDGER (Auto_beam_engraver,bar_line); -ADD_ACKNOWLEDGER (Auto_beam_engraver,beam); -ADD_ACKNOWLEDGER (Auto_beam_engraver,rest); +ADD_ACKNOWLEDGER (Auto_beam_engraver, stem); +ADD_ACKNOWLEDGER (Auto_beam_engraver, bar_line); +ADD_ACKNOWLEDGER (Auto_beam_engraver, beam); +ADD_ACKNOWLEDGER (Auto_beam_engraver, rest); ADD_TRANSLATOR (Auto_beam_engraver, /* doc */ "Generate beams based on measure characteristics and observed " "Stems. Uses beatLength, measureLength and measurePosition to decide " diff --git a/lily/axis-group-interface-scheme.cc b/lily/axis-group-interface-scheme.cc index a5e00341b9..1289160891 100644 --- a/lily/axis-group-interface-scheme.cc +++ b/lily/axis-group-interface-scheme.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "axis-group-interface.hh" @@ -12,28 +11,27 @@ #include "grob.hh" #include "grob-array.hh" -LY_DEFINE(ly_relative_group_extent, "ly:relative-group-extent", - 3, 0, 0, (SCM elements, SCM common, SCM axis), - "Determine the extent of @var{elements} relative to @var{common} in the " - "@var{axis} direction.") +LY_DEFINE (ly_relative_group_extent, "ly:relative-group-extent", + 3, 0, 0, (SCM elements, SCM common, SCM axis), + "Determine the extent of @var{elements} relative to @var{common} in the " + "@var{axis} direction.") { Grob_array *ga = unsmob_grob_array (elements); - - SCM_ASSERT_TYPE(ga || scm_is_pair (elements), elements, SCM_ARG1, __FUNCTION__, "list or Grob_array"); - SCM_ASSERT_TYPE(unsmob_grob (common), common, SCM_ARG2, __FUNCTION__, "grob"); - SCM_ASSERT_TYPE(is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis"); + + SCM_ASSERT_TYPE (ga || scm_is_pair (elements), elements, SCM_ARG1, __FUNCTION__, "list or Grob_array"); + SCM_ASSERT_TYPE (unsmob_grob (common), common, SCM_ARG2, __FUNCTION__, "grob"); + SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis"); Link_array elts; - if (!ga) + if (!ga) { for (SCM s = elements; scm_is_pair (s); s = scm_cdr (s)) elts.push (unsmob_grob (scm_car (s))); } - + Interval ext = Axis_group_interface::relative_group_extent (ga ? ga->array () : elts, unsmob_grob (common), (Axis) scm_to_int (axis)); return ly_interval2scm (ext); } - - + diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index 87bb2754fe..3d6889c6ac 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -19,7 +19,7 @@ Axis_group_interface::add_element (Grob *me, Grob *e) SCM axes = me->get_property ("axes"); if (!scm_is_pair (axes)) programming_error ("axes should be nonempty"); - + for (SCM ax = axes; ax != SCM_EOL; ax = scm_cdr (ax)) { Axis a = (Axis) scm_to_int (scm_car (ax)); @@ -29,7 +29,7 @@ Axis_group_interface::add_element (Grob *me, Grob *e) e->internal_set_object ((a == X_AXIS) ? ly_symbol2scm ("axis-group-parent-X") - : ly_symbol2scm ("axis-group-parent-Y"), + : ly_symbol2scm ("axis-group-parent-Y"), me->self_scm ()); } @@ -51,7 +51,7 @@ Axis_group_interface::relative_group_extent (Link_array const &elts, Grob *common, Axis a) { Interval r; - for (int i = 0; i < elts.size(); i++) + for (int i = 0; i < elts.size (); i++) { Grob *se = elts[i]; Interval dims = se->extent (common, a); @@ -62,7 +62,6 @@ Axis_group_interface::relative_group_extent (Link_array const &elts, } - MAKE_SCHEME_CALLBACK (Axis_group_interface, group_extent_callback, 2); SCM Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis) diff --git a/lily/bar-check-iterator.cc b/lily/bar-check-iterator.cc index 92a9dc988c..4cc905e2de 100644 --- a/lily/bar-check-iterator.cc +++ b/lily/bar-check-iterator.cc @@ -40,7 +40,7 @@ Bar_check_iterator::process (Moment m) SCM check = tr->get_property ("ignoreBarChecks"); if (to_boolean (check)) return; - + SCM mp = tr->get_property ("measurePosition"); SCM sync = tr->get_property ("barCheckSynchronize"); @@ -53,7 +53,7 @@ Bar_check_iterator::process (Moment m) bool warn = true; if (to_boolean (sync)) { - SCM mp; + SCM mp; tr = tr->where_defined (ly_symbol2scm ("measurePosition"), &mp); Moment zero; tr->set_property ("measurePosition", zero.smobbed_copy ()); diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index c36ed795d0..698b4bb7a7 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -106,13 +106,9 @@ Beam_engraver::try_music (Music *m) return false; if (d == START) - { - start_ev_ = m; - } + start_ev_ = m; else if (d == STOP) - { - now_stop_ev_ = m; - } + now_stop_ev_ = m; return true; } return false; diff --git a/lily/beam-performer.cc b/lily/beam-performer.cc index 8618000533..bec8ebbf54 100644 --- a/lily/beam-performer.cc +++ b/lily/beam-performer.cc @@ -77,18 +77,14 @@ Beam_performer::try_music (Music *m) Direction d = to_dir (m->get_property ("span-direction")); if (d == START) - { - start_ev_ = m; - } + start_ev_ = m; else if (d == STOP) - { - now_stop_ev_ = m; - } + now_stop_ev_ = m; return true; } return false; } ADD_TRANSLATOR (Beam_performer, "", "", - "beam-event", "", ""); + "beam-event", "", ""); diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index 689cf7c2ec..b72da881f6 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -23,7 +23,7 @@ Real get_detail (SCM alist, SCM sym, Real def) { SCM entry = scm_assq (sym, alist); - + if (scm_is_pair (entry)) { return robust_scm2double (scm_cdr (entry), def); @@ -35,7 +35,7 @@ void Beam_quant_parameters::fill (Grob *him) { SCM details = him->get_property ("details"); - + INTER_QUANT_PENALTY = get_detail (details, ly_symbol2scm ("inter-quant-penalty"), 1000.0); SECONDARY_BEAM_DEMERIT = get_detail (details, ly_symbol2scm ("secondary-beam-demerit"), 10.0); STEM_LENGTH_DEMERIT_FACTOR = get_detail (details, ly_symbol2scm ("stem-length-demerit-factor"), 5); @@ -101,10 +101,9 @@ Beam::quanting (SCM smob) { Grob *me = unsmob_grob (smob); - Beam_quant_parameters parameters; parameters.fill (me); - + SCM s = me->get_property ("positions"); Real yl = scm_to_double (scm_car (s)); Real yr = scm_to_double (scm_cdr (s)); @@ -195,7 +194,7 @@ Beam::quanting (SCM smob) bool is_knee = dirs_found[LEFT] && dirs_found[RIGHT]; int region_size = (int) parameters.REGION_SIZE; - + /* Knees are harder, lets try some more possibilities for knees. */ @@ -279,10 +278,10 @@ Beam::quanting (SCM smob) } int best_idx = best_quant_score_idx (qscores); - + #if DEBUG_QUANTING SCM inspect_quants = me->get_property ("inspect-quants"); - if ( to_boolean (me->get_layout ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting"))) + if (to_boolean (me->get_layout ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting"))) && scm_is_pair (inspect_quants)) { Drul_array ins = ly_scm2interval (inspect_quants); @@ -306,7 +305,7 @@ Beam::quanting (SCM smob) if (best_idx < 0) { warning (_ ("no feasible beam position")); - me->set_property ("positions", ly_interval2scm (Interval (0,0))); + me->set_property ("positions", ly_interval2scm (Interval (0, 0))); } else me->set_property ("positions", @@ -336,8 +335,7 @@ Beam::score_stem_lengths (Link_array const &stems, bool knee, Real yl, Real yr, - Beam_quant_parameters const*parameters - ) + Beam_quant_parameters const *parameters) { Real limit_penalty = parameters->STEM_LENGTH_LIMIT_PENALTY; Drul_array score (0, 0); @@ -358,7 +356,7 @@ Beam::score_stem_lengths (Link_array const &stems, Stem_info info = stem_infos[i]; Direction d = info.dir_; - score[d] += limit_penalty * max (0.0, (d * (info.shortest_y_ - current_y))); + score[d] += limit_penalty * max (0.0, (d * (info.shortest_y_ - current_y))); Real ideal_diff = d * (current_y - info.ideal_y_); Real ideal_score = shrink_extra_weight (ideal_diff, 1.5); @@ -389,8 +387,8 @@ Beam::score_slopes_dy (Real yl, Real yr, Real dy_mus, Real dy_damp, Real dx, bool xstaff, - - Beam_quant_parameters const*parameters) + + Beam_quant_parameters const *parameters) { Real dy = yr - yl; Real dem = 0.0; @@ -408,7 +406,7 @@ Beam::score_slopes_dy (Real yl, Real yr, dem += parameters->DAMPING_DIRECTION_PENALTY; } - dem += parameters->MUSICAL_DIRECTION_FACTOR * max (0.0, (fabs (dy) - fabs (dy_mus))); + dem += parameters->MUSICAL_DIRECTION_FACTOR *max (0.0, (fabs (dy) - fabs (dy_mus))); Real slope_penalty = parameters->IDEAL_SLOPE_FACTOR; @@ -442,8 +440,8 @@ Beam::score_forbidden_quants (Real yl, Real yr, Real thickness, Real beam_translation, Drul_array beam_counts, Direction ldir, Direction rdir, - - Beam_quant_parameters const*parameters) + + Beam_quant_parameters const *parameters) { Real dy = yr - yl; Drul_array y (yl, yr); diff --git a/lily/beam.cc b/lily/beam.cc index 6c6ed15546..23311ef551 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -90,7 +90,7 @@ Beam::get_beam_count (Grob *me) int m = 0; extract_grob_set (me, "stems", stems); - for (int i = 0; i < stems.size(); i++) + for (int i = 0; i < stems.size (); i++) { Grob *stem = stems[i]; m = max (m, (Stem::beam_multiplicity (stem).length () + 1)); @@ -271,9 +271,7 @@ Beam::connect_beams (Grob *me) } if (i == stems.size () -1) - { - scm_set_cdr_x (this_beaming, SCM_EOL); - } + scm_set_cdr_x (this_beaming, SCM_EOL); if (scm_ilength (scm_cdr (this_beaming)) > 0) { @@ -343,7 +341,7 @@ Beam::print (SCM grob) for (int i = 0; i <= stems.size (); i++) { Grob *stem = (i < stems.size ()) ? stems[i] : 0; - + SCM this_beaming = stem ? stem->get_property ("beaming") : SCM_EOL; Real xposn = stem ? stem->relative_coordinate (xcommon, X_AXIS) : 0.0; Real stem_width = stem ? robust_scm2double (stem->get_property ("thickness"), 1.0) * lt : 0; @@ -365,32 +363,25 @@ Beam::print (SCM grob) { int b = scm_to_int (scm_car (s)); if (scm_c_memq (scm_car (s), right) != SCM_BOOL_F) - { - full_beams.push (b); - } + full_beams.push (b); else - { - lfliebertjes.push (b); - } + lfliebertjes.push (b); } for (SCM s = right; scm_is_pair (s); s = scm_cdr (s)) { int b = scm_to_int (scm_car (s)); if (scm_c_memq (scm_car (s), left) == SCM_BOOL_F) - { - rfliebertjes.push (b); - } + rfliebertjes.push (b); } Drul_array break_overshoot = robust_scm2drul (me->get_property ("break-overshoot"), Drul_array (-0.5, 0.0)); - Real w = (i > 0 && stem) ? (xposn - last_xposn) - : break_overshoot[(i==0) ? LEFT: RIGHT]; + : break_overshoot[ (i == 0) ? LEFT : RIGHT]; Real stem_offset = 0.0; if (i > 0) @@ -853,9 +844,7 @@ Beam::least_squares (SCM smob) pos[-d] = -pos[d]; } else - { - pos = ideal; - } + pos = ideal; /* For broken beams this doesn't work well. In this case, the @@ -1302,12 +1291,12 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis) else { /* - UGH. TODO: fix dependency tracking. - */ + UGH. TODO: fix dependency tracking. + */ position_beam (beam); pos = ly_scm2interval (beam->get_property ("positions")); } - + Real staff_space = Staff_symbol_referencer::staff_space (rest); scale_drul (&pos, staff_space); diff --git a/lily/beaming-info.cc b/lily/beaming-info.cc index 1165148b94..4cc9390996 100644 --- a/lily/beaming-info.cc +++ b/lily/beaming-info.cc @@ -27,7 +27,7 @@ const int at_beat = 1 << 15; int Beaming_info_list::best_splitpoint_index (Moment &beat_length, bool subdivide) const { - int minden = INT_MAX; + int minden = INT_MAX; int minidx = -1; Moment beat_pos; diff --git a/lily/bezier.cc b/lily/bezier.cc index 9c60903bc1..26ad982419 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -12,7 +12,7 @@ #include "warn.hh" #include "libc-extension.hh" -Real binomial_coefficient_3[] = {1,3 ,3, 1}; +Real binomial_coefficient_3[] = {1, 3, 3, 1}; Real binomial_coefficient (Real over, int under) @@ -92,14 +92,14 @@ Bezier::curve_coordinate (Real t, Axis a) const one_min_tj[0] = 1; for (int i = 1; i < 4; i++) { - one_min_tj[i] = one_min_tj[i-1] * (1-t); + one_min_tj[i] = one_min_tj[i - 1] * (1 - t); } Real r = 0.0; for (int j = 0; j < 4; j++) { r += control_[j][a] * binomial_coefficient_3[j] - * tj * one_min_tj[3-j]; + * tj * one_min_tj[3 - j]; tj *= t; } @@ -115,14 +115,14 @@ Bezier::curve_point (Real t) const one_min_tj[0] = 1; for (int i = 1; i < 4; i++) { - one_min_tj[i] = one_min_tj[i-1] * (1-t); + one_min_tj[i] = one_min_tj[i - 1] * (1 - t); } Offset o; for (int j = 0; j < 4; j++) { o += control_[j] * binomial_coefficient_3[j] - * tj * one_min_tj[3-j]; + * tj * one_min_tj[3 - j]; tj *= t; } @@ -139,14 +139,14 @@ Bezier::curve_point (Real t) const Cache binom(3,j) t^j (1-t)^{3-j} */ static struct Polynomial bezier_term_cache[4]; -static bool done_cache_init; +static bool done_cache_init; void init_polynomial_cache () { - for (int j = 0; j <= 3; j++) - bezier_term_cache[j] = - binomial_coefficient_3[j] + for (int j = 0; j <= 3; j++) + bezier_term_cache[j] + = binomial_coefficient_3[j] * Polynomial::power (j, Polynomial (0, 1)) * Polynomial::power (3 - j, Polynomial (1, -1)); done_cache_init = true; @@ -157,9 +157,9 @@ Bezier::polynomial (Axis a) const { if (!done_cache_init) init_polynomial_cache (); - + Polynomial p (0.0); - Polynomial q ; + Polynomial q; for (int j = 0; j <= 3; j++) { q = bezier_term_cache[j]; diff --git a/lily/book-scheme.cc b/lily/book-scheme.cc index 541269be61..c6fb9a4ffa 100644 --- a/lily/book-scheme.cc +++ b/lily/book-scheme.cc @@ -30,7 +30,6 @@ LY_DEFINE (ly_make_book, "ly:make-book", book->scores_ = scm_append (scm_list_2 (scores, book->scores_)); - SCM x = book->self_scm (); book->unprotect (); return x; diff --git a/lily/book.cc b/lily/book.cc index 82d919f0e2..631798e9cd 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -75,8 +75,8 @@ Book::add_score (SCM s) } /* Concatenate all score outputs into a Paper_book - - */ + +*/ Paper_book * Book::process (Output_def *default_paper, Output_def *default_layout) @@ -87,14 +87,14 @@ Book::process (Output_def *default_paper, return 0; Output_def *paper = paper_ ? default_paper : paper_; - + Paper_book *paper_book = new Paper_book (); Real scale = scm_to_double (paper->c_variable ("outputscale")); Output_def *scaled_bookdef = scale_output_def (paper, scale); Object_key *key = new Lilypond_general_key (0, user_key_, 0); SCM scm_key = key->unprotect (); - + paper_book->paper_ = scaled_bookdef; scaled_bookdef->unprotect (); @@ -113,17 +113,15 @@ Book::process (Output_def *default_paper, Music_output *output = unsmob_music_output (scm_car (outputs)); if (Performance *perf = dynamic_cast (output)) - { - paper_book->add_performance (perf->self_scm ()); - } - else if (Paper_score *pscore = dynamic_cast (output)) + paper_book->add_performance (perf->self_scm ()); + else if (Paper_score *pscore = dynamic_cast (output)) { SCM systems = pscore->get_paper_systems (); if (ly_is_module (score->header_)) paper_book->add_score (score->header_); paper_book->add_score (systems); } - + outputs = scm_cdr (outputs); } } diff --git a/lily/box.cc b/lily/box.cc index b13f4f3420..0b61299191 100644 --- a/lily/box.cc +++ b/lily/box.cc @@ -85,13 +85,12 @@ Box::widen (Real x, Real y) interval_a_[Y_AXIS].widen (y); } - -IMPLEMENT_SIMPLE_SMOBS(Box); +IMPLEMENT_SIMPLE_SMOBS (Box); IMPLEMENT_TYPE_P (Box, "ly:box?"); -IMPLEMENT_DEFAULT_EQUAL_P(Box); +IMPLEMENT_DEFAULT_EQUAL_P (Box); SCM -Box::mark_smob (SCM x) +Box::mark_smob (SCM x) { (void)x; return SCM_EOL; diff --git a/lily/break-algorithm.cc b/lily/break-algorithm.cc index 59236fe09e..360eb3f4df 100644 --- a/lily/break-algorithm.cc +++ b/lily/break-algorithm.cc @@ -98,7 +98,6 @@ Break_algorithm::solve () const return h; } - Break_algorithm::~Break_algorithm () { } diff --git a/lily/break-align-engraver.cc b/lily/break-align-engraver.cc index 4fe8c7e363..3359b9b72a 100644 --- a/lily/break-align-engraver.cc +++ b/lily/break-align-engraver.cc @@ -28,7 +28,6 @@ protected: public: TRANSLATOR_DECLARATIONS (Break_align_engraver); DECLARE_ACKNOWLEDGER (break_aligned); - }; void @@ -79,12 +78,12 @@ Break_align_engraver::acknowledge_break_aligned (Grob_info inf) Context *origin = inf.origin_contexts (this)[0]; - Translator_group *tg = origin ->implementation (); - Engraver *random_source = dynamic_cast (unsmob_translator (scm_car (tg->get_simple_trans_list ()))); + Translator_group *tg = origin->implementation (); + Engraver *random_source = dynamic_cast (unsmob_translator (scm_car (tg->get_simple_trans_list ()))); /* Make left edge appear to come from same context as clef/bar-line etc. - */ + */ left_edge_ = make_item_from_properties (random_source, ly_symbol2scm ("LeftEdge"), SCM_EOL, diff --git a/lily/break-align-interface.cc b/lily/break-align-interface.cc index b9232ef6fa..c7fd035c3b 100644 --- a/lily/break-align-interface.cc +++ b/lily/break-align-interface.cc @@ -44,7 +44,7 @@ SCM Break_align_interface::self_align_callback (SCM element_smob, SCM axis) { Grob *me = unsmob_grob (element_smob); - (void) axis; + (void) axis; assert (scm_to_int (axis) == X_AXIS); Item *item = dynamic_cast (me); @@ -72,7 +72,7 @@ Break_align_interface::ordered_elements (Grob *grob) { Item *me = dynamic_cast (grob); extract_grob_set (me, "elements", elts); - + SCM order_vec = me->get_property ("break-align-orders"); if (!scm_is_vector (order_vec) || scm_c_vector_length (order_vec) < 3) @@ -90,7 +90,7 @@ Break_align_interface::ordered_elements (Grob *grob) { SCM sym = scm_car (order); - for (int i = writable_elts.size(); i --; ) + for (int i = writable_elts.size (); i--;) { Grob *g = writable_elts[i]; if (g && sym == g->get_property ("break-align-symbol")) @@ -100,7 +100,7 @@ Break_align_interface::ordered_elements (Grob *grob) } } } - + return new_elts; } @@ -157,8 +157,8 @@ Break_align_interface::do_alignment (Grob *grob) Find the first grob with a space-alist entry. */ extract_grob_set (l, "elements", elts); - - for (int i = elts.size(); i--; ) + + for (int i = elts.size (); i--;) { Grob *elt = elts[i]; @@ -185,7 +185,7 @@ Break_align_interface::do_alignment (Grob *grob) if (r) { extract_grob_set (r, "elements", elts); - for (int i = elts.size(); + for (int i = elts.size (); !scm_is_symbol (rsym) && i--;) { Grob *elt = elts[i]; @@ -237,9 +237,7 @@ Break_align_interface::do_alignment (Grob *grob) offsets[next_idx] = max (extents[idx][RIGHT], distance); } else - { - extra_right_space = distance; - } + extra_right_space = distance; idx = next_idx; } @@ -257,8 +255,8 @@ Break_align_interface::do_alignment (Grob *grob) } if (total_extent.is_empty ()) - return ; - + return; + if (me->break_status_dir () == LEFT) { alignment_off = -total_extent[RIGHT] - extra_right_space; diff --git a/lily/break-substitution.cc b/lily/break-substitution.cc index ea85a6e7e8..670f7e567b 100644 --- a/lily/break-substitution.cc +++ b/lily/break-substitution.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2001--2005 Han-Wen Nienhuys - */ #include @@ -42,9 +41,7 @@ substitute_grob (Grob *sc) System *line = dynamic_cast (unsmob_grob (break_criterion)); if (sc->get_system () != line) - { - sc = sc->find_broken_piece (line); - } + sc = sc->find_broken_piece (line); /* now: !sc || (sc && sc->get_system () == line) */ if (!sc) @@ -66,9 +63,7 @@ substitute_grob (Grob *sc) if (sc->common_refpoint (line, X_AXIS) && sc->common_refpoint (line, Y_AXIS)) - { - return sc; - } + return sc; return 0; } @@ -96,7 +91,7 @@ do_break_substitution (SCM src) if (unsmob_grob (src)) { - Grob * new_ptr = substitute_grob (unsmob_grob (src)); + Grob *new_ptr = substitute_grob (unsmob_grob (src)); return new_ptr ? new_ptr->self_scm () : SCM_UNDEFINED; } else if (scm_is_vector (src)) @@ -145,27 +140,25 @@ do_break_substitution (SCM src) */ Link_array temporary_substition_array; void -substitute_grob_array (Grob_array *grob_arr, Grob_array * new_arr) +substitute_grob_array (Grob_array *grob_arr, Grob_array *new_arr) { Link_array &old_grobs (grob_arr->array_reference ()); Link_array *new_grobs (new_arr == grob_arr - ? &temporary_substition_array + ? & temporary_substition_array : &new_arr->array_reference ()); - + new_grobs->set_size (old_grobs.size ()); - Grob **array = (Grob**) new_grobs->accesses(); - Grob **ptr = array; + Grob **array = (Grob **) new_grobs->accesses (); + Grob **ptr = array; for (int i = 0; i < old_grobs.size (); i++) { Grob *orig = old_grobs[i]; Grob *new_grob = substitute_grob (orig); if (new_grob) - { - *ptr ++ = new_grob; - } + *ptr++ = new_grob; } - new_grobs->set_size (ptr - array); + new_grobs->set_size (ptr - array); if (new_arr == grob_arr) { new_arr->set_array (*new_grobs); @@ -235,7 +228,7 @@ spanner_system_range (Spanner *sp) { if (sp->broken_intos_.size ()) rv = Slice (sp->broken_intos_[0]->get_system ()->get_rank (), - sp->broken_intos_.top ()->get_system ()->get_rank()); + sp->broken_intos_.top ()->get_system ()->get_rank ()); } return rv; } @@ -322,7 +315,7 @@ bool Spanner::fast_substitute_grob_array (SCM sym, Grob_array *grob_array) { - int len = grob_array->size(); + int len = grob_array->size (); if (grob_array->ordered ()) return false; @@ -346,8 +339,8 @@ Spanner::fast_substitute_grob_array (SCM sym, int spanner_index = len; int item_index = 0; - - for (int i = 0 ; i < grob_array->size (); i++) + + for (int i = 0; i < grob_array->size (); i++) { Grob *g = grob_array->grob (i); @@ -356,13 +349,9 @@ Spanner::fast_substitute_grob_array (SCM sym, int idx = 0; if (dynamic_cast (g)) - { - idx = --spanner_index; - } + idx = --spanner_index; else if (dynamic_cast (g)) - { - idx = item_index++; - } + idx = item_index++; vec[idx].set (g, sr); } @@ -377,7 +366,7 @@ Spanner::fast_substitute_grob_array (SCM sym, item_indices.push (Slice (len, 0)); spanner_indices.push (Slice (len, 0)); } - + Array *arrs[] = { &item_indices, &spanner_indices @@ -386,9 +375,7 @@ Spanner::fast_substitute_grob_array (SCM sym, for (int i = 0; i < item_index;i++) { for (int j = vec[i].left_; j <= vec[i].right_; j++) - { - item_indices[j - system_range[LEFT]].add_point (i); - } + item_indices[j - system_range[LEFT]].add_point (i); } /* @@ -415,16 +402,14 @@ Spanner::fast_substitute_grob_array (SCM sym, newval = Grob_array::make_array (); sc->internal_set_object (sym, newval); } - - Grob_array *new_array = unsmob_grob_array (newval); + + Grob_array *new_array = unsmob_grob_array (newval); for (int k = 0; k < 2;k++) for (int j = (*arrs[k])[i][LEFT]; j <= (*arrs[k])[i][RIGHT]; j++) { Grob *substituted = substitute_grob (vec[j].grob_); if (substituted) - { - new_array->add (substituted); - } + new_array->add (substituted); } #ifdef PARANOIA @@ -465,14 +450,14 @@ substitute_object_alist (SCM alist, SCM dest) SCM sym = scm_caar (s); SCM val = scm_cdar (s); - if (Grob_array * orig = unsmob_grob_array (val)) + if (Grob_array *orig = unsmob_grob_array (val)) { SCM handle = scm_assq (sym, dest); - SCM newval = - (scm_is_pair (handle)) + SCM newval + = (scm_is_pair (handle)) ? scm_cdr (handle) : Grob_array::make_array (); - + Grob_array *new_arr = unsmob_grob_array (newval); substitute_grob_array (orig, new_arr); @@ -501,7 +486,7 @@ Spanner::substitute_one_mutable_property (SCM sym, Spanner *s = this; bool fast_done = false; - Grob_array * grob_array = unsmob_grob_array (val); + Grob_array *grob_array = unsmob_grob_array (val); if (grob_array) fast_done = s->fast_substitute_grob_array (sym, grob_array); @@ -518,7 +503,7 @@ Spanner::substitute_one_mutable_property (SCM sym, if (!unsmob_grob_array (newval)) { newval = Grob_array::make_array (); - sc->internal_set_object (sym, newval); + sc->internal_set_object (sym, newval); } substitute_grob_array (grob_array, unsmob_grob_array (newval)); } diff --git a/lily/change-iterator.cc b/lily/change-iterator.cc index 2a4f52751b..8074465995 100644 --- a/lily/change-iterator.cc +++ b/lily/change-iterator.cc @@ -84,7 +84,7 @@ Change_iterator::process (Moment m) { /* We could change the current translator's id, but that would make errors hard to catch. - + last->translator_id_string () = get_change ()->change_to_id_string (); */ error (_f ("not changing to same context type: %s", to_type)); diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index a7cd27c087..0149be9347 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -158,9 +158,7 @@ Chord_tremolo_engraver::acknowledge_stem (Grob_info info) } if (info.music_cause ()->is_mus_type ("rhythmic-event")) - { - Beam::add_stem (beam_, s); - } + Beam::add_stem (beam_, s); else { String s = _ ("stem must have Rhythmic structure"); @@ -178,7 +176,7 @@ Chord_tremolo_engraver::acknowledge_stem (Grob_info info) stem_tremolo_->set_property ("flag-count", scm_from_int (flags_)); stem_tremolo_->set_object ("stem", - info.grob ()->self_scm ()); + info.grob ()->self_scm ()); stem_tremolo_->set_parent (info.grob (), X_AXIS); } } @@ -208,8 +206,7 @@ Chord_tremolo_engraver::stop_translation_timestep () typeset_beam (); } - -ADD_ACKNOWLEDGER (Chord_tremolo_engraver,stem); +ADD_ACKNOWLEDGER (Chord_tremolo_engraver, stem); ADD_TRANSLATOR (Chord_tremolo_engraver, /* doc */ "Generates beams for tremolo repeats.", /* create */ "Beam", diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index d387009e71..8ac60b91a9 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -141,11 +141,11 @@ Clef_engraver::inspect_clef_properties () SCM octavation = get_property ("clefOctavation"); SCM force_clef = get_property ("forceClef"); - if (clefpos == SCM_EOL - || scm_equal_p (glyph, prev_glyph_) == SCM_BOOL_F - || scm_equal_p (clefpos, prev_cpos_) == SCM_BOOL_F - || scm_equal_p (octavation, prev_octavation_) == SCM_BOOL_F - || to_boolean (force_clef)) + if (clefpos == SCM_EOL + || scm_equal_p (glyph, prev_glyph_) == SCM_BOOL_F + || scm_equal_p (clefpos, prev_cpos_) == SCM_BOOL_F + || scm_equal_p (octavation, prev_octavation_) == SCM_BOOL_F + || to_boolean (force_clef)) { set_glyph (); if (prev_cpos_ != SCM_BOOL_F || to_boolean (get_property ("firstClef"))) diff --git a/lily/cluster.cc b/lily/cluster.cc index 8391e7899b..f6ca03ab35 100644 --- a/lily/cluster.cc +++ b/lily/cluster.cc @@ -102,15 +102,11 @@ brew_cluster_piece (Grob *me, Array bottom_points, Array top_poi { points.push (bottom_points[0] - vpadding + hpadding); for (int i = 1; i < size - 1; i++) - { - points.push (bottom_points[i] - vpadding); - } + points.push (bottom_points[i] - vpadding); points.push (bottom_points[size - 1] - vpadding - hpadding); points.push (top_points[size - 1] + vpadding - hpadding); for (int i = size - 2; i > 0; i--) - { - points.push (top_points[i] + vpadding); - } + points.push (top_points[i] + vpadding); points.push (top_points[0] + vpadding + hpadding); out.add_stencil (Lookup::round_filled_polygon (points, blotdiameter)); } @@ -160,10 +156,10 @@ Cluster::print (SCM smob) line with the center of the note heads? */ - for (int i = 0; i < cols.size (); i++) + for (int i = 0; i < cols.size (); i++) { Grob *col = cols[i]; - + Interval yext = col->extent (commony, Y_AXIS); Real x = col->relative_coordinate (commonx, X_AXIS) - left_coord; @@ -182,7 +178,7 @@ Cluster::print (SCM smob) { Spanner *next = orig->broken_intos_[spanner->get_break_index () + 1]; Link_array const &next_cols = extract_grob_array (next, "columns"); - if (next_cols.size() > 0) + if (next_cols.size () > 0) { Grob *next_commony = common_refpoint_of_array (next_cols, next, Y_AXIS); Grob *col = next_cols[0]; diff --git a/lily/coherent-ligature-engraver.cc b/lily/coherent-ligature-engraver.cc index 9c7ad42b9b..c7dc0a3a7c 100644 --- a/lily/coherent-ligature-engraver.cc +++ b/lily/coherent-ligature-engraver.cc @@ -126,7 +126,7 @@ Coherent_ligature_engraver::get_set_column (Item *item, Paper_column *column) Grob *sl = Staff_symbol_referencer::get_staff_symbol (item); extract_item_set (parent, "elements", elements); - + for (int i = elements.size (); i--;) { Item *sibling = elements[i]; diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index 18eddec50f..dbd7936e49 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -22,7 +22,6 @@ #include "pitch.hh" - /* TODO: make matching rest engraver. */ @@ -141,9 +140,7 @@ Completion_heads_engraver::find_nearest_duration (Rational length) continue; } else - { - d = Duration (d.duration_log () + 1, 2); - } + d = Duration (d.duration_log () + 1, 2); } if (d.duration_log () >= log_limit) diff --git a/lily/context-def.cc b/lily/context-def.cc index 1650076669..b0eb1c344f 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -104,7 +104,7 @@ Context_def::add_context_mod (SCM mod) } /* - other modifiers take symbols as argument. + other modifiers take symbols as argument. */ SCM sym = scm_cadr (mod); if (scm_is_string (sym)) @@ -115,8 +115,8 @@ Context_def::add_context_mod (SCM mod) default_child_ = sym; } else if (ly_symbol2scm ("consists") == tag - || ly_symbol2scm ("consists-end") == tag - || ly_symbol2scm ("remove") == tag) + || ly_symbol2scm ("consists-end") == tag + || ly_symbol2scm ("remove") == tag) { if (!get_translator (sym)) error (_f ("program has no such type: `%s'", @@ -171,11 +171,10 @@ Context_def::get_accepted (SCM user_mod) const acc = scm_delete_x (def, acc); acc = scm_cons (def, acc); } - + return acc; } - SCM Context_def::get_default_child (SCM user_mod) const { @@ -254,9 +253,7 @@ Context_def::get_translator_names (SCM user_mod) const if (ly_symbol2scm ("consists") == tag) l1 = scm_cons (arg, l1); else if (ly_symbol2scm ("remove") == tag) - { - l1 = scm_delete_x (arg, l1); - } + l1 = scm_delete_x (arg, l1); } return l1; @@ -271,7 +268,7 @@ filter_performers (SCM ell) if (dynamic_cast (unsmob_translator (scm_car (*tail)))) *tail = scm_cdr (*tail); else - tail = SCM_CDRLOC(*tail); + tail = SCM_CDRLOC (*tail); } return ell; } @@ -285,7 +282,7 @@ filter_engravers (SCM ell) if (dynamic_cast (unsmob_translator (scm_car (*tail)))) *tail = scm_cdr (*tail); else - tail = SCM_CDRLOC(*tail); + tail = SCM_CDRLOC (*tail); } return ell; } @@ -326,16 +323,13 @@ Context_def::instantiate (SCM ops, Object_key const *key) trans_list = cons; } else - { - trans_list = scm_cons (str, trans_list); - } + trans_list = scm_cons (str, trans_list); tr->daddy_context_ = context; tr->unprotect (); } } - /* Ugh, todo: should just make a private copy of Context_def with the user mods. @@ -355,7 +349,7 @@ Context_def::instantiate (SCM ops, Object_key const *key) g->unprotect (); context->accepts_list_ = get_accepted (ops); - + return context; } diff --git a/lily/context-property.cc b/lily/context-property.cc index 880086209a..192001015c 100644 --- a/lily/context-property.cc +++ b/lily/context-property.cc @@ -133,9 +133,7 @@ apply_property_operations (Context *tg, SCM pre_init_ops) execute_pushpop_property (tg, scm_car (entry), scm_cadr (entry), val); } else if (type == ly_symbol2scm ("assign")) - { - tg->internal_set_property (scm_car (entry), scm_cadr (entry)); - } + tg->internal_set_property (scm_car (entry), scm_cadr (entry)); } } @@ -197,10 +195,10 @@ make_grob_from_properties (Engraver *tr, SCM symbol, SCM cause, char const *name Object_key const *key = context->get_grob_key (name); Grob *grob = 0; - + SCM handle = scm_sloppy_assq (ly_symbol2scm ("meta"), props); SCM klass = scm_cdr (scm_sloppy_assq (ly_symbol2scm ("class"), scm_cdr (handle))); - + if (klass == ly_symbol2scm ("Item")) grob = new Item (props, key); else if (klass == ly_symbol2scm ("Spanner")) @@ -217,7 +215,7 @@ make_grob_from_properties (Engraver *tr, SCM symbol, SCM cause, char const *name Item * make_item_from_properties (Engraver *tr, SCM x, SCM cause, char const *name) { - Item *it = dynamic_cast (make_grob_from_properties (tr, x, cause, name)); + Item *it = dynamic_cast (make_grob_from_properties (tr, x, cause, name)); assert (it); return it; } @@ -225,14 +223,13 @@ make_item_from_properties (Engraver *tr, SCM x, SCM cause, char const *name) Paper_column * make_paper_column_from_properties (Engraver *tr, SCM x, char const *name) { - return dynamic_cast (make_grob_from_properties (tr, x, SCM_EOL, name)); + return dynamic_cast (make_grob_from_properties (tr, x, SCM_EOL, name)); } - Spanner * make_spanner_from_properties (Engraver *tr, SCM x, SCM cause, char const *name) { - Spanner *sp = dynamic_cast (make_grob_from_properties (tr, x, cause, name)); + Spanner *sp = dynamic_cast (make_grob_from_properties (tr, x, cause, name)); assert (sp); return sp; } diff --git a/lily/context.cc b/lily/context.cc index 6759a21d71..2e2c2e8873 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -20,7 +20,6 @@ #include "lilypond-key.hh" #include "profile.hh" - bool Context::is_removable () const { @@ -103,16 +102,16 @@ Context::Context (Object_key const *key) definition_ = SCM_EOL; smobify_self (); - + Scheme_hash_table *tab = new Scheme_hash_table; - properties_scm_ = tab->unprotect (); + properties_scm_ = tab->unprotect (); /* - UGH UGH - const correctness. + UGH UGH + const correctness. */ if (key_) - ((Object_key*)key)->unprotect (); + ((Object_key *)key)->unprotect (); } /* TODO: this shares code with find_create_context (). */ @@ -201,9 +200,7 @@ Context::find_create_context (SCM n, String id, SCM operations) String this_id = ""; if (i == path.size () -1) - { - this_id = id; - } + this_id = id; current = current->create_context (path[i], this_id, @@ -251,7 +248,7 @@ Context::get_context_key (String type, String id) { if (!use_object_keys) return 0; - + String now_key = type + "@" + id; int disambiguation_count = 0; @@ -273,7 +270,7 @@ Context::get_grob_key (String name) { if (!use_object_keys) return 0; - + int disambiguation_count = 0; if (grob_counts_.find (name) != grob_counts_.end ()) { @@ -297,7 +294,7 @@ SCM Context::default_child_context_name () const { return scm_is_pair (accepts_list_) - ? scm_car (accepts_list_) + ? scm_car (accepts_list_) : SCM_EOL; } @@ -365,7 +362,7 @@ Context::internal_get_property (SCM sym) const note_property_access (&context_property_lookup_table, sym); } #endif - + SCM val = SCM_EOL; if (properties_dict ()->try_retrieve (sym, &val)) return val; @@ -500,7 +497,7 @@ Context::now_mom () const { p = p->daddy_context_; } - + return p->now_mom (); } @@ -537,7 +534,7 @@ Context::mark_smob (SCM sm) Context *me = (Context *) SCM_CELL_WORD_1 (sm); if (me->key_) scm_gc_mark (me->key_->self_scm ()); - + scm_gc_mark (me->context_list_); scm_gc_mark (me->aliases_); scm_gc_mark (me->definition_); @@ -591,7 +588,7 @@ Context::clear_key_disambiguations () { if (!use_object_keys) return; - + grob_counts_.clear (); context_counts_.clear (); for (SCM s = context_list_; scm_is_pair (s); s = scm_cdr (s)) @@ -600,15 +597,14 @@ Context::clear_key_disambiguations () } } - /* - Ugh. Where to put this? + Ugh. Where to put this? */ Rational measure_length (Context const *context) { SCM l = context->get_property ("measureLength"); - Rational length (1); + Rational length (1); if (unsmob_moment (l)) length = unsmob_moment (l)->main_part_; return length; diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index f25a26afbf..5ebb39c6ca 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -17,7 +17,6 @@ #include "translator.icc" - /* * This class implements an engraver for custos symbols. * @@ -135,9 +134,8 @@ Custos_engraver::finalize () custodes_.clear (); } - -ADD_ACKNOWLEDGER (Custos_engraver,bar); -ADD_ACKNOWLEDGER (Custos_engraver,note_head); +ADD_ACKNOWLEDGER (Custos_engraver, bar); +ADD_ACKNOWLEDGER (Custos_engraver, note_head); ADD_TRANSLATOR (Custos_engraver, /* doc */ "", diff --git a/lily/default-actions.cc b/lily/default-actions.cc deleted file mode 100644 index ef7f931191..0000000000 --- a/lily/default-actions.cc +++ /dev/null @@ -1,10 +0,0 @@ -/* - default-actions.cc -- implement default toplevel actions for .ly - file. - - source file of the GNU LilyPond music typesetter - - (c) 2005 Han-Wen Nienhuys - -*/ - diff --git a/lily/default-bar-line-engraver.cc b/lily/default-bar-line-engraver.cc index 733e8afe5b..086bc8374c 100644 --- a/lily/default-bar-line-engraver.cc +++ b/lily/default-bar-line-engraver.cc @@ -12,7 +12,6 @@ #include "grob.hh" #include "warn.hh" - class Default_bar_line_engraver : public Engraver { protected: @@ -31,15 +30,14 @@ public: ADD_TRANSLATOR (Default_bar_line_engraver, "This engraver determines what kind of automatic bar lines should be produced, " "and sets @code{whichBar} accordingly. It should be at the same " - "level as @ref{Timing_translator}. ", + "level as @ref{Timing_translator}. ", /* create */ "", /* accept */ "", - /* read */ + /* read */ "measurePosition automaticBars whichBar barAlways defaultBarType " "measureLength", /* write */ "automaticBars"); - Default_bar_line_engraver::Default_bar_line_engraver () { last_moment_.main_part_ = Rational (-1); diff --git a/lily/dot-column-engraver.cc b/lily/dot-column-engraver.cc index dd18d5832a..a2c0e2804b 100644 --- a/lily/dot-column-engraver.cc +++ b/lily/dot-column-engraver.cc @@ -25,7 +25,7 @@ protected: DECLARE_ACKNOWLEDGER (stem); DECLARE_ACKNOWLEDGER (rhythmic_head); - + void stop_translation_timestep (); }; @@ -66,7 +66,6 @@ Dot_column_engraver::acknowledge_rhythmic_head (Grob_info info) } } - void Dot_column_engraver::acknowledge_stem (Grob_info info) { diff --git a/lily/dot-column.cc b/lily/dot-column.cc index ec00373261..1121ff04be 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -159,9 +159,7 @@ shift_one (Dot_configuration const &cfg, else { if (new_cfg.find (p) == new_cfg.end ()) - { - offset = 0; - } + offset = 0; new_cfg[p + offset] = i->second; } } @@ -188,9 +186,7 @@ shift_one (Dot_configuration const &cfg, else { if (new_cfg.find (p) == new_cfg.end ()) - { - offset = 0; - } + offset = 0; new_cfg[p + offset] = i->second; } diff --git a/lily/drum-note-engraver.cc b/lily/drum-note-engraver.cc index b018e52902..02bb19f1d1 100644 --- a/lily/drum-note-engraver.cc +++ b/lily/drum-note-engraver.cc @@ -146,9 +146,7 @@ Drum_notes_engraver::acknowledge_note_column (Grob_info inf) if (!e->get_parent (X_AXIS) && Side_position_interface::get_axis (e) == Y_AXIS) - { - e->set_parent (inf.grob (), X_AXIS); - } + e->set_parent (inf.grob (), X_AXIS); } } @@ -165,7 +163,7 @@ Drum_notes_engraver::stop_translation_timestep () #include "translator.icc" ADD_ACKNOWLEDGER (Drum_notes_engraver, stem); -ADD_ACKNOWLEDGER (Drum_notes_engraver,note_column); +ADD_ACKNOWLEDGER (Drum_notes_engraver, note_column); ADD_TRANSLATOR (Drum_notes_engraver, /* doc */ "Generate noteheads.", /* create */ "NoteHead Dots Script", diff --git a/lily/drum-note-performer.cc b/lily/drum-note-performer.cc index 27d0de7999..e52e0a7ad9 100644 --- a/lily/drum-note-performer.cc +++ b/lily/drum-note-performer.cc @@ -29,7 +29,6 @@ private: Link_array notes_; }; - Drum_note_performer::Drum_note_performer () { } diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 5a9668e526..1a93d23a12 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -64,7 +64,6 @@ class Dynamic_engraver : public Engraver DECLARE_ACKNOWLEDGER (note_column); DECLARE_ACKNOWLEDGER (slur); - protected: virtual void finalize (); virtual bool try_music (Music *event); @@ -170,7 +169,7 @@ Dynamic_engraver::process_music () cresc_->set_bound (RIGHT, script_); add_bound_item (line_spanner_, script_); } - + finished_cresc_ = cresc_; cresc_ = 0; current_cresc_ev_ = 0; @@ -231,7 +230,7 @@ Dynamic_engraver::process_music () } cresc_->set_property ("grow-direction", scm_from_int ((start_type == "crescendo") - ? BIGGER : SMALLER)); + ? BIGGER : SMALLER)); } /* @@ -278,7 +277,7 @@ Dynamic_engraver::stop_translation_timestep () finished_line_spanner_ = line_spanner_; line_spanner_ = 0; } - + typeset_all (); if (cresc_ && !cresc_->get_bound (LEFT)) @@ -397,13 +396,12 @@ Dynamic_engraver::acknowledge_note_column (Grob_info info) if (script_ && !script_->get_parent (X_AXIS)) { extract_grob_set (info.grob (), "note-heads", heads); - if (heads.size()) + if (heads.size ()) { Grob *head = heads[0]; script_->set_parent (head, X_AXIS); script_->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, X_AXIS); - } } @@ -446,7 +444,7 @@ ADD_ACKNOWLEDGER (Dynamic_engraver, note_column); ADD_ACKNOWLEDGER (Dynamic_engraver, slur); ADD_TRANSLATOR (Dynamic_engraver, - /* doc */ + /* doc */ "This engraver creates hairpins, dynamic texts, and their vertical\n" "alignments. The symbols are collected onto a DynamicLineSpanner grob\n" "which takes care of vertical positioning. ", diff --git a/lily/dynamic-performer.cc b/lily/dynamic-performer.cc index ce0b4e907e..c1d28c52f1 100644 --- a/lily/dynamic-performer.cc +++ b/lily/dynamic-performer.cc @@ -12,7 +12,6 @@ #include "music.hh" #include "translator.icc" - /* TODO: @@ -85,9 +84,7 @@ Dynamic_performer::create_audio_elements () SCM eq = get_property ("instrumentEqualizer"); if (ly_is_procedure (eq)) - { - s = scm_call_1 (eq, s); - } + s = scm_call_1 (eq, s); if (is_number_pair (s)) { diff --git a/lily/dynamic-text-spanner.cc b/lily/dynamic-text-spanner.cc index 37b701cf65..e40d3cd686 100644 --- a/lily/dynamic-text-spanner.cc +++ b/lily/dynamic-text-spanner.cc @@ -102,7 +102,7 @@ Dynamic_text_spanner::print (SCM smob) SCM text = index_get_cell (edge_text, d); if (Text_interface::is_markup (text)) - edge[d] = *unsmob_stencil (Text_interface::interpret_markup (layout->self_scm (), properties, text)); + edge[d] = *unsmob_stencil (Text_interface::interpret_markup (layout->self_scm (), properties, text)); if (!edge[d].is_empty ()) edge[d].align_to (Y_AXIS, CENTER); diff --git a/lily/easy-notation.cc b/lily/easy-notation.cc index 00e93f1905..a786372441 100644 --- a/lily/easy-notation.cc +++ b/lily/easy-notation.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "note-head.hh" @@ -70,7 +69,7 @@ Note_head::brew_ez_stencil (SCM smob) Stencil head; Box extent (Interval (-radius, radius), Interval (-radius, radius)); - + Stencil black_head (extent, scm_list_4 (ly_symbol2scm ("circle"), scm_from_double (radius), @@ -79,19 +78,18 @@ Note_head::brew_ez_stencil (SCM smob) Stencil white_head; if (black) { - l = l.in_color (1, 1, 1); + l = l.in_color (1, 1, 1); } else { white_head = Stencil (extent, scm_list_4 (ly_symbol2scm ("circle"), - scm_from_double (radius - stem_thick), - scm_from_double (0.0), - SCM_BOOL_T)); + scm_from_double (radius - stem_thick), + scm_from_double (0.0), + SCM_BOOL_T)); white_head = white_head.in_color (1, 1, 1); } - Stencil total; total.add_stencil (l); diff --git a/lily/engraver-group-engraver.cc b/lily/engraver-group-engraver.cc index 41a838fc6f..0054eb913a 100644 --- a/lily/engraver-group-engraver.cc +++ b/lily/engraver-group-engraver.cc @@ -19,9 +19,9 @@ Engraver_group_engraver::announce_grob (Grob_info info) { announce_infos_.push (info); - Engraver_group_engraver * dad_eng = - context_->get_parent_context () - ? dynamic_cast (context_->get_parent_context ()->implementation ()) + Engraver_group_engraver *dad_eng + = context_->get_parent_context () + ? dynamic_cast (context_->get_parent_context ()->implementation ()) : 0; if (dad_eng) dad_eng->announce_grob (info); @@ -64,11 +64,8 @@ Engraver_group_engraver::acknowledge_grobs () scm_hashq_set_x (acknowledge_hash_table_, nm, acklist); } - if (dispatch) - { - dispatch->apply (info); - } + dispatch->apply (info); } } @@ -121,7 +118,6 @@ Engraver_group_engraver::do_announces () while (pending_grob_count () > 0); } - Engraver_group_engraver::Engraver_group_engraver () { acknowledge_hash_table_ = SCM_EOL; @@ -138,7 +134,6 @@ ADD_TRANSLATOR_GROUP (Engraver_group_engraver, /* write */ ""); - void Engraver_group_engraver::derived_mark () const { diff --git a/lily/engraver.cc b/lily/engraver.cc index a8d833874a..2d9d6ae359 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -65,4 +65,3 @@ ADD_TRANSLATOR (Engraver, "", ""); - diff --git a/lily/extender-engraver.cc b/lily/extender-engraver.cc index c740b51dab..52096273be 100644 --- a/lily/extender-engraver.cc +++ b/lily/extender-engraver.cc @@ -115,9 +115,7 @@ completize_extender (Spanner *sp) { extract_item_set (sp, "heads", heads); if (heads.size ()) - { - sp->set_bound (RIGHT, heads.top()); - } + sp->set_bound (RIGHT, heads.top ()); } } @@ -145,7 +143,7 @@ Extender_engraver::finalize () #include "translator.icc" -ADD_ACKNOWLEDGER (Extender_engraver,lyric_syllable); +ADD_ACKNOWLEDGER (Extender_engraver, lyric_syllable); ADD_TRANSLATOR (Extender_engraver, /* doc */ "Create lyric extenders", /* create */ "LyricExtender", diff --git a/lily/file-name-map.cc b/lily/file-name-map.cc index c569f4538d..dc1a240e46 100644 --- a/lily/file-name-map.cc +++ b/lily/file-name-map.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include @@ -17,7 +16,7 @@ std::map file_name_map_global; String map_file_name (String s) { - if (file_name_map_global.find (s) != file_name_map_global.end ()) + if (file_name_map_global.find (s) != file_name_map_global.end ()) { s = file_name_map_global[s]; } diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index 8177ec0c9c..83c8569166 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -13,7 +13,6 @@ #include "self-alignment-interface.hh" #include "pitch.hh" - class Fingering_engraver : public Engraver { Link_array events_; @@ -139,8 +138,8 @@ Fingering_engraver::Fingering_engraver () #include "translator.icc" -ADD_ACKNOWLEDGER (Fingering_engraver,rhythmic_head); -ADD_ACKNOWLEDGER (Fingering_engraver,stem); +ADD_ACKNOWLEDGER (Fingering_engraver, rhythmic_head); +ADD_ACKNOWLEDGER (Fingering_engraver, stem); ADD_TRANSLATOR (Fingering_engraver, /* doc */ "Create fingering-scripts", /* create */ "Fingering", diff --git a/lily/font-config.cc b/lily/font-config.cc index 2c1dfb0a34..46a38b9048 100644 --- a/lily/font-config.cc +++ b/lily/font-config.cc @@ -23,15 +23,14 @@ init_fontconfig () { if (be_verbose_global) message (_ ("Initializing FontConfig...")); - + if (!FcInit ()) error (_ ("initializing FontConfig failed")); - font_config_global = FcConfigGetCurrent (); Array dirs; - struct stat statbuf; + struct stat statbuf; String builddir = prefix_directory + "/mf/out/"; if (stat (builddir.to_str0 (), &statbuf) == 0) @@ -42,7 +41,7 @@ init_fontconfig () dirs.push (prefix_directory + "/fonts/type1/"); dirs.push (prefix_directory + "/fonts/svg/"); } - + for (int i = 0; i < dirs.size (); i++) { String dir = dirs[i]; @@ -61,7 +60,6 @@ init_fontconfig () void init_fontconfig () { - } #endif diff --git a/lily/font-select.cc b/lily/font-select.cc index c4d85f864a..7d0ea7c6e2 100644 --- a/lily/font-select.cc +++ b/lily/font-select.cc @@ -121,9 +121,9 @@ select_encoded_font (Output_def *layout, SCM chain) #endif if (scm_is_string (name)) { - Real rmag = - robust_scm2double (ly_chain_assoc_get (ly_symbol2scm ("font-magnification"), chain, SCM_BOOL_F), - 1.0); + Real rmag + = robust_scm2double (ly_chain_assoc_get (ly_symbol2scm ("font-magnification"), chain, SCM_BOOL_F), + 1.0); Font_metric *fm = all_fonts_global->find_font (ly_scm2string (name)); return find_scaled_font (layout, fm, rmag); @@ -135,7 +135,7 @@ select_encoded_font (Output_def *layout, SCM chain) Real req = robust_scm2double (ly_chain_assoc_get (ly_symbol2scm ("font-size"), chain, SCM_BOOL_F), 0.0); - + return get_font_by_mag_step (layout, req, vec, scm_to_double (base_size)); } diff --git a/lily/font-size-engraver.cc b/lily/font-size-engraver.cc index 60d40ec009..d57f9219a5 100644 --- a/lily/font-size-engraver.cc +++ b/lily/font-size-engraver.cc @@ -25,11 +25,10 @@ Font_size_engraver::Font_size_engraver () size = 0.0; } - void Font_size_engraver::process_music () { - size = robust_scm2double (get_property ("fontSize"), 0.0); + size = robust_scm2double (get_property ("fontSize"), 0.0); } void @@ -39,10 +38,10 @@ Font_size_engraver::acknowledge_font (Grob_info gi) We only want to process a grob once. */ if (!size) - return ; + return; if (gi.context () != context ()) - return ; + return; Real font_size = size + robust_scm2double (gi.grob ()->get_property ("font-size"), 0); @@ -51,7 +50,7 @@ Font_size_engraver::acknowledge_font (Grob_info gi) #include "translator.icc" -ADD_ACKNOWLEDGER (Font_size_engraver,font); +ADD_ACKNOWLEDGER (Font_size_engraver, font); ADD_TRANSLATOR (Font_size_engraver, /* doc */ "Puts fontSize into font-relative-size grob property.", /* create */ "", diff --git a/lily/forbid-break-engraver.cc b/lily/forbid-break-engraver.cc index 2db24f41da..9599d8e28f 100644 --- a/lily/forbid-break-engraver.cc +++ b/lily/forbid-break-engraver.cc @@ -42,14 +42,11 @@ Forbid_line_break_engraver::start_translation_timestep () { Grob *g = unsmob_grob (scm_cdar (busy)); if (g->internal_has_interface (ly_symbol2scm ("rhythmic-grob-interface"))) - { - get_score_engraver ()->forbid_breaks (); - } + get_score_engraver ()->forbid_breaks (); busy = scm_cdr (busy); } } - ADD_TRANSLATOR (Forbid_line_break_engraver, /* doc */ "Forbid line breaks when note heads " "are still playing at some point.", diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index fe33278802..6d57d47769 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -306,7 +306,7 @@ LY_DEFINE (ly_stderr_redirect, "ly:stderr-redirect", { SCM_ASSERT_TYPE (scm_string_p (file_name), file_name, SCM_ARG1, __FUNCTION__, "file_name"); - char const* m = "w"; + char const *m = "w"; if (mode != SCM_UNDEFINED && scm_string_p (mode)) m = ly_scm2newstr (mode, 0); /* dup2 and (fileno (current-error-port)) do not work with mingw'c diff --git a/lily/glissando-engraver.cc b/lily/glissando-engraver.cc index 0ae1f2af56..424d8664f5 100644 --- a/lily/glissando-engraver.cc +++ b/lily/glissando-engraver.cc @@ -105,7 +105,7 @@ Glissando_engraver::finalize () #include "translator.icc" -ADD_ACKNOWLEDGER (Glissando_engraver,rhythmic_head); +ADD_ACKNOWLEDGER (Glissando_engraver, rhythmic_head); ADD_TRANSLATOR (Glissando_engraver, /* doc */ "Engrave a glissandi", /* create */ "Glissando", diff --git a/lily/global-context.cc b/lily/global-context.cc index fe5429c8b9..8a534ef3ca 100644 --- a/lily/global-context.cc +++ b/lily/global-context.cc @@ -130,9 +130,7 @@ Global_context::run_iterator_on_me (Music_iterator *iter) Moment w; w.set_infinite (1); if (iter->ok ()) - { - w = iter->pending_moment (); - } + w = iter->pending_moment (); w = sneaky_insert_extra_moment (w); if (w.main_part_.is_infinity ()) @@ -178,7 +176,7 @@ Global_context::apply_finalizations () SCM lst = get_property ("finalizations"); set_property ("finalizations", SCM_EOL); for (SCM s = lst; scm_is_pair (s); s = scm_cdr (s)) - + /* TODO: make safe. */ scm_primitive_eval (scm_car (s)); } diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 24eeb934a8..6310acb874 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -197,7 +197,7 @@ Gourlay_breaking::do_solve () const if (be_verbose_global) { message (_f ("Optimal demerits: %f", - optimal_paths.top ().demerits_) + "\n"); + optimal_paths.top ().demerits_) + "\n"); } if (optimal_paths.top ().demerits_ >= infinity_f) @@ -235,9 +235,7 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev, { SCM pen = pc->get_property ("penalty"); if (scm_is_number (pen) && fabs (scm_to_double (pen)) < 10000) - { - break_penalties += scm_to_double (pen); - } + break_penalties += scm_to_double (pen); } /* diff --git a/lily/grace-engraver.cc b/lily/grace-engraver.cc index d6daf18aa3..197d618c00 100644 --- a/lily/grace-engraver.cc +++ b/lily/grace-engraver.cc @@ -16,7 +16,7 @@ class Grace_engraver : public Engraver protected: void start_translation_timestep (); virtual void derived_mark () const; - virtual void initialize (); + virtual void initialize (); TRANSLATOR_DECLARATIONS (Grace_engraver); Moment last_moment_; @@ -27,7 +27,7 @@ public: Grace_engraver::Grace_engraver () { grace_settings_ = SCM_EOL; - last_moment_ = Moment (Rational (-1,1)); + last_moment_ = Moment (Rational (-1, 1)); } void @@ -70,9 +70,7 @@ Grace_engraver::consider_change_grace_settings () Context *c = context (); while (c && !c->is_alias (context_name)) - { - c = c->get_parent_context (); - } + c = c->get_parent_context (); if (c) { @@ -89,7 +87,7 @@ Grace_engraver::consider_change_grace_settings () } } - last_moment_ = now_mom(); + last_moment_ = now_mom (); } void diff --git a/lily/grace-music.cc b/lily/grace-music.cc index 3ed2d14aaf..d4945ee5a2 100644 --- a/lily/grace-music.cc +++ b/lily/grace-music.cc @@ -10,7 +10,6 @@ #include "music-wrapper.hh" #include "moment.hh" - class Grace_music { public: diff --git a/lily/gregorian-ligature-engraver.cc b/lily/gregorian-ligature-engraver.cc index 29690da2f9..4071045740 100644 --- a/lily/gregorian-ligature-engraver.cc +++ b/lily/gregorian-ligature-engraver.cc @@ -211,7 +211,7 @@ provide_context_info (Array primitives) if (prefix_set & PES_OR_FLEXA) if (!i) // ligature may not start with 2nd head of pes or flexa { - primitive->warning (_ ( "can't apply `\\~' on first head of ligature")); + primitive->warning (_ ("can't apply `\\~' on first head of ligature")); } else if (pitch > prev_pitch) // pes { @@ -228,9 +228,7 @@ provide_context_info (Array primitives) primitive->warning (_ ("can't apply `\\~' on heads with identical pitch")); } if (prev_prefix_set & DEMINUTUM) - { - context_info |= AFTER_DEMINUTUM; - } + context_info |= AFTER_DEMINUTUM; if (prev_primitive) prev_primitive->set_property ("context-info", diff --git a/lily/grid-line-interface.cc b/lily/grid-line-interface.cc index 7f1bdf47d5..82178f35e8 100644 --- a/lily/grid-line-interface.cc +++ b/lily/grid-line-interface.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "grid-line-interface.hh" @@ -15,7 +14,6 @@ #include "output-def.hh" #include "stencil.hh" - MAKE_SCHEME_CALLBACK (Grid_line_interface, print, 1); SCM Grid_line_interface::print (SCM smobbed_me) @@ -26,8 +24,8 @@ Grid_line_interface::print (SCM smobbed_me) /* compute common refpoint of elements */ Grob *refp = common_refpoint_of_array (elts, me, Y_AXIS); Interval iv; - - for (int i = 0; i < elts.size(); i++) + + for (int i = 0; i < elts.size (); i++) { Grob *point = elts[i]; @@ -44,7 +42,7 @@ Grid_line_interface::print (SCM smobbed_me) Real thick = robust_scm2double (me->get_property ("thickness"), 1.0) * staffline; - iv += - me->relative_coordinate (refp, Y_AXIS); + iv += -me->relative_coordinate (refp, Y_AXIS); Stencil st = Lookup::filled_box (Box (Interval (0, thick), iv)); @@ -62,7 +60,7 @@ Grid_line_interface::width_callback (SCM element_smob, SCM scm_axis) Real staffline = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness")); Real thick = robust_scm2double (me->get_property ("thickness"), 1.0) * staffline; - + return ly_interval2scm (Interval (0, thick)); } @@ -76,7 +74,6 @@ ADD_INTERFACE (Grid_line_interface, "grid-line-interface", "A line that spanned between grid-points. ", "elements thickness"); - ADD_INTERFACE (Grid_point_interface, "grid-point-interface", "A spanning point for grid lines. ", ""); diff --git a/lily/grid-line-span-engraver.cc b/lily/grid-line-span-engraver.cc index a5122fa592..623b95a1df 100644 --- a/lily/grid-line-span-engraver.cc +++ b/lily/grid-line-span-engraver.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "engraver.hh" diff --git a/lily/grid-line.cc b/lily/grid-line.cc deleted file mode 100644 index 8b13789179..0000000000 --- a/lily/grid-line.cc +++ /dev/null @@ -1 +0,0 @@ - diff --git a/lily/grid-point-engraver.cc b/lily/grid-point-engraver.cc index ab321add16..f139d2a5ce 100644 --- a/lily/grid-point-engraver.cc +++ b/lily/grid-point-engraver.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "engraver.hh" @@ -24,7 +23,7 @@ protected: void Grid_point_engraver::process_music () { - SCM grid_interval = get_property ("gridInterval"); + SCM grid_interval = get_property ("gridInterval"); if (Moment *mom = unsmob_moment (grid_interval)) { Moment now = now_mom (); @@ -40,7 +39,6 @@ Grid_point_engraver::Grid_point_engraver () { } - ADD_TRANSLATOR (Grid_point_engraver, /* doc */ "generate grid points.", /* create */ "GridPoint", diff --git a/lily/grob-array.cc b/lily/grob-array.cc index 785b5c215a..5ee86a1d1a 100644 --- a/lily/grob-array.cc +++ b/lily/grob-array.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "grob-array.hh" @@ -16,13 +15,13 @@ Item * Grob_array::item (int i) { - return dynamic_cast (grobs_.elem (i)); + return dynamic_cast (grobs_.elem (i)); } -Spanner* +Spanner * Grob_array::spanner (int i) { - return dynamic_cast (grobs_.elem (i)); + return dynamic_cast (grobs_.elem (i)); } Grob_array::Grob_array () @@ -36,24 +35,22 @@ Grob_array::array_reference () return grobs_; } - Link_array const & Grob_array::array () const { return grobs_; } - SCM Grob_array::mark_smob (SCM s) { (void) s; - + #if 0 /* see System::derived_mark () const */ - Grob_array *ga = unsmob_grob_array (s); - for (int i = 0; i < ga->grobs_.size(); i++) + Grob_array *ga = unsmob_grob_array (s); + for (int i = 0; i < ga->grobs_.size (); i++) scm_gc_mark (ga->grobs_[i]->self_scm ()); -#endif +#endif return SCM_UNDEFINED; } @@ -62,16 +59,15 @@ Grob_array::print_smob (SCM arr, SCM port, scm_print_state*) { scm_puts ("#size(); i++) + Grob_array *grob_arr = unsmob (arr); + for (int i = 0; i < grob_arr->size (); i++) { scm_display (grob_arr->grob (i)->self_scm (), port); - scm_puts (" " , port); + scm_puts (" ", port); } scm_puts (">", port); return 1; } - SCM Grob_array::make_array () @@ -95,7 +91,7 @@ Grob_array::is_empty () const void Grob_array::set_array (Link_array const &src) { - grobs_ = src; + grobs_ = src; } IMPLEMENT_SIMPLE_SMOBS (Grob_array); @@ -103,7 +99,6 @@ IMPLEMENT_TYPE_P (Grob_array, "ly:grob-array?"); IMPLEMENT_DEFAULT_EQUAL_P (Grob_array); - SCM grob_list_to_grob_array (SCM lst) { diff --git a/lily/grob-info.cc b/lily/grob-info.cc index 161fe778e5..e7445d9e90 100644 --- a/lily/grob-info.cc +++ b/lily/grob-info.cc @@ -14,7 +14,6 @@ #include "spanner.hh" #include "item.hh" - Grob_info::Grob_info (Translator *t, Grob *g) { origin_trans_ = t; @@ -49,21 +48,20 @@ Grob_info::origin_contexts (Translator *end) const return r; } - -Context* +Context * Grob_info::context () const { return origin_trans_->context (); } -Spanner* +Spanner * Grob_info::spanner () const { - return dynamic_cast (grob_); + return dynamic_cast (grob_); } -Item* +Item * Grob_info::item () const { - return dynamic_cast (grob_); + return dynamic_cast (grob_); } diff --git a/lily/grob-pq-engraver.cc b/lily/grob-pq-engraver.cc index 6a74a4375c..d40552b6ae 100644 --- a/lily/grob-pq-engraver.cc +++ b/lily/grob-pq-engraver.cc @@ -81,7 +81,7 @@ Grob_pq_engraver::acknowledge_grob (Grob_info gi) Grob_pq_entry e; e.grob_ = gi.grob (); e.end_ = end; - + started_now_.push (e); } } @@ -105,9 +105,9 @@ Grob_pq_engraver::stop_translation_timestep () *tail = scm_acons (started_now_[i].end_.smobbed_copy (), started_now_[i].grob_->self_scm (), SCM_EOL); - tail = SCM_CDRLOC(*tail); + tail = SCM_CDRLOC (*tail); } - + busy = scm_merge_x (lst, busy, ly_grob_pq_less_p_proc); context ()->set_property ("busyGrobs", busy); diff --git a/lily/grob-property.cc b/lily/grob-property.cc index 16fb8be221..8cb3243f4b 100644 --- a/lily/grob-property.cc +++ b/lily/grob-property.cc @@ -61,7 +61,6 @@ Grob::add_to_list_property (SCM sym, SCM thing) } - extern void check_interfaces_for_property (Grob const *me, SCM sym); void @@ -71,12 +70,12 @@ Grob::internal_set_property (SCM sym, SCM v) SCM grob_p = ly_lily_module_constant ("ly:grob?"); SCM grob_list_p = ly_lily_module_constant ("grob-list?"); SCM type = scm_object_property (sym, ly_symbol2scm ("backend-type?")); - + if (type == grob_p || type == grob_list_p || (unsmob_grob (v) && ly_symbol2scm ("cause") != sym)) { - scm_display (scm_list_2 (sym, type), scm_current_output_port()); + scm_display (scm_list_2 (sym, type), scm_current_output_port ()); assert (0); } #endif @@ -99,7 +98,6 @@ Grob::internal_set_property (SCM sym, SCM v) - SCM Grob::internal_get_property (SCM sym) const { @@ -109,11 +107,11 @@ Grob::internal_get_property (SCM sym) const note_property_access (&grob_property_lookup_table, sym); } #endif - + SCM s = scm_sloppy_assq (sym, mutable_property_alist_); if (s != SCM_BOOL_F) return scm_cdr (s); - + s = scm_sloppy_assq (sym, immutable_property_alist_); if (do_internal_type_checking_global && scm_is_pair (s)) @@ -129,7 +127,6 @@ Grob::internal_get_property (SCM sym) const } - void Grob::internal_set_object (SCM s, SCM v) { diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc index 3d5d83f4fb..344612c8f8 100644 --- a/lily/grob-scheme.cc +++ b/lily/grob-scheme.cc @@ -15,7 +15,6 @@ #include "system.hh" #include "font-interface.hh" - LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!", 3, 0, 0, (SCM grob, SCM sym, SCM val), "Set @var{sym} in grob @var{grob} to value @var{val}") @@ -59,7 +58,6 @@ LY_DEFINE (ly_grob_object, "ly:grob-object", return sc->internal_get_object (sym); } - LY_DEFINE (ly_spanner_get_bound, "ly:spanner-get-bound", 2, 0, 0, (SCM slur, SCM dir), "Get one of the bounds of @var{spanner}. @var{dir} is @code{-1} " @@ -98,7 +96,7 @@ LY_DEFINE (ly_grob_alist_chain, "ly:grob-alist-chain", if (global == SCM_UNDEFINED) global = SCM_EOL; } - + return sc->get_property_alist_chain (global); } @@ -252,7 +250,6 @@ LY_DEFINE (ly_grob_key, "ly:grob-key", } - LY_DEFINE (ly_grob_default_font, "ly:grob-default-font", 1, 0, 0, (SCM grob), "Return the default font for grob @var{gr}.") diff --git a/lily/grob-smob.cc b/lily/grob-smob.cc index e7800e96e2..e2e673e194 100644 --- a/lily/grob-smob.cc +++ b/lily/grob-smob.cc @@ -4,9 +4,7 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ - #include "grob.hh" diff --git a/lily/grob.cc b/lily/grob.cc index bcf0f473b3..4ace057b88 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -57,7 +57,6 @@ Grob::Grob (SCM basicprops, mutable_property_alist_ = SCM_EOL; object_alist_ = SCM_EOL; - /* 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. */ @@ -68,9 +67,9 @@ Grob::Grob (SCM basicprops, */ if (key_) { - ((Object_key*)key_)->unprotect (); + ((Object_key *)key_)->unprotect (); } - + SCM meta = get_property ("meta"); if (scm_is_pair (meta)) { @@ -100,7 +99,7 @@ Grob::Grob (SCM basicprops, for (int a = X_AXIS; a <= Y_AXIS; a++) { SCM l = off_callbacks[a]; - + if (scm_ilength (l) >= 0) { dim_cache_[a].offset_callbacks_ = l; @@ -111,19 +110,13 @@ Grob::Grob (SCM basicprops, SCM cb = extent_callbacks[a]; if (cb == SCM_BOOL_F) - { - dim_cache_[a].dimension_ = SCM_BOOL_F; - } + dim_cache_[a].dimension_ = SCM_BOOL_F; SCM xt = extents[a]; if (is_number_pair (xt)) - { - dim_cache_[a].dimension_ = xt; - } + dim_cache_[a].dimension_ = xt; else if (ly_is_procedure (cb)) - { - dim_cache_[a].dimension_callback_ = cb; - } + dim_cache_[a].dimension_callback_ = cb; else if (cb == SCM_EOL && ly_is_procedure (get_property ("print-function"))) dim_cache_[a].dimension_callback_ = stencil_extent_proc; @@ -141,7 +134,7 @@ Grob::Grob (Grob const &s, int copy_index) mutable_property_alist_ = ly_deep_copy (s.mutable_property_alist_); interfaces_ = s.interfaces_; object_alist_ = SCM_EOL; - + /* No properties are copied. That is the job of handle_broken_dependencies. */ status_ = s.status_; @@ -150,7 +143,7 @@ Grob::Grob (Grob const &s, int copy_index) smobify_self (); if (key_) { - ((Object_key*)key_)->unprotect (); + ((Object_key *)key_)->unprotect (); } } @@ -258,7 +251,7 @@ Grob::get_uncached_stencil () const SCM expr = m->expr (); if (point_and_click_global) expr = scm_list_3 (ly_symbol2scm ("grob-cause"), self_scm (), expr); - + stil = Stencil (m->extent_box (), expr).smobbed_copy (); } @@ -315,7 +308,6 @@ Grob::handle_broken_dependencies () { for (SCM s = object_alist_; scm_is_pair (s); s = scm_cdr (s)) sp->substitute_one_mutable_property (scm_caar (s), scm_cdar (s)); - } System *system = get_system (); @@ -350,7 +342,7 @@ Grob::suicide () object_alist_ = SCM_EOL; immutable_property_alist_ = SCM_EOL; interfaces_ = SCM_EOL; - + set_extent (SCM_EOL, Y_AXIS); set_extent (SCM_EOL, X_AXIS); @@ -490,7 +482,7 @@ Grob::extent (Grob *refp, Axis a) const extra = (a == X_AXIS) ? get_property ("minimum-X-extent") : get_property ("minimum-Y-extent"); - + if (scm_is_pair (extra)) ext.unite (Interval (scm_to_double (scm_car (extra)), scm_to_double (scm_cdr (extra)))); @@ -651,7 +643,6 @@ Grob::programming_error (String s) const void Grob::discretionary_processing () { - } bool diff --git a/lily/hairpin.cc b/lily/hairpin.cc index c231c90eba..1b3fbd4a20 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -20,12 +20,12 @@ #include "text-interface.hh" #include "pointer-group-interface.hh" -MAKE_SCHEME_CALLBACK(Hairpin,after_line_breaking,1); +MAKE_SCHEME_CALLBACK (Hairpin, after_line_breaking, 1); SCM Hairpin::after_line_breaking (SCM smob) { Spanner *me = dynamic_cast (unsmob_grob (smob)); - + Drul_array broken; Drul_array bounds; Direction d = LEFT; @@ -38,14 +38,13 @@ Hairpin::after_line_breaking (SCM smob) if (broken[LEFT] && ly_is_equal (bounds[RIGHT]->get_column ()->get_property ("when"), - bounds[LEFT]->get_property ("when"))) + bounds[LEFT]->get_property ("when"))) { me->suicide (); } return SCM_UNSPECIFIED; } - MAKE_SCHEME_CALLBACK (Hairpin, print, 1); SCM @@ -75,7 +74,7 @@ Hairpin::print (SCM smob) Grob *common = bounds[LEFT]->common_refpoint (bounds[RIGHT], X_AXIS); Drul_array x_points; - + do { Item *b = bounds[d]; @@ -97,7 +96,7 @@ Hairpin::print (SCM smob) { bool neighbor_found = false; extract_grob_set (me, "adjacent-hairpins", pins); - for (int i = 0; i < pins.size(); i++) + for (int i = 0; i < pins.size (); i++) { /* FIXME: this will fuck up in case of polyphonic @@ -105,7 +104,7 @@ Hairpin::print (SCM smob) in the current staff/voice. */ - Spanner *pin = dynamic_cast (pins[i]); + Spanner *pin = dynamic_cast (pins[i]); if (pin && (pin->get_bound (LEFT)->get_column () == b->get_column () || pin->get_bound (RIGHT)->get_column () == b->get_column ())) diff --git a/lily/hara-kiri-engraver.cc b/lily/hara-kiri-engraver.cc index 3b93a0d93b..30eda507cd 100644 --- a/lily/hara-kiri-engraver.cc +++ b/lily/hara-kiri-engraver.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "axis-group-engraver.hh" @@ -32,7 +31,7 @@ Hara_kiri_engraver::derived_mark () const { scm_gc_mark (interesting_); } - + void Hara_kiri_engraver::start_translation_timestep () { @@ -40,7 +39,6 @@ Hara_kiri_engraver::start_translation_timestep () interesting_ = get_property ("keepAliveInterfaces"); } - void Hara_kiri_engraver::add_element (Grob *e) { @@ -74,7 +72,6 @@ Hara_kiri_engraver::Hara_kiri_engraver () interesting_ = SCM_EOL; } - ADD_ACKNOWLEDGER (Hara_kiri_engraver, grob); ADD_TRANSLATOR (Hara_kiri_engraver, /* doc */ "Like Axis_group_engraver, but make a hara-kiri spanner, and add " diff --git a/lily/hara-kiri-group-spanner.cc b/lily/hara-kiri-group-spanner.cc index 0fad67b533..a96fe9a226 100644 --- a/lily/hara-kiri-group-spanner.cc +++ b/lily/hara-kiri-group-spanner.cc @@ -32,7 +32,7 @@ Hara_kiri_group_spanner::consider_suicide (Grob *me) { Spanner *sp = dynamic_cast (me); - extract_grob_set (me,"items-worth-living", worth); + extract_grob_set (me, "items-worth-living", worth); if (worth.size ()) return; @@ -63,7 +63,7 @@ Hara_kiri_group_spanner::force_hara_kiri_callback (SCM element_smob, SCM axis) { Grob *me = unsmob_grob (element_smob); (void) axis; - + assert (scm_to_int (axis) == Y_AXIS); consider_suicide (me); return scm_from_double (0.0); diff --git a/lily/horizontal-bracket-engraver.cc b/lily/horizontal-bracket-engraver.cc index 4670e4805f..20f090c6f9 100644 --- a/lily/horizontal-bracket-engraver.cc +++ b/lily/horizontal-bracket-engraver.cc @@ -29,8 +29,7 @@ public: DECLARE_ACKNOWLEDGER (note_column); }; - -ADD_ACKNOWLEDGER (Horizontal_bracket_engraver,note_column); +ADD_ACKNOWLEDGER (Horizontal_bracket_engraver, note_column); ADD_TRANSLATOR (Horizontal_bracket_engraver, "Create horizontal brackets over notes for musical analysis purposes.", "HorizontalBracket", diff --git a/lily/horizontal-bracket.cc b/lily/horizontal-bracket.cc index 3f318b5d68..57225c49d4 100644 --- a/lily/horizontal-bracket.cc +++ b/lily/horizontal-bracket.cc @@ -34,7 +34,7 @@ Horizontal_bracket::print (SCM smob) { Grob *me = unsmob_grob (smob); Spanner *sp = dynamic_cast (me); - + extract_grob_set (me, "columns", gs); if (!gs.size ()) { diff --git a/lily/hyphen-engraver.cc b/lily/hyphen-engraver.cc index 1ae200c152..4046ab06d0 100644 --- a/lily/hyphen-engraver.cc +++ b/lily/hyphen-engraver.cc @@ -42,7 +42,7 @@ Hyphen_engraver::Hyphen_engraver () void Hyphen_engraver::acknowledge_lyric_syllable (Grob_info i) { - Item *item = i.item(); + Item *item = i.item (); if (hyphen_) hyphen_->set_bound (LEFT, item); @@ -67,9 +67,7 @@ completize_hyphen (Spanner *sp) { extract_item_set (sp, "heads", heads); if (heads.size ()) - { - sp->set_bound (RIGHT, heads.top ()); - } + sp->set_bound (RIGHT, heads.top ()); } } @@ -134,7 +132,7 @@ Hyphen_engraver::stop_translation_timestep () #include "translator.icc" -ADD_ACKNOWLEDGER (Hyphen_engraver,lyric_syllable); +ADD_ACKNOWLEDGER (Hyphen_engraver, lyric_syllable); ADD_TRANSLATOR (Hyphen_engraver, /* doc */ "Create lyric hyphens", /* create */ "LyricHyphen", diff --git a/lily/include/axis-group-engraver.hh b/lily/include/axis-group-engraver.hh index 22563ac05e..85325987fe 100644 --- a/lily/include/axis-group-engraver.hh +++ b/lily/include/axis-group-engraver.hh @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #ifndef AXIS_GROUP_ENGRAVER_HH diff --git a/lily/include/beam.hh b/lily/include/beam.hh index b69fc15fce..120840cff4 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -14,17 +14,16 @@ #include "lily-guile.hh" #include "stem-info.hh" - /* TODO: move quanting in separate file. - */ -struct Beam_quant_parameters { +*/ +struct Beam_quant_parameters +{ Real INTER_QUANT_PENALTY; Real SECONDARY_BEAM_DEMERIT; Real STEM_LENGTH_DEMERIT_FACTOR; Real REGION_SIZE; - /* threshold to combat rounding errors. */ @@ -37,7 +36,7 @@ struct Beam_quant_parameters { Real IDEAL_SLOPE_FACTOR; Real ROUND_TO_ZERO_SLOPE; - void fill (Grob *him); + void fill (Grob *him); }; class Beam @@ -69,7 +68,7 @@ public: DECLARE_SCHEME_CALLBACK (slope_damping, (SCM)); DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM)); DECLARE_SCHEME_CALLBACK (quanting, (SCM)); - static Real score_slopes_dy (Real, Real, Real, Real, Real, bool, Beam_quant_parameters const*); + static Real score_slopes_dy (Real, Real, Real, Real, Real, bool, Beam_quant_parameters const *); static Real score_stem_lengths (Link_array const &stems, Array const &stem_infos, @@ -77,11 +76,11 @@ public: Array const &stem_xs, Real xl, Real xr, bool knee, - Real yl, Real yr, Beam_quant_parameters const*); + Real yl, Real yr, Beam_quant_parameters const *); static Real score_forbidden_quants (Real, Real, Real, Real, Real, Real, Drul_array, Direction, Direction, - Beam_quant_parameters const*); + Beam_quant_parameters const *); static int get_direction_beam_count (Grob *me, Direction d); private: diff --git a/lily/include/box.hh b/lily/include/box.hh index 813e698953..a8119664b7 100644 --- a/lily/include/box.hh +++ b/lily/include/box.hh @@ -12,7 +12,7 @@ class Box { Interval interval_a_[NO_AXES]; - DECLARE_SIMPLE_SMOBS(Box,); + DECLARE_SIMPLE_SMOBS (Box,); public: Interval &x () {return interval_a_[X_AXIS]; } Interval &y (){ return interval_a_[Y_AXIS]; } diff --git a/lily/include/chord.hh b/lily/include/chord.hh deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lily/include/context-def.hh b/lily/include/context-def.hh index 22a4c63995..5cc57063b0 100644 --- a/lily/include/context-def.hh +++ b/lily/include/context-def.hh @@ -31,7 +31,7 @@ private: SCM context_aliases_; SCM translator_group_type_; SCM default_child_; - + public: void add_context_mod (SCM); SCM get_default_child (SCM user_mods) const; diff --git a/lily/include/engraver-group-engraver.hh b/lily/include/engraver-group-engraver.hh index 8e3f18be15..b57f4e0bea 100644 --- a/lily/include/engraver-group-engraver.hh +++ b/lily/include/engraver-group-engraver.hh @@ -19,7 +19,7 @@ protected: Array announce_infos_; SCM acknowledge_hash_table_; public: - VIRTUAL_COPY_CONSTRUCTOR ( Translator_group, Engraver_group_engraver); + VIRTUAL_COPY_CONSTRUCTOR (Translator_group, Engraver_group_engraver); Engraver_group_engraver (); virtual void derived_mark () const; void do_announces (); diff --git a/lily/include/file-name-map.hh b/lily/include/file-name-map.hh index 6ae14254df..b3a8c6ff0c 100644 --- a/lily/include/file-name-map.hh +++ b/lily/include/file-name-map.hh @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #ifndef FILE_NAME_MAP_HH diff --git a/lily/include/freetype.hh b/lily/include/freetype.hh index 2e549e741e..16dcac17f4 100644 --- a/lily/include/freetype.hh +++ b/lily/include/freetype.hh @@ -17,7 +17,6 @@ void init_freetype (); extern FT_Library freetype2_library; - FT_Face open_ft_face (String str); #endif /* FREETYPE_HH */ diff --git a/lily/include/grid-line-interface.hh b/lily/include/grid-line-interface.hh index 1742a4e11c..ea39e14977 100644 --- a/lily/include/grid-line-interface.hh +++ b/lily/include/grid-line-interface.hh @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #ifndef GRID_LINE_INTERFACE_HH diff --git a/lily/include/grob-array.hh b/lily/include/grob-array.hh index f0f6b9072c..67f95ac201 100644 --- a/lily/include/grob-array.hh +++ b/lily/include/grob-array.hh @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #ifndef GROB_ARRAY_HH @@ -18,8 +17,8 @@ class Grob_array { Link_array grobs_; bool ordered_; - - DECLARE_SIMPLE_SMOBS(Grob_array,); + + DECLARE_SIMPLE_SMOBS (Grob_array,); Grob_array (); public: @@ -27,10 +26,10 @@ public: void set_ordered (bool b) { ordered_ = b; } Item *item (int i); Spanner *spanner (int i); - Grob * grob (int i) { return grobs_.elem (i); } - int size () const { return grobs_.size(); } + Grob *grob (int i) { return grobs_.elem (i); } + int size () const { return grobs_.size (); } bool is_empty () const; - void clear (); + void clear (); void add (Grob *x) { grobs_.push (x); } void set_array (Link_array const &src); Link_array &array_reference (); @@ -43,6 +42,5 @@ DECLARE_UNSMOB (Grob_array, grob_array); Link_array const &ly_scm2link_array (SCM x); SCM grob_list_to_grob_array (SCM lst); - #endif /* GROB_ARRAY_HH */ diff --git a/lily/include/grob-info.hh b/lily/include/grob-info.hh index 680bee5105..fcf2b44a75 100644 --- a/lily/include/grob-info.hh +++ b/lily/include/grob-info.hh @@ -24,9 +24,9 @@ class Grob_info friend class Engraver; public: Grob *grob () const { return grob_; } - Translator *origin_translator () const { return origin_trans_; } + Translator *origin_translator () const { return origin_trans_; } - Context *context () const; + Context *context () const; Music *music_cause (); Link_array origin_contexts (Translator *) const; Grob_info (Translator *, Grob *); diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 111e4b3b0b..a8993b9371 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -39,16 +39,15 @@ protected: /* If this is a property, it accounts for 25% of the property lookups. - */ + */ SCM interfaces_; - - + /* BARF */ friend class Spanner; friend SCM ly_grob_properties (SCM); friend SCM ly_grob_basic_properties (SCM); - friend void check_interfaces_for_property (Grob const*, SCM); + friend void check_interfaces_for_property (Grob const *, SCM); void substitute_object_links (SCM, SCM); char status_; @@ -80,7 +79,7 @@ public: /* JUNKME. - */ + */ void add_to_list_property (SCM, SCM); void add_to_object_list (SCM sym, SCM thing); diff --git a/lily/include/input.hh b/lily/include/input.hh index e5ad3b42c5..44b895089b 100644 --- a/lily/include/input.hh +++ b/lily/include/input.hh @@ -24,7 +24,7 @@ public: Source_file *get_source_file () const; char const *start () const; char const *end () const; - + void set (Source_file *, char const *, char const *); void warning (String) const; // should use member func? void non_fatal_error (String) const; @@ -37,14 +37,14 @@ public: String location_string () const; String line_number_string () const; String file_string ()const; - + int line_number ()const; int column_number ()const; int end_line_number ()const; int end_column_number ()const; - void get_counts (int*line, int *char_count, int *col) const; - + void get_counts (int *line, int *char_count, int *col) const; + Input (Input const &i); Input (); }; diff --git a/lily/include/ligature-engraver.hh b/lily/include/ligature-engraver.hh index ce3cba4aa8..d1a12e6be9 100644 --- a/lily/include/ligature-engraver.hh +++ b/lily/include/ligature-engraver.hh @@ -18,7 +18,6 @@ protected: void stop_translation_timestep (); virtual void finalize (); - DECLARE_ACKNOWLEDGER (rest); DECLARE_ACKNOWLEDGER (note_head); virtual bool try_music (Music *); diff --git a/lily/include/lily-guile-macros.hh b/lily/include/lily-guile-macros.hh index 03abe6bde5..24989a8acf 100644 --- a/lily/include/lily-guile-macros.hh +++ b/lily/include/lily-guile-macros.hh @@ -68,8 +68,8 @@ inline SCM ly_symbol2scm (char const *x) { return scm_str2symbol ((x)); } if (__builtin_constant_p ((x))) \ { \ if (!cached) \ - value = cached = scm_eval (scm_str2symbol (x), \ - global_lily_module); \ + value = cached = scm_eval (scm_str2symbol (x), \ + global_lily_module); \ } \ else \ value = scm_eval (scm_str2symbol (x), global_lily_module); \ diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 803be9db63..0f92293a4d 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -76,7 +76,6 @@ inline bool ly_is_list (SCM x) { return SCM_NFALSEP (scm_list_p (x)); } inline bool ly_is_procedure (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); } inline bool ly_is_port (SCM x) { return SCM_NFALSEP (scm_port_p (x)); } - inline bool ly_is_equal (SCM x, SCM y) { return SCM_NFALSEP (scm_equal_p (x, y)); @@ -160,8 +159,7 @@ typedef SCM (*Scheme_function_2) (...); typedef SCM (*Scheme_function_3) (...); #endif - -#define scm_cdr ly_cdr +#define scm_cdr ly_cdr #define scm_car ly_car #ifndef scm_is_pair @@ -174,5 +172,4 @@ inline bool ly_is_pair (SCM x) { return SCM_I_CONSP (x); } - #endif /* LILY_GUILE_HH */ diff --git a/lily/include/lily-parser.hh b/lily/include/lily-parser.hh index c971d94c32..9f20f8dadc 100644 --- a/lily/include/lily-parser.hh +++ b/lily/include/lily-parser.hh @@ -72,6 +72,6 @@ SCM ly_parser_scorify (SCM, SCM); Output_def *get_layout (Lily_parser *parser); Output_def *get_midi (Lily_parser *parser); Output_def *get_paper (Lily_parser *parser); -SCM get_header(Lily_parser *parser); +SCM get_header (Lily_parser *parser); #endif /* LILY_PARSER_HH */ diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 15c990ddff..5e7d39e78a 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -171,10 +171,8 @@ class Transposed_music; class Type_swallow_translator; class yyFlexLexer; - -typedef void (*Engraver_void_function_engraver_grob_info)(Engraver*, Grob_info); -typedef void (*Translator_void_method_ptr)(Translator*); - +typedef void (*Engraver_void_function_engraver_grob_info) (Engraver *, Grob_info); +typedef void (*Translator_void_method_ptr) (Translator *); diff --git a/lily/include/line-interface.hh b/lily/include/line-interface.hh index 73b269ebb1..b8d770c992 100644 --- a/lily/include/line-interface.hh +++ b/lily/include/line-interface.hh @@ -22,7 +22,6 @@ struct Line_interface static Stencil arrows (Grob *me, Offset from, Offset to, bool from_arrow, bool to_arrow); - }; #endif /* LINE_INTERFACE_HH */ diff --git a/lily/include/ly-smobs.icc b/lily/include/ly-smobs.icc index 7497b66d36..ec09848350 100644 --- a/lily/include/ly-smobs.icc +++ b/lily/include/ly-smobs.icc @@ -71,22 +71,23 @@ #define IMPLEMENT_SMOBS(CL) \ IMPLEMENT_BASE_SMOBS (CL) \ - void \ + void \ CL::smobify_self () \ { \ self_scm_ = unprotected_smobify_self (); \ - protection_cons_ = SCM_EOL;\ - protect();\ - }\ - void\ - CL::protect(){ \ - protect_smob (self_scm_, &protection_cons_);\ - }\ - SCM\ - CL::unprotect ()\ - {\ - unprotect_smob (&protection_cons_);\ - return self_scm_;\ + protection_cons_ = SCM_EOL; \ + protect (); \ + } \ + void \ + CL::protect () \ + { \ + protect_smob (self_scm_, &protection_cons_); \ + } \ + SCM \ + CL::unprotect () \ + { \ + unprotect_smob (&protection_cons_); \ + return self_scm_; \ } \ SCM \ CL::unprotected_smobify_self () \ diff --git a/lily/include/mensural-ligature.hh b/lily/include/mensural-ligature.hh index 3146dfc3bf..2a3c9318a6 100644 --- a/lily/include/mensural-ligature.hh +++ b/lily/include/mensural-ligature.hh @@ -16,13 +16,13 @@ /* * These are all possible mensural ligature primitives. */ -#define MLP_NONE 0x00 // no output -#define MLP_UP 0x01 // upward left stem -#define MLP_DOWN 0x02 // downward left stem -#define MLP_BREVIS 0x04 // mensural brevis head -#define MLP_LONGA 0x08 // mensural brevis head with right cauda -#define MLP_MAXIMA 0x10 // mensural maxima head without stem -#define MLP_FLEXA 0x20 // mensural flexa-like shape +#define MLP_NONE 0x00 // no output +#define MLP_UP 0x01 // upward left stem +#define MLP_DOWN 0x02 // downward left stem +#define MLP_BREVIS 0x04 // mensural brevis head +#define MLP_LONGA 0x08 // mensural brevis head with right cauda +#define MLP_MAXIMA 0x10 // mensural maxima head without stem +#define MLP_FLEXA 0x20 // mensural flexa-like shape #define MLP_STEM (MLP_UP | MLP_DOWN) #define MLP_SINGLE_HEAD (MLP_BREVIS | MLP_LONGA | MLP_MAXIMA) diff --git a/lily/include/mingw-compatibility.hh b/lily/include/mingw-compatibility.hh index 407d0b4e25..d67e6f927e 100644 --- a/lily/include/mingw-compatibility.hh +++ b/lily/include/mingw-compatibility.hh @@ -15,71 +15,70 @@ investigated whether this is a mingw bug or a windows bug (ie, mingw compatibility feature), also not reported yet. */ -# ifdef CHAR -# define LILY_CHAR CHAR -# undef CHAR -# endif -# define CHAR MINGW_INFRINGES_ON_OUR_NAMESPACE_USING_CHAR - -# ifdef CONTEXT -# define LILY_CONTEXT CONTEXT -# undef CONTEXT -# endif -# define CONTEXT MINGW_INFRINGES_ON_OUR_NAMESPACE_USING_CONTEXT - -# ifdef DATADIR -# define LILY_DATADIR DATADIR -# undef DATADIR -# endif -# define DATADIR MINGW_INFRINGES_ON_OUR_NAMESPACE_USING_DATADIR - -# ifdef RELATIVE -# define LILY_RELATIVE RELATIVE -# undef RELATIVE -# endif -# define RELATIVE MINGW_INFRINGES_ON_OUR_NAMESPACE_USING_RELATIVE - -# ifdef THIS -# define LILY_THIS THIS -# undef THIS -# endif -# define THIS MINGW_INFRINGES_ON_OUR_NAMESPACE_USING_THIS - -//# include +# ifdef CHAR +# define LILY_CHAR CHAR +# undef CHAR +# endif +# define CHAR MINGW_INFRINGES_ON_OUR_NAMESPACE_USING_CHAR + +# ifdef CONTEXT +# define LILY_CONTEXT CONTEXT +# undef CONTEXT +# endif +# define CONTEXT MINGW_INFRINGES_ON_OUR_NAMESPACE_USING_CONTEXT + +# ifdef DATADIR +# define LILY_DATADIR DATADIR +# undef DATADIR +# endif +# define DATADIR MINGW_INFRINGES_ON_OUR_NAMESPACE_USING_DATADIR + +# ifdef RELATIVE +# define LILY_RELATIVE RELATIVE +# undef RELATIVE +# endif +# define RELATIVE MINGW_INFRINGES_ON_OUR_NAMESPACE_USING_RELATIVE + +# ifdef THIS +# define LILY_THIS THIS +# undef THIS +# endif +# define THIS MINGW_INFRINGES_ON_OUR_NAMESPACE_USING_THIS + +//#include #if defined (__MINGW32__) && !defined (STATIC) # define SCM_IMPORT 1 #endif -# include - -# undef CHAR -# ifdef LILY_CHAR -# define CHAR LILY_CHAR -# endif - -# undef CONTEXT -# ifdef LILY_CONTEXT -# define CONTEXT LILY_CONTEXT -# endif -# undef CONTEXT - -# undef DATADIR -# ifdef LILY_DATADIR -# define DATADIR LILY_DATADIR -# endif -# undef DATADIR - -# undef RELATIVE -# ifdef LILY_RELATIVE -# define RELATIVE LILY_RELATIVE -# endif - -# undef THIS -# ifdef LILY_THIS -# define THIS LILY_THIS -# endif - +#include + +# undef CHAR +# ifdef LILY_CHAR +# define CHAR LILY_CHAR +# endif + +# undef CONTEXT +# ifdef LILY_CONTEXT +# define CONTEXT LILY_CONTEXT +# endif +# undef CONTEXT + +# undef DATADIR +# ifdef LILY_DATADIR +# define DATADIR LILY_DATADIR +# endif +# undef DATADIR + +# undef RELATIVE +# ifdef LILY_RELATIVE +# define RELATIVE LILY_RELATIVE +# endif + +# undef THIS +# ifdef LILY_THIS +# define THIS LILY_THIS +# endif #endif /* __MINGW__ */ diff --git a/lily/include/minterval.hh b/lily/include/minterval.hh deleted file mode 100644 index d08c0b4984..0000000000 --- a/lily/include/minterval.hh +++ /dev/null @@ -1,18 +0,0 @@ -/* - -- declare MInterval - - source file of the GNU LilyPond music typesetter - - (c) 1997--2005 Han-Wen Nienhuys -*/ - -#ifndef -#define - -#include "moment.hh" - -typedef Interval_t MInterval; - -#endif // - -#error diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index 6d2587e577..2b1f74ed53 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -97,8 +97,8 @@ bool is_child_context (Context *me, Context *child); (), \ "") \ { \ - Class *c = (new Class);\ - return c->unprotect();\ + Class *c = (new Class); \ + return c->unprotect (); \ } DECLARE_UNSMOB (Music_iterator, iterator); diff --git a/lily/include/music-output.hh b/lily/include/music-output.hh index c185f62247..15f930000b 100644 --- a/lily/include/music-output.hh +++ b/lily/include/music-output.hh @@ -16,14 +16,14 @@ class Music_output { - DECLARE_SMOBS(Music_output, foo); + DECLARE_SMOBS (Music_output, foo); protected: Music_output (); public: - virtual void derived_mark () const; - virtual void process (); + virtual void derived_mark () const; + virtual void process (); }; DECLARE_UNSMOB (Music_output, music_output); diff --git a/lily/include/open-type-font.hh b/lily/include/open-type-font.hh index ae90e276db..05d6f54d33 100644 --- a/lily/include/open-type-font.hh +++ b/lily/include/open-type-font.hh @@ -25,7 +25,7 @@ class Open_type_font : public Font_metric SCM lily_character_table_; SCM lily_global_table_; SCM lily_index_to_bbox_table_; - + Index_to_charcode_map index_to_charcode_map_; Open_type_font (FT_Face); diff --git a/lily/include/paper-book.hh b/lily/include/paper-book.hh index f0d2928918..2780a231ed 100644 --- a/lily/include/paper-book.hh +++ b/lily/include/paper-book.hh @@ -35,7 +35,7 @@ public: Output_def *paper_; Paper_book (); - + void add_score (SCM); void add_performance (SCM); @@ -47,7 +47,6 @@ public: void classic_output (SCM output_channel); void output (SCM output_channel); void post_processing (SCM, SCM); - }; DECLARE_UNSMOB (Paper_book, paper_book) diff --git a/lily/include/paper-column-engraver.hh b/lily/include/paper-column-engraver.hh index 651e7c786b..ee442e0805 100644 --- a/lily/include/paper-column-engraver.hh +++ b/lily/include/paper-column-engraver.hh @@ -4,21 +4,18 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #ifndef PAPER_COLUMN_ENGRAVER_HH #define PAPER_COLUMN_ENGRAVER_HH - #include "engraver.hh" - class Paper_column_engraver : public Engraver { void make_columns (); - void set_columns (Paper_column*, Paper_column*); - TRANSLATOR_DECLARATIONS(Paper_column_engraver); + void set_columns (Paper_column *, Paper_column *); + TRANSLATOR_DECLARATIONS (Paper_column_engraver); protected: void stop_translation_timestep (); @@ -26,7 +23,7 @@ protected: void process_music (); virtual void initialize (); virtual void finalize (); - virtual bool try_music (Music*); + virtual bool try_music (Music *); DECLARE_ACKNOWLEDGER (item); DECLARE_ACKNOWLEDGER (note_spacing); @@ -43,7 +40,6 @@ protected: public: // ug.h void forbid_breaks (); - }; #endif /* PAPER_COLUMN_ENGRAVER_HH */ diff --git a/lily/include/paper-column.hh b/lily/include/paper-column.hh index ff6d642fba..282b7c4c26 100644 --- a/lily/include/paper-column.hh +++ b/lily/include/paper-column.hh @@ -18,7 +18,6 @@ class Paper_column : public Item /// if lines are broken then this column is in #line# System *system_; - // ugh: friend declarations. friend void set_loose_columns (System *which, Column_x_positions const *posns); friend class System; @@ -33,7 +32,7 @@ public: int get_rank () const { return rank_; } void set_rank (int); - + DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM)); diff --git a/lily/include/paper-score.hh b/lily/include/paper-score.hh index bf9443cd50..a8191a361f 100644 --- a/lily/include/paper-score.hh +++ b/lily/include/paper-score.hh @@ -25,7 +25,7 @@ public: Output_def *layout () const; System *root_system () const; - + void typeset_system (System *); Array calc_breaking (); diff --git a/lily/include/performer-group-performer.hh b/lily/include/performer-group-performer.hh index e4cd0500ce..2a8d9a8d4e 100644 --- a/lily/include/performer-group-performer.hh +++ b/lily/include/performer-group-performer.hh @@ -16,13 +16,13 @@ typedef void (Performer:: *Performer_method) (void); class Performer_group_performer : public virtual Translator_group { public: - VIRTUAL_COPY_CONSTRUCTOR (Translator_group,Performer_group_performer); + VIRTUAL_COPY_CONSTRUCTOR (Translator_group, Performer_group_performer); void do_announces (); virtual void announce_element (Audio_element_info); virtual void play_element (Audio_element *p); virtual int get_tempo () const; - + protected: Array announce_infos_; diff --git a/lily/include/pointer-group-interface.hh b/lily/include/pointer-group-interface.hh index 0565b83c1f..ba13af355e 100644 --- a/lily/include/pointer-group-interface.hh +++ b/lily/include/pointer-group-interface.hh @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #ifndef POINTER_GROUP_INTERFACE_HH @@ -14,7 +13,6 @@ #include "lily-proto.hh" #include "lily-guile.hh" - struct Pointer_group_interface { public: @@ -26,20 +24,18 @@ public: Link_array const &internal_extract_grob_array (Grob const *elt, SCM symbol); Link_array internal_extract_item_array (Grob const *elt, SCM symbol); -#define extract_grob_array(x,prop) internal_extract_grob_array (x, ly_symbol2scm (prop)) -#define extract_item_array(x,prop) internal_extract_item_array (x, ly_symbol2scm (prop)) - +#define extract_grob_array(x, prop) internal_extract_grob_array (x, ly_symbol2scm (prop)) +#define extract_item_array(x, prop) internal_extract_item_array (x, ly_symbol2scm (prop)) /* This is dubious coding style, but lets not risk that we change the representation of grob sets again. - */ -#define extract_grob_set(grob,prop,set) \ - Link_array const &set (internal_extract_grob_array (grob, ly_symbol2scm (prop))) -#define extract_item_set(grob,prop,set) \ +*/ +#define extract_grob_set(grob, prop, set) \ + Link_array const &set (internal_extract_grob_array (grob, ly_symbol2scm (prop))) +#define extract_item_set(grob, prop, set) \ Link_array set (internal_extract_item_array (grob, ly_symbol2scm (prop))) - #endif /* POINTER_GROUP_INTERFACE_HH */ diff --git a/lily/include/profile.hh b/lily/include/profile.hh index 83206f686f..65986bc658 100644 --- a/lily/include/profile.hh +++ b/lily/include/profile.hh @@ -1,10 +1,9 @@ /* - profile.hh -- declare property profiling utils. + profile.hh -- declare property profiling utils. source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #ifndef PROFILE_HH diff --git a/lily/include/program-option.hh b/lily/include/program-option.hh index 53f900a00d..c307d88122 100644 --- a/lily/include/program-option.hh +++ b/lily/include/program-option.hh @@ -21,5 +21,4 @@ SCM ly_get_option (SCM); SCM ly_set_option (SCM, SCM); - #endif /* SCM_OPTION_HH */ diff --git a/lily/include/recording-group-engraver.hh b/lily/include/recording-group-engraver.hh index efb77d974b..5444ed6054 100644 --- a/lily/include/recording-group-engraver.hh +++ b/lily/include/recording-group-engraver.hh @@ -4,13 +4,11 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #ifndef RECORDING_GROUP_ENGRAVER_HH #define RECORDING_GROUP_ENGRAVER_HH - #include "engraver-group-engraver.hh" class Recording_group_engraver : public Engraver_group_engraver diff --git a/lily/include/score-engraver.hh b/lily/include/score-engraver.hh index f3847c528e..94273c0887 100644 --- a/lily/include/score-engraver.hh +++ b/lily/include/score-engraver.hh @@ -28,7 +28,6 @@ protected: virtual void prepare (Moment); virtual void one_time_step (); - /* Engraver_group_engraver interface */ virtual bool try_music (Music *); virtual void initialize (); @@ -38,7 +37,7 @@ protected: /* Translator interface - */ + */ virtual void derived_mark () const; public: diff --git a/lily/include/score-performer.hh b/lily/include/score-performer.hh index 953127e132..bd8528b876 100644 --- a/lily/include/score-performer.hh +++ b/lily/include/score-performer.hh @@ -17,7 +17,7 @@ class Score_performer : public Score_translator, public virtual Performer_group_performer { public: - VIRTUAL_COPY_CONSTRUCTOR (Translator_group,Score_performer); + VIRTUAL_COPY_CONSTRUCTOR (Translator_group, Score_performer); ~Score_performer (); Performance *performance_; diff --git a/lily/include/slur-configuration.hh b/lily/include/slur-configuration.hh index 23e67bceda..5e241d0e5f 100644 --- a/lily/include/slur-configuration.hh +++ b/lily/include/slur-configuration.hh @@ -30,7 +30,7 @@ public: Slur_configuration (); void generate_curve (Slur_score_state const &state, Real r0, Real h_inf, - Array const&); + Array const &); void score (Slur_score_state const &); protected: void score_extra_encompass (Slur_score_state const &); diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index 429aca960b..ba86f0fe84 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -120,10 +120,10 @@ private: \ void smobify_self (); \ SCM self_scm_; \ - SCM protection_cons_; \ + SCM protection_cons_; \ public: \ - SCM unprotect();\ - void protect();\ + SCM unprotect (); \ + void protect (); \ SCM self_scm () const { return self_scm_; } \ private: diff --git a/lily/include/source-file.hh b/lily/include/source-file.hh index 71a9df5d32..1a61070348 100644 --- a/lily/include/source-file.hh +++ b/lily/include/source-file.hh @@ -52,7 +52,7 @@ public: public: Slice line_slice (char const *pos_str0) const; String line_string (char const *pos_str0) const; - void get_counts (char const *pos_str0, int*, int*, int*) const; + void get_counts (char const *pos_str0, int *, int *, int *) const; /* JUNKME. diff --git a/lily/include/spacing-spanner.hh b/lily/include/spacing-spanner.hh index 7dbfdfc8b4..60ad275958 100644 --- a/lily/include/spacing-spanner.hh +++ b/lily/include/spacing-spanner.hh @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #ifndef SPACING_SPANNER_HH @@ -21,37 +20,37 @@ struct Spacing_options bool float_nonmusical_columns_; Rational global_shortest_; Real increment_; - Real shortest_duration_space_; - + Real shortest_duration_space_; + void init (); void init_from_grob (Grob *me); - Real get_duration_space (Moment d, bool*) const; + Real get_duration_space (Moment d, bool *) const; }; /* TODO: prune to public interface. - */ +*/ class Spacing_spanner { public: static void generate_pair_spacing (Grob *me, Paper_column *l, Paper_column *r, Paper_column *nextr, - Spacing_options const *options); + Spacing_options const *options); static void standard_breakable_column_spacing (Grob *me, Item *l, Item *r, Real *fixed, Real *space, - Spacing_options const*); + Spacing_options const *); static Real default_bar_spacing (Grob *, Grob *, Grob *, Moment); - static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const*, bool *); - static Real get_duration_space (Moment dur, Spacing_options const*, bool *); + static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const *, bool *); + static Real get_duration_space (Moment dur, Spacing_options const *, bool *); static Rational find_shortest (Grob *, Link_array const &); static Rational effective_shortest_duration (Grob *me, Link_array const &all); - static void breakable_column_spacing (Grob *, Item *l, Item *r, Spacing_options const*); - static void prune_loose_columns (Grob *, Link_array *cols, Spacing_options const*); + static void breakable_column_spacing (Grob *, Item *l, Item *r, Spacing_options const *); + static void prune_loose_columns (Grob *, Link_array *cols, Spacing_options const *); static void set_explicit_neighbor_columns (Link_array const &cols); static void set_implicit_neighbor_columns (Link_array const &cols); - static void generate_springs (Grob *me, Link_array const &cols, Spacing_options const*); - static void musical_column_spacing (Grob *, Item *, Item *, Spacing_options const*); + static void generate_springs (Grob *me, Link_array const &cols, Spacing_options const *); + static void musical_column_spacing (Grob *, Item *, Item *, Spacing_options const *); DECLARE_SCHEME_CALLBACK (set_springs, (SCM)); static bool has_interface (Grob *); }; diff --git a/lily/include/staff-symbol-engraver.hh b/lily/include/staff-symbol-engraver.hh index 6c0d0730a2..9b537093bc 100644 --- a/lily/include/staff-symbol-engraver.hh +++ b/lily/include/staff-symbol-engraver.hh @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #ifndef STAFF_SYMBOL_ENGRAVER_HH @@ -25,7 +24,7 @@ protected: Spanner *span_; Spanner *finished_span_; bool first_start_; - + protected: virtual void start_spanner (); virtual void stop_spanner (); diff --git a/lily/include/stencil.hh b/lily/include/stencil.hh index 2be9a3d7bb..8e0d1bcf91 100644 --- a/lily/include/stencil.hh +++ b/lily/include/stencil.hh @@ -80,7 +80,7 @@ public: Interval extent (Axis) const; Box extent_box () const; bool is_empty () const; - Stencil in_color (Real r, Real g, Real b) const; + Stencil in_color (Real r, Real g, Real b) const; static SCM ly_get_stencil_extent (SCM mol, SCM axis); static SCM ly_set_stencil_extent_x (SCM, SCM, SCM); diff --git a/lily/include/system.hh b/lily/include/system.hh index e79f96cbe5..23b6ec3c04 100644 --- a/lily/include/system.hh +++ b/lily/include/system.hh @@ -21,7 +21,7 @@ class System : public Spanner { int rank_; Grob_array *all_elements_; - void init_elements (); + void init_elements (); public: int get_rank () const; void post_processing (); diff --git a/lily/include/timing-translator.hh b/lily/include/timing-translator.hh index bea4611a5c..d511ba1676 100644 --- a/lily/include/timing-translator.hh +++ b/lily/include/timing-translator.hh @@ -28,5 +28,4 @@ public: Rational measure_length () const; }; - #endif // TIMING_TRANSLATOR_HH diff --git a/lily/include/translator-dispatch-list.hh b/lily/include/translator-dispatch-list.hh index 9691dae857..914df8c167 100644 --- a/lily/include/translator-dispatch-list.hh +++ b/lily/include/translator-dispatch-list.hh @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #ifndef TRANSLATOR_DISPATCH_LIST_HH @@ -29,7 +28,7 @@ public: SCM static create (SCM trans_list, SCM iface_list); - DECLARE_SIMPLE_SMOBS(Engraver_dispatch_list,); + DECLARE_SIMPLE_SMOBS (Engraver_dispatch_list,); }; #endif /* TRANSLATOR_DISPATCH_LIST_HH */ diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index 225629c4c1..bf6e37168f 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -14,17 +14,17 @@ typedef void (Translator:: *Translator_method) (void); typedef void (Translator_group:: *Translator_group_method) (void); -typedef void (*Translator_group_void_method)(Translator_group*); +typedef void (*Translator_group_void_method) (Translator_group *); struct Translator_method_binding { Translator *translator_; Translator_void_method_ptr method_; - - Translator_method_binding() + + Translator_method_binding () { } - Translator_method_binding (Translator*tr, Translator_void_method_ptr ptr) + Translator_method_binding (Translator *tr, Translator_void_method_ptr ptr) { translator_ = tr; method_ = ptr; @@ -32,25 +32,24 @@ struct Translator_method_binding void invoke () { if (method_) - (*method_)(translator_); + (*method_) (translator_); } }; - class Translator_group { private: void precompute_method_bindings (); Array - precomputed_method_bindings_[TRANSLATOR_METHOD_PRECOMPUTE_COUNT]; + precomputed_method_bindings_[TRANSLATOR_METHOD_PRECOMPUTE_COUNT]; Translator_group_void_method - precomputed_self_method_bindings_[TRANSLATOR_METHOD_PRECOMPUTE_COUNT]; + precomputed_self_method_bindings_[TRANSLATOR_METHOD_PRECOMPUTE_COUNT]; public: VIRTUAL_COPY_CONSTRUCTOR (Translator_group, Translator_group); DECLARE_SMOBS (Translator_group, dummy); - + public: virtual Translator_group *get_daddy_translator ()const; virtual SCM get_simple_trans_list (); @@ -60,21 +59,20 @@ public: void stop_translation_timestep (); void start_translation_timestep (); - + virtual void fetch_precomputable_methods (Translator_group_void_method[]); - + Translator_group (); void precomputed_translator_foreach (Translator_precompute_index); void call_precomputed_self_method (Translator_precompute_index); - - Context * context () const { return context_; } + Context *context () const { return context_; } protected: SCM simple_trans_list_; SCM accept_hash_table_; Context *context_; - + friend class Context_def; virtual void derived_mark () const; }; @@ -85,7 +83,7 @@ void recurse_over_translators (Context *c, Translator_method ptr, void precomputed_recurse_over_translators (Context *c, Translator_precompute_index idx, Direction dir); Translator_group *get_translator_group (SCM sym); -#define ADD_TRANSLATOR_GROUP(classname, desc, grobs, accepted, read, write) \ +#define ADD_TRANSLATOR_GROUP(classname, desc, grobs, accepted, read, write) DECLARE_UNSMOB (Translator_group, translator_group); diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 754bfba73a..606ef9508d 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -22,29 +22,31 @@ struct Acknowledge_information Engraver_void_function_engraver_grob_info function_; }; -#define TRANSLATOR_DECLARATIONS(NAME) \ - public: \ - NAME (); \ - VIRTUAL_COPY_CONSTRUCTOR (Translator, NAME); \ - static SCM static_description_; \ - static Array acknowledge_static_array_; \ - virtual void fetch_precomputable_methods (Translator_void_method_ptr methods[]);\ - virtual SCM static_translator_description () const; \ - virtual SCM translator_description () const; \ - virtual Engraver_void_function_engraver_grob_info get_acknowledger (SCM sym) { \ - return static_get_acknowledger (sym);\ - }\ +#define TRANSLATOR_DECLARATIONS(NAME) \ + public: \ + NAME (); \ + VIRTUAL_COPY_CONSTRUCTOR (Translator, NAME); \ + static SCM static_description_; \ + static Array acknowledge_static_array_; \ + virtual void fetch_precomputable_methods (Translator_void_method_ptr methods[]); \ + virtual SCM static_translator_description () const; \ + virtual SCM translator_description () const; \ + virtual Engraver_void_function_engraver_grob_info get_acknowledger (SCM sym) \ + { \ + return static_get_acknowledger (sym); \ + } \ static Engraver_void_function_engraver_grob_info static_get_acknowledger (SCM sym); -#define DECLARE_ACKNOWLEDGER(x) public: void acknowledge_ ## x (Grob_info); protected: +#define DECLARE_ACKNOWLEDGER(x) public : void acknowledge_ ## x (Grob_info); protected: -enum Translator_precompute_index { - START_TRANSLATION_TIMESTEP, - STOP_TRANSLATION_TIMESTEP, - PROCESS_MUSIC, - PROCESS_ACKNOWLEDGED, - TRANSLATOR_METHOD_PRECOMPUTE_COUNT, -}; +enum Translator_precompute_index + { + START_TRANSLATION_TIMESTEP, + STOP_TRANSLATION_TIMESTEP, + PROCESS_MUSIC, + PROCESS_ACKNOWLEDGED, + TRANSLATOR_METHOD_PRECOMPUTE_COUNT, + }; /* Translate music into grobs. @@ -52,7 +54,7 @@ enum Translator_precompute_index { class Translator { void init (); - + protected: bool must_be_last_; @@ -68,7 +70,7 @@ public: virtual Output_def *get_output_def () const; virtual Translator_group *get_daddy_translator ()const; virtual Moment now_mom () const; - + virtual bool try_music (Music *req); virtual void initialize (); virtual void finalize (); @@ -77,7 +79,7 @@ public: void start_translation_timestep (); void process_music (); void process_acknowledged (); - + Score_context *get_score_context () const; Global_context *get_global_context () const; diff --git a/lily/include/translator.icc b/lily/include/translator.icc index 6450793380..462a287f55 100644 --- a/lily/include/translator.icc +++ b/lily/include/translator.icc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #ifndef TRANSLATOR_ICC @@ -30,15 +29,15 @@ } \ ADD_GLOBAL_CTOR (_ ## T ## _adder); -#define ADD_TRANSLATOR(classname, desc, grobs, accepted, read, write) \ - Array classname::acknowledge_static_array_;\ - IMPLEMENT_FETCH_PRECOMPUTABLE_METHODS(classname); \ +#define ADD_TRANSLATOR(classname, desc, grobs, accepted, read, write) \ + Array classname::acknowledge_static_array_; \ + IMPLEMENT_FETCH_PRECOMPUTABLE_METHODS (classname); \ ADD_THIS_TRANSLATOR (classname); \ - Engraver_void_function_engraver_grob_info\ + Engraver_void_function_engraver_grob_info \ classname::static_get_acknowledger (SCM sym) \ - {\ - return generic_get_acknowledger (sym, &acknowledge_static_array_);\ - }\ + { \ + return generic_get_acknowledger (sym, &acknowledge_static_array_); \ + } \ SCM \ classname::static_translator_description () const \ { \ @@ -64,31 +63,31 @@ return static_properties; \ } -#define IMPLEMENT_FETCH_PRECOMPUTABLE_METHODS(T) \ -void \ -T::fetch_precomputable_methods (Translator_void_method_ptr ptrs[])\ -{ \ - ptrs[START_TRANSLATION_TIMESTEP] = \ - ((Translator_void_method_ptr) &T::start_translation_timestep == \ - (Translator_void_method_ptr) &Translator::start_translation_timestep) \ - ? 0 \ - : (Translator_void_method_ptr) &T::start_translation_timestep; \ +#define IMPLEMENT_FETCH_PRECOMPUTABLE_METHODS(T) \ + void \ + T::fetch_precomputable_methods (Translator_void_method_ptr ptrs[]) \ + { \ + ptrs[START_TRANSLATION_TIMESTEP] = \ + ((Translator_void_method_ptr) & T::start_translation_timestep == \ + (Translator_void_method_ptr) & Translator::start_translation_timestep) \ + ? 0 \ + : (Translator_void_method_ptr) & T::start_translation_timestep; \ \ - ptrs[STOP_TRANSLATION_TIMESTEP] = \ - ((Translator_void_method_ptr) &T::stop_translation_timestep == (Translator_void_method_ptr) &Translator::stop_translation_timestep) \ - ? 0 \ - : (Translator_void_method_ptr) &T::stop_translation_timestep; \ + ptrs[STOP_TRANSLATION_TIMESTEP] = \ + ((Translator_void_method_ptr) & T::stop_translation_timestep == (Translator_void_method_ptr) & Translator::stop_translation_timestep) \ + ? 0 \ + : (Translator_void_method_ptr) & T::stop_translation_timestep; \ \ - ptrs[PROCESS_MUSIC] = \ - ((Translator_void_method_ptr) &T::process_music == (Translator_void_method_ptr) &Translator::process_music) \ - ? 0 \ - : (Translator_void_method_ptr) &T::process_music; \ + ptrs[PROCESS_MUSIC] = \ + ((Translator_void_method_ptr) & T::process_music == (Translator_void_method_ptr) & Translator::process_music) \ + ? 0 \ + : (Translator_void_method_ptr) & T::process_music; \ \ - ptrs[PROCESS_ACKNOWLEDGED] = \ - ((Translator_void_method_ptr) &T::process_acknowledged == (Translator_void_method_ptr) &Translator::process_acknowledged) \ - ? 0 \ - : (Translator_void_method_ptr) &T::process_acknowledged; \ -} + ptrs[PROCESS_ACKNOWLEDGED] = \ + ((Translator_void_method_ptr) & T::process_acknowledged == (Translator_void_method_ptr) & Translator::process_acknowledged) \ + ? 0 \ + : (Translator_void_method_ptr) & T::process_acknowledged; \ + } void add_acknowledger (Engraver_void_function_engraver_grob_info ptr, char const *func_name, @@ -98,13 +97,12 @@ Engraver_void_function_engraver_grob_info generic_get_acknowledger (SCM sym, Array const *ack_array); -#define ADD_ACKNOWLEDGER(CLASS,NAME) \ -void CLASS ## NAME ## _ack_adder () \ -{\ - add_acknowledger ((Engraver_void_function_engraver_grob_info) &CLASS::acknowledge_ ## NAME, #NAME, &CLASS::acknowledge_static_array_);\ -}\ - ADD_SCM_INIT_FUNC(CLASS ## NAME ## _ack_adder_initclass, CLASS ## NAME ## _ack_adder); \ - +#define ADD_ACKNOWLEDGER(CLASS, NAME) \ + void CLASS ## NAME ## _ack_adder () \ + { \ + add_acknowledger ((Engraver_void_function_engraver_grob_info) & CLASS::acknowledge_ ## NAME, #NAME, &CLASS::acknowledge_static_array_); \ + } \ + ADD_SCM_INIT_FUNC (CLASS ## NAME ## _ack_adder_initclass, CLASS ## NAME ## _ack_adder); diff --git a/lily/include/tuplet-bracket.hh b/lily/include/tuplet-bracket.hh index e00f8ebb2e..073311500c 100644 --- a/lily/include/tuplet-bracket.hh +++ b/lily/include/tuplet-bracket.hh @@ -19,7 +19,7 @@ public: static bool has_interface (Grob *); static void add_tuplet_bracket (Grob *me, Grob *smaller_bracket); - static void get_bounds (Grob *,Grob **,Grob **); + static void get_bounds (Grob *, Grob **, Grob **); static void add_column (Grob *me, Item *); static void add_beam (Grob *me, Grob *); static Grob *parallel_beam (Grob *me, Link_array const &cols, bool *equally_long); diff --git a/lily/input-scheme.cc b/lily/input-scheme.cc index 5bfed5c60d..f3b8c4e52f 100644 --- a/lily/input-scheme.cc +++ b/lily/input-scheme.cc @@ -40,7 +40,7 @@ LY_DEFINE (ly_input_file_line_column, "ly:input-file-line-char-column", 1, 0, 0, Input *ip = unsmob_input (sip); SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location"); - int l, ch, col; + int l, ch, col; ip->get_counts (&l, &ch, &col); return scm_list_4 (scm_makfrom0str (ip->file_string ().to_str0 ()), scm_from_int (l), diff --git a/lily/input.cc b/lily/input.cc index a9ad1c970e..d6d33e2247 100644 --- a/lily/input.cc +++ b/lily/input.cc @@ -152,7 +152,7 @@ Input::end_column_number () const } void -Input::get_counts (int *line, int *chr, int*col) const +Input::get_counts (int *line, int *chr, int *col) const { source_file_->get_counts (start_, line, chr, col); } @@ -162,23 +162,22 @@ Input::set (Source_file *sf, char const *start, char const *end) { source_file_ = sf; start_ = start; - end_ = end; + end_ = end; } -Source_file* +Source_file * Input::get_source_file () const { return source_file_; } - -char const * +char const * Input::start () const { return start_; } -char const * +char const * Input::end () const { return end_; diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index 68bd472b17..0e517678c6 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -20,7 +20,7 @@ class Instrument_name_engraver : public Engraver { - bool first_; + bool first_; public: TRANSLATOR_DECLARATIONS (Instrument_name_engraver); @@ -32,10 +32,9 @@ protected: DECLARE_ACKNOWLEDGER (bar_line); DECLARE_ACKNOWLEDGER (axis_group); - + void stop_translation_timestep (); void process_music (); - }; Instrument_name_engraver::Instrument_name_engraver () @@ -59,7 +58,7 @@ Instrument_name_engraver::stop_translation_timestep () grob_list_to_grob_array (get_property ("instrumentSupport"))); text_ = 0; } - + first_ = false; } @@ -92,7 +91,6 @@ Instrument_name_engraver::acknowledge_bar_line (Grob_info i) create_text (); } - void Instrument_name_engraver::acknowledge_axis_group (Grob_info i) { @@ -139,7 +137,6 @@ Instrument_name_engraver::process_music () #include "translator.icc" - ADD_ACKNOWLEDGER (Instrument_name_engraver, bar_line); ADD_ACKNOWLEDGER (Instrument_name_engraver, axis_group); ADD_TRANSLATOR (Instrument_name_engraver, diff --git a/lily/item.cc b/lily/item.cc index 7e36b762d9..a4e7ce9f40 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -152,7 +152,7 @@ Item::handle_prebroken_dependencies () SCM vis = get_property ("break-visibility"); if (scm_is_vector (vis)) { - bool visible = to_boolean (scm_vector_ref (vis, scm_from_int (break_status_dir () + 1))); + bool visible = to_boolean (scm_vector_ref (vis, scm_from_int (break_status_dir () + 1))); if (!visible) suicide (); diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 80727b141e..a5a6a7c289 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -88,10 +88,10 @@ Key_engraver::create_key (bool is_default) { *tail = scm_acons (scm_caar (s), scm_from_int (0), *tail); - tail = SCM_CDRLOC(*tail); + tail = SCM_CDRLOC (*tail); } } - + cancellation_->set_property ("alteration-alist", restore); cancellation_->set_property ("c0-position", get_property ("middleCPosition")); @@ -198,9 +198,8 @@ Key_engraver::initialize () context ()->set_property ("tonic", p.smobbed_copy ()); } - -ADD_ACKNOWLEDGER (Key_engraver,clef); -ADD_ACKNOWLEDGER (Key_engraver,bar_line); +ADD_ACKNOWLEDGER (Key_engraver, clef); +ADD_ACKNOWLEDGER (Key_engraver, bar_line); ADD_TRANSLATOR (Key_engraver, /* doc */ "", diff --git a/lily/key-performer.cc b/lily/key-performer.cc index d28c62fcc9..f9afd63b27 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -65,10 +65,10 @@ Key_performer::create_audio_elements () bool minor = (scm_is_pair (third) && scm_is_integer (scm_cdr (third)) && scm_to_int (scm_cdr (third)) == FLAT); - + audio_ = new Audio_key (scm_to_int (acc), !minor); - + Audio_element_info info (audio_, key_ev_); announce_element (info); key_ev_ = 0; @@ -92,7 +92,7 @@ Key_performer::try_music (Music *ev) { key_ev_ = ev; } - + return true; } diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index bcaa2594e7..62f3a82a7c 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -86,7 +86,7 @@ MAKE_SCHEME_CALLBACK (Key_signature_interface, print, 1); SCM Key_signature_interface::print (SCM smob) { - Item *me = dynamic_cast (unsmob_grob (smob)); + Item *me = dynamic_cast (unsmob_grob (smob)); Real inter = Staff_symbol_referencer::staff_space (me) / 2.0; @@ -133,18 +133,17 @@ Key_signature_interface::print (SCM smob) int pos = alteration_pos (what, alteration, c0p); acc.translate_axis (pos * inter, Y_AXIS); - - /* - The natural sign (unlike flat & sharp) - has vertical edges on both sides. A little padding is - needed to prevent collisions. - */ + /* + The natural sign (unlike flat & sharp) + has vertical edges on both sides. A little padding is + needed to prevent collisions. + */ Real padding = 0.0; if (alteration == 0 && last_pos < pos + 2 && last_pos > pos - 6) padding = 0.3; - + mol.add_at_edge (X_AXIS, LEFT, acc, padding, 0); last_pos = pos; } diff --git a/lily/ledger-line-engraver.cc b/lily/ledger-line-engraver.cc index 2f559a33da..7b08506f44 100644 --- a/lily/ledger-line-engraver.cc +++ b/lily/ledger-line-engraver.cc @@ -21,7 +21,7 @@ public: protected: virtual void finalize (); void process_music (); - + DECLARE_ACKNOWLEDGER (ledgered); DECLARE_ACKNOWLEDGER (staff_symbol); @@ -53,7 +53,7 @@ Ledger_line_engraver::process_music () void Ledger_line_engraver::finalize () { - stop_spanner(); + stop_spanner (); } void @@ -69,7 +69,7 @@ Ledger_line_engraver::stop_spanner () void Ledger_line_engraver::acknowledge_staff_symbol (Grob_info s) { - Spanner *sym = dynamic_cast (s.grob ()); + Spanner *sym = dynamic_cast (s.grob ()); if (!span_ || span_->get_bound (LEFT) != sym->get_bound (LEFT)) @@ -92,8 +92,8 @@ Ledger_line_engraver::acknowledge_ledgered (Grob_info s) #include "translator.icc" -ADD_ACKNOWLEDGER (Ledger_line_engraver,ledgered); -ADD_ACKNOWLEDGER (Ledger_line_engraver,staff_symbol); +ADD_ACKNOWLEDGER (Ledger_line_engraver, ledgered); +ADD_ACKNOWLEDGER (Ledger_line_engraver, staff_symbol); ADD_TRANSLATOR (Ledger_line_engraver, "Creates the spanner to draw ledger lines, and notices objects that need ledger lines", /* create */ "LedgerLineSpanner", diff --git a/lily/ledger-line-spanner.cc b/lily/ledger-line-spanner.cc index 85ff9e5d29..fe094e681f 100644 --- a/lily/ledger-line-spanner.cc +++ b/lily/ledger-line-spanner.cc @@ -135,7 +135,7 @@ Ledger_line_spanner::set_spacing_rods (SCM smob) contain a lot of noteheads, superlinear performance is too slow. */ extract_item_set (me, "note-heads", heads); - for (int i = heads.size(); i --; ) + for (int i = heads.size (); i--;) { Item *h = heads[i]; @@ -258,9 +258,7 @@ Ledger_line_spanner::print (SCM smob) i != reqs.end (); last = i++) { if (last == reqs.end ()) - { - continue; - } + continue; Direction d = DOWN; do @@ -343,11 +341,11 @@ Ledger_line_spanner::print (SCM smob) ADD_INTERFACE (Ledger_line_spanner, "ledger-line-interface", - + "This spanner draws the ledger lines of a staff.\n" "This is a separate grob because it has to process\n" "all potential collisions between all note heads.", - + "note-heads thickness minimum-length-fraction length-fraction gap"); struct Ledgered_interface @@ -357,8 +355,8 @@ struct Ledgered_interface ADD_INTERFACE (Ledgered_interface, "ledgered-interface", - + "Objects that need ledger lines, typically " "note heads. See also @ref{ledger-line-interface}.", - + "no-ledgers"); diff --git a/lily/ligature-engraver.cc b/lily/ligature-engraver.cc index e13798034b..0d53cbb3b7 100644 --- a/lily/ligature-engraver.cc +++ b/lily/ligature-engraver.cc @@ -151,9 +151,7 @@ Ligature_engraver::process_music () events_drul_[STOP]->origin ()->warning (_ ("no right bound")); } else - { - ligature_->set_bound (RIGHT, last_bound_); - } + ligature_->set_bound (RIGHT, last_bound_); prev_start_event_ = 0; finished_primitives_ = primitives_; @@ -193,9 +191,7 @@ Ligature_engraver::process_music () events_drul_[START]->origin ()->warning (_ ("no left bound")); } else - { - ligature_->set_bound (LEFT, bound); - } + ligature_->set_bound (LEFT, bound); ligature_start_mom_ = now_mom (); diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index c147945d07..d223d59612 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -330,7 +330,6 @@ ly_deep_copy (SCM src) } - /* looks the key up in the cdrs of the alist-keys - ignoring the car and ignoring non-pair keys. Returns first match found, i.e. @@ -369,7 +368,7 @@ ly_string_array_to_scm (Array a) s = scm_cons (ly_symbol2scm (a[i].to_str0 ()), s); return s; } - + /* SYMBOLS is a whitespace separated list. */ SCM parse_symbol_list (char const *symbols) diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index b1661c86eb..8a331e263a 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -109,7 +109,7 @@ Lily_lexer::Lily_lexer (Lily_lexer const &src) pitchname_tab_stack_ = src.pitchname_tab_stack_; sources_ = src.sources_; start_module_ = SCM_EOL; - + error_level_ = src.error_level_; is_main_input_ = src.is_main_input_; @@ -142,7 +142,7 @@ Lily_lexer::add_scope (SCM module) ly_reexport_module (scm_current_module ()); if (!scm_is_pair (scopes_)) start_module_ = scm_current_module (); - + for (SCM s = scopes_; scm_is_pair (s); s = scm_cdr (s)) { ly_use_module (module, scm_car (s)); @@ -152,7 +152,6 @@ Lily_lexer::add_scope (SCM module) set_current_scope (); } - SCM Lily_lexer::remove_scope () { @@ -166,7 +165,7 @@ SCM Lily_lexer::set_current_scope () { SCM old = scm_current_module (); - + if (scm_is_pair (scopes_)) scm_set_current_module (scm_car (scopes_)); else @@ -286,7 +285,7 @@ Lily_lexer::prepare_for_next_token () void Lily_lexer::add_lexed_char (int count) { - char const * start = here_str0 (); + char const *start = here_str0 (); lexloc->set (get_source_file (), start, start + count); char_count_stack_.top () += count; diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index b25888d689..ab5de83410 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -74,11 +74,10 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", message (_f ("Changing working directory to `%s'", output_name_global.to_str0 ())); chdir (output_name_global.to_str0 ()); - } output_name_global = ""; } - else + else out_file_name = File_name (output_name_global); } @@ -217,7 +216,6 @@ LY_DEFINE (ly_parser_set_note_names, "ly:parser-set-note-names", return SCM_UNSPECIFIED; } - LY_DEFINE (ly_parser_output_name, "ly:parser-output-name", 1, 0, 0, (SCM parser), "Return the base name of the output file.") diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 0119f99398..cc9fce2f56 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -116,14 +116,13 @@ Lily_parser::parse_file (String init, String name, String out_name) /* Don't mix cyclic pointers with weak tables. - */ + */ lexer_->set_identifier (ly_symbol2scm ("parser"), SCM_EOL); ly_reexport_module (scm_current_module ()); - - scm_set_current_module (mod); - + scm_set_current_module (mod); + if (!define_spots_.is_empty ()) { define_spots_.top ().warning (_ ("braces don't match")); @@ -137,10 +136,10 @@ Lily_parser::parse_file (String init, String name, String out_name) void Lily_parser::parse_string (String ly_code) { - // TODO: use $parser + // TODO: use $parser lexer_->set_identifier (ly_symbol2scm ("parser"), self_scm ()); - + lexer_->main_input_name_ = ""; lexer_->is_main_input_ = true; @@ -150,7 +149,7 @@ Lily_parser::parse_string (String ly_code) SCM mod = lexer_->set_current_scope (); do_yyparse (); scm_set_current_module (mod); - + if (!define_spots_.is_empty ()) { if (define_spots_.is_empty () @@ -216,9 +215,9 @@ get_paper (Lily_parser *parser) } SCM -get_header(Lily_parser *parser) +get_header (Lily_parser *parser) { - SCM id = parser->lexer_->lookup_identifier("$defaultheader"); + SCM id = parser->lexer_->lookup_identifier ("$defaultheader"); if (!ly_is_module (id)) id = ly_make_anonymous_module (be_safe_global); diff --git a/lily/line-interface.cc b/lily/line-interface.cc index 81019e210e..fab325528f 100644 --- a/lily/line-interface.cc +++ b/lily/line-interface.cc @@ -19,14 +19,14 @@ Line_interface::make_arrow (Offset begin, Offset end, { Real angle = (end - begin).arg (); Array points; - + points.push (Offset (0, 0)); points.push (Offset (-length, width)); points.push (Offset (-length, -width)); - for (int i = 0; i < points.size(); i++) + for (int i = 0; i < points.size (); i++) points[i] = points[i] * complex_exp (Offset (0, angle)) + end; - + return Lookup::round_filled_polygon (points, thick); } @@ -89,21 +89,20 @@ Line_interface::arrows (Grob *me, Offset from, Offset to, { Real thick = Staff_symbol_referencer::line_thickness (me) * robust_scm2double (me->get_property ("thickness"), 1); - Real ss = Staff_symbol_referencer::staff_space (me); - + Real ss = Staff_symbol_referencer::staff_space (me); + Real len = robust_scm2double (me->get_property ("arrow-length"), 1.3 * ss); Real wid = robust_scm2double (me->get_property ("arrow-width"), 0.5 * ss); if (to_arrow) - a.add_stencil (make_arrow (from, to, thick, len, wid)); - + a.add_stencil (make_arrow (from, to, thick, len, wid)); + if (from_arrow) - a.add_stencil (make_arrow (to, from, thick, len, wid)); + a.add_stencil (make_arrow (to, from, thick, len, wid)); } return a; } - Stencil Line_interface::line (Grob *me, Offset from, Offset to) @@ -114,7 +113,7 @@ Line_interface::line (Grob *me, Offset from, Offset to) SCM type = me->get_property ("style"); Stencil stil; - + SCM dash_fraction = me->get_property ("dash-fraction"); if (scm_is_number (dash_fraction) || type == ly_symbol2scm ("dotted-line")) { @@ -131,10 +130,10 @@ Line_interface::line (Grob *me, Offset from, Offset to) if (period < 0) return Stencil (); - stil = make_dashed_line (thick, from, to, period, fraction); + stil = make_dashed_line (thick, from, to, period, fraction); } else - stil = make_line (thick, from, to); + stil = make_line (thick, from, to); return stil; } diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index d5896ede00..96841816a5 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -33,7 +33,7 @@ zigzag_stencil (Grob *me, Real staff_space = Staff_symbol_referencer::staff_space (me); Real w = robust_scm2double (me->get_property ("zigzag-width"), 1) * staff_space; - int count = (int) ceil (dz.length() / w); + int count = (int) ceil (dz.length () / w); w = dz.length () / count; Real l = robust_scm2double (me->get_property ("zigzag-length"), 1) * w; @@ -42,14 +42,14 @@ zigzag_stencil (Grob *me, Offset rotation_factor = complex_exp (Offset (0, dz.arg ())); Offset points[3]; - points[0] = Offset (0, -h/2); - points[1] = Offset (w/2, h/2); - points[2] = Offset (w, -h/2); + points[0] = Offset (0, -h / 2); + points[1] = Offset (w / 2, h / 2); + points[2] = Offset (w, -h / 2); for (int i = 0; i < 3; i++) points[i] = complex_multiply (points[i], rotation_factor); - - Stencil squiggle (Line_interface::make_line (thick,points[0], points[1])); - squiggle.add_stencil (Line_interface::make_line (thick,points[1], points[2])); + + Stencil squiggle (Line_interface::make_line (thick, points[0], points[1])); + squiggle.add_stencil (Line_interface::make_line (thick, points[1], points[2])); Stencil total; for (int i = 0; i < count; i++) @@ -110,7 +110,7 @@ Line_spanner::line_stencil (Grob *me, SCM type = me->get_property ("style"); Stencil line; - + if (scm_is_symbol (type) && (type == ly_symbol2scm ("line") || type == ly_symbol2scm ("dashed-line") @@ -156,7 +156,7 @@ Line_spanner::line_stencil (Grob *me, if (to_boolean (me->get_property ("arrow"))) line.add_stencil (Line_interface::arrows (me, from, to, false, true)); - + return line; } diff --git a/lily/lookup.cc b/lily/lookup.cc index 10dee7ad44..14efd34fe5 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -44,49 +44,46 @@ Lookup::beam (Real slope, Real width, Real thick, Real blot) Offset p; - p = Offset (0, thick/2); + p = Offset (0, thick / 2); b.add_point (p); - p += Offset (1,-1) * (blot/2); + p += Offset (1, -1) * (blot / 2); SCM points = SCM_EOL; - + points = scm_cons (scm_from_double (p[X_AXIS]), scm_cons (scm_from_double (p[Y_AXIS]), points)); - - - p = Offset (0, -thick/2); + + p = Offset (0, -thick / 2); b.add_point (p); - p += Offset (1,1) * (blot/2); + p += Offset (1, 1) * (blot / 2); points = scm_cons (scm_from_double (p[X_AXIS]), scm_cons (scm_from_double (p[Y_AXIS]), points)); - - - p = Offset (width, width * slope - thick/2); + + p = Offset (width, width * slope - thick / 2); b.add_point (p); - p += Offset (-1, 1) * (blot/2); + p += Offset (-1, 1) * (blot / 2); points = scm_cons (scm_from_double (p[X_AXIS]), scm_cons (scm_from_double (p[Y_AXIS]), points)); - - - p = Offset (width, width * slope + thick/2); + + p = Offset (width, width * slope + thick / 2); b.add_point (p); - p += Offset (-1, -1) * (blot/2); + p += Offset (-1, -1) * (blot / 2); points = scm_cons (scm_from_double (p[X_AXIS]), scm_cons (scm_from_double (p[Y_AXIS]), points)); - + SCM expr = scm_list_n (ly_symbol2scm ("polygon"), ly_quote_scm (points), scm_from_double (blot), SCM_BOOL_T, SCM_UNDEFINED); - + return Stencil (b, expr); } @@ -254,7 +251,7 @@ Lookup::round_filled_polygon (Array const &points, programming_error ("Polygon should not have duplicate points"); } #endif - + /* special cases: degenerated polygons */ if (points.size () == 0) return Stencil (); @@ -659,17 +656,16 @@ Stencil Lookup::repeat_slash (Real w, Real s, Real t) { #if 0 /* TODO */ - Array points ; + Array points; Real blotdiameter = 0.0; - Offset p1(0, 0); - Offset p2(w, w*s); - - - + Offset p1 (0, 0); + Offset p2 (w, w * s); + + return Lookup::round_filled_polygon (points, blotdiameter); #endif - + SCM wid = scm_from_double (w); SCM sl = scm_from_double (s); SCM thick = scm_from_double (t); diff --git a/lily/ly-module.cc b/lily/ly-module.cc index b2d04f4185..87ac798788 100644 --- a/lily/ly-module.cc +++ b/lily/ly-module.cc @@ -16,7 +16,6 @@ Protected_scm anonymous_modules = SCM_EOL; #endif - void clear_anonymous_modules () { @@ -25,8 +24,8 @@ clear_anonymous_modules () s = scm_cdr (s)) { SCM module = scm_car (s); - SCM closure = SCM_MODULE_EVAL_CLOSURE(module); - SCM prop = scm_procedure_property (closure, ly_symbol2scm ("module")); + SCM closure = SCM_MODULE_EVAL_CLOSURE (module); + SCM prop = scm_procedure_property (closure, ly_symbol2scm ("module")); if (ly_is_module (prop)) { @@ -47,11 +46,11 @@ ly_make_anonymous_module (bool safe) SCM maker = ly_lily_module_constant ("make-module"); SCM scm_module = ly_lily_module_constant ("the-scm-module"); - + mod = scm_call_0 (maker); scm_module_define (mod, ly_symbol2scm ("%module-public-interface"), mod); - + ly_use_module (mod, scm_module); ly_use_module (mod, global_lily_module); } @@ -64,7 +63,7 @@ ly_make_anonymous_module (bool safe) #ifdef MODULE_GC_KLUDGE anonymous_modules = scm_cons (mod, anonymous_modules); #endif - + return mod; } @@ -83,7 +82,6 @@ ly_use_module (SCM mod, SCM used) #define FUNC_NAME __FUNCTION__ - static SCM accumulate_symbol (void *closure, SCM key, SCM val, SCM result) { @@ -139,7 +137,6 @@ ly_reexport_module (SCM mod) } - #ifdef MODULE_GC_KLUDGE static SCM redefine_keyval (void *closure, SCM key, SCM val, SCM result) @@ -153,14 +150,14 @@ redefine_keyval (void *closure, SCM key, SCM val, SCM result) /* UGH UGH. Kludge for older GUILE 1.6 versions. - */ +*/ void make_stand_in_procs_weak () { SCM old_tab = scm_stand_in_procs; SCM new_tab = scm_make_weak_key_hash_table (scm_from_int (257)); - - new_tab = scm_internal_hash_fold ((Hash_closure_function) &redefine_keyval, + + new_tab = scm_internal_hash_fold ((Hash_closure_function) & redefine_keyval, NULL, new_tab, old_tab); @@ -168,5 +165,5 @@ make_stand_in_procs_weak () scm_stand_in_procs = new_tab; } -ADD_SCM_INIT_FUNC(make_stand_in_procs_weak, make_stand_in_procs_weak); +ADD_SCM_INIT_FUNC (make_stand_in_procs_weak, make_stand_in_procs_weak); #endif diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index b244fe9583..4c76e189cd 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -33,7 +33,7 @@ private: Music *event_; Item *text_; Item *last_text_; - + Context *get_voice_context (); }; @@ -61,7 +61,7 @@ Lyric_engraver::process_music () if (event_) { SCM text = event_->get_property ("text"); - + if (ly_is_equal (text, scm_makfrom0str (" "))) { if (last_text_) @@ -150,7 +150,7 @@ Lyric_engraver::stop_translation_timestep () text_->set_property ("self-alignment-X", scm_from_int (LEFT)); } } - + last_text_ = text_; text_ = 0; } diff --git a/lily/lyric-performer.cc b/lily/lyric-performer.cc index e41eb6082e..dd083391f0 100644 --- a/lily/lyric-performer.cc +++ b/lily/lyric-performer.cc @@ -71,4 +71,4 @@ Lyric_performer::try_music (Music *event) #include "translator.icc" ADD_TRANSLATOR (Lyric_performer, "", "", "lyric-event", - "", ""); + "", ""); diff --git a/lily/main.cc b/lily/main.cc index 119a2c4161..d2f3a66436 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -5,7 +5,7 @@ (c) 1997--2005 Han-Wen Nienhuys */ - + #include "main.hh" #include @@ -20,10 +20,10 @@ #if HAVE_GRP_H #include -#endif +#endif #if HAVE_PWD_H #include -#endif +#endif #if HAVE_GETTEXT #include #endif @@ -161,7 +161,7 @@ static Long_option_init options_static[] #if HAVE_CHROOT {_i ("USER,GROUP,JAIL,DIR"), "jail", 'j', _i ("chroot to JAIL, become USER:GROUP\n" "and cd into DIR")}, -#endif +#endif {0, "no-print", 0, _i ("do not generate printed output")}, {0, "preview", 'p', _i ("generate a preview of the first system")}, {0, "safe-mode", 's', _i ("run in safe mode")}, @@ -174,7 +174,7 @@ static Long_option_init options_static[] #define LILYPOND_DATADIR PACKAGE_DATADIR "/" TOPLEVEL_VERSION static void -env_var_info (FILE *out, char const* key) +env_var_info (FILE *out, char const *key) { if (char const *value = getenv (key)) fprintf (out, "%s=\"%s\"\n", key, value); @@ -198,7 +198,7 @@ dir_info (FILE *out) env_var_info (out, "GUILE_LOAD_PATH"); env_var_info (out, "PANGO_RC_FILE"); env_var_info (out, "PATH"); -#endif +#endif } static void @@ -260,7 +260,7 @@ warranty () } static int -sane_putenv (char const* key, String value, bool overwrite = true) +sane_putenv (char const *key, String value, bool overwrite = true) { if (overwrite || !getenv (key)) { @@ -273,7 +273,7 @@ sane_putenv (char const* key, String value, bool overwrite = true) #if ARGV0_RELOCATION static int -set_env_file (char const* key, String value) +set_env_file (char const *key, String value) { if (is_file (value)) return sane_putenv (key, value, false); @@ -287,7 +287,7 @@ prepend_env_path (char const *key, String value) { if (is_dir (value)) { - if (char const* cur = getenv (key)) + if (char const *cur = getenv (key)) value += to_string (PATHSEP) + cur; return sane_putenv (key, value.to_str0 ()); } @@ -393,7 +393,7 @@ setup_paths (char const* argv0) /* ugh. C&P font-config.cc */ - struct stat statbuf; + struct stat statbuf; String builddir = prefix_directory + "/mf/out/"; if (stat (builddir.to_str0 (), &statbuf) == 0) { @@ -409,9 +409,9 @@ setup_paths (char const* argv0) } for (int i = 0; i < dirs.size (); i++) - global_path.prepend (dirs[i]); + global_path.prepend (dirs[i]); } - + static void prepend_load_path (String dir) { @@ -508,7 +508,6 @@ do_chroot_jail () #endif - static void main_with_guile (void *, int, char **) { @@ -529,7 +528,6 @@ main_with_guile (void *, int, char **) call_constructors (); ly_set_option (ly_symbol2scm ("verbose"), scm_from_bool (be_verbose_global)); - init_global_tweak_registry (); init_fontconfig (); @@ -537,13 +535,12 @@ main_with_guile (void *, int, char **) all_fonts_global = new All_font_metrics (global_path.to_string ()); - if (!init_scheme_variables.is_empty () || !init_scheme_code_string.is_empty ()) { init_scheme_variables = "(map (lambda (x) (ly:set-option (car x) (cdr x))) (list " + init_scheme_variables + "))"; - + init_scheme_code_string += "(begin #t " + init_scheme_variables @@ -551,13 +548,12 @@ main_with_guile (void *, int, char **) + ")"; char const *str0 = init_scheme_code_string.to_str0 (); - + if (be_verbose_global) - progress_indication (_f("Evaluating %s", str0)); + progress_indication (_f ("Evaluating %s", str0)); scm_c_eval_string ((char *) str0); } - /* We accept multiple independent music files on the command line to reduce compile time when processing lots of small files. Starting the GUILE engine is very time consuming. */ @@ -598,7 +594,7 @@ setup_localisation () String localedir = LOCALEDIR; if (char const *env = getenv ("LILYPOND_LOCALEDIR")) localedir = env; - + bindtextdomain ("lilypond", localedir.to_str0 ()); textdomain ("lilypond"); #endif @@ -641,7 +637,7 @@ parse_argv (int argc, char **argv) String key = arg; String val = "#t"; - + if (eq >= 0) { key = arg.left_string (eq); @@ -649,10 +645,10 @@ parse_argv (int argc, char **argv) } init_scheme_variables - += "(cons \'" + key + " " + val + ")\n"; + += "(cons \'" + key + " " + val + ")\n"; } break; - + case 'v': notice (); exit (0); @@ -715,7 +711,7 @@ parse_argv (int argc, char **argv) if (output_format_global == "") output_format_global = "pdf"; - + if (show_help) { identify (stdout); @@ -729,20 +725,19 @@ parse_argv (int argc, char **argv) void setup_guile_env () { - char * yield = getenv ("LILYPOND_GC_YIELD"); + char *yield = getenv ("LILYPOND_GC_YIELD"); bool overwrite = true; if (!yield) { yield = "70"; overwrite = false; } - + sane_putenv ("GUILE_MIN_YIELD_1", yield, overwrite); sane_putenv ("GUILE_MIN_YIELD_2", yield, overwrite); sane_putenv ("GUILE_MIN_YIELD_MALLOC", yield, overwrite); } - int main (int argc, char **argv) { diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index 5e24855826..a770cf2001 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -132,7 +132,7 @@ Mark_engraver::process_music () #include "translator.icc" -ADD_ACKNOWLEDGER (Mark_engraver,bar_line); +ADD_ACKNOWLEDGER (Mark_engraver, bar_line); ADD_TRANSLATOR (Mark_engraver, /* doc */ "This engraver will create RehearsalMark objects. " "It puts them on top of all staves (which is taken from " diff --git a/lily/melisma-translator.cc b/lily/melisma-translator.cc index b79207b157..fbe0aa3bef 100644 --- a/lily/melisma-translator.cc +++ b/lily/melisma-translator.cc @@ -66,7 +66,6 @@ Melisma_translator::Melisma_translator () event_ = 0; } - ADD_TRANSLATOR (Melisma_translator, /* doc */ "This translator collects melisma information about ties, beams, and user settings (@code{melismaBusy}, and signals it to the @code{\addlyrics} code. ", /* create */ "", diff --git a/lily/mensural-ligature-engraver.cc b/lily/mensural-ligature-engraver.cc index 310899384f..837a3748a4 100644 --- a/lily/mensural-ligature-engraver.cc +++ b/lily/mensural-ligature-engraver.cc @@ -357,16 +357,12 @@ Mensural_ligature_engraver::fold_up_primitives (Array primitives) { Item *current = dynamic_cast (primitives[i].grob ()); if (i == 0) - { - first = current; - } + first = current; get_set_column (current, first->get_column ()); if (i > 0) - { - current->translate_axis (distance, X_AXIS); - } + current->translate_axis (distance, X_AXIS); distance += scm_to_double (current->get_property ("head-width")) diff --git a/lily/midi-stream.cc b/lily/midi-stream.cc index 99010d32de..af634bf2c0 100644 --- a/lily/midi-stream.cc +++ b/lily/midi-stream.cc @@ -6,7 +6,6 @@ (c) 1997--2005 Jan Nieuwenhuizen */ - #include "midi-stream.hh" #include diff --git a/lily/module-scheme.cc b/lily/module-scheme.cc index 46e846e14b..ea50e4e7d1 100644 --- a/lily/module-scheme.cc +++ b/lily/module-scheme.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "lily-guile.hh" @@ -41,20 +40,18 @@ LY_DEFINE (ly_module_copy, "ly:module-copy", return SCM_UNSPECIFIED; } -LY_DEFINE(ly_clear_anonymous_modules, "ly:clear-anonymous-modules", - 0, 0, 0, (), - "Plug a GUILE 1.6 and 1.7 memory leak by breaking a weak reference " - "pointer cycle explicitly." - ) +LY_DEFINE (ly_clear_anonymous_modules, "ly:clear-anonymous-modules", + 0, 0, 0, (), + "Plug a GUILE 1.6 and 1.7 memory leak by breaking a weak reference " + "pointer cycle explicitly.") { #ifdef MODULE_GC_KLUDGE - clear_anonymous_modules(); + clear_anonymous_modules (); #endif return SCM_UNSPECIFIED; } - /* Lookup SYM, but don't give error when it is not defined. */ SCM ly_module_lookup (SCM module, SCM sym) diff --git a/lily/moment-scheme.cc b/lily/moment-scheme.cc index cdedb19829..0f46793385 100644 --- a/lily/moment-scheme.cc +++ b/lily/moment-scheme.cc @@ -42,7 +42,6 @@ LY_DEFINE (ly_make_moment, "ly:make-moment", Rational (grace_num, grace_den)).smobbed_copy (); } - LY_DEFINE (ly_sub_moment, "ly:moment-sub", 2, 0, 0, (SCM a, SCM b), "Subtract two moments.") @@ -98,7 +97,6 @@ LY_DEFINE (ly_moment_mod, "ly:moment-mod", return (*ma % * mb).smobbed_copy (); } - LY_DEFINE (ly_moment_grace_numerator, "ly:moment-grace-numerator", 1, 0, 0, (SCM mom), "Extract numerator from grace timing.") diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index 5977fb33da..ec69a437d3 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -49,7 +49,7 @@ Multi_measure_rest_engraver::Multi_measure_rest_engraver () /* For the start of a score. - */ + */ bar_seen_ = true; start_measure_ = 0; mmrest_ = 0; @@ -249,7 +249,7 @@ Multi_measure_rest_engraver::finalize () #include "translator.icc" ADD_TRANSLATOR (Multi_measure_rest_engraver, - /* doc */ + /* doc */ "Engraves multi-measure rests that are produced with @code{R}. Reads " "measurePosition and currentBarNumber to determine what number to print " "over the MultiMeasureRest. Reads measureLength to determine if it " diff --git a/lily/music-output.cc b/lily/music-output.cc index c41d59e3a9..21e86e4c6c 100644 --- a/lily/music-output.cc +++ b/lily/music-output.cc @@ -1,13 +1,12 @@ -/* +/* music-output.cc -- implement Music_output - + source file of the GNU LilyPond music typesetter - + (c) 2005 Han-Wen Nienhuys - */ -#include "music-output.hh" +#include "music-output.hh" #include "ly-smobs.icc" #include "virtual-methods.hh" @@ -24,9 +23,8 @@ Music_output::process () Music_output::~Music_output () { - } - + void Music_output::derived_mark () const { diff --git a/lily/music-scheme.cc b/lily/music-scheme.cc index 417b3819be..114f42e645 100644 --- a/lily/music-scheme.cc +++ b/lily/music-scheme.cc @@ -110,7 +110,7 @@ LY_DEFINE (ly_music_deep_copy, "ly:music-deep-copy", SCM copy = m; if (unsmob_music (m)) { - Music * mcopy = unsmob_music (m)->clone (); + Music *mcopy = unsmob_music (m)->clone (); copy = mcopy->unprotect (); } else if (scm_is_pair (m)) diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index 86bddb5ece..33cd06ca5f 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -29,9 +29,7 @@ Music_sequence::cumulative_length (SCM l) { Moment l = unsmob_music (scm_car (s))->get_length (); if (last_len.grace_part_ && l.main_part_) - { - last_len.grace_part_ = Rational (0); - } + last_len.grace_part_ = Rational (0); cumulative += last_len; last_len = l; } diff --git a/lily/music-wrapper.cc b/lily/music-wrapper.cc index 8123897171..d66d9085f9 100644 --- a/lily/music-wrapper.cc +++ b/lily/music-wrapper.cc @@ -10,7 +10,6 @@ #include "music.hh" - MAKE_SCHEME_CALLBACK (Music_wrapper, start_callback, 1); SCM Music_wrapper::start_callback (SCM m) diff --git a/lily/music.cc b/lily/music.cc index 5ce63556ba..e8e054311d 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -57,7 +57,7 @@ Music::Music (SCM init) { length_callback_ = duration_length_callback_proc; } - + start_callback_ = get_property ("start-callback"); } @@ -81,7 +81,6 @@ Music::~Music () { } - SCM Music::get_property_alist (bool m) const { @@ -277,7 +276,6 @@ Music::internal_get_property (SCM sym) const return (s == SCM_BOOL_F) ? SCM_EOL : scm_cdr (s); } - SCM Music::internal_get_object (SCM s) const { @@ -287,7 +285,7 @@ Music::internal_get_object (SCM s) const void Music::internal_set_object (SCM s, SCM v) { - return internal_set_property (s,v); + return internal_set_property (s, v); } void @@ -325,7 +323,6 @@ make_music_by_name (SCM sym) return m; } - MAKE_SCHEME_CALLBACK (Music, duration_length_callback, 1); SCM Music::duration_length_callback (SCM m) diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc index c53695f2cb..5cde4e519a 100644 --- a/lily/new-fingering-engraver.cc +++ b/lily/new-fingering-engraver.cc @@ -44,7 +44,7 @@ class New_fingering_engraver : public Engraver Array fingerings_; Array articulations_; Array string_numbers_; - + Link_array heads_; Grob *stem_; @@ -77,21 +77,15 @@ New_fingering_engraver::acknowledge_rhythmic_head (Grob_info inf) continue; if (m->is_mus_type ("fingering-event")) - { - add_fingering (inf.grob (), m, note_ev); - } + add_fingering (inf.grob (), m, note_ev); else if (m->is_mus_type ("text-script-event")) { m->origin ()->warning (_ ("can't add text scripts to individual note heads")); } else if (m->is_mus_type ("script-event")) - { - add_script (inf.grob (), m, note_ev); - } + add_script (inf.grob (), m, note_ev); else if (m->is_mus_type ("string-number-event")) - { - add_string (inf.grob (), m, note_ev); - } + add_string (inf.grob (), m, note_ev); else if (m->is_mus_type ("harmonic-event")) { inf.grob ()->set_property ("style", ly_symbol2scm ("harmonic")); @@ -169,7 +163,6 @@ New_fingering_engraver::add_fingering (Grob *head, fingerings_.push (ft); } - void New_fingering_engraver::add_string (Grob *head, Music *event, diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 8dab14f3da..2e2c167e5d 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -73,7 +73,7 @@ check_meshing_chords (Grob *me, /* Do not merge notes typeset in different style. */ if (!ly_is_equal (nu->get_property ("style"), - nd->get_property ("style"))) + nd->get_property ("style"))) merge_possible = false; int upball_type = Note_head::get_balltype (nu); @@ -211,9 +211,7 @@ check_meshing_chords (Grob *me, wipe_ball = nu; } else - { - dot_wipe_head = nu; - } + dot_wipe_head = nu; } else if (dnball_type > upball_type) { @@ -342,8 +340,8 @@ Note_collision_interface::do_shifts (Grob *me) } } -Drul_array < Link_array > -Note_collision_interface::get_clash_groups (Grob *me) +Drul_array < Link_array +> Note_collision_interface::get_clash_groups (Grob *me) { Drul_array > clash_groups; @@ -470,7 +468,7 @@ Note_collision_interface::forced_shift (Grob *me) SCM tups = SCM_EOL; extract_grob_set (me, "elements", elements); - for (int i = 0; i < elements.size (); i++) + for (int i = 0; i < elements.size (); i++) { Grob *se = elements[i]; diff --git a/lily/note-column.cc b/lily/note-column.cc index 94e01ff5e9..1729e6b432 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -57,7 +57,7 @@ Note_column::head_positions_interval (Grob *me) iv.set_empty (); extract_grob_set (me, "note-heads", heads); - for (int i = 0; i < heads.size(); i++) + for (int i = 0; i < heads.size (); i++) { Grob *se = heads[i]; @@ -79,7 +79,7 @@ Note_column::dir (Grob *me) if (heads.size ()) return (Direction)sign (head_positions_interval (me).center ()); } - + programming_error ("note column without heads and stem"); return CENTER; } @@ -160,7 +160,7 @@ Note_column::accidentals (Grob *me) { extract_grob_set (me, "note-heads", heads); Grob *acc = 0; - for (int i = 0; i < heads.size(); i++) + for (int i = 0; i < heads.size (); i++) { Grob *h = heads[i]; acc = h ? unsmob_grob (h->get_object ("accidental-grob")) : 0; @@ -178,7 +178,6 @@ Note_column::accidentals (Grob *me) return acc; } - Grob * Note_column::arpeggio (Grob *me) { diff --git a/lily/note-head.cc b/lily/note-head.cc index bd31553a3e..98b58a6f91 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -12,7 +12,7 @@ #include #include // min, max -using namespace std; +using namespace std; #include "directional-element-interface.hh" #include "staff-symbol.hh" @@ -39,13 +39,13 @@ internal_print (Grob *me, String *font_char) } SCM log = scm_from_int (Note_head::get_balltype (me)); - String suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2)); + String suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2)); if (style != ly_symbol2scm ("default")) { SCM proc = me->get_property ("glyph-name-procedure"); if (ly_is_procedure (proc)) suffix = ly_scm2string (scm_call_2 (proc, log, style)); - } + } Font_metric *fm = Font_interface::get_default_font (me); String idx = "noteheads.s" + suffix; @@ -56,7 +56,7 @@ internal_print (Grob *me, String *font_char) String prefix = "noteheads."; Grob *stem = unsmob_grob (me->get_object ("stem")); Direction stem_dir = stem ? get_grob_direction (stem) : CENTER; - + if (stem_dir == CENTER) programming_error ("must have stem dir for note head"); String idx = prefix + ((stem_dir == UP) ? "u" : "d") + suffix; @@ -66,7 +66,7 @@ internal_print (Grob *me, String *font_char) if (out.is_empty ()) { me->warning (_f ("note head `%s' not found", idx.to_str0 ())); - out = Stencil (Box(Interval (0, 0),Interval (0, 0)), SCM_EOL); + out = Stencil (Box (Interval (0, 0), Interval (0, 0)), SCM_EOL); } else { diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index c9cfffafc8..1e16c1414c 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -84,7 +84,7 @@ Note_heads_engraver::process_music () ev->origin ()->warning (_ ("NoteEvent without pitch")); } #endif - + int pos = pit ? pit->steps () : 0; SCM c0 = get_property ("middleCPosition"); if (scm_is_number (c0)) @@ -108,9 +108,7 @@ Note_heads_engraver::process_music () SCM style = SCM_EOL; if (scm_c_vector_length (shape_vector) > delta && scm_is_symbol (scm_vector_ref (shape_vector, scm_from_int (delta)))) - { - style = scm_vector_ref (shape_vector, scm_from_int (delta)); - } + style = scm_vector_ref (shape_vector, scm_from_int (delta)); if (scm_is_symbol (style)) { note->set_property ("style", style); diff --git a/lily/note-performer.cc b/lily/note-performer.cc index f19f8c704d..6409c77d5b 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -92,7 +92,7 @@ Note_performer::try_music (Music *ev) ADD_TRANSLATOR (Note_performer, "", "", "note-event busy-playing-event", - "", ""); + "", ""); Note_performer::Note_performer () { diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index 3421ea5cba..6f264a7135 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -20,7 +20,6 @@ #include "output-def.hh" #include "pointer-group-interface.hh" - /* TODO: detect hshifts due to collisions, and account for them in spacing? @@ -45,10 +44,8 @@ Note_spacing::get_spacing (Grob *me, Item *right_col, Item *it = dynamic_cast (items[i]); if (d == RIGHT && it->break_status_dir () != col_dir) - { - it = it->find_prebroken_piece (col_dir); - } - + it = it->find_prebroken_piece (col_dir); + /* some kind of mismatch, eg. a note column, that is behind a linebreak. @@ -96,11 +93,8 @@ Note_spacing::get_spacing (Grob *me, Item *right_col, extents[d].unite (v); } - if (Grob *arpeggio = Note_column::arpeggio (it)) - { - extents[d].unite (arpeggio->extent (it_col, X_AXIS)); - } + extents[d].unite (arpeggio->extent (it_col, X_AXIS)); } } @@ -139,10 +133,9 @@ Note_spacing::get_spacing (Grob *me, Item *right_col, /* Add that which sticks out a lot. - */ + */ + max (0.0, -extents[RIGHT][LEFT] - (base_space - increment)))); - /* We don't do complicated stuff: (base_space - increment) is the @@ -195,11 +188,11 @@ Note_spacing::right_column (Grob *me) if (!me->is_live ()) return 0; - Grob_array * a = unsmob_grob_array (me->get_object ("right-items")); + Grob_array *a = unsmob_grob_array (me->get_object ("right-items")); Item *mincol = 0; int min_rank = INT_MAX; bool prune = false; - for (int i = 0; a && i < a->size (); i++) + for (int i = 0; a && i < a->size (); i++) { Item *ri = a->item (i); Item *col = ri->get_column (); @@ -218,10 +211,10 @@ Note_spacing::right_column (Grob *me) if (prune && a) { - Link_array & right = a->array_reference (); - for (int i = right.size(); i--;) + Link_array &right = a->array_reference (); + for (int i = right.size (); i--;) { - if (dynamic_cast (right[i])->get_column () != mincol) + if (dynamic_cast (right[i])->get_column () != mincol) right.del (i); } } @@ -267,7 +260,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, do { Link_array const &items (ly_scm2link_array (props [d])); - for (int i = 0; i < items.size(); i++) + for (int i = 0; i < items.size (); i++) { Item *it = dynamic_cast (items[i]); @@ -281,9 +274,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, if (d == RIGHT && Separation_item::has_interface (it)) { if (it->get_column () != rcolumn) - { - it = it->find_prebroken_piece (rcolumn->break_status_dir ()); - } + it = it->find_prebroken_piece (rcolumn->break_status_dir ()); Grob *last = Separation_item::extremal_break_aligned_grob (it, LEFT, &bar_xextent); @@ -319,9 +310,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, */ if (d == LEFT && Stem::duration_log (stem) > 2 && !Stem::get_beam (stem)) - { - correct_stem_dirs = false; - } + correct_stem_dirs = false; Interval hp = Stem::head_positions (stem); if (!hp.is_empty ()) @@ -329,7 +318,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, Real chord_start = hp[sd]; Real stem_end = Stem::stem_end_position (stem); - stem_posns[d] = Interval (min (chord_start, stem_end), max (chord_start, stem_end)); + stem_posns[d] = Interval (min (chord_start, stem_end), max (chord_start, stem_end)); head_posns[d].unite (hp); } } @@ -402,9 +391,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, } if (!bar_yextent.is_empty ()) - { - correction *= 0.5; - } + correction *= 0.5; } } else if (correct_stem_dirs && stem_dirs[LEFT] * stem_dirs[RIGHT] == UP) @@ -438,7 +425,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, Real delta = head_posns[-lowest][DOWN] - head_posns[lowest][UP]; Real corr = robust_scm2double (me->get_property ("same-direction-correction"), 0); - + if (delta > 1) correction = -lowest * corr; } diff --git a/lily/object-key-dumper.cc b/lily/object-key-dumper.cc index 4a29c9c7ae..8ba5a8c36c 100644 --- a/lily/object-key-dumper.cc +++ b/lily/object-key-dumper.cc @@ -57,9 +57,7 @@ Object_key_dumper::serialize_key (Object_key const *key) for (SCM s = skey; scm_is_pair (s); s = scm_cdr (s)) { if (Object_key const *sub_key = unsmob_key (scm_car (s))) - { - scm_set_car_x (s, dump_key (sub_key)); - } + scm_set_car_x (s, dump_key (sub_key)); else if (Moment *mom = unsmob_moment (scm_car (s))) { scm_set_car_x (s, diff --git a/lily/object-key-undumper.cc b/lily/object-key-undumper.cc index 2004c3b2b8..b9baee4564 100644 --- a/lily/object-key-undumper.cc +++ b/lily/object-key-undumper.cc @@ -64,9 +64,7 @@ Object_key_undumper::parse_contents (SCM contents) *tail = scm_cons (key->self_scm (), SCM_EOL); } else - { - *tail = scm_cons (item, SCM_EOL); - } + *tail = scm_cons (item, SCM_EOL); tail = SCM_CDRLOC (*tail); } diff --git a/lily/open-type-font-scheme.cc b/lily/open-type-font-scheme.cc index d39a7cc9d8..688534ee74 100644 --- a/lily/open-type-font-scheme.cc +++ b/lily/open-type-font-scheme.cc @@ -35,37 +35,37 @@ LY_DEFINE (ly_otf_font_glyph_info, "ly:otf-font-glyph-info", 2, 0, 0, return scm_hashq_ref (otf->get_char_table (), sym, SCM_EOL); } -LY_DEFINE(ly_otf_font_table_data, "ly:otf-font-table-data", 2, 0, 0, - (SCM font, SCM tag), - "Extract a table @var{tag} from @var{font}. Return empty string for " - "non-existent @var{tag}.") +LY_DEFINE (ly_otf_font_table_data, "ly:otf-font-table-data", 2, 0, 0, + (SCM font, SCM tag), + "Extract a table @var{tag} from @var{font}. Return empty string for " + "non-existent @var{tag}.") { Modified_font_metric *fm = dynamic_cast (unsmob_metrics (font)); - + Open_type_font *otf = fm ? dynamic_cast (fm->original_font ()) : dynamic_cast (unsmob_metrics (font)); - SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "Open type font"); - SCM_ASSERT_TYPE (scm_is_string (tag), tag, SCM_ARG1, __FUNCTION__, "Open type font"); + SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "Open type font"); + SCM_ASSERT_TYPE (scm_is_string (tag), tag, SCM_ARG1, __FUNCTION__, "Open type font"); char ctag [5] = " "; String tag_string = ly_scm2string (tag); - strncpy (ctag, tag_string.to_str0 (), tag_string.length()); + strncpy (ctag, tag_string.to_str0 (), tag_string.length ()); String tab = otf->get_otf_table (String (ctag)); - return scm_from_locale_stringn ((char const*) tab.to_bytes (), tab.length ()); + return scm_from_locale_stringn ((char const *) tab.to_bytes (), tab.length ()); } -LY_DEFINE(ly_otf_font_p, "ly:otf-font?", 1, 0, 0, - (SCM font), - "Is @var{font} an OpenType font?") +LY_DEFINE (ly_otf_font_p, "ly:otf-font?", 1, 0, 0, + (SCM font), + "Is @var{font} an OpenType font?") { Modified_font_metric *fm = dynamic_cast (unsmob_metrics (font)); - + Open_type_font *otf = fm ? dynamic_cast (fm->original_font ()) : dynamic_cast (unsmob_metrics (font)); diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index 5ac1c9c735..0535cb625e 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -38,11 +38,10 @@ load_table (char const *tag_str, FT_Face face, FT_ULong *length) { programming_error ("Cannot find OpenType table."); } - + return 0; } - String Open_type_font::get_otf_table (String tag) const { @@ -85,7 +84,6 @@ Open_type_font::~Open_type_font () FT_Done_Face (face_); } - /* UGH fix naming */ @@ -93,7 +91,7 @@ String get_otf_table (FT_Face face, String tag) { FT_ULong len; - FT_Byte *tab = load_table (tag.to_str0 (), face, &len); + FT_Byte *tab = load_table (tag.to_str0 (), face, &len); return String (tab, len); } @@ -128,7 +126,7 @@ Open_type_font::Open_type_font (FT_Face face) lily_global_table_ = SCM_EOL; lily_subfonts_ = SCM_EOL; lily_index_to_bbox_table_ = SCM_EOL; - + lily_character_table_ = alist_to_hashq (load_scheme_table ("LILC", face_)); lily_global_table_ = alist_to_hashq (load_scheme_table ("LILY", face_)); lily_subfonts_ = load_scheme_table ("LILF", face_); @@ -168,7 +166,7 @@ Open_type_font::get_indexed_char (int signed_idx) const if (SCM_HASHTABLE_P (lily_index_to_bbox_table_)) { SCM box = scm_hashq_ref (lily_index_to_bbox_table_, scm_from_int (signed_idx), SCM_BOOL_F); - Box * box_ptr = Box::unsmob (box); + Box *box_ptr = Box::unsmob (box); if (box_ptr) return *box_ptr; } diff --git a/lily/ottava-bracket.cc b/lily/ottava-bracket.cc index 80b98d2500..a9df448d62 100644 --- a/lily/ottava-bracket.cc +++ b/lily/ottava-bracket.cc @@ -94,16 +94,12 @@ Ottava_bracket::print (SCM smob) Grob *dots = Rhythmic_head::get_dots (h); if (dots && d == RIGHT) - { - ext.unite (dots->extent (common, X_AXIS)); - } + ext.unite (dots->extent (common, X_AXIS)); } } if (ext.is_empty ()) - { - ext = robust_relative_extent (b, common, X_AXIS); - } + ext = robust_relative_extent (b, common, X_AXIS); if (broken[d]) { @@ -122,10 +118,10 @@ Ottava_bracket::print (SCM smob) Real text_size = text.extent (X_AXIS).is_empty () ? 0.0 : text.extent (X_AXIS)[RIGHT] + 0.3; - span_points[LEFT] = - min (span_points[LEFT], - (span_points[RIGHT] - text_size - - robust_scm2double (me->get_property ("minimum-length"), -1.0))); + span_points[LEFT] + = min (span_points[LEFT], + (span_points[RIGHT] - text_size + - robust_scm2double (me->get_property ("minimum-length"), -1.0))); Interval bracket_span_points = span_points; bracket_span_points[LEFT] += text_size; diff --git a/lily/ottava-engraver.cc b/lily/ottava-engraver.cc index 6bec8a6c39..7dd0aeb875 100644 --- a/lily/ottava-engraver.cc +++ b/lily/ottava-engraver.cc @@ -17,9 +17,9 @@ public: TRANSLATOR_DECLARATIONS (Ottava_spanner_engraver); protected: virtual void finalize (); - + DECLARE_ACKNOWLEDGER (note_column); - + void process_music (); void stop_translation_timestep (); virtual void derived_mark () const; @@ -70,7 +70,7 @@ Ottava_spanner_engraver::process_music () void Ottava_spanner_engraver::acknowledge_note_column (Grob_info info) { - Item *it = info.item(); + Item *it = info.item (); if (span_ && it) { Side_position_interface::add_support (span_, it); diff --git a/lily/output-def-scheme.cc b/lily/output-def-scheme.cc index f389fcf3e6..8bf702c6ff 100644 --- a/lily/output-def-scheme.cc +++ b/lily/output-def-scheme.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "font-metric.hh" @@ -22,7 +21,7 @@ LY_DEFINE (ly_layout_lookup, "ly:output-def-lookup", Output_def *op = unsmob_output_def (pap); SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Output_def"); SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol"); - + SCM answer = op->lookup_variable (sym); if (answer == SCM_UNDEFINED) { @@ -60,7 +59,7 @@ LY_DEFINE (ly_output_def_clone, "ly:output-def-clone", Output_def *op = unsmob_output_def (def); SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition"); - Output_def *clone = op->clone (); + Output_def *clone = op->clone (); return clone->unprotect (); } @@ -69,18 +68,18 @@ LY_DEFINE (ly_output_description, "ly:output-description", "Return the description of translators in @var{output-def}.") { Output_def *id = unsmob_output_def (output_def); - + SCM al = ly_module2alist (id->scope_); SCM ell = SCM_EOL; for (SCM s = al; scm_is_pair (s); s = scm_cdr (s)) { - Context_def * td = unsmob_context_def (scm_cdar (s)); + Context_def *td = unsmob_context_def (scm_cdar (s)); SCM key = scm_caar (s); if (td && key == td->get_context_name ()) - ell = scm_cons (scm_cons (key, td->to_alist ()), ell); + ell = scm_cons (scm_cons (key, td->to_alist ()), ell); } - return ell; + return ell; } LY_DEFINE (ly_layout_def_p, "ly:layout-def?", @@ -91,8 +90,8 @@ LY_DEFINE (ly_layout_def_p, "ly:layout-def?", } LY_DEFINE (ly_paper_outputscale, "ly:paper-outputscale", - 1, 0, 0, (SCM bp), - "Get outputscale for BP.") + 1, 0, 0, (SCM bp), + "Get outputscale for BP.") { Output_def *b = unsmob_output_def (bp); SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "paper"); @@ -103,7 +102,7 @@ LY_DEFINE (ly_make_output_def, "ly:make-output-def", 0, 0, 0, (), "Make a output def.") { - Output_def *bp = new Output_def ; + Output_def *bp = new Output_def; return bp->unprotect (); } @@ -118,7 +117,7 @@ LY_DEFINE (ly_paper_get_font, "ly:paper-get-font", 2, 0, 0, Output_def *paper = unsmob_output_def (paper_smob); SCM_ASSERT_TYPE (paper, paper_smob, SCM_ARG1, __FUNCTION__, "paper definition"); - + Font_metric *fm = select_font (paper, chain); return fm->self_scm (); } @@ -140,7 +139,6 @@ LY_DEFINE (ly_paper_fonts, "ly:paper-fonts", { Output_def *b = unsmob_output_def (bp); - SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "paper"); SCM tab1 = b->lookup_variable (ly_symbol2scm ("scaled-fonts")); @@ -150,7 +148,7 @@ LY_DEFINE (ly_paper_fonts, "ly:paper-fonts", if (scm_hash_table_p (tab1) == SCM_BOOL_T) { alist1 = scm_append (ly_alist_vals (ly_hash2alist (tab1))); - + alist1 = ly_alist_vals (alist1); } @@ -161,7 +159,7 @@ LY_DEFINE (ly_paper_fonts, "ly:paper-fonts", alist2 = scm_append (ly_alist_vals (ly_hash2alist (tab2))); // strip size factors - alist2 = ly_alist_vals (alist2); + alist2 = ly_alist_vals (alist2); } SCM alist = scm_append (scm_list_2 (alist1, alist2)); @@ -169,13 +167,13 @@ LY_DEFINE (ly_paper_fonts, "ly:paper-fonts", for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s)) { SCM entry = scm_car (s); - + Font_metric *fm = unsmob_metrics (entry); - if (dynamic_cast (fm) - || dynamic_cast (fm)) + if (dynamic_cast (fm) + || dynamic_cast (fm)) font_list = scm_cons (fm->self_scm (), font_list); } - + return font_list; } diff --git a/lily/pango-font.cc b/lily/pango-font.cc index 0a4fc747fa..ca142d16e4 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -101,7 +101,7 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con PANGO_ASCENT (ink_rect))); b.scale (scale_); - + SCM glyph_exprs = SCM_EOL; SCM *tail = &glyph_exprs; @@ -115,13 +115,12 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con FT_Get_Glyph_Name (ftface, pg, glyph_name, GLYPH_NAME_LEN); - - SCM char_id; + SCM char_id; if (glyph_name[0] == '\0') { /* CID entry - */ + */ cid_keyed = true; char_id = scm_from_int (pg); } diff --git a/lily/paper-book.cc b/lily/paper-book.cc index dc373ea117..fa40e5ef58 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -81,14 +81,12 @@ Paper_book::add_score (SCM s) scores_ = scm_cons (s, scores_); } - void Paper_book::add_performance (SCM s) { performances_ = scm_cons (s, performances_); } - void Paper_book::output (SCM output_channel) { @@ -276,14 +274,14 @@ Paper_book::systems () header_0_ = header; } else if (Music_output *mop = unsmob_music_output (scm_car (s))) - + { if (Paper_score *pscore = dynamic_cast (mop)) { add_score_title (header); - + header = SCM_EOL; - + SCM system_list = scm_vector_to_list (pscore->get_paper_systems ()); system_list = scm_reverse (system_list); systems_ = scm_append (scm_list_2 (system_list, systems_)); @@ -298,11 +296,11 @@ Paper_book::systems () else if (scm_is_vector (scm_car (s))) { /* - UGH. code dup. + UGH. code dup. */ add_score_title (header); header = SCM_EOL; - + SCM system_list = scm_vector_to_list (scm_car (s)); system_list = scm_reverse (system_list); systems_ = scm_append (scm_list_2 (system_list, systems_)); diff --git a/lily/paper-column-engraver.cc b/lily/paper-column-engraver.cc index c92055fa86..680deae2bf 100644 --- a/lily/paper-column-engraver.cc +++ b/lily/paper-column-engraver.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "paper-column-engraver.hh" @@ -20,7 +19,6 @@ #include "translator.icc" - Paper_column_engraver::Paper_column_engraver () { command_column_ = 0; @@ -41,7 +39,7 @@ Paper_column_engraver::finalize () { command_column_->set_property ("breakable", SCM_BOOL_T); system_->set_bound (RIGHT, command_column_); - } + } } void @@ -53,21 +51,19 @@ Paper_column_engraver::make_columns () Paper_column *p1 = make_paper_column ("NonMusicalPaperColumn"); Paper_column *p2 = make_paper_column ("PaperColumn"); - SCM m = now_mom().smobbed_copy(); + SCM m = now_mom ().smobbed_copy (); p1->set_property ("when", m); p2->set_property ("when", m); - + set_columns (p1, p2); } - void Paper_column_engraver::initialize () { - system_ = dynamic_cast (unsmob_grob (get_property ("rootSystem"))); + system_ = dynamic_cast (unsmob_grob (get_property ("rootSystem"))); make_columns (); - system_->set_bound (LEFT, command_column_); command_column_->set_property ("breakable", SCM_BOOL_T); } @@ -113,7 +109,6 @@ Paper_column_engraver::set_columns (Paper_column *new_command, system_->add_column (musical_column_); } - void Paper_column_engraver::forbid_breaks () { @@ -121,7 +116,6 @@ Paper_column_engraver::forbid_breaks () command_column_->set_property ("breakable", SCM_EOL); } - bool Paper_column_engraver::try_music (Music *m) { @@ -157,7 +151,6 @@ Paper_column_engraver::process_music () command_column_->set_property ("page-penalty", scm_from_double (total_pp)); } - bool start_of_measure = (last_moment_.main_part_ != now_mom ().main_part_ && !measure_position (context ()).main_part_); @@ -168,11 +161,11 @@ Paper_column_engraver::process_music () if (start_of_measure) { Moment mlen = Moment (measure_length (context ())); - Grob * column = unsmob_grob (get_property ("currentCommandColumn")); + Grob *column = unsmob_grob (get_property ("currentCommandColumn")); if (column) column->set_property ("measure-length", mlen.smobbed_copy ()); else - programming_error("No command column?"); + programming_error ("No command column?"); } } @@ -190,7 +183,7 @@ Paper_column_engraver::stop_translation_timestep () } } items_.clear (); - + if (to_boolean (command_column_->get_property ("breakable"))) { breaks_++; @@ -212,10 +205,9 @@ Paper_column_engraver::start_translation_timestep () make_columns (); } -ADD_ACKNOWLEDGER (Paper_column_engraver,item); -ADD_ACKNOWLEDGER (Paper_column_engraver,note_spacing); -ADD_ACKNOWLEDGER (Paper_column_engraver,staff_spacing); - +ADD_ACKNOWLEDGER (Paper_column_engraver, item); +ADD_ACKNOWLEDGER (Paper_column_engraver, note_spacing); +ADD_ACKNOWLEDGER (Paper_column_engraver, staff_spacing); ADD_TRANSLATOR (Paper_column_engraver, /* doc */ "Takes care of generating columns." diff --git a/lily/paper-column.cc b/lily/paper-column.cc index 991e58983f..d86caaa735 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -105,12 +105,12 @@ Paper_column::is_musical (Grob *me) bool Paper_column::is_used (Grob *me) { - extract_grob_set (me ,"elements", elts); - if (elts.size()) + extract_grob_set (me, "elements", elts); + if (elts.size ()) return true; - - extract_grob_set (me ,"bounded-by-me", bbm); - if (bbm.size()) + + extract_grob_set (me, "bounded-by-me", bbm); + if (bbm.size ()) return true; return Item::is_breakable (me); } @@ -129,7 +129,7 @@ Paper_column::print (SCM p) Moment *mom = unsmob_moment (me->get_property ("when")); String when = mom ? mom->to_string () : "?/?"; - + SCM properties = Font_interface::text_font_alist_chain (me); SCM scm_mol = Text_interface::interpret_markup (me->get_layout ()->self_scm (), @@ -165,13 +165,13 @@ Paper_column::before_line_breaking (SCM grob) Grob *me = unsmob_grob (grob); SCM bbm = me->get_object ("bounded-by-me"); - Grob_array * ga = unsmob_grob_array (bbm); + Grob_array *ga = unsmob_grob_array (bbm); if (!ga) return SCM_UNSPECIFIED; - + Link_array &array (ga->array_reference ()); - - for (int i = array.size(); i--; ) + + for (int i = array.size (); i--;) { Grob *g = array[i]; diff --git a/lily/paper-outputter-scheme.cc b/lily/paper-outputter-scheme.cc index 9c753f9b49..3c2f531e03 100644 --- a/lily/paper-outputter-scheme.cc +++ b/lily/paper-outputter-scheme.cc @@ -11,7 +11,6 @@ #include "stencil.hh" - LY_DEFINE (ly_make_paper_outputter, "ly:make-paper-outputter", 2, 0, 0, (SCM port, SCM format), "Create an outputter that evaluates within " @@ -25,11 +24,11 @@ LY_DEFINE (ly_make_paper_outputter, "ly:make-paper-outputter", String f = ly_scm2string (format); String output_name = ""; - + SCM port_name = scm_port_filename (port); if (scm_is_string (port_name)) output_name = ly_scm2string (port_name); - + message (_f ("Layout output to `%s'...", output_name.to_str0 ())); diff --git a/lily/paper-score-scheme.cc b/lily/paper-score-scheme.cc index 031c76b84c..219f27e6e9 100644 --- a/lily/paper-score-scheme.cc +++ b/lily/paper-score-scheme.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "paper-score.hh" diff --git a/lily/paper-score.cc b/lily/paper-score.cc index 87b94f1531..f84ac9218a 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -35,7 +35,6 @@ Paper_score::Paper_score (Paper_score const &s) assert (false); } - void Paper_score::derived_mark () const { @@ -108,7 +107,6 @@ Paper_score::layout () const { return layout_; } - SCM Paper_score::get_paper_systems () const diff --git a/lily/part-combine-engraver.cc b/lily/part-combine-engraver.cc index df81f10777..e6a2ceca65 100644 --- a/lily/part-combine-engraver.cc +++ b/lily/part-combine-engraver.cc @@ -22,7 +22,7 @@ class Part_combine_engraver : public Engraver protected: DECLARE_ACKNOWLEDGER (note_head); DECLARE_ACKNOWLEDGER (stem); - + void process_music (); void stop_translation_timestep (); virtual bool try_music (Music *); @@ -84,7 +84,7 @@ void Part_combine_engraver::acknowledge_stem (Grob_info i) { if (text_) - Side_position_interface::add_support (text_, i.grob ()); + Side_position_interface::add_support (text_, i.grob ()); } void diff --git a/lily/percent-repeat-engraver.cc b/lily/percent-repeat-engraver.cc index d68a44e274..521972ec31 100644 --- a/lily/percent-repeat-engraver.cc +++ b/lily/percent-repeat-engraver.cc @@ -91,9 +91,7 @@ Percent_repeat_engraver::try_music (Music *m) if (meas_len == body_length_) repeat_sign_type_ = MEASURE; else if (Moment (2) * meas_len == body_length_) - { - repeat_sign_type_ = DOUBLE_MEASURE; - } + repeat_sign_type_ = DOUBLE_MEASURE; else { warning (_f ("can't handle a percent repeat of length: %s", @@ -116,7 +114,7 @@ Percent_repeat_engraver::try_music (Music *m) if (repeat_sign_type_ == DOUBLE_MEASURE) next_moment_ += meas_len; - + return true; } @@ -139,7 +137,7 @@ Percent_repeat_engraver::process_music () else if (repeat_sign_type_ == DOUBLE_MEASURE) { double_percent_ = make_item ("DoublePercentRepeat", repeat_->self_scm ()); - + /* forbid breaks on a % line. Should forbid all breaks, really. diff --git a/lily/performance-scheme.cc b/lily/performance-scheme.cc index d8dd325346..645262f9df 100644 --- a/lily/performance-scheme.cc +++ b/lily/performance-scheme.cc @@ -4,26 +4,22 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ - #include "performance.hh" - LY_DEFINE (ly_performance_write, "ly:performance-write", - 2,0,0, (SCM performance, SCM filename), + 2, 0, 0, (SCM performance, SCM filename), "Write @var{performance} to @var{filename}") { - Performance * perf = dynamic_cast (unsmob_music_output (performance)); + Performance *perf = dynamic_cast (unsmob_music_output (performance)); - SCM_ASSERT_TYPE(perf, performance, SCM_ARG1, __FUNCTION__, "Performance"); - SCM_ASSERT_TYPE(scm_is_string (filename), filename, SCM_ARG2, __FUNCTION__, "file name"); + SCM_ASSERT_TYPE (perf, performance, SCM_ARG1, __FUNCTION__, "Performance"); + SCM_ASSERT_TYPE (scm_is_string (filename), filename, SCM_ARG2, __FUNCTION__, "file name"); perf->write_output (ly_scm2string (filename)); return SCM_UNSPECIFIED; } - diff --git a/lily/performance.cc b/lily/performance.cc index 6bdec3790c..ca2d061d85 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -149,7 +149,6 @@ Performance::add_element (Audio_element *p) audio_element_list_ = new Killing_cons (p, audio_element_list_); } - void Performance::write_output (String out) { diff --git a/lily/performer-group-performer.cc b/lily/performer-group-performer.cc index 0b8c8f6cf5..37715b538e 100644 --- a/lily/performer-group-performer.cc +++ b/lily/performer-group-performer.cc @@ -14,11 +14,11 @@ #include "warn.hh" ADD_TRANSLATOR_GROUP (Performer_group_performer, - /* doc */ "", - /* create */ "", - /* accept */ "", - /* read */ "", - /* write */ ""); + /* doc */ "", + /* create */ "", + /* accept */ "", + /* read */ "", + /* write */ ""); void Performer_group_performer::announce_element (Audio_element_info info) @@ -75,14 +75,13 @@ Performer_group_performer::do_announces () } } - void Performer_group_performer::play_element (Audio_element *e) { Context *c = context_->get_parent_context (); if (c) { - Performer_group_performer *pgp = dynamic_cast (c->implementation ()); + Performer_group_performer *pgp = dynamic_cast (c->implementation ()); pgp->play_element (e); } } @@ -93,9 +92,9 @@ Performer_group_performer::get_tempo () const Context *c = context_->get_parent_context (); if (c) { - Performer_group_performer *pgp = dynamic_cast (c->implementation ()); + Performer_group_performer *pgp = dynamic_cast (c->implementation ()); return pgp->get_tempo (); } return 60; } - + diff --git a/lily/pfb.cc b/lily/pfb.cc index 56fc6beeba..4af3609938 100644 --- a/lily/pfb.cc +++ b/lily/pfb.cc @@ -93,12 +93,11 @@ LY_DEFINE (ly_pfb_to_pfa, "ly:pfb->pfa", delete str; if (be_verbose_global) progress_indication ("]"); - + return pfa_scm; } - LY_DEFINE (ly_otf_to_cff, "ly:otf->cff", 1, 0, 0, (SCM otf_file_name), "Convert the contents of a OTF file to CFF file, returning it as " @@ -114,12 +113,12 @@ LY_DEFINE (ly_otf_to_cff, "ly:otf->cff", FT_Face face = open_ft_face (file_name); String table = get_otf_table (face, "CFF "); - SCM asscm = scm_from_locale_stringn ((char*) table.get_bytes (), + SCM asscm = scm_from_locale_stringn ((char *) table.get_bytes (), table.length ()); if (be_verbose_global) progress_indication ("]"); - + return asscm; -} - +} + diff --git a/lily/phrasing-slur-engraver.cc b/lily/phrasing-slur-engraver.cc index ab0b30d230..b5087e2f49 100644 --- a/lily/phrasing-slur-engraver.cc +++ b/lily/phrasing-slur-engraver.cc @@ -39,7 +39,7 @@ protected: DECLARE_ACKNOWLEDGER (slur); DECLARE_ACKNOWLEDGER (text_script); DECLARE_ACKNOWLEDGER (tie); - + void stop_translation_timestep (); virtual void finalize (); void process_music (); @@ -93,7 +93,7 @@ Phrasing_slur_engraver::acknowledge_note_column (Grob_info info) void Phrasing_slur_engraver::acknowledge_extra_object (Grob_info info) { - Grob*e = info.grob (); + Grob *e = info.grob (); SCM inside = e->get_property ("inside-slur"); if (Tie::has_interface (e) || to_boolean (inside)) @@ -154,7 +154,6 @@ Phrasing_slur_engraver::acknowledge_tie (Grob_info info) acknowledge_extra_object (info); } - void Phrasing_slur_engraver::acknowledge_slur (Grob_info info) { @@ -199,11 +198,10 @@ Phrasing_slur_engraver::stop_translation_timestep () #include "translator.icc" - ADD_ACKNOWLEDGER (Phrasing_slur_engraver, accidental); ADD_ACKNOWLEDGER (Phrasing_slur_engraver, dynamic_line_spanner); ADD_ACKNOWLEDGER (Phrasing_slur_engraver, fingering) -ADD_ACKNOWLEDGER (Phrasing_slur_engraver, note_column); + ADD_ACKNOWLEDGER (Phrasing_slur_engraver, note_column); ADD_ACKNOWLEDGER (Phrasing_slur_engraver, script); ADD_ACKNOWLEDGER (Phrasing_slur_engraver, slur); ADD_ACKNOWLEDGER (Phrasing_slur_engraver, text_script); diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index 870d6d44d8..a557a8dca9 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -152,7 +152,7 @@ Piano_pedal_engraver::try_music (Music *m) { String nm = p->name_ + String ("Event"); if (ly_is_equal (m->get_property ("name"), - scm_str2symbol (nm.to_str0 ()))) + scm_str2symbol (nm.to_str0 ()))) { Direction d = to_dir (m->get_property ("span-direction")); p->event_drul_[d] = m; @@ -237,9 +237,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed) p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", p->name_)); } else - { - s = scm_cadr (strings); - } + s = scm_cadr (strings); p->start_ev_ = p->event_drul_[START]; } } @@ -252,9 +250,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed) p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", p->name_)); } else - { - s = scm_caddr (strings); - } + s = scm_caddr (strings); p->start_ev_ = 0; } } @@ -423,9 +419,7 @@ Piano_pedal_engraver::finalize () SCM cc = get_property ("currentCommandColumn"); Item *c = unsmob_item (cc); if (p->line_spanner_) - { - p->line_spanner_->set_bound (RIGHT, c); - } + p->line_spanner_->set_bound (RIGHT, c); p->bracket_->set_bound (RIGHT, c); p->finished_bracket_ = p->bracket_; @@ -523,7 +517,7 @@ Piano_pedal_engraver::typeset_all (Pedal_info *p) } #include "translator.icc" -ADD_ACKNOWLEDGER (Piano_pedal_engraver,note_column); +ADD_ACKNOWLEDGER (Piano_pedal_engraver, note_column); ADD_TRANSLATOR (Piano_pedal_engraver, /* doc */ "Engrave piano pedal symbols and brackets.", /* create */ "SostenutoPedal SustainPedal UnaCordaPedal SostenutoPedalLineSpanner SustainPedalLineSpanner UnaCordaPedalLineSpanner", diff --git a/lily/piano-pedal-performer.cc b/lily/piano-pedal-performer.cc index 859c4fa3f8..fe0bcff1f0 100644 --- a/lily/piano-pedal-performer.cc +++ b/lily/piano-pedal-performer.cc @@ -130,7 +130,7 @@ Piano_pedal_performer::try_music (Music *r) { String nm = p->name_ + String ("Event"); if (ly_is_equal (r->get_property ("name"), - scm_str2symbol (nm.to_str0 ()))) + scm_str2symbol (nm.to_str0 ()))) { Direction d = to_dir (r->get_property ("span-direction")); p->event_drul_[d] = r; @@ -145,4 +145,4 @@ Piano_pedal_performer::try_music (Music *r) ADD_TRANSLATOR (Piano_pedal_performer, "", "", "pedal-event", - "", ""); + "", ""); diff --git a/lily/pitch-squash-engraver.cc b/lily/pitch-squash-engraver.cc index 99aa432df7..f6ce236706 100644 --- a/lily/pitch-squash-engraver.cc +++ b/lily/pitch-squash-engraver.cc @@ -32,9 +32,9 @@ Pitch_squash_engraver::Pitch_squash_engraver () } #include "translator.icc" -ADD_ACKNOWLEDGER (Pitch_squash_engraver,note_head); +ADD_ACKNOWLEDGER (Pitch_squash_engraver, note_head); ADD_TRANSLATOR (Pitch_squash_engraver, - /* doc */ + /* doc */ "Set the vertical position of noteheads to " "@code{squashedPosition}, if that " "property is set. " diff --git a/lily/pitched-trill-engraver.cc b/lily/pitched-trill-engraver.cc index cfa2a3ad49..ce2c5a3b91 100644 --- a/lily/pitched-trill-engraver.cc +++ b/lily/pitched-trill-engraver.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "engraver.hh" @@ -16,20 +15,20 @@ #include "note-head.hh" #include "item.hh" #include "side-position-interface.hh" -#include "pitch.hh" +#include "pitch.hh" #include "warn.hh" class Pitched_trill_engraver : public Engraver { public: - TRANSLATOR_DECLARATIONS(Pitched_trill_engraver); - + TRANSLATOR_DECLARATIONS (Pitched_trill_engraver); + protected: - DECLARE_ACKNOWLEDGER ( note_head); - DECLARE_ACKNOWLEDGER ( dots); - DECLARE_ACKNOWLEDGER ( text_spanner); + DECLARE_ACKNOWLEDGER (note_head); + DECLARE_ACKNOWLEDGER (dots); + DECLARE_ACKNOWLEDGER (text_spanner); void process_music (); - virtual bool try_music (Music*); + virtual bool try_music (Music *); void stop_translation_timestep (); private: @@ -42,7 +41,6 @@ private: void make_trill (Music *); }; - Pitched_trill_engraver::Pitched_trill_engraver () { trill_head_ = 0; @@ -60,7 +58,7 @@ Pitched_trill_engraver::acknowledge_note_head (Grob_info info) { heads_.push (info.grob ()); } - + void Pitched_trill_engraver::acknowledge_text_spanner (Grob_info info) { @@ -91,7 +89,7 @@ Pitched_trill_engraver::make_trill (Music *mus) if (trill_head_) { programming_error ("already have a trill head."); - trill_head_ = 0; + trill_head_ = 0; } trill_head_ = make_item ("TrillPitchHead", mus->self_scm ()); @@ -102,10 +100,10 @@ Pitched_trill_engraver::make_trill (Music *mus) trill_head_->set_property ("staff-position", scm_from_int (unsmob_pitch (scm_pitch)->steps () + c0)); - - trill_group_ = make_item ("TrillPitchGroup", mus->self_scm()); - Axis_group_interface::add_element (trill_group_, trill_head_); + trill_group_ = make_item ("TrillPitchGroup", mus->self_scm ()); + + Axis_group_interface::add_element (trill_group_, trill_head_); if (print_acc) { @@ -127,7 +125,7 @@ Pitched_trill_engraver::stop_translation_timestep () if (trill_group_) for (int i = 0; i < heads_.size (); i++) Side_position_interface::add_support (trill_group_, heads_[i]); - + heads_.clear (); trill_head_ = 0; trill_group_ = 0; diff --git a/lily/pointer-group-interface.cc b/lily/pointer-group-interface.cc index 07e49c3518..74b4c2e0e2 100644 --- a/lily/pointer-group-interface.cc +++ b/lily/pointer-group-interface.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "pointer-group-interface.hh" @@ -18,7 +17,7 @@ int Pointer_group_interface::count (Grob *me, SCM sym) { Grob_array *arr = unsmob_grob_array (me->internal_get_object (sym)); - return arr ? arr->size() : 0; + return arr ? arr->size () : 0; } void @@ -27,7 +26,6 @@ Pointer_group_interface::add_grob (Grob *me, SCM sym, SCM p) add_grob (me, sym, unsmob_grob (p)); } - void Pointer_group_interface::add_grob (Grob *me, SCM sym, Grob *p) { @@ -41,7 +39,7 @@ Pointer_group_interface::add_grob (Grob *me, SCM sym, Grob *p) } arr->add (p); } - + static Link_array empty_array; Link_array const & @@ -50,7 +48,6 @@ ly_scm2link_array (SCM x) Grob_array *arr = unsmob_grob_array (x); return arr ? arr->array () : empty_array; } - Link_array const & internal_extract_grob_array (Grob const *elt, SCM symbol) diff --git a/lily/profile.cc b/lily/profile.cc index 0e986d4d70..e0509e56a2 100644 --- a/lily/profile.cc +++ b/lily/profile.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "profile.hh" @@ -14,33 +13,32 @@ void note_property_access (SCM *table, SCM sym); SCM context_property_lookup_table; SCM grob_property_lookup_table; -LY_DEFINE(ly_context_property_lookup_stats, "ly:context-property-lookup-stats", - 0,0,0, (), - "") +LY_DEFINE (ly_context_property_lookup_stats, "ly:context-property-lookup-stats", + 0, 0, 0, (), + "") { - return context_property_lookup_table ? context_property_lookup_table + return context_property_lookup_table ? context_property_lookup_table : scm_c_make_hash_table (1); } - -LY_DEFINE(ly_property_lookup_stats, "ly:grob-property-lookup-stats", - 0,0,0, (), - "") +LY_DEFINE (ly_property_lookup_stats, "ly:grob-property-lookup-stats", + 0, 0, 0, (), + "") { - return grob_property_lookup_table ? grob_property_lookup_table : - scm_c_make_hash_table (1); + return grob_property_lookup_table ? grob_property_lookup_table + : scm_c_make_hash_table (1); } void note_property_access (SCM *table, SCM sym) { /* - Statistics: which properties are looked up? + Statistics: which properties are looked up? */ if (!*table) *table = scm_permanent_object (scm_c_make_hash_table (259)); - + SCM hashhandle = scm_hashq_get_handle (*table, sym); if (hashhandle == SCM_BOOL_F) { @@ -48,6 +46,6 @@ note_property_access (SCM *table, SCM sym) hashhandle = scm_hashq_get_handle (*table, sym); } - int count = scm_to_int (scm_cdr (hashhandle)) + 1; + int count = scm_to_int (scm_cdr (hashhandle)) + 1; scm_set_cdr_x (hashhandle, scm_from_int (count)); } diff --git a/lily/program-option.cc b/lily/program-option.cc index c585bb4a60..c1d4d572b3 100644 --- a/lily/program-option.cc +++ b/lily/program-option.cc @@ -17,7 +17,6 @@ #include "warn.hh" #include "main.hh" - /* Write midi as formatted ascii stream? */ bool do_midi_debugging_global; bool use_object_keys; @@ -80,28 +79,27 @@ void internal_set_option (SCM var, SCM val) } } -const int HELP_INDENT = 30; -const int INDENT = 2; -const int SEPARATION = 5; +const int HELP_INDENT = 30; +const int INDENT = 2; +const int SEPARATION = 5; /* Hmmm. should do in SCM / C++ ? - */ +*/ static String get_help_string () { SCM alist = ly_hash2alist (option_hash_); SCM convertor = ly_lily_module_constant ("scm->string"); - - + Array opts; - + for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s)) { SCM sym = scm_caar (s); SCM val = scm_cdar (s); - String opt_spec = - String_convert::char_string (' ', INDENT) + String opt_spec + = String_convert::char_string (' ', INDENT) + ly_symbol2string (sym) + " (" + ly_scm2string (scm_call_1 (convertor, val)) @@ -116,7 +114,7 @@ get_help_string () opt_spec += String_convert::char_string (' ', HELP_INDENT - opt_spec.length ()); SCM opt_help_scm - = scm_object_property (sym, ly_symbol2scm ("program-option-documentation")); + = scm_object_property (sym, ly_symbol2scm ("program-option-documentation")); String opt_help = ly_scm2string (opt_help_scm); opt_help.substitute (String ("\n"), String ("\n") @@ -127,9 +125,9 @@ get_help_string () String help ("Options supported by ly:set-option\n\n"); opts.sort (String::compare); - for (int i = 0; i < opts.size (); i++) + for (int i = 0; i < opts.size (); i++) help += opts[i]; - + help += String ("\n"); return help; } @@ -138,14 +136,14 @@ LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (), "Print ly:set-option usage") { String help = get_help_string (); - fputs (help.to_str0 (), stdout); + fputs (help.to_str0 (), stdout); exit (0); return SCM_UNSPECIFIED; } LY_DEFINE (ly_add_option, "ly:add-option", 3, 0, 0, - (SCM sym, SCM val, SCM description), + (SCM sym, SCM val, SCM description), "Add a program option @var{sym} with default @var{val}.") { if (scm_hash_table_p (option_hash_) == SCM_BOOL_F) @@ -154,7 +152,7 @@ LY_DEFINE (ly_add_option, "ly:add-option", 3, 0, 0, SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG1, __FUNCTION__, "symbol"); SCM_ASSERT_TYPE (scm_is_string (description), description, SCM_ARG3, __FUNCTION__, "string"); - + internal_set_option (sym, val); scm_set_object_property_x (sym, ly_symbol2scm ("program-option-documentation"), @@ -167,7 +165,7 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val), "Set a program option. Try setting 'help for a help string.") { SCM_ASSERT_TYPE (scm_is_symbol (var), var, SCM_ARG1, - __FUNCTION__, "symbol"); + __FUNCTION__, "symbol"); if (ly_symbol2scm ("help") == var) { @@ -177,13 +175,13 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val), if (val == SCM_UNDEFINED) val = SCM_BOOL_T; - String varstr = ly_scm2string (scm_symbol_to_string (var)); + String varstr = ly_scm2string (scm_symbol_to_string (var)); if (varstr.left_string (3) == String ("no-")) { var = ly_symbol2scm (varstr.nomid_string (0, 3).to_str0 ()); val = scm_from_bool (!to_boolean (val)); } - + SCM handle = scm_hashq_get_handle (option_hash_, var); if (handle == SCM_BOOL_F) { @@ -198,6 +196,6 @@ LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var), "Get a global option setting.") { SCM_ASSERT_TYPE (scm_is_symbol (var), var, - SCM_ARG1, __FUNCTION__, "symbol"); + SCM_ARG1, __FUNCTION__, "symbol"); return scm_hashq_ref (option_hash_, var, SCM_BOOL_F); -} +} diff --git a/lily/property-iterator.cc b/lily/property-iterator.cc index f6eb1f9cc2..9cd2af1fff 100644 --- a/lily/property-iterator.cc +++ b/lily/property-iterator.cc @@ -83,7 +83,6 @@ check_grob (Music *mus, SCM sym) return g; } - void Push_property_iterator::process (Moment m) { diff --git a/lily/recording-group-engraver.cc b/lily/recording-group-engraver.cc index 0394d50a46..54b059d8f7 100644 --- a/lily/recording-group-engraver.cc +++ b/lily/recording-group-engraver.cc @@ -9,7 +9,6 @@ #include "recording-group-engraver.hh" #include "context.hh" - void Recording_group_engraver::derived_mark () const { @@ -43,7 +42,7 @@ Recording_group_engraver::stop_translation_timestep () void Recording_group_engraver::finalize () { - SCM proc = context()->get_property ("recordEventSequence"); + SCM proc = context ()->get_property ("recordEventSequence"); if (ly_is_procedure (proc)) scm_call_2 (proc, context ()->self_scm (), scm_cdr (accumulator_)); @@ -61,7 +60,7 @@ Recording_group_engraver::try_music (Music *m) void recording_engraver (Translator_group *tg) { - Recording_group_engraver *rg = dynamic_cast (tg); + Recording_group_engraver *rg = dynamic_cast (tg); rg->stop_translation_timestep (); } @@ -73,10 +72,10 @@ Recording_group_engraver::fetch_precomputable_methods (Translator_group_void_met } ADD_TRANSLATOR_GROUP (Recording_group_engraver, - "Engraver_group_engraver that records all music events " - "for this context. Calls the procedure " - "in @code{recordEventSequence} when finished.", - "", - "", - "recordEventSequence", - ""); + "Engraver_group_engraver that records all music events " + "for this context. Calls the procedure " + "in @code{recordEventSequence} when finished.", + "", + "", + "recordEventSequence", + ""); diff --git a/lily/repeat-acknowledge-engraver.cc b/lily/repeat-acknowledge-engraver.cc index 6d2a32058b..183f7e88c0 100644 --- a/lily/repeat-acknowledge-engraver.cc +++ b/lily/repeat-acknowledge-engraver.cc @@ -108,7 +108,6 @@ Repeat_acknowledge_engraver::process_music () } } - ADD_TRANSLATOR (Repeat_acknowledge_engraver, /* doc */ "Acknowledge repeated music, and convert the contents of " "repeatCommands ainto an appropriate setting for whichBar.", diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 3e1da1936a..4d7ad33486 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -147,10 +147,9 @@ Rest_collision::do_shift (Grob *me) Direction d = LEFT; do - { - ordered_rests[d].sort (Note_column::shift_compare); - } - while (flip (&d) != LEFT); + ordered_rests[d].sort (Note_column::shift_compare); + while (flip (&d) != LEFT) + ; do { @@ -229,9 +228,7 @@ Rest_collision::do_shift (Grob *me) Interval notedim; for (int i = 0; i < notes.size (); i++) - { - notedim.unite (notes[i]->extent (common, Y_AXIS)); - } + notedim.unite (notes[i]->extent (common, Y_AXIS)); Real dist = minimum_dist + dir * max (notedim[dir] - restdim[-dir], 0.0); diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index 6a72d2c443..0a76fcdb24 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -15,7 +15,6 @@ #include "rhythmic-head.hh" #include "music.hh" - class Rest_engraver : public Engraver { Music *rest_event_; @@ -48,7 +47,6 @@ Rest_engraver::start_translation_timestep () dot_ = 0; } - void Rest_engraver::process_music () { diff --git a/lily/rest.cc b/lily/rest.cc index fa9fdb1660..efeb00b41b 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -28,9 +28,7 @@ Rest::after_line_breaking (SCM smob) if (lc % 2) { if (bt == 0 && lc > 1) - { - me->translate_axis (ss, Y_AXIS); - } + me->translate_axis (ss, Y_AXIS); } else { diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index 492b94d6ea..17dcfa2075 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -49,8 +49,8 @@ class Rhythmic_column_engraver : public Engraver Grob *last_spacing_; Grob *spacing_; - void add_spacing_item (Grob*); - + void add_spacing_item (Grob *); + TRANSLATOR_DECLARATIONS (Rhythmic_column_engraver); protected: @@ -113,9 +113,7 @@ Rhythmic_column_engraver::process_acknowledged () { if (dotcol_ && !dotcol_->get_parent (X_AXIS)) - { - Note_column::set_dotcol (note_column_, dotcol_); - } + Note_column::set_dotcol (note_column_, dotcol_); if (stem_ && !stem_->get_parent (X_AXIS)) @@ -129,7 +127,7 @@ Rhythmic_column_engraver::process_acknowledged () void Rhythmic_column_engraver::acknowledge_stem (Grob_info i) { - stem_ = i.grob(); + stem_ = i.grob (); } void @@ -159,7 +157,6 @@ Rhythmic_column_engraver::stop_translation_timestep () stem_ = 0; } - ADD_ACKNOWLEDGER (Rhythmic_column_engraver, dot_column); ADD_ACKNOWLEDGER (Rhythmic_column_engraver, stem); ADD_ACKNOWLEDGER (Rhythmic_column_engraver, rhythmic_head); diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index 91a4795bf8..b68af1d4ee 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -13,7 +13,7 @@ #include "ly-smobs.icc" -using namespace std; +using namespace std; /* Return: number of objects. diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 5fb7d198e1..d8bbe720e8 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -39,12 +39,11 @@ Score_engraver::derived_mark () const Engraver_group_engraver::derived_mark (); } - void Score_engraver::prepare (Moment m) { (void) m; - + precomputed_recurse_over_translators (context (), START_TRANSLATION_TIMESTEP, DOWN); } @@ -77,15 +76,15 @@ Score_engraver::initialize () } pscore_ = new Paper_score (dynamic_cast (context ()->get_output_def ())); - pscore_->unprotect (); + pscore_->unprotect (); SCM props = updated_grob_properties (context (), ly_symbol2scm ("System")); Object_key const *sys_key = context ()->get_grob_key ("System"); pscore_->typeset_system (new System (props, sys_key)); system_ = pscore_->root_system (); - context ()->set_property ("rootSystem", system_->self_scm ()); - + context ()->set_property ("rootSystem", system_->self_scm ()); + Engraver_group_engraver::initialize (); } @@ -138,20 +137,17 @@ Score_engraver::get_output () return o->self_scm (); } - /* UGH UGH - */ +*/ void Score_engraver::forbid_breaks () { for (SCM s = simple_trans_list_; scm_is_pair (s); s = scm_cdr (s)) { Translator *tr = unsmob_translator (scm_car (s)); - if (Paper_column_engraver* pce = dynamic_cast (tr)) - { - pce->forbid_breaks (); - } + if (Paper_column_engraver *pce = dynamic_cast (tr)) + pce->forbid_breaks (); } } @@ -165,15 +161,15 @@ Score_engraver::try_music (Music *m) } ADD_TRANSLATOR_GROUP (Score_engraver, - /* doc */ "Top level engraver. Takes care of generating columns and the complete system (ie. System) " - "\n\n " - "This engraver decides whether a column is breakable. The default is " - "that a column is always breakable. However, when every Bar_engraver " - "that does not have a barline at a certain point will call " - "Score_engraver::forbid_breaks to stop linebreaks. In practice, this " - "means that you can make a breakpoint by creating a barline (assuming " - "that there are no beams or notes that prevent a breakpoint.) ", - /* create */ "System PaperColumn NonMusicalPaperColumn", - /* accept */ "break-event", - /* read */ "currentMusicalColumn currentCommandColumn verticallySpacedContexts", - /* write */ ""); + /* doc */ "Top level engraver. Takes care of generating columns and the complete system (ie. System) " + "\n\n " + "This engraver decides whether a column is breakable. The default is " + "that a column is always breakable. However, when every Bar_engraver " + "that does not have a barline at a certain point will call " + "Score_engraver::forbid_breaks to stop linebreaks. In practice, this " + "means that you can make a breakpoint by creating a barline (assuming " + "that there are no beams or notes that prevent a breakpoint.) ", + /* create */ "System PaperColumn NonMusicalPaperColumn", + /* accept */ "break-event", + /* read */ "currentMusicalColumn currentCommandColumn verticallySpacedContexts", + /* write */ ""); diff --git a/lily/score-performer.cc b/lily/score-performer.cc index 9878686c6a..6392a52147 100644 --- a/lily/score-performer.cc +++ b/lily/score-performer.cc @@ -19,11 +19,11 @@ #include "context.hh" ADD_TRANSLATOR_GROUP (Score_performer, - /* doc */ "", - /* create */ "", - /* accept */ "", - /* read */ "", - /* write */ ""); + /* doc */ "", + /* create */ "", + /* accept */ "", + /* read */ "", + /* write */ ""); Score_performer::Score_performer () { diff --git a/lily/score-scheme.cc b/lily/score-scheme.cc index df8b920956..ae8d014470 100644 --- a/lily/score-scheme.cc +++ b/lily/score-scheme.cc @@ -13,7 +13,6 @@ #include "global-context.hh" #include "lilypond-key.hh" - LY_DEFINE (ly_make_score, "ly:make-score", 1, 0, 0, (SCM music), @@ -21,7 +20,7 @@ LY_DEFINE (ly_make_score, "ly:make-score", { Music *mus = unsmob_music (music); SCM_ASSERT_TYPE (mus, music, SCM_ARG1, __FUNCTION__, "music"); - + Score *score = new Score; score->set_music (music); @@ -88,7 +87,7 @@ LY_DEFINE (ly_score_process, "ly:score-process", default_header, SCM_ARG3, __FUNCTION__, "\\paper block"); SCM_ASSERT_TYPE (unsmob_output_def (default_layout), default_header, SCM_ARG4, __FUNCTION__, "\\layout block"); - + Object_key *key = new Lilypond_general_key (0, score->user_key_, 0); if (score->error_found_) @@ -97,7 +96,7 @@ LY_DEFINE (ly_score_process, "ly:score-process", SCM header = ly_is_module (score->header_) ? score->header_ : default_header; - + for (int i = 0; i < score->defs_.size (); i++) default_rendering (score->get_music (), score->defs_[i]->self_scm (), default_paper, header, basename, key->self_scm ()); @@ -114,4 +113,3 @@ LY_DEFINE (ly_score_process, "ly:score-process", return SCM_UNSPECIFIED; } - diff --git a/lily/score.cc b/lily/score.cc index c3fcf3ae6f..75935f57ef 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -22,7 +22,6 @@ #include "paper-score.hh" #include "warn.hh" - #include "music.hh" #include "ly-smobs.icc" @@ -76,16 +75,15 @@ Score::Score (Score const &s) Music *m = unsmob_music (s.music_); if (m) { - Music *mclone = m->clone (); + Music *mclone = m->clone (); music_ = mclone->unprotect (); } else music_ = SCM_EOL; - for (int i = 0, n = s.defs_.size (); i < n; i++) { - Output_def * copy = s.defs_[i]->clone (); + Output_def *copy = s.defs_[i]->clone (); defs_.push (copy); copy->unprotect (); } @@ -118,18 +116,18 @@ default_rendering (SCM music, SCM outdef, def->parent_ = bdef; scaled_def = def->self_scm (); - scaled_bookdef = bdef->self_scm(); + scaled_bookdef = bdef->self_scm (); - def->unprotect(); - bdef->unprotect (); + def->unprotect (); + bdef->unprotect (); } SCM context = ly_run_translator (music, scaled_def, key); SCM output_as_scm = ly_format_output (context); Music_output *output = unsmob_music_output (output_as_scm); - - if (Paper_score *pscore = dynamic_cast (output)) + + if (Paper_score *pscore = dynamic_cast (output)) { /* ugh, this is strange, Paper_book without a Book object. */ Paper_book *paper_book = new Paper_book (); @@ -152,7 +150,7 @@ default_rendering (SCM music, SCM outdef, } /* - Format score, return list of Music_output objects. + Format score, return list of Music_output objects. LAYOUTBOOK should be scaled already. */ @@ -172,7 +170,7 @@ Score::book_rendering (Output_def *layoutbook, SCM outputs = SCM_EOL; SCM *tail = &outputs; - + int outdef_count = defs_.size (); Object_key *key = new Lilypond_general_key (book_key, user_key_, 0); @@ -196,9 +194,9 @@ Score::book_rendering (Output_def *layoutbook, if (dynamic_cast (unsmob_context (context))) { SCM s = ly_format_output (context); - + *tail = scm_cons (s, SCM_EOL); - tail = SCM_CDRLOC(*tail); + tail = SCM_CDRLOC (*tail); } scm_remember_upto_here_1 (scaled); diff --git a/lily/script-column-engraver.cc b/lily/script-column-engraver.cc index 101a3206ad..0b6253c4c7 100644 --- a/lily/script-column-engraver.cc +++ b/lily/script-column-engraver.cc @@ -12,7 +12,6 @@ #include "translator.icc" - /** Find potentially colliding scripts, and put them in a Script_column, that will fix the collisions. */ @@ -49,9 +48,7 @@ Script_column_engraver::acknowledge_side_position (Grob_info inf) { if (!Item::is_breakable (thing) && Side_position_interface::get_axis (inf.grob ()) == Y_AXIS) - { - scripts_.push (thing); - } + scripts_.push (thing); } } diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 87e6d72023..ff0ebcc914 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -42,10 +42,10 @@ protected: void stop_translation_timestep (); void process_music (); - DECLARE_ACKNOWLEDGER ( slur); - DECLARE_ACKNOWLEDGER ( rhythmic_head); - DECLARE_ACKNOWLEDGER ( stem); - DECLARE_ACKNOWLEDGER ( note_column); + DECLARE_ACKNOWLEDGER (slur); + DECLARE_ACKNOWLEDGER (rhythmic_head); + DECLARE_ACKNOWLEDGER (stem); + DECLARE_ACKNOWLEDGER (note_column); public: TRANSLATOR_DECLARATIONS (Script_engraver); @@ -151,8 +151,8 @@ void make_script_from_event (Grob *p, bool *follow, Context *tg, void Script_engraver::process_music () { - for (int i = 0; i < scripts_.size(); i++) - { + for (int i = 0; i < scripts_.size (); i++) + { Music *m = scripts_[i].event_; Grob *p = make_item ("Script", m->self_scm ()); @@ -169,7 +169,6 @@ Script_engraver::process_music () } } - void Script_engraver::acknowledge_stem (Grob_info info) { @@ -190,9 +189,9 @@ Script_engraver::acknowledge_stem (Grob_info info) void Script_engraver::acknowledge_rhythmic_head (Grob_info info) { - if(info.music_cause ()) + if (info.music_cause ()) { - for (int i = 0; i < scripts_.size(); i++) + for (int i = 0; i < scripts_.size (); i++) { Grob *e = scripts_[i].script_; @@ -216,8 +215,8 @@ Script_engraver::acknowledge_note_column (Grob_info info) As the note head to put it on is not known now, postpone this decision to Script_interface::before_line_breaking (). */ - - for (int i = 0; i < scripts_.size(); i++) + + for (int i = 0; i < scripts_.size (); i++) { Grob *e = scripts_[i].script_; @@ -226,7 +225,7 @@ Script_engraver::acknowledge_note_column (Grob_info info) e->set_parent (info.grob (), X_AXIS); } } - + void Script_engraver::acknowledge_slur (Grob_info info) { diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index d112fa3621..baf2ea14ae 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -84,9 +84,9 @@ Separating_group_spanner::set_spacing_rods (SCM smob) extract_grob_set (me, "elements", elts); for (int i = elts.size (); - i-- > 1; ) + i-- > 1;) { - Item *r = dynamic_cast (elts[i]); + Item *r = dynamic_cast (elts[i]); if (!r) continue; diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index b632bdf1b9..759e8849d8 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -146,7 +146,7 @@ Separating_line_group_engraver::acknowledge_item (Grob_info i) { Item *it = make_item ("StaffSpacing", SCM_EOL); current_spacings_.staff_spacing_ = it; - Pointer_group_interface::add_grob (it, ly_symbol2scm ("left-items"), + Pointer_group_interface::add_grob (it, ly_symbol2scm ("left-items"), break_item_); if (int i = last_spacings_.note_spacings_.size ()) @@ -159,7 +159,7 @@ Separating_line_group_engraver::acknowledge_item (Grob_info i) else if (last_spacings_.staff_spacing_) { SCM ri = last_spacings_.staff_spacing_->get_object ("right-items"); - Grob_array *ga = unsmob_grob_array (ri); + Grob_array *ga = unsmob_grob_array (ri); if (!ga) { SCM ga_scm = Grob_array::make_array (); diff --git a/lily/separation-item.cc b/lily/separation-item.cc index b990ad61fb..fce28831cc 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -41,7 +41,7 @@ Separation_item::conditional_width (Grob *me, Grob *left) extract_grob_set (me, "conditional-elements", elts); for (int i = 0; i < elts.size (); i++) { - Item *il = dynamic_cast (elts[i]); + Item *il = dynamic_cast (elts[i]); if (pc != il->get_column ()) { /* this shouldn't happen, but let's continue anyway. */ @@ -50,14 +50,10 @@ Separation_item::conditional_width (Grob *me, Grob *left) } if (to_boolean (il->get_property ("no-spacing-rods"))) - { - continue; - } + continue; if (Accidental_placement::has_interface (il)) - { - w.unite (Accidental_placement::get_relevant_accidental_extent (il, pc, left)); - } + w.unite (Accidental_placement::get_relevant_accidental_extent (il, pc, left)); } SCM pad = me->get_property ("padding"); @@ -82,7 +78,7 @@ Separation_item::width (Grob *me) extract_grob_set (me, "elements", elts); for (int i = 0; i < elts.size (); i++) { - Item *il = dynamic_cast (elts[i]); + Item *il = dynamic_cast (elts[i]); if (pc != il->get_column ()) { /* this shouldn't happen, but let's continue anyway. */ @@ -91,15 +87,11 @@ Separation_item::width (Grob *me) } if (to_boolean (il->get_property ("no-spacing-rods"))) - { - continue; - } + continue; Interval iv (il->extent (pc, X_AXIS)); if (!iv.is_empty ()) - { - w.unite (iv); - } + w.unite (iv); } SCM pad = me->get_property ("padding"); @@ -131,9 +123,9 @@ Separation_item::extremal_break_aligned_grob (Grob *me, Grob *col = dynamic_cast (me)->get_column (); last_ext->set_empty (); Grob *last_grob = 0; - + extract_grob_set (me, "elements", elts); - for (int i = elts.size (); i--; ) + for (int i = elts.size (); i--;) { Grob *break_item = elts[i]; if (!scm_is_symbol (break_item->get_property ("break-align-symbol"))) diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 0801a4f76b..a4dc76cf8e 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -11,7 +11,6 @@ #include // ceil. #include - #include "note-head.hh" #include "warn.hh" #include "warn.hh" @@ -268,5 +267,4 @@ ADD_INTERFACE (Side_position_interface, "side-position-interface", "side-relative-direction " "side-support-elements " "slur-padding " - "staff-padding " - ); + "staff-padding "); diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index 9138e4544a..10758ff5bb 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -364,7 +364,7 @@ Simple_spacer::add_spring (Real ideal, Real inverse_hooke) /* desc.is_active_ ? */ - desc.block_force_ = - desc.ideal_ / desc.inverse_hooke_; + desc.block_force_ = -desc.ideal_ / desc.inverse_hooke_; // block at distance 0 active_count_++; @@ -383,9 +383,9 @@ void Simple_spacer_wrapper::add_columns (Link_array const &icols) { Link_array cols (icols); - cols.clear(); - - for (int i = 0; i < icols.size (); i++) + cols.clear (); + + for (int i = 0; i < icols.size (); i++) if (scm_is_pair (icols[i]->get_object ("between-cols"))) { loose_cols_.push (icols[i]); @@ -394,7 +394,7 @@ Simple_spacer_wrapper::add_columns (Link_array const &icols) { cols.push (icols[i]); } - + spaced_cols_ = cols; for (int i = 0; i < cols.size () - 1; i++) { @@ -428,9 +428,7 @@ Simple_spacer_wrapper::add_columns (Link_array const &icols) Grob *other = unsmob_grob (scm_caar (s)); int j = binsearch_links (cols, other, &compare_paper_column_rank); if (j >= 0 && cols[j] == other) - { - spacer_->add_rod (i, j, scm_to_double (scm_cdar (s))); - } + spacer_->add_rod (i, j, scm_to_double (scm_cdar (s))); } if (i diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc index 2d7c66c031..7c60c4f690 100644 --- a/lily/simultaneous-music-iterator.cc +++ b/lily/simultaneous-music-iterator.cc @@ -67,9 +67,7 @@ Simultaneous_music_iterator::construct_children () tail = SCM_CDRLOC (*tail); } else - { - mi->quit (); - } + mi->quit (); } } @@ -82,18 +80,14 @@ Simultaneous_music_iterator::process (Moment until) Music_iterator *i = unsmob_iterator (scm_car (*proc)); if (i->run_always () || i->pending_moment () == until) - { - i->process (until); - } + i->process (until); if (!i->ok ()) { i->quit (); *proc = scm_cdr (*proc); } else - { - proc = SCM_CDRLOC (*proc); - } + proc = SCM_CDRLOC (*proc); } } diff --git a/lily/skyline.cc b/lily/skyline.cc index 455ebb2b9b..41aaa19039 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -158,13 +158,9 @@ skyline_meshing_distance (Array const &buildings, distance = max (distance, (buildings[i].height_ - clouds[j].height_)); if (i > 0 && buildings[i].width_[LEFT] >= clouds[j].width_[LEFT]) - { - i--; - } + i--; else if (j > 0 && buildings[i].width_[LEFT] <= clouds[j].width_[LEFT]) - { - j--; - } + j--; } return distance; diff --git a/lily/slash-repeat-engraver.cc b/lily/slash-repeat-engraver.cc index 014843619a..01099b1f7b 100644 --- a/lily/slash-repeat-engraver.cc +++ b/lily/slash-repeat-engraver.cc @@ -75,9 +75,7 @@ Slash_repeat_engraver::try_music (Music *m) Moment meas_length = robust_scm2moment (get_property ("measureLength"), Moment (0)); if (body_length_ < meas_length) - { - repeat_ = m; - } + repeat_ = m; else return false; @@ -113,7 +111,6 @@ Slash_repeat_engraver::start_translation_timestep () beat_slash_ = 0; } - #include "translator.icc" ADD_TRANSLATOR (Slash_repeat_engraver, diff --git a/lily/slur-configuration.cc b/lily/slur-configuration.cc index 0cc546582b..937a4fb02a 100644 --- a/lily/slur-configuration.cc +++ b/lily/slur-configuration.cc @@ -87,9 +87,7 @@ fit_factor (Offset dz_unit, Offset dz_perp, Real y = curve.get_other_coordinate (X_AXIS, p[X_AXIS]); if (y) - { - fit_factor = max (fit_factor, (p[Y_AXIS] / y)); - } + fit_factor = max (fit_factor, (p[Y_AXIS] / y)); } return fit_factor; } @@ -97,8 +95,7 @@ fit_factor (Offset dz_unit, Offset dz_perp, void Slur_configuration::generate_curve (Slur_score_state const &state, Real r_0, Real h_inf, - Array const &avoid - ) + Array const &avoid) { Offset dz = attachment_[RIGHT]- attachment_[LEFT];; Offset dz_unit = dz; @@ -286,7 +283,7 @@ Slur_configuration::score_encompass (Slur_score_state const &state) variance_penalty = state.parameters_.head_slur_distance_max_ratio_; if (min_dist > 0.0) variance_penalty - = min ((avg_distance / (min_dist + state.parameters_.absolute_closeness_measure_) - 1.0), variance_penalty); + = min ((avg_distance / (min_dist + state.parameters_.absolute_closeness_measure_) - 1.0), variance_penalty); variance_penalty = max (variance_penalty, 0.0); variance_penalty *= state.parameters_.head_slur_distance_factor_; diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index cb707e300d..2b9f9d7ddc 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -205,13 +205,13 @@ Slur_engraver::stop_translation_timestep () #include "translator.icc" -ADD_ACKNOWLEDGER (Slur_engraver,accidental); -ADD_ACKNOWLEDGER (Slur_engraver,dynamic_line_spanner); -ADD_ACKNOWLEDGER (Slur_engraver,fingering) -ADD_ACKNOWLEDGER (Slur_engraver,note_column); -ADD_ACKNOWLEDGER (Slur_engraver,script); -ADD_ACKNOWLEDGER (Slur_engraver,text_script); -ADD_ACKNOWLEDGER (Slur_engraver,tie); +ADD_ACKNOWLEDGER (Slur_engraver, accidental); +ADD_ACKNOWLEDGER (Slur_engraver, dynamic_line_spanner); +ADD_ACKNOWLEDGER (Slur_engraver, fingering) + ADD_ACKNOWLEDGER (Slur_engraver, note_column); +ADD_ACKNOWLEDGER (Slur_engraver, script); +ADD_ACKNOWLEDGER (Slur_engraver, text_script); +ADD_ACKNOWLEDGER (Slur_engraver, tie); ADD_TRANSLATOR (Slur_engraver, /* doc */ "Build slur grobs from slur events", /* create */ "Slur", diff --git a/lily/slur-performer.cc b/lily/slur-performer.cc index babb66ec62..b51dc55556 100644 --- a/lily/slur-performer.cc +++ b/lily/slur-performer.cc @@ -77,13 +77,9 @@ Slur_performer::try_music (Music *m) Direction d = to_dir (m->get_property ("span-direction")); if (d == START) - { - start_ev_ = m; - } + start_ev_ = m; else if (d == STOP) - { - now_stop_ev_ = m; - } + now_stop_ev_ = m; return true; } return false; diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index d25b72a35e..2595521ed0 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -249,19 +249,17 @@ Slur_score_state::get_bound_info () const do not issue warning. This happens for rests and whole notes. */ - s = Interval (0,0) + s = Interval (0, 0) + extremes[d].stem_->relative_coordinate (common_[ax], ax); } - extremes[d].stem_extent_[ax] = s; + extremes[d].stem_extent_[ax] = s; } - + extremes[d].slur_head_ = Stem::extremal_heads (extremes[d].stem_)[dir]; if (!extremes[d].slur_head_ && Note_column::has_rests (extremes[d].bound_)) - { - extremes[d].slur_head_ = Note_column::get_rest (extremes[d].bound_); - } + extremes[d].slur_head_ = Note_column::get_rest (extremes[d].bound_); if (extremes[d].slur_head_) extremes[d].slur_head_extent_ @@ -416,9 +414,7 @@ Slur_score_state::get_best_curve () #endif { for (int i = 0; i < configurations_.size (); i++) - { - configurations_[i]->score (*this); - } + configurations_[i]->score (*this); for (int i = 0; i < configurations_.size (); i++) { if (configurations_[i]->score_ < opt) @@ -554,13 +550,9 @@ Slur_score_state::get_base_attachments () const { Real x, y; if (d == RIGHT) - { - x = extremes_[d].bound_->extent (common_[X_AXIS], X_AXIS)[d]; - } + x = extremes_[d].bound_->extent (common_[X_AXIS], X_AXIS)[d]; else - { - x = slur_->get_broken_left_end_align (); - } + x = slur_->get_broken_left_end_align (); Grob *col = (d == LEFT) ? columns_[0] : columns_.top (); if (extremes_[-d].bound_ != col) @@ -583,7 +575,6 @@ Slur_score_state::get_base_attachments () const } while (flip (&d) != LEFT); - do { for (int a = X_AXIS; a < NO_AXES; a++) @@ -595,12 +586,10 @@ Slur_score_state::get_base_attachments () const programming_error ("slur attachment is inf/nan"); b = 0.0; } - } } while (flip (&d) != LEFT); - - + return base_attachment; } @@ -608,13 +597,13 @@ Real Slur_score_state::move_away_from_staffline (Real y, Grob *on_staff) const { - Grob * staff_symbol = Staff_symbol_referencer::get_staff_symbol (on_staff); + Grob *staff_symbol = Staff_symbol_referencer::get_staff_symbol (on_staff); if (!staff_symbol) return y; - + Real pos = (y - staff_symbol->relative_coordinate (common_[Y_AXIS], - Y_AXIS)) + Y_AXIS)) * 2.0 / staff_space_; if (fabs (pos - my_round (pos)) < 0.2 @@ -626,7 +615,6 @@ Slur_score_state::move_away_from_staffline (Real y, } - Array Slur_score_state::generate_avoid_offsets () const { @@ -644,7 +632,7 @@ Slur_score_state::generate_avoid_offsets () const avoid.push (Offset (inf.x_, y + dir_ * parameters_.free_head_distance_)); } - + extract_grob_set (slur_, "encompass-objects", extra_encompasses); for (int i = 0; i < extra_encompasses.size (); i++) if (Slur::has_interface (extra_encompasses[i])) @@ -669,7 +657,7 @@ Slur_score_state::generate_curves () const Real r_0 = robust_scm2double (slur_->get_property ("ratio"), 0.33); Real h_inf = staff_space_ * scm_to_double (slur_->get_property ("height-limit")); - Array avoid = generate_avoid_offsets (); + Array avoid = generate_avoid_offsets (); for (int i = 0; i < configurations_.size (); i++) configurations_[i]->generate_curve (*this, r_0, h_inf, avoid); } diff --git a/lily/slur.cc b/lily/slur.cc index 11b340ff5f..9956bea231 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -217,7 +217,6 @@ Slur::outside_slur_callback (SCM grob, SCM axis) return scm_from_double (offset); } - MAKE_SCHEME_CALLBACK (Slur, after_line_breaking, 1); SCM Slur::after_line_breaking (SCM smob) diff --git a/lily/smobs.cc b/lily/smobs.cc index 63d36f23a5..e2ec5d5638 100644 --- a/lily/smobs.cc +++ b/lily/smobs.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "smobs.hh" @@ -12,12 +11,12 @@ static SCM smob_protection_list; void -init_smob_protection() +init_smob_protection () { smob_protection_list = scm_cons (SCM_UNDEFINED, SCM_EOL); scm_permanent_object (smob_protection_list); } -ADD_SCM_INIT_FUNC(init_smob_protection, init_smob_protection); +ADD_SCM_INIT_FUNC (init_smob_protection, init_smob_protection); void protect_smob (SCM smob, SCM *prot_cons) @@ -49,9 +48,7 @@ unprotect_smob (SCM *prot_cons) while (scm_is_pair (next) && scm_car (next) == SCM_UNDEFINED) - { - next = scm_cdr (next); - } + next = scm_cdr (next); scm_set_cdr_x (*prot_cons, next); } diff --git a/lily/source-file.cc b/lily/source-file.cc index dee8a9e3c5..fe152dc226 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -146,16 +146,15 @@ Source_file::file_line_column_string (char const *context_str0) const { int l, ch, col; get_counts (context_str0, &l, &ch, &col); - + return name_string () + ":" + to_string (l) + ":" + to_string (col); } } - String -Source_file::quote_input (char const* pos_str0) const +Source_file::quote_input (char const *pos_str0) const { if (!contains (pos_str0)) return " (" + _ ("position unknown") + ")"; @@ -224,7 +223,6 @@ Source_file::line_string (char const* pos_str0) const return String ((Byte const *)data_str0 + line[LEFT], line.length ()); } - void Source_file::get_counts (char const *pos_str0, int *line_number, @@ -235,18 +233,18 @@ Source_file::get_counts (char const *pos_str0, return; *line_number = get_line (pos_str0); - + Slice line = line_slice (pos_str0); char const *data = to_str0 (); Byte const *line_start = (Byte const *)data + line[LEFT]; - int left = (Byte const*) pos_str0 - line_start; + int left = (Byte const *) pos_str0 - line_start; String line_begin (line_start, left); - char const *line_chars = line_begin.to_str0(); - + char const *line_chars = line_begin.to_str0 (); + *column = 0; *line_char = 0; - + mbstate_t state; /* Initialize the state. */ @@ -260,13 +258,13 @@ Source_file::get_counts (char const *pos_str0, FIXME, this is apparently locale dependent. */ size_t thislen = mbrtowc (multibyte, line_chars, left, &state); - + /* Stop converting at invalid character; this can mean we have read just the first part of a valid character. */ if (thislen == (size_t) -1) break; - + /* We want to handle embedded NUL bytes but the return value is 0. Correct this. */ if (thislen == 0) @@ -285,31 +283,31 @@ Source_file::get_counts (char const *pos_str0, } bool -Source_file::contains (char const* pos_str0) const +Source_file::contains (char const *pos_str0) const { return (pos_str0 && (pos_str0 >= to_str0 ()) && (pos_str0 <= to_str0 () + length ())); } int -Source_file::get_line (char const* pos_str0) const +Source_file::get_line (char const *pos_str0) const { if (!contains (pos_str0)) return 0; if (!newline_locations_.size ()) return 1; - + int lo = 0; int hi = newline_locations_.size (); if (newline_locations_[lo] > pos_str0) return 1; - - if (newline_locations_[hi-1] < pos_str0) + + if (newline_locations_[hi - 1] < pos_str0) return hi; - + binary_search_bounds (newline_locations_, - pos_str0, + pos_str0, Link_array::default_compare, &lo, &hi); @@ -376,5 +374,5 @@ Source_file::get_string (int n) SCM Source_file::get_port () const { - return str_port_; + return str_port_; } diff --git a/lily/spaceable-grob.cc b/lily/spaceable-grob.cc index 79b4173efd..f3a4891483 100644 --- a/lily/spaceable-grob.cc +++ b/lily/spaceable-grob.cc @@ -31,7 +31,7 @@ Spaceable_grob::add_rod (Grob *me, Grob *p, Real d) // printf ("rod %lf\n", d); if (d < 0) return; - + if (isinf (d)) programming_error ("infinite rod"); @@ -52,7 +52,7 @@ Spaceable_grob::add_rod (Grob *me, Grob *p, Real d) { programming_error ("Adding reverse rod"); } - + mins = scm_cons (scm_cons (p->self_scm (), newdist), mins); me->set_object ("minimum-distances", mins); } @@ -114,7 +114,6 @@ Spaceable_grob::get_spring (Grob *me, Grob *other, Real *dist, Real *inv_strengt } } - void Spaceable_grob::remove_interface (Grob *me) { diff --git a/lily/spacing-basic.cc b/lily/spacing-basic.cc index 49453e8494..f5753f948a 100644 --- a/lily/spacing-basic.cc +++ b/lily/spacing-basic.cc @@ -1,10 +1,9 @@ /* spacing-basic.cc -- implement Spacing_spanner, simplistic spacing routines - + source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "spacing-spanner.hh" @@ -14,14 +13,13 @@ #include "warn.hh" /* - LilyPond spaces by taking a simple-minded spacing algorithm, and - adding subtle adjustments to that. This file does the simple-minded - spacing routines. + LilyPond spaces by taking a simple-minded spacing algorithm, and + adding subtle adjustments to that. This file does the simple-minded + spacing routines. */ - /* - Get the measure wide ant for arithmetic spacing. + Get the measure wide ant for arithmetic spacing. */ Real Spacing_options::get_duration_space (Moment d, @@ -67,7 +65,6 @@ Spacing_options::get_duration_space (Moment d, } } - /* The one-size-fits all spacing. It doesn't take into account different spacing wishes from one to the next column. @@ -129,7 +126,7 @@ Spacing_spanner::standard_breakable_column_spacing (Grob *me, Item *l, Item *r, Real Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc, - Spacing_options const *options , + Spacing_options const *options, bool *expand_only) { Moment shortest_playing_len = 0; @@ -173,7 +170,7 @@ Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc, if (delta_t.main_part_ && !lwhen.grace_part_) { dist = options->get_duration_space (shortest_playing_len, - expand_only); + expand_only); dist *= double (delta_t.main_part_ / shortest_playing_len.main_part_); } else if (delta_t.grace_part_) @@ -194,7 +191,6 @@ Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc, return dist; } - /****************************************************************/ void @@ -209,7 +205,6 @@ Spacing_options::init_from_grob (Grob *me) shortest_duration_space_ = robust_scm2double (me->get_property ("shortest-duration-space"), 1); } - void Spacing_options::init () { @@ -219,5 +214,5 @@ Spacing_options::init () float_nonmusical_columns_ = false; shortest_duration_space_ = 2.0; - global_shortest_ = Rational (1,8); + global_shortest_ = Rational (1, 8); } diff --git a/lily/spacing-determine-loose-columns.cc b/lily/spacing-determine-loose-columns.cc index f406425c3d..2565d61adb 100644 --- a/lily/spacing-determine-loose-columns.cc +++ b/lily/spacing-determine-loose-columns.cc @@ -5,7 +5,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "staff-spacing.hh" @@ -40,10 +39,10 @@ is_loose_column (Grob *l, Grob *c, Grob *r, Spacing_options const *options) if (Paper_column::is_musical (c) || Item::is_breakable (c)) return false; - + extract_grob_set (c, "right-neighbors", rns); extract_grob_set (c, "left-neighbors", lns); - + /* If this column doesn't have a proper neighbor, we should really make it loose, but spacing it correctly is more than we can @@ -101,13 +100,13 @@ is_loose_column (Grob *l, Grob *c, Grob *r, Spacing_options const *options) in any case, we don't want to move bar lines. */ extract_grob_set (c, "elements", elts); - for (int i = elts.size (); i--; ) + for (int i = elts.size (); i--;) { Grob *g = elts[i]; if (g && Break_align_interface::has_interface (g)) { extract_grob_set (g, "elements", gelts); - for (int j = gelts.size (); j--; ) + for (int j = gelts.size (); j--;) { Grob *h = gelts[j]; @@ -133,23 +132,22 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array *cols, Spacing_options const *options) { Link_array newcols; - + for (int i = 0; i < cols->size (); i++) { Grob *c = cols->elem (i); - bool loose = (i > 0 && i < cols->size()-1) + bool loose = (i > 0 && i < cols->size () - 1) && is_loose_column (cols->elem (i - 1), c, cols->elem (i + 1), options); - - + if (loose) { extract_grob_set (c, "right-neighbors", rns_arr); extract_grob_set (c, "left-neighbors", lns_arr); - - SCM lns = lns_arr.size () ? lns_arr.top()->self_scm () : SCM_BOOL_F; - SCM rns = rns_arr.size () ? rns_arr.top()->self_scm () : SCM_BOOL_F; - + + SCM lns = lns_arr.size () ? lns_arr.top ()->self_scm () : SCM_BOOL_F; + SCM rns = rns_arr.size () ? rns_arr.top ()->self_scm () : SCM_BOOL_F; + /* Either object can be non existent, if the score ends prematurely. @@ -175,7 +173,7 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array *cols, Item *rc = dynamic_cast (d == LEFT ? c : next_door[RIGHT]); extract_grob_set (lc, "spacing-wishes", wishes); - for (int k = wishes.size(); k--;) + for (int k = wishes.size (); k--;) { Grob *sp = wishes[k]; if (Note_spacing::left_column (sp) != lc @@ -224,9 +222,7 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array *cols, r.add_to_cols (); } else - { - newcols.push (c); - } + newcols.push (c); } *cols = newcols; @@ -245,9 +241,9 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array const &cols) int min_rank = 100000; // inf. extract_grob_set (cols[i], "spacing-wishes", wishes); - for (int k = wishes.size(); k--;) + for (int k = wishes.size (); k--;) { - Item *wish = dynamic_cast ( wishes[k]); + Item *wish = dynamic_cast (wishes[k]); Item *lc = wish->get_column (); Grob *right = Note_spacing::right_column (wish); @@ -280,13 +276,13 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array const &cols) extract_grob_set (rc, "left-neighbors", lns_arr); if (lns_arr.size ()) { - Item *it = dynamic_cast (lns_arr.top()); + Item *it = dynamic_cast (lns_arr.top ()); maxrank = Paper_column::get_rank (it->get_column ()); } if (left_rank >= maxrank) { - + if (left_rank > maxrank) { Grob_array *ga = unsmob_grob_array (rc->get_object ("left-neighbors")); @@ -324,19 +320,19 @@ Spacing_spanner::set_implicit_neighbor_columns (Link_array const &cols) sloppy with typing left/right-neighbors should take list, but paper-column found instead. */ extract_grob_set (cols[i], "left-neighbors", lns); - if (lns.is_empty () && i ) + if (lns.is_empty () && i) { - SCM ga_scm = Grob_array::make_array(); + SCM ga_scm = Grob_array::make_array (); Grob_array *ga = unsmob_grob_array (ga_scm); - ga->add (cols[i-1]); + ga->add (cols[i - 1]); cols[i]->set_object ("left-neighbors", ga_scm); } extract_grob_set (cols[i], "right-neighbors", rns); if (rns.is_empty () && i < cols.size () - 1) { - SCM ga_scm = Grob_array::make_array(); + SCM ga_scm = Grob_array::make_array (); Grob_array *ga = unsmob_grob_array (ga_scm); - ga->add (cols[i+1]); + ga->add (cols[i + 1]); cols[i]->set_object ("right-neighbors", ga_scm); } } diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index c29a904c02..3dee97aad9 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -32,13 +32,12 @@ struct Rhythmic_tuple static int time_compare (Rhythmic_tuple const &, Rhythmic_tuple const &); }; - /* TODO: allow starting & stopping of spacing regions. - */ +*/ /* - Acknowledge rhythmic elements, for initializing spacing fields in - the columns. + Acknowledge rhythmic elements, for initializing spacing fields in + the columns. */ class Spacing_engraver : public Engraver { @@ -49,12 +48,12 @@ class Spacing_engraver : public Engraver Spanner *spacing_; TRANSLATOR_DECLARATIONS (Spacing_engraver); - + protected: DECLARE_ACKNOWLEDGER (staff_spacing); DECLARE_ACKNOWLEDGER (note_spacing); DECLARE_ACKNOWLEDGER (rhythmic_head); - + void start_translation_timestep (); void stop_translation_timestep (); void process_music (); @@ -112,7 +111,7 @@ Spacing_engraver::acknowledge_staff_spacing (Grob_info i) { Pointer_group_interface::add_grob (spacing_, ly_symbol2scm ("wishes"), i.grob ()); } - + void Spacing_engraver::acknowledge_rhythmic_head (Grob_info i) { @@ -140,15 +139,15 @@ Spacing_engraver::stop_translation_timestep () { Paper_column *musical_column = dynamic_cast (unsmob_grob (get_property ("currentMusicalColumn"))); - + SCM proportional = get_property ("proportionalNotationDuration"); if (unsmob_moment (proportional)) { musical_column->set_property ("shortest-playing-duration", proportional); musical_column->set_property ("shortest-starter-duration", proportional); - return; + return; } - + Moment shortest_playing; shortest_playing.set_infinite (1); for (int i = 0; i < playing_durations_.size (); i++) @@ -176,7 +175,6 @@ Spacing_engraver::stop_translation_timestep () shortest_playing = min (shortest_playing, starter); - assert (starter.to_bool ()); SCM sh = shortest_playing.smobbed_copy (); SCM st = starter.smobbed_copy (); @@ -199,7 +197,7 @@ Spacing_engraver::start_translation_timestep () ADD_ACKNOWLEDGER (Spacing_engraver, staff_spacing); ADD_ACKNOWLEDGER (Spacing_engraver, note_spacing); ADD_ACKNOWLEDGER (Spacing_engraver, rhythmic_head); - + ADD_TRANSLATOR (Spacing_engraver, "make a SpacingSpanner and do " "bookkeeping of shortest starting and playing notes ", diff --git a/lily/spacing-loose-columns.cc b/lily/spacing-loose-columns.cc index 90e5736677..d27214c86e 100644 --- a/lily/spacing-loose-columns.cc +++ b/lily/spacing-loose-columns.cc @@ -6,7 +6,6 @@ (c) 2005 Han-Wen Nienhuys */ - #include "system.hh" #include "paper-column.hh" #include "column-x-positions.hh" @@ -24,7 +23,7 @@ set_loose_columns (System *which, Column_x_positions const *posns) { int loose_col_count = posns->loose_cols_.size (); if (!loose_col_count) - return; + return; Real default_padding = 1.0; for (int i = 0; i < loose_col_count; i++) @@ -60,7 +59,7 @@ set_loose_columns (System *which, Column_x_positions const *posns) clique.push (left); } - + clique.push (loose); divide_over++; @@ -73,9 +72,9 @@ set_loose_columns (System *which, Column_x_positions const *posns) clique.push (right); Grob *common = right->common_refpoint (left, X_AXIS); - Item *finished_right_column = clique.top(); - - for (int j = clique.size() - 2; j > 0; j--) + Item *finished_right_column = clique.top (); + + for (int j = clique.size () - 2; j > 0; j--) { int count = 0; Real total_space = 0.0; @@ -89,9 +88,7 @@ set_loose_columns (System *which, Column_x_positions const *posns) Real fixed = 0.0; if (Staff_spacing::has_interface (spacing)) - { - Staff_spacing::get_spacing_params (spacing, &space, &fixed); - } + Staff_spacing::get_spacing_params (spacing, &space, &fixed); else if (Note_spacing::has_interface (spacing)) { Spacing_options options; @@ -106,10 +103,8 @@ set_loose_columns (System *which, Column_x_positions const *posns) &space, &fixed); } else - { - continue; - } - + continue; + count++; total_space += space; @@ -117,7 +112,7 @@ set_loose_columns (System *which, Column_x_positions const *posns) } Real distance_to_next = 0.0; - Real right_point = 0.0; + Real right_point = 0.0; if (count) { total_space /= count; @@ -135,7 +130,7 @@ set_loose_columns (System *which, Column_x_positions const *posns) } Real my_offset = right_point - distance_to_next; - + col->system_ = which; col->translate_axis (my_offset - col->relative_coordinate (common, X_AXIS), X_AXIS); @@ -144,4 +139,3 @@ set_loose_columns (System *which, Column_x_positions const *posns) } } - diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 861522122e..2992c88593 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -24,7 +24,6 @@ #include "spacing-interface.hh" - Rational Spacing_spanner::effective_shortest_duration (Grob *me, Link_array const &all) { @@ -44,7 +43,6 @@ Spacing_spanner::effective_shortest_duration (Grob *me, Link_array const & return global_shortest; } - MAKE_SCHEME_CALLBACK (Spacing_spanner, set_springs, 1); SCM Spacing_spanner::set_springs (SCM smob) @@ -61,7 +59,7 @@ Spacing_spanner::set_springs (SCM smob) Spacing_options options; options.init_from_grob (me); options.global_shortest_ = effective_shortest_duration (me, all); - + prune_loose_columns (me, &all, &options); set_implicit_neighbor_columns (all); generate_springs (me, all, &options); @@ -170,14 +168,12 @@ Spacing_spanner::generate_pair_spacing (Grob *me, if (Paper_column::is_musical (left_col)) { bool skip_unbroken_right = false; - + if (!Paper_column::is_musical (right_col) && options->float_nonmusical_columns_ && after_right_col && Paper_column::is_musical (after_right_col)) - { - skip_unbroken_right = true; - } + skip_unbroken_right = true; if (skip_unbroken_right) { @@ -190,7 +186,6 @@ Spacing_spanner::generate_pair_spacing (Grob *me, } else musical_column_spacing (me, left_col, right_col, options); - if (Item *rb = right_col->find_prebroken_piece (LEFT)) musical_column_spacing (me, left_col, rb, options); @@ -207,7 +202,7 @@ Spacing_spanner::generate_pair_spacing (Grob *me, if (left_col && right_col) breakable_column_spacing (me, left_col, right_col, options); - + if (lb && right_col) breakable_column_spacing (me, lb, right_col, options); @@ -249,7 +244,7 @@ Spacing_spanner::musical_column_spacing (Grob *me, { bool expand_only = false; Real base_note_space = note_spacing (me, left_col, right_col, options, &expand_only); - + Real compound_note_space = 0.0; Real compound_fixed_note_space = 0.0; @@ -323,7 +318,7 @@ Spacing_spanner::musical_column_spacing (Grob *me, compound_fixed_note_space = min (compound_fixed_note_space, compound_note_space); } - + Real inverse_strength = 1.0; Real distance = 1.0; @@ -422,7 +417,7 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r, { compound_fixed = 0.0; } - + assert (!isinf (compound_space)); compound_space = max (compound_space, compound_fixed); @@ -449,11 +444,10 @@ ADD_INTERFACE (Spacing_spanner, "spacing-spanner-interface", "gets 2 note heads width (i.e. the space following a note is 1 note\n" "head width) A 16th note is followed by 0.5 note head width. The\n" "quarter note is followed by 3 NHW, the half by 4 NHW, etc.\n", - + "grace-space-factor spacing-increment base-shortest-duration strict-note-spacing " "shortest-duration-space common-shortest-duration uniform-stretching " "packed-spacing " - ); ADD_INTERFACE (Spacing_interface, "spacing-interface", diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc index 391ef6e4f6..cbf77b2673 100644 --- a/lily/span-arpeggio-engraver.cc +++ b/lily/span-arpeggio-engraver.cc @@ -76,12 +76,12 @@ Span_arpeggio_engraver::stop_translation_timestep () for (int j = 0; j < arpeggios_.size (); j++) { extract_grob_set (arpeggios_[j], "stems", stems); - for (int i = stems.size() ; i--;) + for (int i = stems.size (); i--;) Pointer_group_interface::add_grob (span_arpeggio_, ly_symbol2scm ("stems"), stems[i]); extract_grob_set (arpeggios_[j], "side-support-elements", sses); - for (int i = sses.size() ; i--;) + for (int i = sses.size (); i--;) Pointer_group_interface::add_grob (span_arpeggio_, ly_symbol2scm ("side-support-elements"), sses[i]); @@ -99,7 +99,7 @@ Span_arpeggio_engraver::stop_translation_timestep () #include "translator.icc" -ADD_ACKNOWLEDGER (Span_arpeggio_engraver,arpeggio); +ADD_ACKNOWLEDGER (Span_arpeggio_engraver, arpeggio); ADD_TRANSLATOR (Span_arpeggio_engraver, /* doc */ "", /* create */ "Arpeggio", diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 95bd6ae56e..c668844ce3 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -18,7 +18,6 @@ #include "grob.hh" #include "pointer-group-interface.hh" - void Span_bar::add_bar (Grob *me, Grob *b) { @@ -75,14 +74,14 @@ Span_bar::print (SCM smobbed_me) if (!model_bar) model_bar = me; - + extents.sort (&Interval::left_comparison); Stencil span_bar; - for (int i = 1; i < extents.size (); i ++) + for (int i = 1; i < extents.size (); i++) { - Interval prev_extent = extents[i-1]; - Interval ext = extents[i]; + Interval prev_extent = extents[i - 1]; + Interval ext = extents[i]; if (!prev_extent.is_empty ()) { Interval l (prev_extent [UP], @@ -106,7 +105,7 @@ Span_bar::print (SCM smobbed_me) } span_bar.translate_axis (- me->relative_coordinate (refp, Y_AXIS), - Y_AXIS); + Y_AXIS); return span_bar.smobbed_copy (); } @@ -118,7 +117,7 @@ Span_bar::width_callback (SCM element_smob, SCM scm_axis) Grob *se = unsmob_grob (element_smob); (void) scm_axis; - assert ( (Axis) scm_to_int (scm_axis) == X_AXIS); + assert ((Axis) scm_to_int (scm_axis) == X_AXIS); String gl = ly_scm2string (se->get_property ("glyph")); /* @@ -188,8 +187,8 @@ Span_bar::evaluate_glyph (Grob *me) return; extract_grob_set (me, "elements", elements); - for (int i = elements.size(); - i-- && !scm_is_string (gl); ) + for (int i = elements.size (); + i-- && !scm_is_string (gl);) { gl = elements[i]->get_property ("glyph"); } diff --git a/lily/span-dynamic-performer.cc b/lily/span-dynamic-performer.cc index c067530439..f9b20d7182 100644 --- a/lily/span-dynamic-performer.cc +++ b/lily/span-dynamic-performer.cc @@ -184,4 +184,4 @@ Span_dynamic_performer::try_music (Music *r) ADD_TRANSLATOR (Span_dynamic_performer, "", "", "crescendo-event decrescendo-event", - "", ""); + "", ""); diff --git a/lily/spanner.cc b/lily/spanner.cc index 590c4d9473..d5eaa3aaa4 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -253,7 +253,7 @@ Spanner::find_broken_piece (System *l) const int Spanner::compare (Spanner *const &p1, Spanner *const &p2) { - return p1->get_system ()->get_rank() - p2->get_system ()->get_rank(); + return p1->get_system ()->get_rank () - p2->get_system ()->get_rank (); } bool diff --git a/lily/spring-smob.cc b/lily/spring-smob.cc index 388567e793..b3697549cd 100644 --- a/lily/spring-smob.cc +++ b/lily/spring-smob.cc @@ -24,7 +24,7 @@ SCM Spring_smob::mark_smob (SCM x) { (void)x; - + return SCM_UNSPECIFIED; } diff --git a/lily/staff-collecting-engraver.cc b/lily/staff-collecting-engraver.cc index 1834d9149f..1a99e79e61 100644 --- a/lily/staff-collecting-engraver.cc +++ b/lily/staff-collecting-engraver.cc @@ -32,7 +32,7 @@ Staff_collecting_engraver::acknowledge_staff_symbol (Grob_info gi) } #include "translator.icc" -ADD_ACKNOWLEDGER (Staff_collecting_engraver,staff_symbol); +ADD_ACKNOWLEDGER (Staff_collecting_engraver, staff_symbol); ADD_TRANSLATOR (Staff_collecting_engraver, /* doc */ "Maintain the stavesFound variable", diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index c9dd4ac445..45e06833a7 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -44,7 +44,7 @@ private: ADD_TRANSLATOR (Staff_performer, "", "", "", - "", ""); + "", ""); Staff_performer::Staff_performer () { diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index c4ec3b14d6..7a746404e6 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -42,9 +42,7 @@ Staff_spacing::next_note_correction (Grob *me, { Interval v; if (Accidental_placement::has_interface (a)) - { - v = Accidental_placement::get_relevant_accidental_extent (a, col, me); - } + v = Accidental_placement::get_relevant_accidental_extent (a, col, me); else v = a->extent (col, X_AXIS); @@ -124,7 +122,6 @@ Staff_spacing::next_notes_correction (Grob *me, Grob *last_grob) Interval bar_size = bar_y_positions (last_grob); Real max_corr = 0.0; - extract_grob_set (me, "right-items", right_items); for (int i = right_items.size (); i--;) { @@ -132,7 +129,7 @@ Staff_spacing::next_notes_correction (Grob *me, Grob *last_grob) max_corr = max (max_corr, next_note_correction (me, g, bar_size)); extract_grob_set (g, "elements", elts); - for (int j = elts.size(); j--;) + for (int j = elts.size (); j--;) max_corr = max (max_corr, next_note_correction (me, elts[j], bar_size)); } @@ -149,7 +146,7 @@ Staff_spacing::get_spacing_params (Grob *me, Real *space, Real *fixed) Item *me_item = dynamic_cast (me); extract_grob_set (me, "left-items", items); - for (int i = items.size(); i--;) + for (int i = items.size (); i--;) { Grob *cand = items[i]; if (cand && Separation_item::has_interface (cand)) diff --git a/lily/staff-symbol-engraver.cc b/lily/staff-symbol-engraver.cc index 32179bb746..a7bbb6194b 100644 --- a/lily/staff-symbol-engraver.cc +++ b/lily/staff-symbol-engraver.cc @@ -17,7 +17,7 @@ Staff_symbol_engraver::~Staff_symbol_engraver () Staff_symbol_engraver::Staff_symbol_engraver () { finished_span_ = 0; - first_start_ = true; + first_start_ = true; span_ = 0; span_events_[LEFT] = 0; span_events_[RIGHT] = 0; @@ -32,7 +32,7 @@ Staff_symbol_engraver::try_music (Music *music) span_events_[d] = music; return true; } - + return false; } @@ -95,15 +95,15 @@ Staff_symbol_engraver::finalize () /* Todo: staff-symbol-referencer iface. - */ +*/ void Staff_symbol_engraver::acknowledge_grob (Grob_info s) { /* Perhaps should try to take SeparationItem as bound of the staff symbol? - */ - if (span_ || finished_span_ ) + */ + if (span_ || finished_span_) { Spanner *my = span_ ? span_ : finished_span_; s.grob ()->set_object ("staff-symbol", my->self_scm ()); @@ -111,7 +111,7 @@ Staff_symbol_engraver::acknowledge_grob (Grob_info s) } #include "translator.icc" -ADD_ACKNOWLEDGER (Staff_symbol_engraver,grob); +ADD_ACKNOWLEDGER (Staff_symbol_engraver, grob); ADD_TRANSLATOR (Staff_symbol_engraver, /* doc */ "Create the constellation of five (default) " "staff lines.", diff --git a/lily/stanza-number-align-engraver.cc b/lily/stanza-number-align-engraver.cc index de35f67147..cc3baa7a17 100644 --- a/lily/stanza-number-align-engraver.cc +++ b/lily/stanza-number-align-engraver.cc @@ -58,8 +58,8 @@ Stanza_number_align_engraver::stop_translation_timestep () lyrics_.clear (); } -ADD_ACKNOWLEDGER (Stanza_number_align_engraver,lyric_syllable); -ADD_ACKNOWLEDGER (Stanza_number_align_engraver,stanza_number); +ADD_ACKNOWLEDGER (Stanza_number_align_engraver, lyric_syllable); +ADD_ACKNOWLEDGER (Stanza_number_align_engraver, stanza_number); ADD_TRANSLATOR (Stanza_number_align_engraver, "This engraver ensures that stanza numbers are neatly aligned. ", "", diff --git a/lily/stanza-number-engraver.cc b/lily/stanza-number-engraver.cc index 146f48848a..34586f5e55 100644 --- a/lily/stanza-number-engraver.cc +++ b/lily/stanza-number-engraver.cc @@ -71,7 +71,7 @@ Stanza_number_engraver::stop_translation_timestep () #include "translator.icc" -ADD_ACKNOWLEDGER (Stanza_number_engraver,lyric_syllable); +ADD_ACKNOWLEDGER (Stanza_number_engraver, lyric_syllable); ADD_TRANSLATOR (Stanza_number_engraver, /* doc */ "", /* create */ "StanzaNumber", diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index e81771eda1..1e45f43d60 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -59,7 +59,7 @@ Stem_engraver::make_stem (Grob_info gi) */ Music *music = gi.music_cause (); Duration *dur = unsmob_duration (music->get_property ("duration")); - + stem_->set_property ("duration-log", dur ? scm_from_int (dur->duration_log ()) : 0); if (tremolo_ev_) @@ -117,11 +117,11 @@ Stem_engraver::acknowledge_rhythmic_head (Grob_info gi) return; Duration *d = unsmob_duration (cause->get_property ("duration")); if (!d) - return ; - + return; + if (!stem_) make_stem (gi); - + if (Stem::duration_log (stem_) != d->duration_log ()) { // FIXME: @@ -169,7 +169,7 @@ Stem_engraver::try_music (Music *m) } #include "translator.icc" -ADD_ACKNOWLEDGER (Stem_engraver,rhythmic_head); +ADD_ACKNOWLEDGER (Stem_engraver, rhythmic_head); ADD_TRANSLATOR (Stem_engraver, /* doc */ "Create stems and single-stem tremolos. It also works together with " "the beam engraver for overriding beaming.", diff --git a/lily/stem.cc b/lily/stem.cc index f258b7aeda..1905736a9d 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -134,7 +134,7 @@ Stem::support_head (Grob *me) extract_grob_set (me, "note-heads", heads); if (heads.size () == 1) return heads[0]; - + return first_head (me); } @@ -180,7 +180,7 @@ Stem::extremal_heads (Grob *me) Drul_array exthead (0, 0); extract_grob_set (me, "note-heads", heads); - + for (int i = heads.size (); i--;) { Grob *n = heads[i]; @@ -212,7 +212,7 @@ Stem::note_head_positions (Grob *me) { Array ps; extract_grob_set (me, "note-heads", heads); - + for (int i = heads.size (); i--;) { Grob *n = heads[i]; @@ -617,7 +617,7 @@ Stem::width_callback (SCM e, SCM ax) } else { - r = Interval (-1,1) * thickness (me) * 0.5; + r = Interval (-1, 1) * thickness (me) * 0.5; r.unite (flag (me).extent (X_AXIS)); } return ly_interval2scm (r); @@ -886,7 +886,7 @@ Stem::calc_stem_info (Grob *me) y_ext.widen (0.5); // FIXME. Should be tunable? minimum_length = max (minimum_length, y_ext.length ()); } - + ideal_y *= my_dir; Real minimum_y = note_start + minimum_length; Real shortest_y = minimum_y * my_dir; diff --git a/lily/stencil-expression.cc b/lily/stencil-expression.cc index 06fe314fd0..fb60ae26f8 100644 --- a/lily/stencil-expression.cc +++ b/lily/stencil-expression.cc @@ -5,7 +5,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "stencil.hh" @@ -18,7 +17,6 @@ void register_stencil_head (SCM symbol) { scm_set_object_property_x (symbol, ly_symbol2scm ("stencil-head?"), SCM_BOOL_T); heads = scm_cons (symbol, heads); - } bool is_stencil_head (SCM symbol) @@ -32,4 +30,4 @@ all_stencil_heads () { return heads; } - + diff --git a/lily/stencil-interpret.cc b/lily/stencil-interpret.cc index 3964054daf..efe5c90537 100644 --- a/lily/stencil-interpret.cc +++ b/lily/stencil-interpret.cc @@ -1,10 +1,9 @@ /* - stencil-interpret.cc -- implement Stencil expression interpreting + stencil-interpret.cc -- implement Stencil expression interpreting source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "stencil.hh" diff --git a/lily/stencil-scheme.cc b/lily/stencil-scheme.cc index 4b40e88659..fe2552fe95 100644 --- a/lily/stencil-scheme.cc +++ b/lily/stencil-scheme.cc @@ -193,17 +193,16 @@ LY_DEFINE (ly_stencil_add, "ly:stencil-add", SCM_VALIDATE_REST_ARGUMENT (args); SCM expr = SCM_EOL; - SCM *tail = &expr; + SCM *tail = &expr; Box extent; extent.set_empty (); - + while (!SCM_NULLP (args)) { Stencil *s = unsmob_stencil (scm_car (args)); if (!s) SCM_ASSERT_TYPE (s, scm_car (args), SCM_ARGn, __FUNCTION__, "Stencil"); - extent.unite (s->extent_box ()); *tail = scm_cons (s->expr (), SCM_EOL); tail = SCM_CDRLOC (*tail); @@ -230,8 +229,7 @@ LY_DEFINE (ly_make_stencil, "ly:make-stencil", SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG2, __FUNCTION__, "number pair"); SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG3, __FUNCTION__, "number pair"); - - + Box b (ly_scm2interval (xext), ly_scm2interval (yext)); Stencil s (b, expr); return s.smobbed_copy (); @@ -263,7 +261,6 @@ LY_DEFINE (ly_stencil_fonts, "ly:stencil-fonts", return find_expression_fonts (stil->expr ()); } - LY_DEFINE (ly_stencil_in_color, "ly:stencil-in-color", 4, 0, 0, (SCM stc, SCM r, SCM g, SCM b), "Put @var{stc} in a different color.") @@ -276,7 +273,6 @@ LY_DEFINE (ly_stencil_in_color, "ly:stencil-in-color", stil->expr ())).smobbed_copy (); } - struct Stencil_interpret_arguments { SCM func; @@ -340,7 +336,6 @@ LY_DEFINE (ly_filled_box, "ly:round-filled-box", } - LY_DEFINE (ly_register_stencil_expression, "ly:register-stencil-expression", 1, 0, 0, (SCM symbol), diff --git a/lily/stencil.cc b/lily/stencil.cc index 291fe6ad06..903e864b7c 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -91,7 +91,7 @@ Stencil::translate (Offset o) || isnan (o[a]) // ugh, hardcoded. - || fabs (o[a]) > 1e6) + || fabs (o[a]) > 1e6) { programming_error (String_convert::form_string ("Improbable offset for stencil: %f staff space", o[a]) + "\n" @@ -191,7 +191,6 @@ Stencil::add_at_edge (Axis a, Direction d, Stencil const &s, Real padding, } - Stencil Stencil::in_color (Real r, Real g, Real b) const { diff --git a/lily/swallow-perf.cc b/lily/swallow-perf.cc index 599a3f987c..31e76c4829 100644 --- a/lily/swallow-perf.cc +++ b/lily/swallow-perf.cc @@ -9,7 +9,6 @@ #include "performer.hh" #include "music.hh" - class Swallow_performer : public Performer { public: diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index aee2c590d3..cc35f4b264 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -21,7 +21,6 @@ #include "pointer-group-interface.hh" - Stencil System_start_delimiter::staff_bracket (Grob *me, Real height) { @@ -31,24 +30,22 @@ System_start_delimiter::staff_bracket (Grob *me, Real height) Real thickness = robust_scm2double (me->get_property ("thickness"), 0.25); - Real overlap = 0.1 * thickness; - + Stencil bracket = Lookup::filled_box (Box (Interval (0, thickness), Interval (-1, 1) - * (height/2 + overlap))); + * (height / 2 + overlap))); Direction d = DOWN; do { bracket.add_at_edge (Y_AXIS, d, tips[d], -overlap, 0.0); } - while (flip (&d) != DOWN); + while (flip (&d) != DOWN); return bracket; } - Stencil System_start_delimiter::simple_bar (Grob *me, Real h) { @@ -64,12 +61,12 @@ SCM System_start_delimiter::after_line_breaking (SCM smob) { Spanner *me = dynamic_cast (unsmob_grob (smob)); - + SCM gl = me->get_property ("glyph"); if (ly_is_equal (gl, scm_makfrom0str ("bar-line"))) { int count = 0; - Paper_column *left_column = me->get_bound (LEFT)->get_column (); + Paper_column *left_column = me->get_bound (LEFT)->get_column (); #if 1 /* slur-script.ly test */ /* @@ -80,20 +77,20 @@ System_start_delimiter::after_line_breaking (SCM smob) for (int i = elts.size (); i--;) { - Spanner *staff = dynamic_cast (elts[i]); - if (!staff || - staff->get_bound (LEFT)->get_column () != left_column) + Spanner *staff = dynamic_cast (elts[i]); + if (!staff + || staff->get_bound (LEFT)->get_column () != left_column) continue; - + Interval v = staff->extent (common, Y_AXIS); - + if (!v.is_empty ()) count++; } if (count <= 1) me->suicide (); -#endif +#endif } return SCM_UNSPECIFIED; } @@ -118,9 +115,9 @@ System_start_delimiter::print (SCM smob) Interval ext; - for (int i = elts.size(); i--;) + for (int i = elts.size (); i--;) { - Spanner *sp = dynamic_cast (elts[i]); + Spanner *sp = dynamic_cast (elts[i]); if (sp && sp->get_bound (LEFT) == me->get_bound (LEFT)) { @@ -169,7 +166,7 @@ System_start_delimiter::staff_brace (Grob *me, Real y) fm = select_font (me->get_layout (), scm_list_n (alist, SCM_UNDEFINED)); int lo = 0; - int hi = max (fm->count () - 1,2); + int hi = max (fm->count () - 1, 2); Box b; /* do a binary search for each Y, not very efficient, but passable? */ diff --git a/lily/system.cc b/lily/system.cc index 8ad56060e6..e5bc99840e 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -32,7 +32,7 @@ System::System (System const &src, int count) { all_elements_ = 0; rank_ = 0; - init_elements (); + init_elements (); } System::System (SCM s, Object_key const *key) @@ -40,7 +40,7 @@ System::System (SCM s, Object_key const *key) { all_elements_ = 0; rank_ = 0; - init_elements (); + init_elements (); } void @@ -51,7 +51,6 @@ System::init_elements () set_object ("all-elements", scm_arr); } - Grob * System::clone (int count) const { @@ -68,7 +67,7 @@ int System::spanner_count () const { int k = 0; - for (int i = all_elements_->size(); i--;) + for (int i = all_elements_->size (); i--;) if (dynamic_cast (all_elements_->grob (i))) k++; return k; @@ -97,20 +96,20 @@ System::derived_mark () const while (ptr < end) { scm_gc_mark ((*ptr)->self_scm ()); - ptr ++; + ptr++; } } if (pscore_) scm_gc_mark (pscore_->self_scm ()); - + Spanner::derived_mark (); } static void fixup_refpoints (Link_array const &grobs) { - for (int i = grobs.size (); i--; ) + for (int i = grobs.size (); i--;) { grobs[i]->fixup_refpoint (); } @@ -119,7 +118,7 @@ fixup_refpoints (Link_array const &grobs) SCM System::get_paper_systems () { - for (int i = 0; i < all_elements_->size(); i++) + for (int i = 0; i < all_elements_->size (); i++) { Grob *g = all_elements_->grob (i); if (g->internal_has_interface (ly_symbol2scm ("only-prebreak-interface"))) @@ -146,14 +145,14 @@ System::get_paper_systems () for (int i = 0; i < broken_intos_.size (); i++) { Grob *se = broken_intos_[i]; - + extract_grob_set (se, "all-elements", all_elts); - for (int j = 0; j < all_elts.size(); j++) + for (int j = 0; j < all_elts.size (); j++) { Grob *g = all_elts[j]; g->fixup_refpoint (); } - + count += all_elts.size (); } @@ -161,12 +160,12 @@ System::get_paper_systems () needed for doing items. */ fixup_refpoints (all_elements_->array ()); - - for (int i = 0 ; i < all_elements_->size(); i++) + + for (int i = 0; i < all_elements_->size (); i++) all_elements_->grob (i)->handle_broken_dependencies (); handle_broken_dependencies (); - + #if 0 /* FIXME: strange side effects. */ /* Because the this->get_property (all-elements) contains items in 3 @@ -238,10 +237,10 @@ System::add_column (Paper_column *p) } p->rank_ - = ga->size() + = ga->size () ? Paper_column::get_rank (ga->array ().top ()) + 1 : 0; - + ga->add (p); Axis_group_interface::add_element (this, p); } @@ -264,9 +263,8 @@ apply_tweaks (Grob *g, bool broken) void System::pre_processing () { - for (int i = 0 ; i < all_elements_->size(); i ++) + for (int i = 0; i < all_elements_->size (); i++) all_elements_->grob (i)->discretionary_processing (); - if (be_verbose_global) message (_f ("Grob count %d", element_count ())); @@ -276,22 +274,22 @@ System::pre_processing () array, and should be processed before the original is potentially killed. */ - for (int i = all_elements_->size(); i --; ) + for (int i = all_elements_->size (); i--;) all_elements_->grob (i)->handle_prebroken_dependencies (); fixup_refpoints (all_elements_->array ()); - for (int i = 0 ; i < all_elements_->size(); i ++) + for (int i = 0; i < all_elements_->size (); i++) apply_tweaks (all_elements_->grob (i), false); - for (int i = 0 ; i < all_elements_->size(); i ++) + for (int i = 0; i < all_elements_->size (); i++) all_elements_->grob (i)->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback")); message (_ ("Calculating line breaks...")); progress_indication (" "); - - for (int i = 0 ; i < all_elements_->size(); i ++) + + for (int i = 0; i < all_elements_->size (); i++) { Grob *e = all_elements_->grob (i); SCM proc = e->get_property ("spacing-procedure"); @@ -303,7 +301,7 @@ System::pre_processing () void System::post_processing () { - for (int i = 0 ; i < all_elements_->size(); i ++) + for (int i = 0; i < all_elements_->size (); i++) { Grob *g = all_elements_->grob (i); @@ -324,7 +322,6 @@ System::post_processing () This might seem inefficient, but Stencils are cached per grob anyway. */ - Link_array all_elts_sorted (all_elements_->array ()); all_elts_sorted.default_sort (); all_elts_sorted.uniq (); @@ -346,7 +343,7 @@ System::get_paper_system () /* Output stencils in three layers: 0, 1, 2. Default layer: 1. */ for (int i = 0; i < LAYER_COUNT; i++) - for (int j = all_elements_->size (); j --;) + for (int j = all_elements_->size (); j--;) { Grob *g = all_elements_->grob (j); Stencil *stil = g->get_stencil (); @@ -385,7 +382,7 @@ System::get_paper_system () Interval staff_refpoints; staff_refpoints.set_empty (); extract_grob_set (this, "spaceable-staves", staves); - for (int i = staves.size (); i--; ) + for (int i = staves.size (); i--;) { Grob *g = staves[i]; staff_refpoints.add_point (g->relative_coordinate (this, Y_AXIS)); @@ -410,20 +407,20 @@ System::broken_col_range (Item const *left, Item const *right) const extract_grob_set (this, "columns", cols); int i = 0; - while (i < cols.size() + while (i < cols.size () && cols[i] != left) i++; - if (i < cols.size()) - i ++; - - while (i < cols.size() + if (i < cols.size ()) + i++; + + while (i < cols.size () && cols[i] != right) { Paper_column *c = dynamic_cast (cols[i]); if (Item::is_breakable (c) && !c->system_) ret.push (c); - i++; + i++; } return ret; @@ -438,7 +435,7 @@ System::columns () const int last_breakable = ro_columns.size (); - while (last_breakable --) + while (last_breakable--) { if (Item::is_breakable (ro_columns [last_breakable])) break; diff --git a/lily/tab-note-heads-engraver.cc b/lily/tab-note-heads-engraver.cc index acb553c827..ca5c0795f6 100644 --- a/lily/tab-note-heads-engraver.cc +++ b/lily/tab-note-heads-engraver.cc @@ -20,7 +20,6 @@ #include "warn.hh" #include "duration.hh" - /** make (guitar-like) tablature note */ diff --git a/lily/tab-staff-symbol-engraver.cc b/lily/tab-staff-symbol-engraver.cc index 354883141e..8d8401960b 100644 --- a/lily/tab-staff-symbol-engraver.cc +++ b/lily/tab-staff-symbol-engraver.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "staff-symbol-engraver.hh" @@ -37,7 +36,7 @@ Tab_staff_symbol_engraver::Tab_staff_symbol_engraver () #include "translator.icc" -ADD_ACKNOWLEDGER (Tab_staff_symbol_engraver,grob); +ADD_ACKNOWLEDGER (Tab_staff_symbol_engraver, grob); ADD_TRANSLATOR (Tab_staff_symbol_engraver, /* doc */ "Create a staff-symbol, but look at stringTunings for the number of lines." "staff lines.", diff --git a/lily/tempo-performer.cc b/lily/tempo-performer.cc index 913fb90adf..43af310b30 100644 --- a/lily/tempo-performer.cc +++ b/lily/tempo-performer.cc @@ -81,4 +81,4 @@ Tempo_performer::try_music (Music *event) ADD_TRANSLATOR (Tempo_performer, "", "", "metronome-change-event", - "", ""); + "", ""); diff --git a/lily/text-metrics.cc b/lily/text-metrics.cc index 927a9d39e9..d69b59d3b4 100644 --- a/lily/text-metrics.cc +++ b/lily/text-metrics.cc @@ -63,9 +63,7 @@ LY_DEFINE (ly_load_text_dimensions, "ly:load-text-dimensions", if (scm_hash_ref (text_dimension_hash_tab, key, SCM_BOOL_F) == SCM_BOOL_F) - { - scm_hash_set_x (text_dimension_hash_tab, key, val); - } + scm_hash_set_x (text_dimension_hash_tab, key, val); } return SCM_UNSPECIFIED; diff --git a/lily/text-spanner-engraver.cc b/lily/text-spanner-engraver.cc index d738a0c4c9..39f3190570 100644 --- a/lily/text-spanner-engraver.cc +++ b/lily/text-spanner-engraver.cc @@ -140,7 +140,7 @@ Text_spanner_engraver::finalize () } #include "translator.icc" -ADD_ACKNOWLEDGER (Text_spanner_engraver,note_column); +ADD_ACKNOWLEDGER (Text_spanner_engraver, note_column); ADD_TRANSLATOR (Text_spanner_engraver, /* doc */ "Create text spanner from a Music.", /* create */ "TextSpanner", diff --git a/lily/tie-column.cc b/lily/tie-column.cc index 1caf7851a9..082cc619df 100644 --- a/lily/tie-column.cc +++ b/lily/tie-column.cc @@ -116,17 +116,11 @@ Tie_column::werner_directions (Grob *me) if (last_tie && Tie::get_column_rank (t, LEFT) < Tie::get_column_rank (last_tie, LEFT)) - { - d = DOWN; - } + d = DOWN; else if (last_down_pos - p > 5) - { - d = UP; - } + d = UP; else - { - d = DOWN; - } + d = DOWN; set_grob_direction (t, d); } @@ -164,9 +158,7 @@ Tie_column::before_line_breaking (SCM smob) { if (dir * tie->get_bound (dir)->get_column ()->get_rank () > dir * me->get_bound (dir)->get_column ()->get_rank ()) - { - me->set_bound (dir, Tie::head (tie, dir)); - } + me->set_bound (dir, Tie::head (tie, dir)); } while (flip (&dir) != LEFT); } diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index 8db63a0318..b8b7c0b4cd 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -152,14 +152,10 @@ Tie_engraver::stop_translation_timestep () if (ties_.size ()) { if (!to_boolean (get_property ("tieWaitForNote"))) - { - heads_to_tie_.clear (); - } + heads_to_tie_.clear (); for (int i = 0; i < ties_.size (); i++) - { - typeset_tie (ties_[i]); - } + typeset_tie (ties_[i]); ties_.clear (); tie_column_ = 0; diff --git a/lily/tie-performer.cc b/lily/tie-performer.cc index 7482c0434b..314d5c6038 100644 --- a/lily/tie-performer.cc +++ b/lily/tie-performer.cc @@ -13,7 +13,6 @@ #include "audio-item.hh" #include "pqueue.hh" - class Tie_performer : public Performer { Music *event_; @@ -73,7 +72,7 @@ Tie_performer::acknowledge_audio_element (Audio_element_info inf) if (right_mus && left_mus && ly_is_equal (right_mus->get_property ("pitch"), - left_mus->get_property ("pitch"))) + left_mus->get_property ("pitch"))) { an->tie_to (th); ties_created_ = true; diff --git a/lily/tie.cc b/lily/tie.cc index 1899046dc0..8668d994ca 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -232,9 +232,7 @@ Tie::get_control_points (SCM smob) Grob *dots = Rhythmic_head::get_dots (l); if (fabs (staff_space * Staff_symbol_referencer::get_position (dots) / 2 - ypos) < 0.5) - { - ypos += 0.5 * dir; - } + ypos += 0.5 * dir; } /* @@ -297,9 +295,7 @@ Tie::get_control_points (SCM smob) we don't want horizontal ties */ if (fabs (newy - b.control_[0][Y_AXIS]) < 1e-2) - { - newy = newy + dir * staff_space; - } + newy = newy + dir * staff_space; } Real y0 = b.control_ [0][Y_AXIS]; @@ -332,12 +328,10 @@ Tie::print (SCM smob) if (!scm_is_pair (cp)) return Stencil ().smobbed_copy (); - Real staff_thick = Staff_symbol_referencer::line_thickness (me); Real base_thick = robust_scm2double (me->get_property ("thickness"), 1); Real thick = base_thick * staff_thick; - Bezier b; int i = 0; for (SCM s = cp; s != SCM_EOL; s = scm_cdr (s)) @@ -360,14 +354,13 @@ Tie::print (SCM smob) get_grob_direction (me) * staff_thick, thick); - return a.smobbed_copy (); } ADD_INTERFACE (Tie, "tie-interface", "A tie connecting two noteheads.\n", - + "y-offset dash-period dash-fraction " "staffline-clearance control-points head-pair " "details thickness x-gap direction minimum-length"); diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index 4061d13d4a..99881bf6d1 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -27,14 +27,12 @@ public: TRANSLATOR_DECLARATIONS (Time_signature_engraver); }; - void Time_signature_engraver::derived_mark () const { scm_gc_mark (last_time_fraction_); } - Time_signature_engraver::Time_signature_engraver () { time_signature_ = 0; diff --git a/lily/time-signature.cc b/lily/time-signature.cc index 5d98010035..544debf16a 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -66,9 +66,7 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d) if /* neither C2/2 nor C4/4 */ (((n != 2) || (d != 2)) && ((n != 4) || (d != 4))) - { - return numbered_time_signature (me, n, d); - } + return numbered_time_signature (me, n, d); } String char_name = style + to_string (n) + to_string (d); diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 05b560b4bd..1cdfc199ea 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -76,7 +76,6 @@ Timing_translator::Timing_translator () { } - void Timing_translator::start_translation_timestep () { @@ -145,7 +144,6 @@ ADD_TRANSLATOR (Timing_translator, "this engraver should be removed from @code{Score} and placed in " "@code{Staff}. " "\n\nThis engraver adds the alias @code{Timing} to its containing context." - , - "", "", "", ""); + "", "", "", ""); diff --git a/lily/translator-dispatch-list.cc b/lily/translator-dispatch-list.cc index 7dac8ea091..f9461049fd 100644 --- a/lily/translator-dispatch-list.cc +++ b/lily/translator-dispatch-list.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "translator-dispatch-list.hh" @@ -14,7 +13,7 @@ #include "ly-smobs.icc" -void +void Engraver_dispatch_list::apply (Grob_info gi) { Translator *origin = gi.origin_translator (); @@ -22,7 +21,7 @@ Engraver_dispatch_list::apply (Grob_info gi) { Engraver_dispatch_entry const &e (dispatch_entries_[i]); if (e.engraver_ == origin) - continue; + continue; (*e.function_) (e.engraver_, gi); } @@ -32,21 +31,21 @@ SCM Engraver_dispatch_list::create (SCM trans_list, SCM iface_list) { - SCM retval = Engraver_dispatch_list().smobbed_copy (); - Engraver_dispatch_list * list = Engraver_dispatch_list::unsmob (retval); + SCM retval = Engraver_dispatch_list ().smobbed_copy (); + Engraver_dispatch_list *list = Engraver_dispatch_list::unsmob (retval); Engraver_dispatch_entry entry; - bool found = false; + bool found = false; for (SCM s = trans_list; scm_is_pair (s); s = scm_cdr (s)) { - Engraver * eng - = dynamic_cast (unsmob_translator (scm_car (s))); + Engraver *eng + = dynamic_cast (unsmob_translator (scm_car (s))); if (!eng) continue; entry.engraver_ = eng; - for (SCM i = iface_list; scm_is_pair (i); i = scm_cdr (i)) + for (SCM i = iface_list; scm_is_pair (i); i = scm_cdr (i)) { Engraver_void_function_engraver_grob_info ptr = eng->get_acknowledger (scm_car (i)); @@ -56,11 +55,9 @@ Engraver_dispatch_list::create (SCM trans_list, list->dispatch_entries_.push (entry); found = true; } - } } - return found ? retval : SCM_EOL; } @@ -71,7 +68,6 @@ Engraver_dispatch_list::mark_smob (SCM x) return SCM_BOOL_F; } - int Engraver_dispatch_list::print_smob (SCM x, SCM p, scm_print_state *) { @@ -80,5 +76,5 @@ Engraver_dispatch_list::print_smob (SCM x, SCM p, scm_print_state *) return 1; } -IMPLEMENT_SIMPLE_SMOBS(Engraver_dispatch_list); -IMPLEMENT_DEFAULT_EQUAL_P(Engraver_dispatch_list); +IMPLEMENT_SIMPLE_SMOBS (Engraver_dispatch_list); +IMPLEMENT_DEFAULT_EQUAL_P (Engraver_dispatch_list); diff --git a/lily/translator-group-ctors.cc b/lily/translator-group-ctors.cc index ead329095b..4932048f9a 100644 --- a/lily/translator-group-ctors.cc +++ b/lily/translator-group-ctors.cc @@ -4,10 +4,8 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ - #include "score-engraver.hh" #include "score-performer.hh" #include "engraver-group-engraver.hh" @@ -16,20 +14,20 @@ /* Quick & dirty. - */ +*/ Translator_group * get_translator_group (SCM sym) { if (sym == ly_symbol2scm ("Engraver_group_engraver")) return new Engraver_group_engraver (); else if (sym == ly_symbol2scm ("Performer_group_performer")) - return new Performer_group_performer(); + return new Performer_group_performer (); else if (sym == ly_symbol2scm ("Score_engraver")) - return new Score_engraver(); + return new Score_engraver (); else if (sym == ly_symbol2scm ("Score_performer")) - return new Score_performer(); + return new Score_performer (); else if (sym == ly_symbol2scm ("Recording_group_engraver")) - return new Recording_group_engraver(); + return new Recording_group_engraver (); assert (0); return 0; diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 304cf9dea8..0567fa1cc9 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -16,7 +16,6 @@ #include "main.hh" #include "music.hh" - Translator_group * Translator_group::get_daddy_translator () const { @@ -101,13 +100,12 @@ Translator_group::get_simple_trans_list () return simple_trans_list_; } - void precomputed_recurse_over_translators (Context *c, Translator_precompute_index idx, Direction dir) { Translator_group *tg = dynamic_cast (c->implementation ()); - + if (dir == DOWN) { tg->precomputed_translator_foreach (idx); @@ -125,7 +123,6 @@ precomputed_recurse_over_translators (Context *c, Translator_precompute_index id tg->precomputed_translator_foreach (idx); tg->call_precomputed_self_method (idx); } - } void @@ -133,7 +130,7 @@ recurse_over_translators (Context *c, Translator_method ptr, Translator_group_me { Translator_group *tg = dynamic_cast (c->implementation ()); - + if (dir == DOWN) { (tg->*tg_ptr) (); @@ -170,7 +167,6 @@ Translator_group::derived_mark () const { } - void Translator_group::precompute_method_bindings () { @@ -184,9 +180,7 @@ Translator_group::precompute_method_bindings () for (int i = 0; i < TRANSLATOR_METHOD_PRECOMPUTE_COUNT; i++) { if (ptrs[i]) - { - precomputed_method_bindings_[i].push (Translator_method_binding (tr, ptrs[i])); - } + precomputed_method_bindings_[i].push (Translator_method_binding (tr, ptrs[i])); } } @@ -196,7 +190,7 @@ Translator_group::precompute_method_bindings () void Translator_group::precomputed_translator_foreach (Translator_precompute_index idx) { - Array &bindings(precomputed_method_bindings_[idx]); + Array &bindings (precomputed_method_bindings_[idx]); for (int i = 0; i < bindings.size (); i++) { bindings[i].invoke (); @@ -214,10 +208,9 @@ void Translator_group::call_precomputed_self_method (Translator_precompute_index idx) { if (precomputed_self_method_bindings_[idx]) - (*precomputed_self_method_bindings_[idx])(this); + (*precomputed_self_method_bindings_[idx]) (this); } - Translator_group::~Translator_group () { } @@ -228,7 +221,6 @@ IMPLEMENT_SMOBS (Translator_group); IMPLEMENT_DEFAULT_EQUAL_P (Translator_group); IMPLEMENT_TYPE_P (Translator_group, "ly:translator-group?"); - int Translator_group::print_smob (SCM s, SCM port, scm_print_state *) { @@ -240,11 +232,10 @@ Translator_group::print_smob (SCM s, SCM port, scm_print_state *) return 1; } - SCM Translator_group::mark_smob (SCM smob) { - Translator_group *me = (Translator_group*)SCM_CELL_WORD_1 (smob); + Translator_group *me = (Translator_group *)SCM_CELL_WORD_1 (smob); me->derived_mark (); scm_gc_mark (me->accept_hash_table_); diff --git a/lily/translator.cc b/lily/translator.cc index 24d169857f..c301956d3f 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -29,7 +29,6 @@ Translator::init () smobify_self (); } - void Translator::process_music () { @@ -165,7 +164,7 @@ add_acknowledger (Engraver_void_function_engraver_grob_info ptr, Acknowledge_information inf; inf.function_ = ptr; - String interface_name(func_name); + String interface_name (func_name); interface_name = interface_name.substitute ('_', '-'); interface_name += "-interface"; @@ -177,19 +176,17 @@ add_acknowledger (Engraver_void_function_engraver_grob_info ptr, Engraver_void_function_engraver_grob_info generic_get_acknowledger (SCM sym, Array const *ack_array) { - for (int i = 0; i < ack_array->size(); i++) + for (int i = 0; i < ack_array->size (); i++) { if (ack_array->elem (i).symbol_ == sym) - { - return ack_array->elem(i).function_; - } + return ack_array->elem (i).function_; } return 0; } -ADD_TRANSLATOR(Translator, - "Base class. Unused", - "", - "", - "", - ""); +ADD_TRANSLATOR (Translator, + "Base class. Unused", + "", + "", + "", + ""); diff --git a/lily/trill-spanner-engraver.cc b/lily/trill-spanner-engraver.cc index 099636a1c8..95f437e1ee 100644 --- a/lily/trill-spanner-engraver.cc +++ b/lily/trill-spanner-engraver.cc @@ -146,7 +146,7 @@ Trill_spanner_engraver::finalize () span_ = 0; } } -ADD_ACKNOWLEDGER (Trill_spanner_engraver,note_column); +ADD_ACKNOWLEDGER (Trill_spanner_engraver, note_column); ADD_TRANSLATOR (Trill_spanner_engraver, /* doc */ "Create trill spanner from a Music.", /* create */ "TrillSpanner", diff --git a/lily/ttf.cc b/lily/ttf.cc index 3bdf45ff0c..f329a74d4d 100644 --- a/lily/ttf.cc +++ b/lily/ttf.cc @@ -1,10 +1,9 @@ /* - ttf.cc -- implement ttf -> pfa routine. + ttf.cc -- implement ttf -> pfa routine. source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "freetype.hh" @@ -17,43 +16,42 @@ #include "lily-guile.hh" #include "main.hh" - /* Based on ttfps by Juliusz Chroboczek - */ +*/ static void print_header (void *out, FT_Face face) { lily_cookie_fprintf (out, "%%!PS-TrueTypeFont\n"); - TT_Postscript *pt = - (TT_Postscript*) FT_Get_Sfnt_Table(face, ft_sfnt_post); + TT_Postscript *pt + = (TT_Postscript *) FT_Get_Sfnt_Table (face, ft_sfnt_post); if (pt->maxMemType42) lily_cookie_fprintf (out, "%%%%VMUsage: %ld %ld\n", 0, 0); - + lily_cookie_fprintf (out, "%d dict begin\n", 11); lily_cookie_fprintf (out, "/FontName /%s def\n", - FT_Get_Postscript_Name (face)); + FT_Get_Postscript_Name (face)); lily_cookie_fprintf (out, "/Encoding StandardEncoding def\n"); lily_cookie_fprintf (out, "/PaintType 0 def\n"); lily_cookie_fprintf (out, "/FontMatrix [1 0 0 1 0 0] def\n"); - TT_Header *ht = - (TT_Header*)FT_Get_Sfnt_Table(face, ft_sfnt_head); - + TT_Header *ht + = (TT_Header *)FT_Get_Sfnt_Table (face, ft_sfnt_head); + lily_cookie_fprintf (out, "/FontBBox [%ld %ld %ld %ld] def\n", - ht->xMin * 1000L / ht->Units_Per_EM, - ht->yMin * 1000L / ht->Units_Per_EM, - ht->xMax * 1000L / ht->Units_Per_EM, - ht->yMax * 1000L / ht->Units_Per_EM); - + ht->xMin *1000L / ht->Units_Per_EM, + ht->yMin *1000L / ht->Units_Per_EM, + ht->xMax *1000L / ht->Units_Per_EM, + ht->yMax *1000L / ht->Units_Per_EM); + lily_cookie_fprintf (out, "/FontType 42 def\n"); lily_cookie_fprintf (out, "/FontInfo 8 dict dup begin\n"); lily_cookie_fprintf (out, "/version (%d.%d) def\n", (ht->Font_Revision >> 16), - (ht->Font_Revision & ((1 << 16) -1))); + (ht->Font_Revision &((1 << 16) -1))); #if 0 if (strings[0]) @@ -75,25 +73,24 @@ print_header (void *out, FT_Face face) lily_cookie_fprintf (out, ") def\n"); } #endif - + lily_cookie_fprintf (out, "/isFixedPitch %s def\n", - pt->isFixedPitch ? "true" : "false"); + pt->isFixedPitch ? "true" : "false"); lily_cookie_fprintf (out, "/UnderlinePosition %ld def\n", - pt->underlinePosition * 1000L / ht->Units_Per_EM); + pt->underlinePosition *1000L / ht->Units_Per_EM); lily_cookie_fprintf (out, "/UnderlineThickness %ld def\n", - pt->underlineThickness * 1000L / ht->Units_Per_EM); + pt->underlineThickness *1000L / ht->Units_Per_EM); lily_cookie_fprintf (out, "end readonly def\n"); } - #define CHUNKSIZE 65534 static void print_body (void *out, String name) { FILE *fd = fopen (name.to_str0 (), "rb"); - + static char xdigits[] = "0123456789ABCDEF"; unsigned char *buffer; @@ -112,7 +109,7 @@ print_body (void *out, String name) if (j != 0 && j % 36 == 0) lily_cookie_putc ('\n', out); /* lily_cookie_fprintf (out,"%02X",(int)buffer[j]) is too slow */ - lily_cookie_putc (xdigits[(buffer[j] & 0xF0) >> 4], out); + lily_cookie_putc (xdigits[ (buffer[j] & 0xF0) >> 4], out); lily_cookie_putc (xdigits[buffer[j] & 0x0F], out); } lily_cookie_fprintf (out, "00>"); /* Adobe bug? */ @@ -131,9 +128,9 @@ print_trailer (void *out, const int GLYPH_NAME_LEN = 256; char glyph_name[GLYPH_NAME_LEN]; - TT_MaxProfile * mp = - (TT_MaxProfile *)FT_Get_Sfnt_Table(face, ft_sfnt_maxp); - + TT_MaxProfile *mp + = (TT_MaxProfile *)FT_Get_Sfnt_Table (face, ft_sfnt_maxp); + lily_cookie_fprintf (out, "/CharStrings %d dict dup begin\n", mp->numGlyphs); for (int i = 0; i < mp->numGlyphs; i++) { @@ -144,7 +141,7 @@ print_trailer (void *out, else lily_cookie_fprintf (out, "/%s %d def ", glyph_name, i); - if (!(i % 5)) + if (! (i % 5)) lily_cookie_fprintf (out, "\n"); } lily_cookie_fprintf (out, "end readonly def\n"); @@ -155,13 +152,12 @@ static void create_type42_font (void *out, String name) { FT_Face face = open_ft_face (name); - + print_header (out, face); print_body (out, name); print_trailer (out, face); } - LY_DEFINE (ly_ttf_to_pfa, "ly:ttf->pfa", 1, 0, 0, (SCM ttf_file_name), "Convert the contents of a TTF file to Type42 PFA, returning it as " @@ -173,7 +169,7 @@ LY_DEFINE (ly_ttf_to_pfa, "ly:ttf->pfa", String file_name = ly_scm2string (ttf_file_name); if (be_verbose_global) progress_indication ("[" + file_name); - + Memory_out_stream stream; create_type42_font (&stream, file_name); @@ -182,6 +178,6 @@ LY_DEFINE (ly_ttf_to_pfa, "ly:ttf->pfa", if (be_verbose_global) progress_indication ("]"); - + return asscm; } diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index d63ae09ece..828bc58e37 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -49,7 +49,7 @@ static Item * get_x_bound_item (Grob *me_grob, Direction hdir, Direction my_dir) { - Spanner *me = dynamic_cast (me_grob); + Spanner *me = dynamic_cast (me_grob); Item *g = me->get_bound (hdir); if (Note_column::has_interface (g) && Note_column::get_stem (g) @@ -73,14 +73,12 @@ Tuplet_bracket::parallel_beam (Grob *me_grob, Link_array const &cols, bool Grob *s1 = Note_column::get_stem (cols[0]); Grob *s2 = Note_column::get_stem (cols.top ()); - if (s2 != me->get_bound (RIGHT)) return 0; Grob *b1 = s1 ? Stem::get_beam (s1) : 0; Grob *b2 = s2 ? Stem::get_beam (s2) : 0; - *equally_long = false; if (! (b1 && (b1 == b2) && !me->is_broken ())) return 0; @@ -119,10 +117,10 @@ Tuplet_bracket::print (SCM smob) { /* UGH. dependency tracking! - */ + */ extract_grob_set (me, "tuplets", tuplets); for (int i = 0; i < tuplets.size (); i++) - Tuplet_bracket::print (tuplets[i]->self_scm()); + Tuplet_bracket::print (tuplets[i]->self_scm ()); after_line_breaking (smob); } @@ -175,10 +173,10 @@ Tuplet_bracket::print (SCM smob) { x_span[d] = robust_relative_extent (bounds[d], commonx, X_AXIS)[d]; Direction break_dir = bounds[d]->break_status_dir (); - Spanner *orig_spanner = dynamic_cast (me->original_); + Spanner *orig_spanner = dynamic_cast (me->original_); connect_to_other[d] = (break_dir - && (me->get_break_index() - break_dir < orig_spanner->broken_intos_.size())); + && (me->get_break_index () - break_dir < orig_spanner->broken_intos_.size ())); if (connect_to_other[d]) { @@ -188,23 +186,23 @@ Tuplet_bracket::print (SCM smob) if (d == RIGHT) x_span[d] += d * overshoot[d]; else - x_span[d] = robust_relative_extent(bounds[d], commonx, X_AXIS)[RIGHT] + x_span[d] = robust_relative_extent (bounds[d], commonx, X_AXIS)[RIGHT] - overshoot[LEFT]; } else if (d == RIGHT && (columns.is_empty () - || (bounds[d]->get_column () - != dynamic_cast (columns.top())->get_column ()))) + || (bounds[d]->get_column () + != dynamic_cast (columns.top ())->get_column ()))) { /* TODO: make padding tunable? - */ + */ x_span[d] = robust_relative_extent (bounds[d], commonx, X_AXIS) [LEFT] - 1.0; } } while (flip (&d) != LEFT); - Real w = x_span.length(); + Real w = x_span.length (); SCM number = me->get_property ("text"); Output_def *pap = me->get_layout (); @@ -282,7 +280,6 @@ Tuplet_bracket::print (SCM smob) } while (flip (&d) != LEFT); - Stencil brack = make_bracket (me, Y_AXIS, Offset (w, ry - ly), height, @@ -300,7 +297,6 @@ Tuplet_bracket::print (SCM smob) } while (flip (&d) != LEFT); - mol.add_stencil (brack); } @@ -393,14 +389,13 @@ Tuplet_bracket::get_bounds (Grob *me, Grob **left, Grob **right) } } - /* use first -> last note for slope, and then correct for disturbing notes in between. */ void Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy) { - Spanner *me = dynamic_cast (me_grob); + Spanner *me = dynamic_cast (me_grob); extract_grob_set (me, "note-columns", columns); extract_grob_set (me, "tuplets", tuplets); @@ -505,15 +500,13 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy) Let's not take padding into account for nested tuplets. the edges can come very close to the stems, likewise for nested tuplets? - */ + */ Drul_array my_height = robust_scm2drul (me->get_property ("edge-height"), Interval (0, 0)); - if (dynamic_cast (tuplets[i])->get_bound (d) - == me->get_bound (d)) - { - y += dir * my_height[d]; - } + if (dynamic_cast (tuplets[i])->get_bound (d) + == me->get_bound (d)) + y += dir * my_height[d]; #endif points.push (Offset (tuplet_x[d] - x0, y)); @@ -646,7 +639,7 @@ Tuplet_bracket::get_default_dir (Grob *me) { Drul_array dirs (0, 0); extract_grob_set (me, "note-columns", columns); - for (int i = 0 ; i < columns.size (); i++) + for (int i = 0; i < columns.size (); i++) { Grob *nc = columns[i]; Direction d = Note_column::dir (nc); @@ -674,7 +667,6 @@ Tuplet_bracket::add_tuplet_bracket (Grob *me, Grob *bracket) } - ADD_INTERFACE (Tuplet_bracket, "tuplet-bracket-interface", "A bracket with a number in the middle, used for tuplets. " diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc index 5c925b7621..08954e8574 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -33,7 +33,6 @@ struct Tuplet_description }; - class Tuplet_engraver : public Engraver { public: @@ -79,7 +78,6 @@ Tuplet_engraver::process_music () { if (!tuplets_.size ()) return; - tuplets_.sort (&Tuplet_description::compare); for (int i = 0; i < tuplets_.size (); i++) @@ -91,10 +89,10 @@ Tuplet_engraver::process_music () tuplets_[i].music_->self_scm ()); tuplets_[i].spanner_ = spanner; - if (i > 0 && tuplets_[i-1].spanner_) - Tuplet_bracket::add_tuplet_bracket (tuplets_[i].spanner_, tuplets_[i-1].spanner_); - if (i < tuplets_.size()-1 && tuplets_[i+1].spanner_) - Tuplet_bracket::add_tuplet_bracket (tuplets_[i+1].spanner_, tuplets_[i].spanner_); + if (i > 0 && tuplets_[i - 1].spanner_) + Tuplet_bracket::add_tuplet_bracket (tuplets_[i].spanner_, tuplets_[i - 1].spanner_); + if (i < tuplets_.size () - 1 && tuplets_[i + 1].spanner_) + Tuplet_bracket::add_tuplet_bracket (tuplets_[i + 1].spanner_, tuplets_[i].spanner_); SCM proc = get_property ("tupletNumberFormatFunction"); if (ly_is_procedure (proc)) @@ -120,7 +118,7 @@ Tuplet_engraver::start_translation_timestep () Moment now = now_mom (); last_tuplets_.clear (); - if (tuplets_.is_empty()) + if (tuplets_.is_empty ()) return; Moment tsdmom = robust_scm2moment (get_property ("tupletSpannerDuration"), Moment (0)); @@ -134,10 +132,10 @@ Tuplet_engraver::start_translation_timestep () { if (tuplets_[i].spanner_) { - if (full_length ) + if (full_length) { - Item * col = unsmob_item (get_property ("currentMusicalColumn")); - + Item *col = unsmob_item (get_property ("currentMusicalColumn")); + tuplets_[i].spanner_->set_bound (RIGHT, col); } else if (!tuplets_[i].spanner_->get_bound (RIGHT)) @@ -153,9 +151,7 @@ Tuplet_engraver::start_translation_timestep () } if (now.main_part_ >= tuplets_[i].stop_) - { - tuplets_.del (i); - } + tuplets_.del (i); } } @@ -166,7 +162,7 @@ Tuplet_engraver::finalize () { for (int i = 0; i < last_tuplets_.size (); i++) { - Item * col = unsmob_item (get_property ("currentCommandColumn")); + Item *col = unsmob_item (get_property ("currentCommandColumn")); last_tuplets_[i]->set_bound (RIGHT, col); } } @@ -176,10 +172,10 @@ Tuplet_engraver::Tuplet_engraver () { } -ADD_ACKNOWLEDGER (Tuplet_engraver,note_column); +ADD_ACKNOWLEDGER (Tuplet_engraver, note_column); ADD_TRANSLATOR (Tuplet_engraver, /* doc */ "Catch Time_scaled_music and generate appropriate bracket ", /* create */ "TupletBracket", /* accept */ "time-scaled-music", - /* read */ "tupletNumberFormatFunction tupletSpannerDuration tupletFullLength" , + /* read */ "tupletNumberFormatFunction tupletSpannerDuration tupletFullLength", /* write */ ""); diff --git a/lily/type-swallow-translator.cc b/lily/type-swallow-translator.cc index cb420405eb..7e6c04e381 100644 --- a/lily/type-swallow-translator.cc +++ b/lily/type-swallow-translator.cc @@ -67,6 +67,6 @@ ADD_TRANSLATOR (Note_swallow_translator, "", "note-event", "", - + ""); diff --git a/lily/unfolded-repeat-iterator.cc b/lily/unfolded-repeat-iterator.cc index a0fef55567..ef4b72ccb2 100644 --- a/lily/unfolded-repeat-iterator.cc +++ b/lily/unfolded-repeat-iterator.cc @@ -1,6 +1,6 @@ /* unfolded-repeat-iterator.cc -- implement Unfolded_repeat_iterator - + source file of the GNU LilyPond music typesetter (c) 2002--2005 Han-Wen Nienhuys diff --git a/lily/vaticana-ligature-engraver.cc b/lily/vaticana-ligature-engraver.cc index 3a68c6fac8..5ee55163f8 100644 --- a/lily/vaticana-ligature-engraver.cc +++ b/lily/vaticana-ligature-engraver.cc @@ -203,9 +203,7 @@ Vaticana_ligature_engraver::align_heads (Array primitives, { SCM delta_pitch_scm = prev_primitive->get_property ("delta-pitch"); if (delta_pitch_scm != SCM_EOL) - { - delta_pitch = scm_to_int (delta_pitch_scm); - } + delta_pitch = scm_to_int (delta_pitch_scm); else { primitive->programming_error ("Vaticana_ligature:" @@ -369,9 +367,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, int delta_pitch; SCM delta_pitch_scm = primitive->get_property ("delta-pitch"); if (delta_pitch_scm != SCM_EOL) - { - delta_pitch = scm_to_int (delta_pitch_scm); - } + delta_pitch = scm_to_int (delta_pitch_scm); else { primitive->programming_error ("Vaticana_ligature:" @@ -471,14 +467,14 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, prev_primitive->set_property ("add-cauda", ly_bool2scm (false)); } - if (prev_delta_pitch < - 1) - { - glyph_name = "svaticana.reverse.plica"; - } - else - { - glyph_name = "svaticana.reverse.vplica"; - } + if (prev_delta_pitch < - 1) + { + glyph_name = "svaticana.reverse.plica"; + } + else + { + glyph_name = "svaticana.reverse.vplica"; + } } else // (prev_delta_pitch == 0) { diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index a855cd34f7..e9ab261d74 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -22,8 +22,8 @@ class Vertical_align_engraver : public Engraver { Spanner *valign_; bool qualifies (Grob_info) const; - SCM id_to_group_hashtab_; - + SCM id_to_group_hashtab_; + public: TRANSLATOR_DECLARATIONS (Vertical_align_engraver); DECLARE_ACKNOWLEDGER (axis_group); @@ -44,7 +44,6 @@ ADD_TRANSLATOR (Vertical_align_engraver, /* read */ "", /* write */ ""); - Vertical_align_engraver::Vertical_align_engraver () { valign_ = 0; @@ -54,7 +53,7 @@ Vertical_align_engraver::Vertical_align_engraver () void Vertical_align_engraver::derived_mark () const { - scm_gc_mark (id_to_group_hashtab_); + scm_gc_mark (id_to_group_hashtab_); } void @@ -63,7 +62,6 @@ Vertical_align_engraver::initialize () id_to_group_hashtab_ = scm_c_make_hash_table (11); } - void Vertical_align_engraver::process_music () { @@ -103,36 +101,35 @@ Vertical_align_engraver::acknowledge_axis_group (Grob_info i) scm_hash_set_x (id_to_group_hashtab_, scm_makfrom0str (id.to_str0 ()), i.grob ()->self_scm ()); - SCM before_id = i.context ()->get_property ("alignAboveContext"); SCM after_id = i.context ()->get_property ("alignBelowContext"); - - SCM before = scm_hash_ref (id_to_group_hashtab_, before_id, SCM_BOOL_F); - SCM after = scm_hash_ref (id_to_group_hashtab_, after_id, SCM_BOOL_F); - Grob * before_grob = unsmob_grob (before); - Grob * after_grob = unsmob_grob (after); - + SCM before = scm_hash_ref (id_to_group_hashtab_, before_id, SCM_BOOL_F); + SCM after = scm_hash_ref (id_to_group_hashtab_, after_id, SCM_BOOL_F); + + Grob *before_grob = unsmob_grob (before); + Grob *after_grob = unsmob_grob (after); + Align_interface::add_element (valign_, i.grob (), get_property ("verticalAlignmentChildCallback")); if (before_grob || after_grob) { - Grob_array * ga = unsmob_grob_array (valign_->get_object ("elements")); + Grob_array *ga = unsmob_grob_array (valign_->get_object ("elements")); Link_array &arr = ga->array_reference (); - - Grob *added = arr.pop(); - for (int i = 0 ; i < arr.size (); i++) + + Grob *added = arr.pop (); + for (int i = 0; i < arr.size (); i++) { if (arr[i] == before_grob) { arr.insert (added, i); - break ; + break; } else if (arr[i] == after_grob) { arr.insert (added, i + 1); - break ; + break; } } } diff --git a/lily/vertically-spaced-context-engraver.cc b/lily/vertically-spaced-context-engraver.cc index 99a00ef2f0..59aeee40d0 100644 --- a/lily/vertically-spaced-context-engraver.cc +++ b/lily/vertically-spaced-context-engraver.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2005 Han-Wen Nienhuys - */ #include "engraver.hh" @@ -15,7 +14,7 @@ class Vertically_spaced_contexts_engraver : public Engraver { - TRANSLATOR_DECLARATIONS(Vertically_spaced_contexts_engraver); + TRANSLATOR_DECLARATIONS (Vertically_spaced_contexts_engraver); protected: virtual void initialize (); DECLARE_ACKNOWLEDGER (vertically_spaceable); @@ -25,7 +24,6 @@ private: }; - Vertically_spaced_contexts_engraver::Vertically_spaced_contexts_engraver () { system_ = 0; diff --git a/lily/volta-bracket.cc b/lily/volta-bracket.cc index 122167b6e1..6899cba2c1 100644 --- a/lily/volta-bracket.cc +++ b/lily/volta-bracket.cc @@ -44,7 +44,7 @@ Volta_bracket_interface::print (SCM smob) bool no_vertical_end = orig_span && !broken_last_bracket; extract_grob_set (me, "bars", bars); - Grob *endbar = bars.size() ? bars.top () : 0; + Grob *endbar = bars.size () ? bars.top () : 0; SCM glyph = endbar ? endbar->get_property ("glyph") : SCM_EOL; String str; diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index 6ab9ed6ddf..7185b8fb4b 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -30,12 +30,12 @@ protected: DECLARE_ACKNOWLEDGER (staff_symbol); DECLARE_ACKNOWLEDGER (note_column); DECLARE_ACKNOWLEDGER (bar_line); - + virtual void finalize (); virtual void derived_mark () const; void stop_translation_timestep (); void process_music (); - + Moment started_mom_; Spanner *volta_span_; Spanner *end_volta_span_; @@ -176,7 +176,7 @@ void Volta_engraver::acknowledge_note_column (Grob_info i) { if (volta_span_) - Volta_bracket_interface::add_column (volta_span_, i.grob()); + Volta_bracket_interface::add_column (volta_span_, i.grob ()); } void @@ -187,7 +187,7 @@ Volta_engraver::acknowledge_bar_line (Grob_info i) if (end_volta_span_) Volta_bracket_interface::add_bar (end_volta_span_, i.item ()); } - + void Volta_engraver::acknowledge_staff_symbol (Grob_info i) { diff --git a/lily/volta-repeat-iterator.cc b/lily/volta-repeat-iterator.cc index af1127f261..c8132638f7 100644 --- a/lily/volta-repeat-iterator.cc +++ b/lily/volta-repeat-iterator.cc @@ -7,7 +7,6 @@ (c) 2002--2005 Han-Wen Nienhuys */ - #include "music.hh" #include "sequential-iterator.hh" #include "context.hh"