From bdf4ab13203502e7ec7cf9cf5896527643a07c1f Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 16 Mar 2005 19:19:15 +0000 Subject: [PATCH] Update. --- ChangeLog | 4 + buildscripts/fixcc.py | 101 ++++++++++++------ flower/getopt-long.cc | 10 +- flower/include/array.hh | 18 ++-- flower/include/array.icc | 14 +-- flower/include/axes.hh | 4 +- flower/include/compare.hh | 6 +- flower/include/cons.hh | 17 ++- flower/include/direction.hh | 2 +- flower/include/drul-array.hh | 10 +- flower/include/flower-proto.hh | 6 +- flower/include/getopt-long.hh | 2 +- flower/include/interval.hh | 32 +++--- flower/include/interval.tcc | 4 +- flower/include/killing-cons.tcc | 2 +- flower/include/libc-extension.hh | 6 +- flower/include/offset.hh | 25 +++-- flower/include/parray.hh | 21 ++-- flower/include/parse-afm.hh | 8 +- flower/include/polynomial.hh | 20 ++-- flower/include/pqueue.hh | 14 +-- flower/include/rational.hh | 16 +-- flower/include/real.hh | 2 +- flower/include/string-data.hh | 6 +- flower/include/string-data.icc | 7 +- flower/include/string-handle.hh | 10 +- flower/include/string-handle.icc | 12 +-- flower/include/string.hh | 24 ++--- flower/include/string.icc | 4 +- flower/include/virtual-methods.hh | 2 +- flower/libc-extension.cc | 1 - flower/offset.cc | 4 +- flower/parse-afm.cc | 12 --- flower/polynomial.cc | 24 +++-- flower/rational.cc | 23 ++-- flower/string-convert.cc | 8 +- flower/string.cc | 12 +-- lily/accidental-engraver.cc | 2 +- lily/accidental-placement.cc | 2 +- lily/accidental.cc | 2 +- lily/afm.cc | 2 +- lily/align-interface.cc | 1 - lily/ambitus-engraver.cc | 2 + lily/ambitus.cc | 4 +- lily/arpeggio.cc | 2 +- lily/auto-beam-engraver.cc | 2 +- lily/auto-change-iterator.cc | 4 - lily/axis-group-interface.cc | 2 +- lily/bar-line.cc | 5 +- lily/bar-number-engraver.cc | 1 - lily/beam-concave.cc | 2 +- lily/beam-engraver.cc | 6 +- lily/beam-performer.cc | 2 +- lily/beam-quanting.cc | 4 +- lily/beam.cc | 32 +++--- lily/beaming-info.cc | 8 +- lily/bezier-bow.cc | 2 +- lily/bezier.cc | 20 ++-- lily/box.cc | 4 +- lily/break-algorithm.cc | 6 +- lily/break-align-engraver.cc | 2 - lily/break-substitution.cc | 12 +-- lily/clef-engraver.cc | 2 - lily/cluster-engraver.cc | 2 +- lily/collision-engraver.cc | 4 +- lily/completion-note-heads-engraver.cc | 2 - lily/context-handle.cc | 2 +- lily/context-scheme.cc | 2 +- lily/context.cc | 3 +- lily/custos-engraver.cc | 1 - lily/dimension-cache.cc | 2 - lily/dot-column-engraver.cc | 2 - lily/dot-column.cc | 3 +- lily/dots.cc | 3 +- lily/drum-note-engraver.cc | 1 - lily/duration.cc | 2 +- lily/dynamic-engraver.cc | 10 +- lily/dynamic-text-spanner.cc | 2 - lily/engraver-group-engraver.cc | 5 +- lily/engraver.cc | 1 - lily/fingering-engraver.cc | 1 - lily/font-size-engraver.cc | 1 - lily/general-scheme.cc | 2 +- lily/global-context.cc | 3 +- lily/gourlay-breaking.cc | 4 +- lily/gregorian-ligature-engraver.cc | 24 ++--- lily/grob-interface.cc | 1 - lily/grob-pitch-tuple.cc | 1 - lily/grob-pq-engraver.cc | 2 +- lily/grob.cc | 11 +- lily/hairpin.cc | 2 +- lily/hara-kiri-group-spanner.cc | 1 - lily/hyphen-engraver.cc | 3 - lily/include/afm.hh | 2 +- lily/include/audio-item.hh | 2 +- lily/include/axis-group-interface.hh | 1 - lily/include/bezier.hh | 6 +- lily/include/box.hh | 4 +- lily/include/break-align-interface.hh | 1 - lily/include/context.hh | 5 +- lily/include/custos.hh | 1 - lily/include/engraver-group-engraver.hh | 2 +- lily/include/engraver.hh | 1 - lily/include/event.hh | 1 - lily/include/grob.hh | 2 +- lily/include/group-interface.hh | 1 - lily/include/interpretation-context-handle.hh | 2 +- lily/include/lily-guile-macros.hh | 8 +- lily/include/lily-proto.hh | 1 - lily/include/midi-stream.hh | 6 +- lily/include/midi-walker.hh | 6 +- lily/include/moment.hh | 12 +-- lily/include/music-constructor.hh | 3 +- lily/include/note-collision.hh | 4 +- lily/include/object-key-dumper.hh | 6 +- lily/include/object-key-undumper.hh | 2 +- lily/include/object-key.hh | 2 +- lily/include/open-type-font.hh | 2 +- lily/include/performer-group-performer.hh | 2 +- lily/include/pitch.hh | 2 +- lily/include/property-iterator.hh | 2 - lily/include/protected-scm.hh | 4 +- lily/include/rest-collision.hh | 1 - lily/include/rhythmic-head.hh | 1 - lily/include/scm-hash.hh | 2 +- lily/include/script-column.hh | 1 - lily/include/sequential-iterator.hh | 1 - lily/include/source-file.hh | 4 +- lily/include/staff-symbol.hh | 1 - lily/include/tfm-reader.hh | 4 +- lily/include/translator-group.hh | 2 +- lily/include/translator.hh | 1 - lily/include/tweak-registration.hh | 2 +- lily/include/type-swallow-translator.hh | 2 +- lily/input.cc | 4 - lily/instrument-name-engraver.cc | 2 - lily/item.cc | 3 +- lily/key-engraver.cc | 2 - lily/key-signature-interface.cc | 15 ++- lily/least-squares.cc | 2 +- lily/ledger-line-spanner.cc | 38 +++---- lily/lily-guile.cc | 7 +- lily/lilypond-key.cc | 6 +- lily/line-spanner.cc | 17 ++- lily/lookup.cc | 6 +- lily/ly-module.cc | 6 +- lily/lyric-combine-music-iterator.cc | 2 +- lily/lyric-hyphen.cc | 15 ++- lily/lyric-performer.cc | 1 - lily/main.cc | 4 +- lily/mark-engraver.cc | 1 - lily/melisma-translator.cc | 1 - lily/mensural-ligature.cc | 10 +- lily/metronome-engraver.cc | 1 - lily/midi-item.cc | 6 +- lily/midi-stream.cc | 4 +- lily/midi-walker.cc | 4 +- lily/misc.cc | 2 +- lily/moment-scheme.cc | 4 +- lily/moment.cc | 14 +-- lily/multi-measure-rest-engraver.cc | 3 +- lily/multi-measure-rest.cc | 8 +- lily/music-constructor.cc | 4 +- lily/music-scheme.cc | 1 - lily/music-wrapper-iterator.cc | 2 +- lily/music.cc | 5 +- lily/new-fingering-engraver.cc | 6 +- lily/note-collision.cc | 50 ++++----- lily/note-column.cc | 7 +- lily/note-head-line-engraver.cc | 1 - lily/note-spacing.cc | 19 ++-- lily/object-key-undumper.cc | 1 - lily/object-key.cc | 3 +- lily/open-type-font.cc | 2 +- lily/pango-font.cc | 8 +- lily/paper-outputter-scheme.cc | 1 - lily/paper-system.cc | 2 +- lily/part-combine-iterator.cc | 11 +- lily/percent-repeat-engraver.cc | 5 +- lily/performer-group-performer.cc | 2 +- lily/phrasing-slur-engraver.cc | 2 +- lily/piano-pedal-engraver.cc | 5 +- lily/piano-pedal-performer.cc | 2 +- lily/pitch-scheme.cc | 6 +- lily/pitch.cc | 2 +- lily/protected-scm.cc | 8 +- lily/repeat-acknowledge-engraver.cc | 1 - lily/repeated-music.cc | 4 +- lily/rest-collision.cc | 11 +- lily/rest-engraver.cc | 4 +- lily/rhythmic-column-engraver.cc | 5 +- lily/rod.cc | 3 +- lily/scm-hash.cc | 4 +- lily/scm-option.cc | 4 +- lily/score-engraver.cc | 4 +- lily/score.cc | 3 - lily/script-column-engraver.cc | 2 - lily/script-column.cc | 1 - lily/script-engraver.cc | 1 - lily/separating-group-spanner.cc | 4 +- lily/separating-line-group-engraver.cc | 2 - lily/separation-item.cc | 1 - lily/sequential-iterator.cc | 1 - lily/side-position-interface.cc | 7 +- lily/simple-spacer.cc | 3 +- lily/simultaneous-music-iterator.cc | 2 +- lily/skyline.cc | 6 +- lily/slash-repeat-engraver.cc | 1 - lily/slur-configuration.cc | 9 +- lily/slur-engraver.cc | 4 +- lily/slur-performer.cc | 2 +- lily/slur-scoring.cc | 12 +-- lily/spaceable-grob.cc | 2 +- lily/spacing-engraver.cc | 3 - lily/spacing-spanner.cc | 14 ++- lily/span-arpeggio-engraver.cc | 1 - lily/span-bar-engraver.cc | 1 - lily/span-dynamic-performer.cc | 1 - lily/spanner.cc | 17 +-- lily/spring-smob.cc | 2 +- lily/staff-collecting-engraver.cc | 1 - lily/staff-spacing.cc | 1 - lily/staff-symbol-engraver.cc | 4 +- lily/staff-symbol.cc | 4 +- lily/stanza-number-align-engraver.cc | 1 - lily/stanza-number-engraver.cc | 1 - lily/stem.cc | 11 +- lily/stencil-scheme.cc | 4 +- lily/stencil.cc | 4 +- lily/string-number-engraver.cc | 1 - lily/system-start-delimiter-engraver.cc | 2 - lily/tempo-performer.cc | 1 - lily/text-item.cc | 1 - lily/text-spanner.cc | 3 +- lily/tfm-reader.cc | 10 +- lily/tfm.cc | 2 +- lily/tie-engraver.cc | 4 +- lily/tie-performer.cc | 1 - lily/tie.cc | 10 +- lily/time-signature-performer.cc | 1 - lily/timing-translator.cc | 1 - lily/translator.cc | 4 +- lily/tuplet-bracket.cc | 17 ++- lily/vaticana-ligature.cc | 20 ++-- lily/volta-bracket.cc | 4 +- lily/volta-engraver.cc | 2 - 246 files changed, 645 insertions(+), 799 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5824521ffa..5d5d245e33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2005-03-16 Jan Nieuwenhuizen + * Nitpick run. + + * buildscripts/fixcc.py: Update. + Builddir run fixes. * HACKING (datadir): Add VERSION. diff --git a/buildscripts/fixcc.py b/buildscripts/fixcc.py index 4989850d82..015f5145df 100644 --- a/buildscripts/fixcc.py +++ b/buildscripts/fixcc.py @@ -5,9 +5,11 @@ # TODO # * maintainable rules: regexp's using whitespace (?x) and match names # ) -# * trailing * vs function definition +# * trailing `*' vs. function definition +# * do not break/change indentation of fixcc-clean files # * check lexer, parser # * rewrite in elisp, add to cc-mode +# * using regexes is broken by design # * ? # * profit @@ -47,7 +49,7 @@ rules = { #('\)[ \t]*([^\w])', ')\\1'), # delete space around operator # ('([\w\(\)\]])([ \t]*)(::|\.)([ \t]*)([\w\(\)])', '\\1\\3\\5'), - ('([\w\(\)\]])([ \t]*)(\.)([ \t]*)([\w\(\)])', '\\1\\3\\5'), + ('([\w\(\)\]])([ \t]*)(\.|->)([ \t]*)([\w\(\)])', '\\1\\3\\5'), # delete space after operator ('(::)([ \t]*)([\w\(\)])', '\\1\\3'), # delete superflous space around operator @@ -57,24 +59,27 @@ rules = { # space around operator2 ('([\w\)\]]) *(&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|\?|<|>|=|/|:|&|\||\*) ([^\w\s])', '\\1 \\2 \\3'), # space around operator3 - ('([^\w\s]) (&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|\?|<|>|=|/|:|&|\||\*) *([\w\(])', '\\1 \\2 \\3'), + ('([^\w\s]) (&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|\?|<|[^-]>|=|/|:|&|\||\*) *([\w\(])', '\\1 \\2 \\3'), + # space around operator4 + ('([\w\(\)\]]) (\*|/|\+|-) *([-:])', '\\1 \\2 \\3'), # space around +/-; exponent ('([\w\)\]])(\+|-)([_A-Za-z\(])', '\\1 \\2 \\3'), ('([_\dA-Za-df-z\)\]])(\+|-)([\w\(])', '\\1 \\2 \\3'), # trailing operator (' (::|&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|\?|<|>|\+|-|=|/|:|&XXX|\||\*XXX)[ \t]*\n([ \t]*)', '\n\\2\\1 '), - #breaks function definitions - #to#(' (::|&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|<|>|\+|-|=|/|&|\||\*)[ \t]*\n([ \t]*)', '\n\\2\\1 '), # pointer - ('(bool|char|const|delete|int|stream|unsigned|void|(struct \w+)|([A-Z]\w*)|[,]|&&|\|\|)[ \t]*(\*|&)[ \t]*', '\\1 \\4'), + ##('(bool|char|const|delete|int|stream|unsigned|void|size_t|struct \w+|[A-Z]\w*|,|;|&&|<|[^-]>|\|\||-|\+)[ \t]*(\*|&)[ \t]*', '\\1 \\2'), + ('(bool|char|const|delete|int|stream|unsigned|void|size_t|struct \w+|[A-Z]\w*|,|;|:|=|\?\)|&&|<|[^-]>|\|\||-|\+)[ \t]*(\*|&)[ \t]*', '\\1 \\2'), #to#('(bool|char|const|delete|int|stream|unsigned|void|([A-Z]\w*)|[,])[ \n\t]*(\*|&)[ \t]*', '\\1 \\3'), # pointer with template - ('(( *((bool|char|delete|int|stream|unsigned|void|(class[ \t]+\w*)|([A-Z]\w*)|[,])[ \*&],*)+)>) *(\*|&) *', '\\1 \\7'), + ('(( *((bool|char|const|delete|int|stream|unsigned|void|size_t|class[ \t]+\w*|[A-Z]\w*|\w+::\w+|[,])[ \*&],*)+)>) *(\*|&) *', '\\1 \\5'), #to#('(( *((bool|char|delete|int|stream|unsigned|void|(class[ \t]+\w*)|([A-Z]\w*)|[,])[ \*&],*)+)>)[ \t\n]*(\*|&) *', '\\1 \\7'), # unary pointer, minus, not ('(return|=) (\*|&|-|!) ([\w\(])', '\\1 \\2\\3'), # space after `operator' ('(\Woperator) *([^\w\s])', '\\1 \\2'), + # dangling brace close + ('\n[ \t]*(\n[ \t]*})', '\\1'), # dangling newline ('\n[ \t]*\n[ \t]*\n', '\n\n'), # dangling parenthesis open @@ -112,12 +117,15 @@ rules = { ('(typedef struct\s+([\w]*\s){([^}]|{[^}]*})*})\s*\n\s*(\w[\w\d]*;)', '\\1 \\4'), # delete spaces around template brackets #('(dynamic_cast|template|([A-Z]\w*))[ \t]*<[ \t]*(( *(bool|char|int|unsigned|void|(class[ \t]+\w*)|([A-Z]\w*)),?)+)[ \t]?(| [\*&])[ \t]*>', '\\1<\\3\\8>'), - ('(dynamic_cast|template|([A-Z]\w*))[ \t]*<[ \t]*(( *(bool|char|int|unsigned|void|(class[ \t]+\w*)|([A-Z]\w*))[,\*&]*)+)[ \t]?(| [\*&])[ \t]*>', '\\1<\\3\\8>'), + ('(dynamic_cast|template|typedef|\w+::\w+|[A-Z]\w*)[ \t]*<[ \t]*(( *(bool|char|const|int|unsigned|void|size_t|class[ \t]+\w*|[A-Z]\w*)( *[\*&]?,|[\*&])*)+)[ \t]?(| [\*&])[ \t]*>', '\\1<\\2\\6>'), + ('(\w+::\w+|[A-Z]\w*) < ((\w+::\w+|[A-Z]\w*)<[A-Z]\w*>) >', '\\1<\\2 >'), ('((if|while)\s+\(([^\)]|\([^\)]*\))*\))\s*;', '\\1\n;'), ('(for\s+\(([^;]*;[^;]*;([^\)]|\([^\)]*\))*)\))\s*;', '\\1\n;'), - # do .. while - ('(\Wdo\s*{([^}]|{[^}]*})*}\s*while\s*)(\(([^\)]|\([^\)]*\))*\))\s*;', '\\1\\3;\n'), + # do {..} while + ('(}\s*while\s*)(\(([^\)]|\([^\)]*\))*\))\s*;', '\\1\\2;'), + ## Fix code that gets broken by rules above. + ##('->\s+\*', '->*'), # delete space before #define x() ('#[ \t]*define (\w*)[ \t]*\(', '#define \\1('), # add space in #define x () @@ -490,55 +498,74 @@ def main (): nitpick_file (outdir, i) +## TODO: make this compilable and check with g++ TEST = ''' +#include +#include +class +ostream ; + +class Foo { +public: static char* foo (); +std::map* bar (char, char) { return 0; } +}; +typedef struct +{ + Foo **bar; +} String; + ostream & operator << (ostream & os, String d); typedef struct _t_ligature { char *succ, *lig; - struct _t_ligature *next; struct _t_ligature * next; } AFM_Ligature; - + +typedef std::map < AFM_Ligature const *, int > Bar; + +/* || + * vv + * !OK OK + */ +/* || + vv + !OK OK + */ char * -Bar:: foe () +Foo:: foo () { - char* a= ++ 3 ; - a [x] = foe (*i, &bar) * +int +i +; + char* a= &++ i ; + a [*++ a] = (char*) foe (*i, &bar) * 2; int operator double (); - int x =foe(1 ,3); - Interval_t &operator*= (T r); + std::map y =*bar(-*a ,*b); + Interval_t & operator*= (T r); + Foo*c; int compare (Pqueue_ent < K, T > const& e1, Pqueue_ent < K,T> *e2); delete *p; if (abs (f)*2 > abs (d) *FUDGE) ; while (0); - for (; i < x (); foo > bar); - for (; i < x > y; - foo > bar) + for (; ibar); + for (; *p && > y; + foo > bar) ; do { - .. + ;;; } while (foe); squiggle. extent; - 1 && * unsmob_moment (lf); - - line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->self_scm + line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->*self_scm (): SCM_EOL); - case foo: k; - typedef struct - { - ... - } cookie_io_functions_t; - - if (0) {a=b;} else { c=d; } @@ -548,7 +575,19 @@ Bar:: foe () ... }; + int compare (Array < Pitch> *, Array < Pitch> *); + original_ = (Grob *) & s; + Drul_array< Link_array > o; } + + header_.char_info_pos = (6 + header_length) * 4; + return ly_bool2scm (*ma < * mb); + + 1 *::sign(2); + + (shift) *-d; + + a = 0 ? *x : *y; ''' def test (): diff --git a/flower/getopt-long.cc b/flower/getopt-long.cc index e3850b153c..d8d750bf0e 100644 --- a/flower/getopt-long.cc +++ b/flower/getopt-long.cc @@ -77,7 +77,6 @@ Getopt_long::parselong () } if (!optional_argument_str0_) report (E_ARGEXPECT); - } else { @@ -211,7 +210,7 @@ Getopt_long::parseshort () } const Long_option_init * -Getopt_long::operator() () +Getopt_long::operator () () { if (!ok ()) return 0; @@ -258,10 +257,9 @@ Getopt_long::Getopt_long (int c, char **v, Long_option_init *lo) argument_index_ = 0; // reached end of option table? - table_len_ =0; - for (int i = 0; option_a_[i].longname_str0_ ||option_a_[i].shortname_char_; i++) + table_len_ = 0; + for (int i = 0; option_a_[i].longname_str0_ || option_a_[i].shortname_char_; i++) table_len_++; - } bool @@ -298,7 +296,7 @@ Getopt_long::get_next_arg () if (a) { array_index_++; - argument_index_= 0; + argument_index_ = 0; } return a; } diff --git a/flower/include/array.hh b/flower/include/array.hh index 10b91ed97b..938b1c0ce8 100644 --- a/flower/include/array.hh +++ b/flower/include/array.hh @@ -74,12 +74,12 @@ public: Array (T *tp, int n) { array_ = new T[n]; - max_ =size_ = n; + max_ = size_ = n; arrcpy (array_, tp, n); } Array () - { array_ = 0; max_ =0; size_ =0; } + { array_ = 0; max_ = 0; size_ = 0; } // ugh, get around gcc 2.8.1 ice; see bezier.cc Array (int i) @@ -112,7 +112,7 @@ public: { return array_; } - void operator= (Array const &src) + void operator = (Array const &src) { set_size (src.size_); arrcpy (array_, src.array_, size_); @@ -132,19 +132,19 @@ public: T *remove_array (); /// access element - T &operator[] (int i) + T &operator [] (int i) { return elem_ref (i); } /// access element - T const &operator[] (int i) const + T const &operator [] (int i) const { return elem_ref (i); } /// access element T &elem_ref (int i) const { - assert (i >=0 && i < size_); + assert (i >= 0 && i < size_); return ((T *)array_)[i]; } /// access element @@ -157,7 +157,7 @@ public: void push (T x) { if (size_ == max_) - remax (2*max_ + 1); + remax (2 * max_ + 1); // T::operator= (T &) is called here. Safe to use with automatic // vars @@ -201,7 +201,7 @@ public: void swap (int i, int j) { T t ((*this)[i]); - (*this)[i]= (*this)[j]; + (*this)[i] = (*this)[j]; (*this)[j] = t; } bool is_empty () const @@ -224,7 +224,7 @@ public: } void del (int i) { - assert (i >=0&& i < size_); + assert (i >= 0&& i < size_); arrcpy (array_ + i, array_ + i + 1, size_ - i - 1); size_--; } diff --git a/flower/include/array.icc b/flower/include/array.icc index 088a137252..118b1f43d3 100644 --- a/flower/include/array.icc +++ b/flower/include/array.icc @@ -40,7 +40,7 @@ arrcpy (T *dest, T const *src, int count) template INLINE void Array::insert (T k, int j) { - assert (j >=0 && j<= size_); + assert (j >= 0 && j <= size_); set_size (size_ + 1); for (int i = size_ - 1; i > j; i--) array_[i] = array_[i - 1]; @@ -59,7 +59,7 @@ Array::sort (int (*compare) (T const &, T const &), int lower, int upper) return; swap (lower, (lower + upper) / 2); int last = lower; - for (int i= lower +1; i <= upper; i++) + for (int i = lower +1; i <= upper; i++) if (compare (array_[i], array_[lower]) < 0) swap (++last, i); swap (lower, last); @@ -71,7 +71,7 @@ template INLINE void Array::reverse () { int h = size_ / 2; - for (int i =0, j = size_ - 1; i < h; i++, j--) + for (int i = 0, j = size_ - 1; i < h; i++, j--) swap (i, j); } @@ -79,7 +79,7 @@ template INLINE void Array::OK () const { - assert (max_ >= size_ && size_ >=0); + assert (max_ >= size_ && size_ >= 0); if (max_) assert (array_); } @@ -90,7 +90,7 @@ Array::remove_array () T *p = array_; size_ = 0; max_ = 0; - array_ =0; + array_ = 0; return p; } @@ -98,9 +98,9 @@ template INLINE Array Array::slice (int lower, int upper) const { - assert (lower >= 0 && lower <=upper&& upper <= size_); + assert (lower >= 0 && lower <= upper && upper <= size_); Array r; - int s =upper - lower; + int s = upper - lower; r.set_size (s); arrcpy (r.array_, array_ + lower, s); return r; diff --git a/flower/include/axes.hh b/flower/include/axes.hh index 3a1a7fc9dc..bafd572cb6 100644 --- a/flower/include/axes.hh +++ b/flower/include/axes.hh @@ -13,8 +13,8 @@ enum Axis { - X_AXIS =0, - Y_AXIS =1, + X_AXIS = 0, + Y_AXIS = 1, NO_AXES = 2, }; diff --git a/flower/include/compare.hh b/flower/include/compare.hh index a9fde513a5..37e01f46ee 100644 --- a/flower/include/compare.hh +++ b/flower/include/compare.hh @@ -40,10 +40,10 @@ prefix ONE_OPERATOR (type, function, <) \ prefix ONE_OPERATOR (type, function, <=) \ GPP_MINMAX (type, prefix) \ - prefix inline type max (type t1, type t2) { return (t1 > t2)? t1 : t2; } \ - prefix inline type min (type t1, type t2) { return (t1 < t2)? t1 : t2; } \ + prefix inline type max (type t1, type t2) { return (t1 > t2) ? t1 : t2; } \ + prefix inline type min (type t1, type t2) { return (t1 < t2) ? t1 : t2; } \ \ - prefix bool operator< (type t1, type t2) /* stupid fix to allow ; */ + prefix bool operator < (type t1, type t2) /* stupid fix to allow ; */ #define INSTANTIATE_COMPARE(type, func) TEMPLATE_INSTANTIATE_COMPARE (type, func,) diff --git a/flower/include/cons.hh b/flower/include/cons.hh index 3e6b64f1ab..bf1916a90f 100644 --- a/flower/include/cons.hh +++ b/flower/include/cons.hh @@ -20,9 +20,9 @@ public: Cons () { car_ = 0; - next_ =0; + next_ = 0; } - Cons (T *t, Cons*c) + Cons (T *t, Cons *c) { car_ = t; next_ = c; @@ -65,9 +65,8 @@ template int cons_list_size (Cons *l) return i; } - template -Cons * last_cons (Cons * head) +Cons *last_cons (Cons *head) { while (head && head->next_) { @@ -89,7 +88,7 @@ template class Cons_list { public: - Cons * head_; + Cons *head_; Cons ** nil_pointer_address_; Cons_list () { @@ -97,7 +96,7 @@ public: } void init () { - head_ =0; + head_ = 0; nil_pointer_address_ = &head_; } void append (T *c) @@ -143,7 +142,7 @@ public: void junk () { delete head_; - head_ =0; + head_ = 0; } ~Cons_list () { @@ -156,10 +155,10 @@ public: }; template -void copy_killing_cons_list (Cons_list&, Cons *src); +void copy_killing_cons_list (Cons_list &, Cons *src); template void -clone_killing_cons_list (Cons_list&, Cons *src); +clone_killing_cons_list (Cons_list &, Cons *src); #endif /* CONS_HH */ diff --git a/flower/include/direction.hh b/flower/include/direction.hh index 6ff794be86..82161f675a 100644 --- a/flower/include/direction.hh +++ b/flower/include/direction.hh @@ -44,7 +44,7 @@ other_dir (Direction const d) } inline Direction -operator- (Direction const d) +operator - (Direction const d) { return other_dir (d); } diff --git a/flower/include/drul-array.hh b/flower/include/drul-array.hh index f670a56286..bce7f0a581 100644 --- a/flower/include/drul-array.hh +++ b/flower/include/drul-array.hh @@ -21,19 +21,19 @@ struct Drul_array T array_[2]; T &elem_ref (Direction d) { - assert (d == 1 || d== -1); + assert (d == 1 || d == -1); return array_[ (d + 1) / 2]; } T elem (Direction d) const { - assert (d == 1 || d== -1); + assert (d == 1 || d == -1); return array_[ (d + 1) / 2]; } - T &operator[] (Direction d) + T &operator [] (Direction d) { return elem_ref (d); } - T operator[] (Direction d) const + T operator [] (Direction d) const { return elem (d); } @@ -49,7 +49,7 @@ struct Drul_array template void -scale_drul (Drul_array * dr, T x) +scale_drul (Drul_array *dr, T x) { dr->elem_ref (LEFT) *= x; dr->elem_ref (RIGHT) *= x; diff --git a/flower/include/flower-proto.hh b/flower/include/flower-proto.hh index 68fa918527..0b16ff11d3 100644 --- a/flower/include/flower-proto.hh +++ b/flower/include/flower-proto.hh @@ -12,9 +12,9 @@ char const *flower_version_str0 (); template struct Link_array; template struct Array; -template < class T, class K> struct Assoc; -template < class K, class V> struct Hash_table; -template < class K, class V> struct Hash_table_iter; +template struct Assoc; +template struct Hash_table; +template struct Hash_table_iter; template struct Link_list; template struct Interval_t; template struct PQueue; diff --git a/flower/include/getopt-long.hh b/flower/include/getopt-long.hh index 6d3598954d..92f305dd84 100644 --- a/flower/include/getopt-long.hh +++ b/flower/include/getopt-long.hh @@ -102,7 +102,7 @@ public: @return pointer to next option found. 0 if error occurred, or next argument is no option. */ - const Long_option_init *operator() (); + const Long_option_init *operator () (); char const *current_arg (); char const *get_next_arg (); diff --git a/flower/include/interval.hh b/flower/include/interval.hh index 3c319cf9d3..fcaf39cdce 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -73,19 +73,19 @@ struct Interval_t : public Drul_array Interval_t (T m, T M) : Drul_array (m, M) { } - Interval_t &operator-= (T r) + Interval_t &operator -= (T r) { *this += -r; return *this; } - Interval_t &operator+= (T r) + Interval_t &operator += (T r) { elem_ref (LEFT) += r; - elem_ref (RIGHT) +=r; + elem_ref (RIGHT) += r; return *this; } - Interval_t &operator*= (T r) + Interval_t &operator *= (T r) { if (!is_empty ()) { @@ -93,7 +93,6 @@ struct Interval_t : public Drul_array elem_ref (RIGHT) *= r; if (r < T (0)) swap (); - } return *this; } @@ -111,7 +110,7 @@ struct Interval_t : public Drul_array T r = -elem (LEFT); T l = -elem (RIGHT); elem_ref (LEFT) = l; - elem_ref (RIGHT) =r; + elem_ref (RIGHT) = r; } void swap () @@ -126,14 +125,14 @@ struct Interval_t : public Drul_array inclusion ordering. Crash if not comparable. */ template -int Interval__compare (const Interval_t&, Interval_t const &); +int Interval__compare (const Interval_t &, Interval_t const &); /** Inclusion ordering. return -2 if not comparable */ template int -_Interval__compare (const Interval_t&a, Interval_t const &b); +_Interval__compare (const Interval_t &a, Interval_t const &b); /* INLINE @@ -141,7 +140,7 @@ _Interval__compare (const Interval_t&a, Interval_t const &b); #include "compare.hh" -TEMPLATE_INSTANTIATE_COMPARE (Interval_t&, Interval__compare, template); +TEMPLATE_INSTANTIATE_COMPARE (Interval_t &, Interval__compare, template); template inline Interval_t @@ -149,12 +148,11 @@ intersection (Interval_t a, Interval_t const &b) { a.intersect (b); return a; - } template inline -Interval_t operator+ (T a, Interval_t i) +Interval_t operator + (T a, Interval_t i) { i += a; return i; @@ -162,7 +160,7 @@ Interval_t operator+ (T a, Interval_t i) template inline -Interval_t operator- (Interval_t i, T a) +Interval_t operator - (Interval_t i, T a) { i += -a; return i; @@ -170,7 +168,7 @@ Interval_t operator- (Interval_t i, T a) template inline -Interval_t operator- (T a, Interval_t i) +Interval_t operator - (T a, Interval_t i) { i.negate (); i += a; @@ -179,14 +177,14 @@ Interval_t operator- (T a, Interval_t i) template inline -Interval_t operator+ (Interval_t i, T a) +Interval_t operator + (Interval_t i, T a) { return a + i; } template inline -Interval_t operator* (T a, Interval_t i) +Interval_t operator * (T a, Interval_t i) { i *= a; return i; @@ -194,9 +192,9 @@ Interval_t operator* (T a, Interval_t i) template inline -Interval_t operator* (Interval_t i, T a) +Interval_t operator * (Interval_t i, T a) { - return a*i; + return a * i; } template diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index b67f18165d..4c2bedc808 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -17,7 +17,7 @@ template int -_Interval__compare (const Interval_t&a, Interval_t const &b) +_Interval__compare (const Interval_t &a, Interval_t const &b) { if (a.elem (LEFT) == b.elem (LEFT) && a.elem (RIGHT) == b.elem (RIGHT)) return 0; @@ -136,6 +136,6 @@ Interval_t::contains (T r) } #define INTERVAL__INSTANTIATE(T) struct Interval_t; \ - template int Interval__compare (const Interval_t&, Interval_t const &) + template int Interval__compare (const Interval_t &, Interval_t const &) #endif // INTERVAL_TCC diff --git a/flower/include/killing-cons.tcc b/flower/include/killing-cons.tcc index 3ae9ce66ba..07a741ff1c 100644 --- a/flower/include/killing-cons.tcc +++ b/flower/include/killing-cons.tcc @@ -30,7 +30,7 @@ copy_killing_cons_list (Cons_list &dest, Cons *src) template void -clone_killing_cons_list (Cons_list & dest, Cons *src) +clone_killing_cons_list (Cons_list &dest, Cons *src) { for (; src; src = src->next_) { diff --git a/flower/include/libc-extension.hh b/flower/include/libc-extension.hh index a6b5cf8392..62e5a5a2b8 100644 --- a/flower/include/libc-extension.hh +++ b/flower/include/libc-extension.hh @@ -62,8 +62,7 @@ extern "C" { ssize_t (*write) (void *, char const *, size_t); int (*seek) (void *, off64_t *, int); int (*close) (void *); - } - cookie_io_functions_t; + } cookie_io_functions_t; #else @@ -73,8 +72,7 @@ extern "C" { int (*write) (void *, char const *, int); fpos_t (*seek) (void *, fpos_t, int); int (*close) (void *); - } - cookie_io_functions_t; + } cookie_io_functions_t; #endif /* ! HAVE_FUNOPEN */ #endif /* ! HAVE_LIBIO_H */ diff --git a/flower/include/offset.hh b/flower/include/offset.hh index a782eb0507..8ea8c85815 100644 --- a/flower/include/offset.hh +++ b/flower/include/offset.hh @@ -24,24 +24,24 @@ class Offset public: Real coordinate_a_[NO_AXES]; - Real &operator[] (Axis i) + Real &operator [] (Axis i) { return coordinate_a_[i]; } - Real operator[] (Axis i) const + Real operator [] (Axis i) const { return coordinate_a_[i]; } - Offset &operator+= (Offset o) + Offset &operator += (Offset o) { (*this)[X_AXIS] += o[X_AXIS]; (*this)[Y_AXIS] += o[Y_AXIS]; return *this; } - Offset operator- () const + Offset operator - () const { Offset o = *this; @@ -50,7 +50,7 @@ public: return o; } - Offset &operator-= (Offset o) + Offset &operator -= (Offset o) { (*this)[X_AXIS] -= o[X_AXIS]; (*this)[Y_AXIS] -= o[Y_AXIS]; @@ -66,7 +66,7 @@ public: return *this; } - Offset &operator*= (Real a) + Offset &operator *= (Real a) { (*this)[X_AXIS] *= a; (*this)[Y_AXIS] *= a; @@ -76,13 +76,13 @@ public: Offset (Real ix, Real iy) { - coordinate_a_[X_AXIS] =ix; - coordinate_a_[Y_AXIS] =iy; + coordinate_a_[X_AXIS] = ix; + coordinate_a_[Y_AXIS] = iy; } Offset () { - coordinate_a_[X_AXIS] = coordinate_a_[Y_AXIS]= 0.0; + coordinate_a_[X_AXIS] = coordinate_a_[Y_AXIS] = 0.0; } String to_string () const; @@ -96,12 +96,11 @@ public: Real arg () const; Real length () const; - Offset operator*= (Offset z2) + Offset operator *= (Offset z2) { *this = complex_multiply (*this, z2); return *this; } - }; IMPLEMENT_ARITHMETIC_OPERATOR (Offset, +); @@ -109,14 +108,14 @@ IMPLEMENT_ARITHMETIC_OPERATOR (Offset, -); IMPLEMENT_ARITHMETIC_OPERATOR (Offset, *); inline Offset -operator* (Real o1, Offset o2) +operator * (Real o1, Offset o2) { o2 *= o1; return o2; } inline Offset -operator* (Offset o1, Real o2) +operator * (Offset o1, Real o2) { o1 *= o2; return o1; diff --git a/flower/include/parray.hh b/flower/include/parray.hh index 5467bf2573..6395cd493e 100644 --- a/flower/include/parray.hh +++ b/flower/include/parray.hh @@ -58,12 +58,12 @@ public: } /// access element - T *&operator[] (int i) + T *&operator [] (int i) { return (T *&) Array::elem_ref (i); } /// access element - T *const operator[] (int i) const + T *const operator [] (int i) const { return (T *const) Array::elem (i); } @@ -91,23 +91,22 @@ public: void substitute (T *old, T *new_p) { int i; - while ((i = find_index (old)) >=0) + while ((i = find_index (old)) >= 0) if (new_p) - elem_ref (i) =new_p; + elem_ref (i) = new_p; else del (i); } void unordered_substitute (T *old, T *new_p) { int i; - while ((i = find_index (old)) >=0) + while ((i = find_index (old)) >= 0) if (new_p) - elem_ref (i) =new_p; + elem_ref (i) = new_p; else { unordered_del (i); } - } void default_sort () { @@ -185,7 +184,7 @@ public: } }; -template < class T, class V> +template Link_array typecasts (Link_array const &a, T * /* dummy */) { @@ -207,7 +206,7 @@ Link_array::sort (int (*compare) (T *const &, T *const &), int lower, int upp return; swap (lower, (lower + upper) / 2); int last = lower; - for (int i= lower +1; i <= upper; i++) + for (int i = lower +1; i <= upper; i++) if (compare (elem (i), elem (lower)) < 0) swap (++last, i); swap (lower, last); @@ -253,6 +252,7 @@ binsearch (Array const &arr, T t, int (*compare) (T const &, T const &)) lo = cmp; } while (hi - lo > 1); + if (!compare (t, arr[lo])) return lo; else @@ -267,7 +267,7 @@ binsearch_links (Link_array const &arr, T *t, { int cmp; int result; - if (hi< 0) + if (hi < 0) hi = arr.size (); if (hi == 0) @@ -286,6 +286,7 @@ binsearch_links (Link_array const &arr, T *t, lo = cmp; } while (hi - lo > 1); + if (!compare (t, arr[lo])) return lo; else diff --git a/flower/include/parse-afm.hh b/flower/include/parse-afm.hh index 534dba344e..7f6a7c2125 100644 --- a/flower/include/parse-afm.hh +++ b/flower/include/parse-afm.hh @@ -157,8 +157,7 @@ typedef struct _t_ligature { char *succ, *lig; struct _t_ligature *next; -} - AFM_Ligature; +} AFM_Ligature; /* Character Metric Information. This structure is used only if ALL * character metric information is requested. If only the character @@ -172,8 +171,8 @@ typedef struct _t_ligature */ typedef struct { - int code, /* key: C */ - wx, /* key: WX */ + int code, /* key: C */ + wx, /* key: WX */ wy; /* together wx and wy are associated with key: W */ char *name; /* key: N */ AFM_BBox charBBox; /* key: B */ @@ -271,7 +270,6 @@ typedef struct } AFM_Font_info; - /************************* PROCEDURES ****************************/ /* Call this procedure to do the grunt work of parsing an AFM file. diff --git a/flower/include/polynomial.hh b/flower/include/polynomial.hh index ec61d47103..56370a3c18 100644 --- a/flower/include/polynomial.hh +++ b/flower/include/polynomial.hh @@ -40,12 +40,12 @@ struct Polynomial /// eliminate #x# close to zero void real_clean (); void scalarmultiply (Real fact); - void operator*= (Real f) { scalarmultiply (f); } - void operator/= (Real f) { scalarmultiply (1 / f); } - void operator+= (Polynomial const &p2); - void operator*= (Polynomial const &p2); - void operator-= (Polynomial const &p2); - Polynomial (Real a, Real b =0.0); + void operator *= (Real f) { scalarmultiply (f); } + void operator /= (Real f) { scalarmultiply (1 / f); } + void operator += (Polynomial const &p2); + void operator *= (Polynomial const &p2); + void operator -= (Polynomial const &p2); + Polynomial (Real a, Real b = 0.0); Polynomial (){} void set_negate (const Polynomial &src); @@ -67,15 +67,15 @@ IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, +); IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, *); inline Polynomial -operator* (Polynomial p, Real a) +operator * (Polynomial p, Real a) { - p *=a; + p *= a; return p; } inline Polynomial -operator* (Real a, Polynomial p) +operator * (Real a, Polynomial p) { - p *=a; + p *= a; return p; } #endif diff --git a/flower/include/pqueue.hh b/flower/include/pqueue.hh index c80dae2131..548f663724 100644 --- a/flower/include/pqueue.hh +++ b/flower/include/pqueue.hh @@ -10,15 +10,15 @@ #define PQUEUE_HH #include "array.hh" -template < class K, class T> +template struct PQueue_ent { T val; K key; }; -template < class K, class T> -int compare (PQueue_ent < K, T> const &e1, PQueue_ent < K, T> const &e2) +template +int compare (PQueue_ent const &e1, PQueue_ent const &e2) { return compare (e1.key, e2.key); } @@ -48,12 +48,12 @@ public: priority might fuck up the invariants @param 1 <= i < size () */ - T &operator[] (int i) { return heap_array_[i]; } - T operator[] (int i) const { return heap_array_[i]; } + T &operator [] (int i) { return heap_array_[i]; } + T operator [] (int i) const { return heap_array_[i]; } void OK () const { #ifndef NDEBUG - for (int i =2; i <= size (); i++) + for (int i = 2; i <= size (); i++) assert (compare (elt (i / 2), elt (i)) <= 0); #endif } @@ -97,7 +97,7 @@ public: while (mini < size ()) { - if (compare (elt (mini + 1), elt (mini)) <0) + if (compare (elt (mini + 1), elt (mini)) < 0) mini++; if (compare (last, elt (mini)) < 0) break; diff --git a/flower/include/rational.hh b/flower/include/rational.hh index a0973e2d58..18da3c792e 100644 --- a/flower/include/rational.hh +++ b/flower/include/rational.hh @@ -45,7 +45,7 @@ public: // operator bool () const; int to_int () const; operator double () const; - Rational operator- () const; + Rational operator - () const; /** Initialize to 0. */ @@ -54,16 +54,16 @@ public: Rational (int, int); Rational (double); Rational (Rational const &r) { copy (r);} - Rational &operator= (Rational const &r) + Rational &operator = (Rational const &r) { copy (r); return *this; } - Rational &operator*= (Rational); - Rational &operator/= (Rational); - Rational &operator+= (Rational); - Rational &operator-= (Rational); - Rational &operator%= (Rational); + Rational &operator *= (Rational); + Rational &operator /= (Rational); + Rational &operator += (Rational); + Rational &operator -= (Rational); + Rational &operator %= (Rational); static int compare (Rational const &, Rational const &); int sign () const; String to_string () const; @@ -90,7 +90,7 @@ Rational::copy (Rational const &r) #if 0 ostream & -operator<< (ostream &, Rational); +operator << (ostream &, Rational); #endif const Rational infinity_rat = INT_MAX; diff --git a/flower/include/real.hh b/flower/include/real.hh index 43a35179a6..c75b14a0ce 100644 --- a/flower/include/real.hh +++ b/flower/include/real.hh @@ -33,7 +33,7 @@ template inline T max (T x, T y) template inline T sqr (T x) { - return x*x; + return x * x; } template inline T min (T x, T y) diff --git a/flower/include/string-data.hh b/flower/include/string-data.hh index 378432f3ee..001d5641c4 100644 --- a/flower/include/string-data.hh +++ b/flower/include/string-data.hh @@ -62,7 +62,7 @@ class String_data /// concatenation. void append (Byte const *byte, int length_i); - void operator+= (char const *str0); + void operator += (char const *str0); char const *to_str0 () const; @@ -77,8 +77,8 @@ class String_data /** access element. not really safe. Can alter length_ without #String_data# knowing it. */ - Byte &operator[] (int j); - Byte operator[] (int j) const; + Byte &operator [] (int j); + Byte operator [] (int j) const; bool is_binary_bo () const; }; diff --git a/flower/include/string-data.icc b/flower/include/string-data.icc index 9e7fe6f0ad..2f759ff8a1 100644 --- a/flower/include/string-data.icc +++ b/flower/include/string-data.icc @@ -143,7 +143,7 @@ String_data::append (Byte const *byte, int length_i) INLINE void -String_data::operator+= (char const *str0) +String_data::operator += (char const *str0) { append ((Byte const *)str0, strlen (str0)); } @@ -191,18 +191,17 @@ String_data::is_binary_bo () const } INLINE Byte & -String_data::operator[] (int j) +String_data::operator [] (int j) { assert (j >= 0 && j <= length_); return data_byte_[j]; } INLINE Byte -String_data::operator[] (int j) const +String_data::operator [] (int j) const { assert (j >= 0 && j <= length_); return data_byte_[j]; } - #endif // __STRING_UTIL_CC // diff --git a/flower/include/string-handle.hh b/flower/include/string-handle.hh index 32810219d6..25d6a631de 100644 --- a/flower/include/string-handle.hh +++ b/flower/include/string-handle.hh @@ -41,17 +41,17 @@ public: Byte *get_bytes (); char *get_str0 (); bool is_binary_bo () const; - void operator= (String_handle const &src); - void operator+= (char const *s); - Byte operator[] (int j) const; + void operator = (String_handle const &src); + void operator += (char const *s); + Byte operator [] (int j) const; /** Access elements. WARNING: NOT SAFE don't use this for loops. Use to_bytes () */ - Byte &operator[] (int j); + Byte &operator [] (int j); void append (Byte const *byte, int length_i); void set (Byte const *byte, int length_i); - void operator= (char const *p); + void operator = (char const *p); void trunc (int j); int length () const; }; diff --git a/flower/include/string-handle.icc b/flower/include/string-handle.icc index 91af2c56d3..edda14efef 100644 --- a/flower/include/string-handle.icc +++ b/flower/include/string-handle.icc @@ -40,7 +40,7 @@ String_handle::up (String_data *d) INLINE void String_handle::copy () { - if (data->ref_count_ !=1) + if (data->ref_count_ != 1) { String_data *newdata = new String_data (*data); down (); @@ -93,7 +93,7 @@ String_handle::to_str0 () const } INLINE void -String_handle::operator= (String_handle const &src) +String_handle::operator = (String_handle const &src) { if (this == &src) return; @@ -102,14 +102,14 @@ String_handle::operator= (String_handle const &src) } INLINE void -String_handle::operator+= (char const *s) +String_handle::operator += (char const *s) { copy (); *data += s; } INLINE Byte -String_handle::operator[] (int j) const +String_handle::operator [] (int j) const { return (*data)[j]; } @@ -117,7 +117,7 @@ String_handle::operator[] (int j) const // !NOT SAFE! // don't use this for loops. Use to_bytes () INLINE Byte & -String_handle::operator[] (int j) +String_handle::operator [] (int j) { copy (); // hmm. Not efficient return data->get_bytes ()[j]; @@ -138,7 +138,7 @@ String_handle::set (Byte const *byte, int length_i) } INLINE void -String_handle::operator= (char const *p) +String_handle::operator = (char const *p) { copy (); data->set (p); diff --git a/flower/include/string.hh b/flower/include/string.hh index 70e9dd59aa..d4787b3a7a 100644 --- a/flower/include/string.hh +++ b/flower/include/string.hh @@ -79,11 +79,11 @@ public: char *get_str0 (); Byte *get_bytes (); - String &operator= (String const &source); + String &operator = (String const &source); /// concatenate s - void operator+= (char const *s) { strh_ += s; } - void operator+= (String s); + void operator += (char const *s) { strh_ += s; } + void operator += (String s); bool is_empty () const; @@ -93,8 +93,8 @@ public: /** Return a char. UNSAFE because it may change strlen () result */ - char &operator[] (int n); - char operator[] (int n) const; + char &operator [] (int n); + char operator [] (int n) const; /// return n leftmost chars String left_string (int n) const; @@ -132,7 +132,7 @@ public: #ifdef STREAM_SUPPORT /// provide Stream output - void print_on (ostream& os) const; + void print_on (ostream &os) const; #endif /// the length of the string @@ -187,26 +187,26 @@ INSTANTIATE_COMPARE (String const &, String::compare); #endif // because char const* also has an operator ==, this is for safety: -inline bool operator== (String s1, char const *s2) +inline bool operator == (String s1, char const *s2) { return s1 == String (s2); } -inline bool operator== (char const *s1, String s2) +inline bool operator == (char const *s1, String s2) { return String (s1) == s2; } -inline bool operator!= (String s1, char const *s2) +inline bool operator != (String s1, char const *s2) { return s1 != String (s2); } -inline bool operator!= (char const *s1, String s2) +inline bool operator != (char const *s1, String s2) { - return String (s2) !=s1; + return String (s2) != s1; } IMPLEMENT_ARITHMETIC_OPERATOR (String, +); #ifdef STREAM_SUPPORT -ostream &operator<< (ostream& os, String d); +ostream &operator << (ostream &os, String d); #endif #endif diff --git a/flower/include/string.icc b/flower/include/string.icc index ed6a5887ee..86b2036650 100644 --- a/flower/include/string.icc +++ b/flower/include/string.icc @@ -11,14 +11,14 @@ INLINE char & -String::operator[] (int n) +String::operator [] (int n) { return (char &) strh_[n]; } INLINE char -String::operator[] (int n) const +String::operator [] (int n) const { return strh_[n]; } diff --git a/flower/include/virtual-methods.hh b/flower/include/virtual-methods.hh index b63ae6fd6e..e4dcd8ade6 100644 --- a/flower/include/virtual-methods.hh +++ b/flower/include/virtual-methods.hh @@ -34,7 +34,7 @@ demangle_classname (std::type_info const &); virtual Base *clone () const \ { \ /* return new name (*this); */ \ - Base *urg = (Base*) this; \ + Base *urg = (Base *) this; \ return urg->clone_const_helper (); \ } diff --git a/flower/libc-extension.cc b/flower/libc-extension.cc index 7078a3be4e..3fa6e9b2d8 100644 --- a/flower/libc-extension.cc +++ b/flower/libc-extension.cc @@ -240,5 +240,4 @@ extern "C" { #endif /* ! HAVE_FUNOPEN */ #endif /* ! HAVE_FOPENCOOKIE */ - } /* extern C */ diff --git a/flower/offset.cc b/flower/offset.cc index a3ed32aecb..d6d62d44e5 100644 --- a/flower/offset.cc +++ b/flower/offset.cc @@ -37,7 +37,7 @@ complex_multiply (Offset z1, Offset z2) Offset z; if (!isinf_b (z2[Y_AXIS])) { - z[X_AXIS] = z1[X_AXIS] * z2[X_AXIS] - z1[Y_AXIS]*z2[Y_AXIS]; + z[X_AXIS] = z1[X_AXIS] * z2[X_AXIS] - z1[Y_AXIS] * z2[Y_AXIS]; z[Y_AXIS] = z1[X_AXIS] * z2[Y_AXIS] + z1[Y_AXIS] * z2[X_AXIS]; } return z; @@ -67,7 +67,7 @@ complex_exp (Offset o) Real r = exp (o[X_AXIS]); - return Offset (r*c, r*s); + return Offset (r * c, r * s); } Real diff --git a/flower/parse-afm.cc b/flower/parse-afm.cc index fdd8ec846c..ffb7440809 100644 --- a/flower/parse-afm.cc +++ b/flower/parse-afm.cc @@ -222,7 +222,6 @@ token (FILE *stream) ident[idx] = 0; return (ident); /* returns pointer to the token */ - } /* token */ /*************************** linetoken *************************/ @@ -251,7 +250,6 @@ linetoken (FILE *stream) ident[idx] = 0; return (ident); /* returns pointer to the token */ - } /* linetoken */ /*************************** recognize *************************/ @@ -461,7 +459,6 @@ parseGlobals (FILE *fp, register AFM_GlobalFontInfo *gfi) } /* while */ return (error); - } /* parseGlobals */ #if 0 @@ -541,7 +538,6 @@ initializeArray (FILE *fp, register int *cwi) fseek (fp, opos, 0); return (error); - } /* initializeArray */ #endif @@ -644,7 +640,6 @@ parseCharWidths (FILE *fp, register int *cwi) } /* while */ return (error); - } /* parseCharWidths */ /************************* parseCharMetrics ************************/ @@ -765,7 +760,6 @@ parseCharMetrics (FILE *fp, register AFM_Font_info *fi) error = AFM_parseError; } return (error); - } /* parseCharMetrics */ /************************* parseAFM_TrackKernData ***********************/ @@ -870,7 +864,6 @@ parseAFM_TrackKernData (FILE *fp, register AFM_Font_info *fi) error = AFM_parseError; return (error); - } /* parseAFM_TrackKernData */ /************************* parseAFM_PairKernData ************************/ @@ -991,7 +984,6 @@ parseAFM_PairKernData (FILE *fp, register AFM_Font_info *fi) error = AFM_parseError; return (error); - } /* parseAFM_PairKernData */ /************************* parseAFM_CompCharData **************************/ @@ -1116,10 +1108,8 @@ parseAFM_CompCharData (FILE *fp, register AFM_Font_info *fi) error = AFM_parseError; return (error); - } /* parseAFM_CompCharData */ - /*************************** 'PUBLIC' FUNCTION ********************/ void @@ -1375,7 +1365,6 @@ AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags) if ((error != AFM_earlyEOF) && (code < 0)) error = code; - } /* while */ if ((error != AFM_earlyEOF) && (code < 0)) @@ -1384,6 +1373,5 @@ AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags) if (ident != NULL) { free (ident); ident = NULL; } return (error); - } /* parseFile */ diff --git a/flower/polynomial.cc b/flower/polynomial.cc index 92447b6300..7b60880e7d 100644 --- a/flower/polynomial.cc +++ b/flower/polynomial.cc @@ -32,7 +32,7 @@ Polynomial::multiply (const Polynomial &p1, const Polynomial &p2) { Polynomial dest; - int deg= p1.degree () + p2.degree (); + int deg = p1.degree () + p2.degree (); for (int i = 0; i <= deg; i++) { dest.coefs_.push (0); @@ -47,7 +47,7 @@ Polynomial::multiply (const Polynomial &p1, const Polynomial &p2) void Polynomial::differentiate () { - for (int i = 1; i<= degree (); i++) + for (int i = 1; i <= degree (); i++) { coefs_[i - 1] = coefs_[i] * i; } @@ -95,7 +95,7 @@ Polynomial::clean () } void -Polynomial::operator+= (Polynomial const &p) +Polynomial::operator += (Polynomial const &p) { while (degree () < p.degree ()) coefs_.push (0.0); @@ -105,7 +105,7 @@ Polynomial::operator+= (Polynomial const &p) } void -Polynomial::operator-= (Polynomial const &p) +Polynomial::operator -= (Polynomial const &p) { while (degree () < p.degree ()) coefs_.push (0.0); @@ -167,7 +167,8 @@ Polynomial::check_sol (Real x) const p.differentiate (); Real d = p.eval (x); - if (abs (f) > abs (d) * FUDGE); + if (abs (f) > abs (d) * FUDGE) + ; /* warning ("x=%f is not a root of polynomial\n" "f (x)=%f, f' (x)=%f \n", x, f, d); */ @@ -176,7 +177,7 @@ Polynomial::check_sol (Real x) const void Polynomial::check_sols (Array roots) const { - for (int i = 0; i< roots.size (); i++) + for (int i = 0; i < roots.size (); i++) check_sol (roots[i]); } @@ -233,20 +234,23 @@ Polynomial::solve_cubic ()const sol.push (0); sol.push (0); sol.push (0); - } else { /* one single and one double solution */ + } + else { /* one single and one double solution */ Real u = cubic_root (-q); sol.push (2 * u); sol.push (-u); } - } else if (D < 0) { /* Casus irreducibilis: three real solutions */ + } + else if (D < 0) { /* Casus irreducibilis: three real solutions */ Real phi = 1.0 / 3 * acos (-q / sqrt (-cb)); Real t = 2 * sqrt (-p); sol.push (t * cos (phi)); sol.push (-t * cos (phi + M_PI / 3)); sol.push (-t * cos (phi - M_PI / 3)); - } else { /* one real solution */ + } + else { /* one real solution */ Real sqrt_D = sqrt (D); Real u = cubic_root (sqrt_D - q); Real v = -cubic_root (sqrt_D + q); @@ -339,7 +343,7 @@ Polynomial::solve () const } void -Polynomial:: operator*= (Polynomial const &p2) +Polynomial::operator *= (Polynomial const &p2) { *this = multiply (*this, p2); } diff --git a/flower/rational.cc b/flower/rational.cc index a21b939565..c5634402b1 100644 --- a/flower/rational.cc +++ b/flower/rational.cc @@ -21,7 +21,7 @@ Rational::operator double () const #ifdef STREAM_SUPPORT ostream & -operator<< (ostream &o, Rational r) +operator << (ostream &o, Rational r) { o << r.string (); return o; @@ -52,7 +52,7 @@ Rational::Rational (int n) { sign_ = ::sign (n); num_ = abs (n); - den_= 1; + den_ = 1; } static inline @@ -74,7 +74,7 @@ Rational::set_infinite (int s) } Rational -Rational::operator- () const +Rational::operator - () const { Rational r (*this); r.negate (); @@ -153,23 +153,24 @@ compare (Rational const &r, Rational const &s) } Rational & -Rational::operator%= (Rational r) +Rational::operator %= (Rational r) { *this = r.mod_rat (r); return *this; } Rational & -Rational::operator+= (Rational r) +Rational::operator += (Rational r) { - if (is_infinity ()); + if (is_infinity ()) + ; else if (r.is_infinity ()) { *this = r; } else { - int n = sign_ * num_ *r.den_ + r.sign_ * den_ * r.num_; + int n = sign_ * num_ * r.den_ + r.sign_ * den_ * r.num_; int d = den_ * r.den_; sign_ = ::sign (n) * ::sign (d); num_ = abs (n); @@ -215,7 +216,7 @@ Rational::Rational (double x) { num_ = 0; den_ = 1; - sign_ =0; + sign_ = 0; normalise (); } } @@ -229,7 +230,7 @@ Rational::invert () } Rational & -Rational::operator*= (Rational r) +Rational::operator *= (Rational r) { sign_ *= ::sign (r.sign_); if (r.is_infinity ()) @@ -247,7 +248,7 @@ Rational::operator*= (Rational r) } Rational & -Rational::operator/= (Rational r) +Rational::operator /= (Rational r) { r.invert (); return (*this *= r); @@ -260,7 +261,7 @@ Rational::negate () } Rational & -Rational::operator-= (Rational r) +Rational::operator -= (Rational r) { r.negate (); return (*this += r); diff --git a/flower/string-convert.cc b/flower/string-convert.cc index be044e062f..e6aacb7a45 100644 --- a/flower/string-convert.cc +++ b/flower/string-convert.cc @@ -86,7 +86,6 @@ String_convert::i64_string (I64 i64, char const *fmt) snprintf (buffer, STRING_BUFFER_LEN, (fmt ? fmt : "%Ld"), i64); // assume radix 10 return String (buffer); - } // breendet imp from String double @@ -107,7 +106,7 @@ String_convert::hex2bin (String hex_string, String &bin_string_r) hex_string = "0" + hex_string; bin_string_r = ""; - Byte const *byte= hex_string.to_bytes (); + Byte const *byte = hex_string.to_bytes (); int i = 0; while (i < hex_string.length ()) { @@ -319,11 +318,12 @@ String_convert::split (String str, char c) { Array a; int i = str.index (c); - while (i >=0) + while (i >= 0) { String s = str.left_string (i); a.push (s); - while (str[++i] == c); + while (str[++i] == c) + ; str = str.cut_string (i, INT_MAX); i = str.index (c); } diff --git a/flower/string.cc b/flower/string.cc index 0f8aa09011..5279b6a2d5 100644 --- a/flower/string.cc +++ b/flower/string.cc @@ -46,7 +46,7 @@ String::get_copy_str0 () const copying, constructing. */ String & -String::operator= (String const &source) +String::operator = (String const &source) { strh_ = source.strh_; return *this; @@ -107,7 +107,7 @@ String::append (String s) strh_.append (s.to_bytes (), s.length ()); } void -String::operator+= (String s) +String::operator += (String s) { append (s); } @@ -264,7 +264,7 @@ String::index_any (String set) const void const *me = (void const *) strh_.to_str0 (); for (int i = 0; i < set.length (); i++) { - char *found= (char *) memchr (me, set[i], n); + char *found = (char *) memchr (me, set[i], n); if (found) { return found - (char const *)me; @@ -317,7 +317,7 @@ String::nomid_string (int index_i, int n) const String String::cut_string (int index_i, int n) const { - if (index_i <0) + if (index_i < 0) { n += index_i; index_i = 0; @@ -365,14 +365,14 @@ String::to_double () const #ifdef STREAM_SUPPORT ostream & -operator<< (ostream& os, String d) +operator << (ostream &os, String d) { d.print_on (os); return os; } void -String::print_on (ostream& os) const +String::print_on (ostream &os) const { if (!strh_.is_binary_bo ()) os << to_str0 (); diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index 64965254d0..ce05662b50 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -216,7 +216,7 @@ number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch, if (alter == prev) num = 0; - else if ((abs (alter) < abs (prev) || prev*alter < 0) && alter != 0) + else if ((abs (alter) < abs (prev) || prev * alter < 0) && alter != 0) num = 2; *different = (alter != prev); } diff --git a/lily/accidental-placement.cc b/lily/accidental-placement.cc index cf67149f76..ff32ad4313 100644 --- a/lily/accidental-placement.cc +++ b/lily/accidental-placement.cc @@ -358,7 +358,7 @@ Accidental_placement::position_accidentals (Grob *me) insert_extent_into_skyline (&head_skyline, b, Y_AXIS, LEFT); } - head_ape-> left_skyline_ = head_skyline; + head_ape->left_skyline_ = head_skyline; head_ape->offset_ = 0.0; Real padding = robust_scm2double (me->get_property ("padding"), 0.2); diff --git a/lily/accidental.cc b/lily/accidental.cc index e2f21a105a..26909e72a0 100644 --- a/lily/accidental.cc +++ b/lily/accidental.cc @@ -100,7 +100,7 @@ Accidental_interface::accurate_boxes (Grob *a, Grob **common) belly[Y_AXIS] *= 0.75; lstem[X_AXIS][RIGHT] *= .33; - rstem[X_AXIS][LEFT] = rstem[X_AXIS].linear_combination (1.0/3.0); + rstem[X_AXIS][LEFT] = rstem[X_AXIS].linear_combination (1.0 / 3.0); lstem[Y_AXIS][DOWN] = belly[Y_AXIS][DOWN]; rstem[Y_AXIS][UP] = belly[Y_AXIS][UP]; boxes.push (belly); diff --git a/lily/afm.cc b/lily/afm.cc index 8a1b6a8570..b1c3805ac4 100644 --- a/lily/afm.cc +++ b/lily/afm.cc @@ -75,7 +75,7 @@ Adobe_font_metric::find_char_metric (String nm) const int Adobe_font_metric::name_to_index (String name) const { - std::map < String, int>::const_iterator ai = name_to_metric_dict_.find (name); + std::map::const_iterator ai = name_to_metric_dict_.find (name); if (ai == name_to_metric_dict_.end ()) return -1; return (*ai).second; diff --git a/lily/align-interface.cc b/lily/align-interface.cc index 7ebe4f33cc..7489f6692c 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -256,7 +256,6 @@ find_fixed_alignment_parent (Grob *g) return 0; } - ADD_INTERFACE (Align_interface, "align-interface", "Order grobs from top to bottom, left to right, right to left or bottom" "to top.", diff --git a/lily/ambitus-engraver.cc b/lily/ambitus-engraver.cc index bca05e3120..12402a3100 100644 --- a/lily/ambitus-engraver.cc +++ b/lily/ambitus-engraver.cc @@ -61,6 +61,7 @@ Ambitus_engraver::create_ambitus () Side_position_interface::add_support (accidentals_[d], heads_[d]); } while (flip (&d) != DOWN); + ambitus_->set_parent (heads_[DOWN], X_AXIS); Axis_group_interface::add_element (group_, ambitus_); @@ -175,6 +176,7 @@ Ambitus_engraver::finalize () heads_[d]->suicide (); } while (flip (&d) != DOWN); + ambitus_->suicide (); } } diff --git a/lily/ambitus.cc b/lily/ambitus.cc index 420c016834..a702fffb50 100644 --- a/lily/ambitus.cc +++ b/lily/ambitus.cc @@ -52,12 +52,12 @@ Ambitus::print (SCM smob) Real linethickness = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness")) * robust_scm2double (me->get_property ("thickness"), 1.0); Real blotdiameter = me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter")); - Interval x_extent = 0.5 * linethickness *Interval (-1, 1); + Interval x_extent = 0.5 * linethickness * Interval (-1, 1); Interval y_extent = Interval (pmin, pmax); Box line_box (x_extent, y_extent); Stencil line = Lookup::round_filled_box (line_box, blotdiameter); - line.translate_axis (- me-> relative_coordinate (common, Y_AXIS), + line.translate_axis (- me->relative_coordinate (common, Y_AXIS), Y_AXIS); return line.smobbed_copy (); } diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index 0d432a4189..8ac92f1c3c 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -82,7 +82,7 @@ Arpeggio::print (SCM smob) } for (Real y = heads[LEFT]; y < heads[RIGHT]; - y+= squiggle. extent (Y_AXIS).length ()) + y += squiggle.extent (Y_AXIS).length ()) mol.add_at_edge (Y_AXIS, UP, squiggle, 0.0, 0); mol.translate_axis (heads[LEFT], Y_AXIS); diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 9164df8a74..09a6d2a831 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -47,7 +47,7 @@ private: */ Moment shortest_mom_; Spanner *finished_beam_; - Link_array* stems_; + Link_array *stems_; int count_; Moment last_add_mom_; diff --git a/lily/auto-change-iterator.cc b/lily/auto-change-iterator.cc index 1fb472a1b5..64698e441c 100644 --- a/lily/auto-change-iterator.cc +++ b/lily/auto-change-iterator.cc @@ -31,7 +31,6 @@ private: Interpretation_context_handle up_; Interpretation_context_handle down_; - }; void @@ -80,7 +79,6 @@ Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym, */ } else; - } void @@ -138,7 +136,6 @@ Auto_change_iterator::construct_children () "", SCM_EOL); set_context (voice); Music_wrapper_iterator::construct_children (); - } void @@ -146,6 +143,5 @@ Auto_change_iterator::do_quit () { up_.set_context (0); down_.set_context (0); - } IMPLEMENT_CTOR_CALLBACK (Auto_change_iterator); diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index dde37ac72e..46b15f18d3 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -72,7 +72,7 @@ Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis) void Axis_group_interface::set_axes (Grob *me, Axis a1, Axis a2) { - SCM sa1= scm_int2num (a1); + SCM sa1 = scm_int2num (a1); SCM sa2 = scm_int2num (a2); SCM axes = me->get_property ("axes"); diff --git a/lily/bar-line.cc b/lily/bar-line.cc index cd5729a02e..fa803dbfdf 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -132,7 +132,7 @@ Bar_line::compound_barline (Grob *me, String str, Real h) Real y = (- (c - 1.0) / 2 + 0.5 + i * staff_space); Stencil d (dot); - d. translate_axis (y, Y_AXIS); + d.translate_axis (y, Y_AXIS); m.add_stencil (d); } } @@ -179,7 +179,6 @@ Bar_line::before_line_breaking (SCM smob) return SCM_UNSPECIFIED; } - MAKE_SCHEME_CALLBACK (Bar_line, get_staff_bar_size, 1); SCM Bar_line::get_staff_bar_size (SCM smob) @@ -188,7 +187,7 @@ Bar_line::get_staff_bar_size (SCM smob) Real ss = Staff_symbol_referencer::staff_space (me); SCM size = me->get_property ("bar-size"); if (scm_is_number (size)) - return scm_make_real (scm_to_double (size)*ss); + return scm_make_real (scm_to_double (size) * ss); else if (Staff_symbol_referencer::get_staff_symbol (me)) { /* diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 80b431c214..4e9cc302f7 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -54,7 +54,6 @@ Bar_number_engraver::process_music () } } } - } Bar_number_engraver::Bar_number_engraver () diff --git a/lily/beam-concave.cc b/lily/beam-concave.cc index d7ea7638e8..91c772a06b 100644 --- a/lily/beam-concave.cc +++ b/lily/beam-concave.cc @@ -36,7 +36,7 @@ is_concave_single_notes (Array const &positions, Direction beam_dir) note is reached in the opposite direction as the last-first dy */ int dy = positions.top () - positions[0]; - int closest = (beam_dir * positions.top ()) >? (beam_dir *positions[0]); + int closest = (beam_dir * positions.top ()) >? (beam_dir * positions[0]); for (int i = 2; !concave && i < positions.size () - 1; i++) { int inner_dy = positions[i] - positions[i - 1]; diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index def3e6a66b..f5ea6a3ca9 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -118,7 +118,7 @@ Beam_engraver::set_melisma (bool ml) { SCM b = get_property ("autoBeaming"); if (!to_boolean (b)) - context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F); + context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T : SCM_BOOL_F); } void @@ -149,7 +149,6 @@ Beam_engraver::process_music () /* urg, must copy to Auto_beam_engraver too */ } - } void @@ -246,7 +245,7 @@ Beam_engraver::acknowledge_grob (Grob_info info) } last_stem_added_at_ = now; - int durlog = unsmob_duration (m->get_property ("duration"))-> duration_log (); + int durlog = unsmob_duration (m->get_property ("duration"))->duration_log (); if (durlog <= 2) { m->origin ()->warning (_ ("stem doesn't fit in beam")); @@ -268,7 +267,6 @@ Beam_engraver::acknowledge_grob (Grob_info info) } } - ADD_TRANSLATOR (Beam_engraver, /* descr */ "Handles Beam events by engraving Beams. If omitted, then notes will be " "printed with flags instead of beams.", diff --git a/lily/beam-performer.cc b/lily/beam-performer.cc index a7cd2547b1..0b88e90086 100644 --- a/lily/beam-performer.cc +++ b/lily/beam-performer.cc @@ -56,7 +56,7 @@ Beam_performer::set_melisma (bool ml) { SCM b = get_property ("autoBeaming"); if (!to_boolean (b)) - context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F); + context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T : SCM_BOOL_F); } void diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index c18c5c4cfe..eb9d3b0c8c 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -457,11 +457,11 @@ Beam::score_forbidden_quants (Real yl, Real yr, dem += extra_demerit * (fixed_demerit - + (1 - fixed_demerit) * (dist / gap.length ())* 2); + + (1 - fixed_demerit) * (dist / gap.length ()) * 2); } } } - while ((flip (&d))!= LEFT); + while ((flip (&d)) != LEFT); if ((beam_counts[LEFT] >? beam_counts[RIGHT]) >= 2) { diff --git a/lily/beam.cc b/lily/beam.cc index fc02627a2e..f54726950f 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -110,8 +110,8 @@ Beam::space_function (SCM smob, SCM beam_count) Real thickness = get_thickness (me); Real beam_translation = scm_to_int (beam_count) < 4 - ? (2*staff_space + line - thickness) / 2.0 - : (3*staff_space + line - thickness) / 3.0; + ? (2 * staff_space + line - thickness) / 2.0 + : (3 * staff_space + line - thickness) / 3.0; return scm_make_real (beam_translation); } @@ -194,7 +194,7 @@ position_with_maximal_common_beams (SCM left_beaming, SCM right_beaming, int best_count = 0; int best_start = 0; for (int i = lslice[-left_dir]; - (i - lslice[left_dir])* left_dir <= 0; i+= left_dir) + (i - lslice[left_dir]) * left_dir <= 0; i += left_dir) { int count = 0; for (SCM s = scm_car (right_beaming); scm_is_pair (s); s = scm_cdr (s)) @@ -224,7 +224,7 @@ Beam::connect_beams (Grob *me) last_int.set_empty (); SCM last_beaming = SCM_EOL; Direction last_dir = CENTER; - for (int i = 0; i< stems.size (); i++) + for (int i = 0; i < stems.size (); i++) { Grob *this_stem = stems[i]; SCM this_beaming = this_stem->get_property ("beaming"); @@ -253,7 +253,6 @@ Beam::connect_beams (Grob *me) new_slice.add_point (new_beam_pos); scm_set_car_x (s, scm_int2num (new_beam_pos)); } - } while (flip (&d) != LEFT); @@ -342,13 +341,13 @@ Beam::print (SCM grob) Stencil the_beam; Real lt = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness")); - for (int i = 0; i<= stems.size (); i++) + for (int i = 0; i <= stems.size (); i++) { Grob *st = (i < stems.size ()) ? stems[i] : 0; SCM this_beaming = st ? st->get_property ("beaming") : SCM_EOL; Real xposn = st ? st->relative_coordinate (xcommon, X_AXIS) : 0.0; - Real stem_width = st ? robust_scm2double (st->get_property ("thickness"), 1.0) *lt : 0; + Real stem_width = st ? robust_scm2double (st->get_property ("thickness"), 1.0) * lt : 0; Direction stem_dir = st ? to_dir (st->get_property ("direction")) : CENTER; /* We do the space left of ST, with lfliebertjes pointing to the @@ -399,7 +398,7 @@ Beam::print (SCM grob) } if (st) - w += stem_width/ 2; + w += stem_width / 2; Real blot = me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter")); Stencil whole = Lookup::beam (slope, w, thick, blot); @@ -517,7 +516,6 @@ Beam::print (SCM grob) return the_beam.smobbed_copy (); } - Direction Beam::get_default_dir (Grob *me) { @@ -570,7 +568,7 @@ Beam::set_stem_directions (Grob *me, Direction d) Link_array stems = extract_grob_array (me, ly_symbol2scm ("stems")); - for (int i = 0; i set_property ("direction", scm_int2num (d)); @@ -898,7 +895,7 @@ Beam::least_squares (SCM smob) /* "position" is relative to the staff. */ - scale_drul (&pos, 1/ Staff_symbol_referencer::staff_space (me)); + scale_drul (&pos, 1 / Staff_symbol_referencer::staff_space (me)); me->set_property ("positions", ly_interval2scm (pos)); @@ -1000,7 +997,7 @@ Beam::shift_region_to_valid (SCM grob) } pos = Drul_array (y, (y + dy)); - scale_drul (&pos, 1/ Staff_symbol_referencer::staff_space (me)); + scale_drul (&pos, 1 / Staff_symbol_referencer::staff_space (me)); me->set_property ("positions", ly_interval2scm (pos)); return SCM_UNSPECIFIED; @@ -1170,7 +1167,7 @@ Beam::set_stem_lengths (Grob *me) if (gap) stem_y += thick * 0.5 * get_grob_direction (s); - Stem::set_stemend (s, 2* stem_y / staff_space); + Stem::set_stemend (s, 2 * stem_y / staff_space); } } @@ -1234,7 +1231,6 @@ Beam::forced_stem_count (Grob *me) return f; } - int Beam::visible_stem_count (Grob *me) { @@ -1359,7 +1355,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis) < rad || (rest->extent (common_y, Y_AXIS)[-d] + staff_space * shift) * -d < rad) - shift = ceil (fabs (shift)) *sign (shift); + shift = ceil (fabs (shift)) * sign (shift); return scm_make_real (staff_space * shift); } diff --git a/lily/beaming-info.cc b/lily/beaming-info.cc index 1e2f3f4f4d..78846cea7e 100644 --- a/lily/beaming-info.cc +++ b/lily/beaming-info.cc @@ -32,7 +32,7 @@ Beaming_info_list::best_splitpoint_index (Moment &beat_length, bool subdivide) c int minidx = -1; Moment beat_pos; - for (int i =1; i < infos_.size (); i++) + for (int i = 1; i < infos_.size (); i++) { beat_pos = infos_[i].start_mom_ / beat_length; int den = beat_pos.den (); @@ -45,7 +45,7 @@ Beaming_info_list::best_splitpoint_index (Moment &beat_length, bool subdivide) c } } - return minidx| (minden ==1 && subdivide ? at_beat : 0); + return minidx | (minden == 1 && subdivide ? at_beat : 0); } int @@ -80,8 +80,8 @@ Beaming_info_list::beamify (Moment &beat_length, bool subdivide) } while (flip (&d) != LEFT); - int middle_beams = (split ? 1 : - splits[RIGHT].beam_extend_count (LEFT) * array, Real x, Real y) +scale (Array *array, Real x, Real y) { for (int i = 0; i < array->size (); i++) { - (*array)[i][X_AXIS] = x* (*array)[i][X_AXIS]; - (*array)[i][Y_AXIS] = y* (*array)[i][Y_AXIS]; + (*array)[i][X_AXIS] = x * (*array)[i][X_AXIS]; + (*array)[i][Y_AXIS] = y * (*array)[i][Y_AXIS]; } } void -rotate (Array* array, Real phi) +rotate (Array *array, Real phi) { Offset rot (complex_exp (Offset (0, phi))); for (int i = 0; i < array->size (); i++) @@ -46,7 +46,7 @@ rotate (Array* array, Real phi) } void -translate (Array* array, Offset o) +translate (Array *array, Offset o) { for (int i = 0; i < array->size (); i++) (*array)[i] += o; @@ -85,7 +85,7 @@ Offset Bezier::curve_point (Real t) const { Real tj = 1; - Real one_min_tj = (1 - t)* (1 - t)* (1 - t); + Real one_min_tj = (1 - t) * (1 - t) * (1 - t); Offset o; for (int j = 0; j < 4; j++) @@ -99,8 +99,8 @@ Bezier::curve_point (Real t) const } #ifdef PARANOID - assert (fabs (o[X_AXIS] - polynomial (X_AXIS).eval (t))< 1e-8); - assert (fabs (o[Y_AXIS] - polynomial (Y_AXIS).eval (t))< 1e-8); + assert (fabs (o[X_AXIS] - polynomial (X_AXIS).eval (t)) < 1e-8); + assert (fabs (o[Y_AXIS] - polynomial (Y_AXIS).eval (t)) < 1e-8); #endif return o; @@ -128,7 +128,7 @@ Array filter_solutions (Array sol) { for (int i = sol.size (); i--;) - if (sol[i] < 0 || sol[i] >1) + if (sol[i] < 0 || sol[i] > 1) sol.del (i); return sol; } @@ -170,7 +170,7 @@ Bezier::extent (Axis a) const { int o = (a + 1)%NO_AXES; Offset d; - d[Axis (o)] =1.0; + d[Axis (o)] = 1.0; Interval iv; Array sols (solve_derivative (d)); sols.push (1.0); diff --git a/lily/box.cc b/lily/box.cc index bd15a691f9..c933c1bc05 100644 --- a/lily/box.cc +++ b/lily/box.cc @@ -44,13 +44,13 @@ Box::Box (Interval ix, Interval iy) } Interval & -Box::operator[] (Axis a) +Box::operator [] (Axis a) { return interval_a_[a]; } Interval -Box::operator[] (Axis a) const +Box::operator [] (Axis a) const { return interval_a_[a]; } diff --git a/lily/break-algorithm.cc b/lily/break-algorithm.cc index 4575d8410e..66be64c8df 100644 --- a/lily/break-algorithm.cc +++ b/lily/break-algorithm.cc @@ -22,7 +22,7 @@ Break_algorithm::find_break_indices () const Link_array all = pscore_->system_->columns (); Array retval; - for (int i= 0; i < all.size (); i++) + for (int i = 0; i < all.size (); i++) if (Item::is_breakable (all[i])) retval.push (i); @@ -39,12 +39,12 @@ Break_algorithm::find_breaks () const Link_array all = pscore_->system_->columns (); Link_array retval; - for (int i= 0; i < all.size (); i++) + for (int i = 0; i < all.size (); i++) if (Item::is_breakable (all[i])) retval.push (all[i]); if (linewidth_ <= 0) - while (retval.size () >2) + while (retval.size () > 2) retval.del (1); return retval; diff --git a/lily/break-align-engraver.cc b/lily/break-align-engraver.cc index 7309342dd6..a9787ef377 100644 --- a/lily/break-align-engraver.cc +++ b/lily/break-align-engraver.cc @@ -35,7 +35,6 @@ Break_align_engraver::add_column (SCM smob) { Grob *e = unsmob_grob (smob); Break_align_interface::add_element (align_, e); - } void @@ -121,7 +120,6 @@ Break_align_engraver::add_to_group (SCM align_name, Item *item) group->set_parent (align_, Y_AXIS); column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm ()); - } Axis_group_interface::add_element (group, item); } diff --git a/lily/break-substitution.cc b/lily/break-substitution.cc index 9afd8f13ea..e41b09c553 100644 --- a/lily/break-substitution.cc +++ b/lily/break-substitution.cc @@ -34,7 +34,6 @@ substitute_grob (Grob *sc) if (sc->get_system () != line) { sc = sc->find_broken_piece (line); - } /* now: !sc || (sc && sc->get_system () == line) */ @@ -233,7 +232,7 @@ item_system_range (Item *it) if (bi && bi->get_system ()) sr.add_point (bi->get_system ()->rank_); } - while (flip (&d)!= LEFT); + while (flip (&d) != LEFT); return sr; } @@ -378,7 +377,7 @@ Spanner::fast_fubstitute_grob_list (SCM sym, ordering, since they go across the entire score. */ for (int i = sp_indices.size (); i--;) - sp_indices[i]= Slice (sp_index, len - 1); + sp_indices[i] = Slice (sp_index, len - 1); assert (it_index <= sp_index); @@ -387,7 +386,7 @@ Spanner::fast_fubstitute_grob_list (SCM sym, { Grob *sc = broken_intos_[i]; System *l = sc->get_system (); - set_break_subsititution (l ? l->self_scm (): SCM_UNDEFINED); + set_break_subsititution (l ? l->self_scm () : SCM_UNDEFINED); SCM newval = SCM_EOL; SCM *tail = &newval; @@ -396,13 +395,12 @@ Spanner::fast_fubstitute_grob_list (SCM sym, for (int j = (*arrs[k])[i][LEFT]; j <= (*arrs[k])[i][RIGHT]; j++) { SCM subs = substitute_grob (vec[j].grob_); - if (subs!= SCM_UNDEFINED) + if (subs != SCM_UNDEFINED) { *tail = scm_cons (subs, SCM_EOL); tail = SCM_CDRLOC (*tail); } - } #ifdef PARANOIA @@ -489,7 +487,7 @@ Spanner::substitute_one_mutable_property (SCM sym, fast_done = s->fast_fubstitute_grob_list (sym, val); if (!fast_done) - for (int i = 0; i < s->broken_intos_ .size (); i++) + for (int i = 0; i < s->broken_intos_.size (); i++) { Grob *sc = s->broken_intos_[i]; System *l = sc->get_system (); diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 86aa555336..da241a2d4b 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -114,7 +114,6 @@ Clef_engraver::create_clef () g->set_parent (clef_, X_AXIS); g->set_property ("direction", scm_int2num (dir)); octavate_ = g; - } } } @@ -172,7 +171,6 @@ Clef_engraver::stop_translation_timestep () if (octavate_) { octavate_->set_property ("break-visibility", vis); - } } diff --git a/lily/cluster-engraver.cc b/lily/cluster-engraver.cc index 02c7613cbc..cdbfcd9b5d 100644 --- a/lily/cluster-engraver.cc +++ b/lily/cluster-engraver.cc @@ -79,7 +79,7 @@ Cluster_spanner_engraver::process_music () int pmax = INT_MIN; int pmin = INT_MAX; - for (int i = 0; i get_property ("pitch")); diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index a277540df3..13edfdd486 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -33,10 +33,9 @@ Collision_engraver::process_acknowledged_grobs () if (!col_) { col_ = make_item ("NoteCollision", SCM_EOL); - } - for (int i = 0; i< note_columns_.size (); i++) + for (int i = 0; i < note_columns_.size (); i++) Note_collision_interface::add_column (col_, note_columns_[i]); } @@ -65,7 +64,6 @@ Collision_engraver::Collision_engraver () col_ = 0; } - ADD_TRANSLATOR (Collision_engraver, /* descr */ "Collect NoteColumns, and as soon as there are two or more, put them in a NoteCollision object.", /* creats*/ "NoteCollision", diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index 0c9631afab..11b0e185fe 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -100,7 +100,6 @@ Completion_heads_engraver::try_music (Music *m) } return false; - } /* @@ -260,7 +259,6 @@ Completion_heads_engraver::process_music () Tie::set_head (p, RIGHT, notes_[i]); ties_.push (p); - } } diff --git a/lily/context-handle.cc b/lily/context-handle.cc index a649ef02f2..ae0821054f 100644 --- a/lily/context-handle.cc +++ b/lily/context-handle.cc @@ -64,7 +64,7 @@ Interpretation_context_handle::try_music (Music *m) } void -Interpretation_context_handle::operator= (Interpretation_context_handle const &s) +Interpretation_context_handle::operator = (Interpretation_context_handle const &s) { set_context (s.outlet_); } diff --git a/lily/context-scheme.cc b/lily/context-scheme.cc index 3d26ef368c..3ea9718f53 100644 --- a/lily/context-scheme.cc +++ b/lily/context-scheme.cc @@ -19,7 +19,7 @@ LY_DEFINE (ly_context_id, "ly:context-id", Context *tr = unsmob_context (context); SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context"); - return scm_makfrom0str (tr->id_string (). to_str0 ()); + return scm_makfrom0str (tr->id_string ().to_str0 ()); } LY_DEFINE (ly_context_name, "ly:context-name", diff --git a/lily/context.cc b/lily/context.cc index 7d7eddfc19..13965e2fa0 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -22,7 +22,7 @@ bool Context::is_removable () const { return context_list_ == SCM_EOL && ! iterator_count_ - && !dynamic_cast < Score_context const *> (this); + && !dynamic_cast (this); } void @@ -459,7 +459,6 @@ Context::get_output_def () const Context::~Context () { - } Moment diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index 70b5bb9265..0c5157d599 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -105,7 +105,6 @@ Custos_engraver::process_acknowledged_grobs () c->set_property ("staff-position", scm_int2num (p)); - } pitches_.clear (); diff --git a/lily/dimension-cache.cc b/lily/dimension-cache.cc index 1102d91893..e4dd194632 100644 --- a/lily/dimension-cache.cc +++ b/lily/dimension-cache.cc @@ -41,5 +41,3 @@ Dimension_cache::init () parent_ = 0; } - - diff --git a/lily/dot-column-engraver.cc b/lily/dot-column-engraver.cc index 79f3a27686..2bd44f58af 100644 --- a/lily/dot-column-engraver.cc +++ b/lily/dot-column-engraver.cc @@ -56,7 +56,6 @@ Dot_column_engraver::acknowledge_grob (Grob_info info) if (!dotcol_) { dotcol_ = make_item ("DotColumn", SCM_EOL); - } Dot_column::add_head (dotcol_, info.grob_); @@ -67,7 +66,6 @@ Dot_column_engraver::acknowledge_grob (Grob_info info) } } - ADD_TRANSLATOR (Dot_column_engraver, /* descr */ "Engraves dots on dotted notes shifted to the right of the note.\n" "If omitted, then dots appear on top of the notes.", diff --git a/lily/dot-column.cc b/lily/dot-column.cc index ec981b63bc..005651a123 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -81,7 +81,7 @@ struct Dot_position } }; -typedef std::map < int, Dot_position> Dot_configuration; +typedef std::map Dot_configuration; /* Value CFG according. @@ -301,7 +301,6 @@ Dot_column::add_head (Grob *me, Grob *rh) } } - ADD_INTERFACE (Dot_column, "dot-column-interface", "Groups dot objects so they form a column, and position dots so they do not " "clash with staff lines ", diff --git a/lily/dots.cc b/lily/dots.cc index 44eb51802f..a6f2e64a5c 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -41,14 +41,13 @@ Dots::print (SCM d) for (int i = scm_to_int (c); i--;) { - d.translate_axis (2*dw, X_AXIS); + d.translate_axis (2 * dw, X_AXIS); mol.add_at_edge (X_AXIS, RIGHT, d, dw, 0); } } return mol.smobbed_copy (); } - ADD_INTERFACE (Dots, "dots-interface", "The dots to go with a notehead or rest." "@code{direction} sets the preferred direction to move in case of staff " diff --git a/lily/drum-note-engraver.cc b/lily/drum-note-engraver.cc index d58a889d9d..c73cbf9791 100644 --- a/lily/drum-note-engraver.cc +++ b/lily/drum-note-engraver.cc @@ -150,7 +150,6 @@ Drum_notes_engraver::acknowledge_grob (Grob_info inf) } } } - } void diff --git a/lily/duration.cc b/lily/duration.cc index 08a5bbb78c..78c9275a4e 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -47,7 +47,7 @@ Duration::get_length () const { Rational mom (1 << abs (durlog_)); - if (durlog_> 0) + if (durlog_ > 0) mom = Rational (1) / mom; Rational delta = mom; diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 9396c97f9a..8cddbbbcdd 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -65,7 +65,6 @@ protected: virtual void process_music (); }; - Dynamic_engraver::Dynamic_engraver () { script_ = 0; @@ -112,7 +111,7 @@ Dynamic_engraver::process_music () if (!line_spanner_) { Music *rq = accepted_spanreqs_drul_[START]; - line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->self_scm (): SCM_EOL); + line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->self_scm () : SCM_EOL); if (script_ev_) rq = script_ev_; @@ -144,8 +143,8 @@ Dynamic_engraver::process_music () Axis_group_interface::add_element (line_spanner_, script_); } - Music *stop_ev = accepted_spanreqs_drul_ [STOP] ? - accepted_spanreqs_drul_[STOP] : script_ev_; + Music *stop_ev = accepted_spanreqs_drul_ [STOP] + ? accepted_spanreqs_drul_[STOP] : script_ev_; if (accepted_spanreqs_drul_[STOP] || script_ev_) { @@ -172,7 +171,6 @@ Dynamic_engraver::process_music () accepted_spanreqs_drul_[STOP]->origin ()->warning (_ ("can't find start of (de)crescendo")); stop_ev = 0; } - } if (accepted_spanreqs_drul_[START]) @@ -225,7 +223,6 @@ Dynamic_engraver::process_music () cresc_->set_property ("grow-direction", scm_int2num ((start_type == "crescendo") ? BIGGER : SMALLER)); - } /* @@ -392,7 +389,6 @@ Dynamic_engraver::acknowledge_grob (Grob_info info) cresc_->set_bound (LEFT, info.grob_); add_bound_item (line_spanner_, cresc_->get_bound (LEFT)); } - } else if (Script_interface::has_interface (info.grob_) && script_) { diff --git a/lily/dynamic-text-spanner.cc b/lily/dynamic-text-spanner.cc index 8466dbde7d..89d0138f9c 100644 --- a/lily/dynamic-text-spanner.cc +++ b/lily/dynamic-text-spanner.cc @@ -18,7 +18,6 @@ #include "warn.hh" #include "paper-column.hh" - class Dynamic_text_spanner { public: @@ -26,7 +25,6 @@ public: static bool has_interface (Grob *); }; - /* This is a partial C&P from text-spanner.cc diff --git a/lily/engraver-group-engraver.cc b/lily/engraver-group-engraver.cc index 2f204cec18..37811f925b 100644 --- a/lily/engraver-group-engraver.cc +++ b/lily/engraver-group-engraver.cc @@ -109,7 +109,7 @@ Engraver_group_engraver::do_announces () group->do_announces (); } - do + while (1) { engraver_each (get_simple_trans_list (), &Engraver::process_acknowledged_grobs); @@ -120,11 +120,8 @@ Engraver_group_engraver::do_announces () acknowledge_grobs (); announce_infos_.clear (); } - while (1); - } while (pending_grob_count () > 0); - } void diff --git a/lily/engraver.cc b/lily/engraver.cc index bfd30de898..88985792dc 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -49,7 +49,6 @@ Engraver::announce_grob (Grob *e, SCM cause) g->announce_grob (i); } - Engraver::Engraver () { } diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index bcfb63a711..59570ba4a8 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -139,7 +139,6 @@ Fingering_engraver::start_translation_timestep () Fingering_engraver::Fingering_engraver () { - } ADD_TRANSLATOR (Fingering_engraver, diff --git a/lily/font-size-engraver.cc b/lily/font-size-engraver.cc index 6d02eab213..a5f7848c7f 100644 --- a/lily/font-size-engraver.cc +++ b/lily/font-size-engraver.cc @@ -20,7 +20,6 @@ private: Font_size_engraver::Font_size_engraver () { - } void diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index ba66ad8715..3d89ea5b53 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -97,7 +97,7 @@ LY_DEFINE (ly_dir_p, "ly:dir?", if (scm_is_number (s)) { int i = scm_to_int (s); - return (i>= -1 && i <= 1) ? SCM_BOOL_T : SCM_BOOL_F; + return (i >= -1 && i <= 1) ? SCM_BOOL_T : SCM_BOOL_F; } return SCM_BOOL_F; } diff --git a/lily/global-context.cc b/lily/global-context.cc index ceafb4672c..b7afb1dab4 100644 --- a/lily/global-context.cc +++ b/lily/global-context.cc @@ -81,7 +81,6 @@ Global_context::prepare (Moment m) clear_key_disambiguations (); if (get_score_context ()) get_score_context ()->prepare (m); - } Moment @@ -122,7 +121,7 @@ Global_context::finish () void Global_context::run_iterator_on_me (Music_iterator *iter) { - if (iter-> ok ()) + if (iter->ok ()) prev_mom_ = now_mom_ = iter->pending_moment (); bool first = true; diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 3c988c6e0f..dc6649dfb2 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -88,7 +88,7 @@ Gourlay_breaking::do_solve () const bool ragged_last = to_boolean (pscore_->layout_->c_variable ("raggedlast")); Real worst_force = 0.0; - for (int break_idx = 1; break_idx< breaks.size (); break_idx++) + for (int break_idx = 1; break_idx < breaks.size (); break_idx++) { /* start with a short line, add measures. At some point @@ -186,7 +186,7 @@ Gourlay_breaking::do_solve () const Array lines; /* skip 0-th element, since it is a "dummy" elt*/ - for (int i = optimal_paths.size () - 1; i> 0;) + for (int i = optimal_paths.size () - 1; i > 0;) { final_breaks.push (i); int prev = optimal_paths[i].prev_break_; diff --git a/lily/gregorian-ligature-engraver.cc b/lily/gregorian-ligature-engraver.cc index 96c960b1c4..26c6cac558 100644 --- a/lily/gregorian-ligature-engraver.cc +++ b/lily/gregorian-ligature-engraver.cc @@ -91,18 +91,18 @@ void check_and_fix_all_prefixes (Array primitives) /* compute head prefix set by inspecting primitive grob properties */ int prefix_set - = (VIRGA *to_boolean (primitive->get_property ("virga"))) | - (STROPHA *to_boolean (primitive->get_property ("stropha"))) | - (INCLINATUM *to_boolean (primitive->get_property ("inclinatum"))) | - (AUCTUM *to_boolean (primitive->get_property ("auctum"))) | - (DESCENDENS *to_boolean (primitive->get_property ("descendens"))) | - (ASCENDENS *to_boolean (primitive->get_property ("ascendens"))) | - (ORISCUS *to_boolean (primitive->get_property ("oriscus"))) | - (QUILISMA *to_boolean (primitive->get_property ("quilisma"))) | - (DEMINUTUM *to_boolean (primitive->get_property ("deminutum"))) | - (CAVUM *to_boolean (primitive->get_property ("cavum"))) | - (LINEA *to_boolean (primitive->get_property ("linea"))) | - (PES_OR_FLEXA *to_boolean (primitive->get_property ("pes-or-flexa"))); + = (VIRGA *to_boolean (primitive->get_property ("virga"))) + | (STROPHA *to_boolean (primitive->get_property ("stropha"))) + | (INCLINATUM *to_boolean (primitive->get_property ("inclinatum"))) + | (AUCTUM *to_boolean (primitive->get_property ("auctum"))) + | (DESCENDENS *to_boolean (primitive->get_property ("descendens"))) + | (ASCENDENS *to_boolean (primitive->get_property ("ascendens"))) + | (ORISCUS *to_boolean (primitive->get_property ("oriscus"))) + | (QUILISMA *to_boolean (primitive->get_property ("quilisma"))) + | (DEMINUTUM *to_boolean (primitive->get_property ("deminutum"))) + | (CAVUM *to_boolean (primitive->get_property ("cavum"))) + | (LINEA *to_boolean (primitive->get_property ("linea"))) + | (PES_OR_FLEXA *to_boolean (primitive->get_property ("pes-or-flexa"))); /* check: ascendens and descendens exclude each other; same with auctum and deminutum */ diff --git a/lily/grob-interface.cc b/lily/grob-interface.cc index 6e155aa68b..b0a255d58f 100644 --- a/lily/grob-interface.cc +++ b/lily/grob-interface.cc @@ -32,7 +32,6 @@ check_interfaces_for_property (Grob const *me, SCM sym) otherwise we get in a nasty recursion loop. */ return; - } SCM ifs = me->get_property ("interfaces"); diff --git a/lily/grob-pitch-tuple.cc b/lily/grob-pitch-tuple.cc index 6f175b9cf5..62ede1af08 100644 --- a/lily/grob-pitch-tuple.cc +++ b/lily/grob-pitch-tuple.cc @@ -15,7 +15,6 @@ int compare (Grob_pitch_tuple const &a, Grob_pitch_tuple const &b) return Grob_pitch_tuple::time_compare (a, b); } - Grob_pitch_tuple::Grob_pitch_tuple () { head_ = 0; diff --git a/lily/grob-pq-engraver.cc b/lily/grob-pq-engraver.cc index 94b7b8f5a6..10644e7775 100644 --- a/lily/grob-pq-engraver.cc +++ b/lily/grob-pq-engraver.cc @@ -11,7 +11,7 @@ #include "grob.hh" #include "warn.hh" -class Grob_pq_engraver: public Engraver +class Grob_pq_engraver : public Engraver { public: TRANSLATOR_DECLARATIONS (Grob_pq_engraver); diff --git a/lily/grob.cc b/lily/grob.cc index 0594582d79..d127c0094d 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -123,7 +123,7 @@ Grob::Grob (Grob const &s, int copy_index) : dim_cache_ (s.dim_cache_) { key_ = new Copied_key (s.key_, copy_index); - original_ = (Grob *) &s; + original_ = (Grob *) & s; self_scm_ = SCM_EOL; immutable_property_alist_ = s.immutable_property_alist_; @@ -241,7 +241,7 @@ Grob::get_uncached_stencil () const { SCM expr = scm_list_3 (ly_symbol2scm ("grob-cause"), self_scm (), m->expr ()); - stil = Stencil (m->extent_box (), expr). smobbed_copy (); + stil = Stencil (m->extent_box (), expr).smobbed_copy (); } /* color support... see interpret_stencil_expression() for more... */ @@ -439,11 +439,12 @@ Grob::extent (Grob *refp, Axis a) const { Real x = relative_coordinate (refp, a); - Dimension_cache *d = (Dimension_cache *) &dim_cache_[a]; + Dimension_cache *d = (Dimension_cache *) & dim_cache_[a]; Interval ext; SCM dimpair = d->dimension_; - if (scm_is_pair (dimpair)); + if (scm_is_pair (dimpair)) + ; else if (ly_c_procedure_p (d->dimension_callback_) && d->dimension_ == SCM_EOL) d->dimension_ = scm_call_2 (d->dimension_callback_, self_scm (), scm_int2num (a)); @@ -599,7 +600,7 @@ Grob::fixup_refpoint (SCM smob) if (parenti && i) { Direction my_dir = i->break_status_dir (); - if (my_dir!= parenti->break_status_dir ()) + if (my_dir != parenti->break_status_dir ()) { Item *newparent = parenti->find_prebroken_piece (my_dir); me->set_parent (newparent, ax); diff --git a/lily/hairpin.cc b/lily/hairpin.cc index b3e5c6edce..2c7368fa57 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -65,7 +65,7 @@ Hairpin::print (SCM smob) { Interval e = b->extent (common, X_AXIS); if (!e.is_empty ()) - x_points[d] = e[-d] - d*padding; + x_points[d] = e[-d] - d * padding; } else { diff --git a/lily/hara-kiri-group-spanner.cc b/lily/hara-kiri-group-spanner.cc index c3b4d5cd98..6ff6f4a95c 100644 --- a/lily/hara-kiri-group-spanner.cc +++ b/lily/hara-kiri-group-spanner.cc @@ -83,7 +83,6 @@ Hara_kiri_group_spanner::add_element (Grob *me, Grob *e) Axis_group_interface::add_element (me, e); } - void Hara_kiri_group_spanner::add_interesting_item (Grob *me, Grob *n) { diff --git a/lily/hyphen-engraver.cc b/lily/hyphen-engraver.cc index aa647816ba..cbd8d1a2a7 100644 --- a/lily/hyphen-engraver.cc +++ b/lily/hyphen-engraver.cc @@ -28,10 +28,8 @@ protected: virtual void stop_translation_timestep (); virtual void process_music (); private: - }; - Hyphen_engraver::Hyphen_engraver () { hyphen_ = 0; @@ -138,7 +136,6 @@ Hyphen_engraver::stop_translation_timestep () ev_ = 0; } - ADD_TRANSLATOR (Hyphen_engraver, /* descr */ "Create lyric hyphens", /* creats*/ "LyricHyphen", diff --git a/lily/include/afm.hh b/lily/include/afm.hh index 7db3cbcf37..3f815e9461 100644 --- a/lily/include/afm.hh +++ b/lily/include/afm.hh @@ -40,7 +40,7 @@ protected: AFM_CharMetricInfo const *find_ascii_metric (int) const; Array ascii_to_metric_idx_; - std::map < String, int> name_to_metric_dict_; + std::map name_to_metric_dict_; Adobe_font_metric (AFM_Font_info *); }; diff --git a/lily/include/audio-item.hh b/lily/include/audio-item.hh index 1ab00fd915..44ac8c2378 100644 --- a/lily/include/audio-item.hh +++ b/lily/include/audio-item.hh @@ -24,7 +24,7 @@ public: private: Audio_item (Audio_item const &); - Audio_item &operator= (Audio_item const &); + Audio_item &operator = (Audio_item const &); }; class Audio_dynamic : public Audio_item diff --git a/lily/include/axis-group-interface.hh b/lily/include/axis-group-interface.hh index 6792372c09..bcc5e7819c 100644 --- a/lily/include/axis-group-interface.hh +++ b/lily/include/axis-group-interface.hh @@ -23,7 +23,6 @@ struct Axis_group_interface static bool has_axis (Grob *, Axis); static Link_array get_children (Grob *); static bool has_interface (Grob *); - }; #endif /* AXIS_GROUP_INTERFACE_HH */ diff --git a/lily/include/bezier.hh b/lily/include/bezier.hh index a564dbeb1f..eb2199b33b 100644 --- a/lily/include/bezier.hh +++ b/lily/include/bezier.hh @@ -40,9 +40,9 @@ public: Offset control_[4]; }; -void scale (Array* array, Real xscale, Real yscale); -void rotate (Array* array, Real phi); -void translate (Array* array, Offset o); +void scale (Array *array, Real xscale, Real yscale); +void rotate (Array *array, Real phi); +void translate (Array *array, Offset o); Bezier slur_shape (Real width, Real height_limit, Real height_proportion); diff --git a/lily/include/box.hh b/lily/include/box.hh index 85173e0b52..fc8eda7bec 100644 --- a/lily/include/box.hh +++ b/lily/include/box.hh @@ -16,8 +16,8 @@ struct Box Interval &y (){ return interval_a_[Y_AXIS]; } Interval x () const{ return interval_a_[X_AXIS]; } Interval y () const{return interval_a_[Y_AXIS]; } - Interval operator[] (Axis a) const; - Interval &operator[] (Axis a); + Interval operator [] (Axis a) const; + Interval &operator [] (Axis a); Offset center () const; diff --git a/lily/include/break-align-interface.hh b/lily/include/break-align-interface.hh index 96aec1122d..8ab57760f6 100644 --- a/lily/include/break-align-interface.hh +++ b/lily/include/break-align-interface.hh @@ -20,7 +20,6 @@ public: static void add_element (Grob *me, Grob *add); DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element, SCM axis)); DECLARE_SCHEME_CALLBACK (self_align_callback, (SCM element, SCM axis)); - }; struct Break_aligned_interface { diff --git a/lily/include/context.hh b/lily/include/context.hh index 0981bc536a..e17af62e1e 100644 --- a/lily/include/context.hh +++ b/lily/include/context.hh @@ -28,8 +28,8 @@ private: int iterator_count_; bool init_; - std::map < String, int> grob_counts_; - std::map < String, int> context_counts_; + std::map grob_counts_; + std::map context_counts_; protected: Object_key const *key_; @@ -91,7 +91,6 @@ public: SCM ops); Link_array path_to_acceptable_context (SCM alias, Output_def *) const; - }; /* diff --git a/lily/include/custos.hh b/lily/include/custos.hh index 5c706e8154..fe2f13bdd2 100644 --- a/lily/include/custos.hh +++ b/lily/include/custos.hh @@ -22,7 +22,6 @@ struct Custos private: static void add_streepjes (Grob *me, int pos, int interspaces, Stencil *custos_); static Stencil create_ledger_line (Interval x_extent, Grob *me); - }; #endif // CUSTOS_HH diff --git a/lily/include/engraver-group-engraver.hh b/lily/include/engraver-group-engraver.hh index 7d58562c3a..63b126eabf 100644 --- a/lily/include/engraver-group-engraver.hh +++ b/lily/include/engraver-group-engraver.hh @@ -31,7 +31,7 @@ private: virtual void acknowledge_grobs (); }; -typedef void (Engraver::*Engraver_method) (void); +typedef void (Engraver:: *Engraver_method) (void); void engraver_each (SCM list, Engraver_method method); diff --git a/lily/include/engraver.hh b/lily/include/engraver.hh index 3a44301b3e..8031efebcb 100644 --- a/lily/include/engraver.hh +++ b/lily/include/engraver.hh @@ -57,5 +57,4 @@ public: Item *make_item_from_properties (Engraver *tg, SCM x, SCM cause, const char *name); Spanner *make_spanner_from_properties (Engraver *tg, SCM x, SCM cause, const char *name); - #endif // ENGRAVER_HH diff --git a/lily/include/event.hh b/lily/include/event.hh index 6878eb4e61..41d24d2041 100644 --- a/lily/include/event.hh +++ b/lily/include/event.hh @@ -24,5 +24,4 @@ public: DECLARE_SCHEME_CALLBACK (length_callback, (SCM)); }; - #endif diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 6511dc7565..9f46a06e1d 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -26,7 +26,7 @@ enum Grob_status POSTCALCED, // after spacing calcs done }; -typedef void (Grob::*Grob_method_pointer) (void); +typedef void (Grob:: *Grob_method_pointer) (void); // looking at gtk+/pango docstrings .. WIP diff --git a/lily/include/group-interface.hh b/lily/include/group-interface.hh index 55e541755d..c8c0938e30 100644 --- a/lily/include/group-interface.hh +++ b/lily/include/group-interface.hh @@ -35,6 +35,5 @@ public: Link_array extract_grob_array (Grob const *elt, SCM symbol); Link_array extract_item_array (Grob const *elt, SCM symbol); - #endif /* GROUP_INTERFACE_HH */ diff --git a/lily/include/interpretation-context-handle.hh b/lily/include/interpretation-context-handle.hh index 86928e6324..83b11c9cf2 100644 --- a/lily/include/interpretation-context-handle.hh +++ b/lily/include/interpretation-context-handle.hh @@ -22,7 +22,7 @@ public: void set_context (Context *); bool try_music (Music *); - void operator= (Interpretation_context_handle const &); + void operator = (Interpretation_context_handle const &); Interpretation_context_handle (Interpretation_context_handle const &); Context *get_outlet () const; diff --git a/lily/include/lily-guile-macros.hh b/lily/include/lily-guile-macros.hh index 5bf69473ec..2138038481 100644 --- a/lily/include/lily-guile-macros.hh +++ b/lily/include/lily-guile-macros.hh @@ -84,13 +84,13 @@ inline SCM ly_symbol2scm (char const *x) { return scm_str2symbol ((x)); } Make TYPE::FUNC available as a Scheme function. */ #define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT) \ - SCM TYPE :: FUNC ## _proc; \ + SCM TYPE ::FUNC ## _proc; \ void \ TYPE ## _ ## FUNC ## _init_functions () \ { \ - TYPE :: FUNC ## _proc = scm_c_define_gsubr (#TYPE "::" #FUNC, \ - (ARGCOUNT), 0, 0, \ - (Scheme_function_unknown)TYPE :: FUNC); \ + TYPE ::FUNC ## _proc = scm_c_define_gsubr (#TYPE "::" #FUNC, \ + (ARGCOUNT), 0, 0, \ + (Scheme_function_unknown)TYPE ::FUNC); \ scm_c_export (#TYPE "::" #FUNC, NULL); \ } \ \ diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index c71d7c53ee..9aa20c071c 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -10,7 +10,6 @@ #define LILY_PROTO_HH #include "flower-proto.hh" - class Adobe_font_metric; class All_font_metrics; class Audio_column; diff --git a/lily/include/midi-stream.hh b/lily/include/midi-stream.hh index c4512f82ec..6387feb383 100644 --- a/lily/include/midi-stream.hh +++ b/lily/include/midi-stream.hh @@ -19,9 +19,9 @@ struct Midi_stream Midi_stream (String file_name_string); ~Midi_stream (); - Midi_stream &operator<< (String str); - Midi_stream &operator<< (Midi_item const &midi_c_r); - Midi_stream &operator<< (int i); + Midi_stream &operator << (String str); + Midi_stream &operator << (Midi_item const &midi_c_r); + Midi_stream &operator << (int i); void open (); diff --git a/lily/include/midi-walker.hh b/lily/include/midi-walker.hh index 5f9e9e602f..138b47dbb3 100644 --- a/lily/include/midi-walker.hh +++ b/lily/include/midi-walker.hh @@ -12,7 +12,7 @@ #include "lily-proto.hh" #include "moment.hh" -struct Midi_note_event : PQueue_ent < Moment, Midi_note *> +struct Midi_note_event : PQueue_ent { bool ignore_b_; Midi_note_event (); @@ -30,7 +30,7 @@ public: ~Midi_walker (); void process (); - void operator++ (int); + void operator ++ (int); bool ok () const; private: @@ -41,7 +41,7 @@ private: Midi_track *track_; Audio_staff *staff_; int index_; - Link_array * items_; + Link_array *items_; PQueue stop_note_queue; Moment last_mom_; }; diff --git a/lily/include/moment.hh b/lily/include/moment.hh index e7f5499646..2192680b89 100644 --- a/lily/include/moment.hh +++ b/lily/include/moment.hh @@ -26,13 +26,13 @@ public: Moment (Rational, Rational); Moment (Rational m); - Moment operator- () const; + Moment operator - () const; - void operator+= (Moment const &m); - void operator-= (Moment const &m); + void operator += (Moment const &m); + void operator -= (Moment const &m); - void operator*= (Moment const &m); - void operator/= (Moment const &m); + void operator *= (Moment const &m); + void operator /= (Moment const &m); Rational main_part_; Rational grace_part_; @@ -61,7 +61,7 @@ INSTANTIATE_COMPARE (Moment const &, Moment::compare); Moment robust_scm2moment (SCM, Moment); #ifdef STREAM_SUPPORT -std::ostream & operator<< (std::ostream &, Moment const &); +std::ostream &operator << (std::ostream &, Moment const &); #endif bool moment_less (SCM a, SCM b); diff --git a/lily/include/music-constructor.hh b/lily/include/music-constructor.hh index efeb433232..aad0123ddc 100644 --- a/lily/include/music-constructor.hh +++ b/lily/include/music-constructor.hh @@ -21,7 +21,7 @@ } \ static void _ ## type ## _adder () \ { \ - add_music_ctor (#type, & _ ## type ## _ctor); \ + add_music_ctor (#type, &_ ## type ## _ctor); \ } \ ADD_SCM_INIT_FUNC (_ ## type ## _adder_prefix, _ ## type ## _adder); @@ -29,6 +29,5 @@ typedef Music *(*Music_ctor) (SCM); void add_music_ctor (String, Music_ctor); Music *make_music (String, SCM); - #endif /* MUSIC_CONSTRUCTOR_HH */ diff --git a/lily/include/note-collision.hh b/lily/include/note-collision.hh index de6d4dd290..8a0a5ec79e 100644 --- a/lily/include/note-collision.hh +++ b/lily/include/note-collision.hh @@ -26,10 +26,10 @@ class Note_collision_interface { public: - static SCM automatic_shift (Grob *, Drul_array< Link_array >); + static SCM automatic_shift (Grob *, Drul_array >); static SCM forced_shift (Grob *); - static Drul_array< Link_array > get_clash_groups (Grob *me); + static Drul_array > get_clash_groups (Grob *me); DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis)); static void do_shifts (Grob *); static void add_column (Grob *me, Grob *ncol); diff --git a/lily/include/object-key-dumper.hh b/lily/include/object-key-dumper.hh index ad7507a04e..457b273c44 100644 --- a/lily/include/object-key-dumper.hh +++ b/lily/include/object-key-dumper.hh @@ -13,9 +13,9 @@ #include "object-key.hh" -typedef std::map < Object_key const *, Object_key const *, Object_key_less> Key_to_key_map; -typedef std::map < Object_key const *, int> Pointer_to_int_map; -typedef std::map < int, Object_key const *> Int_to_key_map; +typedef std::map Key_to_key_map; +typedef std::map Pointer_to_int_map; +typedef std::map Int_to_key_map; class Object_key_dumper { diff --git a/lily/include/object-key-undumper.hh b/lily/include/object-key-undumper.hh index e74976a898..02d98aab1a 100644 --- a/lily/include/object-key-undumper.hh +++ b/lily/include/object-key-undumper.hh @@ -12,7 +12,7 @@ #include #include "object-key.hh" -typedef std::map < int, Object_key const *> Int_to_key_map; +typedef std::map Int_to_key_map; struct Object_key_undumper { diff --git a/lily/include/object-key.hh b/lily/include/object-key.hh index d8ebf33eb6..d6420eb1ba 100644 --- a/lily/include/object-key.hh +++ b/lily/include/object-key.hh @@ -66,7 +66,7 @@ DECLARE_UNSMOB (Object_key, key); struct Object_key_less { - bool operator() (Object_key const *const &t1, Object_key const *const &t2) const + bool operator () (Object_key const *const &t1, Object_key const *const &t2) const { return t1->compare (t2); } diff --git a/lily/include/open-type-font.hh b/lily/include/open-type-font.hh index b58f6dcf89..eea6204527 100644 --- a/lily/include/open-type-font.hh +++ b/lily/include/open-type-font.hh @@ -13,7 +13,7 @@ #include "freetype.hh" #include "font-metric.hh" -typedef std::map < FT_UInt, FT_ULong> Index_to_charcode_map; +typedef std::map Index_to_charcode_map; Index_to_charcode_map make_index_to_charcode_map (FT_Face face); class Open_type_font : public Font_metric diff --git a/lily/include/performer-group-performer.hh b/lily/include/performer-group-performer.hh index f2e4d44922..52939cf9ea 100644 --- a/lily/include/performer-group-performer.hh +++ b/lily/include/performer-group-performer.hh @@ -11,7 +11,7 @@ #include "performer.hh" #include "translator-group.hh" -typedef void (Performer::*Performer_method) (void); +typedef void (Performer:: *Performer_method) (void); class Performer_group_performer : public Performer, public virtual Translator_group { diff --git a/lily/include/pitch.hh b/lily/include/pitch.hh index 6c36392a9d..f47d142bc0 100644 --- a/lily/include/pitch.hh +++ b/lily/include/pitch.hh @@ -82,7 +82,7 @@ DECLARE_UNSMOB (Pitch, pitch); INSTANTIATE_COMPARE (Pitch, Pitch::compare); -int compare (Array*, Array*); +int compare (Array *, Array *); extern SCM pitch_less_proc; Pitch pitch_interval (Pitch const &from, Pitch const &to); diff --git a/lily/include/property-iterator.hh b/lily/include/property-iterator.hh index 81c4804229..df24350c05 100644 --- a/lily/include/property-iterator.hh +++ b/lily/include/property-iterator.hh @@ -11,7 +11,6 @@ #include "simple-music-iterator.hh" - /** Iterate a property. */ @@ -26,7 +25,6 @@ protected: virtual void process (Moment); }; - /** Iterate a property. */ diff --git a/lily/include/protected-scm.hh b/lily/include/protected-scm.hh index 0bb88dd237..8b64ee009c 100644 --- a/lily/include/protected-scm.hh +++ b/lily/include/protected-scm.hh @@ -22,8 +22,8 @@ public: Protected_scm (SCM); Protected_scm (Protected_scm const &); ~Protected_scm (); - Protected_scm &operator= (SCM); - Protected_scm &operator= (Protected_scm const &); + Protected_scm &operator = (SCM); + Protected_scm &operator = (Protected_scm const &); operator SCM () const; SCM to_SCM () const; }; diff --git a/lily/include/rest-collision.hh b/lily/include/rest-collision.hh index a0897dff64..f37fc1e97f 100644 --- a/lily/include/rest-collision.hh +++ b/lily/include/rest-collision.hh @@ -12,7 +12,6 @@ #include "lily-proto.hh" #include "lily-guile.hh" - class Rest_collision { public: diff --git a/lily/include/rhythmic-head.hh b/lily/include/rhythmic-head.hh index 10b69b3ef9..2f46f76d04 100644 --- a/lily/include/rhythmic-head.hh +++ b/lily/include/rhythmic-head.hh @@ -22,7 +22,6 @@ public: static int dot_count (Grob *); DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM)); static bool has_interface (Grob *); - }; #endif // RHYTHMIC_HEAD_HH diff --git a/lily/include/scm-hash.hh b/lily/include/scm-hash.hh index 8dd635f67d..368e806936 100644 --- a/lily/include/scm-hash.hh +++ b/lily/include/scm-hash.hh @@ -45,7 +45,7 @@ public: SCM get (SCM k) const; void remove (SCM k); Scheme_hash_table (); - void operator= (Scheme_hash_table const &); + void operator = (Scheme_hash_table const &); Scheme_hash_table (Scheme_hash_table const &); SCM to_alist () const; diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh index 0bbb662566..5017d0ed61 100644 --- a/lily/include/script-column.hh +++ b/lily/include/script-column.hh @@ -18,7 +18,6 @@ public: static void add_staff_sided (Grob *, Item *); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM)); static bool has_interface (Grob *); - }; #endif /* Script_COLUMN_HH */ diff --git a/lily/include/sequential-iterator.hh b/lily/include/sequential-iterator.hh index b1e6d45c29..c3e5c277a7 100644 --- a/lily/include/sequential-iterator.hh +++ b/lily/include/sequential-iterator.hh @@ -47,7 +47,6 @@ private: Moment here_mom_; SCM cursor_; Grace_fixup *grace_fixups_; - }; #endif /* SEQUENTIAL_ITERATOR_HH */ diff --git a/lily/include/source-file.hh b/lily/include/source-file.hh index 759bb78425..faf8e5c66b 100644 --- a/lily/include/source-file.hh +++ b/lily/include/source-file.hh @@ -33,7 +33,7 @@ public: char const *to_str0 () const; virtual String error_string (char const *pos_str0) const; - std::istream * get_istream (); + std::istream *get_istream (); bool contains (char const *pos_str0) const; int length () const; virtual int get_line (char const *pos_str0) const; @@ -67,7 +67,7 @@ public: private: Link_array newline_locations_; - std::istream* istream_; + std::istream *istream_; char *contents_str0_; int length_; void load_stdin (); diff --git a/lily/include/staff-symbol.hh b/lily/include/staff-symbol.hh index 5e67b668b2..18d6f49680 100644 --- a/lily/include/staff-symbol.hh +++ b/lily/include/staff-symbol.hh @@ -26,6 +26,5 @@ public: static int line_count (Grob *); DECLARE_SCHEME_CALLBACK (print, (SCM)); static bool has_interface (Grob *); - }; #endif // STAFF_SYMBOL_HH diff --git a/lily/include/tfm-reader.hh b/lily/include/tfm-reader.hh index 4c826d162e..a42a5601e6 100644 --- a/lily/include/tfm-reader.hh +++ b/lily/include/tfm-reader.hh @@ -26,8 +26,8 @@ private: void read_char_metrics (); Tex_font_char_metric read_char_metric (Char_code code); Tex_font_char_metric read_char (); - void read_lig_kern_program (Array* ligatures, - Array* kerns); + void read_lig_kern_program (Array *ligatures, + Array *kerns); Binary_source_file input_; diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index e31766ad2e..ad4af88a55 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -12,7 +12,7 @@ #include "translator.hh" #include "parray.hh" -typedef void (Translator::*Translator_method) (void); +typedef void (Translator:: *Translator_method) (void); class Translator_group : public virtual Translator { diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 6173536b46..7d965e4b5a 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -90,7 +90,6 @@ protected: // should be private. } \ ADD_GLOBAL_CTOR (_ ## T ## _adder); - #define ADD_TRANSLATOR(classname, desc, grobs, accepted, acked, read, write) \ ADD_THIS_TRANSLATOR (classname); \ SCM \ diff --git a/lily/include/tweak-registration.hh b/lily/include/tweak-registration.hh index 77a154c695..ea52b1e41b 100644 --- a/lily/include/tweak-registration.hh +++ b/lily/include/tweak-registration.hh @@ -14,7 +14,7 @@ #include "lily-proto.hh" #include "object-key.hh" -typedef std::map < Object_key const *, SCM, Object_key_less> Tweak_map; +typedef std::map Tweak_map; class Tweak_registry { diff --git a/lily/include/type-swallow-translator.hh b/lily/include/type-swallow-translator.hh index 83b9506c2f..700bef1f56 100644 --- a/lily/include/type-swallow-translator.hh +++ b/lily/include/type-swallow-translator.hh @@ -28,7 +28,7 @@ public: { \ TRANSLATOR_DECLARATIONS (TYPE ## _swallow_translator); \ }; \ - TYPE ## _swallow_translator :: TYPE ## _swallow_translator () \ + TYPE ## _swallow_translator ::TYPE ## _swallow_translator () \ { \ swallow_string_ = #TYPE; \ } \ diff --git a/lily/input.cc b/lily/input.cc index f833937a18..a051da38c3 100644 --- a/lily/input.cc +++ b/lily/input.cc @@ -148,7 +148,6 @@ Input::line_number () const return source_file_->get_line (start_); else return 0; - } int @@ -158,7 +157,6 @@ Input::column_number () const return source_file_->get_column (start_); else return 0; - } int @@ -168,7 +166,6 @@ Input::end_line_number () const return source_file_->get_line (end_); else return 0; - } int @@ -178,5 +175,4 @@ Input::end_column_number () const return source_file_->get_column (end_); else return 0; - } diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index 1ae35630c6..2a20e73fce 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -73,7 +73,6 @@ Instrument_name_engraver::create_text () if (text_->get_property ("text") != txt) text_->set_property ("text", txt); - } void @@ -168,7 +167,6 @@ Vocal_name_engraver::create_text () if (text_->get_property ("text") != txt) text_->set_property ("text", txt); - } ADD_TRANSLATOR (Vocal_name_engraver, diff --git a/lily/item.cc b/lily/item.cc index e94b5bc267..369d4f5178 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -24,7 +24,7 @@ Item::clone (int count) const Item::Item (SCM s, Object_key const *key) : Grob (s, key) { - broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]= 0; + broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] = 0; Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("item-interface")); } @@ -78,6 +78,7 @@ Item::copy_breakable_items () new_copies[i] = item; } while (flip (&i) != LEFT); + broken_to_drul_ = new_copies; } diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 3f5d722c0b..8a178f02b0 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -73,7 +73,6 @@ Key_engraver::create_key (bool def) cancellation_->set_property ("old-accidentals", last); cancellation_->set_property ("c0-position", get_property ("middleCPosition")); - } item_->set_property ("new-accidentals", key); } @@ -178,7 +177,6 @@ Key_engraver::initialize () Pitch p (0, 0, 0); context ()->set_property ("tonic", p.smobbed_copy ()); - } ADD_TRANSLATOR (Key_engraver, diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index 9d776d9dce..375bac59b3 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -25,15 +25,14 @@ struct Key_signature_interface /* FIXME: too much hardcoding here. */ -const int FLAT_TOP_PITCH =2; /* fes, ges, as and bes typeset in lower octave */ -const int SHARP_TOP_PITCH =4; /* ais and bis typeset in lower octave */ +const int FLAT_TOP_PITCH = 2; /* fes, ges, as and bes typeset in lower octave */ +const int SHARP_TOP_PITCH = 4; /* ais and bis typeset in lower octave */ /* TODO: look this up. I'm not sure where the naturals ought to go. */ const int NATURAL_TOP_PITCH = 4; - /* FIXME: key-item should just get a list of (position, acc), and leave the thinking to other parties. @@ -56,8 +55,8 @@ alteration_pos (SCM what, int alter, int c0p) from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive. int c0 = from_bottom_pos - 4; - if ((alter <0 && ((p > FLAT_TOP_PITCH) || (p + c0 > 4)) && (p + c0 > 1)) - || (alter >0 && ((p > SHARP_TOP_PITCH) || (p + c0 > 5)) && (p + c0 > 2)) + if ((alter < 0 && ((p > FLAT_TOP_PITCH) || (p + c0 > 4)) && (p + c0 > 1)) + || (alter > 0 && ((p > SHARP_TOP_PITCH) || (p + c0 > 5)) && (p + c0 > 2)) || (alter == 0 && ((p > NATURAL_TOP_PITCH) || (p + c0 > 5)) && (p + c0 > 2))) { p -= 7; /* Typeset below c_position */ @@ -67,7 +66,7 @@ alteration_pos (SCM what, int alter, int c0p) it's a hack, but probably not worth the effort of finding a nicer solution. --dl. */ - if (c0 == 2 && alter >0 && p ==3) + if (c0 == 2 && alter > 0 && p == 3) p -= 7; if (c0==-3 && alter > 0 && p ==-1) p += 7; @@ -158,7 +157,7 @@ Key_signature_interface::print (SCM smob) int pos = alteration_pos (what, alteration, c0p); Stencil m = natural; - m.translate_axis (pos* inter, Y_AXIS); + m.translate_axis (pos * inter, Y_AXIS); /* The natural sign (unlike flat & sharp) @@ -167,7 +166,7 @@ Key_signature_interface::print (SCM smob) */ Real padding = 0.0; if (last_pos < pos + 2 - && last_pos> pos - 6) + && last_pos > pos - 6) padding = 0.3; mol.add_at_edge (X_AXIS, LEFT, m, padding, 0); diff --git a/lily/least-squares.cc b/lily/least-squares.cc index e7f6b30584..f6d70478ce 100644 --- a/lily/least-squares.cc +++ b/lily/least-squares.cc @@ -42,7 +42,7 @@ minimise_least_squares (Real *coef, Real *offset, } else { - *coef = (N *sxy - sx*sy) / den; + *coef = (N *sxy - sx * sy) / den; *offset = (sy - (*coef) * sx) / N; } } diff --git a/lily/ledger-line-spanner.cc b/lily/ledger-line-spanner.cc index ab591ac4c1..53da1d9463 100644 --- a/lily/ledger-line-spanner.cc +++ b/lily/ledger-line-spanner.cc @@ -48,8 +48,8 @@ Ledger_line_spanner::brew_ledger_lines (Grob *staff, { Real blotdiameter = ledgerlinethickness; Interval y_extent - = Interval (-0.5* (ledgerlinethickness), - +0.5* (ledgerlinethickness)); + = Interval (-0.5 * (ledgerlinethickness), + +0.5 * (ledgerlinethickness)); Stencil proto_ledger_line = Lookup::round_filled_box (Box (x_extent, y_extent), blotdiameter); @@ -76,7 +76,6 @@ Ledger_line_spanner::brew_ledger_lines (Grob *staff, return stencil; } - static void set_rods (Drul_array const ¤t_extents, Drul_array const &previous_extents, @@ -95,7 +94,7 @@ set_rods (Drul_array const ¤t_extents, Rod rod; rod.distance_ = total_head_length - * (3/2 * min_length_fraction) + * (3 / 2 * min_length_fraction) /* we go from right to left. */ @@ -106,12 +105,10 @@ set_rods (Drul_array const ¤t_extents, rod.item_drul_[RIGHT] = previous_column; rod.add_to_cols (); } - } while (flip (&d) != DOWN); } - MAKE_SCHEME_CALLBACK (Ledger_line_spanner, set_spacing_rods, 1); SCM Ledger_line_spanner::set_spacing_rods (SCM smob) @@ -125,11 +122,9 @@ Ledger_line_spanner::set_spacing_rods (SCM smob) SCM heads = me->get_property ("note-heads"); - Real min_length_fraction = robust_scm2double (me->get_property ("minimum-length-fraction"), 0.15); - Drul_array current_extents; Drul_array previous_extents; Item *previous_column = 0; @@ -143,27 +138,26 @@ Ledger_line_spanner::set_spacing_rods (SCM smob) for (SCM hp = heads; scm_is_pair (hp); hp = scm_cdr (hp)) { Item *h = dynamic_cast (unsmob_grob (scm_car (hp))); - + int pos = Staff_symbol_referencer::get_rounded_position (h); if (abs (pos) <= interspaces) continue; - + Item *column = h->get_column (); if (current_column != column) { set_rods (current_extents, previous_extents, current_column, previous_column, min_length_fraction); - + previous_column = current_column; current_column = column; previous_extents = current_extents; - - current_extents[DOWN].set_empty(); - current_extents[UP].set_empty(); + + current_extents[DOWN].set_empty (); + current_extents[UP].set_empty (); } - - + Interval head_extent = h->extent (column, X_AXIS); Direction vdir = Direction (sign (pos)); if (!vdir) @@ -177,8 +171,6 @@ Ledger_line_spanner::set_spacing_rods (SCM smob) current_column, previous_column, min_length_fraction); - - return SCM_UNSPECIFIED; } @@ -201,7 +193,6 @@ typedef std::map < int, Drul_array > Ledger_requests; /* TODO: ledger share a lot of info. Lots of room to optimize away common use of objects/variables. - */ MAKE_SCHEME_CALLBACK (Ledger_line_spanner, print, 1); SCM @@ -255,7 +246,7 @@ Ledger_line_spanner::print (SCM smob) reqs[rank][vdir].ledger_extent_.unite (ledger_extent); reqs[rank][vdir].head_extent_.unite (head_extent); reqs[rank][vdir].position_ - = vdir * ((vdir* reqs[rank][vdir].position_) >? (vdir *pos)); + = vdir * ((vdir * reqs[rank][vdir].position_) >? (vdir * pos)); } } @@ -283,14 +274,14 @@ Ledger_line_spanner::print (SCM smob) Direction which = LEFT; do { - Ledger_request &lr = ((which == LEFT) ? *last : *i).second[d]; + Ledger_request &lr = ((which == LEFT) ? * last : *i).second[d]; // due tilt of quarter note-heads bool both = (abs (last->second[d].position_) > interspaces + 1 && abs (i->second[d].position_) > interspaces + 1); - Real limit = (center + (both? which * gap / 2 : 0)); + Real limit = (center + (both ? which * gap / 2 : 0)); lr.ledger_extent_.elem_ref (-which) = which * (which * lr.ledger_extent_[-which] >? which * limit); } @@ -313,7 +304,7 @@ Ledger_line_spanner::print (SCM smob) { Interval head_size = h->extent (common[X_AXIS], X_AXIS); Interval ledger_size = head_size; - ledger_size.widen (ledger_size.length ()* length_fraction); + ledger_size.widen (ledger_size.length () * length_fraction); Interval max_size = reqs[Paper_column::get_rank (h->get_column ())][Direction (sign (pos))].ledger_extent_; @@ -333,7 +324,6 @@ Ledger_line_spanner::print (SCM smob) TODO: shorten 2 ledger lines for the case natural + downstem. */ - } ledgers.add_stencil (brew_ledger_lines (staff, pos, interspaces, diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 0547aef254..55f5de5a23 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -229,7 +229,7 @@ is_direction (SCM s) if (scm_is_number (s)) { int i = scm_to_int (s); - return i>= -1 && i <= 1; + return i >= -1 && i <= 1; } return false; } @@ -595,7 +595,6 @@ ly_split_list (SCM s, SCM list) before = scm_cons (i, before); } return scm_cons (scm_reverse_x (before, SCM_EOL), after); - } void @@ -659,8 +658,8 @@ Interval robust_scm2interval (SCM k, Drul_array v) { Interval i; - i[LEFT]= v[LEFT]; - i[RIGHT]= v[RIGHT]; + i[LEFT] = v[LEFT]; + i[RIGHT] = v[RIGHT]; if (is_number_pair (k)) i = ly_scm2interval (k); return i; diff --git a/lily/lilypond-key.cc b/lily/lilypond-key.cc index af4a521880..6d96a33add 100644 --- a/lily/lilypond-key.cc +++ b/lily/lilypond-key.cc @@ -29,7 +29,7 @@ Lilypond_grob_key::derived_mark () const int Lilypond_grob_key::do_compare (Object_key const *key) const { - Lilypond_grob_key const *other = dynamic_cast < Lilypond_grob_key const *> (key); + Lilypond_grob_key const *other = dynamic_cast (key); int c; c = context_->compare (other->context_); @@ -101,7 +101,7 @@ int Lilypond_context_key::do_compare (Object_key const *key) const { Lilypond_context_key const *other - = dynamic_cast < Lilypond_context_key const *> (key); + = dynamic_cast (key); int c; if (parent_context_ && other->parent_context_) @@ -188,7 +188,7 @@ int Lilypond_general_key::do_compare (Object_key const *key)const { Lilypond_general_key const *other - = dynamic_cast < Lilypond_general_key const *> (key); + = dynamic_cast (key); if (parent_ && other->parent_) parent_->compare (other->parent_); diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index c7b2677f5d..3aaf75f288 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -34,9 +34,9 @@ zigzag_stencil (Grob *me, Real staff_space = Staff_symbol_referencer::staff_space (me); - double w = robust_scm2double (me->get_property ("zigzag-width"), 1)*staff_space; - double l = robust_scm2double (me->get_property ("zigzag-length"), 1)* w; - double h = l > w / 2 ? sqrt (l*l - w*w / 4) : 0; + double w = robust_scm2double (me->get_property ("zigzag-width"), 1) * staff_space; + double l = robust_scm2double (me->get_property ("zigzag-length"), 1) * w; + double h = l > w / 2 ? sqrt (l * l - w * w / 4) : 0; SCM list = scm_list_n (ly_symbol2scm ("zigzag-line"), ly_bool2scm (true), @@ -84,7 +84,6 @@ Line_spanner::after_line_breaking (SCM g) Can't do suicide, since this mucks up finding the trend. */ me->set_property ("print-function", SCM_EOL); - } return SCM_EOL; } @@ -125,7 +124,8 @@ Line_spanner::line_stencil (Grob *me, mol.add_at_edge (X_AXIS, RIGHT, m, 0, 0); while (m.extent (X_AXIS).length () && mol.extent (X_AXIS).length () - + m.extent (X_AXIS).length () < dz[X_AXIS]); + + m.extent (X_AXIS).length () < dz[X_AXIS]) + ; /* FIXME: should center element on x/y @@ -237,8 +237,8 @@ Line_spanner::print (SCM smob) Offset dz (p2 -p1); Real len = dz.length (); - Offset dir = dz * (1/ len); - dz = (dz.length () - 2*gap) *dir; + Offset dir = dz * (1 / len); + dz = (dz.length () - 2 * gap) * dir; Stencil l (line_stencil (me, Offset (0, 0), dz)); @@ -258,7 +258,7 @@ Line_spanner::print (SCM smob) } // distance from center to start of line - Real off = gap + ((bound[LEFT]->extent (bound[LEFT], X_AXIS).length ()*3) / 4); + Real off = gap + ((bound[LEFT]->extent (bound[LEFT], X_AXIS).length () * 3) / 4); for (int a = X_AXIS; a < NO_AXES; a++) { @@ -269,7 +269,6 @@ Line_spanner::print (SCM smob) my_off[ax] = me->relative_coordinate (common[a], ax); his_off[ax] = bound[LEFT]->relative_coordinate (common[a], ax); - } ofxy = dxy * (off / dxy.length ()); diff --git a/lily/lookup.cc b/lily/lookup.cc index df15d3d1ed..56b0985421 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -358,15 +358,15 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick) SCM scontrols[8]; - for (int i =4; i--;) + for (int i = 4; i--;) scontrols[ i ] = ly_offset2scm (back.control_[i]); - for (int i =4; i--;) + for (int i = 4; i--;) scontrols[i + 4] = ly_offset2scm (curve.control_[i]); /* Need the weird order b.o. the way PS want its arguments */ - int indices[]= {5, 6, 7, 4, 1, 2, 3, 0}; + int indices[] = {5, 6, 7, 4, 1, 2, 3, 0}; SCM list = SCM_EOL; for (int i = 8; i--;) { diff --git a/lily/ly-module.cc b/lily/ly-module.cc index e3b876967f..fb4d3abd16 100644 --- a/lily/ly-module.cc +++ b/lily/ly-module.cc @@ -75,7 +75,7 @@ LY_DEFINE (ly_module_copy, "ly:module-copy", "Copy all bindings from module SRC into DEST.") { SCM_VALIDATE_MODULE (1, src); - scm_internal_hash_fold ((Hash_cl_func) &module_define_closure_func, + scm_internal_hash_fold ((Hash_cl_func) & module_define_closure_func, (void *) dest, SCM_EOL, SCM_MODULE_OBARRAY (src)); return SCM_UNSPECIFIED; @@ -95,7 +95,7 @@ ly_module_symbols (SCM mod) SCM_VALIDATE_MODULE (1, mod); SCM obarr = SCM_MODULE_OBARRAY (mod); - return scm_internal_hash_fold ((Hash_cl_func) &accumulate_symbol, + return scm_internal_hash_fold ((Hash_cl_func) & accumulate_symbol, NULL, SCM_EOL, obarr); } @@ -121,7 +121,7 @@ LY_DEFINE (ly_module2alist, "ly:module->alist", SCM_VALIDATE_MODULE (1, mod); SCM obarr = SCM_MODULE_OBARRAY (mod); - return scm_internal_hash_fold ((Hash_cl_func) &entry_to_alist, NULL, SCM_EOL, obarr); + return scm_internal_hash_fold ((Hash_cl_func) & entry_to_alist, NULL, SCM_EOL, obarr); } /* Lookup SYM, but don't give error when it is not defined. */ diff --git a/lily/lyric-combine-music-iterator.cc b/lily/lyric-combine-music-iterator.cc index 09fe51c293..84abe734ef 100644 --- a/lily/lyric-combine-music-iterator.cc +++ b/lily/lyric-combine-music-iterator.cc @@ -147,7 +147,7 @@ Lyric_combine_music_iterator::get_busy_status () const for (; scm_is_pair (grobs); grobs = scm_cdr (grobs)) { SCM grob = scm_cdar (grobs); - Moment end =*unsmob_moment (scm_caar (grobs)); + Moment end = *unsmob_moment (scm_caar (grobs)); /* This is slightly ugh: we are now confunding the frontend diff --git a/lily/lyric-hyphen.cc b/lily/lyric-hyphen.cc index 10e9c64580..95e8fd881f 100644 --- a/lily/lyric-hyphen.cc +++ b/lily/lyric-hyphen.cc @@ -16,7 +16,7 @@ #include "moment.hh" MAKE_SCHEME_CALLBACK (Hyphen_spanner, print, 1) -SCM + SCM Hyphen_spanner::print (SCM smob) { Spanner *me = unsmob_spanner (smob); @@ -35,7 +35,7 @@ Hyphen_spanner::print (SCM smob) do { Interval iv = bounds[d]->extent (common, X_AXIS); - + span_points[d] = iv.is_empty () ? bounds[d]->relative_coordinate (common, X_AXIS) : iv[-d]; @@ -51,24 +51,23 @@ Hyphen_spanner::print (SCM smob) Real dash_period = robust_scm2double (me->get_property ("dash-period"), 1.0); Real dash_length = robust_scm2double (me->get_property ("length"), .5); Real padding = robust_scm2double (me->get_property ("padding"), 0.1); - + if (dash_period < dash_length) dash_period = 1.5 * dash_length; - Real l = span_points.length (); int n = int (ceil (l / dash_period - 0.5)); if (n <= 0) n = 1; - if (l < dash_length + 2*padding + if (l < dash_length + 2 * padding && !bounds[RIGHT]->break_status_dir ()) { Real minimum_length = robust_scm2double (me->get_property ("minimum-length"), .3); - dash_length = (l - 2*padding) >? minimum_length; + dash_length = (l - 2 * padding) >? minimum_length; } - + Real space_left = l - dash_length - (n - 1) * dash_period; /* @@ -124,7 +123,7 @@ Hyphen_spanner::set_spacing_rods (SCM smob) && r.item_drul_[RIGHT]) r.add_to_cols (); } - + return SCM_UNSPECIFIED; } diff --git a/lily/lyric-performer.cc b/lily/lyric-performer.cc index 7c2aa33c9b..f9faa72693 100644 --- a/lily/lyric-performer.cc +++ b/lily/lyric-performer.cc @@ -24,7 +24,6 @@ private: Audio_text *audio_; }; - Lyric_performer::Lyric_performer () { audio_ = 0; diff --git a/lily/main.cc b/lily/main.cc index a5a3d3afc9..351adc8ed3 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -278,7 +278,7 @@ do_chroot_jail () errno = 0; int uid; - if (passwd *passwd = getpwnam (components[USER_NAME].to_str0 ())) + if (passwd * passwd = getpwnam (components[USER_NAME].to_str0 ())) uid = passwd->pw_uid; else { @@ -295,7 +295,7 @@ do_chroot_jail () errno = 0; int gid; - if (group *group = getgrnam (components[GROUP_NAME].to_str0 ())) + if (group * group = getgrnam (components[GROUP_NAME].to_str0 ())) gid = group->gr_gid; else { diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index cc62a17d7f..07cbd59aa2 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -36,7 +36,6 @@ private: Music *mark_ev_; }; - Mark_engraver::Mark_engraver () { text_ = 0; diff --git a/lily/melisma-translator.cc b/lily/melisma-translator.cc index 9afeeabf8d..3c24d3c771 100644 --- a/lily/melisma-translator.cc +++ b/lily/melisma-translator.cc @@ -52,7 +52,6 @@ Melisma_translator::process_music () else context ()->unset_property (ly_symbol2scm ("melismaBusy")); } - } void diff --git a/lily/mensural-ligature.cc b/lily/mensural-ligature.cc index 0975ad7358..3b73a54a91 100644 --- a/lily/mensural-ligature.cc +++ b/lily/mensural-ligature.cc @@ -38,8 +38,8 @@ brew_flexa (Grob *me, // Compensate optical illusion regarding vertical position of left // and right endings due to slope. - Real ypos_correction = -0.1*staff_space * sign (slope); - Real slope_correction = 0.2*staff_space * sign (slope); + Real ypos_correction = -0.1 * staff_space * sign (slope); + Real slope_correction = 0.2 * staff_space * sign (slope); Real corrected_slope = slope + slope_correction / width; if (solid) // this will come handy for colorated flexae @@ -62,12 +62,12 @@ brew_flexa (Grob *me, Stencil bottom_edge = Lookup::beam (corrected_slope, width, thickness, 0.0); - bottom_edge.translate_axis (-0.5*height, Y_AXIS); + bottom_edge.translate_axis (-0.5 * height, Y_AXIS); stencil.add_stencil (bottom_edge); Stencil top_edge = Lookup::beam (corrected_slope, width, thickness, 0.0); - top_edge.translate_axis (+0.5*height, Y_AXIS); + top_edge.translate_axis (+0.5 * height, Y_AXIS); stencil.add_stencil (top_edge); } stencil.translate_axis (ypos_correction, Y_AXIS); @@ -189,7 +189,7 @@ internal_brew_primitive (Grob *me) if (primitive & MLP_FLEXA) { pos += delta_pitch; - add_ledger_lines (me, &out, pos, 0.5*delta_pitch, ledger_take_space); + add_ledger_lines (me, &out, pos, 0.5 * delta_pitch, ledger_take_space); } #endif diff --git a/lily/metronome-engraver.cc b/lily/metronome-engraver.cc index b59d3c962f..897bb909fd 100644 --- a/lily/metronome-engraver.cc +++ b/lily/metronome-engraver.cc @@ -61,7 +61,6 @@ Metronome_mark_engraver::create_items (Music *rq) return; text_ = make_item ("MetronomeMark", rq->self_scm ()); - } bool diff --git a/lily/midi-item.cc b/lily/midi-item.cc index 564b5057c0..4526cc1dfb 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -101,7 +101,7 @@ String Midi_event::to_string () const { Rational rat_dt = (delta_mom_.main_part_ * Rational (384) - + delta_mom_.grace_part_ * Rational (100))*Rational (4); + + delta_mom_.grace_part_ * Rational (100)) * Rational (4); int delta_i = int (rat_dt); String delta_string = Midi_item::i2varint_string (delta_i); @@ -149,7 +149,7 @@ Midi_instrument::to_string () const else warning (_f ("no such MIDI instrument: `%s'", audio_->str_.to_str0 ())); - String str = ::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME: Should be track. -rz + String str = ::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME : Should be track. -rz str += ::to_string ((char)program_byte); return str; } @@ -340,7 +340,7 @@ Midi_dynamic::to_string () const */ static Real const full_scale = 127; - int volume = (int) (audio_->volume_*full_scale); + int volume = (int) (audio_->volume_ * full_scale); if (volume <= 0) volume = 1; if (volume > full_scale) diff --git a/lily/midi-stream.cc b/lily/midi-stream.cc index aa1619e2c4..0112fdb73f 100644 --- a/lily/midi-stream.cc +++ b/lily/midi-stream.cc @@ -28,7 +28,7 @@ Midi_stream::~Midi_stream () } Midi_stream & -Midi_stream::operator<< (String str) +Midi_stream::operator << (String str) { size_t sz = sizeof (Byte); size_t n = str.length (); @@ -42,7 +42,7 @@ Midi_stream::operator<< (String str) } Midi_stream & -Midi_stream::operator<< (Midi_item const &midi_c_r) +Midi_stream::operator << (Midi_item const &midi_c_r) { String str = midi_c_r.to_string (); diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc index 1223133d13..57e5ac4993 100644 --- a/lily/midi-walker.cc +++ b/lily/midi-walker.cc @@ -161,11 +161,11 @@ Midi_walker::process () bool Midi_walker::ok () const { - return index_ size (); + return index_ < items_->size (); } void -Midi_walker::operator++ (int) +Midi_walker::operator ++ (int) { assert (ok ()); index_++; diff --git a/lily/misc.cc b/lily/misc.cc index 0d1144ec13..bb8a05201c 100644 --- a/lily/misc.cc +++ b/lily/misc.cc @@ -33,7 +33,7 @@ intlog2 (int d) double log_2 (double x) { - return log (x) /log (2.0); + return log (x) / log (2.0); } Array diff --git a/lily/moment-scheme.cc b/lily/moment-scheme.cc index 865431c6da..0450259135 100644 --- a/lily/moment-scheme.cc +++ b/lily/moment-scheme.cc @@ -61,7 +61,7 @@ LY_DEFINE (ly_mul_moment, "ly:mul-moment", Moment *mb = unsmob_moment (b); SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment"); SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment"); - return (*ma * *mb).smobbed_copy (); + return (*ma * * mb).smobbed_copy (); } LY_DEFINE (ly_div_moment, "ly:div-moment", @@ -72,7 +72,7 @@ LY_DEFINE (ly_div_moment, "ly:div-moment", Moment *mb = unsmob_moment (b); SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment"); SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment"); - return (*ma / *mb).smobbed_copy (); + return (*ma / * mb).smobbed_copy (); } LY_DEFINE (ly_moment_main_numerator, "ly:moment-main-numerator", diff --git a/lily/moment.cc b/lily/moment.cc index c892d5f459..a50ce3cbd1 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -91,13 +91,13 @@ Moment::compare (Moment const &a, Moment const &b) } void -Moment::operator+= (Moment const &src) +Moment::operator += (Moment const &src) { main_part_ += src.main_part_; grace_part_ += src.grace_part_; } void -Moment::operator-= (Moment const &src) +Moment::operator -= (Moment const &src) { main_part_ -= src.main_part_; grace_part_ -= src.grace_part_; @@ -107,7 +107,7 @@ Moment::operator-= (Moment const &src) only take the main part of SRC for multiplication. */ void -Moment::operator*= (Moment const &src) +Moment::operator *= (Moment const &src) { main_part_ *= src.main_part_; grace_part_ *= src.main_part_; @@ -117,7 +117,7 @@ Moment::operator*= (Moment const &src) only take the main part of SRC for multiplication. */ void -Moment::operator/= (Moment const &src) +Moment::operator /= (Moment const &src) { main_part_ /= src.main_part_; grace_part_ /= src.main_part_; @@ -159,17 +159,17 @@ Moment::to_string () const } Moment -Moment::operator- () const +Moment::operator - () const { Moment m; m.grace_part_ = -grace_part_; - m. main_part_ = -main_part_; + m.main_part_ = -main_part_; return m; } #ifdef STREAM_SUPPORT std::ostream & -operator<< (std::ostream &os, Moment const &m) +operator << (std::ostream &os, Moment const &m) { os << m.to_string (); return os; diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index a078e4db1e..837b52e201 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -107,7 +107,7 @@ Multi_measure_rest_engraver::process_music () do { Grob *last = 0; - for (int i = 0; i get_property ("direction")) { @@ -118,7 +118,6 @@ Multi_measure_rest_engraver::process_music () } } while (flip (&d) != DOWN); - } for (int i = 0; i < numbers_.size (); i++) diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 1cc6d2b031..a1eb2dbfbf 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -55,7 +55,7 @@ Multi_measure_rest::percent (SCM smob) /* center between stuff. */ - x_off += sp_iv.length ()/ 2; + x_off += sp_iv.length () / 2; r.translate_axis (x_off, X_AXIS); @@ -124,7 +124,7 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space) if (measures > scm_to_int (limit)) { Real padding = 0.15; - Stencil s = big_rest (me, (1.0 - 2*padding) * space); + Stencil s = big_rest (me, (1.0 - 2 * padding) * space); s.translate_axis (padding * space, X_AXIS); return s; } @@ -185,7 +185,7 @@ Multi_measure_rest::big_rest (Grob *me, Real width) Real blot = width ? (.8 * (y = 2) + else if (l >= 2) { l -= 2; k = -1; diff --git a/lily/music-constructor.cc b/lily/music-constructor.cc index c576580048..481b9ebc90 100644 --- a/lily/music-constructor.cc +++ b/lily/music-constructor.cc @@ -13,13 +13,13 @@ #include "warn.hh" -static std::map < String, Music_ctor> *ctors_map_; +static std::map *ctors_map_; void add_music_ctor (String s, Music_ctor c) { if (!ctors_map_) - ctors_map_ = new std::map < String, Music_ctor>; + ctors_map_ = new std::map; (*ctors_map_)[s] = c; } diff --git a/lily/music-scheme.cc b/lily/music-scheme.cc index a666c87aec..b67c0c775d 100644 --- a/lily/music-scheme.cc +++ b/lily/music-scheme.cc @@ -170,7 +170,6 @@ LY_DEFINE (ly_music_duration_length, "ly:music-duration-length", 1, 0, 0, else programming_error ("Music has no duration"); return l.smobbed_copy (); - } LY_DEFINE (ly_music_duration_compress, "ly:music-duration-compress", 2, 0, 0, diff --git a/lily/music-wrapper-iterator.cc b/lily/music-wrapper-iterator.cc index ed29db0fb0..560d8aba3f 100644 --- a/lily/music-wrapper-iterator.cc +++ b/lily/music-wrapper-iterator.cc @@ -38,7 +38,7 @@ Music_wrapper_iterator::derived_substitute (Context *f, Context *t) void Music_wrapper_iterator::construct_children () { - Music *m = dynamic_cast < Music_wrapper const *> (get_music ())-> element (); + Music *m = dynamic_cast (get_music ())->element (); child_iter_ = unsmob_iterator (get_iterator (m)); } diff --git a/lily/music.cc b/lily/music.cc index 3317ba3c76..12066fe04a 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -215,7 +215,7 @@ Music::compress (Moment factor) compress_music_list (get_property ("elements"), factor); Duration *d = unsmob_duration (get_property ("duration")); if (d) - set_property ("duration", d ->compressed (factor.main_part_).smobbed_copy ()); + set_property ("duration", d->compressed (factor.main_part_).smobbed_copy ()); } void @@ -257,7 +257,6 @@ Music::transpose (Pitch delta) { set_property ("pitch-alist", ly_transpose_key_alist (pa, delta.smobbed_copy ())); } - } IMPLEMENT_TYPE_P (Music, "ly:music?"); @@ -295,7 +294,7 @@ Input * Music::origin () const { Input *ip = unsmob_input (get_property ("origin")); - return ip ? ip : & dummy_input_global; + return ip ? ip : &dummy_input_global; } int diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc index 38f4b1d579..2a6930bec3 100644 --- a/lily/new-fingering-engraver.cc +++ b/lily/new-fingering-engraver.cc @@ -35,7 +35,6 @@ struct Finger_tuple { return c1.position_- c2.position_; } - }; class New_fingering_engraver : public Engraver @@ -174,7 +173,7 @@ New_fingering_engraver::position_scripts () */ for (int i = 0; i < fingerings_.size (); i++) { - fingerings_[i].position_ = scm_to_int (fingerings_[i].head_ -> get_property ("staff-position")); + fingerings_[i].position_ = scm_to_int (fingerings_[i].head_->get_property ("staff-position")); } for (int i = fingerings_.size (); i--;) @@ -222,7 +221,7 @@ New_fingering_engraver::position_scripts () else if (up_p) { up.concat (fingerings_); - fingerings_ .clear (); + fingerings_.clear (); } else { @@ -258,7 +257,6 @@ New_fingering_engraver::position_scripts () f->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, X_AXIS); f->set_property ("direction", scm_int2num (UP)); - } for (int i = 0; i < down.size (); i++) diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 0eece029ae..005a8f03a0 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -42,9 +42,9 @@ Note_collision_interface::force_shift_callback (SCM element_smob, SCM axis) void check_meshing_chords (Grob *me, - Drul_array< Array > *offsets, - Drul_array< Array > const &extents, - Drul_array < Link_array > const &clash_groups) + Drul_array > *offsets, + Drul_array > const &extents, + Drul_array > const &clash_groups) { if (!extents[UP].size () || ! extents[DOWN].size ()) @@ -147,11 +147,11 @@ check_meshing_chords (Grob *me, else distant_half_collide = true; } - else if (ups[i]== dps[j]) + else if (ups[i] == dps[j]) full_collide = true; - else if (ups[i] >dps[0] && ups[i] < dps.top ()) + else if (ups[i] > dps[0] && ups[i] < dps.top ()) merge_possible = false; - else if (dps[j] >ups[0] && dps[j] < ups.top ()) + else if (dps[j] > ups[0] && dps[j] < ups.top ()) merge_possible = false; if (ups[i] < dps[j]) @@ -284,13 +284,13 @@ check_meshing_chords (Grob *me, for (int i = 0; i < clash_groups[d].size (); i++) (*offsets)[d][i] += d * shift_amount; } - while ((flip (&d))!= UP); + while ((flip (&d)) != UP); } void Note_collision_interface::do_shifts (Grob *me) { - Drul_array< Link_array > cg = get_clash_groups (me); + Drul_array > cg = get_clash_groups (me); SCM autos (automatic_shift (me, cg)); SCM hand (forced_shift (me)); @@ -320,12 +320,11 @@ Note_collision_interface::do_shifts (Grob *me) amounts.push (amount); if (amount < left_most) left_most = amount; - } for (; scm_is_pair (autos); autos = scm_cdr (autos)) { Grob *s = unsmob_grob (scm_caar (autos)); - Real amount = scm_to_double (scm_cdar (autos)) *wid; + Real amount = scm_to_double (scm_cdar (autos)) * wid; if (!done.find (s)) { @@ -342,10 +341,10 @@ Note_collision_interface::do_shifts (Grob *me) } } -Drul_array< Link_array +Drul_array < Link_array > Note_collision_interface::get_clash_groups (Grob *me) { - Drul_array < Link_array > clash_groups; + Drul_array > clash_groups; SCM s = me->get_property ("elements"); for (; scm_is_pair (s); s = scm_cdr (s)) @@ -360,10 +359,10 @@ Drul_array< Link_array Direction d = UP; do { - Link_array & clashes (clash_groups[d]); + Link_array &clashes (clash_groups[d]); clashes.sort (Note_column::shift_compare); } - while ((flip (&d))!= UP); + while ((flip (&d)) != UP); return clash_groups; } @@ -375,7 +374,7 @@ Drul_array< Link_array */ SCM Note_collision_interface::automatic_shift (Grob *me, - Drul_array< Link_array + Drul_array < Link_array > clash_groups) { Drul_array < Array > shifts; @@ -384,8 +383,8 @@ Note_collision_interface::automatic_shift (Grob *me, Direction d = UP; do { - Array & shift (shifts[d]); - Link_array & clashes (clash_groups[d]); + Array &shift (shifts[d]); + Link_array &clashes (clash_groups[d]); for (int i = 0; i < clashes.size (); i++) { @@ -398,7 +397,7 @@ Note_collision_interface::automatic_shift (Grob *me, shift.push (0); } - for (int i =1; i < shift.size (); i++) + for (int i = 1; i < shift.size (); i++) { if (shift[i - 1] == shift[i]) { @@ -407,10 +406,10 @@ Note_collision_interface::automatic_shift (Grob *me, } } } - while ((flip (&d))!= UP); + while ((flip (&d)) != UP); - Drul_array< Array > extents; - Drul_array< Array > offsets; + Drul_array > extents; + Drul_array > offsets; d = UP; do { @@ -423,7 +422,7 @@ Note_collision_interface::automatic_shift (Grob *me, offsets[d].push (d * 0.5 * i); } } - while ((flip (&d))!= UP); + while ((flip (&d)) != UP); /* do horizontal shifts of each direction @@ -436,17 +435,17 @@ Note_collision_interface::automatic_shift (Grob *me, do { - for (int i =1; i < clash_groups[d].size (); i++) + for (int i = 1; i < clash_groups[d].size (); i++) { Slice prev = extents[d][i - 1]; prev.intersect (extents[d][i]); - if (prev.length ()> 0 + if (prev.length () > 0 || (extents[-d].size () && d * (extents[d][i][-d] - extents[-d][0][d]) < 0)) for (int j = i; j < clash_groups[d].size (); j++) offsets[d][j] += d * 0.5; } } - while ((flip (&d))!= UP); + while ((flip (&d)) != UP); /* Check if chords are meshing @@ -462,6 +461,7 @@ Note_collision_interface::automatic_shift (Grob *me, tups); } while (flip (&d) != UP); + return tups; } diff --git a/lily/note-column.cc b/lily/note-column.cc index fa8e70768f..8258e9eecc 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -36,8 +36,8 @@ Note_column::shift_compare (Grob *const &p1, Grob *const &p2) SCM s1 = p1->get_property ("horizontal-shift"); SCM s2 = p2->get_property ("horizontal-shift"); - int h1 = (scm_is_number (s1))? scm_to_int (s1) :0; - int h2 = (scm_is_number (s2)) ? scm_to_int (s2):0; + int h1 = (scm_is_number (s1)) ? scm_to_int (s1) : 0; + int h2 = (scm_is_number (s2)) ? scm_to_int (s2) : 0; return h1 - h2; } @@ -139,12 +139,11 @@ Note_column::set_dotcol (Grob *me, Grob *d) Axis_group_interface::add_element (me, d); } - Grob * Note_column::first_head (Grob *me) { Grob *st = get_stem (me); - return st? Stem::first_head (st): 0; + return st ? Stem::first_head (st) : 0; } /* diff --git a/lily/note-head-line-engraver.cc b/lily/note-head-line-engraver.cc index cc9decc52a..12fd61e212 100644 --- a/lily/note-head-line-engraver.cc +++ b/lily/note-head-line-engraver.cc @@ -99,7 +99,6 @@ Note_head_line_engraver::stop_translation_timestep () head_ = 0; } - ADD_TRANSLATOR (Note_head_line_engraver, /* descr */ "Engrave a line between two note heads, for example a glissando. If " " followVoice is set, staff switches also generate a line.", diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index b4d85287d2..5b8bc0ed38 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -43,8 +43,7 @@ Note_spacing::get_spacing (Grob *me, Item *right_col, if (d == RIGHT && it->break_status_dir () != col_dir) { - it = it -> find_prebroken_piece (col_dir); - + it = it->find_prebroken_piece (col_dir); } /* some kind of mismatch, eg. a note column, that is behind a @@ -110,10 +109,10 @@ Note_spacing::get_spacing (Grob *me, Item *right_col, FIXED also includes the left part of the right object. */ *fixed - = (left_head_wid.is_empty () ? increment : - /* - Size of the head: - */ + = (left_head_wid.is_empty () ? increment + : /* + Size of the head: + */ (left_head_wid[RIGHT]+ /* @@ -339,7 +338,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, stem_posns[RIGHT] = bar_yextent; } - if (correct_stem_dirs && stem_dirs[LEFT] *stem_dirs[RIGHT] == -1) + if (correct_stem_dirs && stem_dirs[LEFT] * stem_dirs[RIGHT] == -1) { if (beams_drul[LEFT] && beams_drul[LEFT] == beams_drul[RIGHT]) { @@ -367,7 +366,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, } } - correction = note_head_width* stem_dirs[LEFT]; + correction = note_head_width * stem_dirs[LEFT]; correction *= robust_scm2double (me->get_property ("knee-spacing-correction"), 0); *fixed += correction; } @@ -396,7 +395,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, } } } - else if (correct_stem_dirs && stem_dirs[LEFT] *stem_dirs[RIGHT] == UP) + else if (correct_stem_dirs && stem_dirs[LEFT] * stem_dirs[RIGHT] == UP) { /* Correct for the following situation: @@ -437,10 +436,8 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, /* there used to be a correction for bar_xextent () here, but it's unclear what that was good for ? */ - } - ADD_INTERFACE (Note_spacing, "note-spacing-interface", "This object calculates spacing wishes for individual voices.", "left-items right-items stem-spacing-correction knee-spacing-correction"); diff --git a/lily/object-key-undumper.cc b/lily/object-key-undumper.cc index f904646b38..59bcaa65b6 100644 --- a/lily/object-key-undumper.cc +++ b/lily/object-key-undumper.cc @@ -74,7 +74,6 @@ Object_key_undumper::parse_contents (SCM contents) keys_[number] = k; scm_gc_unprotect_object (k->self_scm ()); } - } Object_key const * diff --git a/lily/object-key.cc b/lily/object-key.cc index 134ff7fb23..1a350268f5 100644 --- a/lily/object-key.cc +++ b/lily/object-key.cc @@ -20,7 +20,6 @@ Object_key::mark_smob (SCM key) void Object_key::derived_mark () const { - } Object_key::~Object_key () @@ -138,7 +137,7 @@ Copied_key::get_type () const int Copied_key::do_compare (Object_key const *key) const { - Copied_key const *other = dynamic_cast < Copied_key const *> (key); + Copied_key const *other = dynamic_cast (key); int c = original_->compare (other->original_); if (c) diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index 386a618a9c..b23f947602 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -137,7 +137,7 @@ Open_type_font::get_indexed_char (int signed_idx) const { if (SCM_HASHTABLE_P (lily_character_table_)) { - const int len =256; + const int len = 256; char name[len]; int code = FT_Get_Glyph_Name (face_, signed_idx, name, len); if (code) diff --git a/lily/pango-font.cc b/lily/pango-font.cc index 6eba7c8780..0d7189378d 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -33,7 +33,7 @@ Pango_font::Pango_font (PangoFT2FontMap *fontmap, pango_description_ = pango_font_description_copy (description); // context_ = pango_ft2_font_map_create_context (fontmap); - attribute_list_= pango_attr_list_new (); + attribute_list_ = pango_attr_list_new (); /* urgh. I don't understand this. Why isn't this 1/(scale * @@ -123,7 +123,7 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con FcPattern *fcpat = fcfont->font_pattern; char *filename = 0; - FcPatternGetString (fcpat, FC_FILE, 0, (FcChar8 **) &filename); + FcPatternGetString (fcpat, FC_FILE, 0, (FcChar8 **) & filename); char const *ps_name_str0 = FT_Get_Postscript_Name (ftface); if (!ps_name_str0) @@ -238,8 +238,8 @@ Pango_font::text_stencil (String str) const { Stencil frame = Lookup::frame (dest.extent_box (), 0.1, 0.1); Box empty; - empty.set_empty(); - Stencil dimless_frame (empty, frame.expr()); + empty.set_empty (); + Stencil dimless_frame (empty, frame.expr ()); dest.add_stencil (frame); } #endif diff --git a/lily/paper-outputter-scheme.cc b/lily/paper-outputter-scheme.cc index 453a524f22..4fa9cd2853 100644 --- a/lily/paper-outputter-scheme.cc +++ b/lily/paper-outputter-scheme.cc @@ -79,7 +79,6 @@ LY_DEFINE (ly_outputter_close, "ly:outputter-close", return SCM_UNSPECIFIED; } - LY_DEFINE (ly_outputter_output_scheme, "ly:outputter-output-scheme", 2, 0, 0, (SCM outputter, SCM expr), "Eval @var{expr} in module of @var{outputter}.") diff --git a/lily/paper-system.cc b/lily/paper-system.cc index c519404a65..e78a1e9be9 100644 --- a/lily/paper-system.cc +++ b/lily/paper-system.cc @@ -34,7 +34,7 @@ SCM Paper_system::mark_smob (SCM smob) { Paper_system *system = (Paper_system *) SCM_CELL_WORD_1 (smob); - return system-> stencil_.expr (); + return system->stencil_.expr (); } int diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc index 70086010b7..23d770b61b 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -88,11 +88,10 @@ Part_combine_iterator::do_quit () second_iter_->quit (); null_.set_context (0); - one_ .set_context (0); + one_.set_context (0); two_.set_context (0); shared_.set_context (0); solo_.set_context (0); - } Part_combine_iterator::Part_combine_iterator () @@ -125,7 +124,6 @@ Part_combine_iterator::derived_substitute (Context *f, { if (first_iter_) first_iter_->substitute_outlet (f, t); - } Moment @@ -194,7 +192,7 @@ Part_combine_iterator::solo1 () if (!event) event = make_music_by_name (ly_symbol2scm ("SoloOneEvent")); - first_iter_-> try_music_in_children (event); + first_iter_->try_music_in_children (event); } playing_state_ = SOLO1; } @@ -282,7 +280,7 @@ Part_combine_iterator::solo2 () if (!event) event = make_music_by_name (ly_symbol2scm ("SoloTwoEvent")); - second_iter_-> try_music_in_children (event); + second_iter_->try_music_in_children (event); playing_state_ = SOLO2; } } @@ -331,7 +329,7 @@ Part_combine_iterator::construct_children () = get_outlet ()->find_create_context (ly_symbol2scm ("Voice"), "solo", props); - solo_ .set_context (solo_tr); + solo_.set_context (solo_tr); Context *null = get_outlet ()->find_create_context (ly_symbol2scm ("Devnull"), @@ -380,7 +378,6 @@ Part_combine_iterator::construct_children () execute_pushpop_property (two, sym, ly_symbol2scm ("direction"), scm_int2num (-1)); } - } void diff --git a/lily/percent-repeat-engraver.cc b/lily/percent-repeat-engraver.cc index 99d440e9fb..e5da150a44 100644 --- a/lily/percent-repeat-engraver.cc +++ b/lily/percent-repeat-engraver.cc @@ -90,7 +90,7 @@ Percent_repeat_engraver::try_music (Music *m) Moment meas_len (robust_scm2moment (get_property ("measureLength"), Moment (1))); if (meas_len == body_length_) repeat_sign_type_ = MEASURE; - else if (Moment (2)* meas_len == body_length_) + else if (Moment (2) * meas_len == body_length_) { repeat_sign_type_ = DOUBLE_MEASURE; next_moment_ += meas_len; @@ -113,7 +113,6 @@ Percent_repeat_engraver::try_music (Music *m) */ if (repeat_sign_type_ == DOUBLE_MEASURE) global->add_moment_to_process (next_moment_ + meas_len + Moment (i) * body_length_); - } return true; @@ -174,7 +173,6 @@ Percent_repeat_engraver::typeset_perc () double_percent_ = 0; } - void Percent_repeat_engraver::start_translation_timestep () { @@ -197,7 +195,6 @@ Percent_repeat_engraver::stop_translation_timestep () typeset_perc (); } - ADD_TRANSLATOR (Percent_repeat_engraver, /* descr */ "Make whole bar and double bar repeats.", /* creats*/ "PercentRepeat DoublePercentRepeat", diff --git a/lily/performer-group-performer.cc b/lily/performer-group-performer.cc index 39d6ccc7c5..053a5f32fc 100644 --- a/lily/performer-group-performer.cc +++ b/lily/performer-group-performer.cc @@ -43,7 +43,7 @@ Performer_group_performer::acknowledge_audio_elements () { Translator *t = unsmob_translator (scm_car (p)); Performer *eng = dynamic_cast (t); - if (eng && eng!= info.origin_trans_) + if (eng && eng != info.origin_trans_) eng->acknowledge_audio_element (info); } } diff --git a/lily/phrasing-slur-engraver.cc b/lily/phrasing-slur-engraver.cc index 7eda8473f3..318e8da6db 100644 --- a/lily/phrasing-slur-engraver.cc +++ b/lily/phrasing-slur-engraver.cc @@ -95,7 +95,7 @@ Phrasing_slur_engraver::acknowledge_grob (Grob_info info) } else if (inside == SCM_BOOL_F) { - Grob *slur = slurs_.size ()?slurs_[0] : 0; + Grob *slur = slurs_.size () ? slurs_[0] : 0; slur = (end_slurs_.size () && !slur) ? end_slurs_[0] : slur; diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index e8ee2a12e6..e2e1896b17 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -95,7 +95,7 @@ Piano_pedal_engraver::initialize () { char *names [] = { "Sostenuto", "Sustain", "UnaCorda", 0 }; - info_list_ = new Pedal_info[sizeof (names)/ sizeof (const char *)]; + info_list_ = new Pedal_info[sizeof (names) / sizeof (const char *)]; Pedal_info *p = info_list_; char **np = names; @@ -178,7 +178,6 @@ Piano_pedal_engraver::process_music () String name = String (p->name_) + "PedalLineSpanner"; Music *rq = (p->event_drul_[START] ? p->event_drul_[START] : p->event_drul_[STOP]); p->line_spanner_ = make_spanner (name.to_str0 (), rq->self_scm ()); - } /* Choose the appropriate grobs to add to the line spanner @@ -429,7 +428,7 @@ Piano_pedal_engraver::finalize () { p->line_spanner_->set_bound (RIGHT, c); } - p->bracket_ ->set_bound (RIGHT, c); + p->bracket_->set_bound (RIGHT, c); p->finished_bracket_ = p->bracket_; p->bracket_ = 0; diff --git a/lily/piano-pedal-performer.cc b/lily/piano-pedal-performer.cc index 82c5f9b21b..8393fbe83d 100644 --- a/lily/piano-pedal-performer.cc +++ b/lily/piano-pedal-performer.cc @@ -105,7 +105,7 @@ Piano_pedal_performer::create_audio_elements () void Piano_pedal_performer::stop_translation_timestep () { - for (int i = 0; i< audios_.size (); i++) + for (int i = 0; i < audios_.size (); i++) play_element (audios_[i]); audios_.clear (); } diff --git a/lily/pitch-scheme.cc b/lily/pitch-scheme.cc index c417c850f0..18f3a67307 100644 --- a/lily/pitch-scheme.cc +++ b/lily/pitch-scheme.cc @@ -30,9 +30,9 @@ LY_DEFINE (ly_make_pitch, "ly:make-pitch", "The @var{alter} is zero for a natural, negative for " "flats, or positive for sharps. ") { - SCM_ASSERT_TYPE (scm_integer_p (octave)== SCM_BOOL_T, octave, SCM_ARG1, __FUNCTION__, "integer"); - SCM_ASSERT_TYPE (scm_integer_p (note)== SCM_BOOL_T, note, SCM_ARG2, __FUNCTION__, "integer"); - SCM_ASSERT_TYPE (scm_integer_p (alter)== SCM_BOOL_T, alter, SCM_ARG3, __FUNCTION__, "integer"); + SCM_ASSERT_TYPE (scm_integer_p (octave) == SCM_BOOL_T, octave, SCM_ARG1, __FUNCTION__, "integer"); + SCM_ASSERT_TYPE (scm_integer_p (note) == SCM_BOOL_T, note, SCM_ARG2, __FUNCTION__, "integer"); + SCM_ASSERT_TYPE (scm_integer_p (alter) == SCM_BOOL_T, alter, SCM_ARG3, __FUNCTION__, "integer"); Pitch p (scm_to_int (octave), scm_to_int (note), scm_to_int (alter)); return p.smobbed_copy (); diff --git a/lily/pitch.cc b/lily/pitch.cc index 01bb70d5b1..5504db6bcd 100644 --- a/lily/pitch.cc +++ b/lily/pitch.cc @@ -47,7 +47,7 @@ Pitch::compare (Pitch const &m1, Pitch const &m2) int Pitch::steps () const { - return notename_ + octave_*7; + return notename_ + octave_ * 7; } /* Should be settable from input? */ diff --git a/lily/protected-scm.cc b/lily/protected-scm.cc index 976563ac89..36e527a2a1 100644 --- a/lily/protected-scm.cc +++ b/lily/protected-scm.cc @@ -15,7 +15,7 @@ Protected_scm::Protected_scm () Protected_scm::Protected_scm (SCM s) { - object_ = SCM_NIMP (s) ? scm_gc_protect_object (s): s; + object_ = SCM_NIMP (s) ? scm_gc_protect_object (s) : s; } Protected_scm::Protected_scm (Protected_scm const &s) @@ -31,7 +31,7 @@ Protected_scm::~Protected_scm () } Protected_scm & -Protected_scm::operator= (SCM s) +Protected_scm::operator = (SCM s) { if (object_ == s) return *this; @@ -44,9 +44,9 @@ Protected_scm::operator= (SCM s) } Protected_scm & -Protected_scm::operator= (Protected_scm const &s) +Protected_scm::operator = (Protected_scm const &s) { - return operator= (s.object_); + return operator = (s.object_); } Protected_scm::operator SCM () const diff --git a/lily/repeat-acknowledge-engraver.cc b/lily/repeat-acknowledge-engraver.cc index 0fdc741350..376a89b0ab 100644 --- a/lily/repeat-acknowledge-engraver.cc +++ b/lily/repeat-acknowledge-engraver.cc @@ -30,7 +30,6 @@ protected: virtual void start_translation_timestep (); virtual void process_music (); virtual void initialize (); - }; void diff --git a/lily/repeated-music.cc b/lily/repeated-music.cc index 4a0f7d6e88..0081363e7f 100644 --- a/lily/repeated-music.cc +++ b/lily/repeated-music.cc @@ -161,8 +161,8 @@ Repeated_music::first_start (SCM m) Music *me = unsmob_music (m); Music *body = unsmob_music (me->get_property ("element")); - Moment rv = (body) ? body->start_mom () : - Music_sequence::first_start (me->get_property ("elements")); + Moment rv = (body) ? body->start_mom () + : Music_sequence::first_start (me->get_property ("elements")); return rv.smobbed_copy (); } diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index bcc8a8545a..9e4ff6e50d 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -133,7 +133,7 @@ Rest_collision::do_shift (Grob *me) This is incomplete: in case of an uneven number of rests, the center one should be centered on the staff. */ - Drul_array< Link_array > ordered_rests; + Drul_array > ordered_rests; for (int i = 0; i < rests.size (); i++) { Grob *r = Note_column::get_rest (rests[i]); @@ -191,13 +191,12 @@ Rest_collision::do_shift (Grob *me) Real last_y = ordered_rests[d][i + 1]->extent (common, Y_AXIS)[d]; Real y = ordered_rests[d][i]->extent (common, Y_AXIS)[-d]; - Real diff = d * ((last_y - y) /staff_space); + Real diff = d * ((last_y - y) / staff_space); if (diff > 0) Note_column::translate_rests (ordered_rests[d][i], d * (int) ceil (diff) * 2); } } while (flip (&d) != LEFT); - } else { @@ -243,15 +242,15 @@ Rest_collision::do_shift (Grob *me) if (!stafflines) { programming_error ("No staff line count ? "); - stafflines =5; + stafflines = 5; } // move discretely by half spaces. - int discrete_dist = int (ceil (dist / (0.5 *staff_space))); + int discrete_dist = int (ceil (dist / (0.5 * staff_space))); // move by whole spaces inside the staff. if (discrete_dist < stafflines + 1) - discrete_dist = int (ceil (discrete_dist / 2.0)* 2.0); + discrete_dist = int (ceil (discrete_dist / 2.0) * 2.0); Note_column::translate_rests (rcol, dir * discrete_dist); } diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index d6436d6a21..009d16f768 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -57,7 +57,7 @@ Rest_engraver::process_music () { rest_ = make_item ("Rest", rest_req_->self_scm ()); - int durlog = unsmob_duration (rest_req_->get_property ("duration"))-> duration_log (); + int durlog = unsmob_duration (rest_req_->get_property ("duration"))->duration_log (); rest_->set_property ("duration-log", scm_int2num (durlog)); @@ -71,7 +71,6 @@ Rest_engraver::process_music () Rhythmic_head::set_dots (rest_, dot_); dot_->set_parent (rest_, Y_AXIS); dot_->set_property ("dot-count", scm_int2num (dots)); - } Pitch *p = unsmob_pitch (rest_req_->get_property ("pitch")); @@ -89,7 +88,6 @@ Rest_engraver::process_music () rest_->set_property ("staff-position", scm_int2num (pos)); } - } } diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index 934e25b9dd..f726dc88ab 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -37,7 +37,7 @@ the default spacing do its work. */ -class Rhythmic_column_engraver :public Engraver +class Rhythmic_column_engraver : public Engraver { Link_array rheads_; Grob *stem_; @@ -77,14 +77,12 @@ Rhythmic_column_engraver::process_acknowledged_grobs () spacing_ = make_item ("NoteSpacing", SCM_EOL); spacing_->set_property ("left-items", scm_cons (note_column_->self_scm (), SCM_EOL)); - if (last_spacing_) { Pointer_group_interface::add_grob (last_spacing_, ly_symbol2scm ("right-items"), note_column_); } - } for (int i = 0; i < rheads_.size (); i++) @@ -109,7 +107,6 @@ Rhythmic_column_engraver::process_acknowledged_grobs () Note_column::set_stem (note_column_, stem_); stem_ = 0; } - } } diff --git a/lily/rod.cc b/lily/rod.cc index 268c5e737e..7ad5db343c 100644 --- a/lily/rod.cc +++ b/lily/rod.cc @@ -33,8 +33,7 @@ Rod::columnize () distance_ += -d * item_drul_[d]->relative_coordinate (pc, X_AXIS); item_drul_[d] = pc; } - while ((flip (&d))!= LEFT); - + while ((flip (&d)) != LEFT); } void diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index 2e21757f4c..af73ca3a30 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -48,7 +48,7 @@ Scheme_hash_table::Scheme_hash_table (Scheme_hash_table const &src) } void -Scheme_hash_table::operator= (Scheme_hash_table const &src) +Scheme_hash_table::operator = (Scheme_hash_table const &src) { if (&src == this) return; @@ -115,7 +115,7 @@ Scheme_hash_table::set (SCM k, SCM v) */ if (elt_count_ > 2 * scm_c_vector_length (hash_tab_)) { - SCM nh = scm_make_vector (scm_int2num (3* elt_count_ + 1), SCM_EOL); + SCM nh = scm_make_vector (scm_int2num (3 * elt_count_ + 1), SCM_EOL); elt_count_ = copy_scm_hashes (nh, hash_tab_); hash_tab_ = nh; } diff --git a/lily/scm-option.cc b/lily/scm-option.cc index d836451373..3fc6a3b726 100644 --- a/lily/scm-option.cc +++ b/lily/scm-option.cc @@ -59,7 +59,7 @@ LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (SCM), puts (""); printf (_ (" The function ly:set-option allows for access to some internal variables.").to_str0 ()); puts ("\n"); - printf (_ ("Usage: lilypond -e \"(ly:set - option SYMBOL VAL)\"").to_str0 ()); + printf (_ ("Usage: lilypond -e \"(ly : set - option SYMBOL VAL)\"").to_str0 ()); puts ("\n"); printf (_ ("Use help as SYMBOL to get online help.").to_str0 ()); @@ -96,7 +96,7 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val), "@end table\n" "\n" "This function is useful to call from the command line: @code{lilypond -e\n" - "\"(ly:set - option 'midi-debug #t)\"}.\n") + "\"(ly : set - option 'midi-debug #t)\"}.\n") { if (val == SCM_UNDEFINED) val = SCM_BOOL_T; diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index f7cba549b2..648cc6a758 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -176,7 +176,6 @@ Score_engraver::typeset_all () { bool br = to_boolean (elem->get_property ("breakable")); Axis_group_interface::add_element (br ? command_column_ : musical_column_, elem); - } } if (!elem->get_parent (Y_AXIS)) @@ -229,7 +228,7 @@ Music_output * Score_engraver::get_output () { Music_output *o = pscore_; - ///FIXME WTF? pscore_ = 0; + ///FIXME WTF ? pscore_ = 0; return o; } @@ -303,7 +302,6 @@ Score_engraver::acknowledge_grob (Grob_info gi) gi.grob_); } } - } ADD_TRANSLATOR (Score_engraver, diff --git a/lily/score.cc b/lily/score.cc index e0cb8469a7..f3cca4d334 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -200,7 +200,6 @@ Score::book_rendering (String outname, return systems; } - void Score::set_music (SCM music, SCM parser) { @@ -220,14 +219,12 @@ Score::set_music (SCM music, SCM parser) m->origin ()->error (_ ("Error found in this music expression. Ignoring it")); this->error_found_ = this->error_found_ || to_boolean (m->get_property ("error-found")); - } if (this->error_found_) this->music_ = SCM_EOL; else this->music_ = music; - } SCM diff --git a/lily/script-column-engraver.cc b/lily/script-column-engraver.cc index 5395e4c3b4..7e027aacfc 100644 --- a/lily/script-column-engraver.cc +++ b/lily/script-column-engraver.cc @@ -58,7 +58,6 @@ Script_column_engraver::process_acknowledged_grobs () if (!scol_ && scripts_.size () > 1) { scol_ = make_item ("ScriptColumn", SCM_EOL); - } if (scol_) @@ -67,7 +66,6 @@ Script_column_engraver::process_acknowledged_grobs () Script_column::add_staff_sided (scol_, scripts_[i]); scripts_.clear (); } - } ADD_TRANSLATOR (Script_column_engraver, diff --git a/lily/script-column.cc b/lily/script-column.cc index 37051bd6a4..f70c73aa5c 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -86,7 +86,6 @@ Script_column::before_line_breaking (SCM smob) last = g; } - } while (flip (&d) != DOWN); diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index f393128911..3dfc782f1b 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -141,7 +141,6 @@ void make_script_from_event (Grob *p, bool *follow, Context *tg, } Side_position_interface::set_axis (p, Y_AXIS); - } void diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index 71bf4dd5d7..1a02e6a5ea 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -55,7 +55,7 @@ Separating_group_spanner::find_rods (Item *r, SCM next, Real padding) Rod rod; rod.item_drul_[LEFT] = l; - rod.item_drul_[RIGHT]= r; + rod.item_drul_[RIGHT] = r; rod.distance_ = li[RIGHT] - ri[LEFT] + padding; @@ -68,7 +68,6 @@ Separating_group_spanner::find_rods (Item *r, SCM next, Real padding) this grob doesn't cause a constraint. We look further until we find one that does. */ - } } @@ -112,7 +111,6 @@ Separating_group_spanner::add_spacing_unit (Grob *me, Item *i) me->add_dependency (i); } - ADD_INTERFACE (Separating_group_spanner, "separation-spanner-interface", "A spanner that calculates spacing constraints (\"rods\") " "using the @code{separation-item-interface} grobs in @code{elements}.", diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index 9d95c17f39..3d28bb3c4f 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -149,7 +149,6 @@ Separating_line_group_engraver::acknowledge_grob (Grob_info i) Pointer_group_interface::add_grob (last_spacings_.note_spacings_[i], ly_symbol2scm ("right-items"), break_item_); - } else if (last_spacings_.staff_spacing_) { @@ -190,7 +189,6 @@ Separating_line_group_engraver::stop_translation_timestep () if (musical_item_) Pointer_group_interface::add_grob (sp, ly_symbol2scm ("right-items"), musical_item_); - } if (!current_spacings_.is_empty ()) diff --git a/lily/separation-item.cc b/lily/separation-item.cc index 68fb40fb23..0cf923a2d0 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -160,7 +160,6 @@ Separation_item::extremal_break_aligned_grob (Grob *separation_item, Direction d return last_grob; } - ADD_INTERFACE (Separation_item, "separation-item-interface", "Item that computes widths to generate spacing rods. " "This is done in concert with @ref{separation-spanner-interface}.", diff --git a/lily/sequential-iterator.cc b/lily/sequential-iterator.cc index cf88a52d1d..0f9b429549 100644 --- a/lily/sequential-iterator.cc +++ b/lily/sequential-iterator.cc @@ -52,7 +52,6 @@ Sequential_iterator::do_quit () iter_->quit (); } - void Sequential_iterator::derived_mark () const { diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index c9e3dc6eae..cea9fa6c62 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -135,7 +135,6 @@ Side_position_interface::aligned_on_support_refpoints (SCM smob, SCM axis) return general_side_position (me, a, false); } - Real directed_round (Real f, Direction d) { @@ -164,7 +163,7 @@ Side_position_interface::quantised_position (SCM element_smob, SCM) { Real p = Staff_symbol_referencer::get_position (me); Real rp = directed_round (p, d); - Real rad = Staff_symbol_referencer::staff_radius (me) *2; + Real rad = Staff_symbol_referencer::staff_radius (me) * 2; int ip = int (rp); Grob *head = me->get_parent (X_AXIS); @@ -226,8 +225,8 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis) Grob *common = me->common_refpoint (st, Y_AXIS); Interval staff_size = st->extent (common, Y_AXIS); - Real diff = d*staff_size[d] + padding - d* (o + iv[-d]); - o += (d* (diff >? 0)); + Real diff = d*staff_size[d] + padding - d * (o + iv[-d]); + o += (d * (diff >? 0)); } return scm_make_real (o); diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index e9afca6cbd..2b2529555c 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -172,7 +172,7 @@ void Simple_spacer::set_active_states () { /* float comparison is safe, since force is only copied. */ - for (int i = 0; i = force_) { @@ -335,7 +335,6 @@ Simple_spacer_wrapper::solve (Column_x_positions *positions, bool ragged) if (scm_to_double (p) > 9999) break_satisfy = break_satisfy && ! (i == 0 || i == sz -1); } - } positions->satisfies_constraints_ diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc index 0c9cead8fe..1c5a800206 100644 --- a/lily/simultaneous-music-iterator.cc +++ b/lily/simultaneous-music-iterator.cc @@ -28,7 +28,7 @@ void Simultaneous_music_iterator::derived_substitute (Context *f, Context *t) { for (SCM s = children_list_; scm_is_pair (s); s = scm_cdr (s)) - unsmob_iterator (scm_car (s))-> substitute_outlet (f, t); + unsmob_iterator (scm_car (s))->substitute_outlet (f, t); } void diff --git a/lily/skyline.cc b/lily/skyline.cc index bbbf7f5580..b3b6349461 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -68,7 +68,7 @@ insert_extent_into_skyline (Array *line, Box b, Axis line_axis, if (!w.is_empty () && w.length () > EPS - && d* (my_height - stick_out) < 0) + && d * (my_height - stick_out) < 0) { Interval e1 (line->elem (i).width_[LEFT], extent[LEFT]); Interval e3 (extent[RIGHT], line->elem (i).width_[RIGHT]); @@ -81,12 +81,11 @@ insert_extent_into_skyline (Array *line, Box b, Axis line_axis, if (!e1.is_empty () && e1.length () > EPS) line->insert (Skyline_entry (e1, my_height), i); } - } } void -merge_skyline (Array * a1, +merge_skyline (Array *a1, Array const &a2, Direction dir) { @@ -180,7 +179,6 @@ Skyline_entry::Skyline_entry (Interval i, Real r) { width_ = i; height_ = r; - } void diff --git a/lily/slash-repeat-engraver.cc b/lily/slash-repeat-engraver.cc index 25430d0ace..ee1ea2fd44 100644 --- a/lily/slash-repeat-engraver.cc +++ b/lily/slash-repeat-engraver.cc @@ -119,7 +119,6 @@ Slash_repeat_engraver::stop_translation_timestep () beat_slash_ = 0; } - ADD_TRANSLATOR (Slash_repeat_engraver, /* descr */ "Make beat repeats.", /* creats*/ "RepeatSlash", diff --git a/lily/slur-configuration.cc b/lily/slur-configuration.cc index 6ab45f334e..8a1af612d5 100644 --- a/lily/slur-configuration.cc +++ b/lily/slur-configuration.cc @@ -81,7 +81,7 @@ fit_factor (Offset dz_unit, Offset dz_perp, { Offset z = (avoid[i] - x0); Offset p (dot_product (z, dz_unit), - d* dot_product (z, dz_perp)); + d * dot_product (z, dz_perp)); if (!curve_xext.contains (p[X_AXIS])) continue; @@ -108,7 +108,7 @@ Slur_configuration::generate_curve (Slur_score_state const &state, continue; Encompass_info inf (state.get_encompass_info (encompasses[i])); - Real y = state.dir_ * ((state.dir_ * inf.head_) >? (state.dir_ *inf.stem_)); + Real y = state.dir_ * ((state.dir_ * inf.head_) >? (state.dir_ * inf.stem_)); avoid.push (Offset (inf.x_, y + state.dir_ * state.parameters_.free_head_distance_)); } @@ -201,7 +201,6 @@ Slur_configuration::Slur_configuration () index_ = -1; }; - void Slur_configuration::score_encompass (Slur_score_state const &state) { @@ -255,7 +254,7 @@ Slur_configuration::score_encompass (Slur_score_state const &state) Real closest = state.dir_ * (state.dir_ * state.encompass_infos_[j].get_point (state.dir_) - >? state.dir_ *line_y); + >? state.dir_ * line_y); Real d = fabs (closest - y); convex_head_distances.push (d); @@ -361,7 +360,7 @@ Slur_configuration::score_extra_encompass (Slur_score_state const &state) Item *as_item = dynamic_cast (state.extra_encompass_infos_[j].grob_); if ((as_item && as_item->get_column () - == state.extremes_[d] .bound_->get_column ()) + == state.extremes_[d].bound_->get_column ()) || state.extra_encompass_infos_[j].extents_[X_AXIS].contains (attachment[d][X_AXIS])) { y = attachment[d][Y_AXIS]; diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 200ad5c0f3..f41c69c338 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -66,7 +66,7 @@ Slur_engraver::try_music (Music *m) void Slur_engraver::set_melisma (bool m) { - context ()->set_property ("slurMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F); + context ()->set_property ("slurMelismaBusy", m ? SCM_BOOL_T : SCM_BOOL_F); } void @@ -93,7 +93,7 @@ Slur_engraver::acknowledge_grob (Grob_info info) } else if (inside == SCM_BOOL_F) { - Grob *slur = slurs_.size ()?slurs_[0] : 0; + Grob *slur = slurs_.size () ? slurs_[0] : 0; slur = (end_slurs_.size () && !slur) ? end_slurs_[0] : slur; diff --git a/lily/slur-performer.cc b/lily/slur-performer.cc index aa3d4cdc6b..573e2426c1 100644 --- a/lily/slur-performer.cc +++ b/lily/slur-performer.cc @@ -58,7 +58,7 @@ Slur_performer::process_music () void Slur_performer::set_melisma (bool ml) { - context ()->set_property ("slurMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F); + context ()->set_property ("slurMelismaBusy", ml ? SCM_BOOL_T : SCM_BOOL_F); } void diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 9539ced5c6..28c5fec42b 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -224,7 +224,6 @@ Slur_score_state::get_encompass_info (Grob *col) const return ei; } - Drul_array Slur_score_state::get_bound_info () const { @@ -264,6 +263,7 @@ Slur_score_state::get_bound_info () const } } while (flip (&d) != LEFT); + return extremes; } @@ -459,7 +459,7 @@ Slur_score_state::get_y_attachment_range () const if (extremes_[d].note_column_) { end_ys[d] = dir_ - * ((dir_ * (base_attachments_[d][Y_AXIS] + parameters_.region_size_* dir_)) + * ((dir_ * (base_attachments_[d][Y_AXIS] + parameters_.region_size_ * dir_)) >? (dir_ * (dir_ + extremes_[d].note_column_->extent (common_[Y_AXIS], Y_AXIS)[dir_])) >? (dir_ * base_attachments_[-d][Y_AXIS])); @@ -525,7 +525,6 @@ Slur_score_state::get_base_attachments () const .linear_combination (CENTER); } base_attachment[d] = Offset (x, y); - } while (flip (&d) != LEFT); @@ -588,12 +587,11 @@ void Slur_score_state::generate_curves () const { Real r_0 = robust_scm2double (slur_->get_property ("ratio"), 0.33); - Real h_inf = staff_space_ *scm_to_double (slur_->get_property ("height-limit")); + Real h_inf = staff_space_ * scm_to_double (slur_->get_property ("height-limit")); for (int i = 0; i < configurations_.size (); i++) configurations_[i]->generate_curve (*this, r_0, h_inf); } - Link_array Slur_score_state::enumerate_attachments (Drul_array end_ys) const { @@ -703,7 +701,7 @@ Slur_score_state::get_extra_encompass_infos () const for (int k = 0; k < 3; k++) { - Direction hdir = Direction (k /2 - 1); + Direction hdir = Direction (k / 2 - 1); /* Only take bound into account if small slur starts @@ -720,7 +718,7 @@ Slur_score_state::get_extra_encompass_infos () const yext[dir_] = z[Y_AXIS] + dir_ * thickness_ * 1.0; Interval xext (-1, 1); - xext = xext * (thickness_*2) + z[X_AXIS]; + xext = xext * (thickness_ * 2) + z[X_AXIS]; Extra_collision_info info (small_slur, k - 1.0, xext, diff --git a/lily/spaceable-grob.cc b/lily/spaceable-grob.cc index c8f8950b91..13760ce36a 100644 --- a/lily/spaceable-grob.cc +++ b/lily/spaceable-grob.cc @@ -27,7 +27,7 @@ void Spaceable_grob::add_rod (Grob *me, Grob *p, Real d) { // printf ("rod %lf\n", d); - if (isinf(d) || d < 0) + if (isinf (d) || d < 0) { programming_error ("Weird rod"); } diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index ec4b189fa2..22931c8ecf 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -78,7 +78,6 @@ Spacing_engraver::process_music () { spacing_ = make_spanner ("SpacingSpanner", SCM_EOL); spacing_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn"))); - } } @@ -145,7 +144,6 @@ Spacing_engraver::stop_translation_timestep () { starter = starter *cols, Rational dists[d] = dists[d] >? fixed_space; } - } } while (flip (&d) != LEFT); @@ -338,13 +337,13 @@ Spacing_spanner::set_implicit_neighbor_columns (Link_array cols) /* sloppy with typnig left/right-neighbors should take list, but paper-column found instead. */ - SCM ln = cols[i] ->get_property ("left-neighbors"); + SCM ln = cols[i]->get_property ("left-neighbors"); if (!scm_is_pair (ln) && i) { cols[i]->set_property ("left-neighbors", scm_cons (cols[i - 1]->self_scm (), SCM_EOL)); } - SCM rn = cols[i] ->get_property ("right-neighbors"); + SCM rn = cols[i]->get_property ("right-neighbors"); if (!scm_is_pair (rn) && i < cols.size () - 1) { cols[i]->set_property ("right-neighbors", scm_cons (cols[i + 1]->self_scm (), SCM_EOL)); @@ -579,7 +578,6 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item *lc, Item *rc, Real incr compound_note_space = compound_note_space + space; compound_fixed_note_space = compound_fixed_note_space + fixed; wish_count++; - } } @@ -730,7 +728,7 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r, Moment sh pointer munging. */ - assert (spacing_grob-> get_column () == l); + assert (spacing_grob->get_column () == l); Staff_spacing::get_spacing_params (spacing_grob, &space, &fixed_space); @@ -823,7 +821,7 @@ Spacing_spanner::get_duration_space (Grob *me, Moment d, Rational shortest, bool */ Real log = log_2 (shortest); k -= log; - Rational compdur = d.main_part_ + d.grace_part_ /Rational (3); + Rational compdur = d.main_part_ + d.grace_part_ / Rational (3); *expand_only = false; return (log_2 (compdur) + k) * incr; @@ -861,13 +859,13 @@ Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc, Moment *dt = unsmob_moment (rc->get_property ("measure-length")); if (dt) { - delta_t = delta_t set_parent (bars_[0], X_AXIS); - } } } diff --git a/lily/span-dynamic-performer.cc b/lily/span-dynamic-performer.cc index 175c1da92f..a49eb5a377 100644 --- a/lily/span-dynamic-performer.cc +++ b/lily/span-dynamic-performer.cc @@ -165,7 +165,6 @@ Span_dynamic_performer::stop_translation_timestep () span_events_[STOP] = 0; span_events_[START] = 0; - } bool diff --git a/lily/spanner.cc b/lily/spanner.cc index e7221000c7..abcac02f50 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -10,7 +10,7 @@ #include -#include +#include < libc - extension.hh> #include "warn.hh" #include "paper-column.hh" @@ -78,7 +78,7 @@ Spanner::do_break_processing () broken_intos_.push (span); } } - while ((flip (&d))!= LEFT); + while ((flip (&d)) != LEFT); } else { @@ -87,7 +87,7 @@ Spanner::do_break_processing () break_points.insert (left, 0); break_points.push (right); - for (int i =1; i < break_points.size (); i++) + for (int i = 1; i < break_points.size (); i++) { Drul_array bounds; bounds[LEFT] = break_points[i - 1]; @@ -98,7 +98,7 @@ Spanner::do_break_processing () if (!bounds[d]->get_system ()) bounds[d] = bounds[d]->find_prebroken_piece (- d); } - while ((flip (&d))!= LEFT); + while ((flip (&d)) != LEFT); if (!bounds[LEFT] || ! bounds[RIGHT]) { @@ -208,8 +208,8 @@ Spanner::Spanner (SCM s, Object_key const *key) : Grob (s, key) { break_index_ = 0; - spanned_drul_[LEFT]= 0; - spanned_drul_[RIGHT]= 0; + spanned_drul_[LEFT] = 0; + spanned_drul_[RIGHT] = 0; Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("spanner-interface")); } @@ -226,7 +226,7 @@ Spanner::spanner_length () const Real l = spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS); Real r = spanned_drul_[RIGHT]->relative_coordinate (0, X_AXIS); - if (r< l) + if (r < l) programming_error ("spanner with negative length"); return r - l; @@ -303,7 +303,8 @@ Spanner::do_derived_mark () const do if (spanned_drul_[d]) scm_gc_mark (spanned_drul_[d]->self_scm ()); - while (flip (&d) != LEFT); + while (flip (&d) != LEFT) + ; for (int i = broken_intos_.size (); i--;) scm_gc_mark (broken_intos_[i]->self_scm ()); diff --git a/lily/spring-smob.cc b/lily/spring-smob.cc index ecbeed1993..7eb3820745 100644 --- a/lily/spring-smob.cc +++ b/lily/spring-smob.cc @@ -13,7 +13,7 @@ Spring_smob::Spring_smob () { distance_ = 0.; - strength_ =1.0; + strength_ = 1.0; expand_only_b_ = false; other_ = 0; } diff --git a/lily/staff-collecting-engraver.cc b/lily/staff-collecting-engraver.cc index ad8ca8546a..095bfe1115 100644 --- a/lily/staff-collecting-engraver.cc +++ b/lily/staff-collecting-engraver.cc @@ -20,7 +20,6 @@ public: Staff_collecting_engraver::Staff_collecting_engraver () { - } void diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index 124f19d370..90e6882ea2 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -132,7 +132,6 @@ Staff_spacing::next_notes_correction (Grob *me, Grob *last_grob) for (SCM t = g->get_property ("elements"); scm_is_pair (t); t = scm_cdr (t)) max_corr = max_corr >? next_note_correction (me, unsmob_grob (scm_car (t)), bar_size); - } return max_corr; diff --git a/lily/staff-symbol-engraver.cc b/lily/staff-symbol-engraver.cc index 1c668ed8fe..c3bc1c763c 100644 --- a/lily/staff-symbol-engraver.cc +++ b/lily/staff-symbol-engraver.cc @@ -48,7 +48,6 @@ Staff_symbol_engraver::process_music () span_ = make_spanner ("StaffSymbol", SCM_EOL); span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn"))); - } } @@ -68,7 +67,6 @@ Staff_symbol_engraver::acknowledge_grob (Grob_info s) s.grob_->set_property ("staff-symbol", span_->self_scm ()); } - ADD_TRANSLATOR (Staff_symbol_engraver, /* descr */ "Create the constellation of five (default) " "staff lines.", @@ -96,7 +94,7 @@ Tab_staff_symbol_engraver::process_music () if (init) { int k = scm_ilength (get_property ("stringTunings")); - if (k>= 0) + if (k >= 0) span_->set_property ("line-count", scm_int2num (k)); } } diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 926f1a3bac..b57d1191d4 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -67,7 +67,7 @@ Staff_symbol::print (SCM smob) int l = Staff_symbol::line_count (me); - Real height = (l - 1) * staff_space (me) /2; + Real height = (l - 1) * staff_space (me) / 2; Stencil a = Lookup::horizontal_line (span_points -me->relative_coordinate (common, X_AXIS), @@ -119,7 +119,7 @@ Staff_symbol::get_ledger_line_thickness (Grob *me) SCM lt_pair = me->get_property ("ledger-line-thickness"); Offset z = robust_scm2offset (lt_pair, Offset (1.0, 0.1)); - return z[X_AXIS] * get_line_thickness (me) + z[Y_AXIS]* staff_space (me); + return z[X_AXIS] * get_line_thickness (me) + z[Y_AXIS] * staff_space (me); } ADD_INTERFACE (Staff_symbol, "staff-symbol-interface", diff --git a/lily/stanza-number-align-engraver.cc b/lily/stanza-number-align-engraver.cc index 70c95f8746..16d2e073d2 100644 --- a/lily/stanza-number-align-engraver.cc +++ b/lily/stanza-number-align-engraver.cc @@ -28,7 +28,6 @@ protected: Stanza_number_align_engraver::Stanza_number_align_engraver () { - } void diff --git a/lily/stanza-number-engraver.cc b/lily/stanza-number-engraver.cc index 8d5c8fda19..2f77b5d4f7 100644 --- a/lily/stanza-number-engraver.cc +++ b/lily/stanza-number-engraver.cc @@ -48,7 +48,6 @@ Stanza_number_engraver::process_music () text_ = make_item ("StanzaNumber", SCM_EOL); text_->set_property ("text", stanza); - } } diff --git a/lily/stem.cc b/lily/stem.cc index 0f227b4c94..028843a6eb 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -120,7 +120,7 @@ Stem::set_stemend (Grob *me, Real se) // todo: margins Direction d = get_direction (me); - if (d && d * head_positions (me)[get_direction (me)] >= se*d) + if (d && d * head_positions (me)[get_direction (me)] >= se * d) me->warning (_ ("Weird stem size; check for narrow beams")); me->set_property ("stem-end-position", scm_make_real (se)); @@ -194,7 +194,6 @@ Stem::extremal_heads (Grob *me) } } while (flip (&d) != DOWN); - } return exthead; } @@ -298,8 +297,8 @@ Stem::get_default_stem_end_position (Grob *me) if (dir && dir * hp[dir] >= 0) { SCM sshorten = me->get_property ("stem-shorten"); - SCM scm_shorten = scm_is_pair (sshorten) ? - robust_list_ref ((duration_log (me) - 2) >? 0, sshorten): SCM_EOL; + SCM scm_shorten = scm_is_pair (sshorten) + ? robust_list_ref ((duration_log (me) - 2) >? 0, sshorten) : SCM_EOL; Real shorten = 2* robust_scm2double (scm_shorten, 0); /* On boundary: shorten only half */ @@ -696,7 +695,7 @@ Stem::print (SCM smob) = me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter")); Box b = Box (Interval (-stem_width / 2, stem_width / 2), - Interval (stem_y[DOWN]*half_space, stem_y[UP]*half_space)); + Interval (stem_y[DOWN] * half_space, stem_y[UP] * half_space)); Stencil ss = Lookup::round_filled_box (b, blot); mol.add_stencil (ss); @@ -704,7 +703,7 @@ Stem::print (SCM smob) if (!get_beam (me) && abs (duration_log (me)) > 2) { Stencil fl = flag (me); - fl.translate_axis (stem_y[d]*half_space - d * blot / 2, Y_AXIS); + fl.translate_axis (stem_y[d] * half_space - d * blot / 2, Y_AXIS); fl.translate_axis (stem_width / 2, X_AXIS); mol.add_stencil (fl); } diff --git a/lily/stencil-scheme.cc b/lily/stencil-scheme.cc index 5e54fe1ce7..842200c6a0 100644 --- a/lily/stencil-scheme.cc +++ b/lily/stencil-scheme.cc @@ -13,7 +13,6 @@ #include "lookup.hh" #include "stencil.hh" - /* TODO: naming add/combine. */ @@ -58,7 +57,6 @@ LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis", Stencil *q = unsmob_stencil (new_s); q->translate_axis (real_amount, Axis (scm_to_int (axis))); return new_s; - } LY_DEFINE (ly_translate_stencil, "ly:stencil-translate", @@ -294,7 +292,7 @@ LY_DEFINE (ly_interpret_stencil_expression, "ly:interpret-stencil-expression", a.arg1 = arg1; Offset o = ly_scm2offset (offset); - interpret_stencil_expression (expr, stencil_interpret_in_scm, (void *) &a, o); + interpret_stencil_expression (expr, stencil_interpret_in_scm, (void *) & a, o); return SCM_UNSPECIFIED; } diff --git a/lily/stencil.cc b/lily/stencil.cc index 5e102dd5fc..05aeefe903 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -10,7 +10,7 @@ #include -#include // isinf +#include < libc - extension.hh> // isinf #include "input-smob.hh" #include "font-metric.hh" @@ -282,7 +282,7 @@ find_expression_fonts (SCM expr) fl.fonts_ = SCM_EOL; interpret_stencil_expression (expr, &find_font_function, - (void *) &fl, Offset (0, 0)); + (void *) & fl, Offset (0, 0)); return fl.fonts_; } diff --git a/lily/string-number-engraver.cc b/lily/string-number-engraver.cc index fd87ec4aff..503445facb 100644 --- a/lily/string-number-engraver.cc +++ b/lily/string-number-engraver.cc @@ -25,7 +25,6 @@ String_number_engraver::try_music (Music *) String_number_engraver::String_number_engraver () { - } /* diff --git a/lily/system-start-delimiter-engraver.cc b/lily/system-start-delimiter-engraver.cc index de89a20764..a5f3624d28 100644 --- a/lily/system-start-delimiter-engraver.cc +++ b/lily/system-start-delimiter-engraver.cc @@ -74,7 +74,6 @@ System_start_delimiter_engraver::process_music () ly_symbol2string (delim_name).to_str0 ()); delim_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn"))); - } } void @@ -83,7 +82,6 @@ System_start_delimiter_engraver::finalize () if (delim_) { delim_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn"))); - } } diff --git a/lily/tempo-performer.cc b/lily/tempo-performer.cc index 0cbbbf450c..540db7dcac 100644 --- a/lily/tempo-performer.cc +++ b/lily/tempo-performer.cc @@ -75,7 +75,6 @@ Tempo_performer::try_music (Music *req) return true; } - ADD_TRANSLATOR (Tempo_performer, "", "", "metronome-change-event", "", "", ""); diff --git a/lily/text-item.cc b/lily/text-item.cc index 2cbaedefc2..10500ceba1 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -94,4 +94,3 @@ ADD_INTERFACE (Text_interface, "text-interface", "A scheme markup text, see @usermanref{Text-markup}.", "text baseline-skip word-space"); - diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index f21432c9e7..385c73a4d6 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -135,9 +135,10 @@ Text_spanner::print (SCM smob) } } while (flip (&d) != LEFT); + do { - if (d* span_points[d] > d * edge[-d].extent (X_AXIS)[d]) + if (d * span_points[d] > d * edge[-d].extent (X_AXIS)[d]) { edge_line[d].translate_axis (span_points[d], X_AXIS); m.add_stencil (edge_line[d]); diff --git a/lily/tfm-reader.cc b/lily/tfm-reader.cc index 1b6862ec02..c7ca5ee6c9 100644 --- a/lily/tfm-reader.cc +++ b/lily/tfm-reader.cc @@ -29,7 +29,6 @@ Tex_font_metric_reader::Tex_font_metric_reader (String name) read_header (); read_params (); read_char_metrics (); - } static const Real @@ -114,7 +113,6 @@ Tex_font_metric_reader::read_header () font family and face byte probably aren't. So we don't read them. */ info_.coding_scheme = header_length > 2 ? get_bcpl_string () : "unspecified"; - } /* Although TFM files are only usable by TeX if they have at least seven @@ -151,7 +149,6 @@ Tex_font_metric_reader::read_params () for (Char_code i = 2; i <= header_.param_word_count; i++) info_.parameters[i - 1] = get_U32_fix_scaled (); - } /* Read every character in the TFM file, storing the result in the @@ -222,7 +219,7 @@ Tex_font_metric_reader::read_char () #define GET_CHAR_DIMEN(d) \ if (d##_index != 0) \ { \ - input_.seek_str0 (header_. d##_pos + d##_index*4); \ + input_.seek_str0 (header_.d##_pos + d##_index * 4); \ tfm_char.d##_fix_ = input_.get_U32 (); \ tfm_char.d##_ = fix_to_real (tfm_char.d##_fix_) \ * info_.design_size; \ @@ -257,7 +254,7 @@ Tex_font_metric_reader::read_char () #define KERN_FLAG 128 void -Tex_font_metric_reader::read_lig_kern_program (Array* ligatures, Array* kerns) +Tex_font_metric_reader::read_lig_kern_program (Array *ligatures, Array *kerns) { bool end_b; @@ -280,7 +277,6 @@ Tex_font_metric_reader::read_lig_kern_program (Array* ligatures, A input_.set_pos (old_pos); kerns->push (kern_element); - } else { @@ -288,10 +284,8 @@ Tex_font_metric_reader::read_lig_kern_program (Array* ligatures, A ligature_element.character = next_char; ligature_element.ligature = remainder; ligatures->push (ligature_element); - } } while (!end_b); - } diff --git a/lily/tfm.cc b/lily/tfm.cc index 8d86135022..e5aeea72cd 100644 --- a/lily/tfm.cc +++ b/lily/tfm.cc @@ -44,7 +44,7 @@ Tex_font_char_metric::dimensions () const Real d = -depth_; Real point_constant = 1 PT; - return Box (Interval (0, width_* point_constant), + return Box (Interval (0, width_ * point_constant), Interval ((d ? height_) * point_constant)); } diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index efd6098c5a..4cb3ec1df5 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -147,7 +147,6 @@ Tie_engraver::start_translation_timestep () { context ()->set_property ("tieMelismaBusy", ly_bool2scm (heads_to_tie_.size ())); - } void @@ -160,7 +159,7 @@ Tie_engraver::stop_translation_timestep () heads_to_tie_.clear (); } - for (int i = 0; i< ties_.size (); i++) + for (int i = 0; i < ties_.size (); i++) { typeset_tie (ties_[i]); } @@ -207,7 +206,6 @@ Tie_engraver::typeset_tie (Grob *her) index_set_cell (her->get_property ("head-pair"), LEFT, new_head_drul[LEFT]->self_scm ()); index_set_cell (her->get_property ("head-pair"), RIGHT, new_head_drul[RIGHT]->self_scm ()); - } ADD_TRANSLATOR (Tie_engraver, diff --git a/lily/tie-performer.cc b/lily/tie-performer.cc index 2c0b3c4b32..f415317ae7 100644 --- a/lily/tie-performer.cc +++ b/lily/tie-performer.cc @@ -84,7 +84,6 @@ Tie_performer::start_translation_timestep () { context ()->set_property ("tieMelismaBusy", ly_bool2scm (heads_to_tie_.size ())); - } void diff --git a/lily/tie.cc b/lily/tie.cc index 59755a8ad7..3f9037d577 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -78,7 +78,7 @@ Tie::get_column_rank (Grob *me, Direction d) Real Tie::get_position (Grob *me) { - Direction d = head (me, LEFT) ? LEFT:RIGHT; + Direction d = head (me, LEFT) ? LEFT : RIGHT; return Staff_symbol_referencer::get_position (head (me, d)); } @@ -95,8 +95,8 @@ Tie::get_position (Grob *me) Direction Tie::get_default_dir (Grob *me) { - Item *sl = head (me, LEFT) ? Rhythmic_head::get_stem (head (me, LEFT)) :0; - Item *sr = head (me, RIGHT) ? Rhythmic_head::get_stem (head (me, RIGHT)) :0; + Item *sl = head (me, LEFT) ? Rhythmic_head::get_stem (head (me, LEFT)) : 0; + Item *sr = head (me, RIGHT) ? Rhythmic_head::get_stem (head (me, RIGHT)) : 0; if (sl && sr) { if (get_grob_direction (sl) == UP @@ -175,7 +175,7 @@ Tie::get_control_points (SCM smob) This correction is due te the shape of the black note head. */ if (Rhythmic_head::duration_log (l) == 2) - where += dir* 0.2; + where += dir * 0.2; left_x = l->extent (l, X_AXIS).linear_combination (where) + x_gap_f; } @@ -230,7 +230,7 @@ Tie::get_control_points (SCM smob) if (Note_head::has_interface (l) && Rhythmic_head::get_dots (l)) { Grob *dots = Rhythmic_head::get_dots (l); - if (fabs (staff_space * Staff_symbol_referencer::get_position (dots) /2 + if (fabs (staff_space * Staff_symbol_referencer::get_position (dots) / 2 - ypos) < 0.5) { ypos += 0.5 * dir; diff --git a/lily/time-signature-performer.cc b/lily/time-signature-performer.cc index 4b9aad5e48..b02a15bfa7 100644 --- a/lily/time-signature-performer.cc +++ b/lily/time-signature-performer.cc @@ -49,7 +49,6 @@ Time_signature_performer::create_audio_elements () audio_ = new Audio_time_signature (b, o); Audio_element_info info (audio_, 0); announce_element (info); - } } diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 7edc7ec4fd..a0b9abac3d 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -74,7 +74,6 @@ Timing_translator::measure_length () const Timing_translator::Timing_translator () { - } Moment diff --git a/lily/translator.cc b/lily/translator.cc index 9f192103b9..e1f3408a38 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -36,7 +36,6 @@ Translator::do_announces () void Translator::process_music () { - } Translator::Translator () @@ -128,7 +127,7 @@ Translator::translator_description () const Global_context * Translator::get_global_context () const { - return daddy_context_ ->get_global_context (); + return daddy_context_->get_global_context (); } Score_context * @@ -156,5 +155,4 @@ Translator::must_be_last () const void Translator::derived_mark () const { - } diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index dc1f4a3c20..a73c06dec4 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -210,9 +210,9 @@ Tuplet_bracket::print (SCM smob) if (is_number_pair (fl)) flare[d] += ss * scm_to_double (index_get_cell (fl, d)); if (is_number_pair (eh)) - height[d] += -dir * ss *scm_to_double (index_get_cell (eh, d)); + height[d] += -dir * ss * scm_to_double (index_get_cell (eh, d)); if (is_number_pair (sp)) - shorten[d] += ss *scm_to_double (index_get_cell (sp, d)); + shorten[d] += ss * scm_to_double (index_get_cell (sp, d)); } while (flip (&d) != LEFT); @@ -260,7 +260,7 @@ Tuplet_bracket::make_bracket (Grob *me, // for line properties. Direction d = LEFT; do { - straight_corners[d] += -d * shorten[d] /length * dz; + straight_corners[d] += -d * shorten[d] / length * dz; } while (flip (&d) != LEFT); @@ -318,7 +318,7 @@ Tuplet_bracket::calc_position_and_height (Grob *me, Real *offset, Real *dy) Use outer non-rest columns to determine slope */ int l = 0; - while (l 1 ? 1/ (x1 - x0) : 1.0; + Real factor = columns.size () > 1 ? 1 / (x1 - x0) : 1.0; for (int i = 0; i < columns.size (); i++) { @@ -378,7 +378,7 @@ Tuplet_bracket::calc_position_and_height (Grob *me, Real *offset, Real *dy) } // padding - *offset += scm_to_double (me->get_property ("padding")) *dir; + *offset += scm_to_double (me->get_property ("padding")) * dir; /* horizontal brackets should not collide with staff lines. @@ -396,7 +396,6 @@ Tuplet_bracket::calc_position_and_height (Grob *me, Real *offset, Real *dy) *offset *= 0.5 * ss; } - } /* @@ -413,7 +412,7 @@ Tuplet_bracket::before_line_breaking (SCM smob) for (int i = columns.size (); i--;) { Grob *s = Note_column::get_stem (columns[i]); - Grob *b = s ? Stem::get_beam (s): 0; + Grob *b = s ? Stem::get_beam (s) : 0; if (b) me->add_dependency (b); } @@ -524,8 +523,6 @@ Tuplet_bracket::add_column (Grob *me, Item *n) add_bound_item (dynamic_cast (me), n); } - - ADD_INTERFACE (Tuplet_bracket, "tuplet-bracket-interface", "A bracket with a number in the middle, used for tuplets.", diff --git a/lily/vaticana-ligature.cc b/lily/vaticana-ligature.cc index d8e8b03e2d..5bfd385d17 100644 --- a/lily/vaticana-ligature.cc +++ b/lily/vaticana-ligature.cc @@ -107,9 +107,9 @@ vaticana_brew_flexa (Grob *me, * Compensate optical illusion regarding vertical position of left * and right endings due to curved shape. */ - Real ypos_correction = -0.1*staff_space * sign (interval); - Real interval_correction = 0.2*staff_space * sign (interval); - Real corrected_interval = interval*staff_space + interval_correction; + Real ypos_correction = -0.1 * staff_space * sign (interval); + Real interval_correction = 0.2 * staff_space * sign (interval); + Real corrected_interval = interval * staff_space + interval_correction; /* * middle curve of flexa shape @@ -123,7 +123,7 @@ vaticana_brew_flexa (Grob *me, Bezier top_curve = curve, bottom_curve = curve; for (int i = 0; i < 4; i++) { - Real curve_thickness = 0.33 * ((3 - i)*left_height + i*right_height); + Real curve_thickness = 0.33 * ((3 - i) * left_height + i * right_height); top_curve.control_[i] += Offset (0, 0.5 * curve_thickness); bottom_curve.control_[i] -= Offset (0, 0.5 * curve_thickness); } @@ -157,12 +157,12 @@ vaticana_brew_flexa (Grob *me, * the left end of the bezier curve. */ Box left_edge_box (Interval (0, line_thickness), - Interval (-0.5*left_height, +0.5*left_height)); + Interval (-0.5 * left_height, +0.5 * left_height)); Stencil left_edge = Lookup::filled_box (left_edge_box); stencil.add_stencil (left_edge); Box right_edge_box (Interval (-line_thickness, 0), - Interval (-0.5*right_height, +0.5*right_height)); + Interval (-0.5 * right_height, +0.5 * right_height)); Stencil right_edge = Lookup::filled_box (right_edge_box); right_edge.translate_axis (width, X_AXIS); right_edge.translate_axis (corrected_interval / 2.0, Y_AXIS); @@ -184,8 +184,8 @@ vaticana_brew_join (Grob *me, int delta_pitch, return Stencil (); } Interval x_extent = Interval (0, join_thickness); - Interval y_extent = (delta_pitch > 0) ? - Interval (0, delta_pitch * 0.5 * staff_space) : // ascending join + Interval y_extent = (delta_pitch > 0) + ? Interval (0, delta_pitch * 0.5 * staff_space) : // ascending join Interval (delta_pitch * 0.5 * staff_space, 0); // descending join Box join_box (x_extent, y_extent); return Lookup::round_filled_box (join_box, blotdiameter); @@ -238,9 +238,9 @@ vaticana_brew_primitive (Grob *me) * flexa_width.) */ Real staff_space = Staff_symbol_referencer::staff_space (me); - Real flexa_width = robust_scm2double (me->get_property ("flexa-width"), 2) *staff_space; + Real flexa_width = robust_scm2double (me->get_property ("flexa-width"), 2) * staff_space; out - = Lookup::blank (Box (Interval (0, 0.5*flexa_width), Interval (0, 0))); + = Lookup::blank (Box (Interval (0, 0.5 * flexa_width), Interval (0, 0))); } else if (!String::compare (glyph_name, "flexa")) { diff --git a/lily/volta-bracket.cc b/lily/volta-bracket.cc index 1127f2776a..eafb4fbb52 100644 --- a/lily/volta-bracket.cc +++ b/lily/volta-bracket.cc @@ -54,8 +54,8 @@ Volta_bracket_interface::print (SCM smob) const char *cs = str.to_str0 (); no_vertical_end - |= (strcmp (cs, ":|")!= 0 && strcmp (cs, "|:")!= 0 && strcmp (cs, "|.")!= 0 - && strcmp (cs, ":|:")!= 0 && strcmp (cs, ".|")!= 0); + |= (strcmp (cs, ":|") != 0 && strcmp (cs, "|:") != 0 && strcmp (cs, "|.") != 0 + && strcmp (cs, ":|:") != 0 && strcmp (cs, ".|") != 0); Output_def *layout = me->get_layout (); Real half_space = 0.5; diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index 531c6fa02a..9fe3ee9bb2 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -37,7 +37,6 @@ protected: SCM start_string_; bool staff_eligible (); - }; Volta_engraver::Volta_engraver () @@ -232,7 +231,6 @@ Volta_engraver::stop_translation_timestep () Item *ci = dynamic_cast (cc); volta_span_->set_bound (LEFT, ci); } - } /* -- 2.39.2