diff options
author | Jan Nieuwenhuizen <janneke@gnu.org> | 2005-08-13 21:35:23 +0000 |
---|---|---|
committer | Jan Nieuwenhuizen <janneke@gnu.org> | 2005-08-13 21:35:23 +0000 |
commit | 108cf0e8c08c8e15e2a800feb161cfad9057daa8 (patch) | |
tree | 947e7f0d3ed2f49344d17cb08979ffb0cdbc8b08 | |
parent | c4f9e3faa057fb8ed7875f1955d9f8592d6f20d4 (diff) |
Nitpick run.
buildscripts/fixcc.py: Fixes.
184 files changed, 458 insertions, 1051 deletions
@@ -1,3 +1,9 @@ +2005-08-13 Jan Nieuwenhuizen <janneke@gnu.org> + + * Nitpick run. + + * buildscripts/fixcc.py: Fixes. + 2005-08-12 Graham Percival <gpermus@gmail.com> * Documentation/user/advanced-notation.itely: add markup diff --git a/buildscripts/fixcc.py b/buildscripts/fixcc.py index dc00e573c7..3773d66b71 100644 --- a/buildscripts/fixcc.py +++ b/buildscripts/fixcc.py @@ -22,17 +22,28 @@ import sys import time COMMENT = 'COMMENT' +STRING = 'STRING' +GLOBAL_CXX = 'GC++' CXX = 'C++' verbose_p = 0 indent_p = 0 rules = { + GLOBAL_CXX: + [ + # delete gratuitous block + ('''\n( |\t)\s*{\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''', + '\n\\2;'), + ], CXX: [ # space before parenthesis open ('([^\( \]])[ \t]*\(', '\\1 ('), # space after comma - (',[ \t]*', ', '), + ("\([^'],\)[ \t]*", '\1 '), + # delete gratuitous block + ('''\n( |\t)\s*{\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''', + '\n\\2;'), # delete inline tabs ('(\w)\t+', '\\1 '), # delete inline double spaces @@ -78,9 +89,6 @@ 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 @@ -94,17 +102,14 @@ rules = { ('\n[ \t]*,', ','), # dangling semicolon ('\n[ \t]*;', ';'), - # delete gratuitous blocks - ('''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'), # brace open backslash ('(\w[^\n]*){[ \t]*\\\\\n', '\\1\\\n{\\\n'), # brace close - ('}[ \t]*([^\n]*\w[^\n\\\]*)\n', '}\n\\1\n'), + ("}[ \t]*([^'\n]*\w[^\n\\\]*)\n", '}\n\\1\n'), # brace close backslash - ('}[ \t]*([^\n]*\w[^\n\\\]*)', '\n}\n\\1'), + ("}[ \t]*([^'\n]*\w[^\n\\\]*)", '\n}\n\\1'), # delete space after `operator' #('(\Woperator) (\W)', '\\1\\2'), # delete space after case, label @@ -169,41 +174,38 @@ rules = { no_match = 'a\ba' snippet_res = { CXX: { - 'include': - no_match, - - 'multiline_comment': - r'''(?sx) - (?P<match> - (?P<code> - [ \t]*/\*.*?\*/))''', - - 'singleline_comment': - r'''(?mx) - ^.* - (?P<match> - (?P<code> - [ \t]*//([ \t][^\n]*|)\n))''', - - 'string': - r'''(?x) - (?P<match> - (?P<code> - "([^"]|(([^\\]|(\\\\))\\"))*"))''', - - 'char': - r'''(?x) - (?P<match> - (?P<code> - '([^']+|\')))''', - - 'include': - r'''(?x) - (?P<match> - (?P<code> - "#[ \t]*include[ \t]*<[^>]*>''', - }, - } + 'multiline_comment': + r'''(?sx) + (?P<match> + (?P<code> + [ \t]*/\*.*?\*/))''', + + 'singleline_comment': + r'''(?mx) + ^.* + (?P<match> + (?P<code> + [ \t]*//([ \t][^\n]*|)\n))''', + + 'string': + r'''(?x) + (?P<match> + (?P<code> + "([^\"\n](\")*)*"))''', + + 'char': + r'''(?x) + (?P<match> + (?P<code> + '([^']+|\')))''', + + 'include': + r'''(?x) + (?P<match> + (?P<code> + "#[ \t]*include[ \t]*<[^>]*>''', + }, + } class Chunk: def replacement_text (self): @@ -212,12 +214,6 @@ class Chunk: def filter_text (self): return self.replacement_text () - def ly_is_outdated (self): - return 0 - - def png_is_outdated (self): - return 0 - class Substring (Chunk): def __init__ (self, source, start, end): self.source = source @@ -231,11 +227,12 @@ class Substring (Chunk): for i in rules[CXX]: if verbose_p: sys.stderr.write ('.') - #sys.stderr.write ('\n*********\n') + #sys.stderr.write ('\n\n***********\n') #sys.stderr.write (i[0]) - #sys.stderr.write ('\n=========\n') + #sys.stderr.write ('\n***********\n') + #sys.stderr.write ('\n=========>>\n') #sys.stderr.write (s) - #sys.stderr.write ('\n*********\n') + #sys.stderr.write ('\n<<=========\n') s = re.sub (i[0], i[1], s) if verbose_p: sys.stderr.write ('done\n') @@ -279,8 +276,7 @@ class Multiline_comment (Snippet): snippet_type_to_class = { 'multiline_comment': Multiline_comment, -# 'lilypond_block': Lilypond_snippet, -# 'lilypond': Lilypond_snippet, +# 'string': Multiline_comment, # 'include': Include_snippet, } @@ -359,13 +355,17 @@ def find_toplevel_snippets (s, types): def nitpick_file (outdir, file): s = open (file).read () + for i in rules[GLOBAL_CXX]: + s = re.sub (i[0], i[1], s) + # FIXME: Containing blocks must be first, see # find_toplevel_snippets. + # We leave simple strings be part of the code snippet_types = ( 'multiline_comment', 'singleline_comment', 'string', - 'char', +# 'char', ) chunks = find_toplevel_snippets (s, snippet_types) @@ -531,6 +531,10 @@ typedef struct _t_ligature typedef std::map < AFM_Ligature const *, int > Bar; + /** + (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl> + */ + /* || * vv * !OK OK @@ -595,10 +599,17 @@ i a = 0 ? *x : *y; +a = "foo() 2,2,4"; +{ + if (!span_) + { + span_ = make_spanner ("StaffSymbol", SCM_EOL); + } +} { - if (foo) + if (!span_) { - a = 1; + span_ = make_spanner (StaffSymbol, SCM_EOL); } } ''' diff --git a/flower/direction.cc b/flower/direction.cc index 71e700893e..db1ef4768e 100644 --- a/flower/direction.cc +++ b/flower/direction.cc @@ -15,12 +15,8 @@ direction_string (Direction d, Axis a) { String s ("center"); if (a == Y_AXIS) - { - s = (d == UP ? "up" : "down"); - } + s = (d == UP ? "up" : "down"); else if (a == X_AXIS) - { - s = (d == LEFT ? "left" : "right"); - } + s = (d == LEFT ? "left" : "right"); return s; } diff --git a/flower/file-path.cc b/flower/file-path.cc index 7803618483..d15c92caf4 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -38,10 +38,10 @@ void File_path::parse_path (String p) { int len; - while ((len = p.length ()) ) + while ((len = p.length ())) { int i = p.index (PATHSEP); - if (i < 0) + if (i < 0) i = len; append (p.left_string (i)); p = p.right_string (len - i - 1); diff --git a/flower/getopt-long.cc b/flower/getopt-long.cc index 5db40734be..dd74d8aff7 100644 --- a/flower/getopt-long.cc +++ b/flower/getopt-long.cc @@ -43,16 +43,16 @@ Getopt_long::parselong () assert (*optnm); char const *endopt = strchr (optnm, '='); - int searchlen = (endopt) ? endopt - optnm : strlen (optnm); + int searchlen = (endopt) ? endopt - optnm : strlen (optnm); - found_option_=0; - for (int i=0; i< table_len_; i++) + found_option_ = 0; + for (int i = 0; i < table_len_; i++) { char const *ln = option_a_[i].longname_str0_; if (ln && !strncmp (ln, optnm, searchlen)) { - found_option_ = option_a_+i; + found_option_ = option_a_ + i; break; } } @@ -65,7 +65,6 @@ Getopt_long::parselong () array_index_++; argument_index_ = 0; - if (found_option_->take_arg_str0_) { if (endopt) @@ -202,9 +201,7 @@ Getopt_long::parseshort () array_index_++; } if (!optional_argument_str0_) - { - report (E_ARGEXPECT); - } + report (E_ARGEXPECT); return found_option_; } @@ -308,9 +305,7 @@ Long_option_init::table_string (Long_option_init *l) int wid = 0; for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++) - { - wid = max (wid, l[i].str_for_help ().length ()); - } + wid = max (wid, l[i].str_for_help ().length ()); for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++) { diff --git a/flower/include/array.icc b/flower/include/array.icc index 118b1f43d3..f5ccafee74 100644 --- a/flower/include/array.icc +++ b/flower/include/array.icc @@ -147,9 +147,7 @@ binary_search (Array<T> const &table, binary_search_bounds (table, key, compare, &lo, &hi); if (! (*compare) (key, table[lo])) - { - return lo; - } + return lo; else return -1; /* not found */ } diff --git a/flower/include/cons.hh b/flower/include/cons.hh index bf1916a90f..5f7238173b 100644 --- a/flower/include/cons.hh +++ b/flower/include/cons.hh @@ -69,9 +69,7 @@ template<class T> Cons<T> *last_cons (Cons<T> *head) { while (head && head->next_) - { - head = head->next_; - } + head = head->next_; return head; } @@ -127,9 +125,7 @@ public: { Cons<T> **p = &head_; for (; *p && i; p = &((*p)->next_)) - { - i--; - } + i--; if (*p) { diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index 6426b90b02..4e3323f748 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -101,7 +101,6 @@ Interval_t<T>::intersect (Interval_t<T> h) elem_ref (RIGHT) = min (h.elem (RIGHT), elem (RIGHT)); } - template<class T> String Interval_t<T>::to_string () const diff --git a/flower/include/parray.hh b/flower/include/parray.hh index 3e2c9bdd75..58a78d7892 100644 --- a/flower/include/parray.hh +++ b/flower/include/parray.hh @@ -217,9 +217,7 @@ void junk_pointers (Link_array<T> &a) { for (int i = 0; i < a.size (); i++) - { - delete a[i]; - } + delete a[i]; a.clear (); } diff --git a/flower/parse-afm.cc b/flower/parse-afm.cc index 60f553b588..d5147f1d74 100644 --- a/flower/parse-afm.cc +++ b/flower/parse-afm.cc @@ -203,13 +203,13 @@ token (FILE *stream) int ch, idx; /* skip over white space */ - while ((ch = fgetc (stream)) == ' ' || ch == lineterm || - ch == lineterm_alt || - ch == ',' || ch == '\t' || ch == ';'); + while ((ch = fgetc (stream)) == ' ' || ch == lineterm + || ch == lineterm_alt + || ch == ',' || ch == '\t' || ch == ';'); idx = 0; - while (idx < MAX_NAME - 1 && - ch != EOF && ch != ' ' && ch != lineterm && ch != lineterm_alt + while (idx < MAX_NAME - 1 + && ch != EOF && ch != ' ' && ch != lineterm && ch != lineterm_alt && ch != '\t' && ch != ':' && ch != ';') { ident[idx++] = ch; @@ -217,8 +217,8 @@ token (FILE *stream) } /* while */ if (ch == EOF && idx < 1) return ((char *)NULL); - if (idx >= 1 && ch != ':' ) ungetc (ch, stream); - if (idx < 1 ) ident[idx++] = ch; /* single-character token */ + if (idx >= 1 && ch != ':') ungetc (ch, stream); + if (idx < 1) ident[idx++] = ch; /* single-character token */ ident[idx] = 0; return (ident); /* returns pointer to the token */ @@ -236,11 +236,11 @@ linetoken (FILE *stream) { int ch, idx; - while ((ch = fgetc (stream)) == ' ' || ch == '\t' ); + while ((ch = fgetc (stream)) == ' ' || ch == '\t'); idx = 0; - while (idx < MAX_NAME - 1 && - ch != EOF && ch != lineterm && ch != lineterm_alt) + while (idx < MAX_NAME - 1 + && ch != EOF && ch != lineterm && ch != lineterm_alt) { ident[idx++] = ch; ch = fgetc (stream); diff --git a/flower/polynomial.cc b/flower/polynomial.cc index 7b60880e7d..906c948c9f 100644 --- a/flower/polynomial.cc +++ b/flower/polynomial.cc @@ -48,9 +48,7 @@ void Polynomial::differentiate () { for (int i = 1; i <= degree (); i++) - { - coefs_[i - 1] = coefs_[i] * i; - } + coefs_[i - 1] = coefs_[i] * i; coefs_.pop (); } diff --git a/flower/string-convert.cc b/flower/string-convert.cc index f1fdb8a67f..af4d9931bd 100644 --- a/flower/string-convert.cc +++ b/flower/string-convert.cc @@ -177,13 +177,13 @@ String_convert::unsigned2hex (unsigned u, int length_i, char fill_char) #endif str = to_string (fill_char, length_i - str.length ()) + str; - while ((str.length () > length_i) && (str[ 0 ] == 'f' ) ) + while ((str.length () > length_i) && (str[ 0 ] == 'f')) str = str.cut_string (2, INT_MAX); return str; } -String +String String_convert::int2hex (int i, int length_i, char fill_char) { return unsigned2hex ((unsigned)i, length_i, fill_char); @@ -192,7 +192,7 @@ String_convert::int2hex (int i, int length_i, char fill_char) Byte String_convert::nibble2hex_byte (Byte byte) { - if ((byte & 0x0f) <= 9 ) + if ((byte & 0x0f) <= 9) return (byte & 0x0f) + '0'; else return (byte & 0x0f) - 10 + 'a'; @@ -305,7 +305,7 @@ String_convert::precision_string (double x, int n) str = "0." + to_string ('0', -dot) + str; else if (dot >= str.length ()) str += to_string ('0', dot - str.length ()); - else if (( dot > 0) && (dot < str.length ())) + else if ((dot > 0) && (dot < str.length ())) str = str.left_string (dot) + "." + str.cut_string (dot, INT_MAX); else assert (0); @@ -343,5 +343,5 @@ String_convert::long_string (long l) String String_convert::pad_to (String s, int n) { - return s + to_string (' ' , max (n - s.length (), 0)); + return s + to_string (' ', max (n - s.length (), 0)); } diff --git a/flower/string.cc b/flower/string.cc index 24ba1e2fea..c4c7d49abf 100644 --- a/flower/string.cc +++ b/flower/string.cc @@ -131,7 +131,6 @@ String::to_bytes () const return strh_.to_bytes (); } - Byte * String::get_bytes () { diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index eb4efce0e9..d81d9a3c36 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -83,7 +83,6 @@ public: Array<Accidental_entry> accidentals_; Link_array<Spanner> ties_; - }; /* @@ -205,19 +204,13 @@ number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch, if (from_same_octave != SCM_BOOL_F && recent_enough (bar_number, from_same_octave, laziness)) - { - previous_alteration = from_same_octave; - } + previous_alteration = from_same_octave; else if (ignore_octave && from_other_octaves != SCM_BOOL_F && recent_enough (bar_number, from_other_octaves, laziness)) - { - previous_alteration = from_other_octaves; - } + previous_alteration = from_other_octaves; else if (from_key_signature != SCM_BOOL_F) - { - previous_alteration = from_key_signature; - } + previous_alteration = from_key_signature; int num = 1; if (is_tied (previous_alteration)) @@ -449,9 +442,7 @@ Accidental_engraver::make_suggested_accidental (Music *note, Side_position_interface::add_support (a, note_head); if (Grob *stem = unsmob_grob (a->get_object ("stem"))) - { - Side_position_interface::add_support (a, stem); - } + Side_position_interface::add_support (a, stem); a->set_parent (note_head, X_AXIS); return a; diff --git a/lily/accidental-placement.cc b/lily/accidental-placement.cc index 5265461bee..63e5f79342 100644 --- a/lily/accidental-placement.cc +++ b/lily/accidental-placement.cc @@ -57,9 +57,7 @@ Accidental_placement::add_accidental (Grob *me, Grob *a) SCM key = scm_from_int (n); SCM entry = scm_assq (key, accs); if (entry == SCM_BOOL_F) - { - entry = SCM_EOL; - } + entry = SCM_EOL; else entry = scm_cdr (entry); @@ -113,9 +111,7 @@ Accidental_placement::get_relevant_accidental_extent (Grob *me, Interval extent; for (int i = 0; i < which->size (); i++) - { - extent.unite (which->elem (i)->extent (item_col, X_AXIS)); - } + extent.unite (which->elem (i)->extent (item_col, X_AXIS)); if (!extent.is_empty ()) { @@ -302,9 +298,7 @@ Accidental_placement::position_accidentals (Grob *me) } for (int i = note_cols.size (); i--;) - { - heads.concat (extract_grob_array (note_cols[i], "note-heads")); - } + heads.concat (extract_grob_array (note_cols[i], "note-heads")); heads.default_sort (); heads.uniq (); diff --git a/lily/accidental.cc b/lily/accidental.cc index ad781baede..bd02de2067 100644 --- a/lily/accidental.cc +++ b/lily/accidental.cc @@ -120,9 +120,7 @@ Accidental_interface::accurate_boxes (Grob *a, Grob **common) Offset o (a->relative_coordinate (common[X_AXIS], X_AXIS), a->relative_coordinate (common[Y_AXIS], Y_AXIS)); for (int i = boxes.size (); i--;) - { - boxes[i].translate (o); - } + boxes[i].translate (o); return boxes; } diff --git a/lily/align-interface.cc b/lily/align-interface.cc index b7fe37c475..adbe9d199c 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -120,9 +120,7 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a) if (a == Y_AXIS && 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); diff --git a/lily/ambitus-engraver.cc b/lily/ambitus-engraver.cc index 803598ff3f..7fdd2fadf0 100644 --- a/lily/ambitus-engraver.cc +++ b/lily/ambitus-engraver.cc @@ -91,9 +91,7 @@ Ambitus_engraver::process_music () * be placed after the rest. */ if (!ambitus_) - { - create_ambitus (); - } + create_ambitus (); } void diff --git a/lily/arpeggio-engraver.cc b/lily/arpeggio-engraver.cc index 5c82930b4f..b488e1be64 100644 --- a/lily/arpeggio-engraver.cc +++ b/lily/arpeggio-engraver.cc @@ -44,9 +44,7 @@ bool Arpeggio_engraver::try_music (Music *m) { if (!arpeggio_event_) - { - arpeggio_event_ = m; - } + arpeggio_event_ = m; return true; } @@ -72,27 +70,21 @@ Arpeggio_engraver::acknowledge_rhythmic_head (Grob_info info) We can't catch local key items (accidentals) from Voice context, see Local_key_engraver */ - { - Side_position_interface::add_support (arpeggio_, info.grob ()); - } + Side_position_interface::add_support (arpeggio_, info.grob ()); } void Arpeggio_engraver::acknowledge_note_column (Grob_info info) { if (arpeggio_) - { - info.grob ()->set_object ("arpeggio", arpeggio_->self_scm ()); - } + info.grob ()->set_object ("arpeggio", arpeggio_->self_scm ()); } void Arpeggio_engraver::process_music () { if (arpeggio_event_) - { - arpeggio_ = make_item ("Arpeggio", arpeggio_event_->self_scm ()); - } + arpeggio_ = make_item ("Arpeggio", arpeggio_event_->self_scm ()); } void diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index a2757706a2..53f70cdf6b 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -65,9 +65,7 @@ Arpeggio::print (SCM smob) SCM ad = me->get_property ("arpeggio-direction"); Direction dir = CENTER; if (is_direction (ad)) - { - dir = to_dir (ad); - } + dir = to_dir (ad); Stencil mol; Font_metric *fm = Font_interface::get_default_font (me); diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 2a90c3e3c5..cdf0ad31df 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -240,9 +240,7 @@ void Auto_beam_engraver::end_beam () { if (stems_->size () < 2) - { - junk_beam (); - } + junk_beam (); else { finished_beam_ = create_beam (); @@ -304,16 +302,13 @@ Auto_beam_engraver::finalize () } - void Auto_beam_engraver::acknowledge_beam (Grob_info info) { (void)info; check_bar_property (); if (stems_) - { - end_beam (); - } + end_beam (); } void diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index 3d6889c6ac..b5b64edbbd 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -61,7 +61,6 @@ Axis_group_interface::relative_group_extent (Link_array<Grob> const &elts, return r; } - 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-line.cc b/lily/bar-line.cc index 8ae2c2ff05..a0a9ccdae4 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -75,13 +75,9 @@ Bar_line::compound_barline (Grob *me, String str, Real h, str = "|:"; if (str == "") - { - return Lookup::blank (Box (Interval (0, 0), Interval (-h / 2, h / 2))); - } + return Lookup::blank (Box (Interval (0, 0), Interval (-h / 2, h / 2))); else if (str == "|") - { - return thin; - } + return thin; else if (str == "|." || (h == 0 && str == ":|")) { m.add_at_edge (X_AXIS, LEFT, thick, 0, 0); diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 698b4bb7a7..9f4fa955a5 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -126,9 +126,7 @@ void Beam_engraver::process_music () { if (beam_ && !to_boolean (get_property ("allowBeamBreak"))) - { - get_score_engraver ()->forbid_breaks (); - } + get_score_engraver ()->forbid_breaks (); if (start_ev_) { diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index b72da881f6..0ee1a01b41 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -25,9 +25,7 @@ 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); - } + return robust_scm2double (scm_cdr (entry), def); return def; } @@ -374,10 +372,9 @@ Beam::score_stem_lengths (Link_array<Grob> const &stems, Direction d = DOWN; do - { - score[d] /= max (count[d], 1); - } - while (flip (&d) != DOWN); + score[d] /= max (count[d], 1); + while (flip (&d) != DOWN) + ; return score[LEFT] + score[RIGHT]; } @@ -402,9 +399,7 @@ Beam::score_slopes_dy (Real yl, Real yr, */ if (fabs (dy / dx) > parameters->ROUND_TO_ZERO_SLOPE && sign (dy_damp) != sign (dy)) - { - dem += parameters->DAMPING_DIRECTION_PENALTY; - } + dem += parameters->DAMPING_DIRECTION_PENALTY; dem += parameters->MUSICAL_DIRECTION_FACTOR *max (0.0, (fabs (dy) - fabs (dy_mus))); diff --git a/lily/beam.cc b/lily/beam.cc index 23311ef551..e0a5fe51c1 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -78,9 +78,7 @@ Beam::get_beam_translation (Grob *me) return scm_to_double (s); } else - { - return 0.81; - } + return 0.81; } /* Maximum beam_count. */ diff --git a/lily/beaming-info.cc b/lily/beaming-info.cc index 4cc9390996..f71ce8cfb2 100644 --- a/lily/beaming-info.cc +++ b/lily/beaming-info.cc @@ -74,10 +74,9 @@ Beaming_info_list::beamify (Moment &beat_length, bool subdivide) Direction d = LEFT; do - { - splits[d].beamify (beat_length, subdivide); - } - while (flip (&d) != LEFT); + splits[d].beamify (beat_length, subdivide); + while (flip (&d) != LEFT) + ; int middle_beams = (split ? 1 : min (splits[RIGHT].beam_extend_count (LEFT), diff --git a/lily/bezier.cc b/lily/bezier.cc index 26ad982419..96b37a8705 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -91,9 +91,7 @@ Bezier::curve_coordinate (Real t, Axis a) const Real one_min_tj[4]; 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++) @@ -114,9 +112,7 @@ Bezier::curve_point (Real t) const Real one_min_tj[4]; 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++) diff --git a/lily/binary-source-file.cc b/lily/binary-source-file.cc index 93aca0ad2b..2c726df90d 100644 --- a/lily/binary-source-file.cc +++ b/lily/binary-source-file.cc @@ -43,13 +43,13 @@ Binary_source_file::quote_input (char const *pos_str0) const String str = pre_string + to_string ('\n') - + to_string (' ', pre_string.length () + 1) + + to_string (' ', pre_string.length () + 1) + post_string; return str; } int -Binary_source_file::get_line (char const* pos_str0) const +Binary_source_file::get_line (char const *pos_str0) const { if (!contains (pos_str0)) return 0; @@ -60,10 +60,9 @@ Binary_source_file::get_line (char const* pos_str0) const U8 Binary_source_file::get_U8 () { - return * (U8*)forward_str0 (1); + return *(U8 *)forward_str0 (1); } - U16 Binary_source_file::get_U16 () { diff --git a/lily/book.cc b/lily/book.cc index 631798e9cd..0c3106e3fa 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -75,8 +75,7 @@ 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) diff --git a/lily/break-algorithm.cc b/lily/break-algorithm.cc index 360eb3f4df..7c41cd27fe 100644 --- a/lily/break-algorithm.cc +++ b/lily/break-algorithm.cc @@ -67,9 +67,7 @@ Break_algorithm::generate_spacing_problem (Link_array<Grob> const &curline, sort out how interfacing this should work; */ if (line.is_empty ()) - { - sp->line_len_ = -1; - } + sp->line_len_ = -1; else sp->line_len_ = line.length (); diff --git a/lily/break-align-interface.cc b/lily/break-align-interface.cc index c7fd035c3b..9778f3076b 100644 --- a/lily/break-align-interface.cc +++ b/lily/break-align-interface.cc @@ -50,9 +50,7 @@ Break_align_interface::self_align_callback (SCM element_smob, SCM axis) Item *item = dynamic_cast<Item *> (me); Direction bsd = item->break_status_dir (); if (bsd == LEFT) - { - me->set_property ("self-alignment-X", scm_from_int (RIGHT)); - } + me->set_property ("self-alignment-X", scm_from_int (RIGHT)); /* Force break alignment itself to be done first, in the case @@ -258,9 +256,7 @@ Break_align_interface::do_alignment (Grob *grob) return; if (me->break_status_dir () == LEFT) - { - alignment_off = -total_extent[RIGHT] - extra_right_space; - } + alignment_off = -total_extent[RIGHT] - extra_right_space; else if (edge_idx < 0) alignment_off = -total_extent[LEFT]; diff --git a/lily/break-substitution.cc b/lily/break-substitution.cc index 670f7e567b..5f6edb9ceb 100644 --- a/lily/break-substitution.cc +++ b/lily/break-substitution.cc @@ -160,9 +160,7 @@ substitute_grob_array (Grob_array *grob_arr, Grob_array *new_arr) new_grobs->set_size (ptr - array); if (new_arr == grob_arr) - { - new_arr->set_array (*new_grobs); - } + new_arr->set_array (*new_grobs); } /* @@ -221,9 +219,7 @@ spanner_system_range (Spanner *sp) Slice rv; if (System *st = sp->get_system ()) - { - rv = Slice (st->get_rank (), st->get_rank ()); - } + rv = Slice (st->get_rank (), st->get_rank ()); else { if (sp->broken_intos_.size ()) diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 6343dffa8c..ac24dcb7de 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -45,9 +45,7 @@ Breathing_sign::divisio_minima (SCM smob) Real thickness = Staff_symbol_referencer::line_thickness (me); thickness *= robust_scm2double (me->get_property ("thickness"), 1.0); if (Staff_symbol_referencer::get_staff_symbol (me)) - { - staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; - } + staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; else staff_size = 0.0; @@ -78,9 +76,7 @@ Breathing_sign::divisio_maior (SCM smob) thickness *= robust_scm2double (me->get_property ("thickness"), 1.0); if (Staff_symbol_referencer::get_staff_symbol (me)) - { - staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; - } + staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; else staff_size = 0.0; @@ -118,9 +114,7 @@ Breathing_sign::divisio_maxima (SCM smob) thickness *= robust_scm2double (me->get_property ("thickness"), 1.0); if (Staff_symbol_referencer::get_staff_symbol (me)) - { - staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; - } + staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; else staff_size = 0.0; @@ -148,9 +142,7 @@ Breathing_sign::finalis (SCM smob) thickness *= robust_scm2double (me->get_property ("thickness"), 1.0); if (Staff_symbol_referencer::get_staff_symbol (me)) - { - staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; - } + staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; else staff_size = 0.0; diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index 0149be9347..9547d7abff 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -91,9 +91,7 @@ Chord_tremolo_engraver::try_music (Music *m) int elt_count = body_is_sequential_ ? scm_ilength (body->get_property ("elements")) : 1; if (body_is_sequential_ && elt_count != 2) - { - m->origin ()->warning (_f ("expect 2 elements for chord tremolo, found %d", elt_count)); - } + m->origin ()->warning (_f ("expect 2 elements for chord tremolo, found %d", elt_count)); if (elt_count <= 0) elt_count = 1; @@ -153,9 +151,7 @@ Chord_tremolo_engraver::acknowledge_stem (Grob_info info) Stem::set_beaming (s, flags_, LEFT); if (Stem::duration_log (s) != 1) - { - beam_->set_property ("gap-count", scm_from_int (flags_ - total_duration_flags_)); - } + beam_->set_property ("gap-count", scm_from_int (flags_ - total_duration_flags_)); if (info.music_cause ()->is_mus_type ("rhythmic-event")) Beam::add_stem (beam_, s); diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 8ac60b91a9..fa54f7a8dc 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -85,9 +85,7 @@ Clef_engraver::acknowledge_bar_line (Grob_info info) { Item *item = dynamic_cast<Item *> (info.grob ()); if (item && scm_is_string (get_property ("clefGlyph"))) - { - create_clef (); - } + create_clef (); } void @@ -174,17 +172,13 @@ Clef_engraver::stop_translation_timestep () { SCM vis = 0; if (to_boolean (clef_->get_property ("non-default"))) - { - vis = get_property ("explicitClefVisibility"); - } + vis = get_property ("explicitClefVisibility"); if (vis) { clef_->set_property ("break-visibility", vis); if (octavate_) - { - octavate_->set_property ("break-visibility", vis); - } + octavate_->set_property ("break-visibility", vis); } clef_ = 0; diff --git a/lily/cluster-engraver.cc b/lily/cluster-engraver.cc index ccd52d3dd2..e8d9980f3b 100644 --- a/lily/cluster-engraver.cc +++ b/lily/cluster-engraver.cc @@ -97,9 +97,7 @@ Cluster_spanner_engraver::process_music () } if (beacon_ && !spanner_) - { - spanner_ = make_spanner ("ClusterSpanner", cluster_notes_[0]->self_scm ()); - } + spanner_ = make_spanner ("ClusterSpanner", cluster_notes_[0]->self_scm ()); if (beacon_ && spanner_) { diff --git a/lily/cluster.cc b/lily/cluster.cc index f6ca03ab35..10b408a88f 100644 --- a/lily/cluster.cc +++ b/lily/cluster.cc @@ -39,9 +39,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi String shape; if (scm_is_symbol (shape_scm)) - { - shape = ly_symbol2string (shape_scm); - } + shape = ly_symbol2string (shape_scm); else { programming_error ("#'style should be symbol."); @@ -111,9 +109,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi out.add_stencil (Lookup::round_filled_polygon (points, blotdiameter)); } else - { - me->warning (_f ("unknown cluster style `%s'", shape.to_str0 ())); - } + me->warning (_f ("unknown cluster style `%s'", shape.to_str0 ())); return out; } diff --git a/lily/coherent-ligature-engraver.cc b/lily/coherent-ligature-engraver.cc index c7dc0a3a7c..f868d48ce3 100644 --- a/lily/coherent-ligature-engraver.cc +++ b/lily/coherent-ligature-engraver.cc @@ -87,9 +87,7 @@ if (incr_scm != SCM_EOL) /* (Paper_column::is_musical (l)) */ ly_display_scm (lc->self_scm ()); Real distance; if (incr_scm != SCM_EOL) - { - distance = scm_to_double (incr_scm); - } + distance = scm_to_double (incr_scm); else { me->warning (_ ("distance undefined, assuming 0.1")); @@ -146,9 +144,7 @@ Coherent_ligature_engraver::get_set_column (Item *item, Paper_column *column) } } else - { - get_set_column (parent, column); - } + get_set_column (parent, column); } /* diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index 53f2044b80..ed0d351345 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -31,9 +31,7 @@ Collision_engraver::process_acknowledged () if (col_ || note_columns_.size () < 2) return; if (!col_) - { - col_ = make_item ("NoteCollision", SCM_EOL); - } + col_ = make_item ("NoteCollision", SCM_EOL); for (int i = 0; i < note_columns_.size (); i++) Note_collision_interface::add_column (col_, note_columns_[i]); diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index dbd7936e49..b594e5be61 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -21,7 +21,6 @@ #include "duration.hh" #include "pitch.hh" - /* TODO: make matching rest engraver. */ @@ -98,9 +97,7 @@ Completion_heads_engraver::try_music (Music *m) return true; } else if (m->is_mus_type ("busy-playing-event")) - { - return note_events_.size () && is_first_; - } + return note_events_.size () && is_first_; return false; } @@ -170,9 +167,7 @@ Completion_heads_engraver::process_music () Duration note_dur; Duration *orig = 0; if (left_to_do_) - { - note_dur = find_nearest_duration (left_to_do_); - } + note_dur = find_nearest_duration (left_to_do_); else { orig = unsmob_duration (note_events_[0]->get_property ("duration")); @@ -191,9 +186,7 @@ Completion_heads_engraver::process_music () } if (orig) - { - left_to_do_ = orig->get_length (); - } + left_to_do_ = orig->get_length (); if (orig && note_dur.get_length () != orig->get_length ()) { @@ -270,9 +263,7 @@ Completion_heads_engraver::process_music () */ if (orig && now_mom ().grace_part_) - { - left_to_do_ = Rational (0, 0); - } + left_to_do_ = Rational (0, 0); } void @@ -287,9 +278,7 @@ Completion_heads_engraver::stop_translation_timestep () dots_.clear (); for (int i = scratch_note_events_.size (); i--;) - { - scratch_note_events_[i]->unprotect (); - } + scratch_note_events_[i]->unprotect (); scratch_note_events_.clear (); } diff --git a/lily/context-def.cc b/lily/context-def.cc index b0eb1c344f..101696f288 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -111,9 +111,7 @@ Context_def::add_context_mod (SCM mod) sym = scm_string_to_symbol (sym); if (ly_symbol2scm ("default-child") == tag) - { - default_child_ = sym; - } + default_child_ = sym; else if (ly_symbol2scm ("consists") == tag || ly_symbol2scm ("consists-end") == tag || ly_symbol2scm ("remove") == tag) diff --git a/lily/context-property.cc b/lily/context-property.cc index 192001015c..dbdde16827 100644 --- a/lily/context-property.cc +++ b/lily/context-property.cc @@ -164,9 +164,7 @@ updated_grob_properties (Context *tg, SCM sym) SCM based_on = scm_cdr (props); if (based_on == daddy_props) - { - return scm_car (props); - } + return scm_car (props); else { SCM copy = daddy_props; diff --git a/lily/context.cc b/lily/context.cc index 2e2c2e8873..dce243596e 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -253,9 +253,7 @@ Context::get_context_key (String type, String id) int disambiguation_count = 0; if (context_counts_.find (now_key) != context_counts_.end ()) - { - disambiguation_count = context_counts_[now_key]; - } + disambiguation_count = context_counts_[now_key]; context_counts_[now_key] = disambiguation_count + 1; @@ -273,9 +271,7 @@ Context::get_grob_key (String name) int disambiguation_count = 0; if (grob_counts_.find (name) != grob_counts_.end ()) - { - disambiguation_count = grob_counts_[name]; - } + disambiguation_count = grob_counts_[name]; grob_counts_[name] = disambiguation_count + 1; Object_key *k = new Lilypond_grob_key (get_key (), @@ -337,15 +333,11 @@ Context::where_defined (SCM sym, SCM *value) const { #ifndef NDEBUG if (profile_property_accesses) - { - note_property_access (&context_property_lookup_table, sym); - } + note_property_access (&context_property_lookup_table, sym); #endif if (properties_dict ()->try_retrieve (sym, value)) - { - return (Context *)this; - } + return (Context *)this; return (daddy_context_) ? daddy_context_->where_defined (sym, value) : 0; } @@ -358,9 +350,7 @@ Context::internal_get_property (SCM sym) const { #ifndef NDEBUG if (profile_property_accesses) - { - note_property_access (&context_property_lookup_table, sym); - } + note_property_access (&context_property_lookup_table, sym); #endif SCM val = SCM_EOL; @@ -494,9 +484,7 @@ Context::now_mom () const { Context const *p = this; while (p->daddy_context_) - { - p = p->daddy_context_; - } + p = p->daddy_context_; return p->now_mom (); } @@ -592,9 +580,7 @@ Context::clear_key_disambiguations () grob_counts_.clear (); context_counts_.clear (); for (SCM s = context_list_; scm_is_pair (s); s = scm_cdr (s)) - { - unsmob_context (scm_car (s))->clear_key_disambiguations (); - } + unsmob_context (scm_car (s))->clear_key_disambiguations (); } /* diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index 5ebb39c6ca..56347d07a4 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -128,9 +128,7 @@ void Custos_engraver::finalize () { for (int i = custodes_.size (); i--;) - { - custodes_[i]->suicide (); - } + custodes_[i]->suicide (); custodes_.clear (); } diff --git a/lily/custos.cc b/lily/custos.cc index 55bad6226b..515e04f761 100644 --- a/lily/custos.cc +++ b/lily/custos.cc @@ -33,13 +33,9 @@ Custos::print (SCM smob) SCM scm_style = me->get_property ("style"); String style; if (scm_is_symbol (scm_style)) - { - style = ly_symbol2string (scm_style); - } + style = ly_symbol2string (scm_style); else - { - style = "mensural"; - } + style = "mensural"; /* * Shall we use a common custos font character regardless if on @@ -68,13 +64,9 @@ Custos::print (SCM smob) font_char += "d"; if (adjust) - { - font_char += (((pos ^ sz) & 0x1) == 0) ? "1" : "0"; - } + font_char += (((pos ^ sz) & 0x1) == 0) ? "1" : "0"; else - { - font_char += "2"; - } + font_char += "2"; Stencil stencil = Font_interface::get_default_font (me)->find_by_name (font_char); diff --git a/lily/dot-column-engraver.cc b/lily/dot-column-engraver.cc index a2c0e2804b..d29df4fdc7 100644 --- a/lily/dot-column-engraver.cc +++ b/lily/dot-column-engraver.cc @@ -58,9 +58,7 @@ Dot_column_engraver::acknowledge_rhythmic_head (Grob_info info) if (d) { if (!dotcol_) - { - dotcol_ = make_item ("DotColumn", SCM_EOL); - } + dotcol_ = make_item ("DotColumn", SCM_EOL); Dot_column::add_head (dotcol_, info.grob ()); } diff --git a/lily/dot-column.cc b/lily/dot-column.cc index 1121ff04be..0acae3b414 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -277,9 +277,7 @@ Dot_column::do_shifts (Grob *me) for (Dot_configuration::const_iterator i (cfg.begin ()); i != cfg.end (); i++) - { - Staff_symbol_referencer::set_position (i->second.dot_, i->first); - } + Staff_symbol_referencer::set_position (i->second.dot_, i->first); return SCM_UNSPECIFIED; } diff --git a/lily/drum-note-performer.cc b/lily/drum-note-performer.cc index e52e0a7ad9..28bc190410 100644 --- a/lily/drum-note-performer.cc +++ b/lily/drum-note-performer.cc @@ -68,9 +68,7 @@ Drum_note_performer::stop_translation_timestep () // --> grace notes effectively do not get delayed Moment now = now_mom (); for (int i = 0; i < notes_.size (); i++) - { - play_element (notes_[i]); - } + play_element (notes_[i]); notes_.clear (); note_evs_.clear (); } diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 1a93d23a12..b6021539d2 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -374,9 +374,7 @@ void Dynamic_engraver::acknowledge_slur (Grob_info info) { if (line_spanner_) - { - Side_position_interface::add_support (line_spanner_, info.grob ()); - } + Side_position_interface::add_support (line_spanner_, info.grob ()); } void @@ -415,9 +413,7 @@ Dynamic_engraver::acknowledge_note_column (Grob_info info) } if (finished_cresc_ && !finished_cresc_->get_bound (RIGHT)) - { - finished_cresc_->set_bound (RIGHT, info.grob ()); - } + finished_cresc_->set_bound (RIGHT, info.grob ()); } void diff --git a/lily/easy-notation.cc b/lily/easy-notation.cc index a786372441..bd24ffbab2 100644 --- a/lily/easy-notation.cc +++ b/lily/easy-notation.cc @@ -42,27 +42,23 @@ Note_head::brew_ez_stencil (SCM smob) charstr = scm_makfrom0str (s); } - SCM letter - = Text_interface::interpret_string (me->get_layout()->self_scm (), + = Text_interface::interpret_string (me->get_layout ()->self_scm (), Font_interface::text_font_alist_chain (me), charstr); - + Stencil l (*unsmob_stencil (letter)); l.align_to (X_AXIS, CENTER); l.align_to (Y_AXIS, CENTER); - - l = Stencil (Box (), l.expr ()); + l = Stencil (Box (), l.expr ()); Real ss = Staff_symbol_referencer::staff_space (me); Real lt = Staff_symbol_referencer::line_thickness (me); Real radius = (ss + lt) / 2.0; - Real stem_thick = 1.3 * lt; + Real stem_thick = 1.3 * lt; if (Grob *stem = unsmob_grob (me->get_object ("stem"))) - { - stem_thick = Stem::thickness (stem); - } + stem_thick = Stem::thickness (stem); int black = (log >= 2); @@ -77,9 +73,7 @@ Note_head::brew_ez_stencil (SCM smob) SCM_BOOL_T)); Stencil white_head; if (black) - { - l = l.in_color (1, 1, 1); - } + l = l.in_color (1, 1, 1); else { white_head = Stencil (extent, diff --git a/lily/engraver-group-engraver.cc b/lily/engraver-group-engraver.cc index 0054eb913a..ff632c7317 100644 --- a/lily/engraver-group-engraver.cc +++ b/lily/engraver-group-engraver.cc @@ -133,7 +133,6 @@ ADD_TRANSLATOR_GROUP (Engraver_group_engraver, /* read */ "", /* write */ ""); - void Engraver_group_engraver::derived_mark () const { diff --git a/lily/file-name-map.cc b/lily/file-name-map.cc index dc1a240e46..de656168cb 100644 --- a/lily/file-name-map.cc +++ b/lily/file-name-map.cc @@ -17,9 +17,7 @@ String map_file_name (String s) { if (file_name_map_global.find (s) != file_name_map_global.end ()) - { - s = file_name_map_global[s]; - } + s = file_name_map_global[s]; return s; } diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index 83c8569166..6fa52ea3bc 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -46,9 +46,7 @@ void Fingering_engraver::acknowledge_stem (Grob_info inf) { for (int i = 0; i < fingerings_.size (); i++) - { - Side_position_interface::add_support (fingerings_[i], inf.grob ()); - } + Side_position_interface::add_support (fingerings_[i], inf.grob ()); } void diff --git a/lily/folded-repeat-iterator.cc b/lily/folded-repeat-iterator.cc index 97dd639dd9..3fa42745f5 100644 --- a/lily/folded-repeat-iterator.cc +++ b/lily/folded-repeat-iterator.cc @@ -35,9 +35,7 @@ Moment Folded_repeat_iterator::pending_moment () const { if (main_iter_) - { - return main_iter_->pending_moment (); - } + return main_iter_->pending_moment (); else return main_length_mom_ + alternative_iter_->pending_moment (); } @@ -72,9 +70,7 @@ Folded_repeat_iterator::process (Moment m) } if (!main_iter_ && !alternative_iter_) - { - enter_alternative (); - } + enter_alternative (); if (alternative_iter_) { @@ -121,9 +117,7 @@ Music_iterator * Folded_repeat_iterator::try_music_in_children (Music *m) const { if (main_iter_) - { - return main_iter_->try_music (m); - } + return main_iter_->try_music (m); if (alternative_iter_) return alternative_iter_->try_music (m); return 0; diff --git a/lily/font-config.cc b/lily/font-config.cc index 46a38b9048..cd21688ad7 100644 --- a/lily/font-config.cc +++ b/lily/font-config.cc @@ -27,7 +27,6 @@ init_fontconfig () if (!FcInit ()) error (_ ("initializing FontConfig failed")); - font_config_global = FcConfigGetCurrent (); Array<String> dirs; struct stat statbuf; diff --git a/lily/font-select.cc b/lily/font-select.cc index 7d0ea7c6e2..61030405fb 100644 --- a/lily/font-select.cc +++ b/lily/font-select.cc @@ -77,9 +77,7 @@ get_font_by_design_size (Output_def *layout, Real requested, #endif } else - { - fm = unsmob_metrics (scm_force (scm_c_vector_ref (font_vector, i))); - } + fm = unsmob_metrics (scm_force (scm_c_vector_ref (font_vector, i))); return find_scaled_font (layout, fm, requested / size); } @@ -114,9 +112,7 @@ select_encoded_font (Output_def *layout, SCM chain) #if HAVE_PANGO_FT2 if (scm_is_string (name) && is_pango_format_global) - { - return select_pango_font (layout, chain); - } + return select_pango_font (layout, chain); else #endif if (scm_is_string (name)) diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index 6d57d47769..d080429791 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -233,7 +233,7 @@ LY_DEFINE (ly_output_formats, "ly:output-formats", SCM lst = SCM_EOL; int output_formats_count = output_formats.size (); - for (int i = 0; i < output_formats_count; i ++) + for (int i = 0; i < output_formats_count; i++) lst = scm_cons (scm_makfrom0str (output_formats[i].to_str0 ()), lst); return lst; @@ -250,9 +250,7 @@ LY_DEFINE (ly_wchar_to_utf_8, "ly:wide-char->utf-8", char *p = buf; if (wide_char < 0x0080) - { - *p++ = (char)wide_char; - } + *p++ = (char)wide_char; else if (wide_char < 0x0800) { *p++ = (char) (((wide_char >> 6)) | 0xC0); diff --git a/lily/glissando-engraver.cc b/lily/glissando-engraver.cc index 424d8664f5..1f3407cd3d 100644 --- a/lily/glissando-engraver.cc +++ b/lily/glissando-engraver.cc @@ -53,9 +53,7 @@ void Glissando_engraver::process_music () { if (event_) - { - line_ = make_spanner ("Glissando", event_->self_scm ()); - } + line_ = make_spanner ("Glissando", event_->self_scm ()); } void @@ -73,9 +71,7 @@ void Glissando_engraver::stop_translation_timestep () { if (last_line_ && last_line_->get_bound (RIGHT)) - { - last_line_ = 0; - } + last_line_ = 0; if (line_) { if (last_line_) diff --git a/lily/global-context.cc b/lily/global-context.cc index 8a534ef3ca..3ecc3b9aaf 100644 --- a/lily/global-context.cc +++ b/lily/global-context.cc @@ -29,9 +29,7 @@ Global_context::Global_context (Output_def *o, Moment final, Object_key *key) Context_def *globaldef = unsmob_context_def (definition_); if (!globaldef) - { - programming_error ("no `Global' context found"); - } + programming_error ("no `Global' context found"); else globaldef->apply_default_property_operations (this); accepts_list_ = scm_list_1 (ly_symbol2scm ("Score")); diff --git a/lily/gregorian-ligature-engraver.cc b/lily/gregorian-ligature-engraver.cc index 4071045740..bb43513e93 100644 --- a/lily/gregorian-ligature-engraver.cc +++ b/lily/gregorian-ligature-engraver.cc @@ -210,9 +210,7 @@ provide_context_info (Array<Grob_info> 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 { prev_context_info |= PES_LOWER; @@ -224,9 +222,7 @@ provide_context_info (Array<Grob_info> primitives) context_info |= FLEXA_RIGHT; } else // (pitch == prev_pitch) - { - primitive->warning (_ ("can't apply `\\~' on heads with identical pitch")); - } + primitive->warning (_ ("can't apply `\\~' on heads with identical pitch")); if (prev_prefix_set & DEMINUTUM) context_info |= AFTER_DEMINUTUM; diff --git a/lily/grid-point-engraver.cc b/lily/grid-point-engraver.cc index f139d2a5ce..524be6bf56 100644 --- a/lily/grid-point-engraver.cc +++ b/lily/grid-point-engraver.cc @@ -29,9 +29,7 @@ Grid_point_engraver::process_music () Moment now = now_mom (); if (!now.main_part_.mod_rat (mom->main_part_)) - { - make_item ("GridPoint", SCM_EOL); - } + make_item ("GridPoint", SCM_EOL); } } diff --git a/lily/grob-array.cc b/lily/grob-array.cc index 5ee86a1d1a..05e6a3425d 100644 --- a/lily/grob-array.cc +++ b/lily/grob-array.cc @@ -105,8 +105,6 @@ grob_list_to_grob_array (SCM lst) SCM arr_scm = Grob_array::make_array (); Grob_array *ga = unsmob_grob_array (arr_scm); for (SCM s = lst; scm_is_pair (s); s = scm_cdr (s)) - { - ga->add (unsmob_grob (scm_car (s))); - } + ga->add (unsmob_grob (scm_car (s))); return arr_scm; } diff --git a/lily/grob-pq-engraver.cc b/lily/grob-pq-engraver.cc index d40552b6ae..42455fd11a 100644 --- a/lily/grob-pq-engraver.cc +++ b/lily/grob-pq-engraver.cc @@ -93,9 +93,7 @@ Grob_pq_engraver::stop_translation_timestep () SCM start_busy = get_property ("busyGrobs"); SCM busy = start_busy; while (scm_is_pair (busy) && *unsmob_moment (scm_caar (busy)) == now) - { - busy = scm_cdr (busy); - } + busy = scm_cdr (busy); started_now_.sort (Grob_pq_entry::compare); SCM lst = SCM_EOL; diff --git a/lily/grob-property.cc b/lily/grob-property.cc index 8cb3243f4b..bf1663e530 100644 --- a/lily/grob-property.cc +++ b/lily/grob-property.cc @@ -42,9 +42,7 @@ Grob::add_to_list_property (SCM sym, SCM thing) = scm_sloppy_assq (sym, mutable_property_alist_); if (handle != SCM_BOOL_F) - { - scm_set_cdr_x (handle, scm_cons (thing, scm_cdr (handle))); - } + scm_set_cdr_x (handle, scm_cons (thing, scm_cdr (handle))); else { /* @@ -60,7 +58,6 @@ Grob::add_to_list_property (SCM sym, SCM thing) } } - extern void check_interfaces_for_property (Grob const *me, SCM sym); void @@ -97,15 +94,12 @@ Grob::internal_set_property (SCM sym, SCM v) //#define PROFILE_PROPERTY_ACCESSES - SCM Grob::internal_get_property (SCM sym) const { #ifndef NDEBUG if (profile_property_accesses) - { - note_property_access (&grob_property_lookup_table, sym); - } + note_property_access (&grob_property_lookup_table, sym); #endif SCM s = scm_sloppy_assq (sym, mutable_property_alist_); @@ -126,7 +120,6 @@ Grob::internal_get_property (SCM sym) const return (s == SCM_BOOL_F) ? SCM_EOL : scm_cdr (s); } - void Grob::internal_set_object (SCM s, SCM v) { diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc index 344612c8f8..4480d4f990 100644 --- a/lily/grob-scheme.cc +++ b/lily/grob-scheme.cc @@ -249,7 +249,6 @@ LY_DEFINE (ly_grob_key, "ly:grob-key", return me->get_key ()->self_scm (); } - 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.cc b/lily/grob.cc index 4ace057b88..1343cea453 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -66,15 +66,11 @@ Grob::Grob (SCM basicprops, We always get a new key object for a new grob. */ if (key_) - { - ((Object_key *)key_)->unprotect (); - } + ((Object_key *)key_)->unprotect (); SCM meta = get_property ("meta"); if (scm_is_pair (meta)) - { - interfaces_ = scm_cdr (scm_assoc (ly_symbol2scm ("interfaces"), meta)); - } + interfaces_ = scm_cdr (scm_assoc (ly_symbol2scm ("interfaces"), meta)); /* TODO: @@ -142,9 +138,7 @@ Grob::Grob (Grob const &s, int copy_index) smobify_self (); if (key_) - { - ((Object_key *)key_)->unprotect (); - } + ((Object_key *)key_)->unprotect (); } Grob::~Grob () @@ -170,9 +164,7 @@ robust_relative_extent (Grob *me, Grob *refp, Axis a) { Interval ext = me->extent (refp, a); if (ext.is_empty ()) - { - ext.add_point (me->relative_coordinate (refp, a)); - } + ext.add_point (me->relative_coordinate (refp, a)); return ext; } diff --git a/lily/hairpin.cc b/lily/hairpin.cc index 1b3fbd4a20..6e9591130c 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -39,9 +39,7 @@ Hairpin::after_line_breaking (SCM smob) if (broken[LEFT] && ly_is_equal (bounds[RIGHT]->get_column ()->get_property ("when"), bounds[LEFT]->get_property ("when"))) - { - me->suicide (); - } + me->suicide (); return SCM_UNSPECIFIED; } diff --git a/lily/hara-kiri-group-spanner.cc b/lily/hara-kiri-group-spanner.cc index a96fe9a226..28043337ff 100644 --- a/lily/hara-kiri-group-spanner.cc +++ b/lily/hara-kiri-group-spanner.cc @@ -38,9 +38,7 @@ Hara_kiri_group_spanner::consider_suicide (Grob *me) if (!to_boolean (me->get_property ("remove-first")) && broken_spanner_index (sp) == 0) - { - return; - } + return; Link_array<Grob> childs; Axis_group_interface::get_children (me, &childs); diff --git a/lily/hyphen-engraver.cc b/lily/hyphen-engraver.cc index 4046ab06d0..b773242809 100644 --- a/lily/hyphen-engraver.cc +++ b/lily/hyphen-engraver.cc @@ -104,18 +104,14 @@ void Hyphen_engraver::process_music () { if (ev_) - { - hyphen_ = make_spanner ("LyricHyphen", ev_->self_scm ()); - } + hyphen_ = make_spanner ("LyricHyphen", ev_->self_scm ()); } void Hyphen_engraver::stop_translation_timestep () { if (finished_hyphen_ && finished_hyphen_->get_bound (RIGHT)) - { - finished_hyphen_ = 0; - } + finished_hyphen_ = 0; if (finished_hyphen_ && hyphen_) { diff --git a/lily/include/grob.hh b/lily/include/grob.hh index a8993b9371..0ab69e1aaf 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -42,7 +42,6 @@ protected: */ SCM interfaces_; - /* BARF */ friend class Spanner; friend SCM ly_grob_properties (SCM); diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 0f92293a4d..eaa638ee00 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -171,5 +171,4 @@ inline SCM ly_cdr (SCM x) { return SCM_CDR (x); } inline bool ly_is_pair (SCM x) { return SCM_I_CONSP (x); } - #endif /* LILY_GUILE_HH */ diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 5e7d39e78a..76275cfab9 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -175,5 +175,4 @@ typedef void (*Engraver_void_function_engraver_grob_info) (Engraver *, Grob_info typedef void (*Translator_void_method_ptr) (Translator *); - #endif /* LILY_PROTO_HH */ diff --git a/lily/include/pointer-group-interface.hh b/lily/include/pointer-group-interface.hh index ba13af355e..217bc4aaf1 100644 --- a/lily/include/pointer-group-interface.hh +++ b/lily/include/pointer-group-interface.hh @@ -36,6 +36,5 @@ Link_array<Item> internal_extract_item_array (Grob const *elt, SCM symbol); #define extract_item_set(grob, prop, set) \ Link_array<Item> set (internal_extract_item_array (grob, ly_symbol2scm (prop))) - #endif /* POINTER_GROUP_INTERFACE_HH */ diff --git a/lily/include/program-option.hh b/lily/include/program-option.hh index c307d88122..20233e7ab4 100644 --- a/lily/include/program-option.hh +++ b/lily/include/program-option.hh @@ -20,5 +20,4 @@ extern bool profile_property_accesses; SCM ly_get_option (SCM); SCM ly_set_option (SCM, SCM); - #endif /* SCM_OPTION_HH */ diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index bf6e37168f..7a669e113b 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -83,7 +83,8 @@ 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 foobar +#define ADD_TRANSLATOR_GROUP(classname, desc, grobs, accepted, read, write) foobar DECLARE_UNSMOB (Translator_group, translator_group); diff --git a/lily/include/translator.icc b/lily/include/translator.icc index 462a287f55..6895d6890b 100644 --- a/lily/include/translator.icc +++ b/lily/include/translator.icc @@ -105,6 +105,5 @@ generic_get_acknowledger (SCM sym, ADD_SCM_INIT_FUNC (CLASS ## NAME ## _ack_adder_initclass, CLASS ## NAME ## _ack_adder); - #endif /* TRANSLATOR_ICC */ diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index a5a6a7c289..b0d2557da8 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -128,9 +128,7 @@ Key_engraver::acknowledge_clef (Grob_info info) (void)info; SCM c = get_property ("createKeyOnClefChange"); if (to_boolean (c)) - { - create_key (false); - } + create_key (false); } void @@ -138,9 +136,7 @@ Key_engraver::acknowledge_bar_line (Grob_info info) { (void)info; if (scm_is_pair (get_property ("keySignature"))) - { - create_key (true); - } + create_key (true); } void diff --git a/lily/key-performer.cc b/lily/key-performer.cc index f9afd63b27..50fd46b171 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -89,9 +89,7 @@ bool Key_performer::try_music (Music *ev) { if (!key_ev_) - { - key_ev_ = ev; - } + key_ev_ = ev; return true; } diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index 62f3a82a7c..d374c59b2a 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -93,13 +93,9 @@ Key_signature_interface::print (SCM smob) SCM scm_style = me->get_property ("style"); String style; if (scm_is_symbol (scm_style)) - { - style = ly_symbol2string (scm_style); - } + style = ly_symbol2string (scm_style); else - { - style = ""; - } + style = ""; SCM newas = me->get_property ("alteration-alist"); Stencil mol; @@ -124,9 +120,7 @@ Key_signature_interface::print (SCM smob) Stencil acc (fm->find_by_name ("accidentals." + font_char)); if (acc.is_empty ()) - { - me->warning (_f ("accidental `%s' not found", font_char)); - } + me->warning (_f ("accidental `%s' not found", font_char)); else { SCM what = scm_caar (s); diff --git a/lily/keyword.cc b/lily/keyword.cc index 378ad4e168..70c84e59e2 100644 --- a/lily/keyword.cc +++ b/lily/keyword.cc @@ -16,9 +16,7 @@ int tabcmp (Keyword_ent const &p1, Keyword_ent const &p2) Keyword_table::Keyword_table (Keyword_ent *tab) { while (tab->name_) - { - table_.push (*tab++); - } + table_.push (*tab++); table_.sort (tabcmp); } diff --git a/lily/ligature-engraver.cc b/lily/ligature-engraver.cc index 0d53cbb3b7..cd975b71e9 100644 --- a/lily/ligature-engraver.cc +++ b/lily/ligature-engraver.cc @@ -147,9 +147,7 @@ Ligature_engraver::process_music () } if (!last_bound_) - { - events_drul_[STOP]->origin ()->warning (_ ("no right bound")); - } + events_drul_[STOP]->origin ()->warning (_ ("no right bound")); else ligature_->set_bound (RIGHT, last_bound_); @@ -181,15 +179,11 @@ Ligature_engraver::process_music () brew_ligature_primitive_proc = ligature_->get_property ("ligature-primitive-callback"); if (brew_ligature_primitive_proc == SCM_EOL) - { - programming_error ("Ligature_engraver: ligature-primitive-callback undefined"); - } + programming_error ("Ligature_engraver: ligature-primitive-callback undefined"); Grob *bound = unsmob_grob (get_property ("currentMusicalColumn")); if (!bound) - { - events_drul_[START]->origin ()->warning (_ ("no left bound")); - } + events_drul_[START]->origin ()->warning (_ ("no left bound")); else ligature_->set_bound (LEFT, bound); diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index d223d59612..f0f90afa65 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -145,7 +145,7 @@ ly_scm2newstr (SCM str, size_t *lenp) if (lenp) *lenp = len; - + return new_str; } return 0; @@ -154,7 +154,7 @@ ly_scm2newstr (SCM str, size_t *lenp) SCM index_get_cell (SCM s, Direction d) { - + assert (d); return (d == LEFT) ? scm_car (s) : scm_cdr (s); } @@ -168,7 +168,7 @@ index_set_cell (SCM s, Direction d, SCM v) scm_set_cdr_x (s, v); return s; } - + bool is_number_pair (SCM p) { @@ -329,7 +329,6 @@ ly_deep_copy (SCM src) return 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. @@ -686,9 +685,7 @@ ly_alist_vals (SCM alist) { SCM x = SCM_EOL; for (SCM p = alist; scm_is_pair (p); p = scm_cdr (p)) - { - x = scm_cons (scm_cdar (p), x); - } + x = scm_cons (scm_cdar (p), x); return x; } diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index 8a331e263a..ad16d150e5 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -144,9 +144,7 @@ Lily_lexer::add_scope (SCM module) start_module_ = scm_current_module (); for (SCM s = scopes_; scm_is_pair (s); s = scm_cdr (s)) - { - ly_use_module (module, scm_car (s)); - } + ly_use_module (module, scm_car (s)); scopes_ = scm_cons (module, scopes_); set_current_scope (); @@ -269,7 +267,7 @@ Lily_lexer::escaped_char (char c) const Input Lily_lexer::here_input () const { - return Input(*lexloc); + return Input (*lexloc); } void diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index cc9fce2f56..4e3d6c58cb 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -85,9 +85,7 @@ void Lily_parser::parse_file (String init, String name, String out_name) { if (output_backend_global == "tex") - { - try_load_text_metrics (out_name); - } + try_load_text_metrics (out_name); // TODO: use $parser lexer_->set_identifier (ly_symbol2scm ("parser"), diff --git a/lily/lilypond-version.cc b/lily/lilypond-version.cc index 3996b42c5e..80db995225 100644 --- a/lily/lilypond-version.cc +++ b/lily/lilypond-version.cc @@ -21,7 +21,7 @@ Lilypond_version::Lilypond_version (String str) { Array<String> version; version = String_convert::split (str, '.'); - + major_ = version[0].to_int (); minor_ = version[1].to_int (); patch_ = 0; diff --git a/lily/lookup.cc b/lily/lookup.cc index 14efd34fe5..91e67d1510 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -96,9 +96,7 @@ Lookup::dashed_slur (Bezier b, Real thick, Real dash_period, Real dash_fraction) Real off = dash_period - on; for (int i = 4; i--;) - { - l = scm_cons (ly_offset2scm (b.control_[i]), l); - } + l = scm_cons (ly_offset2scm (b.control_[i]), l); SCM at = (scm_list_n (ly_symbol2scm ("dashed-slur"), scm_from_double (thick), @@ -172,13 +170,9 @@ Stencil Lookup::round_filled_box (Box b, Real blotdiameter) { if (b.x ().length () < blotdiameter) - { - blotdiameter = b.x ().length (); - } + blotdiameter = b.x ().length (); if (b.y ().length () < blotdiameter) - { - blotdiameter = b.y ().length (); - } + blotdiameter = b.y ().length (); SCM at = (scm_list_n (ly_symbol2scm ("round-filled-box"), scm_from_double (-b[X_AXIS][LEFT]), @@ -381,9 +375,7 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick) int indices[] = {5, 6, 7, 4, 1, 2, 3, 0}; SCM list = SCM_EOL; for (int i = 8; i--;) - { - list = scm_cons (scontrols[indices[i]], list); - } + list = scm_cons (scontrols[indices[i]], list); SCM at = (scm_list_n (ly_symbol2scm ("bezier-sandwich"), ly_quote_scm (list), @@ -662,7 +654,6 @@ Lookup::repeat_slash (Real w, Real s, Real t) Offset p1 (0, 0); Offset p2 (w, w * s); - return Lookup::round_filled_polygon (points, blotdiameter); #endif diff --git a/lily/ly-module.cc b/lily/ly-module.cc index 87ac798788..afa97ae663 100644 --- a/lily/ly-module.cc +++ b/lily/ly-module.cc @@ -81,7 +81,6 @@ ly_use_module (SCM mod, SCM used) #define FUNC_NAME __FUNCTION__ - static SCM accumulate_symbol (void *closure, SCM key, SCM val, SCM result) { @@ -136,7 +135,6 @@ ly_reexport_module (SCM mod) ly_export (mod, ly_module_symbols (mod)); } - #ifdef MODULE_GC_KLUDGE static SCM redefine_keyval (void *closure, SCM key, SCM val, SCM result) diff --git a/lily/main.cc b/lily/main.cc index d2f3a66436..8aba4701fe 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -307,11 +307,11 @@ dir_name (String const file_name) #endif #ifdef __MINGW32__ -# include <winbase.h> +#include <winbase.h> #endif static void -setup_paths (char const* argv0) +setup_paths (char const *argv0) { prefix_directory = LILYPOND_DATADIR; @@ -396,9 +396,7 @@ setup_paths (char const* argv0) struct stat statbuf; String builddir = prefix_directory + "/mf/out/"; if (stat (builddir.to_str0 (), &statbuf) == 0) - { - dirs.push (builddir.to_str0 ()); - } + dirs.push (builddir.to_str0 ()); else { dirs.push (prefix_directory + "/fonts/otf/"); @@ -507,7 +505,6 @@ do_chroot_jail () } #endif - static void main_with_guile (void *, int, char **) { @@ -670,7 +667,7 @@ parse_argv (int argc, char **argv) warranty (); exit (0); break; - + case 'b': output_backend_global = option_parser->optional_argument_str0_; break; @@ -678,7 +675,7 @@ parse_argv (int argc, char **argv) case 'f': output_format_global = option_parser->optional_argument_str0_; break; - + case 'H': dump_header_fieldnames_global .push (option_parser->optional_argument_str0_); diff --git a/lily/measure-grouping-engraver.cc b/lily/measure-grouping-engraver.cc index fbd407c513..e7b6bea5ea 100644 --- a/lily/measure-grouping-engraver.cc +++ b/lily/measure-grouping-engraver.cc @@ -42,9 +42,7 @@ void Measure_grouping_engraver::acknowledge_note_column (Grob_info gi) { if (grouping_) - { - Side_position_interface::add_support (grouping_, gi.grob ()); - } + Side_position_interface::add_support (grouping_, gi.grob ()); } void diff --git a/lily/measure-grouping-spanner.cc b/lily/measure-grouping-spanner.cc index 9918b5051b..5bb983d37f 100644 --- a/lily/measure-grouping-spanner.cc +++ b/lily/measure-grouping-spanner.cc @@ -38,13 +38,9 @@ Measure_grouping::print (SCM grob) TODO: use line interface */ if (which == ly_symbol2scm ("bracket")) - { - m = Lookup::bracket (X_AXIS, iv, t, -height, t); - } + m = Lookup::bracket (X_AXIS, iv, t, -height, t); else if (which == ly_symbol2scm ("triangle")) - { - m = Lookup::triangle (iv, t, height); - } + m = Lookup::triangle (iv, t, height); m.align_to (Y_AXIS, DOWN); m.translate_axis (- me->relative_coordinate (common, X_AXIS), X_AXIS); diff --git a/lily/melisma-translator.cc b/lily/melisma-translator.cc index fbe0aa3bef..ca2ea36638 100644 --- a/lily/melisma-translator.cc +++ b/lily/melisma-translator.cc @@ -29,9 +29,7 @@ bool Melisma_translator::try_music (Music *m) { if (m->is_mus_type ("melisma-playing-event")) - { - return melisma_busy (context ()); - } + return melisma_busy (context ()); else if (m->is_mus_type ("melisma-span-event")) { event_ = m; diff --git a/lily/mensural-ligature.cc b/lily/mensural-ligature.cc index f7396f582d..add51960b9 100644 --- a/lily/mensural-ligature.cc +++ b/lily/mensural-ligature.cc @@ -106,9 +106,7 @@ internal_brew_primitive (Grob *me) Real width = 0.0; Real staff_space = Staff_symbol_referencer::staff_space (me); if (primitive & MLP_ANY) - { - thickness = robust_scm2double (me->get_property ("thickness"), .14); - } + thickness = robust_scm2double (me->get_property ("thickness"), .14); if (primitive & MLP_FLEXA) { @@ -118,9 +116,7 @@ internal_brew_primitive (Grob *me) = robust_scm2double (me->get_property ("flexa-width"), 2.0 * staff_space); } if (primitive & MLP_SINGLE_HEAD) - { - width = robust_scm2double (me->get_property ("head-width"), staff_space); - } + width = robust_scm2double (me->get_property ("head-width"), staff_space); switch (primitive & MLP_ANY) { @@ -193,9 +189,7 @@ internal_brew_primitive (Grob *me) out.add_stencil (join); } else - { - programming_error (_f ("Mensural_ligature: (join_right == 0)")); - } + programming_error (_f ("Mensural_ligature: (join_right == 0)")); } #if 0 /* what happend with the ledger lines? */ diff --git a/lily/midi-def.cc b/lily/midi-def.cc index 4d712f7ed3..e7c3539f16 100644 --- a/lily/midi-def.cc +++ b/lily/midi-def.cc @@ -28,9 +28,7 @@ get_tempo (Output_def *def, wholes_per_min /= 4; } else - { - wholes_per_min /= *w; - } + wholes_per_min /= *w; int beats_per_min = int ((wholes_per_min / one_beat_mom).main_part_); return int (beats_per_min); diff --git a/lily/midi-item.cc b/lily/midi-item.cc index 501bb66f2d..4e6605d530 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -116,7 +116,7 @@ Midi_header::Midi_header (int format_i, int tracks_i, int clocks_per_4_i) String format_string = String_convert::int2hex (format_i, 4, '0'); str += String_convert::hex2bin (format_string); - + String tracks_string = String_convert::int2hex (tracks_i, 4, '0'); str += String_convert::hex2bin (tracks_string); @@ -203,7 +203,7 @@ Midi_key::to_string () const return String_convert::hex2bin (str); } -Midi_time_signature::Midi_time_signature (Audio_time_signature* a) +Midi_time_signature::Midi_time_signature (Audio_time_signature *a) { audio_ = a; clocks_per_1_ = 18; @@ -217,13 +217,13 @@ Midi_time_signature::to_string () const String str = "ff5804"; str += String_convert::int2hex (num, 2, '0'); - str += String_convert::int2hex (intlog2 (den) , 2, '0'); + str += String_convert::int2hex (intlog2 (den), 2, '0'); str += String_convert::int2hex (clocks_per_1_, 2, '0'); str += String_convert::int2hex (8, 2, '0'); return String_convert::hex2bin (str); } -Midi_note::Midi_note (Audio_note* a) +Midi_note::Midi_note (Audio_note *a) { audio_ = a; dynamic_byte_ = 0x7f; @@ -388,7 +388,7 @@ Midi_tempo::to_string () const return String_convert::hex2bin (str); } -Midi_text::Midi_text (Audio_text* a) +Midi_text::Midi_text (Audio_text *a) { audio_ = a; } diff --git a/lily/midi-stream.cc b/lily/midi-stream.cc index af634bf2c0..87a1b581d3 100644 --- a/lily/midi-stream.cc +++ b/lily/midi-stream.cc @@ -64,7 +64,7 @@ Midi_stream::operator << (Midi_item const &midi_c_r) return operator << (str); } -Midi_stream& +Midi_stream & Midi_stream::operator << (int i) { // output binary string ourselves diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc index 57e5ac4993..21eee4e3f9 100644 --- a/lily/midi-walker.cc +++ b/lily/midi-walker.cc @@ -131,9 +131,7 @@ Midi_walker::output_event (Moment now_mom, Midi_item *l) start with graces */ if (delta_t < Moment (0)) - { - delta_t = Moment (0); - } + delta_t = Moment (0); track_->add (delta_t, l); } diff --git a/lily/modified-font-metric.cc b/lily/modified-font-metric.cc index 3001ed89f7..5a616198aa 100644 --- a/lily/modified-font-metric.cc +++ b/lily/modified-font-metric.cc @@ -115,60 +115,60 @@ Modified_font_metric::tex_kludge (String text) const /* Accent marks use width of base letter */ if (i +1 < text.length ()) { - if (text[i + 1]=='\'' || text[i + 1]=='`' || text[i+1]=='"' - || text[i+1]=='^') + if (text[i + 1]=='\'' || text[i + 1]=='`' || text[i + 1]=='"' + || text[i + 1]=='^') { i++; break; } /* For string width \\ is a \ and \_ is a _. */ - if (text[i + 1]=='\\' || text[i+1]=='_') + if (text[i + 1]=='\\' || text[i + 1]=='_') break; } - - for (i++; (i < text.length ()) && !isspace (text[i]) + + for (i++; (i < text.length ()) && !isspace (text[i]) && text[i]!='{' && text[i]!='}'; i++) ; - + /* Compensate for the auto-increment in the outer loop. */ i--; break; - case '{': // Skip '{' and '}' + case '{': // Skip '{' and '}' case '}': break; - - default: + + default: Box b = get_ascii_char ((unsigned char)text[i]); - + /* Use the width of 'x' for unknown characters */ if (b[X_AXIS].length () == 0) b = get_ascii_char ((unsigned char)'x'); - + w += b[X_AXIS].length (); ydims.unite (b[Y_AXIS]); break; } } - + if (ydims.is_empty ()) ydims = Interval (0, 0); - + return Box (Interval (0, w), ydims); } Stencil Modified_font_metric::text_stencil (String text) const { - Box b; - if (Pango_font * pf = dynamic_cast<Pango_font*> (orig_)) + Box b; + if (Pango_font *pf = dynamic_cast<Pango_font *> (orig_)) { Stencil stc = pf->text_stencil (text); Box b = stc.extent_box (); b.scale (magnification_); - Stencil scaled(b, stc.expr()); + Stencil scaled (b, stc.expr ()); return scaled; } @@ -182,7 +182,7 @@ Modified_font_metric::text_dimension (String text) const Box b = lookup_tex_text_dimension (orig_, stext); if (!b[Y_AXIS].is_empty ()) { - b.scale (magnification_); + b.scale (magnification_); return b; } diff --git a/lily/moment.cc b/lily/moment.cc index a8d23fa428..90c3a2da2c 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -158,9 +158,7 @@ Moment::to_string () const { String s = main_part_.to_string (); if (grace_part_) - { - s += "G" + grace_part_.to_string (); - } + s += "G" + grace_part_.to_string (); return s; } diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index ec69a437d3..f5b782d0ad 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -186,9 +186,7 @@ void Multi_measure_rest_engraver::start_translation_timestep () { if (now_mom ().main_part_ >= stop_moment_.main_part_) - { - rest_ev_ = 0; - } + rest_ev_ = 0; Moment mp (robust_scm2moment (get_property ("measurePosition"), Moment (0))); @@ -212,9 +210,7 @@ Multi_measure_rest_engraver::start_translation_timestep () SCM sml = get_property ("measureLength"); Rational ml = (unsmob_moment (sml)) ? unsmob_moment (sml)->main_part_ : Rational (1); if (ml >= Rational (2)) - { - last_rest_->set_property ("use-breve-rest", SCM_BOOL_T); - } + last_rest_->set_property ("use-breve-rest", SCM_BOOL_T); mmrest_ = 0; numbers_.clear (); diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index f774170684..bacb18e3c1 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -100,9 +100,7 @@ Multi_measure_rest::print (SCM smob) int measures = 0; SCM m (me->get_property ("measure-count")); if (scm_is_number (m)) - { - measures = scm_to_int (m); - } + measures = scm_to_int (m); mol.translate_axis (x_off, X_AXIS); return mol.smobbed_copy (); @@ -114,9 +112,7 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space) int measures = 0; SCM m (me->get_property ("measure-count")); if (scm_is_number (m)) - { - measures = scm_to_int (m); - } + measures = scm_to_int (m); if (measures <= 0) return Stencil (); @@ -162,9 +158,7 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space) } } else - { - return church_rest (me, musfont, measures, space); - } + return church_rest (me, musfont, measures, space); } /* diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index b016e6e5aa..022573f675 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -238,9 +238,7 @@ bool is_child_context (Context *me, Context *child) { while (child && child != me) - { - child = child->get_parent_context (); - } + child = child->get_parent_context (); return child == me; } diff --git a/lily/music-scheme.cc b/lily/music-scheme.cc index 114f42e645..f796a451bc 100644 --- a/lily/music-scheme.cc +++ b/lily/music-scheme.cc @@ -42,9 +42,7 @@ LY_DEFINE (ly_music_set_property, "ly:music-set-property!", bool ok = type_check_assignment (sym, val, ly_symbol2scm ("music-type?")); if (ok) - { - sc->internal_set_property (sym, val); - } + sc->internal_set_property (sym, val); return SCM_UNSPECIFIED; } diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index 33cd06ca5f..906419405f 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -119,9 +119,7 @@ Music_sequence::minimum_start (SCM l) Moment m; for (SCM s = l; scm_is_pair (s); s = scm_cdr (s)) - { - m = min (m, unsmob_music (scm_car (s))->start_mom ()); - } + m = min (m, unsmob_music (scm_car (s))->start_mom ()); return m; } diff --git a/lily/music.cc b/lily/music.cc index e8e054311d..8ab9028da0 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -36,13 +36,9 @@ Music::name () const { SCM nm = get_property ("name"); if (scm_is_symbol (nm)) - { - return ly_symbol2string (nm); - } + return ly_symbol2string (nm); else - { - return classname (this); - } + return classname (this); } Music::Music (SCM init) @@ -54,9 +50,7 @@ Music::Music (SCM init) length_callback_ = get_property ("length-callback"); if (!ly_is_procedure (length_callback_)) - { - length_callback_ = duration_length_callback_proc; - } + length_callback_ = duration_length_callback_proc; start_callback_ = get_property ("start-callback"); } @@ -256,9 +250,7 @@ Music::transpose (Pitch delta) */ SCM pa = get_property ("pitch-alist"); if (scm_is_pair (pa)) - { - set_property ("pitch-alist", ly_transpose_key_alist (pa, delta.smobbed_copy ())); - } + set_property ("pitch-alist", ly_transpose_key_alist (pa, delta.smobbed_copy ())); } IMPLEMENT_TYPE_P (Music, "ly:music?"); @@ -332,8 +324,6 @@ Music::duration_length_callback (SCM m) Moment mom; if (d) - { - mom = d->get_length (); - } + mom = d->get_length (); return mom.smobbed_copy (); } diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc index 5cde4e519a..dc55d8e7f3 100644 --- a/lily/new-fingering-engraver.cc +++ b/lily/new-fingering-engraver.cc @@ -79,9 +79,7 @@ New_fingering_engraver::acknowledge_rhythmic_head (Grob_info inf) if (m->is_mus_type ("fingering-event")) 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")); - } + 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); else if (m->is_mus_type ("string-number-event")) @@ -204,9 +202,7 @@ New_fingering_engraver::position_scripts (SCM orientations, positioning the fingerings, setting both X and Y coordinates. */ for (int i = 0; i < scripts->size (); i++) - { - (*scripts)[i].position_ = scm_to_int ((*scripts)[i].head_->get_property ("staff-position")); - } + (*scripts)[i].position_ = scm_to_int ((*scripts)[i].head_->get_property ("staff-position")); for (int i = scripts->size (); i--;) for (int j = heads_.size (); j--;) diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 2e2c167e5d..cbb4d07a74 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -335,9 +335,7 @@ Note_collision_interface::do_shifts (Grob *me) } for (int i = 0; i < amounts.size (); i++) - { - done[i]->translate_axis (amounts[i] - left_most, X_AXIS); - } + done[i]->translate_axis (amounts[i] - left_most, X_AXIS); } Drul_array < Link_array<Grob> diff --git a/lily/note-head.cc b/lily/note-head.cc index 98b58a6f91..10707aeaa9 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -34,9 +34,7 @@ internal_print (Grob *me, String *font_char) { SCM style = me->get_property ("style"); if (!scm_is_symbol (style)) - { - style = ly_symbol2scm ("default"); - } + style = ly_symbol2scm ("default"); SCM log = scm_from_int (Note_head::get_balltype (me)); String suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2)); @@ -69,9 +67,7 @@ internal_print (Grob *me, String *font_char) out = Stencil (Box (Interval (0, 0), Interval (0, 0)), SCM_EOL); } else - { - *font_char = idx; - } + *font_char = idx; return out; } diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 1e16c1414c..c5731ab396 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -80,9 +80,7 @@ Note_heads_engraver::process_music () #if 0 /* TODO: should have a mechanism to switch off these warnings. */ if (!pit) - { - ev->origin ()->warning (_ ("NoteEvent without pitch")); - } + ev->origin ()->warning (_ ("NoteEvent without pitch")); #endif int pos = pit ? pit->steps () : 0; @@ -110,9 +108,7 @@ Note_heads_engraver::process_music () && scm_is_symbol (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); - } + note->set_property ("style", style); } notes_.push (note); diff --git a/lily/note-performer.cc b/lily/note-performer.cc index 6409c77d5b..a8326dab36 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -67,9 +67,7 @@ Note_performer::stop_translation_timestep () // --> grace notes effectively do not get delayed Moment now = now_mom (); for (int i = 0; i < notes_.size (); i++) - { - play_element (notes_[i]); - } + play_element (notes_[i]); notes_.clear (); note_evs_.clear (); } diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index 6f264a7135..2bc95d7650 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -136,7 +136,6 @@ Note_spacing::get_spacing (Grob *me, Item *right_col, */ + max (0.0, -extents[RIGHT][LEFT] - (base_space - increment)))); - /* We don't do complicated stuff: (base_space - increment) is the normal amount of white, which also determines the amount of @@ -220,9 +219,7 @@ Note_spacing::right_column (Grob *me) } if (!mincol) - { - return 0; - } + return 0; return mincol; } diff --git a/lily/object-key-dumper.cc b/lily/object-key-dumper.cc index 8ba5a8c36c..c1ba935b44 100644 --- a/lily/object-key-dumper.cc +++ b/lily/object-key-dumper.cc @@ -20,9 +20,7 @@ Object_key_dumper::mark_smob (SCM smob) for (Key_to_key_map::const_iterator i (dumper->serialized_keys_.begin ()); i != dumper->serialized_keys_.end (); i++) - { - scm_gc_mark ((*i).first->self_scm ()); - } + scm_gc_mark ((*i).first->self_scm ()); return SCM_EOL; } @@ -83,13 +81,9 @@ SCM Object_key_dumper::dump_key (Object_key const *key) { if (key_serial_numbers_.find (key) != key_serial_numbers_.end ()) - { - return key_serial (key_serial_numbers_[key]); - } + return key_serial (key_serial_numbers_[key]); else if (Object_key const *serialized = serialized_keys_[key]) - { - return key_serial (key_serial_numbers_[ serialized_keys_ [serialized] ]); - } + return key_serial (key_serial_numbers_[ serialized_keys_ [serialized] ]); return serialize_key (key); } diff --git a/lily/object-key-undumper.cc b/lily/object-key-undumper.cc index b9baee4564..3a984b37e3 100644 --- a/lily/object-key-undumper.cc +++ b/lily/object-key-undumper.cc @@ -19,9 +19,7 @@ Object_key_undumper::mark_smob (SCM smob) Object_key_undumper *undumper = (Object_key_undumper *) SCM_CELL_WORD_1 (smob); for (Int_to_key_map::const_iterator i (undumper->keys_.begin ()); i != undumper->keys_.end (); i++) - { - scm_gc_mark ((*i).second->self_scm ()); - } + scm_gc_mark ((*i).second->self_scm ()); return SCM_BOOL_F; } diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index 0535cb625e..cd0c67c057 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -35,9 +35,7 @@ load_table (char const *tag_str, FT_Face face, FT_ULong *length) return buffer; } else - { - programming_error ("Cannot find OpenType table."); - } + programming_error ("Cannot find OpenType table."); return 0; } diff --git a/lily/pango-font.cc b/lily/pango-font.cc index ca142d16e4..f2f5af8755 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -184,7 +184,7 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con { ((Pango_font *) this)->register_font_file (file_name, ps_name); pango_fc_font_unlock_face (fcfont); - + SCM expr = scm_list_5 (ly_symbol2scm ("glyph-string"), scm_makfrom0str (ps_name.to_str0 ()), scm_from_double (size), diff --git a/lily/pango-select.cc b/lily/pango-select.cc index 7ca70983ff..31f9f79e77 100644 --- a/lily/pango-select.cc +++ b/lily/pango-select.cc @@ -69,14 +69,10 @@ symbol_to_pango_style (SCM style) { PangoStyle pstyle = PANGO_STYLE_NORMAL; if (style == ly_symbol2scm ("italic")) - { - pstyle = PANGO_STYLE_ITALIC; - } + pstyle = PANGO_STYLE_ITALIC; else if (style == ly_symbol2scm ("oblique") || style == ly_symbol2scm ("slanted")) - { - pstyle = PANGO_STYLE_OBLIQUE; - } + pstyle = PANGO_STYLE_OBLIQUE; return pstyle; } @@ -86,9 +82,7 @@ symbol_to_pango_variant (SCM variant) { PangoVariant pvariant = PANGO_VARIANT_NORMAL; if (variant == ly_symbol2scm ("caps")) - { - pvariant = PANGO_VARIANT_SMALL_CAPS; - } + pvariant = PANGO_VARIANT_SMALL_CAPS; return pvariant; } @@ -97,25 +91,15 @@ symbol_to_pango_weight (SCM weight) { PangoWeight pw = PANGO_WEIGHT_NORMAL; if (weight == ly_symbol2scm ("bold")) - { - pw = PANGO_WEIGHT_BOLD; - } + pw = PANGO_WEIGHT_BOLD; if (weight == ly_symbol2scm ("heavy")) - { - pw = PANGO_WEIGHT_HEAVY; - } + pw = PANGO_WEIGHT_HEAVY; if (weight == ly_symbol2scm ("ultrabold")) - { - pw = PANGO_WEIGHT_ULTRABOLD; - } + pw = PANGO_WEIGHT_ULTRABOLD; if (weight == ly_symbol2scm ("light")) - { - pw = PANGO_WEIGHT_LIGHT; - } + pw = PANGO_WEIGHT_LIGHT; if (weight == ly_symbol2scm ("ultralight")) - { - pw = PANGO_WEIGHT_ULTRALIGHT; - } + pw = PANGO_WEIGHT_ULTRALIGHT; return pw; } diff --git a/lily/paper-column-engraver.cc b/lily/paper-column-engraver.cc index 680deae2bf..256aa430b9 100644 --- a/lily/paper-column-engraver.cc +++ b/lily/paper-column-engraver.cc @@ -96,14 +96,10 @@ Paper_column_engraver::set_columns (Paper_column *new_command, command_column_ = new_command; musical_column_ = new_musical; if (new_command) - { - context ()->set_property ("currentCommandColumn", new_command->self_scm ()); - } + context ()->set_property ("currentCommandColumn", new_command->self_scm ()); if (new_musical) - { - context ()->set_property ("currentMusicalColumn", new_musical->self_scm ()); - } + context ()->set_property ("currentMusicalColumn", new_musical->self_scm ()); system_->add_column (command_column_); system_->add_column (musical_column_); diff --git a/lily/paper-column.cc b/lily/paper-column.cc index d86caaa735..1ae46fee11 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -96,9 +96,7 @@ Paper_column::is_musical (Grob *me) SCM m = me->get_property ("shortest-starter-duration"); Moment s (0); if (unsmob_moment (m)) - { - s = *unsmob_moment (m); - } + s = *unsmob_moment (m); return s != Moment (0); } diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 6b7a1917a7..eb338d2f7e 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -76,9 +76,7 @@ find_pango_font (Output_def *layout, SCM descr, Real factor) SCM size_key = scm_from_double (factor); SCM handle = scm_assoc (size_key, sizes); if (scm_is_pair (handle)) - { - return unsmob_metrics (scm_cdr (handle)); - } + return unsmob_metrics (scm_cdr (handle)); PangoFontDescription *description = pango_font_description_from_string (scm_i_string_chars (descr)); diff --git a/lily/paper-outputter-scheme.cc b/lily/paper-outputter-scheme.cc index 3c2f531e03..706ef0a1f7 100644 --- a/lily/paper-outputter-scheme.cc +++ b/lily/paper-outputter-scheme.cc @@ -10,7 +10,6 @@ #include "warn.hh" #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 " diff --git a/lily/percent-repeat-item.cc b/lily/percent-repeat-item.cc index 8dad52aba3..a8c2a4d0ab 100644 --- a/lily/percent-repeat-item.cc +++ b/lily/percent-repeat-item.cc @@ -40,9 +40,7 @@ Percent_repeat_item_interface::x_percent (Grob *me, int count, Stencil s = brew_slash (me); for (int i = count; i--;) - { - m.add_at_edge (X_AXIS, RIGHT, s, -slash_neg_kern, 0); - } + m.add_at_edge (X_AXIS, RIGHT, s, -slash_neg_kern, 0); Stencil d1 = Font_interface::get_default_font (me)->find_by_name ("dots.dot"); Stencil d2 = d1; d1.translate_axis (0.5, Y_AXIS); diff --git a/lily/performance-scheme.cc b/lily/performance-scheme.cc index 645262f9df..2894b0435e 100644 --- a/lily/performance-scheme.cc +++ b/lily/performance-scheme.cc @@ -22,4 +22,3 @@ LY_DEFINE (ly_performance_write, "ly:performance-write", return SCM_UNSPECIFIED; } - diff --git a/lily/performance.cc b/lily/performance.cc index ca2d061d85..087522ebb4 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -128,7 +128,7 @@ Performance::output_header_track (Midi_stream &midi_stream) Audio_text track_name_a (Audio_text::TRACK_NAME, "Track " + String_convert::int2dec (0, 0, '0')); Midi_text track_name (&track_name_a); - + midi_track.add (Moment (0), &track_name); // Some sequencers read track 0 last. @@ -143,9 +143,7 @@ void Performance::add_element (Audio_element *p) { if (Audio_staff *s = dynamic_cast<Audio_staff *> (p)) - { - audio_staffs_.push (s); - } + audio_staffs_.push (s); audio_element_list_ = new Killing_cons<Audio_element> (p, audio_element_list_); } diff --git a/lily/pfb.cc b/lily/pfb.cc index 4af3609938..d5961f12f5 100644 --- a/lily/pfb.cc +++ b/lily/pfb.cc @@ -58,14 +58,11 @@ pfb2pfa (Byte const *pfb, int length) sprintf (outp, "%02x", *p++); outp += 2; if (! (i % 32)) - { - *outp++ = '\n'; - } + *outp++ = '\n'; } olen = outp - out; } - } out[olen] = 0; @@ -97,7 +94,6 @@ LY_DEFINE (ly_pfb_to_pfa, "ly:pfb->pfa", 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 " diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index a557a8dca9..5fb5c37321 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -233,9 +233,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed) if (!mixed) { if (!p->start_ev_) - { - p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", p->name_)); - } + p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", p->name_)); else s = scm_cadr (strings); p->start_ev_ = p->event_drul_[START]; @@ -246,9 +244,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed) if (!mixed) { if (!p->start_ev_) - { - p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", p->name_)); - } + p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", p->name_)); else s = scm_caddr (strings); p->start_ev_ = 0; @@ -481,17 +477,13 @@ Piano_pedal_engraver::typeset_all (Pedal_info *p) p->finished_bracket_ = 0; if (p->item_) - { - p->item_ = 0; - } + p->item_ = 0; if (p->finished_bracket_) { Grob *r = p->finished_bracket_->get_bound (RIGHT); if (!r) - { - p->finished_bracket_->set_bound (RIGHT, unsmob_grob (get_property ("currentMusicalColumn"))); - } + p->finished_bracket_->set_bound (RIGHT, unsmob_grob (get_property ("currentMusicalColumn"))); p->finished_bracket_ = 0; } diff --git a/lily/piano-pedal-performer.cc b/lily/piano-pedal-performer.cc index fe0bcff1f0..1feec98359 100644 --- a/lily/piano-pedal-performer.cc +++ b/lily/piano-pedal-performer.cc @@ -77,9 +77,7 @@ Piano_pedal_performer::create_audio_elements () if (p->event_drul_[STOP]) { if (!p->start_event_) - { - p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", String (p->name_))); - } + p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", String (p->name_))); else { Audio_piano_pedal *a = new Audio_piano_pedal; diff --git a/lily/pitch-squash-engraver.cc b/lily/pitch-squash-engraver.cc index f6ce236706..e3869bb6f9 100644 --- a/lily/pitch-squash-engraver.cc +++ b/lily/pitch-squash-engraver.cc @@ -22,9 +22,7 @@ Pitch_squash_engraver::acknowledge_note_head (Grob_info i) { SCM newpos = get_property ("squashedPosition"); if (scm_is_number (newpos)) - { - i.grob ()->set_property ("staff-position", newpos); - } + i.grob ()->set_property ("staff-position", newpos); } Pitch_squash_engraver::Pitch_squash_engraver () diff --git a/lily/pointer-group-interface.cc b/lily/pointer-group-interface.cc index 74b4c2e0e2..4d60fec905 100644 --- a/lily/pointer-group-interface.cc +++ b/lily/pointer-group-interface.cc @@ -61,9 +61,7 @@ internal_extract_item_array (Grob const *elt, SCM symbol) Grob_array *arr = unsmob_grob_array (elt->internal_get_object (symbol)); Link_array<Item> items; for (int i = 0; arr && i < arr->size (); i++) - { - items.push (arr->item (i)); - } + items.push (arr->item (i)); return items; } diff --git a/lily/profile.cc b/lily/profile.cc index e0509e56a2..e599501422 100644 --- a/lily/profile.cc +++ b/lily/profile.cc @@ -21,7 +21,6 @@ LY_DEFINE (ly_context_property_lookup_stats, "ly:context-property-lookup-stats", : scm_c_make_hash_table (1); } - LY_DEFINE (ly_property_lookup_stats, "ly:grob-property-lookup-stats", 0, 0, 0, (), "") diff --git a/lily/program-option.cc b/lily/program-option.cc index c1d4d572b3..de93d2dd76 100644 --- a/lily/program-option.cc +++ b/lily/program-option.cc @@ -119,7 +119,7 @@ get_help_string () opt_help.substitute (String ("\n"), String ("\n") + String_convert::char_string (' ', HELP_INDENT)); - + opts.push (opt_spec + opt_help + "\n"); } @@ -168,9 +168,7 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val), __FUNCTION__, "symbol"); if (ly_symbol2scm ("help") == var) - { - ly_option_usage (); - } + ly_option_usage (); if (val == SCM_UNDEFINED) val = SCM_BOOL_T; @@ -184,9 +182,7 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val), SCM handle = scm_hashq_get_handle (option_hash_, var); if (handle == SCM_BOOL_F) - { - warning (_f ("no such internal option: %s", varstr.to_str0 ())); - } + warning (_f ("no such internal option: %s", varstr.to_str0 ())); internal_set_option (var, val); return SCM_UNSPECIFIED; diff --git a/lily/quote-iterator.cc b/lily/quote-iterator.cc index fd7498d7be..2eecb72fe4 100644 --- a/lily/quote-iterator.cc +++ b/lily/quote-iterator.cc @@ -117,9 +117,7 @@ Quote_iterator::construct_children () quote_outlet_.set_context (cue_context); } else - { - quote_outlet_.set_context (get_outlet ()); - } + quote_outlet_.set_context (get_outlet ()); event_vector_ = get_music ()->get_property ("quoted-events"); diff --git a/lily/repeat-acknowledge-engraver.cc b/lily/repeat-acknowledge-engraver.cc index 183f7e88c0..b765d40236 100644 --- a/lily/repeat-acknowledge-engraver.cc +++ b/lily/repeat-acknowledge-engraver.cc @@ -102,9 +102,7 @@ Repeat_acknowledge_engraver::process_music () if (!scm_is_string (wb) || ly_is_equal (db, wb)) { if (s != "" || (volta_found && !scm_is_string (wb))) - { - context ()->set_property ("whichBar", scm_makfrom0str (s.to_str0 ())); - } + context ()->set_property ("whichBar", scm_makfrom0str (s.to_str0 ())); } } diff --git a/lily/repeated-music.cc b/lily/repeated-music.cc index ee586efc89..34b8e56c04 100644 --- a/lily/repeated-music.cc +++ b/lily/repeated-music.cc @@ -48,9 +48,7 @@ Repeated_music::relative_callback (SCM music, SCM pitch) return last.smobbed_copy (); } else - { - return me->generic_to_relative_octave (p).smobbed_copy (); - } + return me->generic_to_relative_octave (p).smobbed_copy (); } Moment @@ -97,9 +95,7 @@ Repeated_music::body_get_length (Music *me) { Moment m = 0; if (Music *body = unsmob_music (me->get_property ("element"))) - { - m = body->get_length (); - } + m = body->get_length (); return m; } @@ -149,9 +145,7 @@ Repeated_music::minimum_start (SCM m) if (body) return body->start_mom ().smobbed_copy (); else - { - return Music_sequence::minimum_start (me->get_property ("elements")).smobbed_copy (); - } + return Music_sequence::minimum_start (me->get_property ("elements")).smobbed_copy (); } MAKE_SCHEME_CALLBACK (Repeated_music, first_start, 1); diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 4d7ad33486..e7d8db4a2d 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -201,9 +201,7 @@ Rest_collision::do_shift (Grob *me) Rests and notes. */ if (rests.size () > 1) - { - warning (_ ("too many colliding rests")); - } + warning (_ ("too many colliding rests")); Grob *rcol = 0; Direction dir = CENTER; diff --git a/lily/rest.cc b/lily/rest.cc index efeb00b41b..e36525262b 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -31,9 +31,7 @@ Rest::after_line_breaking (SCM smob) me->translate_axis (ss, Y_AXIS); } else - { - me->translate_axis (ss / 2, Y_AXIS); - } + me->translate_axis (ss / 2, Y_AXIS); Grob *d = unsmob_grob (me->get_object ("dot")); if (d && bt > 4) // UGH. diff --git a/lily/score-performer.cc b/lily/score-performer.cc index 6392a52147..c7d8165312 100644 --- a/lily/score-performer.cc +++ b/lily/score-performer.cc @@ -38,9 +38,7 @@ void Score_performer::play_element (Audio_element *p) { if (Audio_item *i = dynamic_cast<Audio_item *> (p)) - { - audio_column_->add_audio_item (i); - } + audio_column_->add_audio_item (i); performance_->add_element (p); } diff --git a/lily/script-column-engraver.cc b/lily/script-column-engraver.cc index 0b6253c4c7..5e9c668093 100644 --- a/lily/script-column-engraver.cc +++ b/lily/script-column-engraver.cc @@ -56,9 +56,7 @@ void Script_column_engraver::process_acknowledged () { if (!scol_ && scripts_.size () > 1) - { - scol_ = make_item ("ScriptColumn", SCM_EOL); - } + scol_ = make_item ("ScriptColumn", SCM_EOL); if (scol_) { diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index 759e8849d8..7b8ce78cc6 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -102,9 +102,7 @@ Separating_line_group_engraver::finalize () if (last_spacings_.staff_spacing_ && last_spacings_.staff_spacing_->get_column () == column) - { - last_spacings_.staff_spacing_->suicide (); - } + last_spacings_.staff_spacing_->suicide (); } void @@ -193,9 +191,7 @@ void Separating_line_group_engraver::stop_translation_timestep () { if (break_item_) - { - Separating_group_spanner::add_spacing_unit (sep_span_, break_item_); - } + Separating_group_spanner::add_spacing_unit (sep_span_, break_item_); if (Item *sp = current_spacings_.staff_spacing_) { @@ -209,16 +205,12 @@ Separating_line_group_engraver::stop_translation_timestep () } if (!current_spacings_.is_empty ()) - { - last_spacings_ = current_spacings_; - } + last_spacings_ = current_spacings_; current_spacings_.clear (); if (musical_item_) - { - Separating_group_spanner::add_spacing_unit (sep_span_, musical_item_); - } + Separating_group_spanner::add_spacing_unit (sep_span_, musical_item_); musical_item_ = 0; } diff --git a/lily/separation-item.cc b/lily/separation-item.cc index fce28831cc..4b80e14793 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -67,9 +67,7 @@ Separation_item::width (Grob *me) { SCM sw = me->get_property ("X-extent"); if (is_number_pair (sw)) - { - return ly_scm2interval (sw); - } + return ly_scm2interval (sw); Item *item = dynamic_cast<Item *> (me); Paper_column *pc = item->get_column (); diff --git a/lily/sequential-iterator.cc b/lily/sequential-iterator.cc index 0f9b429549..6174c202f1 100644 --- a/lily/sequential-iterator.cc +++ b/lily/sequential-iterator.cc @@ -123,9 +123,7 @@ Sequential_iterator::construct_children () } while (iter_ && !iter_->ok ()) - { - next_element (true); - } + next_element (true); last_mom_ = Moment (-1); here_mom_ = get_music ()->start_mom (); @@ -232,9 +230,7 @@ Sequential_iterator::pending_moment () const Grace_fixup *gf = get_grace_fixup (); if (gf && gf->length_ + iter_->music_start_mom () == cp) - { - return here_mom_ + gf->length_ + Moment (0, gf->grace_start_); - } + return here_mom_ + gf->length_ + Moment (0, gf->grace_start_); /* Fix-up a grace note at the start of the music. diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index a4dc76cf8e..0acb79da21 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -39,16 +39,12 @@ Side_position_interface::get_direction (Grob *me) Direction relative_dir = Direction (1); SCM reldir = me->get_property ("side-relative-direction"); // should use a lambda. if (is_direction (reldir)) - { - relative_dir = to_dir (reldir); - } + relative_dir = to_dir (reldir); SCM other_elt = me->get_object ("direction-source"); Grob *e = unsmob_grob (other_elt); if (e) - { - return (Direction) (relative_dir * get_grob_direction (e)); - } + return (Direction) (relative_dir * get_grob_direction (e)); return CENTER; } diff --git a/lily/simple-spacer-scheme.cc b/lily/simple-spacer-scheme.cc index c38d1e52ed..ec9f4ac35d 100644 --- a/lily/simple-spacer-scheme.cc +++ b/lily/simple-spacer-scheme.cc @@ -73,21 +73,15 @@ LY_DEFINE (ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem", SCM force_return = SCM_BOOL_F; if (!isinf (spacer.force_) && (spacer.is_active () || is_ragged)) - { - force_return = scm_from_double (spacer.force_); - } + force_return = scm_from_double (spacer.force_); if (is_ragged && posns.top () > spacer.line_len_) - { - force_return = SCM_BOOL_F; - } + force_return = SCM_BOOL_F; SCM retval = SCM_EOL; for (int i = posns.size (); i--;) - { - retval = scm_cons (scm_from_double (posns[i]), retval); - } + retval = scm_cons (scm_from_double (posns[i]), retval); retval = scm_cons (force_return, retval); return retval; diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index 10758ff5bb..a37f040c86 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -134,9 +134,7 @@ Simple_spacer::active_blocking_force () const Real bf = -infinity_f; for (int i = 0; i < springs_.size (); i++) if (springs_[i].is_active_) - { - bf = max (bf, springs_[i].block_force_); - } + bf = max (bf, springs_[i].block_force_); return bf; } @@ -356,9 +354,7 @@ Simple_spacer::add_spring (Real ideal, Real inverse_hooke) } if (!inverse_hooke) - { - desc.is_active_ = false; - } + desc.is_active_ = false; else { /* @@ -387,13 +383,9 @@ Simple_spacer_wrapper::add_columns (Link_array<Grob> const &icols) for (int i = 0; i < icols.size (); i++) if (scm_is_pair (icols[i]->get_object ("between-cols"))) - { - loose_cols_.push (icols[i]); - } + loose_cols_.push (icols[i]); else - { - cols.push (icols[i]); - } + cols.push (icols[i]); spaced_cols_ = cols; for (int i = 0; i < cols.size () - 1; i++) diff --git a/lily/slash-repeat-engraver.cc b/lily/slash-repeat-engraver.cc index 01099b1f7b..92115d3904 100644 --- a/lily/slash-repeat-engraver.cc +++ b/lily/slash-repeat-engraver.cc @@ -105,9 +105,7 @@ void Slash_repeat_engraver::start_translation_timestep () { if (stop_mom_ == now_mom ()) - { - repeat_ = 0; - } + repeat_ = 0; beat_slash_ = 0; } diff --git a/lily/slur-configuration.cc b/lily/slur-configuration.cc index 937a4fb02a..4e14589d81 100644 --- a/lily/slur-configuration.cc +++ b/lily/slur-configuration.cc @@ -131,9 +131,7 @@ Slur_configuration::generate_curve (Slur_score_state const &state, max_h = len / 3.0; } else - { - max_h = sqrt (max_h); - } + max_h = sqrt (max_h); Real eccentricity = robust_scm2double (state.slur_->get_property ("eccentricity"), 0); diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 2595521ed0..b5a91f4678 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -375,13 +375,9 @@ set_slur_control_points (Grob *me) Bezier best; if (is_number_pair (end_ys)) - { - best = state.configurations_[state.get_closest_index (end_ys)]->curve_; - } + best = state.configurations_[state.get_closest_index (end_ys)]->curve_; else - { - best = state.get_best_curve (); - } + best = state.get_best_curve (); SCM controls = SCM_EOL; for (int i = 4; i--;) @@ -614,7 +610,6 @@ Slur_score_state::move_away_from_staffline (Real y, return y; } - Array<Offset> Slur_score_state::generate_avoid_offsets () const { diff --git a/lily/smobs.cc b/lily/smobs.cc index e2ec5d5638..e984567be5 100644 --- a/lily/smobs.cc +++ b/lily/smobs.cc @@ -23,9 +23,7 @@ protect_smob (SCM smob, SCM *prot_cons) { SCM s = scm_cdr (smob_protection_list); while (scm_is_pair (s) && scm_car (s) == SCM_UNDEFINED) - { - s = scm_cdr (s); - } + s = scm_cdr (s); SCM prot = scm_cons (smob, s); scm_set_cdr_x (smob_protection_list, @@ -39,9 +37,7 @@ unprotect_smob (SCM *prot_cons) SCM next = scm_cdr (*prot_cons); if (next == SCM_EOL) - { - scm_set_car_x (*prot_cons, SCM_UNDEFINED); - } + scm_set_car_x (*prot_cons, SCM_UNDEFINED); else { scm_set_car_x (*prot_cons, SCM_UNDEFINED); diff --git a/lily/source-file.cc b/lily/source-file.cc index fe152dc226..af9005e9e7 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -117,10 +117,10 @@ Source_file::init_port () int Source_file::tell () const { - return pos_str0_ - contents_str0_; + return pos_str0_ - contents_str0_; } -std::istream* +std::istream * Source_file::get_istream () { if (!istream_) @@ -152,7 +152,6 @@ Source_file::file_line_column_string (char const *context_str0) const } } - String Source_file::quote_input (char const *pos_str0) const { @@ -201,7 +200,7 @@ Source_file::line_slice (char const *pos_str0) const break; } - char const* end_str0 = pos_str0; + char const *end_str0 = pos_str0; while (end_str0 < eof_C_) if (*end_str0++ == '\n') { @@ -213,7 +212,7 @@ Source_file::line_slice (char const *pos_str0) const } String -Source_file::line_string (char const* pos_str0) const +Source_file::line_string (char const *pos_str0) const { if (!contains (pos_str0)) return ""; @@ -271,11 +270,11 @@ Source_file::get_counts (char const *pos_str0, thislen = 1; if (thislen == 1 && line_chars[0] == '\t') - (*column) = (*column / 8 + 1) * 8; + (*column) = (*column / 8 + 1) * 8; else - (*column) ++; + (*column)++; - (*line_char) ++; + (*line_char)++; /* Advance past this character. */ line_chars += thislen; left -= thislen; @@ -329,7 +328,7 @@ Source_file::to_str0 () const } void -Source_file::set_pos (char const * pos_str0) +Source_file::set_pos (char const *pos_str0) { if (contains (pos_str0)) pos_str0_ = pos_str0; diff --git a/lily/spaceable-grob.cc b/lily/spaceable-grob.cc index f3a4891483..6ae304dfa3 100644 --- a/lily/spaceable-grob.cc +++ b/lily/spaceable-grob.cc @@ -49,9 +49,7 @@ Spaceable_grob::add_rod (Grob *me, Grob *p, Real d) } if (Paper_column::get_rank (p) < Paper_column::get_rank (me)) - { - programming_error ("Adding reverse rod"); - } + programming_error ("Adding reverse rod"); mins = scm_cons (scm_cons (p->self_scm (), newdist), mins); me->set_object ("minimum-distances", mins); diff --git a/lily/spacing-determine-loose-columns.cc b/lily/spacing-determine-loose-columns.cc index 2565d61adb..58d821a99e 100644 --- a/lily/spacing-determine-loose-columns.cc +++ b/lily/spacing-determine-loose-columns.cc @@ -89,9 +89,7 @@ is_loose_column (Grob *l, Grob *c, Grob *r, Spacing_options const *options) */ if (! ((Paper_column::is_musical (l_neighbor) || Item::is_breakable (l_neighbor)) && (Paper_column::is_musical (r_neighbor) || Item::is_breakable (r_neighbor)))) - { - return false; - } + return false; /* A rather hairy check, but we really only want to move around @@ -207,9 +205,7 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols, dists[d] = max (dists[d], fixed_space); } else - { - programming_error ("Subversive spacing wish"); - } + programming_error ("Subversive spacing wish"); } } while (flip (&d) != LEFT); @@ -295,9 +291,7 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> const &cols) } if (rn_arr->size ()) - { - cols[i]->set_object ("right-neighbors", right_neighbors); - } + cols[i]->set_object ("right-neighbors", right_neighbors); } } diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 2992c88593..4bf6d551d8 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -23,16 +23,13 @@ #include "staff-spacing.hh" #include "spacing-interface.hh" - Rational Spacing_spanner::effective_shortest_duration (Grob *me, Link_array<Grob> const &all) { SCM preset_shortest = me->get_property ("common-shortest-duration"); Rational global_shortest; if (unsmob_moment (preset_shortest)) - { - global_shortest = unsmob_moment (preset_shortest)->main_part_; - } + global_shortest = unsmob_moment (preset_shortest)->main_part_; else { global_shortest = Spacing_spanner::find_shortest (me, all); @@ -249,9 +246,7 @@ Spacing_spanner::musical_column_spacing (Grob *me, Real compound_fixed_note_space = 0.0; if (options->stretch_uniformly_) - { - compound_note_space = base_note_space; - } + compound_note_space = base_note_space; else { int wish_count = 0; @@ -414,9 +409,7 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r, } if (options->stretch_uniformly_ && l->break_status_dir () != RIGHT) - { - compound_fixed = 0.0; - } + compound_fixed = 0.0; assert (!isinf (compound_space)); compound_space = max (compound_space, compound_fixed); @@ -447,8 +440,7 @@ ADD_INTERFACE (Spacing_spanner, "spacing-spanner-interface", "grace-space-factor spacing-increment base-shortest-duration strict-note-spacing " "shortest-duration-space common-shortest-duration uniform-stretching " - "packed-spacing " - ); + "packed-spacing "); ADD_INTERFACE (Spacing_interface, "spacing-interface", "Something to do with line breaking and spacing. " diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc index cbf77b2673..72cdfbad85 100644 --- a/lily/span-arpeggio-engraver.cc +++ b/lily/span-arpeggio-engraver.cc @@ -42,9 +42,7 @@ void Span_arpeggio_engraver::acknowledge_arpeggio (Grob_info info) { if (info.origin_contexts (this).size ()) // huh? what's this test for? - { - arpeggios_.push (info.grob ()); - } + arpeggios_.push (info.grob ()); } void @@ -59,9 +57,7 @@ Span_arpeggio_engraver::process_acknowledged () */ if (!span_arpeggio_ && arpeggios_.size () > 1 && to_boolean (get_property ("connectArpeggios"))) - { - span_arpeggio_ = make_item ("Arpeggio", SCM_EOL); - } + span_arpeggio_ = make_item ("Arpeggio", SCM_EOL); } void diff --git a/lily/span-bar.cc b/lily/span-bar.cc index c668844ce3..9a3312daa0 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -173,9 +173,7 @@ Span_bar::evaluate_empty (Grob *me) extract_grob_set (me, "elements", elements); if (elements.is_empty ()) - { - me->suicide (); - } + me->suicide (); } void @@ -189,9 +187,7 @@ Span_bar::evaluate_glyph (Grob *me) extract_grob_set (me, "elements", elements); for (int i = elements.size (); i-- && !scm_is_string (gl);) - { - gl = elements[i]->get_property ("glyph"); - } + gl = elements[i]->get_property ("glyph"); if (!scm_is_string (gl)) { @@ -201,17 +197,11 @@ Span_bar::evaluate_glyph (Grob *me) String type = ly_scm2string (gl); if (type == "|:") - { - type = ".|"; - } + type = ".|"; else if (type == ":|") - { - type = "|."; - } + type = "|."; else if (type == ":|:") - { - type = ".|."; - } + type = ".|."; gl = scm_makfrom0str (type.to_str0 ()); if (scm_equal_p (me->get_property ("glyph"), gl) diff --git a/lily/span-dynamic-performer.cc b/lily/span-dynamic-performer.cc index f9b20d7182..96bbcdae97 100644 --- a/lily/span-dynamic-performer.cc +++ b/lily/span-dynamic-performer.cc @@ -58,9 +58,7 @@ void Span_dynamic_performer::acknowledge_audio_element (Audio_element_info i) { if (Audio_dynamic *d = dynamic_cast<Audio_dynamic *> (i.elem_)) - { - last_volume_ = d->volume_; - } + last_volume_ = d->volume_; } void @@ -105,14 +103,10 @@ Span_dynamic_performer::process_music () } if (span_events_[STOP]) - { - finished_dynamic_tuples_.top ().audio_->volume_ = last_volume_; - } + finished_dynamic_tuples_.top ().audio_->volume_ = last_volume_; if (span_events_[START]) - { - dynamic_tuples_[0].audio_->volume_ = last_volume_; - } + dynamic_tuples_[0].audio_->volume_ = last_volume_; span_events_[START] = 0; span_events_[STOP] = 0; diff --git a/lily/spanner.cc b/lily/spanner.cc index d5eaa3aaa4..2c961fffc1 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -185,9 +185,7 @@ Spanner::set_bound (Direction d, Grob *s) We check for System to prevent the column -> line_of_score -> column -> line_of_score -> etc situation */ if (d == LEFT && !dynamic_cast<System *> (this)) - { - set_parent (i, X_AXIS); - } + set_parent (i, X_AXIS); /* Signal that this column needs to be kept alive. They need to be @@ -198,9 +196,7 @@ Spanner::set_bound (Direction d, Grob *s) */ if (dynamic_cast<Paper_column *> (i)) - { - Pointer_group_interface::add_grob (i, ly_symbol2scm ("bounded-by-me"), this); - } + Pointer_group_interface::add_grob (i, ly_symbol2scm ("bounded-by-me"), this); } Spanner::Spanner (SCM s, Object_key const *key) diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index 45e06833a7..a7e51ea629 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -138,8 +138,6 @@ void Staff_performer::acknowledge_audio_element (Audio_element *p) { if (Audio_item *ai = dynamic_cast<Audio_item *> (p)) - { - audio_staff_->add_audio_item (ai); - } + audio_staff_->add_audio_item (ai); } diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index 7a746404e6..5860306984 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -49,9 +49,7 @@ Staff_spacing::next_note_correction (Grob *me, max_corr = max (max_corr, (- v[LEFT])); } if (Grob *a = unsmob_grob (g->get_object ("arpeggio"))) - { - max_corr = max (max_corr, - a->extent (col, X_AXIS)[LEFT]); - } + max_corr = max (max_corr, - a->extent (col, X_AXIS)[LEFT]); /* Let's decrease the space a little if the problem is not located @@ -212,18 +210,14 @@ Staff_spacing::get_spacing_params (Grob *me, Real *space, Real *fixed) *space = *fixed; } else if (type == ly_symbol2scm ("extra-space")) - { - *space = *fixed + distance; - } + *space = *fixed + distance; else if (type == ly_symbol2scm ("semi-fixed-space")) { *fixed += distance / 2; *space = *fixed + distance / 2; } else if (type == ly_symbol2scm ("minimum-space")) - { - *space = last_ext[LEFT] + max (last_ext.length (), distance); - } + *space = last_ext[LEFT] + max (last_ext.length (), distance); else if (type == ly_symbol2scm ("minimum-fixed-space")) { *space = last_ext[LEFT] + max (last_ext.length (), distance); diff --git a/lily/staff-symbol-engraver.cc b/lily/staff-symbol-engraver.cc index a7bbb6194b..9df51250c1 100644 --- a/lily/staff-symbol-engraver.cc +++ b/lily/staff-symbol-engraver.cc @@ -54,18 +54,14 @@ void Staff_symbol_engraver::start_spanner () { if (!span_) - { - span_ = make_spanner ("StaffSymbol", SCM_EOL); - } + span_ = make_spanner ("StaffSymbol", SCM_EOL); } void Staff_symbol_engraver::stop_spanner () { if (finished_span_ && !finished_span_->get_bound (RIGHT)) - { - finished_span_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn"))); - } + finished_span_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn"))); finished_span_ = 0; } diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index 37edd6f436..80db80ba06 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -81,9 +81,7 @@ Staff_symbol_referencer::get_position (Grob *me) return p; } else if (!st) - { - return me->relative_coordinate (me->get_parent (Y_AXIS), Y_AXIS) * 2; - } + return me->relative_coordinate (me->get_parent (Y_AXIS), Y_AXIS) * 2; return robust_scm2double (me->get_property ("staff-position"), p); } diff --git a/lily/stanza-number-engraver.cc b/lily/stanza-number-engraver.cc index 34586f5e55..063c351835 100644 --- a/lily/stanza-number-engraver.cc +++ b/lily/stanza-number-engraver.cc @@ -58,9 +58,7 @@ void Stanza_number_engraver::acknowledge_lyric_syllable (Grob_info inf) { if (text_) - { - Side_position_interface::add_support (text_, inf.grob ()); - } + Side_position_interface::add_support (text_, inf.grob ()); } void diff --git a/lily/stem.cc b/lily/stem.cc index 1905736a9d..c1ecd82d85 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -505,9 +505,7 @@ Stem::height (SCM smob, SCM ax) */ Grob *beam = get_beam (me); if (beam) - { - Beam::after_line_breaking (beam->self_scm ()); - } + Beam::after_line_breaking (beam->self_scm ()); SCM mol = me->get_uncached_stencil (); Interval iv; @@ -561,14 +559,10 @@ Stem::flag (Grob *me) = Staff_symbol_referencer::on_staffline (me, p) ? "0" : "1"; } else - { - staffline_offs = "2"; - } + staffline_offs = "2"; } else - { - staffline_offs = ""; - } + staffline_offs = ""; char dir = (get_direction (me) == UP) ? 'u' : 'd'; String font_char = flag_style @@ -607,9 +601,7 @@ Stem::width_callback (SCM e, SCM ax) Interval r; if (is_invisible (me)) - { - r.set_empty (); - } + r.set_empty (); else if (unsmob_grob (me->get_object ("beam")) || abs (duration_log (me)) <= 2) { r = Interval (-1, 1); diff --git a/lily/stencil-scheme.cc b/lily/stencil-scheme.cc index fe2552fe95..cc046d51c3 100644 --- a/lily/stencil-scheme.cc +++ b/lily/stencil-scheme.cc @@ -335,7 +335,6 @@ LY_DEFINE (ly_filled_box, "ly:round-filled-box", scm_to_double (blot)).smobbed_copy (); } - 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 903e864b7c..9b050baf9f 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -190,7 +190,6 @@ Stencil::add_at_edge (Axis a, Direction d, Stencil const &s, Real padding, add_stencil (moved_to_edge (a, d, s, padding, minimum)); } - Stencil Stencil::in_color (Real r, Real g, Real b) const { diff --git a/lily/system-start-delimiter-engraver.cc b/lily/system-start-delimiter-engraver.cc index 52cece087f..1842ffa6f9 100644 --- a/lily/system-start-delimiter-engraver.cc +++ b/lily/system-start-delimiter-engraver.cc @@ -77,9 +77,7 @@ void System_start_delimiter_engraver::finalize () { if (delim_) - { - delim_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn"))); - } + delim_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn"))); } #include "translator.icc" diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index cc35f4b264..2fd6a6523a 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -38,10 +38,9 @@ System_start_delimiter::staff_bracket (Grob *me, Real height) Direction d = DOWN; do - { - bracket.add_at_edge (Y_AXIS, d, tips[d], -overlap, 0.0); - } - while (flip (&d) != DOWN); + bracket.add_at_edge (Y_AXIS, d, tips[d], -overlap, 0.0); + while (flip (&d) != DOWN) + ; return bracket; } diff --git a/lily/system.cc b/lily/system.cc index e5bc99840e..932e7ce8c6 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -110,9 +110,7 @@ static void fixup_refpoints (Link_array<Grob> const &grobs) { for (int i = grobs.size (); i--;) - { - grobs[i]->fixup_refpoint (); - } + grobs[i]->fixup_refpoint (); } SCM @@ -312,9 +310,7 @@ System::post_processing () Interval iv (extent (this, Y_AXIS)); if (iv.is_empty ()) - { - programming_error ("system with empty extent"); - } + programming_error ("system with empty extent"); else translate_axis (-iv[MAX], Y_AXIS); diff --git a/lily/tab-note-heads-engraver.cc b/lily/tab-note-heads-engraver.cc index ca5c0795f6..2aad5ce6ee 100644 --- a/lily/tab-note-heads-engraver.cc +++ b/lily/tab-note-heads-engraver.cc @@ -58,9 +58,7 @@ Tab_note_heads_engraver::try_music (Music *m) return true; } else if (m->is_mus_type ("busy-playing-event")) - { - return note_events_.size (); - } + return note_events_.size (); return false; } diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index ce62499400..4787661847 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -66,9 +66,7 @@ void Text_engraver::acknowledge_stem (Grob_info inf) { for (int i = 0; i < texts_.size (); i++) - { - Side_position_interface::add_support (texts_[i], inf.grob ()); - } + Side_position_interface::add_support (texts_[i], inf.grob ()); } void diff --git a/lily/text-spanner-engraver.cc b/lily/text-spanner-engraver.cc index 39f3190570..731488e313 100644 --- a/lily/text-spanner-engraver.cc +++ b/lily/text-spanner-engraver.cc @@ -57,9 +57,7 @@ Text_spanner_engraver::process_music () if (event_drul_[STOP]) { if (!span_) - { - event_drul_[STOP]->origin ()->warning (_ ("can't find start of text spanner")); - } + event_drul_[STOP]->origin ()->warning (_ ("can't find start of text spanner")); else { finished_ = span_; @@ -71,9 +69,7 @@ Text_spanner_engraver::process_music () if (event_drul_[START]) { if (current_event_) - { - event_drul_[START]->origin ()->warning (_ ("already have a text spanner")); - } + event_drul_[START]->origin ()->warning (_ ("already have a text spanner")); else { current_event_ = event_drul_[START]; diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index a9765c85b5..33608058a6 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -82,9 +82,7 @@ bool Tie_engraver::try_music (Music *mus) { if (mus->is_mus_type ("tie-event")) - { - event_ = mus; - } + event_ = mus; return true; } @@ -93,9 +91,7 @@ void Tie_engraver::process_music () { if (event_) - { - context ()->set_property ("tieMelismaBusy", SCM_BOOL_T); - } + context ()->set_property ("tieMelismaBusy", SCM_BOOL_T); } void @@ -130,9 +126,7 @@ Tie_engraver::acknowledge_note_head (Grob_info i) } if (ties_.size () && ! tie_column_) - { - tie_column_ = make_spanner ("TieColumn", ties_[0]->self_scm ()); - } + tie_column_ = make_spanner ("TieColumn", ties_[0]->self_scm ()); if (tie_column_) for (int i = ties_.size (); i--;) diff --git a/lily/tie-performer.cc b/lily/tie-performer.cc index 314d5c6038..f49861bcb7 100644 --- a/lily/tie-performer.cc +++ b/lily/tie-performer.cc @@ -43,9 +43,7 @@ bool Tie_performer::try_music (Music *mus) { if (mus->is_mus_type ("tie-event")) - { - event_ = mus; - } + event_ = mus; return true; } diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 1cdfc199ea..b73c1bdb73 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -101,9 +101,7 @@ Timing_translator::start_translation_timestep () SCM s = get_property ("measurePosition"); if (unsmob_moment (s)) - { - measposp = *unsmob_moment (s); - } + measposp = *unsmob_moment (s); else { measposp = now; @@ -116,9 +114,7 @@ Timing_translator::start_translation_timestep () SCM barn = get_property ("currentBarNumber"); int b = 0; if (scm_is_number (barn)) - { - b = scm_to_int (barn); - } + b = scm_to_int (barn); SCM cad = get_property ("timing"); bool c = to_boolean (cad); @@ -143,7 +139,6 @@ ADD_TRANSLATOR (Timing_translator, "Normally in @code{Score}. In order to create polyrhythmic music, " "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." - , + "\n\nThis engraver adds the alias @code{Timing} to its containing context.", "", "", "", ""); diff --git a/lily/translator-ctors.cc b/lily/translator-ctors.cc index 874402d490..728dd00271 100644 --- a/lily/translator-ctors.cc +++ b/lily/translator-ctors.cc @@ -22,9 +22,7 @@ LY_DEFINE (get_all_translators, "ly:get-all-translators", 0, 0, 0, (), SCM l = global_translator_dict ? global_translator_dict->to_alist () : SCM_EOL; for (SCM s = l; scm_is_pair (s); s = scm_cdr (s)) - { - scm_set_car_x (s, scm_cdar (s)); - } + scm_set_car_x (s, scm_cdar (s)); return l; } diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 0567fa1cc9..5bf64576eb 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -114,9 +114,7 @@ precomputed_recurse_over_translators (Context *c, Translator_precompute_index id for (SCM s = c->children_contexts (); scm_is_pair (s); s = scm_cdr (s)) - { - precomputed_recurse_over_translators (unsmob_context (scm_car (s)), idx, dir); - } + precomputed_recurse_over_translators (unsmob_context (scm_car (s)), idx, dir); if (dir == UP) { @@ -139,9 +137,7 @@ recurse_over_translators (Context *c, Translator_method ptr, Translator_group_me for (SCM s = c->children_contexts (); scm_is_pair (s); s = scm_cdr (s)) - { - recurse_over_translators (unsmob_context (scm_car (s)), ptr, tg_ptr, dir); - } + recurse_over_translators (unsmob_context (scm_car (s)), ptr, tg_ptr, dir); if (dir == UP) { @@ -192,9 +188,7 @@ Translator_group::precomputed_translator_foreach (Translator_precompute_index id { Array<Translator_method_binding> &bindings (precomputed_method_bindings_[idx]); for (int i = 0; i < bindings.size (); i++) - { - bindings[i].invoke (); - } + bindings[i].invoke (); } void diff --git a/lily/trill-spanner-engraver.cc b/lily/trill-spanner-engraver.cc index 95f437e1ee..7ee181dd58 100644 --- a/lily/trill-spanner-engraver.cc +++ b/lily/trill-spanner-engraver.cc @@ -66,9 +66,7 @@ Trill_spanner_engraver::process_music () if (event_drul_[STOP]) { if (!span_) - { - event_drul_[STOP]->origin ()->warning (_ ("can't find start of trill spanner")); - } + event_drul_[STOP]->origin ()->warning (_ ("can't find start of trill spanner")); else { finished_ = span_; @@ -80,9 +78,7 @@ Trill_spanner_engraver::process_music () if (event_drul_[START]) { if (current_event_) - { - event_drul_[START]->origin ()->warning (_ ("already have a trill spanner")); - } + event_drul_[START]->origin ()->warning (_ ("already have a trill spanner")); else { current_event_ = event_drul_[START]; diff --git a/lily/ttf.cc b/lily/ttf.cc index f329a74d4d..170fbfb719 100644 --- a/lily/ttf.cc +++ b/lily/ttf.cc @@ -83,7 +83,6 @@ print_header (void *out, FT_Face face) lily_cookie_fprintf (out, "end readonly def\n"); } - #define CHUNKSIZE 65534 static void diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 828bc58e37..df5b9f3096 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -54,9 +54,7 @@ get_x_bound_item (Grob *me_grob, Direction hdir, Direction my_dir) if (Note_column::has_interface (g) && Note_column::get_stem (g) && Note_column::dir (g) == my_dir) - { - g = Note_column::get_stem (g); - } + g = Note_column::get_stem (g); return g; } @@ -142,17 +140,13 @@ Tuplet_bracket::print (SCM smob) */ SCM bracket = me->get_property ("bracket-visibility"); if (scm_is_bool (bracket)) - { - bracket_visibility = ly_scm2bool (bracket); - } + bracket_visibility = ly_scm2bool (bracket); else if (bracket == ly_symbol2scm ("if-no-beam")) bracket_visibility = !par_beam; SCM numb = me->get_property ("number-visibility"); if (scm_is_bool (numb)) - { - number_visibility = ly_scm2bool (numb); - } + number_visibility = ly_scm2bool (numb); else if (numb == ly_symbol2scm ("if-no-beam")) number_visibility = !par_beam; @@ -229,9 +223,7 @@ Tuplet_bracket::print (SCM smob) */ if (bracket_visibility && number_visibility && mol.extent (X_AXIS).length () > w) - { - bracket_visibility = false; - } + bracket_visibility = false; if (bracket_visibility) { @@ -332,18 +324,16 @@ Tuplet_bracket::make_bracket (Grob *me, // for line properties. Direction d = LEFT; do - { - straight_corners[d] += -d * shorten[d] / length * dz; - } - while (flip (&d) != LEFT); + straight_corners[d] += -d * shorten[d] / length * dz; + while (flip (&d) != LEFT) + ; if (gap.is_empty ()) gap = Interval (0, 0); do - { - gap_corners[d] = (dz * 0.5) + gap[d] / length * dz; - } - while (flip (&d) != LEFT); + gap_corners[d] = (dz * 0.5) + gap[d] / length * dz; + while (flip (&d) != LEFT) + ; Drul_array<Offset> flare_corners = straight_corners; do @@ -403,9 +393,7 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy) Grob *commony = common_refpoint_of_array (columns, me, Y_AXIS); commony = common_refpoint_of_array (tuplets, commony, Y_AXIS); if (Grob *st = Staff_symbol_referencer::get_staff_symbol (me)) - { - commony = st->common_refpoint (commony, Y_AXIS); - } + commony = st->common_refpoint (commony, Y_AXIS); Grob *commonx = common_refpoint_of_array (columns, me, X_AXIS); commonx = common_refpoint_of_array (tuplets, commonx, Y_AXIS); @@ -591,9 +579,7 @@ Tuplet_bracket::after_line_breaking (SCM smob) Real offset = 0.0; if (!par_beam || get_grob_direction (par_beam) != dir) - { - calc_position_and_height (me, &offset, &dy); - } + calc_position_and_height (me, &offset, &dy); else { SCM ps = par_beam->get_property ("positions"); @@ -612,13 +598,9 @@ Tuplet_bracket::after_line_breaking (SCM smob) SCM rp = me->get_property ("right-position"); if (scm_is_number (lp) && !scm_is_number (rp)) - { - rp = scm_from_double (scm_to_double (lp) + dy); - } + rp = scm_from_double (scm_to_double (lp) + dy); else if (scm_is_number (rp) && !scm_is_number (lp)) - { - lp = scm_from_double (scm_to_double (rp) - dy); - } + lp = scm_from_double (scm_to_double (rp) - dy); else if (!scm_is_number (rp) && !scm_is_number (lp)) { lp = scm_from_double (offset); @@ -666,7 +648,6 @@ Tuplet_bracket::add_tuplet_bracket (Grob *me, Grob *bracket) me->add_dependency (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 08954e8574..49bfc8bc3a 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -32,7 +32,6 @@ struct Tuplet_description } }; - class Tuplet_engraver : public Engraver { public: diff --git a/lily/vaticana-ligature-engraver.cc b/lily/vaticana-ligature-engraver.cc index 5ee55163f8..7819fb380d 100644 --- a/lily/vaticana-ligature-engraver.cc +++ b/lily/vaticana-ligature-engraver.cc @@ -468,13 +468,9 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, ly_bool2scm (false)); } if (prev_delta_pitch < - 1) - { - glyph_name = "svaticana.reverse.plica"; - } + glyph_name = "svaticana.reverse.plica"; else - { - glyph_name = "svaticana.reverse.vplica"; - } + glyph_name = "svaticana.reverse.vplica"; } else // (prev_delta_pitch == 0) { diff --git a/lily/vaticana-ligature.cc b/lily/vaticana-ligature.cc index fd73f5405a..62a72141a1 100644 --- a/lily/vaticana-ligature.cc +++ b/lily/vaticana-ligature.cc @@ -78,9 +78,7 @@ vaticana_brew_flexa (Grob *me, Real interval; SCM flexa_height_scm = me->get_property ("flexa-height"); if (flexa_height_scm != SCM_EOL) - { - interval = scm_to_int (flexa_height_scm); - } + interval = scm_to_int (flexa_height_scm); else { me->warning ("Vaticana_ligature: " @@ -89,9 +87,7 @@ vaticana_brew_flexa (Grob *me, } if (interval >= 0.0) - { - me->warning (_ ("ascending vaticana style flexa")); - } + me->warning (_ ("ascending vaticana style flexa")); Real width = robust_scm2double (me->get_property ("flexa-width"), 2); @@ -243,9 +239,7 @@ vaticana_brew_primitive (Grob *me) = Lookup::blank (Box (Interval (0, 0.5 * flexa_width), Interval (0, 0))); } else if (!String::compare (glyph_name, "flexa")) - { - out = vaticana_brew_flexa (me, true, line_thickness); - } + out = vaticana_brew_flexa (me, true, line_thickness); else { out diff --git a/lily/vertically-spaced-context-engraver.cc b/lily/vertically-spaced-context-engraver.cc index 59aeee40d0..ce9dd788e5 100644 --- a/lily/vertically-spaced-context-engraver.cc +++ b/lily/vertically-spaced-context-engraver.cc @@ -23,7 +23,6 @@ private: Grob *system_; }; - Vertically_spaced_contexts_engraver::Vertically_spaced_contexts_engraver () { system_ = 0; diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index 7185b8fb4b..c113ee9bad 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -72,9 +72,7 @@ Volta_engraver::staff_eligible () { SCM doit = get_property ("voltaOnThisStaff"); if (scm_is_bool (doit)) - { - return to_boolean (doit); - } + return to_boolean (doit); if (!unsmob_grob (staff_)) return false; diff --git a/lily/volta-repeat-iterator.cc b/lily/volta-repeat-iterator.cc index c8132638f7..4df93c8eaa 100644 --- a/lily/volta-repeat-iterator.cc +++ b/lily/volta-repeat-iterator.cc @@ -94,18 +94,14 @@ Volta_repeat_iterator::next_element (bool side_effect) } if (done_count_ == 1 && alt_count_ < rep_count_) - { - repstr = "1.--" + to_string (rep_count_ - alt_count_ + done_count_) + "."; - } + repstr = "1.--" + to_string (rep_count_ - alt_count_ + done_count_) + "."; if (done_count_ <= alt_count_) add_repeat_command (scm_list_n (ly_symbol2scm ("volta"), scm_makfrom0str (repstr.to_str0 ()), SCM_UNDEFINED)); } else - { - add_repeat_command (ly_symbol2scm ("end-repeat")); - } + add_repeat_command (ly_symbol2scm ("end-repeat")); } } diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 517a9e7ed9..f60cd2c614 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -48,12 +48,15 @@ displayMusic = (display-scheme-music music) music) -%#(use-modules (scm display-lily)) -%displayLilyMusic = -%#(def-music-function (parser location music) (ly:music?) -% (display-lily-init parser) -% (display-lily-music music) -% music) +%% FIXME: guile-1.7 required? +%% # (use-modules (scm display-lily))invalid module name for use-syntax ((srfi srfi-39)) + +%%#(use-modules (scm display-lily)) +%%displayLilyMusic = +%%#(def-music-function (parser location music) (ly:music?) +%% (display-lily-init parser) +%% (display-lily-music music) +%% music) applyoutput = #(def-music-function (parser location proc) (procedure?) |