From fc3e875d6bf06f0680e897faffdcab36ad975a03 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 11 Mar 2001 17:49:25 +0100 Subject: [PATCH] patch::: 1.3.136.jcn3 1.3.136.jcn3 ============ * Finished () beautification. * Bugfix: grob-description.scm: Script::after_line_breaking -> before_line_breaking. 1.3.136.hwn1 ============ * Percent style repeats. * Named music creation: (ly-make-music "Note_req") 1.3.136.jcn2 --- CHANGES | 30 +- Documentation/user/internals.itely | 4 + Documentation/user/refman.itely | 26 +- VERSION | 2 +- flower/axis.cc | 14 +- flower/binary-source-file.cc | 4 +- flower/cpu-timer.cc | 4 +- flower/data-file.cc | 30 +- flower/direction.cc | 4 +- flower/dstream.cc | 30 +- flower/file-path.cc | 22 +- flower/getopt-long.cc | 28 +- flower/include/array.hh | 42 +- flower/include/array.icc | 4 +- flower/include/axes.hh | 6 +- flower/include/compare.hh | 22 +- flower/include/cons.hh | 12 +- flower/include/data-file.hh | 12 +- flower/include/dictionary.hh | 3 +- flower/include/direction.hh | 2 +- flower/include/drul-array.hh | 6 +- flower/include/dstream.hh | 6 +- flower/include/flower-proto.hh | 2 +- flower/include/getopt-long.hh | 18 +- flower/include/hash-table-iter.hh | 6 +- flower/include/hash-table.hh | 20 +- flower/include/interval.hh | 34 +- flower/include/interval.tcc | 14 +- flower/include/killing-cons.tcc | 2 +- flower/include/offset.hh | 36 +- flower/include/parray.hh | 30 +- flower/include/parse-afm.hh | 18 +- flower/include/pointer.hh | 32 +- flower/include/pointer.tcc | 22 +- flower/include/polynomial.hh | 52 +-- flower/include/pqueue.hh | 42 +- flower/include/rational.hh | 8 +- flower/include/real.hh | 2 +- flower/include/source.hh | 2 +- flower/include/string-convert.hh | 2 +- flower/include/string-data.hh | 24 +- flower/include/string-data.icc | 38 +- flower/include/string-handle.hh | 28 +- flower/include/string-handle.icc | 64 +-- flower/include/string.hh | 24 +- flower/include/string.icc | 4 +- flower/include/text-db.hh | 18 +- flower/include/text-stream.hh | 24 +- flower/include/virtual-methods.hh | 8 +- flower/input.cc | 6 +- flower/offset.cc | 6 +- flower/parse-afm.cc | 432 +++++++++--------- flower/polynomial.cc | 100 ++-- flower/rational.cc | 12 +- flower/rtti.cc | 2 +- flower/simple-file-storage.cc | 2 +- flower/source-file.cc | 6 +- flower/string-convert.cc | 40 +- flower/string.cc | 8 +- flower/text-db.cc | 22 +- flower/text-stream.cc | 8 +- flower/warn.cc | 2 +- input/regression/repeat-volta.ly | 2 +- input/test/music-creation.ly | 34 ++ lily/GNUmakefile | 1 + lily/afm.cc | 12 +- lily/align-interface.cc | 42 +- lily/align-note-column-engraver.cc | 12 +- lily/all-font-metrics.cc | 22 +- lily/arpeggio.cc | 2 +- lily/audio-column.cc | 2 +- lily/audio-element-info.cc | 2 +- lily/audio-element.cc | 2 +- lily/audio-staff.cc | 4 +- lily/auto-beam-engraver.cc | 10 +- lily/auto-change-iterator.cc | 16 +- lily/axis-group-engraver.cc | 22 +- lily/axis-group-interface.cc | 8 +- lily/bar-engraver.cc | 12 +- lily/bar-number-engraver.cc | 18 +- lily/bar.cc | 21 +- lily/beam-engraver.cc | 26 +- lily/beam.cc | 58 +-- lily/beaming-info.cc | 10 +- lily/bezier-bow.cc | 14 +- lily/bezier.cc | 16 +- lily/box.cc | 10 +- lily/break-algorithm.cc | 4 +- lily/break-align-engraver.cc | 10 +- lily/break-align-item.cc | 32 +- lily/breathing-sign-engraver.cc | 24 +- lily/breathing-sign.cc | 16 +- lily/change-iterator.cc | 4 +- lily/chord-tremolo-engraver.cc | 24 +- lily/chord-tremolo-iterator.cc | 8 +- lily/chord.cc | 2 +- lily/clef-engraver.cc | 10 +- lily/clef-item.cc | 8 +- lily/collision-engraver.cc | 14 +- lily/collision.cc | 19 +- lily/column-x-positions.cc | 2 +- lily/command-request.cc | 56 +-- lily/context-specced-music.cc | 12 +- lily/custos-engraver.cc | 20 +- lily/custos.cc | 52 +-- lily/cxx-function-smob.cc | 10 +- lily/debug.cc | 2 +- lily/dimension-cache.cc | 6 +- lily/directional-element-interface.cc | 4 +- lily/dot-column-engraver.cc | 8 +- lily/dot-column.cc | 6 +- lily/dots.cc | 8 +- lily/duration.cc | 20 +- lily/dynamic-engraver.cc | 18 +- lily/dynamic-performer.cc | 6 +- lily/engraver-group-engraver.cc | 14 +- lily/engraver.cc | 8 +- lily/extender-engraver.cc | 10 +- lily/folded-repeat-iterator.cc | 6 +- lily/font-interface.cc | 24 +- lily/font-metric.cc | 18 +- lily/gdb.cc | 4 +- lily/global-ctor.cc | 2 +- lily/global-translator.cc | 16 +- lily/gourlay-breaking.cc | 2 +- lily/grace-align-item.cc | 6 +- lily/grace-engraver-group.cc | 10 +- lily/grace-iterator.cc | 6 +- lily/grace-music.cc | 8 + lily/grace-performer-group.cc | 8 +- lily/grace-position-engraver.cc | 10 +- lily/grob-info.cc | 2 +- lily/grob.cc | 78 ++-- lily/group-interface.cc | 6 +- lily/hairpin.cc | 4 +- lily/hara-kiri-group-spanner.cc | 10 +- lily/hyphen-engraver.cc | 8 +- lily/hyphen-spanner.cc | 14 +- lily/includable-lexer.cc | 4 +- lily/include/align-interface.hh | 4 +- lily/include/arpeggio.hh | 2 +- lily/include/audio-column.hh | 4 +- lily/include/audio-element-info.hh | 2 +- lily/include/audio-item.hh | 2 +- lily/include/axis-group-interface.hh | 2 +- lily/include/bar.hh | 6 +- lily/include/beam.hh | 8 +- lily/include/beaming.hh | 2 +- lily/include/box.hh | 12 +- lily/include/break-algorithm.hh | 12 +- lily/include/break-align-item.hh | 6 +- lily/include/breathing-sign.hh | 4 +- lily/include/chord-name.hh | 4 +- lily/include/chord-tremolo-iterator.hh | 2 +- lily/include/chord.hh | 2 +- lily/include/clef.hh | 4 +- lily/include/collision.hh | 2 +- lily/include/column-x-positions.hh | 2 +- lily/include/command-request.hh | 18 +- lily/include/context-specced-music.hh | 5 +- lily/include/custos.hh | 6 +- lily/include/dimension-cache-callback.hh | 4 +- lily/include/dimension-cache.hh | 2 +- lily/include/directional-element-interface.hh | 2 +- lily/include/dot-column.hh | 2 +- lily/include/dots.hh | 4 +- lily/include/duration.hh | 8 +- lily/include/engraver-group-engraver.hh | 4 +- lily/include/engraver.hh | 4 +- lily/include/font-interface.hh | 4 +- lily/include/font-metric.hh | 2 +- lily/include/global-ctor.hh | 2 +- lily/include/global-translator.hh | 10 +- lily/include/gourlay-breaking.hh | 4 +- lily/include/grace-align-item.hh | 2 +- lily/include/grace-engraver-group.hh | 2 +- lily/include/grace-music.hh | 3 +- lily/include/grace-performer-group.hh | 4 +- lily/include/grob-info.hh | 2 +- lily/include/grob.hh | 12 +- lily/include/hara-kiri-group-spanner.hh | 6 +- lily/include/hyphen-spanner.hh | 4 +- lily/include/interpretation-context-handle.hh | 2 +- lily/include/item.hh | 6 +- lily/include/key-item.hh | 4 +- lily/include/kpath.hh | 2 +- lily/include/lily-guile.hh | 20 +- lily/include/lily-proto.hh | 4 +- lily/include/line-group-group-engraver.hh | 8 +- lily/include/line-of-score.hh | 6 +- lily/include/ly-smobs.icc | 32 +- lily/include/lyric-combine-music.hh | 3 +- lily/include/lyric-extender.hh | 2 +- lily/include/lyric-phrasing-engraver.hh | 60 +-- lily/include/main.hh | 6 +- lily/include/midi-def.hh | 6 +- lily/include/midi-stream.hh | 10 +- lily/include/midi-walker.hh | 8 +- lily/include/minmax.tcc | 2 +- lily/include/misc.hh | 4 +- lily/include/molecule.hh | 14 +- lily/include/moment.hh | 2 +- lily/include/multi-measure-rest.hh | 5 +- lily/include/music-constructor.hh | 35 ++ lily/include/music-iterator.hh | 8 +- lily/include/music-list.hh | 18 +- lily/include/music-output-def.hh | 4 +- lily/include/music-output.hh | 4 +- lily/include/music-sequence.hh | 6 +- lily/include/music-wrapper-iterator.hh | 2 +- lily/include/music-wrapper.hh | 3 +- lily/include/music.hh | 10 +- lily/include/musical-request.hh | 22 +- lily/include/my-lily-lexer.hh | 22 +- lily/include/my-lily-parser.hh | 16 +- lily/include/note-column.hh | 8 +- lily/include/note-head.hh | 4 +- lily/include/paper-column.hh | 4 +- lily/include/paper-def.hh | 2 +- lily/include/paper-outputter.hh | 2 +- lily/include/paper-score.hh | 10 +- lily/include/paper-stream.hh | 6 +- lily/include/part-combine-music.hh | 2 + lily/include/percent-repeat-iterator.hh | 36 ++ lily/include/performance.hh | 4 +- lily/include/performer-group-performer.hh | 4 +- lily/include/performer.hh | 6 +- lily/include/pitch.hh | 10 +- lily/include/protected-scm.hh | 2 +- lily/include/relative-music.hh | 3 +- lily/include/repeated-music.hh | 12 +- lily/include/request-chord-iterator.hh | 2 +- lily/include/request.hh | 10 +- lily/include/rest-collision.hh | 2 +- lily/include/rest.hh | 6 +- lily/include/rhythmic-head.hh | 2 +- lily/include/scm-hash.hh | 6 +- lily/include/score-engraver.hh | 20 +- lily/include/score-performer.hh | 14 +- lily/include/score.hh | 6 +- lily/include/script-column.hh | 2 +- lily/include/script.hh | 4 +- lily/include/separating-group-spanner.hh | 2 +- lily/include/side-position-interface.hh | 12 +- lily/include/smobs.hh | 14 +- lily/include/spacing-spanner.hh | 2 +- lily/include/span-bar.hh | 8 +- lily/include/spanner.hh | 2 +- lily/include/staff-symbol-referencer.hh | 4 +- lily/include/staff-symbol.hh | 4 +- lily/include/stem.hh | 18 +- lily/include/swallow-perf.hh | 2 +- lily/include/symbol-cache.hh | 2 +- lily/include/system-start-delimiter.hh | 4 +- lily/include/text-item.hh | 2 +- lily/include/tie-column.hh | 2 +- lily/include/tie.hh | 6 +- lily/include/time-scaled-music.hh | 3 +- lily/include/time-signature.hh | 2 +- lily/include/timing-translator.hh | 2 +- lily/include/translation-property.hh | 6 +- lily/include/translator-def.hh | 2 +- lily/include/translator-group.hh | 22 +- lily/include/translator.hh | 24 +- lily/include/transposed-music.hh | 4 +- lily/include/tuplet-spanner.hh | 6 +- lily/include/type-swallow-translator.hh | 10 +- lily/include/unfolded-repeat-iterator.hh | 3 - lily/include/volta-spanner.hh | 2 +- lily/input-smob.cc | 12 +- lily/instrument-name-engraver.cc | 10 +- lily/interpretation-context-handle.cc | 6 +- lily/item.cc | 20 +- lily/key-engraver.cc | 12 +- lily/key-item.cc | 18 +- lily/key-performer.cc | 8 +- lily/keyword.cc | 4 +- lily/kpath.cc | 33 +- lily/least-squares.cc | 6 +- lily/lexer.ll | 29 +- lily/lily-guile.cc | 42 +- lily/line-group-group-engraver.cc | 12 +- lily/line-of-score.cc | 52 +-- lily/line-spanner.cc | 12 +- lily/local-key-engraver.cc | 44 +- lily/local-key-item.cc | 24 +- lily/lookup.cc | 188 ++++---- lily/lyric-combine-music-iterator.cc | 2 +- lily/lyric-combine-music.cc | 9 +- lily/lyric-engraver.cc | 8 +- lily/lyric-extender.cc | 10 +- lily/lyric-performer.cc | 6 +- lily/lyric-phrasing-engraver.cc | 174 +++---- lily/main.cc | 16 +- lily/mark-engraver.cc | 18 +- lily/melisma-engraver.cc | 14 +- lily/midi-def.cc | 8 +- lily/midi-item.cc | 6 +- lily/midi-walker.cc | 20 +- lily/misc.cc | 10 +- lily/molecule.cc | 32 +- lily/moment.cc | 14 +- lily/multi-measure-rest-engraver.cc | 10 +- lily/multi-measure-rest.cc | 55 ++- lily/music-constructor.cc | 40 ++ lily/music-ctor.cc | 1 + lily/music-iterator.cc | 8 +- lily/music-list.cc | 31 +- lily/music-output-def.cc | 10 +- lily/music-sequence.cc | 14 +- lily/music-wrapper-iterator.cc | 2 +- lily/music-wrapper.cc | 10 +- lily/music.cc | 55 ++- lily/musical-request.cc | 19 +- lily/my-lily-lexer.cc | 20 +- lily/my-lily-parser.cc | 26 +- lily/note-column.cc | 4 +- lily/note-head.cc | 18 +- lily/note-heads-engraver.cc | 12 +- lily/note-name-engraver.cc | 10 +- lily/note-performer.cc | 4 +- lily/output-property-engraver.cc | 6 +- lily/output-property-music-iterator.cc | 2 +- lily/paper-column.cc | 12 +- lily/paper-def.cc | 10 +- lily/paper-outputter.cc | 22 +- lily/paper-score.cc | 2 +- lily/parser.yy | 89 ++-- lily/part-combine-music-iterator.cc | 34 +- lily/part-combine-music.cc | 8 + lily/percent-repeat-engraver.cc | 208 +++++++++ lily/percent-repeat-iterator.cc | 85 ++++ lily/performance.cc | 24 +- lily/performer-group-performer.cc | 10 +- lily/performer.cc | 6 +- lily/phrasing-slur-engraver.cc | 6 +- lily/piano-pedal-engraver.cc | 22 +- lily/piano-pedal-performer.cc | 8 +- lily/pitch.cc | 32 +- lily/property-engraver.cc | 14 +- lily/property-inspect.cc | 9 - lily/property-iterator.cc | 10 +- lily/protected-scm.cc | 10 +- lily/relative-octave-music.cc | 8 +- lily/repeat-acknowledge-engraver.cc | 10 +- lily/repeated-music.cc | 27 +- lily/request-chord-iterator.cc | 8 +- lily/rest-collision-engraver.cc | 14 +- lily/rest-collision.cc | 24 +- lily/rest-engraver.cc | 4 +- lily/rest.cc | 12 +- lily/rhythmic-column-engraver.cc | 24 +- lily/rod.cc | 4 +- lily/scaled-font-metric.cc | 2 +- lily/scm-hash.cc | 24 +- lily/scope.cc | 6 +- lily/score-engraver.cc | 72 +-- lily/score-performer.cc | 18 +- lily/score.cc | 50 +- lily/scores.cc | 16 +- lily/script-column-engraver.cc | 8 +- lily/script-column.cc | 6 +- lily/script-engraver.cc | 30 +- lily/script.cc | 33 +- lily/separating-group-spanner.cc | 12 +- lily/separating-line-group-engraver.cc | 6 +- lily/separation-item.cc | 4 +- lily/sequential-music-iterator.cc | 18 +- lily/side-position-interface.cc | 36 +- lily/simple-music-iterator.cc | 2 +- lily/simple-spacer.cc | 8 +- lily/simultaneous-music-iterator.cc | 28 +- lily/slur-bezier-bow.cc | 12 +- lily/slur-engraver.cc | 6 +- lily/slur.cc | 36 +- lily/spaceable-element.cc | 4 +- lily/spacing-engraver.cc | 18 +- lily/spacing-spanner.cc | 30 +- lily/span-bar-engraver.cc | 22 +- lily/span-bar.cc | 20 +- lily/span-dynamic-performer.cc | 8 +- lily/spanner.cc | 52 +-- lily/staff-performer.cc | 6 +- lily/staff-symbol-engraver.cc | 24 +- lily/staff-symbol-referencer.cc | 14 +- lily/staff-symbol.cc | 6 +- lily/stanza-number-engraver.cc | 12 +- lily/stem-engraver.cc | 16 +- lily/stem-tremolo.cc | 26 +- lily/stem.cc | 64 +-- lily/sustain-pedal.cc | 4 +- lily/swallow-perf.cc | 2 +- lily/syllable-group.cc | 118 ++--- lily/symbol-cache.cc | 6 +- lily/system-start-delimiter-engraver.cc | 14 +- lily/system-start-delimiter.cc | 16 +- lily/template5.cc | 4 +- lily/tempo-performer.cc | 8 +- lily/text-engraver.cc | 10 +- lily/text-item.cc | 10 +- lily/text-spanner-engraver.cc | 6 +- lily/tfm-reader.cc | 21 +- lily/tfm.cc | 4 +- lily/tie-column.cc | 14 +- lily/tie-engraver.cc | 34 +- lily/tie-performer.cc | 16 +- lily/tie.cc | 22 +- lily/time-scaled-music-iterator.cc | 4 +- lily/time-scaled-music.cc | 5 + lily/time-signature-engraver.cc | 14 +- lily/time-signature-performer.cc | 10 +- lily/time-signature.cc | 4 +- lily/timing-engraver.cc | 8 +- lily/timing-translator.cc | 30 +- lily/translator-ctors.cc | 2 +- lily/translator-def.cc | 20 +- lily/translator-group.cc | 40 +- lily/translator.cc | 16 +- lily/transposed-music.cc | 5 +- lily/tuplet-bracket.cc | 16 +- lily/tuplet-engraver.cc | 18 +- lily/type-swallow-translator.cc | 2 +- lily/unfolded-repeat-iterator.cc | 22 +- lily/vertical-align-engraver.cc | 22 +- lily/voice-devnull-engraver.cc | 7 +- lily/volta-engraver.cc | 14 +- lily/volta-spanner.cc | 14 +- ly/engraver.ly | 1 + mf/feta-bolletjes.mf | 122 ++++- mf/feta-klef.mf | 44 +- mf/feta-puntje.mf | 6 + scm/c++.scm | 4 +- scm/clef.scm | 1 + scm/grob-description.scm | 15 +- scm/output-lib.scm | 2 +- 435 files changed, 3931 insertions(+), 3100 deletions(-) create mode 100644 input/test/music-creation.ly create mode 100644 lily/include/music-constructor.hh create mode 100644 lily/include/percent-repeat-iterator.hh create mode 100644 lily/music-constructor.cc create mode 100644 lily/music-ctor.cc create mode 100644 lily/percent-repeat-engraver.cc create mode 100644 lily/percent-repeat-iterator.cc diff --git a/CHANGES b/CHANGES index 3da27c528e..61b05eba1b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,19 @@ -1.3.136.jcn2 +1.3.136.jcn3 +============ + +* Finished () beautification. + +* Bugfix: grob-description.scm: Script::after_line_breaking -> +before_line_breaking. + +1.3.136.hwn1 +============ + +* Percent style repeats. + +* Named music creation: (ly-make-music "Note_req") + + 1.3.136.jcn2 ============ * Bugfix and small addition to convert-ly. @@ -11,9 +26,6 @@ Coriolan from 1143 to 283. Part combiner still gives rise to many foreseeable warnings. -1.3.136.jcn1 -============ - * Bugfix: install gettext.py into @datadir@/python and use that path from ly2dvi. Debian or RedHat installs could/should move gettext.py into /usr/share/lib/python/1.x/site-packages or so. @@ -43,6 +55,16 @@ editorial decisions dated 1936. Arguably, because most of these small changes can be found in other editions, some of which even are commonplace modernisations. +1.3.136.uu1 +=========== + +* Added noteheadtypes: "slash","triangle","xcircle" ; completed +noteheadtype "cross" ; added (ugly) tab-clef ; changed percussion +clef, fixed "repeat dots on even number of stafflines"-bug. (Rune +Zedeler) + +* Use complete version number for /var/lib/texmf/ paths. + 1.3.136 ======= diff --git a/Documentation/user/internals.itely b/Documentation/user/internals.itely index 3f37cc89b7..3664cef1c3 100644 --- a/Documentation/user/internals.itely +++ b/Documentation/user/internals.itely @@ -456,6 +456,10 @@ Get the property @var{sym} of music expression @var{m}. Set property @var{sym} in music expression @var{m} to @var{val}. @end defun +@defun ly-make-music name +Make a music object/expression of type @var{name}. Warning: this +interface will likely change in the near future. +@end defun @node Molecules @section Molecules diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 9dfeaf081a..fb6f39694e 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1320,9 +1320,8 @@ This is a short-cut for doing @end example You are encouraged to use @code{\repeat} for repetitions. See -@ref{Repeats}, and the documentation of @code{whichBar} in -@ref{(lilypond-internals)LilyPond context properties}. - +@ref{Repeats}, and the documentation of @code{whichBar} in the generated +docuemntation. [FIXME] @@ -1376,6 +1375,11 @@ practical for anything right now. @item tremolo Make tremolo beams. + +@item percent +Make measure repeats. These look like percent signs. + + @end table @menu @@ -1383,6 +1387,7 @@ Make tremolo beams. * Manual repeat commands:: * Tremolo repeats:: * Tremolo subdivision:: +* Measure repeats:: @end menu @node Repeat syntax @@ -1541,6 +1546,21 @@ default argument saves a lot of typing. +@node Measure repeats +@subsection Measure repeats + +@cindex percent repeats +@cindex measure repeats + +In the @code{percent} style, a note pattern can be repeated. It is +printed once, and then the pattern is replaced with a special sign. + +@lilypond[verbatim,singleline] + \context Voice { \repeat "percent" 5 { c'1 } } +@end lilypond + +At present, only repeats of whole measures are supported. + @c . {Piano music} @node Piano music diff --git a/VERSION b/VERSION index f21e2fd23d..7b236227d9 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=136 -MY_PATCH_LEVEL=jcn2 +MY_PATCH_LEVEL=jcn3 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/flower/axis.cc b/flower/axis.cc index 8814f7723e..0bf70a244e 100644 --- a/flower/axis.cc +++ b/flower/axis.cc @@ -13,26 +13,26 @@ String axis_name_str (Axis a) { - return to_str (char(a + 'x')); + return to_str (char (a + 'x')); } /* TODO inline these. */ Axis -post_incr(Axis &a) +post_incr (Axis &a) { - assert(a < NO_AXES); + assert (a < NO_AXES); Axis b= a; - a = Axis(int(a) + 1); + a = Axis (int (a) + 1); return b; } Axis -incr(Axis &a) +incr (Axis &a) { - assert(a < NO_AXES); - a = Axis(int(a) + 1); + assert (a < NO_AXES); + a = Axis (int (a) + 1); return a; } diff --git a/flower/binary-source-file.cc b/flower/binary-source-file.cc index a551244489..4cc1d02f5b 100644 --- a/flower/binary-source-file.cc +++ b/flower/binary-source-file.cc @@ -63,7 +63,7 @@ Binary_source_file::line_i (char const* pos_ch_C) const U8 Binary_source_file::get_U8 () { - return *(U8*)forward_ch_C (1); + return * (U8*)forward_ch_C (1); } @@ -80,7 +80,7 @@ Binary_source_file::get_U16 () U32 -Binary_source_file::get_U32() +Binary_source_file::get_U32 () { U32 b; diff --git a/flower/cpu-timer.cc b/flower/cpu-timer.cc index b61ea77ff1..56eee1a2ce 100644 --- a/flower/cpu-timer.cc +++ b/flower/cpu-timer.cc @@ -13,7 +13,7 @@ #ifdef CLK_TCK #define CLOCKS_PER_SEC CLK_TCK #elif defined _SC_CLK_TCK -#define CLOCKS_PER_SEC sysconf(_SC_CLK_TCK) +#define CLOCKS_PER_SEC sysconf (_SC_CLK_TCK) #else #error cannot determine CLOCKS_PER_SEC #endif @@ -34,5 +34,5 @@ Real Cpu_timer::read () { clock_t stop = clock (); - return (stop-start_clock_)/Real(CLOCKS_PER_SEC); + return (stop-start_clock_)/Real (CLOCKS_PER_SEC); } diff --git a/flower/data-file.cc b/flower/data-file.cc index 8339524cd0..9f4c16b115 100644 --- a/flower/data-file.cc +++ b/flower/data-file.cc @@ -15,27 +15,27 @@ #include "data-file.hh" void -Data_file::gobble_white() +Data_file::gobble_white () { char c; - while ((c=data_get()) == ' ' ||c == '\t') - if (eof_b()) + while ((c=data_get ()) == ' ' ||c == '\t') + if (eof_b ()) return; data_unget (c); } String -Data_file::get_word() +Data_file::get_word () {// should handle escape seq's String s; while (1) { - char c = data_get(); + char c = data_get (); - if (eof_b ()) + if (eof_b ()) break; if (isspace (c)) @@ -49,7 +49,7 @@ Data_file::get_word() { rawmode= true; - while ((c = data_get()) != '\"') + while ((c = data_get ()) != '\"') if (eof_b ()) error (_ ("EOF in a string")); else @@ -66,12 +66,12 @@ Data_file::get_word() } char -Data_file::data_get() +Data_file::data_get () { - char c = get(); + char c = get (); if (!rawmode && c == '#') // gobble comment { - while (!eof_b () && (c = get()) != '\n') + while (!eof_b () && (c = get ()) != '\n') ; return '\n'; } @@ -80,23 +80,23 @@ Data_file::data_get() } String -Data_file::get_line() +Data_file::get_line () { char c; String s; - while (!eof_b () && (c = data_get()) != '\n') + while (!eof_b () && (c = data_get ()) != '\n') s += to_str (c); return s; } void -Data_file::gobble_leading_white() +Data_file::gobble_leading_white () { // eat blank lines. while (!eof_b ()) { - char c = data_get(); + char c = data_get (); if (!isspace (c)) { data_unget (c); @@ -108,7 +108,7 @@ Data_file::gobble_leading_white() Data_file::Data_file (String s) : Text_stream (s) { - //*mlog << "(" << s << flush; + //*mlog << " (" << s << flush; rawmode= false; } diff --git a/flower/direction.cc b/flower/direction.cc index f28077dc85..797174755b 100644 --- a/flower/direction.cc +++ b/flower/direction.cc @@ -13,10 +13,10 @@ String direction_str (Direction d, Axis a) { - String s("center"); + String s ("center"); if (a == Y_AXIS) { - s =( d == UP ? "up" : "down"); + s = ( d == UP ? "up" : "down"); } else if (a == X_AXIS) { diff --git a/flower/dstream.cc b/flower/dstream.cc index abdd5c3db0..c157fe5049 100644 --- a/flower/dstream.cc +++ b/flower/dstream.cc @@ -57,13 +57,13 @@ Dstream::identify_as (String name) idx = cl; else { - (*silent_dict_p_)[idx] = default_silence_b_; + (*silent_dict_p_)[idx] = default_silence_b_; } local_silence_b_ = (*silent_dict_p_)[idx]; if (current_classname_str_ != idx && !local_silence_b_) { current_classname_str_=idx; - if (!(*silent_dict_p_)["Dstream"]) + if (! (*silent_dict_p_)["Dstream"]) *os_l_ << "[" << current_classname_str_ << ":]"; // messy. } return *this; @@ -81,28 +81,28 @@ Dstream::silent_b (String s) const } Dstream & -Dstream::operator<<(void const *v_l) +Dstream::operator<< (void const *v_l) { output (String_convert::pointer_str (v_l)); return *this; } Dstream & -Dstream::operator <<(String s) +Dstream::operator << (String s) { output (s); return *this; } Dstream & -Dstream::operator <<(const char * s) +Dstream::operator << (const char * s) { output (String (s)); return *this; } Dstream & -Dstream::operator <<(char c) +Dstream::operator << (char c) { output (to_str (c)); return *this; @@ -111,19 +111,19 @@ Dstream::operator <<(char c) Dstream& Dstream::operator << (Real r) { - output (to_str (r)); + output (to_str (r)); return *this; } Dstream & -Dstream::operator <<(Rational c) +Dstream::operator << (Rational c) { output (c.str ()); return *this; } Dstream & -Dstream::operator <<(int i) +Dstream::operator << (int i) { - output (to_str(i)); + output (to_str (i)); return *this; } @@ -148,7 +148,7 @@ Dstream::output (String s) indent_level_i_ -= INDTAB; *os_l_ << *cp ; - assert (indent_level_i_>=0) ; + assert (indent_level_i_>=0) ; break; case '\n': @@ -181,12 +181,12 @@ Dstream::Dstream (ostream *r, char const * cfg_nm) Text_db cfg (fn); while (!cfg.eof_b ()){ Text_record r (cfg++); - if (r.size() != 2) + if (r.size () != 2) { r.message (_ ("not enough fields in Dstream init")); continue; } - (*silent_dict_p_)[r[0]] = r[1] == "1"; + (*silent_dict_p_)[r[0]] = r[1] == "1"; } if ((*silent_dict_p_).elem_b ("Dstream_default_silence")) @@ -194,14 +194,14 @@ Dstream::Dstream (ostream *r, char const * cfg_nm) } -Dstream::~Dstream() +Dstream::~Dstream () { delete silent_dict_p_; assert (!indent_level_i_) ; } void -Dstream::clear_silence() +Dstream::clear_silence () { delete silent_dict_p_; silent_dict_p_ = 0; diff --git a/flower/file-path.cc b/flower/file-path.cc index f290b83628..b078fbc3b6 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -83,12 +83,12 @@ File_path::parse_path (String p) { int l; - while ( (l = p.length_i ()) ) + while ((l = p.length_i ()) ) { - int i = p.index_i(PATHSEP); + int i = p.index_i (PATHSEP); if (i <0) i = l; - add (p.left_str(i)); + add (p.left_str (i)); p = p.right_str (l- i - 1); } } @@ -107,13 +107,13 @@ String File_path::find (String nm) const { DEBUG_OUT << "looking for" << nm << ": "; - if (!nm.length_i() || (nm == "-") ) + if (!nm.length_i () || (nm == "-") ) return nm; - for (int i=0; i < size(); i++) + for (int i=0; i < size (); i++) { - String path = elem(i); + String path = elem (i); String sep = to_str (DIRSEP); - String right(path.right_str (1)); + String right (path.right_str (1)); if (path.length_i () && right != sep) path += to_str (DIRSEP); @@ -126,10 +126,10 @@ File_path::find (String nm) const Check if directory. TODO: encapsulate for autoconf */ struct stat sbuf; - if (stat (path.ch_C(), &sbuf) == ENOENT) + if (stat (path.ch_C (), &sbuf) == ENOENT) continue; - if (!(sbuf.st_mode & __S_IFREG)) + if (! (sbuf.st_mode & __S_IFREG)) continue; #endif #if !STAT_MACROS_BROKEN @@ -141,7 +141,7 @@ File_path::find (String nm) const continue; #endif - FILE *f = fopen (path.ch_C(), "r"); // ugh! + FILE *f = fopen (path.ch_C (), "r"); // ugh! if (f) { DEBUG_OUT << "found\n"; @@ -161,7 +161,7 @@ File_path::try_add (String s) { if (s == "") s = "."; - FILE * f = fopen (s.ch_C(), "r"); + FILE * f = fopen (s.ch_C (), "r"); if (!f) return false; fclose (f); diff --git a/flower/getopt-long.cc b/flower/getopt-long.cc index 22d5c05600..8e210efe20 100644 --- a/flower/getopt-long.cc +++ b/flower/getopt-long.cc @@ -27,7 +27,7 @@ gettext (char const* s) #endif long -Getopt_long::argument_to_i() +Getopt_long::argument_to_i () { long l; if (!optional_argument_ch_C_ @@ -38,7 +38,7 @@ Getopt_long::argument_to_i() } const Long_option_init * -Getopt_long::parselong() +Getopt_long::parselong () { char const *optnm = arg_value_ch_a_a_[array_index_i_] + 2 ; assert (*optnm); @@ -168,7 +168,7 @@ Getopt_long::report (Errorcod c) } const Long_option_init * -Getopt_long::parseshort() +Getopt_long::parseshort () { char c=arg_value_ch_a_a_[array_index_i_][argument_index_i_]; found_option_l_=0; @@ -212,17 +212,17 @@ Getopt_long::parseshort() } const Long_option_init * -Getopt_long::operator()() +Getopt_long::operator () () { - if (!ok()) + if (!ok ()) return 0; - next(); + next (); if (!ok ()) return 0; if (argument_index_i_) - return parseshort(); + return parseshort (); const char * argument_C = arg_value_ch_a_a_[array_index_i_]; @@ -231,7 +231,7 @@ Getopt_long::operator()() if (argument_C[1] == '-') {// what to do with "command -- bla" if (argument_C[2]) - return parselong(); + return parselong (); else return 0; } @@ -240,7 +240,7 @@ Getopt_long::operator()() if (argument_C[ 1 ]) { argument_index_i_ = 1; - return parseshort(); + return parseshort (); } else { @@ -268,13 +268,13 @@ Getopt_long::Getopt_long (int c, char **v, Long_option_init *lo) } bool -Getopt_long::ok() const +Getopt_long::ok () const { return array_index_i_ < argument_count_i_; } void -Getopt_long::next() +Getopt_long::next () { error_ = E_NOERROR; while (array_index_i_ < argument_count_i_ @@ -286,7 +286,7 @@ Getopt_long::next() } char const * -Getopt_long::current_arg() +Getopt_long::current_arg () { if (array_index_i_ >= argument_count_i_) return 0; @@ -295,9 +295,9 @@ Getopt_long::current_arg() } char const * -Getopt_long::get_next_arg() +Getopt_long::get_next_arg () { - char const * a = current_arg(); + char const * a = current_arg (); if (a) { array_index_i_ ++; diff --git a/flower/include/array.hh b/flower/include/array.hh index f8f6e352fd..4e9710c1e2 100644 --- a/flower/include/array.hh +++ b/flower/include/array.hh @@ -56,19 +56,19 @@ protected: public: /// check invariants - void OK() const ; + void OK () const ; /** report the size_. @see {setsize_} */ - int size() const + int size () const { return size_; } - /// POST: size() == 0 - void clear() + /// POST: size () == 0 + void clear () { size_ = 0; } @@ -80,7 +80,7 @@ public: arrcpy (array_p_, tp, n); } - Array() + Array () { array_p_ = 0; max_ =0; size_ =0; } // ugh, get around gcc 2.8.1 ice; see bezier.cc @@ -92,7 +92,7 @@ public: /** set the size_ to #s#. - POST: size() == s. + POST: size () == s. Warning: contents are unspecified */ void set_size (int s) { @@ -100,11 +100,11 @@ public: size_ = s; } - ~Array() + ~Array () { delete[] array_p_; } /// return a "new"ed copy of array - T* copy_array() const + T* copy_array () const { T* Tarray = new T[size_]; arrcpy (Tarray, array_p_, size_); @@ -115,19 +115,19 @@ public: { return array_p_; } - void operator=(Array const & src) + void operator= (Array const & src) { set_size (src.size_); arrcpy (array_p_,src.array_p_, size_); } Array (Array const & src) { - array_p_ = src.copy_array(); + array_p_ = src.copy_array (); max_ = size_ = src.size_; } /// tighten array size_. - void tighten_maxsize() { + void tighten_maxsize () { remax (size_); } @@ -161,16 +161,16 @@ public: if (size_ == max_) remax (2*max_ + 1); - // T::operator=(T &) is called here. Safe to use with automatic + // T::operator= (T &) is called here. Safe to use with automatic // vars array_p_[size_++] = x; } /// remove and return last entry - T pop() + T pop () { - assert (!empty()); + assert (!empty ()); T l = top (0); - set_size (size()-1); + set_size (size ()-1); return l; } /// access last entry @@ -205,8 +205,8 @@ public: void swap (int i,int j) { T t ((*this)[i]); - (*this)[i]=(*this)[j]; - (*this)[j]=t; + (*this)[i]= (*this)[j]; + (*this)[j]=t; } bool empty () const { return !size_; } @@ -223,8 +223,8 @@ public: } void unordered_del (int i) { - elem_ref (i) = top(); - set_size (size() -1); + elem_ref (i) = top (); + set_size (size () -1); } void del (int i) { @@ -233,7 +233,7 @@ public: size_--; } // quicksort. - void sort (int (*compare)(T const&,T const&), + void sort (int (*compare) (T const&,T const&), int lower = -1, int upper = -1); void concat (Array const &src) { @@ -242,7 +242,7 @@ public: arrcpy (array_p_+s,src.array_p_, src.size_); } Array slice (int lower, int upper) const; - void reverse(); + void reverse (); }; #include "array.icc" diff --git a/flower/include/array.icc b/flower/include/array.icc index 71de84a8ac..6ede38df66 100644 --- a/flower/include/array.icc +++ b/flower/include/array.icc @@ -49,7 +49,7 @@ Array::insert (T k, int j) } template INLINE void -Array::sort (int (*compare)(T const&,T const&), +Array::sort (int (*compare) (T const&,T const&), int lower = -1, int upper = -1) { if (lower < 0) @@ -79,7 +79,7 @@ Array::reverse () template INLINE void -Array::OK() const +Array::OK () const { assert (max_ >= size_ && size_ >=0); if (max_) assert (array_p_); diff --git a/flower/include/axes.hh b/flower/include/axes.hh index c863fdda1f..7293725c03 100644 --- a/flower/include/axes.hh +++ b/flower/include/axes.hh @@ -25,9 +25,9 @@ String axis_name_str (Axis); /** the operator ++ for Axis. */ -Axis post_incr(Axis &); -Axis incr(Axis &); -//Axis operator++(Axis); +Axis post_incr (Axis &); +Axis incr (Axis &); +//Axis operator++ (Axis); diff --git a/flower/include/compare.hh b/flower/include/compare.hh index ef69ce5162..328783c2e6 100644 --- a/flower/include/compare.hh +++ b/flower/include/compare.hh @@ -22,8 +22,8 @@ operator op (type t1, type t2)\ #if defined (__GNUG__) && ! defined (__STRICT_ANSI__) #define GPP_MINMAX(type, prefix)\ - prefix GPP_MINMAX_OPERATOR(type, ?, >) + prefix GPP_MINMAX_OPERATOR (type, ?, >) #else #define GPP_MINMAX(type, prefix) #endif @@ -33,21 +33,21 @@ operator op (type t1, type t2)\ Please fill a & in the type argument if necessary. */ #define TEMPLATE_INSTANTIATE_COMPARE(type, function, prefix) \ -prefix ONE_OPERATOR(type, function, >)\ -prefix ONE_OPERATOR(type, function, >=)\ -prefix ONE_OPERATOR(type, function, ==)\ -prefix ONE_OPERATOR(type, function, !=)\ -prefix ONE_OPERATOR(type, function, <)\ -prefix ONE_OPERATOR(type, function, <=)\ -GPP_MINMAX(type, prefix)\ +prefix ONE_OPERATOR (type, function, >)\ +prefix ONE_OPERATOR (type, function, >=)\ +prefix ONE_OPERATOR (type, function, ==)\ +prefix ONE_OPERATOR (type, function, !=)\ +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 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,) +#define INSTANTIATE_COMPARE(type, func) TEMPLATE_INSTANTIATE_COMPARE (type,func,) diff --git a/flower/include/cons.hh b/flower/include/cons.hh index a2ebc352d7..81161dd5ce 100644 --- a/flower/include/cons.hh +++ b/flower/include/cons.hh @@ -40,7 +40,7 @@ class Killing_cons : public Cons { public: Killing_cons (T *t, Cons *p) - : Cons( t,p) + : Cons ( t,p) { } virtual ~Killing_cons (); @@ -60,7 +60,7 @@ Cons *remove_cons (Cons **pp) template int cons_list_size_i (Cons *l) { int i=0; - while (l) + while (l) { l = l->next_; i++; @@ -86,7 +86,7 @@ Cons * last_cons (Cons * head) Invariants: - (*tail_) is either the head_ pointer, or a next_ pointer from the list. + (*tail_) is either the head_ pointer, or a next_ pointer from the list. **tail_ == NULL */ @@ -115,7 +115,7 @@ public: assert (!c->next_); *nil_pointer_address_ = c; while (*nil_pointer_address_) - nil_pointer_address_ = &(*nil_pointer_address_)->next_; + nil_pointer_address_ = & (*nil_pointer_address_)->next_; } /** PRE: *pp should either be the head_ pointer, or the next_ pointer @@ -123,7 +123,7 @@ public: */ Cons *remove_cons (Cons **pp) { - if (&(*pp)->next_ == nil_pointer_address_) + if (& (*pp)->next_ == nil_pointer_address_) nil_pointer_address_ = pp; return ::remove_cons (pp); @@ -133,7 +133,7 @@ public: void truncate (int i) { Cons **p = &head_; - for (; *p && i; p = &((*p)->next_)) + for (; *p && i; p = & ((*p)->next_)) { i--; } diff --git a/flower/include/data-file.hh b/flower/include/data-file.hh index 9ca3a0cbfb..797765c90b 100644 --- a/flower/include/data-file.hh +++ b/flower/include/data-file.hh @@ -27,24 +27,24 @@ public: Get a char. Only class member who uses text_file::get */ - char data_get(); + char data_get (); void data_unget (char c) { unget (c); } /// read line, eat #\n# - String get_line(); + String get_line (); /// read a word till next space, leave space. Also does quotes - String get_word(); + String get_word (); /// gobble horizontal white stuff. - void gobble_white(); + void gobble_white (); /// gobble empty stuff before first field. - void gobble_leading_white(); + void gobble_leading_white (); Data_file (String); - ~Data_file(); + ~Data_file (); /** eat complete file @post diff --git a/flower/include/dictionary.hh b/flower/include/dictionary.hh index f7eb8affce..464bfa1323 100644 --- a/flower/include/dictionary.hh +++ b/flower/include/dictionary.hh @@ -19,7 +19,6 @@ unsigned int string_hash (String); - template struct Dict_initialiser { @@ -42,7 +41,7 @@ public: { hash_func_ = string_hash; for (Dict_initialiser *q = p; q->key_; q++) - (*this) [q->key_] = q->value_; + (*this) [q->key_] = q->value_; } bool elem_b (String s) diff --git a/flower/include/direction.hh b/flower/include/direction.hh index 2e18ff2a49..902f2fa2b8 100644 --- a/flower/include/direction.hh +++ b/flower/include/direction.hh @@ -30,7 +30,7 @@ enum Direction inline Direction other_dir (Direction const d) { - return (Direction)(-d); + return (Direction) (-d); } inline Direction diff --git a/flower/include/drul-array.hh b/flower/include/drul-array.hh index 75f9861195..4e193667f0 100644 --- a/flower/include/drul-array.hh +++ b/flower/include/drul-array.hh @@ -24,7 +24,7 @@ struct Drul_array T &elem (Direction d) { assert (d==1 || d== -1); - return array_[(d+1)/2]; + return array_[ (d+1)/2]; } T &operator[] (Direction d) @@ -34,10 +34,10 @@ struct Drul_array T elem (Direction d) const { assert (d==1 || d== -1); - return array_[(d+1)/2]; + return array_[ (d+1)/2]; } - T operator[] (Direction d) const + T operator[] (Direction d) const { return elem (d); } diff --git a/flower/include/dstream.hh b/flower/include/dstream.hh index 0f1c100796..92111fbfb1 100644 --- a/flower/include/dstream.hh +++ b/flower/include/dstream.hh @@ -16,7 +16,7 @@ const char eol= '\n'; /** Debug stream. a class for providing debug output of nested structures, - with indents according to \{\}()[]. + with indents according to \{\} ()[]. One can turn on and off specific messages using the Assoc silent. This can be done automatically: @@ -43,14 +43,14 @@ class Dstream Dictionary *silent_dict_p_; public: - void clear_silence(); + void clear_silence (); bool silent_b (String) const; /** if rcfile == 0, then do not read any rc file. */ Dstream (ostream *r, char const * rcfile); - virtual ~Dstream(); + virtual ~Dstream (); Dstream &identify_as (String s); diff --git a/flower/include/flower-proto.hh b/flower/include/flower-proto.hh index cad9bff1f2..d946063901 100644 --- a/flower/include/flower-proto.hh +++ b/flower/include/flower-proto.hh @@ -9,7 +9,7 @@ #define FPROTO_HH -char const * flower_version_sz(); +char const * flower_version_sz (); template struct Link_array; template struct Array; diff --git a/flower/include/getopt-long.hh b/flower/include/getopt-long.hh index 92de4934dc..887a1a3709 100644 --- a/flower/include/getopt-long.hh +++ b/flower/include/getopt-long.hh @@ -71,18 +71,18 @@ public: public: /// get ready for processing next error. - void next(); - const Long_option_init *parselong(); - const Long_option_init *parseshort(); - void OK() const; - bool ok() const; + void next (); + const Long_option_init *parselong (); + const Long_option_init *parseshort (); + void OK () const; + bool ok () const; /// report an error and abort void report (Errorcod c); /// return an integer (with err. detect) - long argument_to_i(); + long argument_to_i (); /** @@ -100,10 +100,10 @@ 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(); + char const *current_arg (); + char const * get_next_arg (); }; #endif // GETOPT_LONG_HH diff --git a/flower/include/hash-table-iter.hh b/flower/include/hash-table-iter.hh index 61b4a34973..ee84098251 100644 --- a/flower/include/hash-table-iter.hh +++ b/flower/include/hash-table-iter.hh @@ -17,10 +17,10 @@ class Hash_table_iter Hash_table *dict_l_; int i; public: - Hash_table_iter(Hash_table const &dict) + Hash_table_iter (Hash_table const &dict) { i = 0; - dict_l_ =(Hash_table *) & dict; + dict_l_ = (Hash_table *) & dict; next_used (); } @@ -36,7 +36,7 @@ public: i ++; } } - void operator ++(int) + void operator ++ (int) { i++; next_used (); diff --git a/flower/include/hash-table.hh b/flower/include/hash-table.hh index f3f5bfe234..8cc51f2e1b 100644 --- a/flower/include/hash-table.hh +++ b/flower/include/hash-table.hh @@ -28,7 +28,7 @@ struct Hash_table_entry V value_; bool free_b_; - Hash_table_entry() { + Hash_table_entry () { free_b_ = true; } Hash_table_entry (K s, V v) @@ -55,12 +55,12 @@ public: Fixed_size_hash_table (int size_idx) { size_idx_ = size_idx; - int sz = prime_list(size_idx_); + int sz = prime_list (size_idx_); dict_arr_.set_size (sz); } /// find #s#, or find first empty entry corresponding to #s# - int lookup (K s, unsigned int initial_hash) + int lookup (K s, unsigned int initial_hash) { int sz =dict_arr_.size (); initial_hash = initial_hash % sz; @@ -102,13 +102,13 @@ class Hash_table { Fixed_size_hash_table *f = new Fixed_size_hash_table (fixed_p_->size_idx_ +1); - for (int i=0; i < fixed_p_->dict_arr_.size(); i++) + for (int i=0; i < fixed_p_->dict_arr_.size (); i++) { if (fixed_p_->dict_arr_[i].free_b_) continue; K nm (fixed_p_->dict_arr_[i].key_); - unsigned int h = (*hash_func_)(nm); + unsigned int h = (*hash_func_) (nm); int nl = f->lookup (nm, h); f->dict_arr_[nl] = Hash_table_entry (nm, fixed_p_->dict_arr_[i].value_); @@ -149,7 +149,7 @@ public: } bool elem_b (K s) const { - int l = fixed_p_->lookup (s, (*hash_func_)(s)); + int l = fixed_p_->lookup (s, (*hash_func_) (s)); return (l >= 0 && !fixed_p_->dict_arr_[l].free_b_) ; } @@ -160,7 +160,7 @@ public: V& elem (K s) { int l; - unsigned int h = (*hash_func_)(s); + unsigned int h = (*hash_func_) (s); while ((l= fixed_p_->lookup (s,h)) <0) { enlarge (); @@ -172,7 +172,7 @@ public: } bool try_retrieve (K k, V *v) { - int l = fixed_p_->lookup (k, (*hash_func_)(k)); + int l = fixed_p_->lookup (k, (*hash_func_) (k)); if (l < 0 || fixed_p_->dict_arr_[l].free_b_) return false; else @@ -204,11 +204,11 @@ public: V remove (K s) { - return fixed_p_->remove (s, (*hash_func_)(s)); + return fixed_p_->remove (s, (*hash_func_) (s)); } friend class Hash_table_iter; public: - unsigned int (*hash_func_)(K); + unsigned int (*hash_func_) (K); }; diff --git a/flower/include/interval.hh b/flower/include/interval.hh index b526673298..849a76e8e8 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -14,7 +14,7 @@ /** a T interval. this represents the closed interval [left,right]. No invariants. T must be a totally ordered ring (with division, anyway ..) - At instantiation, the function infinity() has to be defined explicitely. + At instantiation, the function infinity () has to be defined explicitely. */ template @@ -22,9 +22,9 @@ struct Interval_t : public Drul_array { /* ************** */ - static T infinity() ; + static T infinity () ; static String T_to_str (T arg); - T center() { return (elem (LEFT) + elem (RIGHT)) / T(2);} + T center () { return (elem (LEFT) + elem (RIGHT)) / T (2);} void translate (T t) { elem (LEFT) += t; @@ -38,12 +38,12 @@ struct Interval_t : public Drul_array { void unite (Interval_t h); void intersect (Interval_t h); - T length() const; - void set_empty() ; - bool empty_b() const { return elem (LEFT) > elem (RIGHT); } + T length () const; + void set_empty () ; + bool empty_b () const { return elem (LEFT) > elem (RIGHT); } bool contains_b (Interval_t const&) const; - Interval_t() { - set_empty(); + Interval_t () { + set_empty (); } Interval_t (T m, T M) : Drul_array (m,M) {} @@ -57,12 +57,12 @@ struct Interval_t : public Drul_array { elem (RIGHT) +=r; return *this; } - Interval_t &operator *=(T r) { + Interval_t &operator *= (T r) { if (!empty_b ()) { elem (LEFT) *= r; elem (RIGHT) *= r; - if (r < T(0)) { + if (r < T (0)) { T t = elem (LEFT); elem (LEFT) = elem (RIGHT); elem (RIGHT) = t; @@ -72,9 +72,9 @@ struct Interval_t : public Drul_array { } Real linear_combination (Real x) const { - return ((1.0 - x) * Real (elem (LEFT)) + (x + 1.0) * Real (elem(RIGHT))) * 0.5; + return ((1.0 - x) * Real (elem (LEFT)) + (x + 1.0) * Real (elem (RIGHT))) * 0.5; } - String str() const; + String str () const; void print () const; bool elem_b (T r); void negate () { @@ -106,7 +106,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 @@ -120,7 +120,7 @@ intersection (Interval_t a, Interval_t const&b) template inline -Interval_t operator +(T a,Interval_t i) +Interval_t operator + (T a,Interval_t i) { i += a; return i; @@ -145,13 +145,13 @@ 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; @@ -159,7 +159,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){ return a*i; } diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index 7c51bd18f3..ab7ab1410e 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -62,15 +62,15 @@ Interval__compare (const Interval_t&a,Interval_t const&b) template void -Interval_t::set_empty() +Interval_t::set_empty () { - elem (LEFT) = (T) infinity(); - elem (RIGHT) = (T) -infinity(); + elem (LEFT) = (T) infinity (); + elem (RIGHT) = (T) -infinity (); } template T -Interval_t::length() const +Interval_t::length () const { if (elem (RIGHT) < elem (LEFT)) return 0; @@ -120,9 +120,9 @@ intersect (Interval_t x, Interval_t const &y) template String -Interval_t::str() const +Interval_t::str () const { - if (empty_b()) + if (empty_b ()) return "[empty]"; String s ("["); @@ -138,6 +138,6 @@ Interval_t::elem_b (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 f6fcff7bd1..c29989c58e 100644 --- a/flower/include/killing-cons.tcc +++ b/flower/include/killing-cons.tcc @@ -24,7 +24,7 @@ copy_killing_cons_list (Cons_list &dest, Cons *src) { for (; src; src = src->next_) { - T *t = new T(*src->car_); + T *t = new T (*src->car_); dest.append ( new Killing_cons (t, 0)); } } diff --git a/flower/include/offset.hh b/flower/include/offset.hh index b9d7fae509..ad0134651e 100644 --- a/flower/include/offset.hh +++ b/flower/include/offset.hh @@ -25,16 +25,16 @@ struct 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) { - (*this)[X_AXIS] += o[X_AXIS]; - (*this)[Y_AXIS] += o[Y_AXIS]; + Offset& operator+= (Offset o) { + (*this)[X_AXIS] += o[X_AXIS]; + (*this)[Y_AXIS] += o[Y_AXIS]; return *this; } Offset operator - () const { @@ -44,22 +44,22 @@ public: o[Y_AXIS] = - o[Y_AXIS]; return o; } - Offset& operator-=(Offset o) { - (*this)[X_AXIS] -= o[X_AXIS]; - (*this)[Y_AXIS] -= o[Y_AXIS]; + Offset& operator-= (Offset o) { + (*this)[X_AXIS] -= o[X_AXIS]; + (*this)[Y_AXIS] -= o[Y_AXIS]; return *this; } Offset &scale (Offset o) { - (*this)[X_AXIS] *= o[X_AXIS]; - (*this)[Y_AXIS] *= o[Y_AXIS]; + (*this)[X_AXIS] *= o[X_AXIS]; + (*this)[Y_AXIS] *= o[Y_AXIS]; return *this; } - Offset &operator *=(Real a) { - (*this)[X_AXIS] *= a; - (*this)[Y_AXIS] *= a; + Offset &operator *= (Real a) { + (*this)[X_AXIS] *= a; + (*this)[Y_AXIS] *= a; return *this; } @@ -68,7 +68,7 @@ public: coordinate_a_[X_AXIS] =ix; coordinate_a_[Y_AXIS] =iy; } - Offset() { + Offset () { coordinate_a_[X_AXIS]= coordinate_a_[Y_AXIS]= 0.0; @@ -79,16 +79,16 @@ public: void mirror (Axis); 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, +); -IMPLEMENT_ARITHMETIC_OPERATOR(Offset, -); -IMPLEMENT_ARITHMETIC_OPERATOR(Offset, *); +IMPLEMENT_ARITHMETIC_OPERATOR (Offset, +); +IMPLEMENT_ARITHMETIC_OPERATOR (Offset, -); +IMPLEMENT_ARITHMETIC_OPERATOR (Offset, *); inline Offset operator* (Real o1, Offset o2) diff --git a/flower/include/parray.hh b/flower/include/parray.hh index 41099671d6..52399b1718 100644 --- a/flower/include/parray.hh +++ b/flower/include/parray.hh @@ -34,10 +34,10 @@ class Link_array : private Array { } public: - Link_array() + Link_array () {} - Link_array(T * const *tp, int n) + Link_array (T * const *tp, int n) : Array ((void **)tp, n) { } @@ -51,7 +51,7 @@ public: { return elem_ref (i); } - T *&elem_ref (int i) const + T *&elem_ref (int i) const { return (T*&) Array::elem_ref (i); } @@ -107,16 +107,16 @@ public: } } - void default_sort() { + void default_sort () { sort (default_compare); } // quicksort. - void sort (int (*compare)(T *const&,T *const&), + void sort (int (*compare) (T *const&,T *const&), int lower = -1, int upper = -1); - void uniq() { + void uniq () { Link_array l_arr; - for (int i=0; i < size(); i++) + for (int i=0; i < size (); i++) if (!i || elem (i-1) != elem (i)) l_arr.push (elem (i)); *this = l_arr; @@ -150,14 +150,14 @@ public: T ** access_array () const { - return (T**) Array::access_array(); + return (T**) Array::access_array (); } T * get (int i) { return (T*) Array::get (i); } Link_array - slice(int l,int u) + slice (int l,int u) { return Array::slice (l,u); } @@ -166,7 +166,7 @@ public: Array::concat (a2); } int find_i (T const * t) const { - for (int i=0; i < size(); i++) + for (int i=0; i < size (); i++) if (elem (i) == t) return i; return -1; @@ -195,7 +195,7 @@ typecast_array (Link_array const &a, T * /* dummy */ ) template inline void -Link_array::sort (int (*compare)(T *const&,T *const&), +Link_array::sort (int (*compare) (T *const&,T *const&), int lower = -1, int upper = -1) { if (lower < 0) @@ -208,7 +208,7 @@ Link_array::sort (int (*compare)(T *const&,T *const&), swap (lower, (lower+upper)/2); int last = lower; for (int i= lower +1; i <= upper; i++) - if (compare (elem (i), elem(lower)) < 0) + if (compare (elem (i), elem (lower)) < 0) swap (++last,i); swap (lower, last); sort (compare, lower, last-1); @@ -233,7 +233,7 @@ junk_pointer_array (Link_array &a) */ template int -binsearch_array (Array const &arr, T t, int (*compare)(T const&,T const&)) +binsearch_array (Array const &arr, T t, int (*compare) (T const&,T const&)) { int lo; int hi; @@ -265,14 +265,14 @@ binsearch_array (Array const &arr, T t, int (*compare)(T const&,T const&)) template int binsearch_link_array (Link_array const &arr, T *t, - int (*compare)(T *const&,T *const&)) + int (*compare) (T *const&,T *const&)) { int lo; int hi; int cmp; int result; lo = 0; - hi = arr.size(); + hi = arr.size (); if (hi == 0) return -1; diff --git a/flower/include/parse-afm.hh b/flower/include/parse-afm.hh index d2384f612e..51b43b3e1f 100644 --- a/flower/include/parse-afm.hh +++ b/flower/include/parse-afm.hh @@ -105,12 +105,16 @@ /* Commonly used flags */ -#define P_GW (P_G | P_W) -#define P_GM (P_G | P_M) -#define P_GMP (P_G | P_M | P_P) -#define P_GMK (P_G | P_M | P_P | P_T) -#define P_GALL (P_G | P_M | P_P | P_T | P_C) - +#define P_GW\ + (P_G | P_W) +#define P_GM\ + (P_G | P_M) +#define P_GMP\ + (P_G | P_M | P_P) +#define P_GMK\ + (P_G | P_M | P_P | P_T) +#define P_GALL\ + (P_G | P_M | P_P | P_T | P_C) /* Possible return codes from the parseFile procedure. @@ -311,7 +315,7 @@ typedef struct * "fp" should be a valid file pointer to an AFM file. * * "fi" is a pointer to a pointer to a FontInfo record sturcture - * (defined above). Storage for the FontInfo structure will be + * (defined above). Storage for the FontInfo structure will be * allocated in parseFile and the structure will be filled in * with the requested data from the AFM File. * diff --git a/flower/include/pointer.hh b/flower/include/pointer.hh index 850ec18348..5ff3582712 100644 --- a/flower/include/pointer.hh +++ b/flower/include/pointer.hh @@ -31,25 +31,25 @@ class P { /** junk contents and set to 0 */ - void junk(); + void junk (); public: - P(P const &src); + P (P const &src); /** Remove the pointer, and return it. */ - T *get_p() { T*p = t_p; t_p=0; return p; } + T *get_p () { T*p = t_p; t_p=0; return p; } /** return the pointer */ - T *get_l() { return t_p; } + T *get_l () { return t_p; } - T const *get_C() const { return t_p; } + T const *get_C () const { return t_p; } /** copy the contents of pointer, and return it */ - T *copy_p() const; + T *copy_p () const; /** swallow new_p, and set contents t new_p */ @@ -59,17 +59,17 @@ public: */ void set_l (T const *t_C); - P &operator =(P const &); - ~P(); - P() { t_p = 0; } - //P(T *p) { t_p = p; } + P &operator = (P const &); + ~P (); + P () { t_p = 0; } + //P (T *p) { t_p = p; } - T *operator ->() { return t_p; } - operator T *() { return t_p; } - const T *operator ->() const { return t_p ; } - T &operator *() { return *t_p; } - T const &operator *() const { return *t_p; } - operator const T *() const { return t_p; } + T *operator -> () { return t_p; } + operator T * () { return t_p; } + const T *operator -> () const { return t_p ; } + T &operator * () { return *t_p; } + T const &operator * () const { return *t_p; } + operator const T * () const { return t_p; } }; #endif // POINTER_HH diff --git a/flower/include/pointer.tcc b/flower/include/pointer.tcc index 318b5b1437..cd4aac565e 100644 --- a/flower/include/pointer.tcc +++ b/flower/include/pointer.tcc @@ -13,9 +13,9 @@ template inline T * -P::copy_p() const +P::copy_p () const { - return t_p? new T(*t_p) : 0; + return t_p? new T (*t_p) : 0; } template @@ -23,13 +23,13 @@ inline void P::copy (T const *l_C) { - t_p = l_C ? new T(*l_C) : 0; + t_p = l_C ? new T (*l_C) : 0; } template inline void -P::junk() +P::junk () { delete t_p; t_p =0; @@ -37,25 +37,25 @@ P::junk() template inline -P::P(P const &s) +P::P (P const &s) { - t_p = s.copy_p(); + t_p = s.copy_p (); } template inline P & -P::operator =(P const&s) +P::operator = (P const&s) { - junk(); + junk (); copy (s.t_p); return *this; } template inline -P::~P() { - junk(); +P::~P () { + junk (); } template @@ -79,7 +79,7 @@ P::set_l (T const * l_C) if (t_p == l_C) return; - junk(); + junk (); copy (l_C); } diff --git a/flower/include/polynomial.hh b/flower/include/polynomial.hh index df79274bdc..b978910caf 100644 --- a/flower/include/polynomial.hh +++ b/flower/include/polynomial.hh @@ -22,52 +22,52 @@ struct Polynomial Array coefs_; // leading coef - Real &lc(); + Real &lc (); // leading coef - Real lc() const; - void print() const ; - Real eval(Real) const ; - void print_sols(Array) const ; - void check_sols(Array) const ; - void check_sol(Real x) const; - static Polynomial multiply(const Polynomial & p1, const Polynomial & p2); - static Polynomial power(int exponent, const Polynomial & src); + Real lc () const; + void print () const ; + Real eval (Real) const ; + void print_sols (Array) const ; + void check_sols (Array) const ; + void check_sol (Real x) const; + static Polynomial multiply (const Polynomial & p1, const Polynomial & p2); + static Polynomial power (int exponent, const Polynomial & src); /// chop low coefficients - void clean(); + void clean (); /// eliminate #x# close to zero - void real_clean(); - static Polynomial add(const Polynomial & p1, const Polynomial & p2); - void scalarmultiply(Real fact); - void operator *= (Real f) { scalarmultiply(f); } - void operator /= (Real f) { scalarmultiply(1/f); } + void real_clean (); + static Polynomial add (const Polynomial & p1, const Polynomial & p2); + 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); Polynomial (){} - static Polynomial subtract(const Polynomial & p1, const Polynomial & p2); - void set_negate(const Polynomial & src); + static Polynomial subtract (const Polynomial & p1, const Polynomial & p2); + void set_negate (const Polynomial & src); /// take the derivative - void differentiate(); - int set_mod(const Polynomial &u, const Polynomial &v); + void differentiate (); + int set_mod (const Polynomial &u, const Polynomial &v); - void debug_clean(); + void debug_clean (); - Array solve_quadric()const; - Array solve_cubic()const; - Array solve_linear()const; + Array solve_quadric ()const; + Array solve_cubic ()const; + Array solve_linear ()const; Array solve () const; }; -IMPLEMENT_ARITHMETIC_OPERATOR(Polynomial, - ); -IMPLEMENT_ARITHMETIC_OPERATOR(Polynomial, + ); -IMPLEMENT_ARITHMETIC_OPERATOR(Polynomial, * ); +IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, - ); +IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, + ); +IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, * ); inline Polynomial operator * (Polynomial p, Real a) diff --git a/flower/include/pqueue.hh b/flower/include/pqueue.hh index 1661bff73c..4ccd72d176 100644 --- a/flower/include/pqueue.hh +++ b/flower/include/pqueue.hh @@ -30,7 +30,7 @@ int compare (PQueue_ent const &e1 , PQueue_ent const &e2) { Hungarian postfix pq TODO: add increase/decrease operations, - add max() operation + add max () operation */ template class PQueue { @@ -45,21 +45,21 @@ public: /** acces an heap element. Careful with this, as changing the priority might fuck up the invariants - @param 1 <= i < size() */ - T& operator[](int i) { return heap_arr_[i]; } - T operator[](int i) const { return heap_arr_[i]; } - void OK() const + @param 1 <= i < size () */ + T& operator[] (int i) { return heap_arr_[i]; } + T operator[] (int i) const { return heap_arr_[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 } - T front() const { return elt (1); } - int size() const { return heap_arr_.size (); } + T front () const { return elt (1); } + int size () const { return heap_arr_.size (); } void insert (T v) { heap_arr_.push (v); - int i = heap_arr_.size(); + int i = heap_arr_.size (); int j = i / 2 ; while (j) { if (compare (elt (j), v) > 0) { @@ -71,21 +71,21 @@ public: } } elt (i) = v; - OK(); + OK (); } - T max() const { - //int first_leaf_i = size(); + T max () const { + //int first_leaf_i = size (); T max_t; return max_t; } - void delmin() { - assert (size()); - T last = heap_arr_.top(); + void delmin () { + assert (size ()); + T last = heap_arr_.top (); int mini=2; int lasti=1; - while (mini < size()) { + while (mini < size ()) { if (compare (elt (mini + 1), elt (mini)) <0) mini++; if (compare (last,elt (mini)) < 0) @@ -95,12 +95,12 @@ public: mini *= 2; } elt (lasti) = last; - heap_arr_.pop(); - OK(); + heap_arr_.pop (); + OK (); } - T get() { - T t = front(); - delmin(); + T get () { + T t = front (); + delmin (); return t; } }; diff --git a/flower/include/rational.hh b/flower/include/rational.hh index 69a9ab1bd2..e095f58710 100644 --- a/flower/include/rational.hh +++ b/flower/include/rational.hh @@ -37,10 +37,10 @@ public: void set_infinite (int sign); bool infty_b () const; void invert (); - int num () const { return sign_ * num_; } - int den () const { return den_; } - int num_i () const { return sign_ * num_; } - int den_i () const { return den_; } + int num () const { return sign_ * num_; } + int den () const { return den_; } + int num_i () const { return sign_ * num_; } + int den_i () const { return den_; } Rational trunc_rat () const; Rational div_rat (Rational) const; Rational mod_rat (Rational) const; diff --git a/flower/include/real.hh b/flower/include/real.hh index 73131dd7d3..58d3f95365 100644 --- a/flower/include/real.hh +++ b/flower/include/real.hh @@ -24,7 +24,7 @@ template inline T abs (T x) template inline int sign (T x) { if (x) - return x > T(0) ? 1 : -1; + return x > T (0) ? 1 : -1; return 0; } diff --git a/flower/include/source.hh b/flower/include/source.hh index 20ebdb02f3..58192e812c 100644 --- a/flower/include/source.hh +++ b/flower/include/source.hh @@ -18,7 +18,7 @@ class Sources Sources (Sources const&) {} public: Sources (); - ~Sources(); + ~Sources (); Source_file * get_file_l (String &filename ); Source_file* sourcefile_l (char const* ch_C ); diff --git a/flower/include/string-convert.hh b/flower/include/string-convert.hh index a96b81b234..1ae7460df7 100644 --- a/flower/include/string-convert.hh +++ b/flower/include/string-convert.hh @@ -13,7 +13,7 @@ /** The functor String_convert handles all conversions to/from String - (some time, anyway). The class is quite empty from data view. */ + (some time, anyway). The class is quite empty from data view. */ class String_convert { static int hex2bin_i (String hex_str, String& bin_str_r); static int hex2nibble_i (Byte byte); diff --git a/flower/include/string-data.hh b/flower/include/string-data.hh index 38670869cd..764dd8f0cd 100644 --- a/flower/include/string-data.hh +++ b/flower/include/string-data.hh @@ -25,12 +25,12 @@ friend class String_handle; int references; /// init to "" - String_data(); + String_data (); /// init from src. Conservative allocation. String_data (String_data const &src); - ~String_data(); + ~String_data (); /** POST: maxlen >= j. @param j, maximum stringlength_i_. @@ -45,13 +45,13 @@ friend class String_handle; void remax (int j); /// check if writeable. - void OKW(); + void OKW (); /// check state. - void OK(); + void OK (); /// reduce memory usage. - void tighten(); + void tighten (); // assignment. void set (Byte const* byte_C, int length_i); @@ -63,22 +63,22 @@ friend class String_handle; void operator += (char const* ch_C); - char const* ch_C() const; + char const* ch_C () const; - char* ch_l(); + char* ch_l (); - Byte const* byte_C() const; + Byte const* byte_C () const; // idem, non const - Byte* byte_l(); + Byte* byte_l (); void trunc (int j); /** access element. not really safe. Can alter length_i_ without #String_data# knowing it. */ - Byte &operator [](int j); - Byte operator [](int j) const; - bool is_binary_bo() 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 f15434331a..73a8b9c671 100644 --- a/flower/include/string-data.icc +++ b/flower/include/string-data.icc @@ -18,13 +18,13 @@ const int INITIALMAX=8; #include INLINE void -String_data::OKW() +String_data::OKW () { assert (references == 1); } INLINE void -String_data::OK() +String_data::OK () { assert (maxlen >= length_i_); assert (bool (data_byte_p_)); @@ -33,7 +33,7 @@ String_data::OK() INLINE -String_data::String_data() +String_data::String_data () { references=0; maxlen = INITIALMAX; @@ -52,7 +52,7 @@ String_data::String_data (String_data const &src) } INLINE -String_data::~String_data() +String_data::~String_data () { assert (references == 0); delete[] data_byte_p_; @@ -61,7 +61,7 @@ String_data::~String_data() INLINE void String_data::setmax (int j) { - OKW(); + OKW (); if (j > maxlen) { delete data_byte_p_; @@ -85,7 +85,7 @@ String_data::setmax (int j) INLINE void String_data::remax (int j) { - OKW(); + OKW (); if (j > maxlen) { Byte *p = new Byte[j + 1]; @@ -97,7 +97,7 @@ String_data::remax (int j) } INLINE void -String_data::tighten() +String_data::tighten () { // should be dec'd const maxlen = length_i_; Byte *p = new Byte[maxlen + 1]; @@ -109,7 +109,7 @@ String_data::tighten() INLINE void String_data::set (Byte const* byte_C, int length_i) { - OKW(); + OKW (); assert (byte_C && byte_C != data_byte_p_); @@ -131,8 +131,8 @@ String_data::set (char const* ch_C) INLINE void String_data::append (Byte const* byte_C, int length_i) { - OK(); - OKW(); + OK (); + OKW (); int old_i = length_i_; length_i_ += length_i; @@ -152,26 +152,26 @@ String_data::operator += (char const* ch_C) INLINE char const* -String_data::ch_C() const +String_data::ch_C () const { return (char const*)data_byte_p_; } INLINE char* -String_data::ch_l() +String_data::ch_l () { return (char*)data_byte_p_; } INLINE Byte const* -String_data::byte_C() const +String_data::byte_C () const { return data_byte_p_; } INLINE Byte* -String_data::byte_l() +String_data::byte_l () { - OKW(); + OKW (); return data_byte_p_; } @@ -179,28 +179,28 @@ INLINE void String_data::trunc (int j) { - OKW(); + OKW (); assert (j >= 0 && j <= length_i_); data_byte_p_[j] = 0; length_i_ = j; } INLINE bool -String_data::is_binary_bo() const +String_data::is_binary_bo () const { // return !memchr (data_byte_p_, length_i_, 0); return ((int)strlen ((char const*)data_byte_p_) != length_i_ ); } INLINE Byte& -String_data::operator [](int j) +String_data::operator [] (int j) { assert (j >= 0 && j <= length_i_); return data_byte_p_[j] ; } INLINE Byte -String_data::operator [](int j) const +String_data::operator [] (int j) const { assert (j >= 0 && j <= length_i_); return data_byte_p_[j]; diff --git a/flower/include/string-handle.hh b/flower/include/string-handle.hh index f74977cfbb..610531cf1e 100644 --- a/flower/include/string-handle.hh +++ b/flower/include/string-handle.hh @@ -24,7 +24,7 @@ class String_handle { String_data* data; /// decrease ref count. Named kind of like a Tanenbaum semafore - void down(); + void down (); /// increase ref count void up (String_data *d); @@ -32,31 +32,31 @@ class String_handle { /** make sure data has only one reference. POST: data->references == 1 */ - void copy(); + void copy (); public: - String_handle(); - ~String_handle(); + String_handle (); + ~String_handle (); String_handle (String_handle const & src); - Byte const* byte_C() const; - char const* ch_C() const; - Byte* byte_l(); - char* ch_l(); - bool is_binary_bo() const; - void operator =(String_handle const &src); + Byte const* byte_C () const; + char const* ch_C () const; + Byte* byte_l (); + char* ch_l (); + bool is_binary_bo () const; + void operator = (String_handle const &src); void operator += (char const *s); - Byte operator[](int j) const; + Byte operator[] (int j) const; /** Access elements. WARNING: NOT SAFE - don't use this for loops. Use byte_C() + don't use this for loops. Use byte_C () */ - Byte &operator[](int j); + Byte &operator[] (int j); void append (Byte const* byte_C, int length_i); void set (Byte const* byte_C, int length_i); void operator = (char const *p); void trunc (int j); - int length_i() const; + int length_i () const; }; #ifdef STRING_UTILS_INLINED diff --git a/flower/include/string-handle.icc b/flower/include/string-handle.icc index b2404b9ed5..decb241bff 100644 --- a/flower/include/string-handle.icc +++ b/flower/include/string-handle.icc @@ -17,9 +17,9 @@ #include "string-handle.hh" INLINE void -String_handle::down() +String_handle::down () { - if (!(--data->references)) delete data; data = 0; + if (! (--data->references)) delete data; data = 0; } /// increase ref count @@ -30,26 +30,26 @@ String_handle::up (String_data *d) } INLINE void -String_handle::copy() +String_handle::copy () { if (data->references !=1) { String_data *newdata = new String_data (*data); - down(); + down (); up (newdata); } } INLINE -String_handle::String_handle() +String_handle::String_handle () { up (new String_data); } INLINE -String_handle::~String_handle() +String_handle::~String_handle () { - down(); + down (); } INLINE @@ -59,99 +59,99 @@ String_handle::String_handle (String_handle const & src) } INLINE Byte* -String_handle::byte_l() +String_handle::byte_l () { - copy(); - return data->byte_l(); + copy (); + return data->byte_l (); } INLINE char* -String_handle::ch_l() +String_handle::ch_l () { - copy(); - return (char*)data->byte_l(); + copy (); + return (char*)data->byte_l (); } INLINE Byte -const* String_handle::byte_C() const +const* String_handle::byte_C () const { - return data->byte_C(); + return data->byte_C (); } INLINE char const* -String_handle::ch_C() const +String_handle::ch_C () const { - return (char const*)data->byte_C(); + return (char const*)data->byte_C (); } INLINE void -String_handle::operator =(String_handle const &src) +String_handle::operator = (String_handle const &src) { if (this == &src) return; - down(); + down (); up (src.data); } INLINE void String_handle::operator += (char const *s) { - copy(); + copy (); *data += s; } INLINE Byte -String_handle::operator[](int j) const +String_handle::operator[] (int j) const { return (*data)[j]; } // !NOT SAFE! -// don't use this for loops. Use byte_C() +// don't use this for loops. Use byte_C () INLINE Byte & -String_handle::operator[](int j) +String_handle::operator[] (int j) { - copy(); // hmm. Not efficient - return data->byte_l()[j]; + copy (); // hmm. Not efficient + return data->byte_l ()[j]; } INLINE void String_handle::append (Byte const* byte_C, int length_i) { - copy(); + copy (); data->append (byte_C, length_i); } INLINE void String_handle::set (Byte const* byte_C, int length_i) { - copy(); + copy (); data->set (byte_C, length_i); } INLINE void String_handle::operator = (char const *p) { - copy(); + copy (); data->set (p); } INLINE void String_handle::trunc (int j) { - copy(); data->trunc (j); + copy (); data->trunc (j); } INLINE int -String_handle::length_i() const +String_handle::length_i () const { return data->length_i_; } INLINE bool -String_handle::is_binary_bo() const { - return data->is_binary_bo(); +String_handle::is_binary_bo () const { + return data->is_binary_bo (); } #endif diff --git a/flower/include/string.hh b/flower/include/string.hh index a64cce3014..5868d9313a 100644 --- a/flower/include/string.hh +++ b/flower/include/string.hh @@ -61,7 +61,7 @@ public: /** init to empty string. This is needed because other constructors are provided.*/ - String (); + String (); /// String s = "abc"; String (char const* source); @@ -69,20 +69,20 @@ public: /// return "new"-ed copy of contents Byte* copy_byte_p () const; - char* copy_ch_p() const; + char* copy_ch_p () const; char const* ch_C () const; Byte const* byte_C () const; char* ch_l (); Byte* byte_l (); - String &operator =(String const & source); + String &operator = (String const & source); /// concatenate s void operator += (char const* s) { strh_ += s; } void operator += (String s); - bool empty_b () const; + bool empty_b () const; void append (String); void prepend (String); @@ -90,8 +90,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_str (int n) const; @@ -120,7 +120,7 @@ public: /// index of rightmost c int index_last_i (char c) const; - /// index of rightmost element of string (???) + /// index of rightmost element of string (???) int index_last_i (char const* string) const; int index_i (char c) const; @@ -177,7 +177,7 @@ String to_str (char const* format, ... ); #include "compare.hh" -INSTANTIATE_COMPARE(String const &, String::compare_i); +INSTANTIATE_COMPARE (String const &, String::compare_i); #ifdef STRING_UTILS_INLINED #ifndef INLINE @@ -189,18 +189,18 @@ INSTANTIATE_COMPARE(String const &, String::compare_i); // 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; } diff --git a/flower/include/string.icc b/flower/include/string.icc index 829f31f6bb..f53586f5b5 100644 --- a/flower/include/string.icc +++ b/flower/include/string.icc @@ -13,14 +13,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/text-db.hh b/flower/include/text-db.hh index eb0ca98fc4..813bdf041e 100644 --- a/flower/include/text-db.hh +++ b/flower/include/text-db.hh @@ -11,15 +11,15 @@ class Text_record : Array String filename; public: - Text_record() { } // needed because of other ctor + Text_record () { } // needed because of other ctor /// report an error in this line. void message (String s); - String operator[](int j) { - return Array::operator[](j); + String operator[] (int j) { + return Array::operator[] (j); } - Text_record (Array s, String fn, int j) : Array(s) { + Text_record (Array s, String fn, int j) : Array (s) { filename = fn; line_no = j; } Array::size; @@ -31,21 +31,21 @@ public: class Text_db : private Data_file { - void gobble_leading_white(); + void gobble_leading_white (); public: /// get a line with records - Text_record get_record(); + Text_record get_record (); Text_db (String fn):Data_file (fn) { } Data_file::error; bool eof_b (); /// get next line. - Text_record operator++(int) { - return get_record(); + Text_record operator++ (int) { + return get_record (); } /// are we done yet? - operator bool() { + operator bool () { return !eof_b (); } }; diff --git a/flower/include/text-stream.hh b/flower/include/text-stream.hh index 53c103c7ee..6d7e5530a8 100644 --- a/flower/include/text-stream.hh +++ b/flower/include/text-stream.hh @@ -10,7 +10,7 @@ /** line counting input stream. a stream for textfiles. linecounting. Thin interface getchar and - ungetchar. (ungetc is unlimited) + ungetchar. (ungetc is unlimited) should protect get and unget against improper use */ @@ -27,15 +27,15 @@ class Text_stream public: Text_stream (String fn); - String get_name() { return name; } - bool eof_b(); - char get() { + String get_name () { return name; } + bool eof_b (); + char get () { char c; - if (pushback.empty()) + if (pushback.empty ()) c = getc (f); else - c = pushback.pop(); + c = pushback.pop (); if (c =='\n') line_no++; @@ -46,21 +46,21 @@ public: line_no--; pushback.push (c); } - char peek() { + char peek () { if (eof_b ()) return (char)-1; - char c = get(); + char c = get (); unget (c); return c; } - bool eol() { - return (peek() == '\n'); + bool eol () { + return (peek () == '\n'); } - int line(){ + int line (){ return line_no; } - ~Text_stream(); + ~Text_stream (); /// GNU format message. diff --git a/flower/include/virtual-methods.hh b/flower/include/virtual-methods.hh index dd18a37f40..e5516d8e70 100644 --- a/flower/include/virtual-methods.hh +++ b/flower/include/virtual-methods.hh @@ -12,7 +12,7 @@ #include -#define classname(class_ptr) demangle_classname(typeid(*(class_ptr))) +#define classname(class_ptr) demangle_classname (typeid (* (class_ptr))) const char * demangle_classname (type_info const &); @@ -20,10 +20,10 @@ demangle_classname (type_info const &); /** Virtual copy constructor. Make up for C++'s lack of a standard - clone() function. Uses a typeof hack. Usage: + clone () function. Uses a typeof hack. Usage: class Foo : Baseclass { - VIRTUAL_COPY_CONS(Baseclass); + VIRTUAL_COPY_CONS (Baseclass); }; */ @@ -36,7 +36,7 @@ demangle_classname (type_info const &); #define VIRTUAL_COPY_CONS(base) \ virtual base *clone () const \ { \ - return new typeof(*this) (*this); \ + return new typeof (*this) (*this); \ } #else #define VIRTUAL_COPY_CONS(base) \ diff --git a/flower/input.cc b/flower/input.cc index 1ec7fb9428..8ec33cf882 100644 --- a/flower/input.cc +++ b/flower/input.cc @@ -3,7 +3,7 @@ source file of the LilyPond music typesetter - (c) 1997--2000 Han-Wen Nienhuys + (c) 1997--2000 Han-Wen Nienhuys */ #include #include "flower-proto.hh" @@ -38,7 +38,7 @@ Input::set_spot (Input const &i) /* Produce GNU-compliant error message. Correcting mudela is such a - breeze if you('re edidor) know(s) the error column too + breeze if you ('re edidor) know (s) the error column too Format: @@ -101,7 +101,7 @@ Input::location_str () const if (source_file_l_) return source_file_l_->file_line_column_str (defined_ch_C_); else - return "(" + _ ("position unknown") + ")"; + return " (" + _ ("position unknown") + ")"; } String diff --git a/flower/offset.cc b/flower/offset.cc index ed2598da61..d797f5f96b 100644 --- a/flower/offset.cc +++ b/flower/offset.cc @@ -18,7 +18,7 @@ String Offset::str () const { String s; - s = String("(") + to_str (coordinate_a_[X_AXIS]) + ", " + s = String (" (") + to_str (coordinate_a_[X_AXIS]) + ", " + to_str (coordinate_a_[Y_AXIS]) + ")"; return s; } @@ -39,7 +39,7 @@ Offset complex_multiply (Offset z1, Offset z2) { Offset z; - if(!isinf_b(z2[Y_AXIS])) + if (!isinf_b (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]; @@ -74,7 +74,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 4e047fde6a..39b9c0d7d9 100644 --- a/flower/parse-afm.cc +++ b/flower/parse-afm.cc @@ -63,7 +63,7 @@ Morten Welinder September 1999. * - fixed bug of not allocating extra byte for string duplication * - fixed typos * modified: DSM Tue Apr 3 11:18:34 PDT 1990 - * - added free(ident) at end of parseFile routine + * - added free (ident) at end of parseFile routine * modified: DSM Tue Jun 19 10:16:29 PDT 1990 * - changed (width == 250) to (width = 250) in initializeArray */ @@ -85,7 +85,7 @@ Morten Welinder September 1999. #define False "false" /* used in string comparison to check the value of */ /* boolean keys (e.g. IsFixedPitch) */ -#define MATCH(A,B) (strncmp((A),(B), MAX_NAME) == 0) +#define MATCH(A,B) (strncmp ((A), (B), MAX_NAME) == 0) @@ -156,12 +156,12 @@ static char *keyStrings[] = { * reads all tokens until the next end-of-line. */ -static char *token(FILE *stream) +static char *token (FILE *stream) { int ch, idx; /* skip over white space */ - while ((ch = fgetc(stream)) == ' ' || ch == lineterm || + while ((ch = fgetc (stream)) == ' ' || ch == lineterm || ch == lineterm_alt || ch == ',' || ch == '\t' || ch == ';'); @@ -171,15 +171,15 @@ static char *token(FILE *stream) && ch != '\t' && ch != ':' && ch != ';') { ident[idx++] = ch; - ch = fgetc(stream); + ch = fgetc (stream); } /* while */ if (ch == EOF && idx < 1) return ((char *)NULL); - if (idx >= 1 && ch != ':' ) ungetc(ch, stream); + if (idx >= 1 && ch != ':' ) ungetc (ch, stream); if (idx < 1 ) ident[idx++] = ch; /* single-character token */ ident[idx] = 0; - return(ident); /* returns pointer to the token */ + return (ident); /* returns pointer to the token */ } /* token */ @@ -191,24 +191,24 @@ static char *token(FILE *stream) * more than one word (like Comment lines and FullName). */ -static char *linetoken(FILE *stream) +static char *linetoken (FILE *stream) { int ch, idx; - while ((ch = fgetc(stream)) == ' ' || ch == '\t' ); + while ((ch = fgetc (stream)) == ' ' || ch == '\t' ); idx = 0; while (idx < MAX_NAME - 1 && ch != EOF && ch != lineterm && ch != lineterm_alt) { ident[idx++] = ch; - ch = fgetc(stream); + ch = fgetc (stream); } /* while */ - ungetc(ch, stream); + ungetc (ch, stream); ident[idx] = 0; - return(ident); /* returns pointer to the token */ + return (ident); /* returns pointer to the token */ } /* linetoken */ @@ -223,7 +223,7 @@ static char *linetoken(FILE *stream) * The algorithm is a standard Knuth binary search. */ -static enum parseKey recognize( register char *ident) +static enum parseKey recognize ( register char *ident) { int lower = 0, upper = (int) NOPE, midpoint, cmpvalue; BOOL found = FALSE; @@ -232,7 +232,7 @@ static enum parseKey recognize( register char *ident) { midpoint = (lower + upper)/2; if (keyStrings[midpoint] == NULL) break; - cmpvalue = strncmp(ident, keyStrings[midpoint], MAX_NAME); + cmpvalue = strncmp (ident, keyStrings[midpoint], MAX_NAME); if (cmpvalue == 0) found = TRUE; else if (cmpvalue < 0) upper = midpoint - 1; else lower = midpoint + 1; @@ -265,7 +265,7 @@ static enum parseKey recognize( register char *ident) * parseFile to determine if there is more file to parse. */ -static BOOL parseGlobals(FILE *fp, register AFM_GlobalFontInfo *gfi) +static BOOL parseGlobals (FILE *fp, register AFM_GlobalFontInfo *gfi) { BOOL cont = TRUE, save = (gfi != NULL); int error = AFM_ok; @@ -273,7 +273,7 @@ static BOOL parseGlobals(FILE *fp, register AFM_GlobalFontInfo *gfi) while (cont) { - keyword = token(fp); + keyword = token (fp); if (keyword == NULL) /* Have reached an early and unexpected EOF. */ @@ -285,7 +285,7 @@ static BOOL parseGlobals(FILE *fp, register AFM_GlobalFontInfo *gfi) if (!save) /* get tokens until the end of the Global Font info section */ /* without saving any of the data */ - switch (recognize(keyword)) + switch (recognize (keyword)) { case STARTCHARMETRICS: cont = FALSE; @@ -300,97 +300,97 @@ static BOOL parseGlobals(FILE *fp, register AFM_GlobalFontInfo *gfi) else /* otherwise parse entire global font info section, */ /* saving the data */ - switch(recognize(keyword)) + switch (recognize (keyword)) { case STARTFONTMETRICS: - keyword = token(fp); - gfi->afmVersion = (char *) malloc(strlen(keyword) + 1); - strcpy(gfi->afmVersion, keyword); + keyword = token (fp); + gfi->afmVersion = (char *) malloc (strlen (keyword) + 1); + strcpy (gfi->afmVersion, keyword); break; case COMMENT: - keyword = linetoken(fp); + keyword = linetoken (fp); break; case FONTNAME: - keyword = token(fp); - gfi->fontName = (char *) malloc(strlen(keyword) + 1); - strcpy(gfi->fontName, keyword); + keyword = token (fp); + gfi->fontName = (char *) malloc (strlen (keyword) + 1); + strcpy (gfi->fontName, keyword); break; case ENCODINGSCHEME: - keyword = token(fp); + keyword = token (fp); gfi->encodingScheme = (char *) - malloc(strlen(keyword) + 1); - strcpy(gfi->encodingScheme, keyword); + malloc (strlen (keyword) + 1); + strcpy (gfi->encodingScheme, keyword); break; case FULLNAME: - keyword = linetoken(fp); - gfi->fullName = (char *) malloc(strlen(keyword) + 1); - strcpy(gfi->fullName, keyword); + keyword = linetoken (fp); + gfi->fullName = (char *) malloc (strlen (keyword) + 1); + strcpy (gfi->fullName, keyword); break; case FAMILYNAME: - keyword = linetoken(fp); - gfi->familyName = (char *) malloc(strlen(keyword) + 1); - strcpy(gfi->familyName, keyword); + keyword = linetoken (fp); + gfi->familyName = (char *) malloc (strlen (keyword) + 1); + strcpy (gfi->familyName, keyword); break; case WEIGHT: - keyword = token(fp); - gfi->weight = (char *) malloc(strlen(keyword) + 1); - strcpy(gfi->weight, keyword); + keyword = token (fp); + gfi->weight = (char *) malloc (strlen (keyword) + 1); + strcpy (gfi->weight, keyword); break; case ITALICANGLE: - keyword = token(fp); - gfi->italicAngle = atof(keyword); + keyword = token (fp); + gfi->italicAngle = atof (keyword); if (errno == ERANGE) error = AFM_parseError; break; case ISFIXEDPITCH: - keyword = token(fp); - if (MATCH(keyword, False)) + keyword = token (fp); + if (MATCH (keyword, False)) gfi->isFixedPitch = 0; else gfi->isFixedPitch = 1; break; case UNDERLINEPOSITION: - keyword = token(fp); - gfi->underlinePosition = atoi(keyword); + keyword = token (fp); + gfi->underlinePosition = atoi (keyword); break; case UNDERLINETHICKNESS: - keyword = token(fp); - gfi->underlineThickness = atoi(keyword); + keyword = token (fp); + gfi->underlineThickness = atoi (keyword); break; case VERSION: - keyword = linetoken(fp); - gfi->version = (char *) malloc(strlen(keyword) + 1); - strcpy(gfi->version, keyword); + keyword = linetoken (fp); + gfi->version = (char *) malloc (strlen (keyword) + 1); + strcpy (gfi->version, keyword); break; case NOTICE: - keyword = linetoken(fp); - gfi->notice = (char *) malloc(strlen(keyword) + 1); - strcpy(gfi->notice, keyword); + keyword = linetoken (fp); + gfi->notice = (char *) malloc (strlen (keyword) + 1); + strcpy (gfi->notice, keyword); break; case FONTBBOX: - keyword = token(fp); - gfi->fontBBox.llx = atoi(keyword); - keyword = token(fp); - gfi->fontBBox.lly = atoi(keyword); - keyword = token(fp); - gfi->fontBBox.urx = atoi(keyword); - keyword = token(fp); - gfi->fontBBox.ury = atoi(keyword); + keyword = token (fp); + gfi->fontBBox.llx = atoi (keyword); + keyword = token (fp); + gfi->fontBBox.lly = atoi (keyword); + keyword = token (fp); + gfi->fontBBox.urx = atoi (keyword); + keyword = token (fp); + gfi->fontBBox.ury = atoi (keyword); break; case CAPHEIGHT: - keyword = token(fp); - gfi->capHeight = atoi(keyword); + keyword = token (fp); + gfi->capHeight = atoi (keyword); break; case XHEIGHT: - keyword = token(fp); - gfi->xHeight = atoi(keyword); + keyword = token (fp); + gfi->xHeight = atoi (keyword); break; case DESCENDER: - keyword = token(fp); - gfi->descender = atoi(keyword); + keyword = token (fp); + gfi->descender = atoi (keyword); break; case ASCENDER: - keyword = token(fp); - gfi->ascender = atoi(keyword); + keyword = token (fp); + gfi->ascender = atoi (keyword); break; case STARTCHARMETRICS: cont = FALSE; @@ -406,7 +406,7 @@ static BOOL parseGlobals(FILE *fp, register AFM_GlobalFontInfo *gfi) } /* switch */ } /* while */ - return(error); + return (error); } /* parseGlobals */ @@ -430,35 +430,35 @@ static BOOL parseGlobals(FILE *fp, register AFM_GlobalFontInfo *gfi) * file is reset to be where it was upon entering this function. */ -static int initializeArray(FILE *fp, register int *cwi) +static int initializeArray (FILE *fp, register int *cwi) { BOOL cont = TRUE, found = FALSE; - long opos = ftell(fp); + long opos = ftell (fp); int code = 0, width = 0, i = 0, error = 0; register char *keyword; while (cont) { - keyword = token(fp); + keyword = token (fp); if (keyword == NULL) { error = AFM_earlyEOF; break; /* get out of loop */ } - switch(recognize(keyword)) + switch (recognize (keyword)) { case COMMENT: - keyword = linetoken(fp); + keyword = linetoken (fp); break; case CODE: - code = atoi(token(fp)); + code = atoi (token (fp)); break; case XWIDTH: - width = atoi(token(fp)); + width = atoi (token (fp)); break; case CHARNAME: - keyword = token(fp); - if (MATCH(keyword, Space)) + keyword = token (fp); + if (MATCH (keyword, Space)) { cont = FALSE; found = TRUE; @@ -484,9 +484,9 @@ static int initializeArray(FILE *fp, register int *cwi) for (i = 0; i < 256; ++i) cwi[i] = width; - fseek(fp, opos, 0); + fseek (fp, opos, 0); - return(error); + return (error); } /* initializeArray */ @@ -511,7 +511,7 @@ static int initializeArray(FILE *fp, register int *cwi) * parseFile to determine if there is more file to parse. */ -static int parseCharWidths(FILE *fp, register int *cwi) +static int parseCharWidths (FILE *fp, register int *cwi) { BOOL cont = TRUE, save = (cwi != NULL); int pos = 0, error = AFM_ok; @@ -519,7 +519,7 @@ static int parseCharWidths(FILE *fp, register int *cwi) while (cont) { - keyword = token(fp); + keyword = token (fp); /* Have reached an early and unexpected EOF. */ /* Set flag and stop parsing */ if (keyword == NULL) @@ -530,7 +530,7 @@ static int parseCharWidths(FILE *fp, register int *cwi) if (!save) /* get tokens until the end of the Char Metrics section without */ /* saving any of the data*/ - switch (recognize(keyword)) + switch (recognize (keyword)) { case ENDCHARMETRICS: cont = FALSE; @@ -545,24 +545,24 @@ static int parseCharWidths(FILE *fp, register int *cwi) else /* otherwise parse entire char metrics section, saving */ /* only the char x-width info */ - switch(recognize(keyword)) + switch (recognize (keyword)) { case COMMENT: - keyword = linetoken(fp); + keyword = linetoken (fp); break; case CODE: - keyword = token(fp); - pos = atoi(keyword); + keyword = token (fp); + pos = atoi (keyword); break; case XYWIDTH: /* PROBLEM: Should be no Y-WIDTH when doing "quick & dirty" */ - keyword = token(fp); keyword = token(fp); /* eat values */ + keyword = token (fp); keyword = token (fp); /* eat values */ error = AFM_parseError; break; case XWIDTH: - keyword = token(fp); + keyword = token (fp); if (pos >= 0) /* ignore unmapped chars */ - cwi[pos] = atoi(keyword); + cwi[pos] = atoi (keyword); break; case ENDCHARMETRICS: cont = FALSE; @@ -572,14 +572,14 @@ static int parseCharWidths(FILE *fp, register int *cwi) error = normalEOF; break; case CHARNAME: /* eat values (so doesn't cause AFM_parseError) */ - keyword = token(fp); + keyword = token (fp); break; case CHARBBOX: - keyword = token(fp); keyword = token(fp); - keyword = token(fp); keyword = token(fp); + keyword = token (fp); keyword = token (fp); + keyword = token (fp); keyword = token (fp); break; case LIGATURE: - keyword = token(fp); keyword = token(fp); + keyword = token (fp); keyword = token (fp); break; case NOPE: default: @@ -588,7 +588,7 @@ static int parseCharWidths(FILE *fp, register int *cwi) } /* switch */ } /* while */ - return(error); + return (error); } /* parseCharWidths */ @@ -597,7 +597,7 @@ static int parseCharWidths(FILE *fp, register int *cwi) /* This function is called by parseFile if the caller of parseFile * requested that all character metric information be saved - * (as opposed to only the character width information). + * (as opposed to only the character width information). * * parseCharMetrics is passed in a pointer to an array of records * to hold information on a per character basis. This function @@ -610,7 +610,7 @@ static int parseCharWidths(FILE *fp, register int *cwi) * parseFile to determine if there is more file to parse. */ -static int parseCharMetrics(FILE *fp, register AFM_Font_info *fi) +static int parseCharMetrics (FILE *fp, register AFM_Font_info *fi) { BOOL cont = TRUE, firstTime = TRUE; int error = AFM_ok, count = 0; @@ -619,23 +619,23 @@ static int parseCharMetrics(FILE *fp, register AFM_Font_info *fi) while (cont) { - keyword = token(fp); + keyword = token (fp); if (keyword == NULL) { error = AFM_earlyEOF; break; /* get out of loop */ } - switch(recognize(keyword)) + switch (recognize (keyword)) { case COMMENT: - keyword = linetoken(fp); + keyword = linetoken (fp); break; case CODE: if (count < fi->numOfChars) { if (firstTime) firstTime = FALSE; else temp++; - temp->code = atoi(token(fp)); + temp->code = atoi (token (fp)); count++; } else @@ -645,41 +645,41 @@ static int parseCharMetrics(FILE *fp, register AFM_Font_info *fi) } break; case XYWIDTH: - temp->wx = atoi(token(fp)); - temp->wy = atoi(token(fp)); + temp->wx = atoi (token (fp)); + temp->wy = atoi (token (fp)); break; case XWIDTH: - temp->wx = atoi(token(fp)); + temp->wx = atoi (token (fp)); break; case CHARNAME: - keyword = token(fp); - temp->name = (char *) malloc(strlen(keyword) + 1); - strcpy(temp->name, keyword); + keyword = token (fp); + temp->name = (char *) malloc (strlen (keyword) + 1); + strcpy (temp->name, keyword); break; case CHARBBOX: - temp->charBBox.llx = atoi(token(fp)); - temp->charBBox.lly = atoi(token(fp)); - temp->charBBox.urx = atoi(token(fp)); - temp->charBBox.ury = atoi(token(fp)); + temp->charBBox.llx = atoi (token (fp)); + temp->charBBox.lly = atoi (token (fp)); + temp->charBBox.urx = atoi (token (fp)); + temp->charBBox.ury = atoi (token (fp)); break; case LIGATURE: { - AFM_Ligature **tail = &(temp->ligs); + AFM_Ligature **tail = & (temp->ligs); AFM_Ligature *node = *tail; if (*tail != NULL) { while (node->next != NULL) node = node->next; - tail = &(node->next); + tail = & (node->next); } - *tail = (AFM_Ligature *) calloc(1, sizeof(AFM_Ligature)); - keyword = token(fp); - (*tail)->succ = (char *) malloc(strlen(keyword) + 1); - strcpy((*tail)->succ, keyword); - keyword = token(fp); - (*tail)->lig = (char *) malloc(strlen(keyword) + 1); - strcpy((*tail)->lig, keyword); + *tail = (AFM_Ligature *) calloc (1, sizeof (AFM_Ligature)); + keyword = token (fp); + (*tail)->succ = (char *) malloc (strlen (keyword) + 1); + strcpy ((*tail)->succ, keyword); + keyword = token (fp); + (*tail)->lig = (char *) malloc (strlen (keyword) + 1); + strcpy ((*tail)->lig, keyword); break; } case ENDCHARMETRICS: cont = FALSE;; @@ -698,7 +698,7 @@ static int parseCharMetrics(FILE *fp, register AFM_Font_info *fi) if ((error == AFM_ok) && (count != fi->numOfChars)) error = AFM_parseError; - return(error); + return (error); } /* parseCharMetrics */ @@ -719,7 +719,7 @@ static int parseCharMetrics(FILE *fp, register AFM_Font_info *fi) * parseFile to determine if there is more file to parse. */ -static int parseAFM_TrackKernData(FILE *fp, register AFM_Font_info *fi) +static int parseAFM_TrackKernData (FILE *fp, register AFM_Font_info *fi) { BOOL cont = TRUE, save = (fi->tkd != NULL); int pos = 0, error = AFM_ok, tcount = 0; @@ -727,7 +727,7 @@ static int parseAFM_TrackKernData(FILE *fp, register AFM_Font_info *fi) while (cont) { - keyword = token(fp); + keyword = token (fp); if (keyword == NULL) { @@ -737,7 +737,7 @@ static int parseAFM_TrackKernData(FILE *fp, register AFM_Font_info *fi) if (!save) /* get tokens until the end of the Track Kerning Data */ /* section without saving any of the data */ - switch(recognize(keyword)) + switch (recognize (keyword)) { case ENDTRACKKERN: case ENDKERNDATA: @@ -753,27 +753,27 @@ static int parseAFM_TrackKernData(FILE *fp, register AFM_Font_info *fi) else /* otherwise parse entire Track Kerning Data section, */ /* saving the data */ - switch(recognize(keyword)) + switch (recognize (keyword)) { case COMMENT: - keyword = linetoken(fp); + keyword = linetoken (fp); break; case TRACKKERN: if (tcount < fi->numOfTracks) { - keyword = token(fp); - fi->tkd[pos].degree = atoi(keyword); - keyword = token(fp); - fi->tkd[pos].minPtSize = atof(keyword); + keyword = token (fp); + fi->tkd[pos].degree = atoi (keyword); + keyword = token (fp); + fi->tkd[pos].minPtSize = atof (keyword); if (errno == ERANGE) error = AFM_parseError; - keyword = token(fp); - fi->tkd[pos].minKernAmt = atof(keyword); + keyword = token (fp); + fi->tkd[pos].minKernAmt = atof (keyword); if (errno == ERANGE) error = AFM_parseError; - keyword = token(fp); - fi->tkd[pos].maxPtSize = atof(keyword); + keyword = token (fp); + fi->tkd[pos].maxPtSize = atof (keyword); if (errno == ERANGE) error = AFM_parseError; - keyword = token(fp); - fi->tkd[pos++].maxKernAmt = atof(keyword); + keyword = token (fp); + fi->tkd[pos++].maxKernAmt = atof (keyword); if (errno == ERANGE) error = AFM_parseError; tcount++; } @@ -801,7 +801,7 @@ static int parseAFM_TrackKernData(FILE *fp, register AFM_Font_info *fi) if (error == AFM_ok && tcount != fi->numOfTracks) error = AFM_parseError; - return(error); + return (error); } /* parseAFM_TrackKernData */ @@ -821,7 +821,7 @@ static int parseAFM_TrackKernData(FILE *fp, register AFM_Font_info *fi) * parseFile to determine if there is more file to parse. */ -static int parseAFM_PairKernData(FILE *fp, register AFM_Font_info *fi) +static int parseAFM_PairKernData (FILE *fp, register AFM_Font_info *fi) { BOOL cont = TRUE, save = (fi->pkd != NULL); int pos = 0, error = AFM_ok, pcount = 0; @@ -829,7 +829,7 @@ static int parseAFM_PairKernData(FILE *fp, register AFM_Font_info *fi) while (cont) { - keyword = token(fp); + keyword = token (fp); if (keyword == NULL) { @@ -839,7 +839,7 @@ static int parseAFM_PairKernData(FILE *fp, register AFM_Font_info *fi) if (!save) /* get tokens until the end of the Pair Kerning Data */ /* section without saving any of the data */ - switch(recognize(keyword)) + switch (recognize (keyword)) { case ENDKERNPAIRS: case ENDKERNDATA: @@ -855,26 +855,26 @@ static int parseAFM_PairKernData(FILE *fp, register AFM_Font_info *fi) else /* otherwise parse entire Pair Kerning Data section, */ /* saving the data */ - switch(recognize(keyword)) + switch (recognize (keyword)) { case COMMENT: - keyword = linetoken(fp); + keyword = linetoken (fp); break; case KERNPAIR: if (pcount < fi->numOfPairs) { - keyword = token(fp); + keyword = token (fp); fi->pkd[pos].name1 = (char *) - malloc(strlen(keyword) + 1); - strcpy(fi->pkd[pos].name1, keyword); - keyword = token(fp); + malloc (strlen (keyword) + 1); + strcpy (fi->pkd[pos].name1, keyword); + keyword = token (fp); fi->pkd[pos].name2 = (char *) - malloc(strlen(keyword) + 1); - strcpy(fi->pkd[pos].name2, keyword); - keyword = token(fp); - fi->pkd[pos].xamt = atoi(keyword); - keyword = token(fp); - fi->pkd[pos++].yamt = atoi(keyword); + malloc (strlen (keyword) + 1); + strcpy (fi->pkd[pos].name2, keyword); + keyword = token (fp); + fi->pkd[pos].xamt = atoi (keyword); + keyword = token (fp); + fi->pkd[pos++].yamt = atoi (keyword); pcount++; } else @@ -886,16 +886,16 @@ static int parseAFM_PairKernData(FILE *fp, register AFM_Font_info *fi) case KERNPAIRXAMT: if (pcount < fi->numOfPairs) { - keyword = token(fp); + keyword = token (fp); fi->pkd[pos].name1 = (char *) - malloc(strlen(keyword) + 1); - strcpy(fi->pkd[pos].name1, keyword); - keyword = token(fp); + malloc (strlen (keyword) + 1); + strcpy (fi->pkd[pos].name1, keyword); + keyword = token (fp); fi->pkd[pos].name2 = (char *) - malloc(strlen(keyword) + 1); - strcpy(fi->pkd[pos].name2, keyword); - keyword = token(fp); - fi->pkd[pos++].xamt = atoi(keyword); + malloc (strlen (keyword) + 1); + strcpy (fi->pkd[pos].name2, keyword); + keyword = token (fp); + fi->pkd[pos++].xamt = atoi (keyword); pcount++; } else @@ -922,7 +922,7 @@ static int parseAFM_PairKernData(FILE *fp, register AFM_Font_info *fi) if (error == AFM_ok && pcount != fi->numOfPairs) error = AFM_parseError; - return(error); + return (error); } /* parseAFM_PairKernData */ @@ -945,7 +945,7 @@ static int parseAFM_PairKernData(FILE *fp, register AFM_Font_info *fi) * parseFile to determine if there is more file to parse. */ -static int parseAFM_CompCharData(FILE *fp, register AFM_Font_info *fi) +static int parseAFM_CompCharData (FILE *fp, register AFM_Font_info *fi) { BOOL cont = TRUE, firstTime = TRUE, save = (fi->ccd != NULL); int pos = 0, j = 0, error = AFM_ok, ccount = 0, pcount = 0; @@ -953,7 +953,7 @@ static int parseAFM_CompCharData(FILE *fp, register AFM_Font_info *fi) while (cont) { - keyword = token(fp); + keyword = token (fp); if (keyword == NULL) /* Have reached an early and unexpected EOF. */ /* Set flag and stop parsing */ @@ -969,7 +969,7 @@ static int parseAFM_CompCharData(FILE *fp, register AFM_Font_info *fi) if (!save) /* get tokens until the end of the Composite Character info */ /* section without saving any of the data */ - switch(recognize(keyword)) + switch (recognize (keyword)) { case ENDCOMPOSITES: cont = FALSE; @@ -984,27 +984,27 @@ static int parseAFM_CompCharData(FILE *fp, register AFM_Font_info *fi) else /* otherwise parse entire Composite Character info section, */ /* saving the data */ - switch(recognize(keyword)) + switch (recognize (keyword)) { case COMMENT: - keyword = linetoken(fp); + keyword = linetoken (fp); break; case COMPCHAR: if (ccount < fi->numOfComps) { - keyword = token(fp); + keyword = token (fp); if (pcount != fi->ccd[pos].numOfPieces) error = AFM_parseError; pcount = 0; if (firstTime) firstTime = FALSE; else pos++; fi->ccd[pos].ccName = (char *) - malloc(strlen(keyword) + 1); - strcpy(fi->ccd[pos].ccName, keyword); - keyword = token(fp); - fi->ccd[pos].numOfPieces = atoi(keyword); + malloc (strlen (keyword) + 1); + strcpy (fi->ccd[pos].ccName, keyword); + keyword = token (fp); + fi->ccd[pos].numOfPieces = atoi (keyword); fi->ccd[pos].pieces = (AFM_Pcc *) - calloc(fi->ccd[pos].numOfPieces, sizeof(AFM_Pcc)); + calloc (fi->ccd[pos].numOfPieces, sizeof (AFM_Pcc)); j = 0; ccount++; } @@ -1017,14 +1017,14 @@ static int parseAFM_CompCharData(FILE *fp, register AFM_Font_info *fi) case COMPCHARPIECE: if (pcount < fi->ccd[pos].numOfPieces) { - keyword = token(fp); + keyword = token (fp); fi->ccd[pos].pieces[j].AFM_PccName = (char *) - malloc(strlen(keyword) + 1); - strcpy(fi->ccd[pos].pieces[j].AFM_PccName, keyword); - keyword = token(fp); - fi->ccd[pos].pieces[j].deltax = atoi(keyword); - keyword = token(fp); - fi->ccd[pos].pieces[j++].deltay = atoi(keyword); + malloc (strlen (keyword) + 1); + strcpy (fi->ccd[pos].pieces[j].AFM_PccName, keyword); + keyword = token (fp); + fi->ccd[pos].pieces[j].deltax = atoi (keyword); + keyword = token (fp); + fi->ccd[pos].pieces[j++].deltay = atoi (keyword); pcount++; } else @@ -1047,7 +1047,7 @@ static int parseAFM_CompCharData(FILE *fp, register AFM_Font_info *fi) if (error == AFM_ok && ccount != fi->numOfComps) error = AFM_parseError; - return(error); + return (error); } /* parseAFM_CompCharData */ @@ -1089,21 +1089,21 @@ extern int AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags) /* storage data for the global variable ident */ if (!ident) - ident = (char *) calloc(MAX_NAME, sizeof(char)); - if (ident == NULL) {error = AFM_storageProblem; return(error);} + ident = (char *) calloc (MAX_NAME, sizeof (char)); + if (ident == NULL) {error = AFM_storageProblem; return (error);} - (*fi) = (AFM_Font_info *) calloc(1, sizeof(AFM_Font_info)); - if ((*fi) == NULL) {error = AFM_storageProblem; return(error);} + (*fi) = (AFM_Font_info *) calloc (1, sizeof (AFM_Font_info)); + if ((*fi) == NULL) {error = AFM_storageProblem; return (error);} if (flags & P_G) { - (*fi)->gfi = (AFM_GlobalFontInfo *) calloc(1, sizeof(AFM_GlobalFontInfo)); - if ((*fi)->gfi == NULL) {error = AFM_storageProblem; return(error);} + (*fi)->gfi = (AFM_GlobalFontInfo *) calloc (1, sizeof (AFM_GlobalFontInfo)); + if ((*fi)->gfi == NULL) {error = AFM_storageProblem; return (error);} } /* The AFM File begins with Global Font Information. This section */ /* will be parsed whether or not information should be saved. */ - code = parseGlobals(fp, (*fi)->gfi); + code = parseGlobals (fp, (*fi)->gfi); if (code < 0) error = code; @@ -1117,27 +1117,27 @@ extern int AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags) if ((code != normalEOF) && (code != AFM_earlyEOF)) { - (*fi)->numOfChars = atoi(token(fp)); + (*fi)->numOfChars = atoi (token (fp)); if (flags & (P_M ^ P_W)) { - (*fi)->cmi = (AFM_CharMetricInfo *) - calloc((*fi)->numOfChars, sizeof(AFM_CharMetricInfo)); - if ((*fi)->cmi == NULL) {error = AFM_storageProblem; return(error);} - code = parseCharMetrics(fp, *fi); + (*fi)->cmi = (AFM_CharMetricInfo *) + calloc ((*fi)->numOfChars, sizeof (AFM_CharMetricInfo)); + if ((*fi)->cmi == NULL) {error = AFM_storageProblem; return (error);} + code = parseCharMetrics (fp, *fi); } else { if (flags & P_W) { - (*fi)->cwi = (int *) calloc(256, sizeof(int)); + (*fi)->cwi = (int *) calloc (256, sizeof (int)); if ((*fi)->cwi == NULL) { error = AFM_storageProblem; - return(error); + return (error); } } /* parse section regardless */ - code = parseCharWidths(fp, (*fi)->cwi); + code = parseCharWidths (fp, (*fi)->cwi); } /* else */ } /* if */ @@ -1151,7 +1151,7 @@ extern int AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags) while ((code != normalEOF) && (code != AFM_earlyEOF)) { - keyword = token(fp); + keyword = token (fp); if (keyword == NULL) /* Have reached an early and unexpected EOF. */ /* Set flag and stop parsing */ @@ -1159,56 +1159,56 @@ extern int AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags) code = AFM_earlyEOF; break; /* get out of loop */ } - switch(recognize(keyword)) + switch (recognize (keyword)) { case STARTKERNDATA: break; case ENDKERNDATA: break; case STARTTRACKKERN: - keyword = token(fp); + keyword = token (fp); if (flags & P_T) { - (*fi)->numOfTracks = atoi(keyword); - (*fi)->tkd = (AFM_TrackKernData *) - calloc((*fi)->numOfTracks, sizeof(AFM_TrackKernData)); + (*fi)->numOfTracks = atoi (keyword); + (*fi)->tkd = (AFM_TrackKernData *) + calloc ((*fi)->numOfTracks, sizeof (AFM_TrackKernData)); if ((*fi)->tkd == NULL) { error = AFM_storageProblem; - return(error); + return (error); } } /* if */ - code = parseAFM_TrackKernData(fp, *fi); + code = parseAFM_TrackKernData (fp, *fi); break; case STARTKERNPAIRS: - keyword = token(fp); + keyword = token (fp); if (flags & P_P) { - (*fi)->numOfPairs = atoi(keyword); - (*fi)->pkd = (AFM_PairKernData *) - calloc((*fi)->numOfPairs, sizeof(AFM_PairKernData)); + (*fi)->numOfPairs = atoi (keyword); + (*fi)->pkd = (AFM_PairKernData *) + calloc ((*fi)->numOfPairs, sizeof (AFM_PairKernData)); if ((*fi)->pkd == NULL) { error = AFM_storageProblem; - return(error); + return (error); } } /* if */ - code = parseAFM_PairKernData(fp, *fi); + code = parseAFM_PairKernData (fp, *fi); break; case STARTCOMPOSITES: - keyword = token(fp); + keyword = token (fp); if (flags & P_C) { - (*fi)->numOfComps = atoi(keyword); - (*fi)->ccd = (AFM_CompCharData *) - calloc((*fi)->numOfComps, sizeof(AFM_CompCharData)); + (*fi)->numOfComps = atoi (keyword); + (*fi)->ccd = (AFM_CompCharData *) + calloc ((*fi)->numOfComps, sizeof (AFM_CompCharData)); if ((*fi)->ccd == NULL) { error = AFM_storageProblem; - return(error); + return (error); } } /* if */ - code = parseAFM_CompCharData(fp, *fi); + code = parseAFM_CompCharData (fp, *fi); break; case ENDFONTMETRICS: code = normalEOF; @@ -1225,9 +1225,9 @@ extern int AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags) if ((error != AFM_earlyEOF) && (code < 0)) error = code; - if (ident != NULL) { free(ident); ident = NULL; } + if (ident != NULL) { free (ident); ident = NULL; } - return(error); + return (error); } /* parseFile */ diff --git a/flower/polynomial.cc b/flower/polynomial.cc index 1dd202ac95..df8847fe04 100644 --- a/flower/polynomial.cc +++ b/flower/polynomial.cc @@ -1,7 +1,7 @@ /* poly.cc -- routines for manipulation of polynomials in one var - (c) 1993--2000 Han-Wen Nienhuys + (c) 1993--2000 Han-Wen Nienhuys */ #include @@ -29,7 +29,7 @@ Polynomial::eval (Real x)const Polynomial -Polynomial::multiply(const Polynomial & p1, const Polynomial & p2) +Polynomial::multiply (const Polynomial & p1, const Polynomial & p2) { Polynomial dest; @@ -46,7 +46,7 @@ Polynomial::multiply(const Polynomial & p1, const Polynomial & p2) } void -Polynomial::differentiate() +Polynomial::differentiate () { for (int i = 1; i<= degree (); i++) { @@ -56,10 +56,10 @@ Polynomial::differentiate() } Polynomial -Polynomial::power(int exponent, const Polynomial & src) +Polynomial::power (int exponent, const Polynomial & src) { int e = exponent; - Polynomial dest(1), base(src); + Polynomial dest (1), base (src); /* classic int power. invariant: src^exponent = dest * src ^ e @@ -68,11 +68,11 @@ Polynomial::power(int exponent, const Polynomial & src) { if (e % 2) { - dest = multiply(dest, base); + dest = multiply (dest, base); e--; } else { - base = multiply(base, base); + base = multiply (base, base); e /= 2; } } @@ -82,20 +82,20 @@ Polynomial::power(int exponent, const Polynomial & src) static Real const FUDGE = 1e-8; void -Polynomial::clean() +Polynomial::clean () { /* We only do relative comparisons. Absolute comparisons break down in degenerate cases. */ while (degree () > 0 && - (fabs (coefs_.top ()) < FUDGE * fabs (coefs_.top (1)) + (fabs (coefs_.top ()) < FUDGE * fabs (coefs_.top (1)) || !coefs_.top ())) coefs_.pop (); } Polynomial -Polynomial::add(const Polynomial & p1, const Polynomial & p2) +Polynomial::add (const Polynomial & p1, const Polynomial & p2) { Polynomial dest; int tempord = p2.degree () >? p1.degree (); @@ -112,14 +112,14 @@ Polynomial::add(const Polynomial & p1, const Polynomial & p2) } void -Polynomial::scalarmultiply(Real fact) +Polynomial::scalarmultiply (Real fact) { for (int i = 0; i <= degree (); i++) coefs_[i] *= fact; } Polynomial -Polynomial::subtract(const Polynomial & p1, const Polynomial & p2) +Polynomial::subtract (const Polynomial & p1, const Polynomial & p2) { Polynomial dest; int tempord = p2.degree () >? p1.degree (); @@ -138,19 +138,19 @@ Polynomial::subtract(const Polynomial & p1, const Polynomial & p2) } void -Polynomial::set_negate(const Polynomial & src) +Polynomial::set_negate (const Polynomial & src) { - for (int i = 0; i <= src.degree(); i++) + for (int i = 0; i <= src.degree (); i++) coefs_[i] = -src.coefs_[i]; } /// mod of #u/v# int -Polynomial::set_mod(const Polynomial &u, const Polynomial &v) +Polynomial::set_mod (const Polynomial &u, const Polynomial &v) { - (*this) = u; + (*this) = u; - if (v.lc() < 0.0) { + if (v.lc () < 0.0) { for (int k = u.degree () - v.degree () - 1; k >= 0; k -= 2) coefs_[k] = -coefs_[k]; @@ -167,30 +167,30 @@ Polynomial::set_mod(const Polynomial &u, const Polynomial &v) while (k >= 0 && coefs_[k] == 0.0) k--; - coefs_.set_size(1+ ( (k < 0) ? 0 : k)); - return degree(); + coefs_.set_size (1+ ((k < 0) ? 0 : k)); + return degree (); } void -Polynomial::check_sol(Real x) const +Polynomial::check_sol (Real x) const { - Real f=eval(x); - Polynomial p(*this); - p.differentiate(); - Real d = p.eval(x); + Real f=eval (x); + Polynomial p (*this); + 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); */ + warning ("x=%f is not a root of polynomial\n" + "f (x)=%f, f' (x)=%f \n", x, f, d); */ } void -Polynomial::check_sols(Array roots) const +Polynomial::check_sols (Array roots) const { for (int i=0; i< roots.size (); i++) - check_sol(roots[i]); + check_sol (roots[i]); } Polynomial::Polynomial (Real a, Real b) @@ -201,12 +201,12 @@ Polynomial::Polynomial (Real a, Real b) } /* cubic root. */ -inline Real cubic_root(Real x) +inline Real cubic_root (Real x) { if (x > 0.0) - return pow(x, 1.0/3.0) ; + return pow (x, 1.0/3.0) ; else if (x < 0.0) - return -pow(-x, 1.0/3.0); + return -pow (-x, 1.0/3.0); else return 0.0; } @@ -218,7 +218,7 @@ iszero (Real r) } Array -Polynomial::solve_cubic()const +Polynomial::solve_cubic ()const { Array sol; @@ -240,28 +240,28 @@ Polynomial::solve_cubic()const Real cb_p = p * p * p; Real D = q * q + cb_p; - if (iszero(D)) { - if (iszero(q)) { /* one triple solution */ + if (iszero (D)) { + if (iszero (q)) { /* one triple solution */ sol.push (0); sol.push (0); sol.push (0); } else { /* one single and one double solution */ - Real u = cubic_root(-q); + Real u = cubic_root (-q); sol.push (2 * u); sol.push (-u); } } else if (D < 0) { /* Casus irreducibilis: three real solutions */ - Real phi = 1.0 / 3 * acos(-q / sqrt(-cb_p)); - Real t = 2 * sqrt(-p); + Real phi = 1.0 / 3 * acos (-q / sqrt (-cb_p)); + 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)); + 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 */ - Real sqrt_D = sqrt(D); - Real u = cubic_root(sqrt_D - q); - Real v = -cubic_root(sqrt_D + q); + Real sqrt_D = sqrt (D); + Real u = cubic_root (sqrt_D - q); + Real v = -cubic_root (sqrt_D + q); sol.push ( u + v); } @@ -284,7 +284,7 @@ Polynomial::solve_cubic()const Real Polynomial::lc () const { - return coefs_.top(); + return coefs_.top (); } Real& @@ -302,7 +302,7 @@ Polynomial::degree ()const all roots of quadratic eqn. */ Array -Polynomial::solve_quadric()const +Polynomial::solve_quadric ()const { Array sol; /* normal form: x^2 + px + q = 0 */ @@ -312,7 +312,7 @@ Polynomial::solve_quadric()const Real D = p * p - q; if (D>0) { - D = sqrt(D); + D = sqrt (D); sol.push ( D - p); sol.push ( -D - p); @@ -322,7 +322,7 @@ Polynomial::solve_quadric()const /* solve linear equation */ Array -Polynomial::solve_linear()const +Polynomial::solve_linear ()const { Array s; if (coefs_[1]) @@ -359,11 +359,11 @@ Polynomial:: operator *= (Polynomial const &p2) void Polynomial::operator += (Polynomial const &p) { - *this = add( *this, p); + *this = add ( *this, p); } void Polynomial::operator -= (Polynomial const &p) { - *this = subtract(*this, p); + *this = subtract (*this, p); } diff --git a/flower/rational.cc b/flower/rational.cc index a50228330b..5c3c8c5cbd 100644 --- a/flower/rational.cc +++ b/flower/rational.cc @@ -37,7 +37,7 @@ operator << (ostream &o, Rational r) Rational Rational::trunc_rat () const { - return Rational(num_ - (num_ % den_), den_); + return Rational (num_ - (num_ % den_), den_); } Rational::Rational () @@ -81,7 +81,7 @@ Rational::set_infinite (int s) Rational Rational::operator - () const { - Rational r(*this); + Rational r (*this); r.negate (); return r; } @@ -144,7 +144,7 @@ Rational::compare (Rational const &r, Rational const &s) else if (r.infty_b ()) return 0; - return (r - s).sign (); + return (r - s).sign (); } int @@ -173,7 +173,7 @@ Rational::operator += (Rational r) { int n = sign_ * num_ *r.den_ + r.sign_ * den_ * r.num_; int d = den_ * r.den_; - sign_ = ::sign (n) * ::sign(d); + sign_ = ::sign (n) * ::sign (d); num_ = abs (n); den_ = abs (d); normalise (); @@ -185,7 +185,7 @@ Rational::operator += (Rational r) /* copied from libg++ 2.8.0 */ -Rational::Rational(double x) +Rational::Rational (double x) { if (x != 0.0) { @@ -193,7 +193,7 @@ Rational::Rational(double x) x *= sign_; int expt; - double mantissa = frexp(x, &expt); + double mantissa = frexp (x, &expt); const int FACT = 1 << 20; diff --git a/flower/rtti.cc b/flower/rtti.cc index ae1aa8658c..e942dfbc1b 100644 --- a/flower/rtti.cc +++ b/flower/rtti.cc @@ -6,7 +6,7 @@ const char * demangle_classname (type_info const &t) { - char const *s = t.name(); + char const *s = t.name (); while (isdigit (*s)) s++; return s; diff --git a/flower/simple-file-storage.cc b/flower/simple-file-storage.cc index 34cda9d1f4..8feb1a5843 100644 --- a/flower/simple-file-storage.cc +++ b/flower/simple-file-storage.cc @@ -52,7 +52,7 @@ Simple_file_storage::load_file (String s) data_p_[len_i_] = 0; ret = fread (data_p_, sizeof (char), len_i_, f); - if (ret!=len_i_) + if (ret!=len_i_) warning (_f ("Huh? Got %d, expected %d characters", ret, len_i_)); fclose (f); diff --git a/flower/source-file.cc b/flower/source-file.cc index 65e4674b46..4c5a4390fd 100644 --- a/flower/source-file.cc +++ b/flower/source-file.cc @@ -58,8 +58,8 @@ Source_file::istream_l () String Source_file::file_line_column_str (char const *context_ch_C) const { - if (!ch_C ()) - return "(" + _ ("position unknown") + ")"; + if (!ch_C ()) + return " (" + _ ("position unknown") + ")"; else return name_str () + ":" + to_str (line_i (context_ch_C)) + ":" + to_str (char_i (context_ch_C)); @@ -152,7 +152,7 @@ String Source_file::error_str (char const* pos_ch_C) const { if (!in_b (pos_ch_C)) - return "(" + _ ("position unknown") + ")"; + return " (" + _ ("position unknown") + ")"; int ch_i = char_i (pos_ch_C); String line = line_str (pos_ch_C); diff --git a/flower/string-convert.cc b/flower/string-convert.cc index 0d5c27e117..e751cc71d8 100644 --- a/flower/string-convert.cc +++ b/flower/string-convert.cc @@ -37,8 +37,8 @@ String String_convert::bin2hex_str (String bin_str) { String str; - Byte const* byte_C = bin_str.byte_C(); - for (int i = 0; i < bin_str.length_i(); i++) + Byte const* byte_C = bin_str.byte_C (); + for (int i = 0; i < bin_str.length_i (); i++) { str += to_str ((char)nibble2hex_byte (*byte_C >> 4)); str += to_str ((char)nibble2hex_byte (*byte_C++)); @@ -55,10 +55,10 @@ String_convert::bin2_i (String bin_str) unsigned String_convert::bin2_u (String bin_str) { - assert (bin_str.length_i() <= (int)sizeof(unsigned)); + assert (bin_str.length_i () <= (int)sizeof (unsigned)); unsigned result_u = 0; - for (int i = 0; i < bin_str.length_i(); i++) + for (int i = 0; i < bin_str.length_i (); i++) { result_u <<= 8; result_u += (Byte)bin_str[ i ]; @@ -70,11 +70,11 @@ String_convert::bin2_u (String bin_str) int String_convert::dec2_i (String dec_str) { - if (!dec_str.length_i()) + if (!dec_str.length_i ()) return 0; long l = 0; - int conv = sscanf (dec_str.ch_C(), "%ld", &l); + int conv = sscanf (dec_str.ch_C (), "%ld", &l); assert (conv); return (int)l; @@ -85,7 +85,7 @@ String_convert::i64_str (I64 i64, char const* fmt) { char buffer[STRING_BUFFER_LEN]; snprintf (buffer, STRING_BUFFER_LEN, - (fmt ? fmt : "%Ld"), i64); // assume radix 10 + (fmt ? fmt : "%Ld"), i64); // assume radix 10 return String (buffer); } @@ -93,10 +93,10 @@ String_convert::i64_str (I64 i64, char const* fmt) double String_convert::dec2_f (String dec_str) { - if (!dec_str.length_i()) + if (!dec_str.length_i ()) return 0; double d = 0; - int conv = sscanf (dec_str.ch_C(), "%lf", &d); + int conv = sscanf (dec_str.ch_C (), "%lf", &d); assert (conv); return d; } @@ -104,19 +104,19 @@ String_convert::dec2_f (String dec_str) int String_convert::hex2bin_i (String hex_str, String& bin_str_r) { - if (hex_str.length_i() % 2) + if (hex_str.length_i () % 2) hex_str = "0" + hex_str; bin_str_r = ""; - Byte const* byte_C= hex_str.byte_C(); + Byte const* byte_C= hex_str.byte_C (); int i = 0; - while (i < hex_str.length_i()) + while (i < hex_str.length_i ()) { int high_i = hex2nibble_i (*byte_C++); int low_i = hex2nibble_i (*byte_C++); if (high_i < 0 || low_i < 0) return 1; // illegal char - bin_str_r += to_str ((char)(high_i << 4 | low_i), 1 ); + bin_str_r += to_str ((char) (high_i << 4 | low_i), 1 ); i += 2; } return 0; @@ -145,7 +145,7 @@ String_convert::hex2nibble_i (Byte byte) return -1; } -// stupido. Should use int_str() +// stupido. Should use int_str () String String_convert::i2dec_str (int i, int length_i, char ch) { @@ -157,11 +157,11 @@ String_convert::i2dec_str (int i, int length_i, char ch) String dec_str = to_str (i); // ugh - return to_str (fill_ch, length_i - dec_str.length_i()) + dec_str; + return to_str (fill_ch, length_i - dec_str.length_i ()) + dec_str; } -// stupido. Should use int_str() +// stupido. Should use int_str () String String_convert::u2hex_str (unsigned u, int length_i, char fill_ch) { @@ -172,15 +172,15 @@ String_convert::u2hex_str (unsigned u, int length_i, char fill_ch) #if 1 // both go... while (u) { - str = to_str ((char)((u % 16)["0123456789abcdef"] ) ) + str; + str = to_str ((char) ((u % 16)["0123456789abcdef"] ) ) + str; u /= 16; } #else str += int_str (u, "%x"); // hmm. %lx vs. %x -> portability? #endif - str = to_str (fill_ch, length_i - str.length_i()) + str; - while ((str.length_i() > length_i) && (str[ 0 ] == 'f' ) ) + str = to_str (fill_ch, length_i - str.length_i ()) + str; + while ((str.length_i () > length_i) && (str[ 0 ] == 'f' ) ) str = str.cut_str (2, INT_MAX); return str; @@ -211,7 +211,7 @@ String_convert::int_str (int i, char const* fmt) { char buffer[STRING_BUFFER_LEN]; snprintf (buffer, STRING_BUFFER_LEN, - (fmt ? fmt : "%d"), i); // assume radix 10 + (fmt ? fmt : "%d"), i); // assume radix 10 return String (buffer); } diff --git a/flower/string.cc b/flower/string.cc index b7afe955f2..8ee89d0c5f 100644 --- a/flower/string.cc +++ b/flower/string.cc @@ -2,7 +2,7 @@ string.cc - implement String - (c) 1997--2000 Han-Wen Nienhuys & Jan Nieuwenhuizen + (c) 1997--2000 Han-Wen Nienhuys & Jan Nieuwenhuizen */ @@ -198,7 +198,7 @@ String::index_last_i (char const c) const return -1; char const* me = strh_.ch_C (); - char const* p = (char const*)memrchr ( (Byte*)me, length_i (), c); + char const* p = (char const*)memrchr ((Byte*)me, length_i (), c); if (p) return p - me; return -1; @@ -254,7 +254,7 @@ String::index_i (String searchfor) const { char const* me = strh_.ch_C (); - char const* p = (char const *) + char const* p = (char const *) memmem (me, length_i (), searchfor.ch_C (), searchfor.length_i ()); if (p) @@ -347,7 +347,7 @@ String::cut_str (int index_i, int n) const if (!length_i () || (index_i < 0) || (index_i >= length_i () ) || (n < 1 ) ) return String (); - if ( (n > length_i ()) || (index_i + n > length_i () ) ) + if ((n > length_i ()) || (index_i + n > length_i () ) ) n = length_i () - index_i; return String (byte_C () + index_i, n); diff --git a/flower/text-db.cc b/flower/text-db.cc index 61fb0529d6..6acfa9eeef 100644 --- a/flower/text-db.cc +++ b/flower/text-db.cc @@ -4,20 +4,20 @@ bool Text_db::eof_b () { - Data_file::gobble_leading_white(); - return Data_file::eof_b(); + Data_file::gobble_leading_white (); + return Data_file::eof_b (); } void -Text_db::gobble_leading_white() +Text_db::gobble_leading_white () { while (1) { - Data_file::gobble_leading_white(); + Data_file::gobble_leading_white (); if (eof_b ()) return ; char c; - if ((c = data_get()) !='\n') + if ((c = data_get ()) !='\n') { data_unget (c); return ; @@ -27,7 +27,7 @@ Text_db::gobble_leading_white() Text_record -Text_db::get_record() +Text_db::get_record () { while (1) { @@ -35,18 +35,18 @@ Text_db::get_record() Array fields; assert (!eof_b ()); - while ((s = get_word()) != "") + while ((s = get_word ()) != "") { fields.push (s); - gobble_white(); + gobble_white (); } - if (get_line() != "") + if (get_line () != "") assert (false); - assert (fields.size()); - return Text_record (fields, get_name(), line ()); + assert (fields.size ()); + return Text_record (fields, get_name (), line ()); } } diff --git a/flower/text-stream.cc b/flower/text-stream.cc index 446c44a019..e6a1202a14 100644 --- a/flower/text-stream.cc +++ b/flower/text-stream.cc @@ -4,7 +4,7 @@ Text_stream::Text_stream (String fn) { - ios::sync_with_stdio(); + ios::sync_with_stdio (); if (fn == "") { name = _ (""); @@ -30,7 +30,7 @@ Text_stream::Text_stream (String fn) void Text_stream::message (String s) { - cerr << '\n'<checksum_ = checksum; - return fm->self_scm(); + return fm->self_scm (); } @@ -48,7 +48,7 @@ Adobe_font_metric::find_ascii_metric (int a , bool warn) const return font_inf_->cmi + code; } } - else if (warn ) + else if (warn) { warning (_f ("can't find character number: %d", a)); } @@ -65,7 +65,7 @@ Adobe_font_metric::find_char_metric (String nm, bool warn) const { if (warn) { - warning (_f ("can't find character called: `%s'", nm.ch_C())); + warning (_f ("can't find character called: `%s'", nm.ch_C ())); } return 0; } @@ -79,7 +79,7 @@ Adobe_font_metric::get_char (int code) const { AFM_CharMetricInfo const * c = find_ascii_metric (code,false); - Box b (Interval (0,0),Interval(0,0)); + Box b (Interval (0,0),Interval (0,0)); if (c) b = afm_bbox_to_box (c->charBBox); @@ -89,7 +89,7 @@ Adobe_font_metric::get_char (int code) const SCM read_afm_file (String nm) { - FILE *f = fopen (nm.ch_C() , "r"); + FILE *f = fopen (nm.ch_C () , "r"); char s[2048]; char *check_key = "TfmCheckSum"; fgets (s, sizeof (s), f); @@ -148,7 +148,7 @@ Adobe_font_metric::find_by_name (String s) const return m; } - SCM at = (gh_list (ly_symbol2scm ("char"), + SCM at = (gh_list (ly_symbol2scm ("char"), gh_int2scm (cm->code), SCM_UNDEFINED)); diff --git a/lily/align-interface.cc b/lily/align-interface.cc index 7aa6de3fc8..af9d3763e6 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -17,12 +17,12 @@ This callback is set in the children of the align element. It does not compute anything, but a side effect of a->do_side_processing () is that the elements are placed correctly. */ -MAKE_SCHEME_CALLBACK(Align_interface,alignment_callback,2); +MAKE_SCHEME_CALLBACK (Align_interface,alignment_callback,2); SCM Align_interface::alignment_callback (SCM element_smob, SCM axis) { Grob * me = unsmob_grob (element_smob); - Axis ax = (Axis )gh_scm2int (axis); + Axis ax = (Axis)gh_scm2int (axis); Grob * par = me->parent_l (ax); if (par && !to_boolean (par->get_grob_property ("alignment-done"))) { @@ -31,12 +31,12 @@ Align_interface::alignment_callback (SCM element_smob, SCM axis) return gh_double2scm (0.0); } -MAKE_SCHEME_CALLBACK(Align_interface,fixed_distance_alignment_callback,2); +MAKE_SCHEME_CALLBACK (Align_interface,fixed_distance_alignment_callback,2); SCM Align_interface::fixed_distance_alignment_callback (SCM element_smob, SCM axis) { Grob * me = unsmob_grob (element_smob); - Axis ax = (Axis )gh_scm2int (axis); + Axis ax = (Axis)gh_scm2int (axis); Grob * par = me->parent_l (ax); if (par && !to_boolean (par->get_grob_property ("alignment-done"))) { @@ -53,7 +53,7 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a) SCM d = me->get_grob_property ("stacking-dir"); - Direction stacking_dir = gh_number_p(d) ? to_dir (d) : CENTER; + Direction stacking_dir = gh_number_p (d) ? to_dir (d) : CENTER; if (!stacking_dir) stacking_dir = DOWN; @@ -67,9 +67,9 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a) } Link_array elems - = Pointer_group_interface__extract_elements ( me, (Grob*) 0, "elements"); + = Pointer_group_interface__extract_elements (me, (Grob*) 0, "elements"); Real where_f=0; - for (int j=0 ; j < elems.size(); j++) + for (int j=0 ; j < elems.size (); j++) { where_f += stacking_dir * dy; elems[j]->translate_axis (where_f, a); @@ -88,7 +88,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) SCM d = me->get_grob_property ("stacking-dir"); - Direction stacking_dir = gh_number_p(d) ? to_dir (d) : CENTER; + Direction stacking_dir = gh_number_p (d) ? to_dir (d) : CENTER; if (!stacking_dir) stacking_dir = DOWN; @@ -108,12 +108,12 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) Link_array elems; Link_array all_grobs = Pointer_group_interface__extract_elements (me, (Grob*) 0, "elements"); - for (int i=0; i < all_grobs.size(); i++) + for (int i=0; i < all_grobs.size (); i++) { - Interval y = all_grobs[i]->extent(me, a); - if (!y.empty_b()) + Interval y = all_grobs[i]->extent (me, a); + if (!y.empty_b ()) { - Grob *e =dynamic_cast(all_grobs[i]); + Grob *e =dynamic_cast (all_grobs[i]); // todo: fucks up if item both in Halign & Valign. SCM min_dims = e->remove_grob_property ("minimum-space"); @@ -129,7 +129,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) gh_number_p (gh_car (extra_dims)) && gh_number_p (gh_cdr (extra_dims))) { - y[LEFT] += gh_scm2double (gh_car (extra_dims)); + y[LEFT] += gh_scm2double (gh_car (extra_dims)); y[RIGHT] += gh_scm2double (gh_cdr (extra_dims)); } @@ -148,15 +148,15 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) String s ("self-alignment-"); - s += (a == X_AXIS) ? "X" : "Y"; + s += (a == X_AXIS) ? "X" : "Y"; - SCM align (me->get_grob_property (s.ch_C())); + SCM align (me->get_grob_property (s.ch_C ())); Array translates ; Interval total; Real where_f=0; - for (int j=0 ; j < elems.size(); j++) + for (int j=0 ; j < elems.size (); j++) { Real dy = 0.0; dy = - stacking_dir * dims[j][-stacking_dir]; @@ -165,12 +165,12 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) if (j) { - dy = (dy >? threshold[SMALLER] ) + dy = (dy >? threshold[SMALLER]) all_translates; - if (translates.size ()) + if (translates.size ()) { int i =0; int j =0; @@ -200,7 +200,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) j++; } - if (isdir_b (align)) + if (isdir_b (align)) { center_offset = total.linear_combination (gh_scm2double (align)); } @@ -253,7 +253,7 @@ Align_interface::set_interface (Grob*me) void Align_interface::set_axis (Grob*me,Axis a) { - Axis_group_interface::set_axes (me, a,a ); + Axis_group_interface::set_axes (me, a,a); } bool diff --git a/lily/align-note-column-engraver.cc b/lily/align-note-column-engraver.cc index 87dd0f0794..b1259ab1dd 100644 --- a/lily/align-note-column-engraver.cc +++ b/lily/align-note-column-engraver.cc @@ -32,11 +32,11 @@ class Align_note_column_engraver: public Engraver virtual void finalize (); virtual void acknowledge_grob (Grob_info); public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Align_note_column_engraver (); }; -Align_note_column_engraver::Align_note_column_engraver() +Align_note_column_engraver::Align_note_column_engraver () { align_item_p_ =0; now_column_l_ =0; @@ -72,7 +72,7 @@ Align_note_column_engraver::finalize () void Align_note_column_engraver::acknowledge_grob (Grob_info inf) { - if (Note_column::has_interface(inf.elem_l_)) + if (Note_column::has_interface (inf.elem_l_)) { now_column_l_ =inf.elem_l_; } @@ -98,12 +98,12 @@ Align_note_column_engraver::create_grobs () use that to space grace notes. */ SCM grsp = get_property ("graceAccidentalSpace") ; - if (gh_number_p(grsp)) + if (gh_number_p (grsp)) { /* ugh. */ - Real extra_space = gh_scm2double(grsp); + Real extra_space = gh_scm2double (grsp); SCM e = gh_cons (gh_double2scm (-extra_space), gh_double2scm (0.0)); now_column_l_->set_grob_property ("extra-space", e); @@ -128,5 +128,5 @@ Align_note_column_engraver::start_translation_timestep () accidental_l_ =0; } -ADD_THIS_TRANSLATOR(Align_note_column_engraver); +ADD_THIS_TRANSLATOR (Align_note_column_engraver); diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 6f749f85cc..a19fb2aa8b 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -43,21 +43,21 @@ All_font_metrics::find_afm (String name) SCM val; - if (!afm_p_dict_->try_retrieve (sname, &val)) + if (!afm_p_dict_->try_retrieve (sname, &val)) { String path; - if (path.empty_b()) + if (path.empty_b ()) path = search_path_.find (name + ".afm"); if (path.empty_b ()) { - char * p = ly_find_afm (name.ch_C()); + char * p = ly_find_afm (name.ch_C ()); if (p) path = p; } - if (path.empty_b()) + if (path.empty_b ()) return 0; if (verbose_global_b) @@ -76,19 +76,19 @@ All_font_metrics::find_afm (String name) Adobe_font_metric *afm - = dynamic_cast (unsmob_metrics (val) ); + = dynamic_cast (unsmob_metrics (val)); Tex_font_metric * tfm = find_tfm (name); if (tfm->info_.checksum != afm->checksum_) { String s = _f ("checksum mismatch for font file: `%s'", path.ch_C ()); - s += " " + _f ("does not match: `%s'", tfm->path_.ch_C()); // FIXME + s += " " + _f ("does not match: `%s'", tfm->path_.ch_C ()); // FIXME s += "\n"; s += " TFM: " + to_str ((int) tfm->info_.checksum); s += " AFM: " + to_str ((int) afm->checksum_); s += "\n"; - s += _(" Rebuild all .afm files, and remove all .pk and .tfm files. Rerun with -V to show font paths."); + s += _ (" Rebuild all .afm files, and remove all .pk and .tfm files. Rerun with -V to show font paths."); error (s); } @@ -109,16 +109,16 @@ All_font_metrics::find_tfm (String name) { String path; - if (path.empty_b()) + if (path.empty_b ()) { - char * p = ly_find_tfm (name.ch_C()); + char * p = ly_find_tfm (name.ch_C ()); if (p) path = p; } - if (path.empty_b()) + if (path.empty_b ()) path = search_path_.find (name + ".tfm"); - if (path.empty_b()) + if (path.empty_b ()) return 0; diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index 5cbf5c17ec..900949224c 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -86,7 +86,7 @@ Arpeggio::brew_molecule (SCM smob) vertical alignment if it is cross-staff. This callback also adds padding. */ -MAKE_SCHEME_CALLBACK(Arpeggio, width_callback,2); +MAKE_SCHEME_CALLBACK (Arpeggio, width_callback,2); SCM Arpeggio::width_callback (SCM smob, SCM axis) { diff --git a/lily/audio-column.cc b/lily/audio-column.cc index fd1255eda2..59d5730d33 100644 --- a/lily/audio-column.cc +++ b/lily/audio-column.cc @@ -26,7 +26,7 @@ Audio_column::add_audio_item (Audio_item* l) } Moment -Audio_column::at_mom() const +Audio_column::at_mom () const { return at_mom_; } diff --git a/lily/audio-element-info.cc b/lily/audio-element-info.cc index c42ad1a443..b3505fb882 100644 --- a/lily/audio-element-info.cc +++ b/lily/audio-element-info.cc @@ -17,7 +17,7 @@ Audio_element_info::Audio_element_info (Audio_element*s_l, Music *r_l) } -Audio_element_info::Audio_element_info() +Audio_element_info::Audio_element_info () { elem_l_ = 0; req_l_ = 0; diff --git a/lily/audio-element.cc b/lily/audio-element.cc index ca124d9704..6de8b5f247 100644 --- a/lily/audio-element.cc +++ b/lily/audio-element.cc @@ -14,7 +14,7 @@ Audio_element::Audio_element () grace_b_ = false; } -Audio_element::~Audio_element() +Audio_element::~Audio_element () { } diff --git a/lily/audio-staff.cc b/lily/audio-staff.cc index fe9ecaf9f4..4a89b66555 100644 --- a/lily/audio-staff.cc +++ b/lily/audio-staff.cc @@ -24,8 +24,8 @@ Audio_staff::output (Midi_stream& midi_stream_r, int track_i) { Midi_track midi_track; midi_track.number_i_ = track_i; - for (Midi_walker i (this, &midi_track); i.ok(); i++) - i.process(); + for (Midi_walker i (this, &midi_track); i.ok (); i++) + i.process (); midi_stream_r << midi_track; } diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 27283b34dd..6f0f0e1dab 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -117,8 +117,8 @@ Auto_beam_engraver::test_moment (Direction dir, Moment test_mom) else function = gh_list (ly_symbol2scm ("end"), SCM_UNDEFINED); - Moment one_beat = *unsmob_moment( get_property ("beatLength")); - int num = *unsmob_moment (get_property("measureLength")) / one_beat; + Moment one_beat = *unsmob_moment (get_property ("beatLength")); + int num = *unsmob_moment (get_property ("measureLength")) / one_beat; int den = one_beat.den_i (); SCM time = gh_list (gh_int2scm (num), gh_int2scm (den), SCM_UNDEFINED); @@ -130,7 +130,7 @@ Auto_beam_engraver::test_moment (Direction dir, Moment test_mom) /* first guess */ /* begin beam at any position - (and fallback for end) */ + (and fallback for end) */ Moment moment (0); /* end beam at end of beat */ @@ -229,7 +229,7 @@ Auto_beam_engraver::create_beam_p () scm_unprotect_object (beam_p->self_scm ()); return 0; } - Beam::add_stem (beam_p,(*stem_l_arr_p_)[i]); + Beam::add_stem (beam_p, (*stem_l_arr_p_)[i]); } announce_grob (beam_p, 0); @@ -450,7 +450,7 @@ Auto_beam_engraver::create_grobs () { Moment now = now_mom (); if ((extend_mom_ < now) - || ((extend_mom_ == now) && (last_add_mom_ != now ))) + || ((extend_mom_ == now) && (last_add_mom_ != now))) { end_beam (); } diff --git a/lily/auto-change-iterator.cc b/lily/auto-change-iterator.cc index 9e3bb205db..d39c10d5d5 100644 --- a/lily/auto-change-iterator.cc +++ b/lily/auto-change-iterator.cc @@ -31,7 +31,7 @@ Auto_change_iterator::change_to (Music_iterator *it, String to_type, If \translator Staff = bass, then look for Staff = * */ - while (current && current->type_str_ != to_type) + while (current && current->type_str_ != to_type) { last = current; current = current->daddy_trans_l_; @@ -75,7 +75,7 @@ Auto_change_iterator::change_to (Music_iterator *it, String to_type, will confuse the autochanger, since it will not notice that the music for OTHERSTAFF is not his. - PRECONDITION: this->ok() holds. + PRECONDITION: this->ok () holds. */ Array Auto_change_iterator::pending_pitch (Moment m) const @@ -95,7 +95,7 @@ Auto_change_iterator::pending_pitch (Moment m) const break; iter->skip (m); - if (!iter->ok()) + if (!iter->ok ()) break; m = iter->pending_moment (); @@ -110,7 +110,7 @@ Auto_change_iterator::process (Moment m) { /* first we get the pitches, then we do the real work. - Music_wrapper_iterator::process() might process (and throw away) + Music_wrapper_iterator::process () might process (and throw away) pitches we need. */ Array ps = pending_pitch (m); @@ -118,20 +118,20 @@ Auto_change_iterator::process (Moment m) if (ps.size ()) { Pitch p = ps[0]; - Direction s = Direction (sign(p.steps ())); + Direction s = Direction (sign (p.steps ())); if (s != where_dir_) { where_dir_ = s; - String to_id = (s >= 0) ? "up" : "down"; + String to_id = (s >= 0) ? "up" : "down"; String wh = ly_scm2string (music_l_->get_mus_property ("what")); change_to (child_iter_p_, wh, to_id); } } } -Auto_change_iterator::Auto_change_iterator( ) +Auto_change_iterator::Auto_change_iterator () { where_dir_ = CENTER; } -IMPLEMENT_CTOR_CALLBACK(Auto_change_iterator); +IMPLEMENT_CTOR_CALLBACK (Auto_change_iterator); diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index 6e22f40b6b..de404ca62f 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -21,18 +21,18 @@ class Axis_group_engraver : public Engraver protected: Spanner *staffline_p_; Link_array elts_; - virtual void initialize(); - virtual void finalize(); + virtual void initialize (); + virtual void finalize (); virtual void acknowledge_grob (Grob_info); virtual void create_grobs (); virtual Spanner* get_spanner_p () const; virtual void add_element (Grob*) ; public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Axis_group_engraver (); }; -ADD_THIS_TRANSLATOR(Axis_group_engraver); +ADD_THIS_TRANSLATOR (Axis_group_engraver); Axis_group_engraver::Axis_group_engraver () { @@ -48,7 +48,7 @@ Axis_group_engraver::initialize () Grob * it = unsmob_grob (get_property ("currentCommandColumn")); - staffline_p_->set_bound(LEFT,it); + staffline_p_->set_bound (LEFT,it); announce_grob (staffline_p_, 0); } @@ -63,7 +63,7 @@ void Axis_group_engraver::finalize () { String type = daddy_grav_l ()->type_str_ ; - SCM dims = get_property ((type + "VerticalExtent").ch_C()); + SCM dims = get_property ((type + "VerticalExtent").ch_C ()); if (gh_pair_p (dims) && gh_number_p (gh_car (dims)) && gh_number_p (gh_cdr (dims))) @@ -72,12 +72,12 @@ Axis_group_engraver::finalize () staffline_p_->set_grob_property ("extent-Y", dims); } - dims = get_property ((type + "MinimumVerticalExtent").ch_C()); + dims = get_property ((type + "MinimumVerticalExtent").ch_C ()); if (gh_pair_p (dims) && gh_number_p (gh_car (dims)) && gh_number_p (gh_cdr (dims))) staffline_p_->set_grob_property ("minimum-extent-Y", dims); - dims = get_property ((type + "ExtraVerticalExtent").ch_C()); + dims = get_property ((type + "ExtraVerticalExtent").ch_C ()); if (gh_pair_p (dims) && gh_number_p (gh_car (dims)) && gh_number_p (gh_cdr (dims))) staffline_p_->set_grob_property ("extra-extent-Y", dims); @@ -85,7 +85,7 @@ Axis_group_engraver::finalize () Grob * it = unsmob_grob (get_property ("currentCommandColumn")); - staffline_p_->set_bound(RIGHT,it); + staffline_p_->set_bound (RIGHT,it); typeset_grob (staffline_p_); staffline_p_ = 0; @@ -135,7 +135,7 @@ protected: virtual void acknowledge_grob (Grob_info); virtual void add_element (Grob *e); public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); }; void @@ -163,4 +163,4 @@ Hara_kiri_engraver::acknowledge_grob (Grob_info i) Hara_kiri_group_spanner::add_interesting_item (staffline_p_, i.elem_l_); } } -ADD_THIS_TRANSLATOR(Hara_kiri_engraver); +ADD_THIS_TRANSLATOR (Hara_kiri_engraver); diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index b7a8ec5a20..e133402284 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -26,7 +26,7 @@ Axis_group_interface::add_element (Grob*me,Grob *e) } bool -Axis_group_interface::axis_b (Grob*me,Axis a ) +Axis_group_interface::axis_b (Grob*me,Axis a) { /* urg. FIXME, check for Hara_kiri_group_spanner shouldn't be necessary? @@ -34,7 +34,7 @@ Axis_group_interface::axis_b (Grob*me,Axis a ) */ return me->has_extent_callback_b (group_extent_callback_proc, a) || - (me->has_extent_callback_b (Hara_kiri_group_spanner::y_extent_proc, a)); + (me->has_extent_callback_b (Hara_kiri_group_spanner::y_extent_proc, a)); } Interval @@ -51,14 +51,14 @@ Axis_group_interface::relative_group_extent (Axis a, Grob *common, SCM elts) return r; } -MAKE_SCHEME_CALLBACK(Axis_group_interface,group_extent_callback,2); +MAKE_SCHEME_CALLBACK (Axis_group_interface,group_extent_callback,2); SCM Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis) { Grob *me = unsmob_grob (element_smob); Axis a = (Axis) gh_scm2int (scm_axis); - Grob * common =(Grob*) me; + Grob * common = (Grob*) me; for (SCM s = me->get_grob_property ("elements"); gh_pair_p (s); s = gh_cdr (s)) { diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index 540c321396..23e22f0e16 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -22,13 +22,13 @@ class Bar_engraver : public Engraver { public: - Bar_engraver(); - VIRTUAL_COPY_CONS(Translator); + Bar_engraver (); + VIRTUAL_COPY_CONS (Translator); void request_bar (String type_str); protected: virtual void finalize (); - virtual void stop_translation_timestep(); + virtual void stop_translation_timestep (); virtual void create_grobs (); private: @@ -38,7 +38,7 @@ private: Item * bar_p_; }; -Bar_engraver::Bar_engraver() +Bar_engraver::Bar_engraver () { bar_p_ =0; } @@ -91,7 +91,7 @@ Bar_engraver::typeset_bar () lines may only be broken if there is a barline in all staffs */ void -Bar_engraver::stop_translation_timestep() +Bar_engraver::stop_translation_timestep () { if (!bar_p_) { @@ -111,4 +111,4 @@ Bar_engraver::stop_translation_timestep() typeset_bar (); } -ADD_THIS_TRANSLATOR(Bar_engraver); +ADD_THIS_TRANSLATOR (Bar_engraver); diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index eb91eeef96..92d45eabf9 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -28,11 +28,11 @@ protected: virtual void acknowledge_grob (Grob_info); virtual void initialize (); virtual void create_grobs (); - void create_items(); + void create_items (); public: - VIRTUAL_COPY_CONS(Translator); - Bar_number_engraver(); + VIRTUAL_COPY_CONS (Translator); + Bar_number_engraver (); }; @@ -43,10 +43,10 @@ public: void Bar_number_engraver::create_grobs () { - // todo include (&&!time->cadenza_b_ ) - SCM bn = get_property("currentBarNumber"); + // todo include (&&!time->cadenza_b_) + SCM bn = get_property ("currentBarNumber"); SCM smp = get_property ("measurePosition"); - Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); + Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); if (gh_number_p (bn) && !mp && now_mom () > Moment (0)) @@ -55,11 +55,11 @@ Bar_number_engraver::create_grobs () // guh. text_p_->set_grob_property ("text", - ly_str02scm (to_str (gh_scm2int (bn)).ch_C())); + ly_str02scm (to_str (gh_scm2int (bn)).ch_C ())); } } -ADD_THIS_TRANSLATOR(Bar_number_engraver); +ADD_THIS_TRANSLATOR (Bar_number_engraver); Bar_number_engraver::Bar_number_engraver () { @@ -119,7 +119,7 @@ Bar_number_engraver::create_items () SCM b = get_property ("BarNumber"); text_p_ = new Item (b); - Side_position_interface::set_axis(text_p_,Y_AXIS); + Side_position_interface::set_axis (text_p_,Y_AXIS); announce_grob (text_p_, 0); } diff --git a/lily/bar.cc b/lily/bar.cc index 6d0c9a968b..33b7e5af4d 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -21,7 +21,7 @@ #include "item.hh" #include "staff-symbol-referencer.hh" -MAKE_SCHEME_CALLBACK(Bar,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Bar,brew_molecule,1); SCM Bar::brew_molecule (SCM smob) @@ -61,13 +61,16 @@ Bar::compound_barline (Grob*me, String str, Real h) Molecule thin = simple_barline (me, hair, h); Molecule thick = simple_barline (me, fatline, h); - Molecule colon = Font_interface::get_default_font (me)->find_by_name ("dots-repeatcolon"); + Molecule colon = Font_interface::get_default_font (me)->find_by_name ( + Staff_symbol_referencer::line_count (me) & 1 == 1 ? + "dots-repeatcolon" : "dots-evenrepeatcolon" + ); Molecule m; if (str == "") { - return Lookup::blank (Box (Interval(0, 0), Interval (-h/2, h/2))); + return Lookup::blank (Box (Interval (0, 0), Interval (-h/2, h/2))); } else if (str == "|") { @@ -120,13 +123,13 @@ Bar::compound_barline (Grob*me, String str, Real h) Molecule Bar::simple_barline (Grob*,Real w, Real h) { - return Lookup::filledbox (Box (Interval(0,w), Interval(-h/2, h/2))); + return Lookup::filledbox (Box (Interval (0,w), Interval (-h/2, h/2))); } -MAKE_SCHEME_CALLBACK(Bar,before_line_breaking ,1); +MAKE_SCHEME_CALLBACK (Bar,before_line_breaking ,1); SCM -Bar::before_line_breaking (SCM smob) +Bar::before_line_breaking (SCM smob) { Grob*me=unsmob_grob (smob); Item * item = dynamic_cast (me); @@ -148,7 +151,7 @@ Bar::before_line_breaking (SCM smob) // leave y_extent for spanbar? } - if (! gh_equal_p (g, orig)) + if (! gh_equal_p (g, orig)) me->set_grob_property ("glyph", g); @@ -188,7 +191,7 @@ Bar::has_interface (Grob*m) } -MAKE_SCHEME_CALLBACK(Bar,get_staff_bar_size,1); +MAKE_SCHEME_CALLBACK (Bar,get_staff_bar_size,1); SCM Bar::get_staff_bar_size (SCM smob) { @@ -196,7 +199,7 @@ Bar::get_staff_bar_size (SCM smob) Real ss = Staff_symbol_referencer::staff_space (me); SCM size = me->get_grob_property ("bar-size"); if (gh_number_p (size)) - return gh_double2scm (gh_scm2double(size)*ss); + return gh_double2scm (gh_scm2double (size)*ss); else if (Staff_symbol_referencer::staff_symbol_l (me)) { /* diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 824cf0344e..b5ebc0156f 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -69,7 +69,7 @@ Beam_engraver::Beam_engraver () bool Beam_engraver::try_music (Music *m) { - if (Span_req * c = dynamic_cast(m)) + if (Span_req * c = dynamic_cast (m)) { if (scm_equal_p (c->get_mus_property ("span-type"), ly_str02scm ("abort")) == SCM_BOOL_T) @@ -88,15 +88,15 @@ Beam_engraver::try_music (Music *m) if (d == STOP && !beam_p_) { - m->origin ()->warning (_ ("can't find start of beam")); + m->origin ()->warning (_ ("can't find start of beam")); return false; } - if(d == STOP) + if (d == STOP) { SCM m = get_property ("automaticMelismata"); - SCM b = get_property("noAutoBeaming"); - if (to_boolean (m) && to_boolean(b)) + SCM b = get_property ("noAutoBeaming"); + if (to_boolean (m) && to_boolean (b)) { set_melisma (false); } @@ -121,7 +121,7 @@ Beam_engraver::process_music () if (reqs_drul_[STOP]) { if (!beam_p_) - reqs_drul_[STOP]->origin ()->warning (_("can't find start of beam")); + reqs_drul_[STOP]->origin ()->warning (_ ("can't find start of beam")); prev_start_req_ =0; finished_beam_p_ = beam_p_; finished_beam_info_p_ = beam_info_p_; @@ -162,10 +162,10 @@ Beam_engraver::create_grobs () prev_start_req_ = reqs_drul_[START]; beam_p_ = new Spanner (get_property ("Beam")); SCM smp = get_property ("measurePosition"); - Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); + Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); beam_start_location_ = mp; - beam_start_mom_ = now_mom(); + beam_start_mom_ = now_mom (); beam_info_p_ = new Beaming_info_list; @@ -198,10 +198,10 @@ void Beam_engraver::start_translation_timestep () { reqs_drul_ [START] =0; - if(beam_p_) { + if (beam_p_) { SCM m = get_property ("automaticMelismata"); - SCM b = get_property("noAutoBeaming"); - if (to_boolean (m) && to_boolean(b)) { + SCM b = get_property ("noAutoBeaming"); + if (to_boolean (m) && to_boolean (b)) { set_melisma (true); } } @@ -282,7 +282,7 @@ Beam_engraver::acknowledge_grob (Grob_info info) gh_int2scm (durlog)); Moment stem_location = now_mom () - beam_start_mom_ + beam_start_location_; beam_info_p_->add_stem (stem_location, - (durlog- 2) >? 1); + (durlog- 2) >? 1); Beam::add_stem (beam_p_, stem_l); } } @@ -290,5 +290,5 @@ Beam_engraver::acknowledge_grob (Grob_info info) -ADD_THIS_TRANSLATOR(Beam_engraver); +ADD_THIS_TRANSLATOR (Beam_engraver); diff --git a/lily/beam.cc b/lily/beam.cc index a28b7b56de..2e0615baf4 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -36,7 +36,7 @@ void Beam::add_stem (Grob*me, Grob*s) { - Pointer_group_interface:: add_element(me, "stems", s); + Pointer_group_interface:: add_element (me, "stems", s); s->add_dependency (me); @@ -68,7 +68,7 @@ Beam::get_multiplicity (Grob*me) [Alternatively, stems could set its own directions, according to their beam, during 'final-pre-processing'.] */ -MAKE_SCHEME_CALLBACK(Beam,before_line_breaking,1); +MAKE_SCHEME_CALLBACK (Beam,before_line_breaking,1); SCM Beam::before_line_breaking (SCM smob) { @@ -120,7 +120,7 @@ Beam::get_default_dir (Grob*me) count[d] ++; } - } while (flip(&d) != DOWN); + } while (flip (&d) != DOWN); SCM func = me->get_grob_property ("dir-function"); SCM s = gh_call2 (func, @@ -148,7 +148,7 @@ void Beam::set_stem_directions (Grob*me) { Link_array stems - =Pointer_group_interface__extract_elements (me, (Item*) 0, "stems"); + =Pointer_group_interface__extract_elements (me, (Item*) 0, "stems"); Direction d = Directional_element_interface::get (me); for (int i=0; i set_grob_property ("dy", gh_double2scm (0)); /* Hmm, callbacks should be called by, a eh, callback mechanism - somewhere(?), I guess, not by looping here. */ + somewhere (?), I guess, not by looping here. */ SCM list = me->get_grob_property ("y-dy-callbacks"); for (SCM i = list; gh_pair_p (i); i = gh_cdr (i)) @@ -387,7 +387,7 @@ Beam::cancel_suspect_slope (SCM smob) Real dx = last_visible_stem (me)->relative_coordinate (0, X_AXIS) - first_visible_stem (me)->relative_coordinate (0, X_AXIS); Real dydx = dy && dx ? dy/dx : 0; - if (((y - first_ideal > lengthened) && (dydx > steep)) + if (( (y - first_ideal > lengthened) && (dydx > steep)) || ((y + dy - last_ideal > lengthened) && (dydx < -steep))) { Real adjusted_y = y + dy / 2; @@ -614,7 +614,7 @@ Beam::check_stem_length_f (Grob*me,Real y, Real dy) Link_array stems= Pointer_group_interface__extract_elements (me, (Item*)0, "stems"); - for (int i=0; i < stems.size(); i++) + for (int i=0; i < stems.size (); i++) { Item* s = stems[i]; if (Stem::invisible_b (s)) @@ -713,7 +713,7 @@ Beam::quantise_y_f (Grob*me,Real y, Real dy, int quant_dir) Real q = up_y - iv[SMALLER] <= iv[BIGGER] - up_y ? iv[SMALLER] : iv[BIGGER]; if (quant_dir) - q = iv[(Direction)quant_dir]; + q = iv[ (Direction)quant_dir]; return q * Directional_element_interface::get (me); } @@ -725,7 +725,7 @@ Beam::set_beaming (Grob*me,Beaming_info_list *beaming) Pointer_group_interface__extract_elements (me, (Grob*)0, "stems"); Direction d = LEFT; - for (int i=0; i < stems.size(); i++) + for (int i=0; i < stems.size (); i++) { do { @@ -754,8 +754,8 @@ Molecule Beam::stem_beams (Grob*me,Item *here, Item *next, Item *prev) { // ugh -> use commonx - if ((next && !(next->relative_coordinate (0, X_AXIS) > here->relative_coordinate (0, X_AXIS))) || - (prev && !(prev->relative_coordinate (0, X_AXIS) < here->relative_coordinate (0, X_AXIS)))) + if ((next && ! (next->relative_coordinate (0, X_AXIS) > here->relative_coordinate (0, X_AXIS))) || + (prev && ! (prev->relative_coordinate (0, X_AXIS) < here->relative_coordinate (0, X_AXIS)))) programming_error ("Beams are not left-to-right"); Real staffline_f = me->paper_l ()->get_var ("stafflinethickness"); @@ -824,14 +824,14 @@ Beam::stem_beams (Grob*me,Item *here, Item *next, Item *prev) Real w = next->relative_coordinate (0, X_AXIS) - here->relative_coordinate (0, X_AXIS); Molecule a = Lookup::beam (dydx, w + stemdx, thick); - a.translate_axis( - stemdx/2, X_AXIS); + a.translate_axis (- stemdx/2, X_AXIS); int j = 0; Real gap_f = 0; SCM gap = me->get_grob_property ("gap"); if (gh_number_p (gap)) { - int gap_i = gh_scm2int ( (gap)); + int gap_i = gh_scm2int ((gap)); int nogap = rwholebeams - gap_i; for (; j < nogap; j++) @@ -874,7 +874,7 @@ Beam::stem_beams (Grob*me,Item *here, Item *next, Item *prev) return leftbeams; } -MAKE_SCHEME_CALLBACK(Beam,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Beam,brew_molecule,1); SCM Beam::brew_molecule (SCM smob) { @@ -895,7 +895,7 @@ Beam::brew_molecule (SCM smob) else { x0 = stems[0]->relative_coordinate (0, X_AXIS); - dx = stems.top()->relative_coordinate (0, X_AXIS) - x0; + dx = stems.top ()->relative_coordinate (0, X_AXIS) - x0; } @@ -904,11 +904,11 @@ Beam::brew_molecule (SCM smob) Real y = gh_scm2double (me->get_grob_property ("y")); - for (int j=0; j 0)? stems[j-1] : 0; - Item * next = (j < stems.size()-1) ? stems[j+1] :0; + Item * next = (j < stems.size ()-1) ? stems[j+1] :0; Molecule sb = stem_beams (me, i, next, prev); Real x = i->relative_coordinate (0, X_AXIS)-x0; @@ -925,7 +925,7 @@ int Beam::forced_stem_count (Grob*me) { Link_arraystems = - Pointer_group_interface__extract_elements ( me, (Item*) 0, "stems"); + Pointer_group_interface__extract_elements (me, (Item*) 0, "stems"); int f = 0; for (int i=0; i < stems.size (); i++) { @@ -934,8 +934,8 @@ Beam::forced_stem_count (Grob*me) if (Stem::invisible_b (s)) continue; - if (((int)Stem::chord_start_f (s)) - && (Stem::get_direction (s ) != Stem::get_default_dir (s ))) + if (( (int)Stem::chord_start_f (s)) + && (Stem::get_direction (s) != Stem::get_default_dir (s))) f++; } return f; @@ -962,10 +962,10 @@ Beam::visible_stem_count (Grob*me) } Item* -Beam::first_visible_stem(Grob*me) +Beam::first_visible_stem (Grob*me) { Link_arraystems = - Pointer_group_interface__extract_elements ( me, (Item*) 0, "stems"); + Pointer_group_interface__extract_elements (me, (Item*) 0, "stems"); for (int i = 0; i < stems.size (); i++) { @@ -976,10 +976,10 @@ Beam::first_visible_stem(Grob*me) } Item* -Beam::last_visible_stem(Grob*me) +Beam::last_visible_stem (Grob*me) { Link_arraystems = - Pointer_group_interface__extract_elements ( me, (Item*) 0, "stems"); + Pointer_group_interface__extract_elements (me, (Item*) 0, "stems"); for (int i = stems.size (); i--;) { if (!Stem::invisible_b (stems[i])) @@ -998,7 +998,7 @@ Beam::last_visible_stem(Grob*me) rest -> stem -> beam -> interpolate_y_position () */ -MAKE_SCHEME_CALLBACK(Beam,rest_collision_callback,2); +MAKE_SCHEME_CALLBACK (Beam,rest_collision_callback,2); SCM Beam::rest_collision_callback (SCM element_smob, SCM axis) { @@ -1030,8 +1030,8 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis) beam_y = gh_scm2double (s); // ugh -> use commonx - Real x0 = first_visible_stem(beam)->relative_coordinate (0, X_AXIS); - Real dx = last_visible_stem(beam)->relative_coordinate (0, X_AXIS) - x0; + Real x0 = first_visible_stem (beam)->relative_coordinate (0, X_AXIS); + Real dx = last_visible_stem (beam)->relative_coordinate (0, X_AXIS) - x0; Real dydx = beam_dy && dx ? beam_dy/dx : 0; Direction d = Stem::get_direction (stem); @@ -1056,7 +1056,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis) if (discrete_dist < stafflines+1) discrete_dist = int (ceil (discrete_dist / 2.0)* 2.0); - return gh_double2scm (-d * discrete_dist); + return gh_double2scm (-d * discrete_dist); } diff --git a/lily/beaming-info.cc b/lily/beaming-info.cc index 653e1b3382..fb828388de 100644 --- a/lily/beaming-info.cc +++ b/lily/beaming-info.cc @@ -9,14 +9,14 @@ #include "beaming.hh" -Beaming_info::Beaming_info( ) +Beaming_info::Beaming_info () { start_mom_ = 0; beams_i_drul_[LEFT] = 0; beams_i_drul_[RIGHT] = 0; } -Beaming_info::Beaming_info(Moment m, int i) +Beaming_info::Beaming_info (Moment m, int i) { start_mom_ = m; beams_i_drul_[LEFT] = i; @@ -31,12 +31,12 @@ Beaming_info_list::min_denominator_index () const int minden = infinity_i; int minidx = -1; - for (int i=1; i < infos_.size ( ); i++) + for (int i=1; i < infos_.size (); i++) { if (infos_[i].start_mom_.den_i () < minden) { minidx = i; - minden = infos_[i].start_mom_.den_i (); + minden = infos_[i].start_mom_.den_i (); } } @@ -93,5 +93,5 @@ Beaming_info_list::beamify () void Beaming_info_list::add_stem (Moment m, int b) { - infos_.push (Beaming_info (m, b)); + infos_.push (Beaming_info (m, b)); } diff --git a/lily/bezier-bow.cc b/lily/bezier-bow.cc index 13fbba0c34..b98b613c1e 100644 --- a/lily/bezier-bow.cc +++ b/lily/bezier-bow.cc @@ -16,7 +16,7 @@ static Real F0_1 (Real x) { - return 2 / M_PI * atan ( M_PI * x / 2); + return 2 / M_PI * atan (M_PI * x / 2); } Real @@ -29,19 +29,19 @@ slur_height (Real width, Real h_inf, Real r_0) For small w, the height should be proportional to w, for w -> infinity, the height should rise to a limit asymptotically. - Hence we take F(x) such that - F(0) = 0 , F'(0) = 1, and F(infty) = 1 + Hence we take F (x) such that + F (0) = 0 , F' (0) = 1, and F (infty) = 1 and use - h = h_infinity * F(x * r_0 / h_infinity) + h = h_infinity * F (x * r_0 / h_infinity) Examples: - * F(x) = 2/pi * atan (pi x/2) + * F (x) = 2/pi * atan (pi x/2) - * F(x) 1/alpha * x^alpha / (1 + x^alpha) + * F (x) 1/alpha * x^alpha / (1 + x^alpha) * (etc.) @@ -49,7 +49,7 @@ slur_height (Real width, Real h_inf, Real r_0) `small' slurs to `big' slurs occurs.] Although this might seem cand_idates to SCM-ify, it is not all clear - which parameters (ie. h_inf, r_0, F(.)) should be candidates for + which parameters (ie. h_inf, r_0, F (.)) should be candidates for this. At present h_inf and r_0 come from paper settings, but we did no experiments for determining the best combinations of F, h_inf and r_0. diff --git a/lily/bezier.cc b/lily/bezier.cc index 945a1ccda3..fbbbc6c867 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -34,8 +34,8 @@ scale (Array* arr_p, Real x , Real y) { for (int i = 0; i < arr_p->size (); i++) { - (*arr_p)[i][X_AXIS] = x* (*arr_p)[i][X_AXIS]; - (*arr_p)[i][Y_AXIS] = y* (*arr_p)[i][Y_AXIS]; + (*arr_p)[i][X_AXIS] = x* (*arr_p)[i][X_AXIS]; + (*arr_p)[i][Y_AXIS] = y* (*arr_p)[i][Y_AXIS]; } } @@ -44,21 +44,21 @@ rotate (Array* arr_p, Real phi) { Offset rot (complex_exp (Offset (0, phi))); for (int i = 0; i < arr_p->size (); i++) - (*arr_p)[i] = complex_multiply (rot, (*arr_p)[i]); + (*arr_p)[i] = complex_multiply (rot, (*arr_p)[i]); } void translate (Array* arr_p, Offset o) { for (int i = 0; i < arr_p->size (); i++) - (*arr_p)[i] += o; + (*arr_p)[i] += o; } /* Formula of the bezier 3-spline - sum_{j=0}^3 (3 over j) z_j (1-t)^(3-j) t^j + sum_{j=0}^3 (3 over j) z_j (1-t)^ (3-j) t^j */ Real @@ -84,7 +84,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++) @@ -115,7 +115,7 @@ Bezier::polynomial (Axis a)const p += control_[j][a] * Polynomial::power (j , Polynomial (0,1))* Polynomial::power (3 - j, Polynomial (1,-1))* - binomial_coefficient(3, j); + binomial_coefficient (3, j); } return p; @@ -156,7 +156,7 @@ Bezier::solve_derivative (Offset deriv)const Array Bezier::solve_point (Axis ax, Real coordinate) const { - Polynomial p(polynomial (ax)); + Polynomial p (polynomial (ax)); p.coefs_[0] -= coordinate; Array sol (p.solve ()); diff --git a/lily/box.cc b/lily/box.cc index f82325d20b..eb31e83110 100644 --- a/lily/box.cc +++ b/lily/box.cc @@ -12,21 +12,21 @@ void Box::translate (Offset o) { - for (Axis i=X_AXIS; i < NO_AXES; incr(i)) + for (Axis i=X_AXIS; i < NO_AXES; incr (i)) interval_a_[i] += o[i]; } void Box::unite (Box b) { - for (Axis i=X_AXIS; i < NO_AXES; incr(i)) + for (Axis i=X_AXIS; i < NO_AXES; incr (i)) interval_a_[i].unite (b[i]); } /** Initialize to empty. */ -Box::Box() +Box::Box () { } @@ -39,8 +39,8 @@ Box::set_empty () Box::Box (Interval ix, Interval iy) { - x() = ix; - y() = iy; + x () = ix; + y () = iy; } Interval & diff --git a/lily/break-algorithm.cc b/lily/break-algorithm.cc index 320857f7b8..e845133d63 100644 --- a/lily/break-algorithm.cc +++ b/lily/break-algorithm.cc @@ -72,7 +72,7 @@ Break_algorithm::generate_spacing_problem (Link_array curline, Interval li /* sort out how interfacing this should work; */ - if (line.empty_b()) + if (line.empty_b ()) { sp->line_len_f_ = -1; } @@ -95,7 +95,7 @@ void Break_algorithm::set_pscore (Paper_score*s) { pscore_l_ = s; - linewidth_f_ = s->paper_l_->get_var("linewidth"); + linewidth_f_ = s->paper_l_->get_var ("linewidth"); } Array diff --git a/lily/break-align-engraver.cc b/lily/break-align-engraver.cc index f17922a017..a403c4a60e 100644 --- a/lily/break-align-engraver.cc +++ b/lily/break-align-engraver.cc @@ -20,18 +20,18 @@ class Break_align_engraver : public Engraver Protected_scm column_alist_; protected: virtual void finalize (); - virtual void acknowledge_grob(Grob_info i); + virtual void acknowledge_grob (Grob_info i); virtual void stop_translation_timestep (); void add_column (SCM); public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Break_align_engraver (); }; -ADD_THIS_TRANSLATOR(Break_align_engraver); +ADD_THIS_TRANSLATOR (Break_align_engraver); void Break_align_engraver::add_column (SCM smob) @@ -53,7 +53,7 @@ Break_align_engraver::stop_translation_timestep () SCM order = get_property ("breakAlignOrder"); for (; gh_pair_p (order); order = gh_cdr (order)) { - SCM p = scm_assoc ( gh_car (order), column_alist_); + SCM p = scm_assoc (gh_car (order), column_alist_); if (gh_pair_p (p)) { add_column (gh_cdr (p)); @@ -136,7 +136,7 @@ Break_align_engraver::acknowledge_grob (Grob_info inf) if (s != SCM_BOOL_F) { - Grob *e = unsmob_grob (gh_cdr(s)); + Grob *e = unsmob_grob (gh_cdr (s)); group = dynamic_cast (e); } else diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index 779be73cf3..06ff6bac74 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -21,7 +21,7 @@ #include "group-interface.hh" #include "align-interface.hh" -MAKE_SCHEME_CALLBACK(Break_align_interface,before_line_breaking,1); +MAKE_SCHEME_CALLBACK (Break_align_interface,before_line_breaking,1); SCM Break_align_interface::before_line_breaking (SCM smob) @@ -30,7 +30,7 @@ Break_align_interface::before_line_breaking (SCM smob) do_alignment (me); return SCM_UNSPECIFIED; } -MAKE_SCHEME_CALLBACK(Break_align_interface,alignment_callback,2); +MAKE_SCHEME_CALLBACK (Break_align_interface,alignment_callback,2); SCM Break_align_interface::alignment_callback (SCM element_smob, SCM axis) @@ -49,7 +49,7 @@ Break_align_interface::alignment_callback (SCM element_smob, SCM axis) return gh_double2scm (0); } -MAKE_SCHEME_CALLBACK(Break_align_interface,self_align_callback,2); +MAKE_SCHEME_CALLBACK (Break_align_interface,self_align_callback,2); SCM Break_align_interface::self_align_callback (SCM element_smob, SCM axis) { @@ -58,7 +58,7 @@ Break_align_interface::self_align_callback (SCM element_smob, SCM axis) assert (a == X_AXIS); Item* item = dynamic_cast (me); - Direction bsd = item->break_status_dir(); + Direction bsd = item->break_status_dir (); if (bsd == LEFT) { me->set_grob_property ("self-alignment-X", gh_int2scm (RIGHT)); @@ -89,10 +89,10 @@ Break_align_interface::do_alignment (Grob *me) = Pointer_group_interface__extract_elements (me, (Grob*)0, "elements"); - for (int i=0; i < all_elems.size(); i++) + for (int i=0; i < all_elems.size (); i++) { - Interval y = all_elems[i]->extent(all_elems[i], X_AXIS); - if (!y.empty_b()) + Interval y = all_elems[i]->extent (all_elems[i], X_AXIS); + if (!y.empty_b ()) elems.push (dynamic_cast (all_elems[i])); } @@ -139,10 +139,10 @@ Break_align_interface::do_alignment (Grob *me) extra_space = scm_listify (ly_symbol2scm ("minimum-space"), gh_double2scm (0.0), SCM_UNDEFINED); } - SCM symbol = gh_car (extra_space); - Real spc = gh_scm2double (gh_cadr(extra_space)); + SCM symbol = gh_car (extra_space); + Real spc = gh_scm2double (gh_cadr (extra_space)); - dists.push(spc); + dists.push (spc); symbol_list = gh_cons (symbol, symbol_list); current_origin = next_origin; } @@ -150,9 +150,9 @@ Break_align_interface::do_alignment (Grob *me) // skip the first sym. symbol_list = gh_cdr (scm_reverse (symbol_list)); - for (int i=0; i set_grob_property (gh_car (symbol_list), + elems[i]->set_grob_property (gh_car (symbol_list), scm_cons (gh_double2scm (0), gh_double2scm (dists[i+1]))); @@ -170,7 +170,7 @@ Break_align_interface::do_alignment (Grob *me) scm_set_car_x (first_pair, gh_double2scm (-dists[0])); elems[0]->set_grob_property ("minimum-space", first_pair); - Direction bsd = item->break_status_dir(); + Direction bsd = item->break_status_dir (); if (bsd == LEFT) { me->set_grob_property ("self-alignment-X", gh_int2scm (RIGHT)); @@ -198,12 +198,12 @@ Break_align_interface::do_alignment (Grob *me) Real stretch_distance =0.; - if (gh_car (symbol_list) == ly_symbol2scm ("extra-space")) + if (gh_car (symbol_list) == ly_symbol2scm ("extra-space")) { spring_len += dists.top (); stretch_distance = dists.top (); } - else if (gh_car (symbol_list) == ly_symbol2scm ("minimum-space")) + else if (gh_car (symbol_list) == ly_symbol2scm ("minimum-space")) { spring_len = spring_len >? dists.top (); stretch_distance = spring_len; @@ -221,7 +221,7 @@ Break_align_interface::do_alignment (Grob *me) This is a side effect, and there is no guarantee that this info is computed at a "sane" moment. - (just spent some time tracking a bug that was caused by this info + (just spent some time tracking a bug that was caused by this info being written halfway: self_alignment_callback (*) diff --git a/lily/breathing-sign-engraver.cc b/lily/breathing-sign-engraver.cc index 5e1c08fa2f..4207c86683 100644 --- a/lily/breathing-sign-engraver.cc +++ b/lily/breathing-sign-engraver.cc @@ -8,7 +8,7 @@ TODO: . Cancel any beams running through the breathing sign - ([e8 \breathe f e f] should become [e8] \breathe [f e f]) + ([e8 \breathe f e f] should become [e8] \breathe [f e f]) . Spacing is not yet completely pretty */ @@ -24,21 +24,21 @@ TODO: class Breathing_sign_engraver : public Engraver { public: - Breathing_sign_engraver(); - VIRTUAL_COPY_CONS(Translator); + Breathing_sign_engraver (); + VIRTUAL_COPY_CONS (Translator); protected: virtual bool try_music (Music *req_l); virtual void create_grobs (); - virtual void stop_translation_timestep(); - virtual void start_translation_timestep(); + virtual void stop_translation_timestep (); + virtual void start_translation_timestep (); private: Breathing_sign_req * breathing_sign_req_l_; Grob * breathing_sign_p_; }; -Breathing_sign_engraver::Breathing_sign_engraver() +Breathing_sign_engraver::Breathing_sign_engraver () { breathing_sign_p_ = 0; breathing_sign_req_l_ = 0; @@ -59,7 +59,7 @@ Breathing_sign_engraver::try_music (Music*r_l) void Breathing_sign_engraver::create_grobs () { - if(breathing_sign_req_l_ && ! breathing_sign_p_) + if (breathing_sign_req_l_ && ! breathing_sign_p_) { SCM b = get_property ("BreathingSign"); breathing_sign_p_ = new Item (b); @@ -72,19 +72,19 @@ Breathing_sign_engraver::create_grobs () } void -Breathing_sign_engraver::stop_translation_timestep() +Breathing_sign_engraver::stop_translation_timestep () { - if(breathing_sign_p_) + if (breathing_sign_p_) { - typeset_grob(breathing_sign_p_); + typeset_grob (breathing_sign_p_); breathing_sign_p_ = 0; } } void -Breathing_sign_engraver::start_translation_timestep() +Breathing_sign_engraver::start_translation_timestep () { breathing_sign_req_l_ = 0; } -ADD_THIS_TRANSLATOR(Breathing_sign_engraver); +ADD_THIS_TRANSLATOR (Breathing_sign_engraver); diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 06be981cf1..32ef10e334 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -20,7 +20,7 @@ #include "dimensions.hh" #include "direction.hh" -MAKE_SCHEME_CALLBACK(Breathing_sign,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Breathing_sign,brew_molecule,1); SCM Breathing_sign::brew_molecule (SCM smob) { @@ -28,15 +28,15 @@ Breathing_sign::brew_molecule (SCM smob) Real space = Staff_symbol_referencer::staff_space (me); // todo: cfg'able. - Interval i1(0, space / 6), i2(-space / 2, space / 2); - Box b(i1, i2); + Interval i1 (0, space / 6), i2 (-space / 2, space / 2); + Box b (i1, i2); - return Lookup::filledbox(b).smobbed_copy (); + return Lookup::filledbox (b).smobbed_copy (); } -MAKE_SCHEME_CALLBACK(Breathing_sign,offset_callback,2); +MAKE_SCHEME_CALLBACK (Breathing_sign,offset_callback,2); SCM -Breathing_sign::offset_callback (SCM element_smob, SCM ) +Breathing_sign::offset_callback (SCM element_smob, SCM) { Grob *me = unsmob_grob (element_smob); @@ -49,12 +49,12 @@ Breathing_sign::offset_callback (SCM element_smob, SCM ) Real inter_f = Staff_symbol_referencer::staff_space (me)/2; int sz = Staff_symbol_referencer::line_count (me)-1; - return gh_double2scm ( inter_f * sz * d); + return gh_double2scm (inter_f * sz * d); } void Breathing_sign::set_interface (Grob *b) { - Staff_symbol_referencer::set_interface (b); + Staff_symbol_referencer::set_interface (b); } diff --git a/lily/change-iterator.cc b/lily/change-iterator.cc index f76a2d7203..96e7affd07 100644 --- a/lily/change-iterator.cc +++ b/lily/change-iterator.cc @@ -47,7 +47,7 @@ Change_iterator::process (Moment m) If \translator Staff = bass, then look for Staff = * */ - while (current && current->type_str_ != to_type) + while (current && current->type_str_ != to_type) { last = current; current = current->daddy_trans_l_; @@ -84,4 +84,4 @@ Change_iterator::process (Moment m) -IMPLEMENT_CTOR_CALLBACK(Change_iterator); +IMPLEMENT_CTOR_CALLBACK (Change_iterator); diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index a73cb16875..78a2ad5885 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -41,8 +41,8 @@ class Chord_tremolo_engraver : public Engraver { void typeset_beam (); public: - VIRTUAL_COPY_CONS(Translator); - Chord_tremolo_engraver(); + VIRTUAL_COPY_CONS (Translator); + Chord_tremolo_engraver (); protected: Repeated_music * repeat_; @@ -60,15 +60,15 @@ protected: Spanner * finished_beam_p_; Item * stem_tremolo_; protected: - virtual void finalize(); + virtual void finalize (); virtual bool try_music (Music*); virtual void acknowledge_grob (Grob_info); - virtual void stop_translation_timestep(); - virtual void start_translation_timestep(); + virtual void stop_translation_timestep (); + virtual void start_translation_timestep (); virtual void process_music (); }; -Chord_tremolo_engraver::Chord_tremolo_engraver() +Chord_tremolo_engraver::Chord_tremolo_engraver () { beam_p_ = finished_beam_p_ = 0; repeat_ =0; @@ -112,13 +112,13 @@ Chord_tremolo_engraver::process_music () SCM smp = get_property ("measurePosition"); Moment mp - = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); + = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); beam_start_location_ = mp; announce_grob (beam_p_, repeat_); } else if (!sequential_body_b_ && !stem_tremolo_) { - int flags = intlog2(note_head_i_ * repeat_->repeat_count ()) -2; + int flags = intlog2 (note_head_i_ * repeat_->repeat_count ()) -2; if (flags) { stem_tremolo_ = new Item (get_property ("StemTremolo")); @@ -179,10 +179,10 @@ Chord_tremolo_engraver::acknowledge_grob (Grob_info info) --hwn. */ SCM d = s->get_grob_property ("direction"); - if (Stem::type_i (s ) != 1) + if (Stem::type_i (s) != 1) { - int gap_i =Stem::flag_i (s ) - ((Stem::type_i (s ) >? 2) - 2); - beam_p_->set_grob_property ("beam-gap", gh_int2scm(gap_i)); + int gap_i =Stem::flag_i (s) - ((Stem::type_i (s) >? 2) - 2); + beam_p_->set_grob_property ("beam-gap", gh_int2scm (gap_i)); } s->set_grob_property ("direction", d); @@ -241,5 +241,5 @@ Chord_tremolo_engraver::stop_translation_timestep () } -ADD_THIS_TRANSLATOR(Chord_tremolo_engraver); +ADD_THIS_TRANSLATOR (Chord_tremolo_engraver); diff --git a/lily/chord-tremolo-iterator.cc b/lily/chord-tremolo-iterator.cc index 5487f96251..9c2aaf4a77 100644 --- a/lily/chord-tremolo-iterator.cc +++ b/lily/chord-tremolo-iterator.cc @@ -24,7 +24,7 @@ Chord_tremolo_iterator::construct_children () child_iter_p_ = get_iterator_p (rep->body ()); } -Chord_tremolo_iterator::Chord_tremolo_iterator() +Chord_tremolo_iterator::Chord_tremolo_iterator () { factor_ = 1; child_iter_p_ = 0; @@ -45,7 +45,7 @@ Chord_tremolo_iterator::process (Moment m) if (yeah) set_translator (yeah->report_to_l ()); else - music_l_->origin ()->warning ( _("no one to print a tremolos")); + music_l_->origin ()->warning (_ ("no one to print a tremolos")); } child_iter_p_->process (factor_ * m); @@ -61,7 +61,7 @@ Chord_tremolo_iterator::pending_moment () const bool Chord_tremolo_iterator::ok () const { - return child_iter_p_ && child_iter_p_->ok(); + return child_iter_p_ && child_iter_p_->ok (); } Chord_tremolo_iterator::~Chord_tremolo_iterator () @@ -77,5 +77,5 @@ Chord_tremolo_iterator::try_music_in_children (Music *m) const -IMPLEMENT_CTOR_CALLBACK(Chord_tremolo_iterator); +IMPLEMENT_CTOR_CALLBACK (Chord_tremolo_iterator); diff --git a/lily/chord.cc b/lily/chord.cc index 32215b656c..dd20c964ee 100644 --- a/lily/chord.cc +++ b/lily/chord.cc @@ -189,7 +189,7 @@ Chord::step_scm (SCM tonic, SCM p) int i = unsmob_pitch (p)->notename_i_ - unsmob_pitch (tonic)->notename_i_ + (unsmob_pitch (p)->octave_i_ - - unsmob_pitch (tonic)->octave_i_ ) * 7; + - unsmob_pitch (tonic)->octave_i_) * 7; while (i < 0) i += 7; i++; diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index f0fe112bac..6f527fc75e 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -57,7 +57,7 @@ Clef_engraver::Clef_engraver () octavate_p_ = 0; /* - will trigger a clef at the start since #f != '() + will trigger a clef at the start since #f != ' () */ prev_cpos_ = prev_glyph_ = SCM_BOOL_F; } @@ -135,7 +135,7 @@ Clef_engraver::acknowledge_grob (Grob_info info) /* Key_item adapts its formatting to make sure that the accidentals stay in the upper half of the staff. It needs - to know c0-pos for this. (?) + to know c0-pos for this. (?) */ item->set_grob_property ("c0-position", get_property ("centralCPosition")); @@ -158,7 +158,7 @@ Clef_engraver::create_clef () Staff_symbol_referencer::set_position (clef_p_, gh_scm2int (get_property ("clefPosition"))); - SCM oct = get_property("clefOctavation"); + SCM oct = get_property ("clefOctavation"); if (gh_number_p (oct) && gh_scm2int (oct)) { Item * g = new Item (get_property ("OctavateEight")); @@ -187,9 +187,9 @@ Clef_engraver::create_grobs () || scm_equal_p (clefpos, prev_cpos_) == SCM_BOOL_F || scm_equal_p (octavation, prev_octavation_) == SCM_BOOL_F || to_boolean (force_clef) - ) +) { - set_glyph(); + set_glyph (); set_central_c (glyph, clefpos, octavation); create_clef (); diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 22dcaf1fd8..d7c323ee60 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -16,7 +16,7 @@ /* FIXME: should use symbol for #'style. */ -MAKE_SCHEME_CALLBACK(Clef,before_line_breaking,1); +MAKE_SCHEME_CALLBACK (Clef,before_line_breaking,1); SCM Clef::before_line_breaking (SCM smob) { @@ -29,11 +29,11 @@ Clef::before_line_breaking (SCM smob) String str = ly_scm2string (glyph); if (to_boolean (s->get_grob_property ("non-default")) - && s->break_status_dir() != RIGHT + && s->break_status_dir () != RIGHT && !to_boolean (s->get_grob_property ("full-size-change"))) { str += "_change"; - s->set_grob_property ("glyph-name", ly_str02scm (str.ch_C())); + s->set_grob_property ("glyph-name", ly_str02scm (str.ch_C ())); } } else @@ -58,7 +58,7 @@ Clef::set_interface (Grob* me) me->set_interface (ly_symbol2scm ("clef-interface")); } -MAKE_SCHEME_CALLBACK(Clef,brew_molecule,1) +MAKE_SCHEME_CALLBACK (Clef,brew_molecule,1) SCM Clef::brew_molecule (SCM smob) { diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index b0cc610f12..ca18e2ddde 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -22,10 +22,10 @@ class Collision_engraver : public Engraver { protected: virtual void acknowledge_grob (Grob_info); virtual void create_grobs (); - virtual void stop_translation_timestep(); + virtual void stop_translation_timestep (); public: - VIRTUAL_COPY_CONS(Translator); - Collision_engraver(); + VIRTUAL_COPY_CONS (Translator); + Collision_engraver (); }; @@ -53,7 +53,7 @@ Collision_engraver::acknowledge_grob (Grob_info i) if (Note_column::has_interface (i.elem_l_)) { /*should check Y axis? */ - if (Note_column::rest_b (i.elem_l_) || i.elem_l_->parent_l(X_AXIS)) + if (Note_column::rest_b (i.elem_l_) || i.elem_l_->parent_l (X_AXIS)) return ; note_column_l_arr_.push (i.elem_l_); @@ -61,7 +61,7 @@ Collision_engraver::acknowledge_grob (Grob_info i) } void -Collision_engraver::stop_translation_timestep() +Collision_engraver::stop_translation_timestep () { if (col_p_) { @@ -71,11 +71,11 @@ Collision_engraver::stop_translation_timestep() note_column_l_arr_.clear (); } -Collision_engraver::Collision_engraver() +Collision_engraver::Collision_engraver () { col_p_ =0; } -ADD_THIS_TRANSLATOR(Collision_engraver); +ADD_THIS_TRANSLATOR (Collision_engraver); diff --git a/lily/collision.cc b/lily/collision.cc index af13b3f6b2..5c0ae79518 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -5,6 +5,7 @@ (c) 1997--2001 Han-Wen Nienhuys */ + #include "debug.hh" #include "collision.hh" #include "note-column.hh" @@ -14,7 +15,8 @@ #include "item.hh" -MAKE_SCHEME_CALLBACK(Collision,force_shift_callback,2); +MAKE_SCHEME_CALLBACK (Collision,force_shift_callback,2); + SCM Collision::force_shift_callback (SCM element_smob, SCM axis) { @@ -39,7 +41,7 @@ Collision::force_shift_callback (SCM element_smob, SCM axis) TODO: make callback of this. */ void -Collision::do_shifts(Grob* me) +Collision::do_shifts (Grob* me) { SCM autos (automatic_shift (me)); SCM hand (forced_shift (me)); @@ -127,7 +129,7 @@ Collision::automatic_shift (Grob *me) { for (int i=0; i < clash_groups[d].size (); i++) { - Slice s(Note_column::head_positions_interval (clash_groups[d][i])); + Slice s (Note_column::head_positions_interval (clash_groups[d][i])); s[LEFT] --; s[RIGHT]++; extents[d].push (s); @@ -143,7 +145,7 @@ Collision::automatic_shift (Grob *me) Slice prev =extents[d][i-1]; prev.intersect (extents[d][i]); if (prev.length ()> 0 || - (extents[-d].size () && d * (extents[d][i][-d] - extents[-d][0][d]) < 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; } @@ -162,8 +164,8 @@ Collision::automatic_shift (Grob *me) /* TODO. */ - Grob * nu_l= Note_column::first_head(cu_l); - Grob * nd_l = Note_column::first_head(cd_l); + Grob * nu_l= Note_column::first_head (cu_l); + Grob * nd_l = Note_column::first_head (cd_l); int downpos = Note_column::head_positions_interval (cd_l)[BIGGER]; int uppos = Note_column::head_positions_interval (cu_l)[SMALLER]; @@ -179,7 +181,7 @@ Collision::automatic_shift (Grob *me) /* notes are close, but can not be merged. Shift */ - if (abs(uppos - downpos) < 2 && !merge) + if (abs (uppos - downpos) < 2 && !merge) do { for (int i=0; i < clash_groups[d].size (); i++) @@ -221,9 +223,6 @@ Collision::forced_shift (Grob *me) return tups; } - - - void Collision::add_column (Grob*me,Grob* ncol_l) { diff --git a/lily/column-x-positions.cc b/lily/column-x-positions.cc index bf4eccf4e0..8f9067d4fa 100644 --- a/lily/column-x-positions.cc +++ b/lily/column-x-positions.cc @@ -10,7 +10,7 @@ #include "real.hh" #include "debug.hh" -Column_x_positions::Column_x_positions() +Column_x_positions::Column_x_positions () { satisfies_constraints_b_ = false; force_f_ = 0; diff --git a/lily/command-request.cc b/lily/command-request.cc index 1255c87bcc..ea7e0a4a20 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -10,7 +10,6 @@ #include "debug.hh" #include "musical-request.hh" - bool Barcheck_req::do_equal_b (Request const *r) const { @@ -18,36 +17,11 @@ Barcheck_req::do_equal_b (Request const *r) const return b; } - - - Tempo_req::Tempo_req () { - set_mus_property ("duration", Duration(2,0).smobbed_copy ()); -} - - - -bool -Tempo_req::do_equal_b (Request const *r) const -{ - Tempo_req const *t = dynamic_cast (r); - - return t; // && t->dur_.length_mom ()== dur_.length_mom (); - // && metronome_i_ == t->metronome_i_; + set_mus_property ("duration", Duration (2,0).smobbed_copy ()); } - - - -bool -Key_change_req::do_equal_b (Request const * req) const -{ - Key_change_req const * k = dynamic_cast (req); - return k && scm_equal_p (get_mus_property ("pitch-alist"), k->get_mus_property ("pitch-alist")) == SCM_BOOL_T; -} - - void Key_change_req::transpose (Pitch p) { @@ -65,7 +39,7 @@ Key_change_req::transpose (Pitch p) orig.transpose (p); - SCM key = gh_cons (gh_int2scm (orig.octave_i () ), + SCM key = gh_cons (gh_int2scm (orig.octave_i ()), gh_int2scm (orig.notename_i_)); newlist = gh_cons (gh_cons (key, gh_int2scm (orig.alteration_i_)), @@ -97,3 +71,29 @@ Mark_req::do_equal_b (Request const * r) const return other && scm_equal_p (other->get_mus_property ("mark-label"), get_mus_property ("mark-label")) == SCM_BOOL_T; } + + +ADD_MUSIC (Articulation_req); +ADD_MUSIC (Barcheck_req); +ADD_MUSIC (Break_req); +ADD_MUSIC (Breathing_sign_req); +ADD_MUSIC (Busy_playing_req); +ADD_MUSIC (Extender_req); +ADD_MUSIC (Glissando_req); +ADD_MUSIC (Hyphen_req); +ADD_MUSIC (Key_change_req); +ADD_MUSIC (Lyric_req); +ADD_MUSIC (Mark_req); +ADD_MUSIC (Melisma_playing_req); +ADD_MUSIC (Melisma_req); +ADD_MUSIC (Melodic_req); +ADD_MUSIC (Note_req); +ADD_MUSIC (Rest_req); +ADD_MUSIC (Rhythmic_req); +ADD_MUSIC (Script_req); +ADD_MUSIC (Skip_req); +ADD_MUSIC (Span_req); +ADD_MUSIC (Tempo_req); +ADD_MUSIC (Text_script_req); +ADD_MUSIC (Tie_req); +ADD_MUSIC (Tremolo_req); diff --git a/lily/context-specced-music.cc b/lily/context-specced-music.cc index bb479a4ba6..f0373b2dca 100644 --- a/lily/context-specced-music.cc +++ b/lily/context-specced-music.cc @@ -7,10 +7,18 @@ */ #include "context-specced-music.hh" -Context_specced_music::Context_specced_music(SCM m) - : Music_wrapper (m) +Context_specced_music::Context_specced_music (SCM m) + : Music_wrapper (m) { set_mus_property ("type", ly_symbol2scm ("context-specced-music")); } + +Context_specced_music::Context_specced_music () +{ + set_mus_property ("type", + ly_symbol2scm ("context-specced-music")); +} + +ADD_MUSIC (Context_specced_music); diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index aed720a86f..075e80d792 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (C) 2000 Juergen Reuter , + (C) 2000 Juergen Reuter , Han-Wen Nienhuys @@ -23,16 +23,16 @@ class Custos_engraver : public Engraver { public: - Custos_engraver(); - virtual void start_translation_timestep(); - virtual void acknowledge_grob(Grob_info); + Custos_engraver (); + virtual void start_translation_timestep (); + virtual void acknowledge_grob (Grob_info); virtual void create_grobs (); virtual void stop_translation_timestep (); virtual void finalize (); - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); private: - Item * create_custos(); + Item * create_custos (); bool custos_permitted; Link_array custos_arr_; Array pitches_; @@ -45,7 +45,7 @@ Custos_engraver::Custos_engraver () void -Custos_engraver::stop_translation_timestep() +Custos_engraver::stop_translation_timestep () { /* delay typeset until we're at the next moment, so we can silence custodes at the end of the piece. @@ -69,7 +69,7 @@ Custos_engraver::start_translation_timestep () void Custos_engraver::acknowledge_grob (Grob_info info) { - Item *item = dynamic_cast (info.elem_l_); + Item *item = dynamic_cast (info.elem_l_); if (item) { if (Bar::has_interface (info.elem_l_)) @@ -95,7 +95,7 @@ Custos_engraver::acknowledge_grob (Grob_info info) void Custos_engraver::create_grobs () { - if (gh_string_p (get_property( "whichBar"))) + if (gh_string_p (get_property ("whichBar"))) custos_permitted = true; if (custos_permitted) @@ -114,7 +114,7 @@ Custos_engraver::create_grobs () } Item* -Custos_engraver::create_custos() +Custos_engraver::create_custos () { SCM basicProperties = get_property ("Custos"); Item* custos = new Item (basicProperties); diff --git a/lily/custos.cc b/lily/custos.cc index ef3399d7ec..87b724fd1d 100644 --- a/lily/custos.cc +++ b/lily/custos.cc @@ -3,15 +3,15 @@ source file of the GNU LilyPond music typesetter - (C) 2000 Juergen Reuter + (C) 2000 Juergen Reuter */ /* TODO: - - merge create_ledger_line () and Note_head::create_ledger_line() + - merge create_ledger_line () and Note_head::create_ledger_line () - - rewrite create_ledger_line() to support short and thin ledger lines + - rewrite create_ledger_line () to support short and thin ledger lines - do not show if a clef change immediately follows in the next line @@ -34,39 +34,39 @@ /* This function is a patched and hopefully much more understandable - rewrite of Note_head::ledger_line(). It still has some + rewrite of Note_head::ledger_line (). It still has some bugs/limitations: * - (1) The term thick/2 probably should be thick*2 (probably a bug, + (1) The term thick/2 probably should be thick*2 (probably a bug, see the code below). * - (2) The minimal width of the resulting ledger line equals the width + (2) The minimal width of the resulting ledger line equals the width of the noteheads-ledgerending symbol (a limitation): * - (---- left ledger ending + (---- left ledger ending ----) right ledger ending - (---) resulting ledger line (just ok) + (---) resulting ledger line (just ok) * If x_extent ("xwid" in Note_head) is less than the width of the ledger ending, the width of the total ledger line is even *greater* than the width of a ledger ending (I would call this a bug). In - the below code, the condition "if (x_extent.length() > - slice_x_extent.length())" avoids outputting the left ending in such + the below code, the condition "if (x_extent.length () > + slice_x_extent.length ())" avoids outputting the left ending in such cases (rather a silly workaround, but better than nothing). * - (---- left ledger ending + (---- left ledger ending ----) right ledger ending - (-) desired ledger line + (-) desired ledger line ------- resulting ledger line (too long) ----) resulting ledger line with additional "if" (still too long) * The algorithm works properly only for a desired ledger line width greater than the width of the ledger ending: * - (---- left ledger ending + (---- left ledger ending ----) right ledger ending - (------) desired ledger line - (------) resulting ledger line (ok) + (------) desired ledger line + (------) resulting ledger line (ok) * * (3) The thickness of the ledger line is fixed (limitation). */ @@ -75,13 +75,13 @@ Custos::create_ledger_line (Interval x_extent, Grob *me) { Molecule line; Molecule slice = Font_interface::get_default_font (me)->find_by_name ("noteheads-ledgerending"); - Interval slice_x_extent = slice.extent(X_AXIS); - Interval slice_y_extent = slice.extent(Y_AXIS); + Interval slice_x_extent = slice.extent (X_AXIS); + Interval slice_y_extent = slice.extent (Y_AXIS); // Create left ending of ledger line. Molecule left_ending = slice; left_ending.translate_axis (x_extent[LEFT] - slice_x_extent[LEFT], X_AXIS); - if (x_extent.length() > slice_x_extent.length()) + if (x_extent.length () > slice_x_extent.length ()) line.add_molecule (left_ending); // Create right ending of ledger line. @@ -93,7 +93,7 @@ Custos::create_ledger_line (Interval x_extent, Grob *me) // Fill out space between left and right ending of ledger line by // lining up a series of slices in a row between them. Molecule fill_out_slice = left_ending; - Real thick = slice_y_extent.length(); + Real thick = slice_y_extent.length (); Real delta_x = slice_x_extent.length () - thick; Real xpos = x_extent [LEFT] + 2*delta_x + thick/2; // TODO: check: thick*2? while (xpos <= x_extent[RIGHT]) @@ -107,7 +107,7 @@ Custos::create_ledger_line (Interval x_extent, Grob *me) } void -Custos::add_streepjes(Grob* me, +Custos::add_streepjes (Grob* me, int pos, int interspaces, Molecule* custos_p_) @@ -117,7 +117,7 @@ Custos::add_streepjes(Grob* me, Real inter_f = Staff_symbol_referencer::staff_space (me)/2; int streepjes_i = abs (pos) < interspaces ? 0 - : (abs(pos) - interspaces) /2; + : (abs (pos) - interspaces) /2; if (streepjes_i) { Direction dir = (Direction)sign (pos); @@ -137,7 +137,7 @@ Custos::add_streepjes(Grob* me, } } -MAKE_SCHEME_CALLBACK(Custos,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Custos,brew_molecule,1); SCM Custos::brew_molecule (SCM smob) { @@ -158,16 +158,16 @@ Custos::brew_molecule (SCM smob) idx += style; Molecule molecule = Font_interface::get_default_font (me)->find_by_name (idx); - if (molecule.empty_b()) + if (molecule.empty_b ()) { String message = "unknown custos style: `" + style + "'"; - warning(_ (message.ch_C())); + warning (_ (message.ch_C ())); return SCM_EOL; } else { - add_streepjes(me, (int)pos, interspaces, &molecule); - return molecule.smobbed_copy(); + add_streepjes (me, (int)pos, interspaces, &molecule); + return molecule.smobbed_copy (); } } else diff --git a/lily/cxx-function-smob.cc b/lily/cxx-function-smob.cc index 35b2073219..f0d5beec1f 100644 --- a/lily/cxx-function-smob.cc +++ b/lily/cxx-function-smob.cc @@ -35,10 +35,10 @@ scm_sizet free_smob (SCM) SCM cxx_function_type_p (SCM x) { - return (SCM_CELL_TYPE(x) == callback_tag) ? SCM_BOOL_T : SCM_BOOL_F; + return (SCM_CELL_TYPE (x) == callback_tag) ? SCM_BOOL_T : SCM_BOOL_F; } -void init_cxx_function_smobs() +void init_cxx_function_smobs () { callback_tag = scm_make_smob_type_mfpe ("callback", 0, mark_smob, free_smob, @@ -52,7 +52,7 @@ smobify_cxx_function (Cxx_function cb) { SCM z; - SCM_NEWCELL(z); + SCM_NEWCELL (z); SCM_SETCDR (z, (SCM)cb); SCM_SETCAR (z, (SCM)callback_tag); @@ -64,8 +64,8 @@ Cxx_function unsmob_cxx_function (SCM x) { - if (SCM_NIMP (x) && SCM_CELL_TYPE(x) == callback_tag) - return (Cxx_function) SCM_CELL_WORD_1(x); + if (SCM_NIMP (x) && SCM_CELL_TYPE (x) == callback_tag) + return (Cxx_function) SCM_CELL_WORD_1 (x); else return 0; } diff --git a/lily/debug.cc b/lily/debug.cc index 8dc98a7018..57380d6e7f 100644 --- a/lily/debug.cc +++ b/lily/debug.cc @@ -28,7 +28,7 @@ float_handler (int) } void -debug_init() +debug_init () { my_monitor = new Dstream (&cout, ".dstreamrc"); signal (SIGFPE, float_handler); diff --git a/lily/dimension-cache.cc b/lily/dimension-cache.cc index e78ec6c282..f92c7e4f68 100644 --- a/lily/dimension-cache.cc +++ b/lily/dimension-cache.cc @@ -14,7 +14,7 @@ Dimension_cache::Dimension_cache (Dimension_cache const &d) { - init(); + init (); dimension_ = d.dimension_; offset_ = d.offset_; @@ -25,11 +25,11 @@ Dimension_cache::Dimension_cache (Dimension_cache const &d) Dimension_cache::Dimension_cache () { - init(); + init (); } void -Dimension_cache::init() +Dimension_cache::init () { dimension_ = SCM_EOL; diff --git a/lily/directional-element-interface.cc b/lily/directional-element-interface.cc index 1197048d31..7f986d51ee 100644 --- a/lily/directional-element-interface.cc +++ b/lily/directional-element-interface.cc @@ -17,7 +17,7 @@ init_functions () { Directional_element_interface::direction_sym = scm_permanent_object (ly_symbol2scm ("direction")); } -ADD_SCM_INIT_FUNC(Directional, init_functions); +ADD_SCM_INIT_FUNC (Directional, init_functions); bool @@ -31,7 +31,7 @@ Directional_element_interface::get (Grob*me) { // return dir_; SCM d= me->get_grob_property (direction_sym); - if (!isdir_b(d)) + if (!isdir_b (d)) return CENTER; return to_dir (d); diff --git a/lily/dot-column-engraver.cc b/lily/dot-column-engraver.cc index 9e234405cf..e56d7f3f08 100644 --- a/lily/dot-column-engraver.cc +++ b/lily/dot-column-engraver.cc @@ -18,8 +18,8 @@ class Dot_column_engraver : public Engraver Grob *dotcol_p_ ; Link_array head_l_arr_; public: - VIRTUAL_COPY_CONS(Translator); - Dot_column_engraver(); + VIRTUAL_COPY_CONS (Translator); + Dot_column_engraver (); protected: virtual void acknowledge_grob (Grob_info); @@ -51,7 +51,7 @@ Dot_column_engraver::acknowledge_grob (Grob_info info) { if (!dotcol_p_) { - dotcol_p_ = new Item(get_property ("DotColumn")); + dotcol_p_ = new Item (get_property ("DotColumn")); Dot_column::set_interface (dotcol_p_); Side_position_interface::set_axis (dotcol_p_, X_AXIS); @@ -64,5 +64,5 @@ Dot_column_engraver::acknowledge_grob (Grob_info info) } -ADD_THIS_TRANSLATOR(Dot_column_engraver); +ADD_THIS_TRANSLATOR (Dot_column_engraver); diff --git a/lily/dot-column.cc b/lily/dot-column.cc index db7e3b0d3c..a3c30cc444 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -46,7 +46,7 @@ Dot_column::set_interface (Grob* me) */ -MAKE_SCHEME_CALLBACK(Dot_column,force_shift_callback,2); +MAKE_SCHEME_CALLBACK (Dot_column,force_shift_callback,2); SCM Dot_column::force_shift_callback (SCM element_smob, SCM axis) { @@ -88,7 +88,7 @@ Dot_column::do_shifts (SCM l) } taken_posns.push ((int)p); s.unite (Slice ((int)p, - (int)p)); + (int)p)); } if (!conflicts) @@ -99,7 +99,7 @@ Dot_column::do_shifts (SCM l) +1 -> off by one */ int pos = middle - dots.size () + 1; - if (!(pos % 2)) + if (! (pos % 2)) pos ++; // center () rounds down. for (int i=0; i < dots.size (); pos += 2, i++) diff --git a/lily/dots.cc b/lily/dots.cc index a601beeeb1..2f8202a465 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -16,7 +16,7 @@ #include "directional-element-interface.hh" -MAKE_SCHEME_CALLBACK(Dots,quantised_position_callback,2); +MAKE_SCHEME_CALLBACK (Dots,quantised_position_callback,2); SCM Dots::quantised_position_callback (SCM element_smob, SCM axis) { @@ -34,11 +34,11 @@ Dots::quantised_position_callback (SCM element_smob, SCM axis) return gh_double2scm (Staff_symbol_referencer::staff_space (me) / 2.0 * Directional_element_interface::get (me)); } - return gh_double2scm (0.0); + return gh_double2scm (0.0); } -MAKE_SCHEME_CALLBACK(Dots,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Dots,brew_molecule,1); SCM Dots::brew_molecule (SCM d) { @@ -59,7 +59,7 @@ Dots::brew_molecule (SCM d) mol = Lookup::blank (Box (Interval (0,0), Interval (0,0))); - for (int i = gh_scm2int (c); i--; ) + for (int i = gh_scm2int (c); i--;) { d.translate_axis (2*dw,X_AXIS); mol.add_at_edge (X_AXIS, RIGHT, d, dw); diff --git a/lily/duration.cc b/lily/duration.cc index 930321d067..37e75ac8d1 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -79,16 +79,16 @@ Duration::str () const } -IMPLEMENT_TYPE_P(Duration, "duration?"); -IMPLEMENT_UNSMOB(Duration, duration); +IMPLEMENT_TYPE_P (Duration, "duration?"); +IMPLEMENT_UNSMOB (Duration, duration); SCM -Duration::mark_smob (SCM ) +Duration::mark_smob (SCM) { return SCM_EOL; } -IMPLEMENT_SIMPLE_SMOBS(Duration); +IMPLEMENT_SIMPLE_SMOBS (Duration); int @@ -97,7 +97,7 @@ Duration::print_smob (SCM s, SCM port, scm_print_state *) Duration *r = (Duration *) gh_cdr (s); scm_puts ("#str().ch_C()), port); + scm_display (ly_str02scm (r->str ().ch_C ()), port); scm_puts (" >", port); return 1; @@ -116,14 +116,14 @@ Duration::equal_p (SCM a , SCM b) return eq ? SCM_BOOL_T : SCM_BOOL_F; } -MAKE_SCHEME_CALLBACK(Duration, less_p, 2); +MAKE_SCHEME_CALLBACK (Duration, less_p, 2); SCM Duration::less_p (SCM p1, SCM p2) { Duration *a = unsmob_duration (p1); Duration *b = unsmob_duration (p2); - if (compare(*a, *b) < 0 ) + if (compare (*a, *b) < 0) return SCM_BOOL_T; else return SCM_BOOL_F; @@ -132,17 +132,17 @@ Duration::less_p (SCM p1, SCM p2) static SCM make_duration (SCM l, SCM d) { - Duration p( gh_scm2int (l), gh_scm2int (d)); + Duration p (gh_scm2int (l), gh_scm2int (d)); return p.smobbed_copy (); } static void -add_funcs() +add_funcs () { scm_make_gsubr ("make-duration", 2, 0, 0, (Scheme_function_unknown)make_duration); } -ADD_SCM_INIT_FUNC(duration, add_funcs); +ADD_SCM_INIT_FUNC (duration, add_funcs); SCM Duration::smobbed_copy ()const diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index e97858ea67..0d0ab6be59 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -57,7 +57,7 @@ class Dynamic_engraver : public Engraver void typeset_all (); public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Dynamic_engraver (); protected: @@ -115,7 +115,7 @@ Dynamic_engraver::try_music (Music * m) earlier, not-to-be-terminated stuff. It will disappear by itself when stop_translation_timestep - () finds that there is nothing to support anymore. */ + () finds that there is nothing to support anymore. */ if (cresc_p_) cresc_p_->suicide (); @@ -124,7 +124,7 @@ Dynamic_engraver::try_music (Music * m) else if (t == "crescendo" || t == "decrescendo") { - accepted_spanreqs_drul_[s->get_span_dir()] = s; + accepted_spanreqs_drul_[s->get_span_dir ()] = s; return true; } } @@ -192,10 +192,10 @@ Dynamic_engraver::process_music () there are no new dynamics. */ - if ( !cresc_p_) + if (!cresc_p_) { accepted_spanreqs_drul_[STOP]->origin ()->warning - (_ ("can't find start of (de)crescendo")); + (_ ("can't find start of (de)crescendo")); accepted_spanreqs_drul_[STOP] = 0; } else @@ -219,7 +219,7 @@ Dynamic_engraver::process_music () if (current_cresc_req_) { accepted_spanreqs_drul_[START]->origin ()->warning - (current_cresc_req_->get_span_dir() == 1 + (current_cresc_req_->get_span_dir () == 1 ? _ ("already have a crescendo") : _ ("already have a decrescendo")); } @@ -236,7 +236,7 @@ Dynamic_engraver::process_music () /* ugh. Use push/pop? */ - SCM s = get_property ((start_type + "Spanner").ch_C()); + SCM s = get_property ((start_type + "Spanner").ch_C ()); if (!gh_symbol_p (s) || s == ly_symbol2scm ("hairpin")) { cresc_p_ = new Spanner (get_property ("Hairpin")); @@ -258,7 +258,7 @@ Dynamic_engraver::process_music () daddy_trans_l_->set_property (start_type + "Spanner", SCM_UNDEFINED); - s = get_property ((start_type + "Text").ch_C()); + s = get_property ((start_type + "Text").ch_C ()); if (gh_string_p (s)) { cresc_p_->set_grob_property ("edge-text", @@ -390,7 +390,7 @@ Dynamic_engraver::acknowledge_grob (Grob_info i) && line_spanner_->immutable_property_alist_ != SCM_EOL) { Side_position_interface::add_support (line_spanner_,i.elem_l_); - add_bound_item (line_spanner_,dynamic_cast(i.elem_l_)); + add_bound_item (line_spanner_,dynamic_cast (i.elem_l_)); } } } diff --git a/lily/dynamic-performer.cc b/lily/dynamic-performer.cc index fee5a054a9..f805428f0c 100644 --- a/lily/dynamic-performer.cc +++ b/lily/dynamic-performer.cc @@ -83,10 +83,10 @@ Dynamic_performer::create_audio_elements () */ SCM s = get_property ("midiInstrument"); - if (!gh_string_p(s)) + if (!gh_string_p (s)) s = get_property ("instrument"); - if (!gh_string_p(s)) + if (!gh_string_p (s)) s = ly_str02scm ("piano"); @@ -127,7 +127,7 @@ Dynamic_performer::try_music (Music* r) { if (!script_req_l_) { - if( dynamic_cast (r) + if (dynamic_cast (r) && r->get_mus_property ("text-type") == ly_symbol2scm ("dynamic")) { script_req_l_ = r; diff --git a/lily/engraver-group-engraver.cc b/lily/engraver-group-engraver.cc index ab1b5602f0..0a47bb8420 100644 --- a/lily/engraver-group-engraver.cc +++ b/lily/engraver-group-engraver.cc @@ -14,7 +14,7 @@ #include "grob.hh" -ADD_THIS_TRANSLATOR(Engraver_group_engraver); +ADD_THIS_TRANSLATOR (Engraver_group_engraver); void Engraver_group_engraver::announce_grob (Grob_info info) @@ -28,7 +28,7 @@ void Engraver_group_engraver::create_grobs () { - for (SCM p = simple_trans_list_; gh_pair_p (p); p = gh_cdr ( p)) + for (SCM p = simple_trans_list_; gh_pair_p (p); p = gh_cdr (p)) { Translator * t = unsmob_translator (gh_car (p)); Engraver * eng = dynamic_cast (t); @@ -40,7 +40,7 @@ Engraver_group_engraver::create_grobs () void Engraver_group_engraver::acknowledge_grobs () { - for (int j =0; j < announce_info_arr_.size(); j++) + for (int j =0; j < announce_info_arr_.size (); j++) { Grob_info info = announce_info_arr_[j]; for (SCM p = simple_trans_list_; gh_pair_p (p); p = gh_cdr (p)) @@ -54,9 +54,9 @@ Engraver_group_engraver::acknowledge_grobs () } void -Engraver_group_engraver::do_announces() +Engraver_group_engraver::do_announces () { - for (SCM p = trans_group_list_; gh_pair_p (p); p =gh_cdr ( p)) + for (SCM p = trans_group_list_; gh_pair_p (p); p =gh_cdr (p)) { Translator * t = unsmob_translator (gh_car (p)); dynamic_cast (t)->do_announces (); @@ -80,7 +80,7 @@ Engraver_group_engraver::do_announces() void Engraver_group_engraver::process_music () { - for (SCM p = simple_trans_list_; gh_pair_p (p); p =gh_cdr ( p)) + for (SCM p = simple_trans_list_; gh_pair_p (p); p =gh_cdr (p)) { Translator * t = unsmob_translator (gh_car (p)); Engraver * eng = dynamic_cast (t); @@ -88,7 +88,7 @@ Engraver_group_engraver::process_music () if (eng) eng->process_music (); } - for (SCM p = trans_group_list_; gh_pair_p (p); p =gh_cdr ( p)) + for (SCM p = trans_group_list_; gh_pair_p (p); p =gh_cdr (p)) { Translator * t = unsmob_translator (gh_car (p)); Engraver*eng = dynamic_cast (t); diff --git a/lily/engraver.cc b/lily/engraver.cc index 5e9df9c922..02e683b055 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -15,7 +15,7 @@ void Engraver::announce_grob (Grob_info inf) { - daddy_grav_l()->announce_grob (inf); + daddy_grav_l ()->announce_grob (inf); } void @@ -29,7 +29,7 @@ Engraver::announce_grob (Grob* e, Music *m) Grob_info i (e, m); if (!i.origin_trans_l_) i.origin_trans_l_ = this; - daddy_grav_l()->announce_grob (i); + daddy_grav_l ()->announce_grob (i); } @@ -37,14 +37,14 @@ Engraver::announce_grob (Grob* e, Music *m) void Engraver::typeset_grob (Grob*p) { - daddy_grav_l()->typeset_grob (p); + daddy_grav_l ()->typeset_grob (p); } Engraver_group_engraver* Engraver::daddy_grav_l () const { - return (daddy_trans_l_ ) + return (daddy_trans_l_) ? dynamic_cast (daddy_trans_l_) : 0; } diff --git a/lily/extender-engraver.cc b/lily/extender-engraver.cc index e261af552f..d3ae21945f 100644 --- a/lily/extender-engraver.cc +++ b/lily/extender-engraver.cc @@ -38,9 +38,9 @@ public: protected: virtual void acknowledge_grob (Grob_info); - virtual void finalize(); + virtual void finalize (); virtual bool try_music (Music*); - virtual void stop_translation_timestep(); + virtual void stop_translation_timestep (); virtual void start_translation_timestep (); virtual void process_music (); private: @@ -62,7 +62,7 @@ void Extender_engraver::acknowledge_grob (Grob_info i) { // -> text_item - if (i.elem_l_->has_interface (ly_symbol2scm("lyric-syllable-interface"))) + if (i.elem_l_->has_interface (ly_symbol2scm ("lyric-syllable-interface"))) { current_lyric_l_ = i.elem_l_; if (extender_p_ @@ -95,7 +95,7 @@ Extender_engraver::finalize () if (extender_p_) { req_l_->origin ()->warning (_ ("unterminated extender")); - extender_p_->set_bound(RIGHT, unsmob_grob (get_property ("currentCommandColumn"))); + extender_p_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn"))); } } @@ -113,7 +113,7 @@ Extender_engraver::process_music () extender_p_ = new Spanner (get_property ("LyricExtender")); - Lyric_extender::set_textitem (extender_p_, LEFT, last_lyric_l_); + Lyric_extender::set_textitem (extender_p_, LEFT, last_lyric_l_); announce_grob (extender_p_, req_l_); } } diff --git a/lily/folded-repeat-iterator.cc b/lily/folded-repeat-iterator.cc index 75c2e0f3d7..16454dba80 100644 --- a/lily/folded-repeat-iterator.cc +++ b/lily/folded-repeat-iterator.cc @@ -61,7 +61,7 @@ Folded_repeat_iterator::construct_children () { Repeated_music * mus = dynamic_cast (music_l_); main_iter_p_ = get_iterator_p (mus->body ()); - if (!main_iter_p_->ok()) + if (!main_iter_p_->ok ()) { leave_body (); enter_alternative (); @@ -75,7 +75,7 @@ Folded_repeat_iterator::process (Moment m) { bool success = try_music (music_l_); if (!success) - music_l_->origin ()->warning ( _("no one to print a repeat brace")); + music_l_->origin ()->warning (_ ("no one to print a repeat brace")); } if (main_iter_p_) @@ -138,4 +138,4 @@ Folded_repeat_iterator::try_music_in_children (Music * m) const return 0; } -IMPLEMENT_CTOR_CALLBACK(Folded_repeat_iterator); +IMPLEMENT_CTOR_CALLBACK (Folded_repeat_iterator); diff --git a/lily/font-interface.cc b/lily/font-interface.cc index 0f946a7480..3793f54d42 100644 --- a/lily/font-interface.cc +++ b/lily/font-interface.cc @@ -19,7 +19,7 @@ SCM Font_interface::font_alist_chain (Grob *me) { SCM defaults = gh_cdr (scm_assoc (ly_symbol2scm ("font-defaults"), - me->paper_l ()->style_sheet_ )); + me->paper_l ()->style_sheet_)); SCM ch = gh_list (me->mutable_property_alist_, me->immutable_property_alist_, @@ -132,15 +132,15 @@ init_syms () bool -Font_interface::wild_compare(SCM field_val, SCM val) +Font_interface::wild_compare (SCM field_val, SCM val) { return (val == SCM_BOOL_F || field_val == wild_sym || field_val == val); } -ADD_SCM_INIT_FUNC(Font_interface_syms,init_syms); +ADD_SCM_INIT_FUNC (Font_interface_syms,init_syms); -MAKE_SCHEME_CALLBACK(Font_interface,properties_to_font_name,2); +MAKE_SCHEME_CALLBACK (Font_interface,properties_to_font_name,2); SCM Font_interface::properties_to_font_name (SCM fonts, SCM alist_chain) { @@ -186,16 +186,16 @@ Font_interface::properties_to_font_name (SCM fonts, SCM alist_chain) if (name != SCM_BOOL_F) { - if (!wild_compare(scm_list_ref (qlist, gh_int2scm (4)), name)) + if (!wild_compare (scm_list_ref (qlist, gh_int2scm (4)), name)) continue; } else { - if (!wild_compare(scm_list_ref (qlist, gh_int2scm (1)), series)) + if (!wild_compare (scm_list_ref (qlist, gh_int2scm (1)), series)) continue; - if (!wild_compare(scm_list_ref (qlist, gh_int2scm (2)), shape)) + if (!wild_compare (scm_list_ref (qlist, gh_int2scm (2)), shape)) continue; - if (!wild_compare(scm_list_ref (qlist, gh_int2scm (3)), family)) + if (!wild_compare (scm_list_ref (qlist, gh_int2scm (3)), family)) continue; } @@ -203,12 +203,12 @@ Font_interface::properties_to_font_name (SCM fonts, SCM alist_chain) { // This if statement will always be true since name must // be SCM_BOOL_F here, right? /MB - if (!wild_compare(scm_list_ref (qlist, gh_int2scm (4)), name)) + if (!wild_compare (scm_list_ref (qlist, gh_int2scm (4)), name)) continue; } else { - if (!wild_compare(gh_car (qlist), rel_sz)) + if (!wild_compare (gh_car (qlist), rel_sz)) continue; } @@ -217,9 +217,9 @@ Font_interface::properties_to_font_name (SCM fonts, SCM alist_chain) return qname; } - warning (_("couldn't find any font satisfying ") ); + warning (_ ("couldn't find any font satisfying ")); scm_write (gh_list (name, point_sz, shape, series , family, rel_sz, SCM_UNDEFINED), scm_current_error_port ()); - scm_flush(scm_current_error_port ()); + scm_flush (scm_current_error_port ()); return ly_str02scm ("cmr10"); diff --git a/lily/font-metric.cc b/lily/font-metric.cc index e8682df66b..7ce615a859 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -5,7 +5,7 @@ (c) 1999--2001 Han-Wen Nienhuys - Mats Bengtsson (the ugly TeX parsing in text_dimension) + Mats Bengtsson (the ugly TeX parsing in text_dimension) */ #include @@ -29,7 +29,7 @@ Font_metric::text_dimension (String text) const switch (text[i]) { case '\\': - for (i++; (i < text.length_i ()) && !isspace(text[i]) + for (i++; (i < text.length_i ()) && !isspace (text[i]) && text[i]!='{' && text[i]!='}'; i++) ; // ugh. @@ -54,7 +54,7 @@ Font_metric::text_dimension (String text) const if (ydims.empty_b ()) ydims = Interval (0,0); - return Box(Interval (0, w), ydims); + return Box (Interval (0, w), ydims); } @@ -76,21 +76,21 @@ Font_metric::Font_metric (Font_metric const &s) Box -Font_metric::get_char (int )const +Font_metric::get_char (int)const { - return Box (Interval(0,0),Interval (0,0)); + return Box (Interval (0,0),Interval (0,0)); } SCM Font_metric::mark_smob (SCM s) { - Font_metric * m = (Font_metric*) SCM_CELL_WORD_1(s); + Font_metric * m = (Font_metric*) SCM_CELL_WORD_1 (s); return m->description_; } int -Font_metric::print_smob (SCM s, SCM port, scm_print_state * ) +Font_metric::print_smob (SCM s, SCM port, scm_print_state *) { Font_metric *m = unsmob_metrics (s); scm_puts ("#(g); + return dynamic_cast (g); } Spanner* to_spanner (Grob*g) { - return dynamic_cast(g); + return dynamic_cast (g); } diff --git a/lily/global-ctor.cc b/lily/global-ctor.cc index 27ab068d09..5fa1db034d 100644 --- a/lily/global-ctor.cc +++ b/lily/global-ctor.cc @@ -23,5 +23,5 @@ void call_constructors () { for (int i=0; i < ctor_global_static_arr_p_->size (); i++) - (ctor_global_static_arr_p_->elem (i)) (); + (ctor_global_static_arr_p_->elem (i)) (); } diff --git a/lily/global-translator.cc b/lily/global-translator.cc index 1174200de2..e7fe6790d7 100644 --- a/lily/global-translator.cc +++ b/lily/global-translator.cc @@ -23,10 +23,10 @@ Global_translator::add_moment_to_process (Moment m) if (m > final_mom_) return; - if (m < now_mom_ ) + if (m < now_mom_) programming_error ("Trying to freeze in time."); - for (int i=0; i < extra_mom_pq_.size(); i++) + for (int i=0; i < extra_mom_pq_.size (); i++) if (extra_mom_pq_[i] == m) return; extra_mom_pq_.insert (m); @@ -35,15 +35,15 @@ Global_translator::add_moment_to_process (Moment m) Moment Global_translator::sneaky_insert_extra_moment (Moment w) { - while (extra_mom_pq_.size() && extra_mom_pq_.front() <= w) - w = extra_mom_pq_.get(); + while (extra_mom_pq_.size () && extra_mom_pq_.front () <= w) + w = extra_mom_pq_.get (); return w; } int -Global_translator::moments_left_i() const +Global_translator::moments_left_i () const { - return extra_mom_pq_.size(); + return extra_mom_pq_.size (); } void @@ -62,7 +62,7 @@ Global_translator::now_mom () const Music_output* -Global_translator::get_output_p() +Global_translator::get_output_p () { return 0; } @@ -89,7 +89,7 @@ Global_translator::run_iterator_on_me (Music_iterator * iter) w.set_infinite (1); if (iter->ok ()) { - w = iter->pending_moment(); + w = iter->pending_moment (); } diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 35db227ff8..04112971d3 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -135,7 +135,7 @@ Gourlay_breaking::do_solve () const } /* do the last one */ - if (break_idx % HAPPY_DOTS_I) + if (break_idx % HAPPY_DOTS_I) progress_indication (String ("[") + to_str (break_idx) + "]"); diff --git a/lily/grace-align-item.cc b/lily/grace-align-item.cc index c907e9ed2b..3f395c94f8 100644 --- a/lily/grace-align-item.cc +++ b/lily/grace-align-item.cc @@ -13,7 +13,7 @@ #include "paper-column.hh" #include "paper-def.hh" -MAKE_SCHEME_CALLBACK(Grace_align_item,before_line_breaking,1); +MAKE_SCHEME_CALLBACK (Grace_align_item,before_line_breaking,1); SCM Grace_align_item::before_line_breaking (SCM smob) { @@ -23,7 +23,7 @@ Grace_align_item::before_line_breaking (SCM smob) me->set_grob_property ("threshold", gh_cons (space, gh_double2scm (infinity_f))); - dynamic_cast(me)->column_l ()->set_grob_property ("contains-grace", SCM_BOOL_T); + dynamic_cast (me)->column_l ()->set_grob_property ("contains-grace", SCM_BOOL_T); return SCM_UNSPECIFIED; } @@ -33,7 +33,7 @@ Grace_align_item::set_interface (Grob*me) { me->set_interface (ly_symbol2scm ("grace-align-interface")); me->set_grob_property ("stacking-dir", gh_int2scm (RIGHT)); - Align_interface::set_interface(me); + Align_interface::set_interface (me); Align_interface::set_axis (me,X_AXIS); } diff --git a/lily/grace-engraver-group.cc b/lily/grace-engraver-group.cc index c5e6bcf9ae..fd60e0de66 100644 --- a/lily/grace-engraver-group.cc +++ b/lily/grace-engraver-group.cc @@ -60,7 +60,7 @@ Grace_engraver_group::typeset_grob (Grob*e) } -Grace_engraver_group::Grace_engraver_group() +Grace_engraver_group::Grace_engraver_group () { calling_self_b_ = false; } @@ -70,9 +70,9 @@ Grace_engraver_group::one_time_step () { calling_self_b_ = true; process_music (); - announces(); - pre_move_processing(); - check_removal(); + announces (); + pre_move_processing (); + check_removal (); calling_self_b_ = false; } @@ -85,7 +85,7 @@ Grace_engraver_group::each (Method_pointer method) } -ADD_THIS_TRANSLATOR(Grace_engraver_group); +ADD_THIS_TRANSLATOR (Grace_engraver_group); /* diff --git a/lily/grace-iterator.cc b/lily/grace-iterator.cc index 3be0038dde..18a7a62bf6 100644 --- a/lily/grace-iterator.cc +++ b/lily/grace-iterator.cc @@ -29,7 +29,7 @@ Grace_iterator::construct_children () void Grace_iterator::process (Moment) { - Global_translator * t = dynamic_cast(report_to_l ()); + Global_translator * t = dynamic_cast (report_to_l ()); if (t) { t->start (); @@ -40,7 +40,7 @@ Grace_iterator::process (Moment) } else { - warning (_("no Grace context available")); + warning (_ ("no Grace context available")); } } @@ -51,4 +51,4 @@ Grace_iterator::pending_moment () const } -IMPLEMENT_CTOR_CALLBACK(Grace_iterator); +IMPLEMENT_CTOR_CALLBACK (Grace_iterator); diff --git a/lily/grace-music.cc b/lily/grace-music.cc index 20d3e8a167..9121df5ff9 100644 --- a/lily/grace-music.cc +++ b/lily/grace-music.cc @@ -22,9 +22,17 @@ Grace_music::length_mom () const return 0; } +Grace_music::Grace_music () +{ + set_mus_property ("iterator-ctor", + Grace_iterator::constructor_cxx_function); +} + Grace_music::Grace_music (SCM p) : Music_wrapper (p) { set_mus_property ("iterator-ctor", Grace_iterator::constructor_cxx_function); } + +ADD_MUSIC (Grace_music); diff --git a/lily/grace-performer-group.cc b/lily/grace-performer-group.cc index c58a8a25c7..54fbce92d9 100644 --- a/lily/grace-performer-group.cc +++ b/lily/grace-performer-group.cc @@ -62,7 +62,7 @@ Grace_performer_group::play_element (Audio_element*e) } -Grace_performer_group::Grace_performer_group() +Grace_performer_group::Grace_performer_group () { calling_self_b_ = false; } @@ -72,9 +72,9 @@ Grace_performer_group::one_time_step () { calling_self_b_ = true; // process_music (); - announces(); - pre_move_processing(); - check_removal(); + announces (); + pre_move_processing (); + check_removal (); calling_self_b_ = false; } diff --git a/lily/grace-position-engraver.cc b/lily/grace-position-engraver.cc index 0f732a37d8..1ea8ce3a4c 100644 --- a/lily/grace-position-engraver.cc +++ b/lily/grace-position-engraver.cc @@ -21,7 +21,7 @@ class Grace_position_engraver:public Engraver { Paper_column *last_musical_col_l_; protected: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); virtual void acknowledge_grob (Grob_info); virtual void create_grobs (); virtual void start_translation_timestep (); @@ -29,7 +29,7 @@ protected: Item*align_l_; Link_array support_; public: - Grace_position_engraver(); + Grace_position_engraver (); }; @@ -93,7 +93,7 @@ Grace_position_engraver::stop_translation_timestep () if (last_musical_col_l_) { - warning (_("Unattached grace notes. Attaching to last musical column.")); + warning (_ ("Unattached grace notes. Attaching to last musical column.")); align_l_->set_parent (0, X_AXIS); Axis_group_interface::add_element (last_musical_col_l_, align_l_); @@ -103,7 +103,7 @@ Grace_position_engraver::stop_translation_timestep () // tja. } } - last_musical_col_l_ = dynamic_cast( unsmob_grob (get_property ("currentMusicalColumn"))); + last_musical_col_l_ = dynamic_cast (unsmob_grob (get_property ("currentMusicalColumn"))); } void @@ -113,5 +113,5 @@ Grace_position_engraver::start_translation_timestep () align_l_ =0; } -ADD_THIS_TRANSLATOR(Grace_position_engraver); +ADD_THIS_TRANSLATOR (Grace_position_engraver); diff --git a/lily/grob-info.cc b/lily/grob-info.cc index edd020796e..c2ed5bd013 100644 --- a/lily/grob-info.cc +++ b/lily/grob-info.cc @@ -19,7 +19,7 @@ Grob_info::Grob_info (Grob*s_l, Music *r_l) } -Grob_info::Grob_info() +Grob_info::Grob_info () { elem_l_ = 0; req_l_ = 0; diff --git a/lily/grob.cc b/lily/grob.cc index 467853e6df..f151def2e2 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -42,7 +42,7 @@ remove dynamic_cast and put this code into respective #define INFINITY_MSG "Infinity or NaN encountered" -Grob::Grob(SCM basicprops) +Grob::Grob (SCM basicprops) { /* fixme: default should be no callback. @@ -93,7 +93,7 @@ Grob::Grob(SCM basicprops) Grob::Grob (Grob const&s) : dim_cache_ (s.dim_cache_) { - original_l_ =(Grob*) &s; + original_l_ = (Grob*) &s; immutable_property_alist_ = s.immutable_property_alist_; mutable_property_alist_ = SCM_EOL; @@ -103,7 +103,7 @@ Grob::Grob (Grob const&s) smobify_self (); } -Grob::~Grob() +Grob::~Grob () { /* do nothing scm-ish and no unprotecting here. @@ -121,7 +121,7 @@ Grob::get_grob_property (const char *nm) const SCM Grob::get_grob_property (SCM sym) const { - SCM s = scm_sloppy_assq(sym, mutable_property_alist_); + SCM s = scm_sloppy_assq (sym, mutable_property_alist_); if (s != SCM_BOOL_F) return gh_cdr (s); @@ -153,7 +153,7 @@ Grob::set_grob_property (const char* k, SCM v) /* Puts the k, v in the immutable_property_alist_, which is convenient for storing variables that are needed during the breaking process. (eg. - Line_of_score::rank : int ) + Line_of_score::rank : int) */ void Grob::set_immutable_grob_property (const char*k, SCM v) @@ -175,7 +175,7 @@ Grob::set_grob_property (SCM s, SCM v) } -MAKE_SCHEME_CALLBACK(Grob,molecule_extent,2); +MAKE_SCHEME_CALLBACK (Grob,molecule_extent,2); SCM Grob::molecule_extent (SCM element_smob, SCM scm_axis) { @@ -185,11 +185,11 @@ Grob::molecule_extent (SCM element_smob, SCM scm_axis) Molecule *m = s->get_molecule (); Interval e ; if (m) - e = m->extent(a); - return ly_interval2scm ( e); + e = m->extent (a); + return ly_interval2scm (e); } -MAKE_SCHEME_CALLBACK(Grob,preset_extent,2); +MAKE_SCHEME_CALLBACK (Grob,preset_extent,2); SCM Grob::preset_extent (SCM element_smob, SCM scm_axis) @@ -208,7 +208,7 @@ Grob::preset_extent (SCM element_smob, SCM scm_axis) return ly_interval2scm (Interval (l, r)); } - return ly_interval2scm ( Interval ()); + return ly_interval2scm (Interval ()); } @@ -243,7 +243,7 @@ Grob::calculate_dependencies (int final, int busy, SCM funcname) // ughugh. String s = ly_symbol2string (funcname); - SCM proc = get_grob_property (s.ch_C()); + SCM proc = get_grob_property (s.ch_C ()); if (gh_procedure_p (proc)) gh_call1 (proc, this->self_scm ()); @@ -313,7 +313,7 @@ Grob::get_uncached_molecule ()const */ void -Grob::do_break_processing() +Grob::do_break_processing () { } @@ -323,7 +323,7 @@ Grob::do_break_processing() Line_of_score * -Grob::line_l() const +Grob::line_l () const { return 0; } @@ -362,7 +362,7 @@ Grob::handle_broken_smobs (SCM src, SCM criterion) if (i && i->break_status_dir () != d) { Item *br = i->find_prebroken_piece (d); - return (br) ? br->self_scm () : SCM_UNDEFINED; + return (br) ? br->self_scm () : SCM_UNDEFINED; } } else @@ -422,7 +422,7 @@ Grob::handle_broken_smobs (SCM src, SCM criterion) } void -Grob::handle_broken_dependencies() +Grob::handle_broken_dependencies () { Spanner * s= dynamic_cast (this); if (original_l_ && s) @@ -441,7 +441,7 @@ Grob::handle_broken_dependencies() } - Line_of_score *line = line_l(); + Line_of_score *line = line_l (); if (line && common_refpoint (line, X_AXIS) && common_refpoint (line, Y_AXIS)) { @@ -462,9 +462,9 @@ Grob::handle_broken_dependencies() do not do this for Line_of_score, since that would remove references to the originals of score-elts, which get then GC'd - (a bad thing.) + (a bad thing.) */ - suicide(); + suicide (); } } @@ -490,7 +490,7 @@ Grob::suicide () } void -Grob::handle_prebroken_dependencies() +Grob::handle_prebroken_dependencies () { } @@ -504,7 +504,7 @@ void Grob::translate_axis (Real y, Axis a) { if (isinf (y) || isnan (y)) - programming_error (_(INFINITY_MSG)); + programming_error (_ (INFINITY_MSG)); else { dim_cache_[a].offset_ += y; @@ -550,18 +550,18 @@ Grob::get_offset (Axis a) const } -MAKE_SCHEME_CALLBACK(Grob,point_dimension_callback,2); +MAKE_SCHEME_CALLBACK (Grob,point_dimension_callback,2); SCM -Grob::point_dimension_callback (SCM , SCM ) +Grob::point_dimension_callback (SCM , SCM) { - return ly_interval2scm ( Interval (0,0)); + return ly_interval2scm (Interval (0,0)); } bool Grob::empty_b (Axis a)const { - return ! (gh_pair_p (dim_cache_[a].dimension_ ) || - gh_procedure_p (dim_cache_[a].dimension_ )); + return ! (gh_pair_p (dim_cache_[a].dimension_) || + gh_procedure_p (dim_cache_[a].dimension_)); } /* @@ -586,7 +586,7 @@ Grob::extent (Grob * refp, Axis a) const /* FIXME: add doco on types, and should typecheck maybe? */ - d->dimension_= gh_call2 (d->dimension_, self_scm(), gh_int2scm (a)); + d->dimension_= gh_call2 (d->dimension_, self_scm (), gh_int2scm (a)); } else return ext; @@ -665,7 +665,7 @@ Grob::name () const { SCM meta = get_grob_property ("meta"); SCM nm = scm_assoc (ly_symbol2scm ("name"), meta); - nm = (gh_pair_p (nm)) ? gh_cdr (nm) : SCM_EOL; + nm = (gh_pair_p (nm)) ? gh_cdr (nm) : SCM_EOL; return gh_string_p (nm) ?ly_scm2string (nm) : classname (this); } @@ -674,7 +674,7 @@ Grob::add_offset_callback (SCM cb, Axis a) { if (!has_offset_callback_b (cb, a)) { - dim_cache_[a].offset_callbacks_ = gh_cons (cb, dim_cache_[a].offset_callbacks_ ); + dim_cache_[a].offset_callbacks_ = gh_cons (cb, dim_cache_[a].offset_callbacks_); dim_cache_[a].offsets_left_ ++; } } @@ -710,7 +710,7 @@ Grob::set_parent (Grob *g, Axis a) dim_cache_[a].parent_l_ = g; } -MAKE_SCHEME_CALLBACK(Grob,fixup_refpoint,1); +MAKE_SCHEME_CALLBACK (Grob,fixup_refpoint,1); SCM Grob::fixup_refpoint (SCM smob) { @@ -736,7 +736,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); @@ -754,14 +754,14 @@ Grob::fixup_refpoint (SCM smob) ****************************************************/ -IMPLEMENT_UNSMOB(Grob, grob); -IMPLEMENT_SMOBS(Grob); -IMPLEMENT_DEFAULT_EQUAL_P(Grob); +IMPLEMENT_UNSMOB (Grob, grob); +IMPLEMENT_SMOBS (Grob); +IMPLEMENT_DEFAULT_EQUAL_P (Grob); SCM Grob::mark_smob (SCM ses) { - Grob * s = (Grob*) SCM_CELL_WORD_1(ses); + Grob * s = (Grob*) SCM_CELL_WORD_1 (ses); scm_gc_mark (s->immutable_property_alist_); scm_gc_mark (s->mutable_property_alist_); @@ -787,7 +787,7 @@ Grob::print_smob (SCM s, SCM port, scm_print_state *) Grob *sc = (Grob *) gh_cdr (s); scm_puts ("#name ().ch_C(), port); + scm_puts ((char *)sc->name ().ch_C (), port); /* don't try to print properties, that is too much hassle. @@ -848,7 +848,7 @@ ly_get_grob_property (SCM elt, SCM sym) void -Grob::discretionary_processing() +Grob::discretionary_processing () { } @@ -889,10 +889,10 @@ Grob::set_interface (SCM k) else { set_grob_property (interfaces_sym, - gh_cons (k, get_grob_property (interfaces_sym))); + gh_cons (k, get_grob_property (interfaces_sym))); } } -ADD_SCM_INIT_FUNC(scoreelt, init_functions); -IMPLEMENT_TYPE_P(Grob, "ly-grob?"); +ADD_SCM_INIT_FUNC (scoreelt, init_functions); +IMPLEMENT_TYPE_P (Grob, "ly-grob?"); diff --git a/lily/group-interface.cc b/lily/group-interface.cc index d0ac48aa3f..3734882cee 100644 --- a/lily/group-interface.cc +++ b/lily/group-interface.cc @@ -14,19 +14,19 @@ void Group_interface::add_thing (Grob*me, String name, SCM s) { me->set_grob_property (name.ch_C (), - gh_cons (s, me->get_grob_property (name.ch_C()))); + gh_cons (s, me->get_grob_property (name.ch_C ()))); } int Group_interface::count (Grob *me, String name) { - return scm_ilength (me->get_grob_property (name.ch_C())); + return scm_ilength (me->get_grob_property (name.ch_C ())); } void Pointer_group_interface::add_element (Grob*me, String name, Grob*p) { - Group_interface::add_thing (me, name, p->self_scm()); + Group_interface::add_thing (me, name, p->self_scm ()); } diff --git a/lily/hairpin.cc b/lily/hairpin.cc index 6634746e85..a42dea8a11 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -21,11 +21,11 @@ SCM Hairpin::brew_molecule (SCM smob) { Grob *me= unsmob_grob (smob); - Spanner *spanner = dynamic_cast(me); + Spanner *spanner = dynamic_cast (me); Real line = me->paper_l ()->get_var ("stafflinethickness"); - SCM s = me->get_grob_property("grow-direction"); + SCM s = me->get_grob_property ("grow-direction"); if (!isdir_b (s)) { me->suicide (); diff --git a/lily/hara-kiri-group-spanner.cc b/lily/hara-kiri-group-spanner.cc index 53166be9e5..909a49d183 100644 --- a/lily/hara-kiri-group-spanner.cc +++ b/lily/hara-kiri-group-spanner.cc @@ -14,7 +14,7 @@ #include "item.hh" -MAKE_SCHEME_CALLBACK(Hara_kiri_group_spanner,y_extent,2); +MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner,y_extent,2); SCM Hara_kiri_group_spanner::y_extent (SCM element_smob, SCM scm_axis) { @@ -28,7 +28,7 @@ Hara_kiri_group_spanner::y_extent (SCM element_smob, SCM scm_axis) void -Hara_kiri_group_spanner::consider_suicide(Grob*me) +Hara_kiri_group_spanner::consider_suicide (Grob*me) { SCM worth = me->get_grob_property ("items-worth-living"); if (gh_pair_p (worth)) @@ -51,7 +51,7 @@ Hara_kiri_group_spanner::consider_suicide(Grob*me) We can't rely on offsets and dimensions of elements in a hara-kiri group. Use a callback to make sure that hara-kiri has been done before asking for offsets. */ -MAKE_SCHEME_CALLBACK(Hara_kiri_group_spanner,force_hara_kiri_callback,2); +MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner,force_hara_kiri_callback,2); SCM Hara_kiri_group_spanner::force_hara_kiri_callback (SCM element_smob, SCM axis) { @@ -63,7 +63,7 @@ Hara_kiri_group_spanner::force_hara_kiri_callback (SCM element_smob, SCM axis) } -MAKE_SCHEME_CALLBACK(Hara_kiri_group_spanner,force_hara_kiri_in_parent_callback,2); +MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner,force_hara_kiri_in_parent_callback,2); SCM Hara_kiri_group_spanner::force_hara_kiri_in_parent_callback (SCM element_smob, SCM axis) { @@ -71,7 +71,7 @@ Hara_kiri_group_spanner::force_hara_kiri_in_parent_callback (SCM element_smob, S Axis a = (Axis) gh_scm2int (axis); assert (a == Y_AXIS); force_hara_kiri_callback (daughter->parent_l (a)->self_scm (), axis); - return gh_double2scm ( 0.0); + return gh_double2scm (0.0); } void diff --git a/lily/hyphen-engraver.cc b/lily/hyphen-engraver.cc index 44eb929805..d7ebcea02e 100644 --- a/lily/hyphen-engraver.cc +++ b/lily/hyphen-engraver.cc @@ -32,9 +32,9 @@ public: protected: virtual void acknowledge_grob (Grob_info); - virtual void finalize(); + virtual void finalize (); virtual bool try_music (Music*); - virtual void stop_translation_timestep(); + virtual void stop_translation_timestep (); virtual void start_translation_timestep (); virtual void create_grobs (); private: @@ -88,7 +88,7 @@ Hyphen_engraver::finalize () if (hyphen_p_) { req_l_->origin ()->warning (_ ("unterminated hyphen")); - hyphen_p_->set_bound(RIGHT, unsmob_grob (get_property ("currentCommandColumn"))); + hyphen_p_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn"))); } } @@ -105,7 +105,7 @@ Hyphen_engraver::create_grobs () hyphen_p_ = new Spanner (get_property ("LyricHyphen")); - Hyphen_spanner (hyphen_p_).set_textitem (LEFT, last_lyric_l_); + Hyphen_spanner (hyphen_p_).set_textitem (LEFT, last_lyric_l_); announce_grob (hyphen_p_, req_l_); } } diff --git a/lily/hyphen-spanner.cc b/lily/hyphen-spanner.cc index 6c0dd240ae..433a107ba6 100644 --- a/lily/hyphen-spanner.cc +++ b/lily/hyphen-spanner.cc @@ -5,7 +5,7 @@ (c) 1999 Glen Prideaux - (adapted from lyric-extender) + (adapted from lyric-extender) */ #include @@ -19,7 +19,7 @@ #include "spanner.hh" #include "item.hh" -MAKE_SCHEME_CALLBACK(Hyphen_spanner,brew_molecule,1) +MAKE_SCHEME_CALLBACK (Hyphen_spanner,brew_molecule,1) SCM Hyphen_spanner::brew_molecule (SCM smob) @@ -30,7 +30,7 @@ Hyphen_spanner::brew_molecule (SCM smob) Direction d = LEFT; do { - common = common->common_refpoint( sp->get_bound (d), X_AXIS); + common = common->common_refpoint (sp->get_bound (d), X_AXIS); } while (flip (&d) != LEFT); Interval bounds; @@ -54,8 +54,8 @@ Hyphen_spanner::brew_molecule (SCM smob) Real w = bounds.length (); /* for length, use a geometric mean of the available space and some minimum */ - if(l < w) - l = sqrt(l*w); + if (l < w) + l = sqrt (l*w); else { /* OK, we have a problem. Usually this means that we're on the @@ -63,7 +63,7 @@ Hyphen_spanner::brew_molecule (SCM smob) the offset for stuff */ /* This test for being on the first column has been shamelessly ripped from spanner.cc */ - Paper_column *sc = dynamic_cast (sp->get_bound(LEFT)->column_l()); + Paper_column *sc = dynamic_cast (sp->get_bound (LEFT)->column_l ()); if (sc != NULL && sc->break_status_dir () == RIGHT) { @@ -78,7 +78,7 @@ Hyphen_spanner::brew_molecule (SCM smob) l = w; } } - Box b (Interval (-l/2,l/2), Interval (h,h+th)); + Box b (Interval (-l/2,l/2), Interval (h,h+th)); Molecule mol (Lookup::filledbox (b)); mol.translate_axis (bounds.center () -sp->relative_coordinate (common, X_AXIS), diff --git a/lily/includable-lexer.cc b/lily/includable-lexer.cc index d1a781699b..70ffaaf097 100644 --- a/lily/includable-lexer.cc +++ b/lily/includable-lexer.cc @@ -21,7 +21,7 @@ #endif #ifndef YY_START -#define YY_START ((yy_start - 1) / 2) +#define YY_START() ((yy_start - 1) / 2) #define YYSTATE YY_START #endif @@ -47,7 +47,7 @@ Includable_lexer::new_input (String s, Sources * global_sources) { String msg = _f ("can't find file: `%s'", s); msg += "\n"; - msg += _f ("(search path: `%s')", global_sources->path_C_->str ().ch_C()); + msg += _f ("(search path: `%s')", global_sources->path_C_->str ().ch_C ()); msg += "\n"; LexerError (msg.ch_C ()); diff --git a/lily/include/align-interface.hh b/lily/include/align-interface.hh index 643bd53175..d7294b990a 100644 --- a/lily/include/align-interface.hh +++ b/lily/include/align-interface.hh @@ -15,8 +15,8 @@ #include "lily-guile.hh" struct Align_interface { - DECLARE_SCHEME_CALLBACK(alignment_callback, (SCM element, SCM axis)); - DECLARE_SCHEME_CALLBACK(fixed_distance_alignment_callback, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (fixed_distance_alignment_callback, (SCM element, SCM axis)); static void align_to_fixed_distance (Grob*,Axis a); static void align_elements_to_extents (Grob*,Axis a); static void set_axis (Grob*,Axis); diff --git a/lily/include/arpeggio.hh b/lily/include/arpeggio.hh index 74411bfc9e..0ae3ccbb13 100644 --- a/lily/include/arpeggio.hh +++ b/lily/include/arpeggio.hh @@ -16,7 +16,7 @@ class Arpeggio { public: DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM)); - DECLARE_SCHEME_CALLBACK(width_callback, (SCM,SCM)); + DECLARE_SCHEME_CALLBACK (width_callback, (SCM,SCM)); static bool has_interface (Grob*); }; diff --git a/lily/include/audio-column.hh b/lily/include/audio-column.hh index 5705a9c7b0..4c5b73cb3d 100644 --- a/lily/include/audio-column.hh +++ b/lily/include/audio-column.hh @@ -22,8 +22,8 @@ public: Audio_column (Moment at_mom); void add_audio_item (Audio_item* i_l); - Moment at_mom() const; - void print() const; + Moment at_mom () const; + void print () const; Link_array audio_item_l_arr_; Performance * performance_l_; diff --git a/lily/include/audio-element-info.hh b/lily/include/audio-element-info.hh index 85db1680ba..e42d4ceeed 100644 --- a/lily/include/audio-element-info.hh +++ b/lily/include/audio-element-info.hh @@ -23,7 +23,7 @@ struct Audio_element_info { Link_array origin_trans_l_arr (Translator*) const; Audio_element_info (Audio_element*, Music*); - Audio_element_info(); + Audio_element_info (); }; diff --git a/lily/include/audio-item.hh b/lily/include/audio-item.hh index 66246a074a..7b07610895 100644 --- a/lily/include/audio-item.hh +++ b/lily/include/audio-item.hh @@ -32,7 +32,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 869361f64b..33306c15c1 100644 --- a/lily/include/axis-group-interface.hh +++ b/lily/include/axis-group-interface.hh @@ -17,7 +17,7 @@ */ struct Axis_group_interface { - DECLARE_SCHEME_CALLBACK(group_extent_callback, (SCM smob, SCM axis)); + DECLARE_SCHEME_CALLBACK (group_extent_callback, (SCM smob, SCM axis)); static Interval relative_group_extent (Axis, Grob * common, SCM list); static void add_element (Grob* me, Grob*); diff --git a/lily/include/bar.hh b/lily/include/bar.hh index fa3330a15b..b83bc935e3 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -20,9 +20,9 @@ public: static void set_interface (Grob*); static Molecule compound_barline (Grob*, String, Real height) ; static Molecule simple_barline (Grob*, Real wid, Real height) ; - DECLARE_SCHEME_CALLBACK(get_staff_bar_size, (SCM )); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); - DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (get_staff_bar_size, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); }; #endif // BAR_HH diff --git a/lily/include/beam.hh b/lily/include/beam.hh index e74b8e1b0e..082ceb630e 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -19,15 +19,15 @@ public: static Item* first_visible_stem (Grob*); static Item* last_visible_stem (Grob*); static bool has_interface (Grob*); - DECLARE_SCHEME_CALLBACK(rest_collision_callback, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (rest_collision_callback, (SCM element, SCM axis)); Beam (SCM); static void add_stem (Grob*,Grob*); static void set_beaming (Grob*,Beaming_info_list *); static void set_stemlens (Grob*); static int get_multiplicity (Grob*me); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); - DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM )); - DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); /* y-dy callbacks diff --git a/lily/include/beaming.hh b/lily/include/beaming.hh index fd1643f153..6fca4f6a97 100644 --- a/lily/include/beaming.hh +++ b/lily/include/beaming.hh @@ -20,7 +20,7 @@ struct Beaming_info Drul_array beams_i_drul_; Beaming_info (Moment, int); - int count (Direction d); + int count (Direction d); Beaming_info (); }; diff --git a/lily/include/box.hh b/lily/include/box.hh index a105d56f4a..39aa77eeb3 100644 --- a/lily/include/box.hh +++ b/lily/include/box.hh @@ -15,11 +15,11 @@ struct Box { Interval interval_a_[NO_AXES]; - Interval &x() {return interval_a_[X_AXIS]; } - 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 &x () {return interval_a_[X_AXIS]; } + 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); void translate (Offset o); @@ -27,7 +27,7 @@ struct Box { void set_empty (); void scale (Real r); void unite (Box b); - Box(); + Box (); Box (Interval ix, Interval iy); }; diff --git a/lily/include/break-algorithm.hh b/lily/include/break-algorithm.hh index 9e7866cac0..c91a00bdaf 100644 --- a/lily/include/break-algorithm.hh +++ b/lily/include/break-algorithm.hh @@ -28,9 +28,9 @@ protected: Real linewidth_f_; /// search all pcols which are breakable. - Link_array find_breaks() const; + Link_array find_breaks () const; - Array find_break_indices() const; + Array find_break_indices () const; /// helper: solve for the columns in #curline#. @@ -42,14 +42,14 @@ protected: Simple_spacer* generate_spacing_problem (Link_array, Interval) const; - virtual Array do_solve() const=0; + virtual Array do_solve () const=0; public: - Simple_spacer* (*get_line_spacer)(); - Break_algorithm(); + Simple_spacer* (*get_line_spacer) (); + Break_algorithm (); void set_pscore (Paper_score*); - Array solve() const; + Array solve () const; }; #endif // BREAK_HH diff --git a/lily/include/break-align-item.hh b/lily/include/break-align-item.hh index 06f62615ed..5321469df9 100644 --- a/lily/include/break-align-item.hh +++ b/lily/include/break-align-item.hh @@ -15,12 +15,12 @@ class Break_align_interface { public: - DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); static void do_alignment (Grob*); static void set_interface (Grob*); static bool has_interface (Grob*); 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)); + DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (self_align_callback, (SCM element, SCM axis)); }; #endif // BREAK_ALIGN_ITEM_HH diff --git a/lily/include/breathing-sign.hh b/lily/include/breathing-sign.hh index 07f82506cd..f9a7a77887 100644 --- a/lily/include/breathing-sign.hh +++ b/lily/include/breathing-sign.hh @@ -19,8 +19,8 @@ class Breathing_sign { public: - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); - DECLARE_SCHEME_CALLBACK(offset_callback, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (offset_callback, (SCM element, SCM axis)); static void set_interface (Grob*); static bool has_interface (Grob*); }; diff --git a/lily/include/chord-name.hh b/lily/include/chord-name.hh index d9cc316497..1374ea192a 100644 --- a/lily/include/chord-name.hh +++ b/lily/include/chord-name.hh @@ -16,8 +16,8 @@ class Chord_name { public: - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); - DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); }; #endif // CHORD_NAME_HH diff --git a/lily/include/chord-tremolo-iterator.hh b/lily/include/chord-tremolo-iterator.hh index 8c35be601d..90e3bc23e2 100644 --- a/lily/include/chord-tremolo-iterator.hh +++ b/lily/include/chord-tremolo-iterator.hh @@ -22,7 +22,7 @@ public: protected: virtual ~Chord_tremolo_iterator (); virtual Moment pending_moment () const; - virtual void construct_children () ; + virtual void construct_children () ; virtual bool ok () const; virtual void process (Moment) ; virtual Music_iterator *try_music_in_children (Music *) const; diff --git a/lily/include/chord.hh b/lily/include/chord.hh index 1b6b856927..e60fe80483 100644 --- a/lily/include/chord.hh +++ b/lily/include/chord.hh @@ -16,7 +16,7 @@ functions ``chord'' is encoded: - (PITCHES . (INVERSION . BASS)) + (PITCHES . (INVERSION . BASS)) Chord:: namespace... */ class Chord diff --git a/lily/include/clef.hh b/lily/include/clef.hh index a436219de1..85be436897 100644 --- a/lily/include/clef.hh +++ b/lily/include/clef.hh @@ -14,8 +14,8 @@ struct Clef { - DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM )); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); static bool has_interface (Grob*); static void set_interface (Grob*); }; diff --git a/lily/include/collision.hh b/lily/include/collision.hh index 798634244e..712fe371f9 100644 --- a/lily/include/collision.hh +++ b/lily/include/collision.hh @@ -30,7 +30,7 @@ class Collision // interface public: static SCM automatic_shift (Grob*); static SCM forced_shift (Grob*); - DECLARE_SCHEME_CALLBACK(force_shift_callback, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis)); static void do_shifts (Grob*); static void add_column (Grob*me,Grob*ncol_l); }; diff --git a/lily/include/column-x-positions.hh b/lily/include/column-x-positions.hh index 3e186c57ae..e8688d3bcd 100644 --- a/lily/include/column-x-positions.hh +++ b/lily/include/column-x-positions.hh @@ -18,7 +18,7 @@ struct Column_x_positions Real force_f_; bool satisfies_constraints_b_; - Column_x_positions(); + Column_x_positions (); }; diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 193636d04c..2670690a3e 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -21,14 +21,14 @@ public: Break_req (); protected: - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; class Mark_req : public Request { public: virtual bool do_equal_b (Request const*) const; SCM mark_label (); - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; /* @@ -37,22 +37,20 @@ public: class Tempo_req : public Request { public: - Tempo_req(); + Tempo_req (); protected: - - VIRTUAL_COPY_CONS(Music); - bool do_equal_b (Request const *) const; + VIRTUAL_COPY_CONS (Music); }; /// check if we're at start of a measure. class Barcheck_req : public Request { public: bool do_equal_b (Request const *) const; - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; class Breathing_sign_req : public Request { - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; /** @@ -64,9 +62,9 @@ public: SCM pitch_alist (); protected: - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); void transpose (Pitch d); - bool do_equal_b (Request const * )const; }; #endif // COMMANDREQUEST_HH + diff --git a/lily/include/context-specced-music.hh b/lily/include/context-specced-music.hh index 29eeb68fbf..c68cb9e2c0 100644 --- a/lily/include/context-specced-music.hh +++ b/lily/include/context-specced-music.hh @@ -14,9 +14,10 @@ class Context_specced_music : public Music_wrapper { -public: +public: + Context_specced_music (); Context_specced_music (SCM); - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; #endif /* CONTEXT_SPECCED_MUSIC_HH */ diff --git a/lily/include/custos.hh b/lily/include/custos.hh index 028982f18f..18a421d84d 100644 --- a/lily/include/custos.hh +++ b/lily/include/custos.hh @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (C) 2000 Juergen Reuter + (C) 2000 Juergen Reuter */ #ifndef CUSTOS_HH @@ -13,11 +13,11 @@ struct Custos { - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); static bool has_interface (Grob*); private: - static void add_streepjes(Grob* me, int pos, int interspaces, Molecule* custos_p_); + static void add_streepjes (Grob* me, int pos, int interspaces, Molecule* custos_p_); static Molecule create_ledger_line (Interval x_extent, Grob *me) ; }; diff --git a/lily/include/dimension-cache-callback.hh b/lily/include/dimension-cache-callback.hh index 4c8d6d59eb..a3186ec4e1 100644 --- a/lily/include/dimension-cache-callback.hh +++ b/lily/include/dimension-cache-callback.hh @@ -11,8 +11,8 @@ #define DIMENSION_CACHE_CALLBACK_HH -typedef Interval (*Dim_cache_callback)(Grob *,Axis); -typedef Real (*Offset_callback)(Grob *,Axis); +typedef Interval (*Dim_cache_callback) (Grob *,Axis); +typedef Real (*Offset_callback) (Grob *,Axis); #endif /* DIMENSION_CACHE_CALLBACK_HH */ diff --git a/lily/include/dimension-cache.hh b/lily/include/dimension-cache.hh index 576879b5a2..a671878f43 100644 --- a/lily/include/dimension-cache.hh +++ b/lily/include/dimension-cache.hh @@ -46,7 +46,7 @@ struct Dimension_cache */ Grob * parent_l_; - Dimension_cache(Dimension_cache const&); + Dimension_cache (Dimension_cache const&); Dimension_cache (); void init (); }; diff --git a/lily/include/directional-element-interface.hh b/lily/include/directional-element-interface.hh index 448ef9d809..81685e377a 100644 --- a/lily/include/directional-element-interface.hh +++ b/lily/include/directional-element-interface.hh @@ -16,7 +16,7 @@ struct Directional_element_interface { public: static SCM direction_sym ; - static void set (Grob*,Direction d); + static void set (Grob*,Direction d); static Direction get (Grob*) ; static bool has_interface (Grob*) ; }; diff --git a/lily/include/dot-column.hh b/lily/include/dot-column.hh index 4757501f63..8cf53ae02a 100644 --- a/lily/include/dot-column.hh +++ b/lily/include/dot-column.hh @@ -22,7 +22,7 @@ public: static void add_head (Grob * dotcol, Grob* rh ); static void set_interface (Grob*); static bool has_interface (Grob*); - DECLARE_SCHEME_CALLBACK(force_shift_callback, (SCM ,SCM)); + DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM ,SCM)); static SCM do_shifts (SCM dotlist); }; #endif // DOT_COLUMN_HH diff --git a/lily/include/dots.hh b/lily/include/dots.hh index 72c85f09f2..1f293a9fa3 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -18,8 +18,8 @@ class Dots { public: - DECLARE_SCHEME_CALLBACK(quantised_position_callback, (SCM element, SCM axis)); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (quantised_position_callback, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); }; #endif // DOTS_HH diff --git a/lily/include/duration.hh b/lily/include/duration.hh index 06680e1b9e..685bddb5fc 100644 --- a/lily/include/duration.hh +++ b/lily/include/duration.hh @@ -27,8 +27,8 @@ struct Duration { static int compare (Duration const&, Duration const&); SCM smobbed_copy () const; - DECLARE_SCHEME_CALLBACK(less_p, (SCM a, SCM b)); - DECLARE_SIMPLE_SMOBS(Duration,); + DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b)); + DECLARE_SIMPLE_SMOBS (Duration,); public: int duration_log ()const; @@ -44,8 +44,8 @@ private: }; #include "compare.hh" -INSTANTIATE_COMPARE(Duration, Duration::compare); -Duration*unsmob_duration(SCM); +INSTANTIATE_COMPARE (Duration, Duration::compare); +Duration*unsmob_duration (SCM); // int compare (Array*, Array*); #endif // DURATION_HH diff --git a/lily/include/engraver-group-engraver.hh b/lily/include/engraver-group-engraver.hh index 65aadbca8e..9b7c69d50c 100644 --- a/lily/include/engraver-group-engraver.hh +++ b/lily/include/engraver-group-engraver.hh @@ -31,9 +31,9 @@ protected: public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); - virtual void do_announces(); + virtual void do_announces (); virtual void announce_grob (Grob_info); virtual void process_music (); private: diff --git a/lily/include/engraver.hh b/lily/include/engraver.hh index d06055ec37..66475cd36e 100644 --- a/lily/include/engraver.hh +++ b/lily/include/engraver.hh @@ -49,8 +49,8 @@ protected: virtual void announce_grob (Grob_info); virtual void process_music (); public: - VIRTUAL_COPY_CONS(Translator); - Engraver_group_engraver * daddy_grav_l() const; + VIRTUAL_COPY_CONS (Translator); + Engraver_group_engraver * daddy_grav_l () const; /** override other ctor */ diff --git a/lily/include/font-interface.hh b/lily/include/font-interface.hh index a75a25b5b5..03aa03898c 100644 --- a/lily/include/font-interface.hh +++ b/lily/include/font-interface.hh @@ -19,8 +19,8 @@ struct Font_interface static Font_metric * get_font (Grob*, SCM alist_chain); static Font_metric * get_default_font (Grob*); static SCM add_style (Grob*, SCM style, SCM alist_chain); - static bool wild_compare(SCM field_val, SCM val); - DECLARE_SCHEME_CALLBACK(properties_to_font_name, (SCM,SCM)); + static bool wild_compare (SCM field_val, SCM val); + DECLARE_SCHEME_CALLBACK (properties_to_font_name, (SCM,SCM)); }; #endif /* FONT_INTERFACE_HH */ diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index 24c9cc1032..0bea74247e 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -25,7 +25,7 @@ public: virtual Box text_dimension (String) const; virtual Molecule find_by_name (String) const; - DECLARE_SMOBS(Font_metric,); + DECLARE_SMOBS (Font_metric,); private: Font_metric (Font_metric const&); // no copy. protected: diff --git a/lily/include/global-ctor.hh b/lily/include/global-ctor.hh index 03ecd38457..05f3a2d8c8 100644 --- a/lily/include/global-ctor.hh +++ b/lily/include/global-ctor.hh @@ -21,7 +21,7 @@ public: \ } _ ## y ## _ctor_init; \ -#define ADD_GLOBAL_CTOR(x) ADD_GLOBAL_CTOR_WITHNAME(x,x); +#define ADD_GLOBAL_CTOR(x) ADD_GLOBAL_CTOR_WITHNAME (x,x); typedef void (* Global_ctor ) (); diff --git a/lily/include/global-translator.hh b/lily/include/global-translator.hh index 606fea37bb..51c125c9c2 100644 --- a/lily/include/global-translator.hh +++ b/lily/include/global-translator.hh @@ -18,13 +18,13 @@ class Global_translator : public virtual Translator_group{ PQueue extra_mom_pq_; public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Moment final_mom_; Moment prev_mom_; Moment now_mom_; - Global_translator(); + Global_translator (); - int moments_left_i() const; + int moments_left_i () const; Moment sneaky_insert_extra_moment (Moment); void add_moment_to_process (Moment); void run_iterator_on_me (Music_iterator*); @@ -32,8 +32,8 @@ public: virtual Music_output *get_output_p (); virtual void prepare (Moment); virtual void one_time_step (); - virtual void finish(); - virtual void start(); + virtual void finish (); + virtual void start (); virtual Moment now_mom () const; diff --git a/lily/include/gourlay-breaking.hh b/lily/include/gourlay-breaking.hh index 54da51c85c..6780025903 100644 --- a/lily/include/gourlay-breaking.hh +++ b/lily/include/gourlay-breaking.hh @@ -17,8 +17,8 @@ */ struct Gourlay_breaking : public Break_algorithm { - Array do_solve() const; - Gourlay_breaking(); + Array do_solve () const; + Gourlay_breaking (); Real combine_demerits (Column_x_positions const&,Column_x_positions const&) const; }; #endif // GOURLAY_BREAKING_HH diff --git a/lily/include/grace-align-item.hh b/lily/include/grace-align-item.hh index b89bd6ef90..f90650b844 100644 --- a/lily/include/grace-align-item.hh +++ b/lily/include/grace-align-item.hh @@ -19,7 +19,7 @@ class Grace_align_item public: static void set_interface (Grob*); static bool has_interface (Grob*); - DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); }; #endif /* GRACE_ALIGN_ITEM_HH */ diff --git a/lily/include/grace-engraver-group.hh b/lily/include/grace-engraver-group.hh index 1419ce3e83..a918311208 100644 --- a/lily/include/grace-engraver-group.hh +++ b/lily/include/grace-engraver-group.hh @@ -20,7 +20,7 @@ class Grace_engraver_group : public Engraver_group_engraver, public Global_trans bool calling_self_b_; bool pass_to_top_b (Music *) const; public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Grace_engraver_group (); protected: virtual void initialize (); diff --git a/lily/include/grace-music.hh b/lily/include/grace-music.hh index 5392b734cc..47def5db9d 100644 --- a/lily/include/grace-music.hh +++ b/lily/include/grace-music.hh @@ -15,8 +15,9 @@ class Grace_music : public Music_wrapper { public: - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); Grace_music (SCM); + Grace_music (); protected: virtual void compress (Moment); virtual Moment length_mom () const; diff --git a/lily/include/grace-performer-group.hh b/lily/include/grace-performer-group.hh index f7d2b93221..da1275393c 100644 --- a/lily/include/grace-performer-group.hh +++ b/lily/include/grace-performer-group.hh @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1999--2001 Jan Nieuwenhuizen + (c) 1999--2001 Jan Nieuwenhuizen */ @@ -19,7 +19,7 @@ class Grace_performer_group : public Performer_group_performer, public Global_tr Array announce_to_top_; bool calling_self_b_; public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Grace_performer_group (); protected: virtual void announce_element (Audio_element_info); diff --git a/lily/include/grob-info.hh b/lily/include/grob-info.hh index 86997faaee..c8f57c20aa 100644 --- a/lily/include/grob-info.hh +++ b/lily/include/grob-info.hh @@ -28,7 +28,7 @@ public: Grob_info (Grob*, Music*); - Grob_info(); + Grob_info (); }; diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 3940b7f58a..dc95ba5143 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -85,7 +85,7 @@ public: bool linked_b () const; - VIRTUAL_COPY_CONS(Grob); + VIRTUAL_COPY_CONS (Grob); /** Recursively track all dependencies of this Grob. The @@ -108,9 +108,9 @@ public: void suicide (); - DECLARE_SCHEME_CALLBACK(preset_extent, (SCM smob, SCM axis)); - DECLARE_SCHEME_CALLBACK(point_dimension_callback, (SCM smob, SCM axis)); - DECLARE_SCHEME_CALLBACK(molecule_extent, (SCM smob, SCM axis)); + DECLARE_SCHEME_CALLBACK (preset_extent, (SCM smob, SCM axis)); + DECLARE_SCHEME_CALLBACK (point_dimension_callback, (SCM smob, SCM axis)); + DECLARE_SCHEME_CALLBACK (molecule_extent, (SCM smob, SCM axis)); static SCM ly_set_grob_property (SCM, SCM,SCM); @@ -123,7 +123,7 @@ public: virtual void handle_prebroken_dependencies (); - DECLARE_SMOBS(Grob,foo); + DECLARE_SMOBS (Grob,foo); void init (); @@ -171,7 +171,7 @@ public: void set_parent (Grob* e, Axis); Grob *parent_l (Axis a) const; - DECLARE_SCHEME_CALLBACK(fixup_refpoint, (SCM)); + DECLARE_SCHEME_CALLBACK (fixup_refpoint, (SCM)); }; Grob * unsmob_grob (SCM); diff --git a/lily/include/hara-kiri-group-spanner.hh b/lily/include/hara-kiri-group-spanner.hh index 52312d6f97..9f1fc528db 100644 --- a/lily/include/hara-kiri-group-spanner.hh +++ b/lily/include/hara-kiri-group-spanner.hh @@ -17,9 +17,9 @@ class Hara_kiri_group_spanner { public: - DECLARE_SCHEME_CALLBACK(force_hara_kiri_callback, (SCM ,SCM)); - DECLARE_SCHEME_CALLBACK(y_extent, (SCM smob, SCM axis)); - DECLARE_SCHEME_CALLBACK(force_hara_kiri_in_parent_callback, (SCM ,SCM)); + DECLARE_SCHEME_CALLBACK (force_hara_kiri_callback, (SCM ,SCM)); + DECLARE_SCHEME_CALLBACK (y_extent, (SCM smob, SCM axis)); + DECLARE_SCHEME_CALLBACK (force_hara_kiri_in_parent_callback, (SCM ,SCM)); static void add_element (Grob *me, Grob *e); static void set_interface (Grob*me); static bool has_interface (Grob*); diff --git a/lily/include/hyphen-spanner.hh b/lily/include/hyphen-spanner.hh index 2cdcdab2fc..ad4870a9d5 100644 --- a/lily/include/hyphen-spanner.hh +++ b/lily/include/hyphen-spanner.hh @@ -13,9 +13,9 @@ struct Hyphen_spanner { public: Spanner* elt_l_; - Hyphen_spanner (Spanner*); + Hyphen_spanner (Spanner*); void set_textitem (Direction, Grob*); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); }; #endif // HYPHEN_SPANNER_HH diff --git a/lily/include/interpretation-context-handle.hh b/lily/include/interpretation-context-handle.hh index 4d630936c0..8b05d48b84 100644 --- a/lily/include/interpretation-context-handle.hh +++ b/lily/include/interpretation-context-handle.hh @@ -19,7 +19,7 @@ public: Interpretation_context_handle* clone () const; void set_translator (Translator_group*); bool try_music (Music *); - void operator =(Interpretation_context_handle const&); + void operator = (Interpretation_context_handle const&); Interpretation_context_handle (Interpretation_context_handle const&); Translator_group * report_to_l () const; diff --git a/lily/include/item.hh b/lily/include/item.hh index 0591a80781..5748fea2bb 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -26,7 +26,7 @@ class Item : public Grob Drul_array broken_to_drul_; public: - VIRTUAL_COPY_CONS(Grob); + VIRTUAL_COPY_CONS (Grob); Item (SCM); Item (Item const &); @@ -38,12 +38,12 @@ public: Item * find_prebroken_piece (Direction) const; Grob * find_broken_piece (Line_of_score*) const; - virtual Line_of_score * line_l() const; + virtual Line_of_score * line_l () const; virtual Paper_column * column_l () const; virtual void handle_prebroken_dependencies (); protected: virtual void discretionary_processing (); - void copy_breakable_items(); + void copy_breakable_items (); virtual SCM do_derived_mark (); }; diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index cb8e28aab8..8b32647c4e 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -13,10 +13,10 @@ struct Key_item { - static int calculate_position(Grob*,SCM pair) ; + static int calculate_position (Grob*,SCM pair) ; static void set_interface (Grob*); static bool has_interface (Grob*); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); }; #endif // KEYITEM_HH diff --git a/lily/include/kpath.hh b/lily/include/kpath.hh index 95e7df7209..e6b0f54398 100644 --- a/lily/include/kpath.hh +++ b/lily/include/kpath.hh @@ -3,7 +3,7 @@ kpath.hh -- declare kpath funcs. source file of the GNU LilyPond music typesetter -(c) 2000--2001 Han-Wen Nienhuys + (c) 2000--2001 Han-Wen Nienhuys */ diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index d2cf5074ee..cde9d412a3 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -83,19 +83,19 @@ SCM index_set_cell (SCM cellp, Direction d, SCM val); /* snarfing. */ -void add_scm_init_func (void (*)()); +void add_scm_init_func (void (*) ()); -typedef SCM(*Scheme_function_unknown)(); +typedef SCM (*Scheme_function_unknown) (); #if __GNUC_MINOR__ >= 96 -typedef SCM(*Scheme_function_0)(); -typedef SCM(*Scheme_function_1)(SCM); -typedef SCM(*Scheme_function_2)(SCM,SCM); +typedef SCM (*Scheme_function_0) (); +typedef SCM (*Scheme_function_1) (SCM); +typedef SCM (*Scheme_function_2) (SCM,SCM); #else -typedef SCM(*Scheme_function_0)(...); -typedef SCM(*Scheme_function_1)(...); -typedef SCM(*Scheme_function_2)(...); +typedef SCM (*Scheme_function_0) (...); +typedef SCM (*Scheme_function_1) (...); +typedef SCM (*Scheme_function_2) (...); #endif #define DECLARE_SCHEME_CALLBACK(NAME,ARGS) \ @@ -108,10 +108,10 @@ void \ TYPE ## _ ## FUNC ## _init_functions () \ { \ TYPE :: FUNC ## _proc = gh_new_procedure ## ARGCOUNT ## _0 (#TYPE "::" #FUNC, \ - ((Scheme_function_ ## ARGCOUNT)TYPE :: FUNC)); \ + ((Scheme_function_ ## ARGCOUNT)TYPE :: FUNC)); \ } \ \ -ADD_SCM_INIT_FUNC(TYPE ## _ ## FUNC ## _callback, TYPE ## _ ## FUNC ## _init_functions); \ +ADD_SCM_INIT_FUNC (TYPE ## _ ## FUNC ## _callback, TYPE ## _ ## FUNC ## _init_functions); \ #define ADD_SCM_INIT_FUNC(name, func)\ diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 94e0adb016..7259cd3b28 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2001 Han-Wen Nienhuys + (c) 1997--2001 Han-Wen Nienhuys */ #ifndef LILY_PROTO_HH @@ -173,10 +173,8 @@ class Tie_performer; class Tie_req; class Time_scaled_music; class Time_scaled_music_iterator; -class Time_signature_change_req; class Time_signature_performer; class Timing_engraver; -class Timing_req; class Timing_translator; class Translation_property; class Translator; diff --git a/lily/include/line-group-group-engraver.hh b/lily/include/line-group-group-engraver.hh index 4774141b38..49751d8b08 100644 --- a/lily/include/line-group-group-engraver.hh +++ b/lily/include/line-group-group-engraver.hh @@ -23,13 +23,13 @@ protected: Spanner *staffline_p_; virtual void create_line_spanner (); - virtual void initialize(); - virtual void finalize(); + virtual void initialize (); + virtual void finalize (); virtual void typeset_grob (Grob*); public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); - Line_group_engraver_group(); + Line_group_engraver_group (); }; diff --git a/lily/include/line-of-score.hh b/lily/include/line-of-score.hh index 88068617f9..e2c2fc4b73 100644 --- a/lily/include/line-of-score.hh +++ b/lily/include/line-of-score.hh @@ -15,9 +15,9 @@ class Line_of_score : public Spanner { public: int rank_i_; - void post_processing(bool); + void post_processing (bool); - Line_of_score(SCM); + Line_of_score (SCM); /// is #c# contained in #*this#? bool contains_b (Paper_column const *c) const; int element_count () const; @@ -34,7 +34,7 @@ public: void output_scheme (SCM); void pre_processing (); protected: - VIRTUAL_COPY_CONS(Grob); + VIRTUAL_COPY_CONS (Grob); }; #endif diff --git a/lily/include/ly-smobs.icc b/lily/include/ly-smobs.icc index c38d545829..0405b9c506 100644 --- a/lily/include/ly-smobs.icc +++ b/lily/include/ly-smobs.icc @@ -25,14 +25,14 @@ void init_type_p_ ## CL ()\ {\ scm_make_gsubr (FUNCNAME, 1, 0, 0, (Scheme_function_unknown) CL::smob_p);\ }\ -ADD_SCM_INIT_FUNC(init_type_p_ ## CL, init_type_p_ ## CL) +ADD_SCM_INIT_FUNC (init_type_p_ ## CL, init_type_p_ ## CL) #ifndef SCM_CELL_TYPE -#define SCM_CELL_TYPE(X) SCM_CAR(X) +#define SCM_CELL_TYPE(X) SCM_CAR (X) #endif #ifndef SCM_CELL_WORD_1 -#define SCM_CELL_WORD_1(X) SCM_CDR(X) +#define SCM_CELL_WORD_1(X) SCM_CDR (X) #endif @@ -41,7 +41,7 @@ long CL::smob_tag_; \ SCM \ CL::smob_p (SCM s) \ { \ - if (SCM_NIMP(s) && SCM_CELL_TYPE(s) == smob_tag_) \ + if (SCM_NIMP (s) && SCM_CELL_TYPE (s) == smob_tag_) \ return SCM_BOOL_T; \ else \ return SCM_BOOL_F; \ @@ -57,30 +57,30 @@ CL::init_smobs () \ SCM CL::smobbed_self () const \ { \ SCM s; \ - s = gh_cons (SCM_PACK(CL::smob_tag_), SCM_PACK(this)); \ - scm_done_malloc(sizeof(CL)); \ + s = gh_cons (SCM_PACK (CL::smob_tag_), SCM_PACK (this)); \ + scm_done_malloc (sizeof (CL)); \ \ return s; \ } \ CL * \ CL::unsmob (SCM s) \ { \ - if (SCM_NIMP(s) && SCM_CELL_TYPE(s) == smob_tag_) \ - return (CL*) SCM_CELL_WORD_1(s); \ + if (SCM_NIMP (s) && SCM_CELL_TYPE (s) == smob_tag_) \ + return (CL*) SCM_CELL_WORD_1 (s); \ else \ return 0; \ } \ scm_sizet \ CL::free_smob (SCM ses) \ { \ - CL * s = (CL*) SCM_CDR(ses); \ + CL * s = (CL*) SCM_CDR (ses); \ delete s; \ return sizeof (CL); \ } \ -ADD_SCM_INIT_FUNC(CL, CL::init_smobs) +ADD_SCM_INIT_FUNC (CL, CL::init_smobs) #define IMPLEMENT_SMOBS(CL) \ -IMPLEMENT_SIMPLE_SMOBS(CL) \ +IMPLEMENT_SIMPLE_SMOBS (CL) \ SCM \ CL::smobify_self () \ { \ @@ -96,15 +96,15 @@ CL::unprotected_smobify_self () \ that S isn't GC-ed from under us. \ \ We don't use smobbed_self () to ensure that mark_smob () doesn't have to \ - deal half-initialized objects: scm_done_malloc( ) might trigger GC. \ + deal half-initialized objects: scm_done_malloc ( ) might trigger GC. \ the warning in smobs.hh is just to be doubleplus goodly sure \ */ \ SCM s; \ - SCM_NEWCELL(s); \ - SCM_SETCAR(s,CL::smob_tag_); \ - SCM_SETCDR (s, SCM_PACK(this)); \ + SCM_NEWCELL (s); \ + SCM_SETCAR (s,CL::smob_tag_); \ + SCM_SETCDR (s, SCM_PACK (this)); \ self_scm_ = s; \ - scm_done_malloc(sizeof(CL)); \ + scm_done_malloc (sizeof (CL)); \ return s; \ } diff --git a/lily/include/lyric-combine-music.hh b/lily/include/lyric-combine-music.hh index a2fcd65dae..e9711a1d3c 100644 --- a/lily/include/lyric-combine-music.hh +++ b/lily/include/lyric-combine-music.hh @@ -18,10 +18,11 @@ public: Music * music_l () const; Music * lyrics_l () const; + Lyric_combine_music (); Lyric_combine_music (SCM); virtual void transpose (Pitch); - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); virtual Moment length_mom () const; virtual Pitch to_relative_octave (Pitch); virtual void compress (Moment); diff --git a/lily/include/lyric-extender.hh b/lily/include/lyric-extender.hh index 48595e43e0..1b76b715ac 100644 --- a/lily/include/lyric-extender.hh +++ b/lily/include/lyric-extender.hh @@ -29,7 +29,7 @@ class Lyric_extender { public: static void set_textitem (Spanner*, Direction, Grob*); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); }; #endif // EXTENDER_SPANNER_HH diff --git a/lily/include/lyric-phrasing-engraver.hh b/lily/include/lyric-phrasing-engraver.hh index f0e02bcfe7..68996710f9 100644 --- a/lily/include/lyric-phrasing-engraver.hh +++ b/lily/include/lyric-phrasing-engraver.hh @@ -26,27 +26,27 @@ class Syllable_group; /* * Build an engraver that catches noteheads and lyrics. -(It needs to be in a context above Staff and Lyrics, eg. in Score + (It needs to be in a context above Staff and Lyrics, eg. in Score context.) * Determine which heads belong to which lyrics -(eg. by looking at the names of their originating contexts, or maybe + (eg. by looking at the names of their originating contexts, or maybe some \properties) * Attach the lyrics to the appropriate heads -(by doing lyric->set_parent (head, X_AXIS), that will fix the current + (by doing lyric->set_parent (head, X_AXIS), that will fix the current noteheadwidth guessing kludge) * Check if the lyric syllables end or start a phrase. -(eg. check if the syllable ends with punctuation, and remember that + (eg. check if the syllable ends with punctuation, and remember that fact for the next one.) * Adjust their alignment accordingly. -(eg. by doing lyric->add_offset_callback(centered_on_parent,X_AXIS) + (eg. by doing lyric->add_offset_callback (centered_on_parent,X_AXIS) and setting self-alignment-X) * Add a property to switch on/off the engraver (for multi stanza @@ -62,16 +62,16 @@ for melismas as well. class Lyric_phrasing_engraver : public Engraver { protected: - virtual void acknowledge_grob(Grob_info); + virtual void acknowledge_grob (Grob_info); virtual void create_grobs (); - virtual void stop_translation_timestep(); + virtual void stop_translation_timestep (); virtual void finalize (); private: - void record_notehead(const String &context_id, Grob * notehead); - void record_lyric(const String &context_id, Grob * lyric); - void record_melisma(const String &context_id); - void record_extender(const String &context_id, Grob * extender); - Syllable_group * lookup_context_id(const String &context_id); + void record_notehead (const String &context_id, Grob * notehead); + void record_lyric (const String &context_id, Grob * lyric); + void record_melisma (const String &context_id); + void record_extender (const String &context_id, Grob * extender); + Syllable_group * lookup_context_id (const String &context_id); public: Lyric_phrasing_engraver (); @@ -97,25 +97,25 @@ class Syllable_group bool melisma_b_; Real group_translation_f_; public: - static SCM make_entry(); - void set_first_in_phrase(bool f); - void set_notehead(Grob * notehead); - void add_lyric(Grob * lyric); - void add_extender(Grob * extender); - void set_melisma() { melisma_b_ = true; } - bool get_melisma() { return melisma_b_; } - int lyric_count() { return lyric_list_.size(); } - void clear(); - bool is_empty(); - bool set_lyric_align(const char *punc, Grob *default_notehead_l); - void adjust_melisma_align(); - int appropriate_alignment(const char *punc); - Real amount_to_translate(); - void next_lyric(); - void copy(Syllable_group *); + static SCM make_entry (); + void set_first_in_phrase (bool f); + void set_notehead (Grob * notehead); + void add_lyric (Grob * lyric); + void add_extender (Grob * extender); + void set_melisma () { melisma_b_ = true; } + bool get_melisma () { return melisma_b_; } + int lyric_count () { return lyric_list_.size (); } + void clear (); + bool is_empty (); + bool set_lyric_align (const char *punc, Grob *default_notehead_l); + void adjust_melisma_align (); + int appropriate_alignment (const char *punc); + Real amount_to_translate (); + void next_lyric (); + void copy (Syllable_group *); private: - Syllable_group(); - DECLARE_SIMPLE_SMOBS(Syllable_group,); + Syllable_group (); + DECLARE_SIMPLE_SMOBS (Syllable_group,); } ; Syllable_group * unsmob_voice_entry (SCM); diff --git a/lily/include/main.hh b/lily/include/main.hh index 5405857a4b..1521bbd4c9 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -10,10 +10,10 @@ #include "lily-proto.hh" -void debug_init(); +void debug_init (); void set_debug (bool); -void do_scores(); -void clear_scores(); +void do_scores (); +void clear_scores (); void add_score (Score* s); void set_default_output (String s); String find_file (String); diff --git a/lily/include/midi-def.hh b/lily/include/midi-def.hh index 1c4c1fe205..9ec3167720 100644 --- a/lily/include/midi-def.hh +++ b/lily/include/midi-def.hh @@ -23,14 +23,14 @@ class Midi_def : public Music_output_def { static int score_count_i_; public: - VIRTUAL_COPY_CONS(Music_output_def); + VIRTUAL_COPY_CONS (Music_output_def); - Midi_def(); + Midi_def (); int get_tempo_i (Moment moment); void set_tempo (Moment moment, int count_per_minute_i); virtual int get_next_score_count () const; - static void reset_score_count(); + static void reset_score_count (); }; #endif // MIDI_DEF_HH diff --git a/lily/include/midi-stream.hh b/lily/include/midi-stream.hh index 3881993ab1..599b3a2b16 100644 --- a/lily/include/midi-stream.hh +++ b/lily/include/midi-stream.hh @@ -12,13 +12,13 @@ /// Midi outputfile struct Midi_stream { Midi_stream (String filename_str); - ~Midi_stream(); + ~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(); + void open (); ostream* os_p_; String filename_str_; diff --git a/lily/include/midi-walker.hh b/lily/include/midi-walker.hh index 766bc08e5c..342983f5f1 100644 --- a/lily/include/midi-walker.hh +++ b/lily/include/midi-walker.hh @@ -15,7 +15,7 @@ struct Midi_note_event : PQueue_ent { bool ignore_b_; - Midi_note_event(); + Midi_note_event (); }; int compare (Midi_note_event const& left, Midi_note_event const& right); @@ -27,10 +27,10 @@ class Midi_walker { public: Midi_walker (Audio_staff* audio_staff_l, Midi_track* midi_track_l); - ~Midi_walker(); + ~Midi_walker (); - void process(); - void operator ++(int); + void process (); + void operator ++ (int); bool ok () const; private: void do_start_note (Midi_note* note_p); diff --git a/lily/include/minmax.tcc b/lily/include/minmax.tcc index 5f3fa895e7..5e19689bb3 100644 --- a/lily/include/minmax.tcc +++ b/lily/include/minmax.tcc @@ -1,6 +1,6 @@ /* - minmax.cc -- implement minmax() + minmax.cc -- implement minmax () source file of the GNU LilyPond music typesetter diff --git a/lily/include/misc.hh b/lily/include/misc.hh index 917c66a6b6..892dca89f2 100644 --- a/lily/include/misc.hh +++ b/lily/include/misc.hh @@ -7,8 +7,8 @@ #include "array.hh" #include "interval.hh" -double log_2(double x) ; -int intlog2(int d); +double log_2 (double x) ; +int intlog2 (int d); inline int sign (int i) diff --git a/lily/include/molecule.hh b/lily/include/molecule.hh index 41eb304160..a8a3425279 100644 --- a/lily/include/molecule.hh +++ b/lily/include/molecule.hh @@ -37,24 +37,24 @@ Empty molecules have empty dimensions. If add_at_edge is used to init the molecule, we assume that - DIMENSIONS = (Interval(0,0),Interval(0,0) + DIMENSIONS = (Interval (0,0),Interval (0,0) */ class Molecule { Box dim_; SCM expr_; - DECLARE_SIMPLE_SMOBS(Molecule,); + DECLARE_SIMPLE_SMOBS (Molecule,); public: Molecule (Box, SCM s); - Molecule(); + Molecule (); SCM smobbed_copy () const; SCM get_expr () const; /** - Set dimensions to empty, or to (Interval(0,0),Interval(0,0) */ + Set dimensions to empty, or to (Interval (0,0),Interval (0,0) */ void set_empty (bool); void add_at_edge (Axis a, Direction d, const Molecule &m, Real padding); void add_molecule (Molecule const &m); @@ -63,9 +63,9 @@ public: /** align D direction in axis A. - If D == CENTER, then move the dimension(A).center() to (0,0) + If D == CENTER, then move the dimension (A).center () to (0,0) - Else, move so dimension(A)[D] == 0.0 + Else, move so dimension (A)[D] == 0.0 */ void align_to (Axis a, Direction d); @@ -77,7 +77,7 @@ public: codify THIS into a Scheme expression. */ SCM create_scheme () const; - bool empty_b() const; + bool empty_b () const; static SCM ly_get_molecule_extent (SCM mol, SCM axis); diff --git a/lily/include/moment.hh b/lily/include/moment.hh index 2113ab9f60..7810f2063f 100644 --- a/lily/include/moment.hh +++ b/lily/include/moment.hh @@ -19,7 +19,7 @@ FIXME: remove self_scm_ and then remove this class */ class Moment : public Rational { - DECLARE_SIMPLE_SMOBS(Moment,); + DECLARE_SIMPLE_SMOBS (Moment,); public: Moment () { } Moment (int m) : Rational (m) { } diff --git a/lily/include/multi-measure-rest.hh b/lily/include/multi-measure-rest.hh index 2a6ef9fae0..887e0b504e 100644 --- a/lily/include/multi-measure-rest.hh +++ b/lily/include/multi-measure-rest.hh @@ -19,9 +19,10 @@ class Multi_measure_rest public: static void set_interface (Grob*); static bool has_interface (Grob*); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (percent, (SCM)); static void add_column (Grob*,Item*); - DECLARE_SCHEME_CALLBACK(set_spacing_rods, (SCM )); + DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM )); }; #endif /* MULTI_MEASURE_REST_HH */ diff --git a/lily/include/music-constructor.hh b/lily/include/music-constructor.hh new file mode 100644 index 0000000000..587db25680 --- /dev/null +++ b/lily/include/music-constructor.hh @@ -0,0 +1,35 @@ +/* + music-constructor.hh -- declare Music_constructor + + source file of the GNU LilyPond music typesetter + + (c) 2001 Han-Wen Nienhuys + + */ + +#ifndef MUSIC_CONSTRUCTOR_HH +#define MUSIC_CONSTRUCTOR_HH + +#include "lily-proto.hh" +#include "string.hh" +#include "global-ctor.hh" + +#define ADD_MUSIC(type) \ +Music * _ ## type ## _ctor ()\ +{\ + return new type;\ +}\ +static void _ ## type ## _adder () {\ + add_music_ctor (#type, & _ ## type ## _ctor);\ +}\ +ADD_GLOBAL_CTOR (_ ## type ## _adder); + +void add_music_ctor (String, Music* (*) ()); +Music*get_music (String); + + + + + +#endif /* MUSIC_CONSTRUCTOR_HH */ + diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index 019976f848..4041b5d028 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -26,10 +26,10 @@ ok () -- events left ? pending_mom () -- time tag of the next event to be processed. - PRECONDITION: this->ok() holds. + PRECONDITION: this->ok () holds. process (M) -- process all at M (Precondition: no events exist - before M, this->ok() holds). Side-effects: + before M, this->ok () holds). Side-effects: * This removes all events at M from the pending queue. @@ -120,14 +120,14 @@ Class ## _ctor (SCM) \ } \ SCM Class :: constructor_cxx_function;\ void \ -Class ## _constructor_init() \ +Class ## _constructor_init () \ { \ SCM s = smobify_cxx_function (& Class ## _ctor); \ scm_permanent_object (s);\ gh_define (#Class "::constructor", s);\ Class :: constructor_cxx_function = s;\ }\ -ADD_SCM_INIT_FUNC(Class ## _ctor_init, Class ## _constructor_init); +ADD_SCM_INIT_FUNC (Class ## _ctor_init, Class ## _constructor_init); diff --git a/lily/include/music-list.hh b/lily/include/music-list.hh index 1212195f9c..b953c6a35c 100644 --- a/lily/include/music-list.hh +++ b/lily/include/music-list.hh @@ -19,10 +19,12 @@ class Simultaneous_music : public Music_sequence { public: - VIRTUAL_COPY_CONS(Music); - Simultaneous_music(SCM); + VIRTUAL_COPY_CONS (Music); + Simultaneous_music (SCM); virtual Pitch to_relative_octave (Pitch); virtual Moment length_mom () const; + + Simultaneous_music (); }; /** @@ -32,9 +34,11 @@ public: class Request_chord : public Simultaneous_music { public: - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); virtual Pitch to_relative_octave (Pitch); - Request_chord(SCM list); + Request_chord (SCM list); + + Request_chord (); }; /** @@ -43,9 +47,11 @@ public: class Sequential_music : public Music_sequence { public: - VIRTUAL_COPY_CONS(Music); - Sequential_music(SCM); + VIRTUAL_COPY_CONS (Music); + Sequential_music (SCM); virtual Moment length_mom () const; + + Sequential_music (); }; #endif // Music_sequence_HH diff --git a/lily/include/music-output-def.hh b/lily/include/music-output-def.hh index 3381788dbb..9128c2b2ed 100644 --- a/lily/include/music-output-def.hh +++ b/lily/include/music-output-def.hh @@ -32,7 +32,7 @@ public: SCM scaled_fonts_; SCM style_sheet_; - VIRTUAL_COPY_CONS(Music_output_def); + VIRTUAL_COPY_CONS (Music_output_def); Music_output_def (Music_output_def const&); Music_output_def (); virtual int get_next_score_count () const; @@ -43,7 +43,7 @@ public: SCM find_translator_l (SCM name) const; String outname_str () ; - DECLARE_SMOBS(Music_output_def,); + DECLARE_SMOBS (Music_output_def,); }; Music_output_def* unsmob_music_output_def (SCM); diff --git a/lily/include/music-output.hh b/lily/include/music-output.hh index f52c82dc6f..604ff11ce7 100644 --- a/lily/include/music-output.hh +++ b/lily/include/music-output.hh @@ -24,9 +24,9 @@ public: String origin_str_; int errorlevel_i_; - virtual void process() {} + virtual void process () {} virtual ~Music_output (){} - Music_output() + Music_output () { errorlevel_i_ = 0; } diff --git a/lily/include/music-sequence.hh b/lily/include/music-sequence.hh index f3d6ed9e9b..797563830d 100644 --- a/lily/include/music-sequence.hh +++ b/lily/include/music-sequence.hh @@ -19,11 +19,11 @@ class Music_sequence : public Music { public: Music_sequence (SCM h); - + Music_sequence (); SCM music_list () const; void append_music (Music *); - VIRTUAL_COPY_CONS(Music); - + VIRTUAL_COPY_CONS (Music); + Pitch do_relative_octave (Pitch p, bool b); virtual void transpose (Pitch ); void truncate (int k); diff --git a/lily/include/music-wrapper-iterator.hh b/lily/include/music-wrapper-iterator.hh index a488b8e2f7..2f401705ef 100644 --- a/lily/include/music-wrapper-iterator.hh +++ b/lily/include/music-wrapper-iterator.hh @@ -27,7 +27,7 @@ public: Music_wrapper_iterator (Music_wrapper_iterator const&); ~Music_wrapper_iterator (); - virtual void construct_children () ; + virtual void construct_children () ; virtual Moment pending_moment () const; virtual bool ok () const; virtual SCM get_music (Moment)const; diff --git a/lily/include/music-wrapper.hh b/lily/include/music-wrapper.hh index 8713d912da..ec95046649 100644 --- a/lily/include/music-wrapper.hh +++ b/lily/include/music-wrapper.hh @@ -23,11 +23,12 @@ class Music_wrapper : public Music { public: Music_wrapper (SCM); + Music_wrapper (); Music * element () const; virtual void transpose (Pitch); - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); virtual Moment length_mom () const; virtual Pitch to_relative_octave (Pitch); virtual void compress (Moment); diff --git a/lily/include/music.hh b/lily/include/music.hh index 5ad9151ee0..2b11f459c1 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -16,12 +16,14 @@ #include "lily-proto.hh" #include "string.hh" #include "smobs.hh" +#include "music-constructor.hh" + /** Music is anything that has duration and supports both time compression and transposition. In Lily, everything that can be thought to have a length and a pitch - (which has a duration which can be transposed) is considered "music", + (which has a duration which can be transposed) is considered "music", Music is hierarchical: @@ -49,17 +51,17 @@ public: /// The duration of this piece of music virtual Moment length_mom () const; - void print() const; + void print () const; /// Transpose, with the interval central C to #p# virtual void transpose (Pitch p); /// Scale the music in time by #factor#. virtual void compress (Moment factor); - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); Music (Music const &m); Music (SCM); protected: - DECLARE_SMOBS(Music,); + DECLARE_SMOBS (Music,); SCM immutable_property_alist_; SCM mutable_property_alist_; }; diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 04f7c0c3aa..cd3e27b315 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -25,12 +25,12 @@ public: void compress (Moment); virtual Moment length_mom () const; static int compare (Rhythmic_req const&,Rhythmic_req const&); - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; class Skip_req : public Rhythmic_req { public: - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; @@ -56,11 +56,11 @@ protected: class Articulation_req : public Script_req { public: - String get_articulation_str(); + String get_articulation_str (); protected: virtual bool do_equal_b (Request const*) const; - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; class Text_script_req : public Script_req @@ -81,7 +81,7 @@ protected: virtual void transpose (Pitch delta); virtual bool do_equal_b (Request const*) const; - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; /* @@ -95,11 +95,11 @@ protected: class Note_req : public Rhythmic_req, virtual public Melodic_req { public: - Note_req(); + Note_req (); protected: bool do_equal_b (Request const*) const; - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; /** @@ -107,20 +107,20 @@ Put a rest on the staff. Why a request? It might be a good idea to not typeset t */ class Rest_req : public Rhythmic_req { public: - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; /// an extender line class Extender_req : public Request { public: - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; /// a centred hyphen class Hyphen_req : public Request { public: - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; /** is anyone playing a note? @@ -139,7 +139,7 @@ public: class Melisma_req : public Span_req { public: - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; diff --git a/lily/include/my-lily-lexer.hh b/lily/include/my-lily-lexer.hh index 11ad0adbe0..a0f6901b1b 100644 --- a/lily/include/my-lily-lexer.hh +++ b/lily/include/my-lily-lexer.hh @@ -21,9 +21,9 @@ #include "pitch.hh" #include "protected-scm.hh" -bool busy_parsing(); -void kill_lexer(); -void set_lexer(); +bool busy_parsing (); +void kill_lexer (); +void set_lexer (); /// lexer for Lilypond class My_lily_lexer : public Includable_lexer @@ -55,22 +55,22 @@ public: void start_main_input (); SCM lookup_identifier (String s); - void push_note_state(); - void push_chord_state(); - void push_lyric_state(); - void pop_state(); + void push_note_state (); + void push_chord_state (); + void push_lyric_state (); + void pop_state (); void LexerError (char const *); void set_identifier (String str, SCM); - bool note_state_b() const; - bool chord_state_b() const; - bool lyric_state_b() const; + bool note_state_b () const; + bool chord_state_b () const; + bool lyric_state_b () const; private: int lookup_keyword (String); int scan_bare_word (String); int scan_escaped_word (String); - char escaped_char(char) const; + char escaped_char (char) const; }; #endif diff --git a/lily/include/my-lily-parser.hh b/lily/include/my-lily-parser.hh index 83463056cf..0e8b8f2b86 100644 --- a/lily/include/my-lily-parser.hh +++ b/lily/include/my-lily-parser.hh @@ -31,9 +31,9 @@ class My_lily_parser { public: My_lily_parser (Sources * sources_l); - ~My_lily_parser(); + ~My_lily_parser (); - void do_init_file(); + void do_init_file (); void parse_file ( String init_str, String file_str); void set_version_check (bool ignore); @@ -49,22 +49,22 @@ public: My_lily_lexer * lexer_p_; bool ignore_version_b_; - Input here_input() const; - void remember_spot(); - Input pop_spot(); + Input here_input () const; + void remember_spot (); + Input pop_spot (); - void do_yyparse(); + void do_yyparse (); void parser_error (String); void set_yydebug (bool); - DECLARE_SCHEME_CALLBACK(paper_description, ()); + DECLARE_SCHEME_CALLBACK (paper_description, ()); private: Array define_spot_array_; - char const* here_ch_C() const; + char const* here_ch_C () const; Simultaneous_music * get_chord (Pitch tonic, Array* add_arr_p, Array* sub_arr_p, Pitch* inversion_p, diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index bb10e2696a..5f24f7284e 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -13,7 +13,7 @@ #include "item.hh" /** a struct for treating a group of noteheads (noteheads, stem - (chord) and scripts) as a single entity. + (chord) and scripts) as a single entity. UGR. Junkme. refpoint should be the notehead, dir should come from stem. @@ -30,9 +30,9 @@ public: */ static Direction dir (Grob*me); - static Slice head_positions_interval(Grob* me); + static Slice head_positions_interval (Grob* me); static Direction static_dir (Grob*); - static void translate_rests(Grob*me,int dy); + static void translate_rests (Grob*me,int dy); static Grob * first_head (Grob*me); static void set_stem (Grob*me,Grob*); static void set_dotcol (Grob*me,Grob*); @@ -40,7 +40,7 @@ public: static bool rest_b (Grob*me); static bool has_interface (Grob*); static void set_interface (Grob*); - static Item *stem_l(Grob*); + static Item *stem_l (Grob*); }; #endif // NOTE_COLUMN_HH diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index 04283267e7..99404f4d8e 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -20,9 +20,9 @@ class Note_head { public: - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); static Molecule ledger_line (Interval, Grob*) ; - DECLARE_SCHEME_CALLBACK(brew_ez_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_ez_molecule, (SCM )); static bool has_interface (Grob*); }; diff --git a/lily/include/paper-column.hh b/lily/include/paper-column.hh index 00d7e48864..6660379575 100644 --- a/lily/include/paper-column.hh +++ b/lily/include/paper-column.hh @@ -17,7 +17,7 @@ class Paper_column : public Item { public: - VIRTUAL_COPY_CONS(Grob); + VIRTUAL_COPY_CONS (Grob); /* Not (yet) in scm, because of messy effects when a column commits suicide. @@ -31,7 +31,7 @@ public: Line_of_score *line_l_; /// which one (left =0) - static int rank_i(Grob*); + static int rank_i (Grob*); Paper_column (SCM); bool musical_b () const; diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index 29d0abacc5..e30aa30e82 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -48,7 +48,7 @@ class Paper_def : public Music_output_def { protected: - VIRTUAL_COPY_CONS(Music_output_def); + VIRTUAL_COPY_CONS (Music_output_def); public: diff --git a/lily/include/paper-outputter.hh b/lily/include/paper-outputter.hh index 9d76b67f73..48d78a529a 100644 --- a/lily/include/paper-outputter.hh +++ b/lily/include/paper-outputter.hh @@ -22,7 +22,7 @@ itself. The Paper_outputter contains a reference to an output stream - (Paper_stream). */ + (Paper_stream). */ class Paper_outputter { diff --git a/lily/include/paper-score.hh b/lily/include/paper-score.hh index 9429aaf5e8..114754a37b 100644 --- a/lily/include/paper-score.hh +++ b/lily/include/paper-score.hh @@ -42,17 +42,17 @@ public: protected: /* MAIN ROUTINES */ - virtual void process(); + virtual void process (); private: /// before calc_breaking - void preprocess(); - void calc_idealspacing(); + void preprocess (); + void calc_idealspacing (); /// calculate where the lines are to be broken, and use results - Array calc_breaking(); + Array calc_breaking (); /// after calc_breaking - void postprocess(); + void postprocess (); Paper_score (Paper_score const &); }; diff --git a/lily/include/paper-stream.hh b/lily/include/paper-stream.hh index 86c0a22b61..939f6522a5 100644 --- a/lily/include/paper-stream.hh +++ b/lily/include/paper-stream.hh @@ -23,14 +23,14 @@ public: Paper_stream (String filename); /// delegate conversion to scalar class - Paper_stream &operator <<(String); + Paper_stream &operator << (String); /// close the file - ~Paper_stream(); + ~Paper_stream (); private: Paper_stream (Paper_stream const&); - void break_line(); + void break_line (); }; class ostream; diff --git a/lily/include/part-combine-music.hh b/lily/include/part-combine-music.hh index 95062639a5..ef18fb2b78 100644 --- a/lily/include/part-combine-music.hh +++ b/lily/include/part-combine-music.hh @@ -27,6 +27,8 @@ public: virtual Moment length_mom () const; virtual Pitch to_relative_octave (Pitch); virtual void compress (Moment); + + Part_combine_music (); }; #endif /* PART_COMBINE_MUSIC_HH */ diff --git a/lily/include/percent-repeat-iterator.hh b/lily/include/percent-repeat-iterator.hh new file mode 100644 index 0000000000..71d220224d --- /dev/null +++ b/lily/include/percent-repeat-iterator.hh @@ -0,0 +1,36 @@ +/* + percent-repeat-iterator.hh -- declare Percent_repeat_iterator + + source file of the GNU LilyPond music typesetter + + (c) 2001 Han-Wen Nienhuys + + */ + +#ifndef PERCENT_REPEAT_ITERATOR_HH +#define PERCENT_REPEAT_ITERATOR_HH + +#include "music-iterator.hh" + +class Percent_repeat_iterator : public Music_iterator +{ +public: + VIRTUAL_COPY_CONS (Music_iterator); + static SCM constructor_cxx_function; + Percent_repeat_iterator (); + Percent_repeat_iterator (Percent_repeat_iterator const & ); +protected: + virtual ~Percent_repeat_iterator (); + virtual Moment pending_moment () const; + virtual void construct_children () ; + virtual bool ok () const; + virtual void process (Moment) ; + virtual Music_iterator *try_music_in_children (Music *) const; + +private: + Music_iterator * child_iter_p_; + Moment finish_mom_; +}; + + +#endif /* PERCENT_REPEAT_ITERATOR_HH */ diff --git a/lily/include/performance.hh b/lily/include/performance.hh index 1120ac5c89..af26a91ede 100644 --- a/lily/include/performance.hh +++ b/lily/include/performance.hh @@ -26,8 +26,8 @@ public: void output (Midi_stream& midi_stream_r); void output_header_track (Midi_stream& midi_stream_r); - void print() const; - void process(); + void print () const; + void process (); Link_array audio_staff_l_arr_; diff --git a/lily/include/performer-group-performer.hh b/lily/include/performer-group-performer.hh index a516331ec7..2f05ae6604 100644 --- a/lily/include/performer-group-performer.hh +++ b/lily/include/performer-group-performer.hh @@ -19,9 +19,9 @@ class Performer_group_performer : public Performer, public virtual Translator_group { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); - virtual void do_announces(); + virtual void do_announces (); virtual void announce_element (Audio_element_info); protected: Array announce_info_arr_; diff --git a/lily/include/performer.hh b/lily/include/performer.hh index 1e639af771..c8b0de3e37 100644 --- a/lily/include/performer.hh +++ b/lily/include/performer.hh @@ -21,15 +21,15 @@ class Performer : public virtual Translator { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); friend class Performer_group_performer; - Performer_group_performer* daddy_perf_l() const; + Performer_group_performer* daddy_perf_l () const; protected: virtual void announce_element (Audio_element_info); virtual void acknowledge_audio_element (Audio_element_info); virtual void create_audio_elements (); - virtual int get_tempo_i() const; + virtual int get_tempo_i () const; virtual void play_element (Audio_element * elem_p ); }; diff --git a/lily/include/pitch.hh b/lily/include/pitch.hh index 25b576f4c0..c88ed87ff0 100644 --- a/lily/include/pitch.hh +++ b/lily/include/pitch.hh @@ -58,16 +58,16 @@ public: static int compare (Pitch const&,Pitch const&); /// return large part of interval from central c - int steps() const; + int steps () const; /// return pitch from central c (in halfnotes) - int semitone_pitch() const; + int semitone_pitch () const; String str () const; static SCM transpose (SCM p, SCM delta); SCM smobbed_copy () const; - DECLARE_SCHEME_CALLBACK(less_p, (SCM a, SCM b)); - DECLARE_SIMPLE_SMOBS(Pitch,); + DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b)); + DECLARE_SIMPLE_SMOBS (Pitch,); }; @@ -75,7 +75,7 @@ public: Pitch* unsmob_pitch (SCM); #include "compare.hh" -INSTANTIATE_COMPARE(Pitch, Pitch::compare); +INSTANTIATE_COMPARE (Pitch, Pitch::compare); int compare (Array*, Array*); diff --git a/lily/include/protected-scm.hh b/lily/include/protected-scm.hh index 7b96c6e7d6..bfe3cafcdc 100644 --- a/lily/include/protected-scm.hh +++ b/lily/include/protected-scm.hh @@ -24,7 +24,7 @@ public: Protected_scm (Protected_scm const &); ~Protected_scm (); Protected_scm &operator = (SCM); - Protected_scm &operator =( Protected_scm const&); + Protected_scm &operator = ( Protected_scm const&); operator SCM () const; SCM to_SCM () const; }; diff --git a/lily/include/relative-music.hh b/lily/include/relative-music.hh index fac082d913..eb782fa9fe 100644 --- a/lily/include/relative-music.hh +++ b/lily/include/relative-music.hh @@ -16,8 +16,9 @@ class Relative_octave_music : public Music_wrapper { public: Relative_octave_music (SCM l); + Relative_octave_music (); - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); virtual Pitch to_relative_octave (Pitch); }; diff --git a/lily/include/repeated-music.hh b/lily/include/repeated-music.hh index 222a4abcc9..61c9661823 100644 --- a/lily/include/repeated-music.hh +++ b/lily/include/repeated-music.hh @@ -53,24 +53,24 @@ public: Music_sequence * alternatives () const; /// how often do we repeat? - int repeat_count( ) const; + int repeat_count ( ) const; virtual Pitch to_relative_octave (Pitch); Moment body_length_mom () const; Moment alternatives_length_mom (bool fold) const; Moment alternatives_volta_length_mom () const; - DECLARE_SCHEME_CALLBACK(unfolded_music_length, (SCM)); - DECLARE_SCHEME_CALLBACK(volta_music_length, (SCM)); - DECLARE_SCHEME_CALLBACK(folded_music_length, (SCM)); + DECLARE_SCHEME_CALLBACK (unfolded_music_length, (SCM)); + DECLARE_SCHEME_CALLBACK (volta_music_length, (SCM)); + DECLARE_SCHEME_CALLBACK (folded_music_length, (SCM)); /// Transpose, with the interval central C to #p# virtual void transpose (Pitch p); /// Scale the music in time by #factor#. virtual void compress (Moment factor); - VIRTUAL_COPY_CONS(Music); - + VIRTUAL_COPY_CONS (Music); + Repeated_music (); Repeated_music (SCM); }; diff --git a/lily/include/request-chord-iterator.hh b/lily/include/request-chord-iterator.hh index d54cfe9d8e..664aecadfd 100644 --- a/lily/include/request-chord-iterator.hh +++ b/lily/include/request-chord-iterator.hh @@ -38,7 +38,7 @@ public: virtual SCM get_music (Moment) const; protected: virtual void process (Moment); - virtual void construct_children(); + virtual void construct_children (); }; diff --git a/lily/include/request.hh b/lily/include/request.hh index 0f693ce13d..c0090667d6 100644 --- a/lily/include/request.hh +++ b/lily/include/request.hh @@ -27,7 +27,7 @@ class Request : public Music { public: Request (); - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); bool equal_b (Request const*) const; protected: virtual bool do_equal_b (Request const*) const; @@ -42,7 +42,7 @@ public: void set_direction (Direction d); Direction get_direction () const; - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); Script_req (); }; @@ -58,12 +58,12 @@ public: void set_span_dir (Direction d); Direction get_span_dir () const; - Span_req(); + Span_req (); protected: virtual bool do_equal_b (Request const*) const; - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; /** @@ -71,7 +71,7 @@ protected: */ class Tie_req : public Request { public: - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; #endif diff --git a/lily/include/rest-collision.hh b/lily/include/rest-collision.hh index 578b1151dd..e2a20d1050 100644 --- a/lily/include/rest-collision.hh +++ b/lily/include/rest-collision.hh @@ -22,7 +22,7 @@ public: static void add_column (Grob*me,Grob*); static void set_interface (Grob*me); static bool has_interface (Grob*); - DECLARE_SCHEME_CALLBACK(force_shift_callback, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis)); static SCM do_shift (Grob*,SCM); }; #endif // REST_COLLISION_HH diff --git a/lily/include/rest.hh b/lily/include/rest.hh index b462bca6fc..fdd41ce7e7 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -15,10 +15,10 @@ class Rest { public: - DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); static bool has_interface (Grob*); static SCM brew_internal_molecule (SCM); - DECLARE_SCHEME_CALLBACK(extent_callback, (SCM,SCM)); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (extent_callback, (SCM,SCM)); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); }; #endif // REST_HH diff --git a/lily/include/rhythmic-head.hh b/lily/include/rhythmic-head.hh index 7b4e7c2302..73b7890249 100644 --- a/lily/include/rhythmic-head.hh +++ b/lily/include/rhythmic-head.hh @@ -21,7 +21,7 @@ public: static Item * stem_l (Grob*) ; static Item * dots_l (Grob*) ; static int dot_count (Grob*) ; - DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); static bool has_interface (Grob*); static void set_interface (Grob*); }; diff --git a/lily/include/scm-hash.hh b/lily/include/scm-hash.hh index c36a368e3e..22c630f9cf 100644 --- a/lily/include/scm-hash.hh +++ b/lily/include/scm-hash.hh @@ -19,9 +19,9 @@ struct SCM_less { - bool operator () (SCM s1, SCM s2) const + bool operator () (SCM s1, SCM s2) const { - return long(s1) < long (s2); + return long (s1) < long (s2); } }; @@ -75,7 +75,7 @@ public: Scheme_hash_table (Scheme_hash_table const &); SCM to_alist () const; - DECLARE_SMOBS(Scheme_hash_table,foo); + DECLARE_SMOBS (Scheme_hash_table,foo); }; #endif /* SCM_HASH_HH */ diff --git a/lily/include/score-engraver.hh b/lily/include/score-engraver.hh index cdabb2eb13..bbb53792b6 100644 --- a/lily/include/score-engraver.hh +++ b/lily/include/score-engraver.hh @@ -28,32 +28,32 @@ class Score_engraver : Paper_column* musical_column_l_; void make_columns (Moment); void set_columns (Paper_column*,Paper_column*); - void typeset_all(); + void typeset_all (); public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Paper_score * pscore_p_; void forbid_breaks (); - Score_engraver(); + Score_engraver (); virtual Music_output *get_output_p (); protected: virtual void prepare (Moment); - virtual void finish(); - virtual void one_time_step(); - virtual int depth_i() const { return Global_translator::depth_i ();} + virtual void finish (); + virtual void one_time_step (); + virtual int depth_i () const { return Global_translator::depth_i ();} protected: /* Engraver_group_engraver interface */ virtual bool try_music (Music*); - virtual void initialize(); - virtual void finalize(); + virtual void initialize (); + virtual void finalize (); virtual void announce_grob (Grob_info); - virtual void do_announces(); + virtual void do_announces (); virtual void typeset_grob (Grob*elem_p); - virtual void stop_translation_timestep(); + virtual void stop_translation_timestep (); }; diff --git a/lily/include/score-performer.hh b/lily/include/score-performer.hh index 41f00e2ed3..09097470a6 100644 --- a/lily/include/score-performer.hh +++ b/lily/include/score-performer.hh @@ -18,20 +18,20 @@ class Score_performer: public Performer_group_performer, public Global_translator { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); - Score_performer(); - ~Score_performer(); + Score_performer (); + ~Score_performer (); Performance *performance_p_; protected: - virtual void finish(); + virtual void finish (); virtual void prepare (Moment mom); - virtual void one_time_step(); - virtual void start(); + virtual void one_time_step (); + virtual void start (); virtual void initialize (); virtual void announce_element (Audio_element_info); - virtual int get_tempo_i() const; + virtual int get_tempo_i () const; virtual void play_element (Audio_element* p); virtual Music_output *get_output_p (); diff --git a/lily/include/score.hh b/lily/include/score.hh index 26fe6fb57f..7c25235490 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -27,13 +27,13 @@ public: int errorlevel_i_; /// construction - Score(); + Score (); Score (Score const&); - void process(); + void process (); void add_output (Music_output_def *def_p); - DECLARE_SMOBS(Score,foo); + DECLARE_SMOBS (Score,foo); private: void run_translator (Music_output_def*); }; diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh index c5b0bd43ea..934c04480d 100644 --- a/lily/include/script-column.hh +++ b/lily/include/script-column.hh @@ -17,7 +17,7 @@ class Script_column { public: static void add_staff_sided (Grob*, Item*); - DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); }; diff --git a/lily/include/script.hh b/lily/include/script.hh index 8ab6db25dd..e1e46d5c21 100644 --- a/lily/include/script.hh +++ b/lily/include/script.hh @@ -24,8 +24,8 @@ public: static Molecule get_molecule (Grob*,Direction d); static void set_interface (Grob*); static bool has_interface (Grob*); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); - DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); }; #endif /* Stem_SCRIPT_HH */ diff --git a/lily/include/separating-group-spanner.hh b/lily/include/separating-group-spanner.hh index 4bff88adc4..aacce5f998 100644 --- a/lily/include/separating-group-spanner.hh +++ b/lily/include/separating-group-spanner.hh @@ -17,7 +17,7 @@ class Separating_group_spanner public: static void add_spacing_unit (Grob*me, Item*); static void set_interface (Grob*); - DECLARE_SCHEME_CALLBACK(set_spacing_rods, (SCM )); + DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM )); }; #endif /* SEPARATING_GROUP_SPANNER_HH */ diff --git a/lily/include/side-position-interface.hh b/lily/include/side-position-interface.hh index 9ce408a662..05973ff1e4 100644 --- a/lily/include/side-position-interface.hh +++ b/lily/include/side-position-interface.hh @@ -21,12 +21,12 @@ struct Side_position_interface { public: - DECLARE_SCHEME_CALLBACK(aligned_on_support_extents, (SCM element, SCM axis)); - DECLARE_SCHEME_CALLBACK(aligned_on_support_refpoints, (SCM element, SCM axis)); - DECLARE_SCHEME_CALLBACK(aligned_on_self, (SCM element, SCM axis)); - DECLARE_SCHEME_CALLBACK(aligned_side, (SCM element, SCM axis)); - DECLARE_SCHEME_CALLBACK(quantised_position, (SCM element, SCM axis)); - DECLARE_SCHEME_CALLBACK(centered_on_parent, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (aligned_on_support_extents, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (aligned_on_support_refpoints, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (aligned_on_self, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (aligned_side, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (quantised_position, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (centered_on_parent, (SCM element, SCM axis)); static SCM general_side_position (Grob*, Axis, bool); static void set_axis (Grob*,Axis); diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index 2a519c4326..45be2c08ae 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -42,7 +42,7 @@ DECLARE_SIMPLE_SMOBS; static SCM make_scm (void initdata) { Ssmob * sp = new Ssmob (initdata); - return sp->smobbed_self(); + return sp->smobbed_self (); } private: Ssmob (initdata); @@ -59,7 +59,7 @@ class Csmob { DECLARE_SMOBS; - Csmob () { smobify_self(); } + Csmob () { smobify_self (); } Csmob (Csmob const & s) { // don't copy self_scm_ smobify_self (); @@ -95,8 +95,8 @@ WARNING: - smobify_self() might trigger a GC, so make sure that objects are - sane when you do smobify_self(). + smobify_self () might trigger a GC, so make sure that objects are + sane when you do smobify_self (). */ #define DECLARE_SIMPLE_SMOBS(CL,dummy) \ @@ -112,14 +112,14 @@ public: \ static SCM equal_p (SCM a, SCM b);\ static CL * unsmob (SCM);\ static SCM smob_p (SCM);\ - static void init_smobs(); \ + static void init_smobs (); \ private: #define DECLARE_SMOBS(CL,dummy) \ - DECLARE_SIMPLE_SMOBS(CL,dammy) \ + DECLARE_SIMPLE_SMOBS (CL,dammy) \ protected:\ - virtual ~CL();\ + virtual ~CL ();\ SCM unprotected_smobify_self ();\ private: \ SCM smobify_self (); \ diff --git a/lily/include/spacing-spanner.hh b/lily/include/spacing-spanner.hh index 73d8da023d..019765c883 100644 --- a/lily/include/spacing-spanner.hh +++ b/lily/include/spacing-spanner.hh @@ -18,7 +18,7 @@ public: static void set_interface (Grob*); static void do_measure (Grob*,Link_array) ; - DECLARE_SCHEME_CALLBACK(set_springs, (SCM )); + DECLARE_SCHEME_CALLBACK (set_springs, (SCM )); static Real stem_dir_correction (Grob*,Grob*,Grob*) ; static Real default_bar_spacing (Grob*,Grob*,Grob*,Moment) ; static Real note_spacing (Grob*,Grob*,Grob*,Moment) ; diff --git a/lily/include/span-bar.hh b/lily/include/span-bar.hh index 370c3626f4..1e7ea7eadd 100644 --- a/lily/include/span-bar.hh +++ b/lily/include/span-bar.hh @@ -27,10 +27,10 @@ public: static void add_bar (Grob*,Grob*); static void evaluate_glyph (Grob*); static void evaluate_empty (Grob*); - DECLARE_SCHEME_CALLBACK(width_callback, (SCM smob, SCM axis)); - DECLARE_SCHEME_CALLBACK(get_bar_size, (SCM )); - DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM )); - DECLARE_SCHEME_CALLBACK(center_on_spanned_callback, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (width_callback, (SCM smob, SCM axis)); + DECLARE_SCHEME_CALLBACK (get_bar_size, (SCM )); + DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (center_on_spanned_callback, (SCM element, SCM axis)); }; #endif // SPAN_BAR_HH diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index 3429e22b0d..03cb986634 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -54,7 +54,7 @@ public: virtual SCM do_derived_mark (); protected: void set_my_columns (); - VIRTUAL_COPY_CONS(Grob); + VIRTUAL_COPY_CONS (Grob); virtual void do_break_processing (); virtual Line_of_score*line_l () const; }; diff --git a/lily/include/staff-symbol-referencer.hh b/lily/include/staff-symbol-referencer.hh index 8e60ae6591..9abe4f9d51 100644 --- a/lily/include/staff-symbol-referencer.hh +++ b/lily/include/staff-symbol-referencer.hh @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1999--2001 Han-Wen Nienhuys + (c) 1999--2001 Han-Wen Nienhuys */ @@ -24,7 +24,7 @@ public: static void set_interface (Grob*); static bool has_interface (Grob*); static void set_position (Grob*,Real); - DECLARE_SCHEME_CALLBACK(callback, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (callback, (SCM element, SCM axis)); /** Leading are the lead strips between the sticks (lines) of diff --git a/lily/include/staff-symbol.hh b/lily/include/staff-symbol.hh index dde710433a..d8bb51dc71 100644 --- a/lily/include/staff-symbol.hh +++ b/lily/include/staff-symbol.hh @@ -19,9 +19,9 @@ class Staff_symbol { public: static Real staff_space (Grob*) ; - static int steps_i(Grob*) ; + static int steps_i (Grob*) ; static int line_count (Grob*); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); static bool has_interface (Grob*); static void set_interface (Grob*); }; diff --git a/lily/include/stem.hh b/lily/include/stem.hh index 8d9c533763..40d26e6c13 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -15,7 +15,7 @@ class Stem { public: - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); static int flag_i (Grob*) ; static int beam_count (Grob*,Direction) ; @@ -30,18 +30,18 @@ public: static Direction get_direction (Grob*) ; static int type_i (Grob *) ; static void set_stemend (Grob *,Real); - static Direction get_default_dir(Grob *) ; - static int get_center_distance(Grob *,Direction) ; + static Direction get_default_dir (Grob *) ; + static int get_center_distance (Grob *,Direction) ; static int heads_i (Grob *) ; - static bool invisible_b(Grob *) ; - static Interval head_positions(Grob *) ; + static bool invisible_b (Grob *) ; + static Interval head_positions (Grob *) ; static Real get_default_stem_end_position (Grob*me) ; - static void position_noteheads(Grob*); + static void position_noteheads (Grob*); static Real stem_end_position (Grob*) ; - DECLARE_SCHEME_CALLBACK(off_callback, (SCM element, SCM axis)); + DECLARE_SCHEME_CALLBACK (off_callback, (SCM element, SCM axis)); static Molecule flag (Grob*); - DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM )); - DECLARE_SCHEME_CALLBACK(dim_callback, (SCM smob, SCM axis)); + DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (dim_callback, (SCM smob, SCM axis)); DECLARE_SCHEME_CALLBACK (height, (SCM,SCM)); static bool has_interface (Grob*); static void set_interface (Grob*); diff --git a/lily/include/swallow-perf.hh b/lily/include/swallow-perf.hh index b297371896..3b40a7dfe0 100644 --- a/lily/include/swallow-perf.hh +++ b/lily/include/swallow-perf.hh @@ -15,7 +15,7 @@ class Swallow_performer : public Performer { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); protected: virtual bool try_music (Music*) { return true; } diff --git a/lily/include/symbol-cache.hh b/lily/include/symbol-cache.hh index 5471f09264..82023eeec4 100644 --- a/lily/include/symbol-cache.hh +++ b/lily/include/symbol-cache.hh @@ -68,7 +68,7 @@ symbol (const char *ch) private_symbol_cache_end = private_symbol_cache + sz; for (p = private_symbol_cache_end -1; p != private_symbol_cache + idx; p --) - *p = *(p - 1); + *p = * (p - 1); p->key = ch; p->val = sym; diff --git a/lily/include/system-start-delimiter.hh b/lily/include/system-start-delimiter.hh index 5b15f9b264..1b05be028d 100644 --- a/lily/include/system-start-delimiter.hh +++ b/lily/include/system-start-delimiter.hh @@ -19,11 +19,11 @@ class System_start_delimiter { public: - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); static void set_interface (Grob*me); static bool has_interface (Grob*); - DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); static void try_collapse (Grob*); static Molecule staff_bracket (Grob*,Real) ; static Molecule staff_brace (Grob*,Real) ; diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh index 650096c140..a579a48794 100644 --- a/lily/include/text-item.hh +++ b/lily/include/text-item.hh @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1998--2001 Han-Wen Nienhuys + (c) 1998--2001 Han-Wen Nienhuys Jan Nieuwenhuizen */ diff --git a/lily/include/tie-column.hh b/lily/include/tie-column.hh index 36072dd03c..059d60ac5b 100644 --- a/lily/include/tie-column.hh +++ b/lily/include/tie-column.hh @@ -20,7 +20,7 @@ public: static void set_interface (Grob*me); static bool has_interface (Grob*); static void add_tie (Grob*me,Grob*); - DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); static void set_directions (Grob*me); }; diff --git a/lily/include/tie.hh b/lily/include/tie.hh index 97499d8a11..2c4f3a52a4 100644 --- a/lily/include/tie.hh +++ b/lily/include/tie.hh @@ -22,10 +22,10 @@ public: static bool has_interface (Grob*); static Grob * head (Grob*,Direction) ; static Real position_f (Grob*) ; - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); - static Direction get_default_dir(Grob*) ; + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); + static Direction get_default_dir (Grob*) ; static SCM get_control_points (SCM); - DECLARE_SCHEME_CALLBACK(set_spacing_rods, (SCM )); + DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM )); }; #endif // TIE_HH diff --git a/lily/include/time-scaled-music.hh b/lily/include/time-scaled-music.hh index 2ede5ffa6a..5cdf43bbab 100644 --- a/lily/include/time-scaled-music.hh +++ b/lily/include/time-scaled-music.hh @@ -18,8 +18,9 @@ class Time_scaled_music : public Music_wrapper { public: Time_scaled_music (SCM); + Time_scaled_music (); - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; #endif /* Time_scaled_music_HH */ diff --git a/lily/include/time-signature.hh b/lily/include/time-signature.hh index 686c9b132b..f402a67a17 100644 --- a/lily/include/time-signature.hh +++ b/lily/include/time-signature.hh @@ -21,7 +21,7 @@ struct Time_signature { static Molecule special_time_signature (Grob*,String,int,int) ; static Molecule time_signature (Grob*,int, int); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); }; #endif // METER_HH diff --git a/lily/include/timing-translator.hh b/lily/include/timing-translator.hh index 85f2c4ba58..1fcc8a86a3 100644 --- a/lily/include/timing-translator.hh +++ b/lily/include/timing-translator.hh @@ -20,7 +20,7 @@ class Timing_translator : public virtual Translator SCM last_time_sig_; public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Timing_translator (); Music *check_; diff --git a/lily/include/translation-property.hh b/lily/include/translation-property.hh index 3750e927e4..a3d8151974 100644 --- a/lily/include/translation-property.hh +++ b/lily/include/translation-property.hh @@ -25,7 +25,7 @@ class Translation_property : public Music { public: Translation_property (); - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; /** @@ -41,7 +41,7 @@ public: class Push_translation_property : public Music { public: - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; /** @@ -54,7 +54,7 @@ public: class Pop_translation_property : public Music { public: - VIRTUAL_COPY_CONS(Music); + VIRTUAL_COPY_CONS (Music); }; diff --git a/lily/include/translator-def.hh b/lily/include/translator-def.hh index dbaea4d43d..d9c6d9643e 100644 --- a/lily/include/translator-def.hh +++ b/lily/include/translator-def.hh @@ -56,7 +56,7 @@ public: void apply_property_operations (Translator_group*); private: - DECLARE_SMOBS(Translator_def,foo); + DECLARE_SMOBS (Translator_def,foo); Translator_def (); Translator_def (Translator_def const&); diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index 52d7995aea..3f444e468b 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -18,7 +18,7 @@ #include "smobs.hh" // egcs -typedef void (Translator::*Method_pointer)(void); +typedef void (Translator::*Method_pointer) (void); class Scheme_hash_table; @@ -45,17 +45,17 @@ public: String id_str_; - VIRTUAL_COPY_CONS(Translator); - Translator_group(Translator_group const &); - Translator_group(); + VIRTUAL_COPY_CONS (Translator); + Translator_group (Translator_group const &); + Translator_group (); void add_group_translator (Translator *trans_p); /// Score_register = 0, Staff_registers = 1, etc) Translator_group* ancestor_l (int l=1); - int depth_i() const; + int depth_i () const; bool is_bottom_translator_b () const; - bool removable_b() const; + bool removable_b () const; void terminate_translator (Translator*r_l); Translator *remove_translator_p (Translator*trans_l); void check_removal (); @@ -64,17 +64,17 @@ public: Translator_group *find_create_translator_l (String n, String id); Link_array path_to_acceptable_translator (String alias, Music_output_def*) const; - Translator_group*get_default_interpreter(); + Translator_group*get_default_interpreter (); public: bool try_music_on_nongroup_children (Music *m); virtual void do_announces (); virtual bool try_music (Music* req_l); - virtual void stop_translation_timestep(); - virtual void start_translation_timestep(); - virtual void initialize(); - virtual void finalize(); + virtual void stop_translation_timestep (); + virtual void start_translation_timestep (); + virtual void initialize (); + virtual void finalize (); virtual void each (Method_pointer); }; diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 58500438be..d0c14c1424 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -28,20 +28,20 @@ public: Music_output_def * output_def_l_; String type_str_; - virtual const char *name() const; + virtual const char *name () const; bool is_alias_b (String) const; - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Translator (Translator const &); Translator (); Translator_group * daddy_trans_l_ ; - void pre_move_processing(); - void announces(); - void post_move_processing(); - void removal_processing(); + void pre_move_processing (); + void announces (); + void post_move_processing (); + void removal_processing (); /** ask daddy for a feature */ @@ -60,7 +60,7 @@ public: SCM definition_; SCM properties_scm_; - DECLARE_SMOBS(Translator, dummy); + DECLARE_SMOBS (Translator, dummy); public: /** @@ -73,11 +73,11 @@ public: */ virtual bool try_music (Music *req_l); - virtual void stop_translation_timestep(); - virtual void start_translation_timestep(); + virtual void stop_translation_timestep (); + virtual void start_translation_timestep (); virtual void do_announces () ; - virtual void initialize() ; - virtual void finalize(); + virtual void initialize () ; + virtual void finalize (); }; @@ -90,7 +90,7 @@ static void _ ## T ## _adder () {\ t->type_str_ = classname (t);\ add_translator (t);\ }\ -ADD_GLOBAL_CTOR(_ ## T ## _adder); +ADD_GLOBAL_CTOR (_ ## T ## _adder); diff --git a/lily/include/transposed-music.hh b/lily/include/transposed-music.hh index 75de24ff09..e6aa328ad0 100644 --- a/lily/include/transposed-music.hh +++ b/lily/include/transposed-music.hh @@ -17,8 +17,10 @@ class Transposed_music : public Music_wrapper { public: Transposed_music (SCM); + Transposed_music (); - VIRTUAL_COPY_CONS(Music); + + VIRTUAL_COPY_CONS (Music); virtual Pitch to_relative_octave (Pitch); }; diff --git a/lily/include/tuplet-spanner.hh b/lily/include/tuplet-spanner.hh index cf1e2cedf0..ebafc2eb19 100644 --- a/lily/include/tuplet-spanner.hh +++ b/lily/include/tuplet-spanner.hh @@ -12,14 +12,14 @@ /* TODO: quantise, we don't want to collide with staff lines. - (or should we be above staff?) + (or should we be above staff?) todo: handle breaking elegantly. */ class Tuplet_bracket { public: - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); static void set_interface (Grob*); static bool has_interface (Grob*); @@ -29,7 +29,7 @@ public: static void calc_dy (Grob*,Real *) ; static void calc_position_and_height (Grob*,Real*,Real *dy); - DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM )); + DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); static Direction get_default_dir (Grob*); }; diff --git a/lily/include/type-swallow-translator.hh b/lily/include/type-swallow-translator.hh index 908e7b86d5..b352473e4e 100644 --- a/lily/include/type-swallow-translator.hh +++ b/lily/include/type-swallow-translator.hh @@ -13,7 +13,7 @@ #include "translator.hh" /** eat a certain type of request. - (Duh, it's good for your skin) + (Duh, it's good for your skin) */ class Type_swallow_translator : public virtual Translator { @@ -21,18 +21,18 @@ protected: String swallow_str_; bool try_music (Music*); public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); }; #define DECLARE_REQUEST_SWALLOWER(TYPE) \ struct TYPE ## _swallow_translator : public Type_swallow_translator {\ - TYPE ## _swallow_translator() { \ + TYPE ## _swallow_translator () { \ swallow_str_ = #TYPE;\ }\ \ - VIRTUAL_COPY_CONS(Translator);\ + VIRTUAL_COPY_CONS (Translator);\ };\ -ADD_THIS_TRANSLATOR(TYPE ## _swallow_translator);\ +ADD_THIS_TRANSLATOR (TYPE ## _swallow_translator);\ #endif // TYPESWALLOW_GRAV_HH diff --git a/lily/include/unfolded-repeat-iterator.hh b/lily/include/unfolded-repeat-iterator.hh index 272365ecd4..e69de29bb2 100644 --- a/lily/include/unfolded-repeat-iterator.hh +++ b/lily/include/unfolded-repeat-iterator.hh @@ -1,3 +0,0 @@ - -#error - diff --git a/lily/include/volta-spanner.hh b/lily/include/volta-spanner.hh index 32a39cd3fc..97f1e15035 100644 --- a/lily/include/volta-spanner.hh +++ b/lily/include/volta-spanner.hh @@ -18,7 +18,7 @@ class Volta_spanner public: static void set_interface (Grob*); static bool has_interface (Grob*); - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); static void add_column (Grob*, Grob*col); static void add_bar (Grob*me, Item*bar); }; diff --git a/lily/input-smob.cc b/lily/input-smob.cc index 4e6710cd69..5b6ad8b779 100644 --- a/lily/input-smob.cc +++ b/lily/input-smob.cc @@ -24,7 +24,7 @@ static int print_smob (SCM s, SCM port, scm_print_state *) { String str = "#location_str () + ">"; - scm_puts (str.ch_C(), port); + scm_puts (str.ch_C (), port); return 1; } @@ -42,7 +42,7 @@ ly_input_p (SCM x) } static -void start_input_smobs() +void start_input_smobs () { input_tag = scm_make_smob_type_mfpe ("input", 0, @@ -58,7 +58,7 @@ make_input (Input ip) Input * nip = new Input (ip); SCM z; - SCM_NEWCELL(z); + SCM_NEWCELL (z); SCM_SETCAR (z, (SCM)input_tag); SCM_SETCDR (z, (SCM)nip); // fixme: done_malloc @@ -70,14 +70,14 @@ unsmob_input (SCM s) { if (SCM_IMP (s)) return 0; - if ((long)SCM_CAR(s) == input_tag) // ugh. - return (Input*) SCM_CDR(s); + if ((long)SCM_CAR (s) == input_tag) // ugh. + return (Input*) SCM_CDR (s); else return 0; } -ADD_SCM_INIT_FUNC(input, start_input_smobs); +ADD_SCM_INIT_FUNC (input, start_input_smobs); Input dummy_input_global; diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index 9171bb6919..261cb2e054 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -23,14 +23,14 @@ class Instrument_name_engraver : public Engraver void create_text (SCM s); public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Instrument_name_engraver (); virtual void initialize (); virtual void acknowledge_grob (Grob_info); virtual void stop_translation_timestep (); }; -ADD_THIS_TRANSLATOR(Instrument_name_engraver); +ADD_THIS_TRANSLATOR (Instrument_name_engraver); Instrument_name_engraver::Instrument_name_engraver () { @@ -60,7 +60,7 @@ Instrument_name_engraver::stop_translation_timestep () void Instrument_name_engraver::create_text (SCM txt) { - if(!text_) + if (!text_) { text_ = new Item (get_property ("InstrumentName")); @@ -97,10 +97,10 @@ Instrument_name_engraver::acknowledge_grob (Grob_info i) return; if (dynamic_cast (i.elem_l_) - &&((Axis_group_interface::has_interface (i.elem_l_) + && ((Axis_group_interface::has_interface (i.elem_l_) && Axis_group_interface::axis_b (i.elem_l_, Y_AXIS)) || (Align_interface::has_interface (i.elem_l_) - && Align_interface::axis (i.elem_l_) == Y_AXIS))) + && Align_interface::axis (i.elem_l_) == Y_AXIS))) { SCM nl = gh_cons (i.elem_l_->self_scm (), get_property ("instrumentSupport")); diff --git a/lily/interpretation-context-handle.cc b/lily/interpretation-context-handle.cc index d03d4bc8e0..fddebdf9a7 100644 --- a/lily/interpretation-context-handle.cc +++ b/lily/interpretation-context-handle.cc @@ -11,7 +11,7 @@ #include "interpretation-context-handle.hh" #include "translator-group.hh" -Interpretation_context_handle::Interpretation_context_handle() +Interpretation_context_handle::Interpretation_context_handle () { report_to_l_ =0; } @@ -20,7 +20,7 @@ Interpretation_context_handle::Interpretation_context_handle (Interpretation_con { report_to_l_ =0; if (s.report_to_l_) - up (s.report_to_l_ ); + up (s.report_to_l_); } Interpretation_context_handle* @@ -45,7 +45,7 @@ Interpretation_context_handle::up (Translator_group*t) } void -Interpretation_context_handle::down() +Interpretation_context_handle::down () { report_to_l_->iterator_count_ --; report_to_l_ = 0; diff --git a/lily/item.cc b/lily/item.cc index 099257e001..6eeaf77503 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -37,7 +37,7 @@ Item::breakable_b (Grob*me) if (me->original_l_) return false; - if (!dynamic_cast(me)) + if (!dynamic_cast (me)) programming_error ("only items can be breakable."); Item * i =dynamic_cast (me->parent_l (X_AXIS)); @@ -52,7 +52,7 @@ Item::column_l () const } Line_of_score * -Item::line_l() const +Item::line_l () const { Grob *g = parent_l (X_AXIS); return g ? g->line_l () : 0; @@ -60,18 +60,18 @@ Item::line_l() const void -Item::copy_breakable_items() +Item::copy_breakable_items () { Drul_array new_copies; Direction i=LEFT; do { - Grob * dolly = clone(); - Item * item_p = dynamic_cast(dolly); + Grob * dolly = clone (); + Item * item_p = dynamic_cast (dolly); pscore_l_->line_l_->typeset_grob (item_p); new_copies[i] =item_p; } - while (flip(&i) != LEFT); + while (flip (&i) != LEFT); broken_to_drul_= new_copies; } @@ -87,20 +87,20 @@ Item::broken_b () const Generate items for begin and end-of line. */ void -Item::discretionary_processing() +Item::discretionary_processing () { if (broken_b ()) return; if (Item::breakable_b (this)) - copy_breakable_items(); + copy_breakable_items (); } Grob* Item::find_broken_piece (Line_of_score*l) const { - if (line_l() == l) - return (Item*)(this); + if (line_l () == l) + return (Item*) (this); Direction d = LEFT; do { diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 9ffb77a381..7cfcee40b6 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -24,24 +24,24 @@ */ class Key_engraver : public Engraver { - void create_key(bool); + void create_key (bool); void read_req (Key_change_req const * r); public: - Key_engraver(); + Key_engraver (); - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Key_change_req * keyreq_l_; Item * item_p_; Protected_scm old_accs_; // ugh. -> property protected: - virtual void initialize(); + virtual void initialize (); virtual void finalize (); virtual bool try_music (Music *req_l); - virtual void stop_translation_timestep(); - virtual void start_translation_timestep(); + virtual void stop_translation_timestep (); + virtual void start_translation_timestep (); virtual void create_grobs (); virtual void acknowledge_grob (Grob_info); }; diff --git a/lily/key-item.cc b/lily/key-item.cc index 4a3c30db99..f1c8ec2232 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -28,7 +28,7 @@ const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */ the thinking to other parties. */ int -Key_item::calculate_position(Grob *ki, SCM pair) +Key_item::calculate_position (Grob *ki, SCM pair) { int p = gh_scm2int (gh_car (pair)); int a = gh_scm2int (gh_cdr (pair)); @@ -47,7 +47,7 @@ Key_item::calculate_position(Grob *ki, SCM pair) if ((a<0 && ((p>FLAT_TOP_PITCH) || (p+c0>4)) && (p+c0>1)) || - (a>0 && ((p>SHARP_TOP_PITCH) || (p+c0>5)) && (p+c0>2))) + (a>0 && ((p>SHARP_TOP_PITCH) || (p+c0>5)) && (p+c0>2))) { p -= 7; /* Typeset below c_position */ } @@ -72,7 +72,7 @@ Key_item::calculate_position(Grob *ki, SCM pair) TODO - space the `natural' signs wider */ -MAKE_SCHEME_CALLBACK(Key_item,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Key_item,brew_molecule,1); SCM Key_item::brew_molecule (SCM smob) { @@ -91,7 +91,7 @@ Key_item::brew_molecule (SCM smob) { int a = gh_scm2int (gh_cdar (s)); Molecule m = Font_interface::get_default_font (me)->find_by_name ("accidentals-" + to_str (a)); - m.translate_axis (calculate_position(me, gh_car (s)) * inter, Y_AXIS); + m.translate_axis (calculate_position (me, gh_car (s)) * inter, Y_AXIS); mol.add_at_edge (X_AXIS, LEFT, m, 0); } @@ -104,10 +104,10 @@ Key_item::brew_molecule (SCM smob) As suggested by [Ross], p.148. */ - Interval x(0, inter); - Interval y(0,0); + Interval x (0, inter); + Interval y (0,0); - mol.add_at_edge (X_AXIS, LEFT, Lookup::blank (Box(x,y)),0); + mol.add_at_edge (X_AXIS, LEFT, Lookup::blank (Box (x,y)),0); for (; gh_pair_p (old); old = gh_cdr (old)) { @@ -117,7 +117,7 @@ Key_item::brew_molecule (SCM smob) find correspondences in pitches */ for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s)) - if (gh_caar(s) == gh_caar (old)) + if (gh_caar (s) == gh_caar (old)) found = gh_car (s); if (found == SCM_EOL || gh_cdr (found) != gh_cdar (old)) @@ -130,7 +130,7 @@ Key_item::brew_molecule (SCM smob) } } - return mol.smobbed_copy(); + return mol.smobbed_copy (); } diff --git a/lily/key-performer.cc b/lily/key-performer.cc index 65bcfba7b2..74f702c6af 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -14,10 +14,10 @@ class Key_performer : public Performer { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); - Key_performer(); - ~Key_performer(); + Key_performer (); + ~Key_performer (); protected: virtual bool try_music (Music* req_l); @@ -51,7 +51,7 @@ Key_performer::create_audio_elements () SCM acc = gh_call1 (proc, pitchlist); proc = scm_eval2 (ly_symbol2scm ("major-key"), SCM_EOL); SCM major = gh_call1 (proc, pitchlist); - audio_p_ = new Audio_key (gh_scm2int(acc), major == SCM_BOOL_T); + audio_p_ = new Audio_key (gh_scm2int (acc), major == SCM_BOOL_T); Audio_element_info info (audio_p_, key_req_l_); announce_element (info); key_req_l_ = 0; diff --git a/lily/keyword.cc b/lily/keyword.cc index ea7f14901d..e235d6a973 100644 --- a/lily/keyword.cc +++ b/lily/keyword.cc @@ -10,8 +10,8 @@ int tabcmp (void const * p1, void const * p2) { - return strcmp (((Keyword_ent const *) p1)->name, - ((Keyword_ent const *) p2)->name); + return strcmp (( (Keyword_ent const *) p1)->name, + ((Keyword_ent const *) p2)->name); } Keyword_table::Keyword_table (Keyword_ent *tab) diff --git a/lily/kpath.cc b/lily/kpath.cc index 8f6f819343..e061214ef1 100644 --- a/lily/kpath.cc +++ b/lily/kpath.cc @@ -1,11 +1,10 @@ /* -kpath.cc -- glue kpathsea to lily. Need some ugly kludges for gcc 2.96 + kpath.cc -- glue kpathsea to lily. Need some ugly kludges for gcc 2.96 -source file of the GNU LilyPond music typesetter + source file of the GNU LilyPond music typesetter -(c) 2000--2001 Han-Wen Nienhuys - - */ + (c) 2000--2001 Han-Wen Nienhuys +*/ #include @@ -23,10 +22,11 @@ extern "C" { #endif #include "kpath.hh" -#include "version.hh" +#include "lily-version.hh" -char * ly_find_afm (char const * name) +char * +ly_find_afm (char const * name) { #if (KPATHSEA && HAVE_KPSE_FIND_FILE) return kpse_find_file (name, kpse_afm_format, true); @@ -34,7 +34,8 @@ char * ly_find_afm (char const * name) return 0; } -char * ly_find_tfm (char const * name) +char * +ly_find_tfm (char const * name) { #if (KPATHSEA && HAVE_KPSE_FIND_FILE) return kpse_find_file (name, kpse_tfm_format, true); @@ -50,21 +51,17 @@ ly_init_kpath (char *av0) /* initialize kpathsea */ - kpse_set_program_name(av0, NULL); - kpse_maketex_option("tfm", TRUE); + kpse_set_program_name (av0, NULL); + kpse_maketex_option ("tfm", TRUE); - /* - ugh: apparently the program_args is non-functional. - */ -#define VERSION MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL - -#define MY_TFMPATH "$VARTEXFONTS/tfm/lilypond/" VERSION "/" + String my_tfm = "$VARTEXFONTS/tfm/lilypond/"; + my_tfm += version_str () + "/"; - char * mypath = kpse_expand (MY_TFMPATH); + char * mypath = kpse_expand (my_tfm.ch_C ()); String prog = "mktextfm --destdir "; prog += mypath; - kpse_format_info[kpse_tfm_format].program = strdup (prog.ch_C()); + kpse_format_info[kpse_tfm_format].program = strdup (prog.ch_C ()); kpse_format_info[kpse_tfm_format].client_path = mypath; #endif } diff --git a/lily/least-squares.cc b/lily/least-squares.cc index 8e9a5baf4f..8f635b0cd2 100644 --- a/lily/least-squares.cc +++ b/lily/least-squares.cc @@ -20,7 +20,7 @@ minimise_least_squares (Real * coef, Real * offset, Real sqx =0.0; Real sxy = 0.0; - for (int i=0; i < input.size();i++) + for (int i=0; i < input.size ();i++) { Real x=input[i][X_AXIS]; Real y = input[i][Y_AXIS]; @@ -29,7 +29,7 @@ minimise_least_squares (Real * coef, Real * offset, sqx += sqr (x); sxy += x*y; } - int N = input.size(); + int N = input.size (); *coef =0.0; *offset =0.; @@ -37,7 +37,7 @@ minimise_least_squares (Real * coef, Real * offset, Real den = (N*sqx - sqr (sx)); if (!N || !den) { - programming_error ("minimise_least_squares(): Nothing to minimise"); + programming_error ("minimise_least_squares (): Nothing to minimise"); *coef = 0.0; *offset = N ? sy/N : 0.0; } diff --git a/lily/lexer.ll b/lily/lexer.ll index e271bb1ada..d08ee082cf 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -18,7 +18,7 @@ lex.backup contains no backup states, but only the reminder Compressed tables always back up. - (don-t forget to rm lex.yy.cc :-) + (don-t forget to rm lex.yy.cc :-) */ @@ -60,7 +60,8 @@ valid_version_b (String s); yy_push_state (quote);\ yylval.string = new String -#define yylval (*(YYSTYPE*)lexval_l) +#define yylval \ + (*(YYSTYPE*)lexval_l) #define YY_USER_ACTION add_lexed_char (YYLeng ()); /* @@ -95,7 +96,7 @@ N [0-9] AN {AA}|{N} PUNCT [?!:'] ACCENT \\[`'"^] -NATIONAL [\001-\006\021-\027\031\036\200-\377] +NATIONAL [\001-\006\021-\027\031\036\200-\377] TEX {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL} WORD {A}{AN}* ALPHAWORD {A}+ @@ -282,7 +283,7 @@ HYPHEN -- } { \\{ESCAPED} { - *yylval.string += to_str (escaped_char(YYText()[1])); + *yylval.string += to_str (escaped_char (YYText ()[1])); } [^\\"]+ { *yylval.string += YYText (); @@ -293,7 +294,7 @@ HYPHEN -- /* yylval is union. Must remember STRING before setting SCM*/ String *sp = yylval.string; - yylval.scm = ly_str02scm (sp->ch_C ()); + yylval.scm = ly_str02scm (sp->ch_C ()); delete sp; return STRING; } @@ -322,17 +323,17 @@ HYPHEN -- return yylval.i = HYPHEN; int i = 0; while ((i=s.index_i ("_")) != -1) // change word binding "_" to " " - *(s.ch_l () + i) = ' '; + * (s.ch_l () + i) = ' '; if ((i=s.index_i ("\\,")) != -1) // change "\," to TeX's "\c " { - *(s.ch_l () + i + 1) = 'c'; + * (s.ch_l () + i + 1) = 'c'; s = s.left_str (i+2) + " " + s.right_str (s.length_i ()-i-2); } char c = s[s.length_i () - 1]; if (c == '{' || c == '}') // brace open is for not confusing dumb tools. here_input ().warning ( - _("Brace found at end of lyric. Did you forget a space?")); + _ ("Brace found at end of lyric. Did you forget a space?")); yylval.scm = ly_str02scm (s.ch_C ()); DEBUG_OUT << "lyric : `" << s << "'\n"; @@ -472,7 +473,7 @@ My_lily_lexer::scan_escaped_word (String str) { // use more SCM for this. - SCM sym = ly_symbol2scm (str.ch_C()); + SCM sym = ly_symbol2scm (str.ch_C ()); int l = lookup_keyword (str); if (l != -1) { @@ -520,7 +521,7 @@ My_lily_lexer::scan_escaped_word (String str) String msg (_f ("unknown escaped string: `\\%s'", str)); LexerError (msg.ch_C ()); - yylval.scm = ly_str02scm(str.ch_C()); + yylval.scm = ly_str02scm (str.ch_C ()); return STRING; } @@ -541,7 +542,7 @@ My_lily_lexer::scan_bare_word (String str) } } - yylval.scm = ly_str02scm (str.ch_C()); + yylval.scm = ly_str02scm (str.ch_C ()); return STRING; } @@ -564,7 +565,7 @@ My_lily_lexer::lyric_state_b () const } /* - urg, belong to String(_convert) + urg, belong to String (_convert) and should be generalised */ void @@ -597,10 +598,10 @@ valid_version_b (String s) { Lilypond_version current ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL ); Lilypond_version ver (s); - if (!((ver >= oldest_version) && (ver <= current))) + if (! ((ver >= oldest_version) && (ver <= current))) { non_fatal_error (_f ("incorrect lilypond version: %s (%s, %s)", ver.str (), oldest_version.str (), current.str ())); - non_fatal_error (_("Consider converting the input with the convert-ly script")); + non_fatal_error (_ ("Consider converting the input with the convert-ly script")); return false; } return true; diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 695601e8ca..04bb47cdd3 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -79,11 +79,11 @@ ly_parse_scm (char const* s, int* n) /* After parsing - (begin (foo 1 2)) + (begin (foo 1 2)) all seems fine, but after parsing - (foo 1 2) + (foo 1 2) read_buf has been advanced to read_pos - 1, so that scm_ftell returns 1, instead of #parsed chars @@ -116,7 +116,7 @@ ly_quote_scm (SCM s) SCM -ly_symbol2scm(const char *s) +ly_symbol2scm (const char *s) { return gh_symbol2scm ((char *)s); } @@ -126,7 +126,7 @@ String ly_symbol2string (SCM s) { assert (gh_symbol_p (s)); - return String((Byte*)SCM_CHARS (s), (int) SCM_LENGTH(s)); + return String ((Byte*)SCM_CHARS (s), (int) SCM_LENGTH (s)); } @@ -142,11 +142,11 @@ gulp_file_to_string (String fn) error (e); } else if (verbose_global_b) - progress_indication ("[" + s ); + progress_indication ("[" + s); - Simple_file_storage f(s); - String result (f.ch_C()); + Simple_file_storage f (s); + String result (f.ch_C ()); if (verbose_global_b) progress_indication ("]"); return result; @@ -155,7 +155,7 @@ gulp_file_to_string (String fn) SCM ly_gulp_file (SCM fn) { - return ly_str02scm (gulp_file_to_string (ly_scm2string (fn)).ch_C()); + return ly_str02scm (gulp_file_to_string (ly_scm2string (fn)).ch_C ()); } @@ -166,7 +166,7 @@ ly_gulp_file (SCM fn) void read_lily_scm_file (String fn) { - gh_eval_str ((char *) gulp_file_to_string (fn).ch_C()); + gh_eval_str ((char *) gulp_file_to_string (fn).ch_C ()); } extern "C" { @@ -196,7 +196,7 @@ SCM index_cell (SCM s, Direction d) { assert (d); - return (d == LEFT) ? gh_car (s) : gh_cdr (s); + return (d == LEFT) ? gh_car (s) : gh_cdr (s); } SCM @@ -230,24 +230,24 @@ ly_isdir_p (SCM s) -typedef void (*Void_fptr)(); +typedef void (*Void_fptr) (); Array *scm_init_funcs_; -void add_scm_init_func (void (*f)()) +void add_scm_init_func (void (*f) ()) { if (!scm_init_funcs_) scm_init_funcs_ = new Array; scm_init_funcs_->push (f); } -extern void init_cxx_function_smobs(); +extern void init_cxx_function_smobs (); void init_lily_guile () { - init_cxx_function_smobs(); - for (int i=scm_init_funcs_->size() ; i--;) - (scm_init_funcs_->elem (i)) (); + init_cxx_function_smobs (); + for (int i=scm_init_funcs_->size () ; i--;) + (scm_init_funcs_->elem (i)) (); } unsigned int ly_scm_hash (SCM s) @@ -323,7 +323,7 @@ appendable_list_append (SCM l, SCM elt) SCM ly_offset2scm (Offset o) { - return gh_cons (gh_double2scm (o[X_AXIS]), gh_double2scm(o[Y_AXIS])); + return gh_cons (gh_double2scm (o[X_AXIS]), gh_double2scm (o[Y_AXIS])); } Offset @@ -405,13 +405,13 @@ ly_number2string (SCM s) static void * greet_sweep (void *dummy1, void *dummy2, void *dummy3) { - fprintf(stderr, "entering sweep\n"); + fprintf (stderr, "entering sweep\n"); } static void * wave_sweep_goodbye (void *dummy1, void *dummy2, void *dummy3) { - fprintf(stderr, "leaving sweep\n"); + fprintf (stderr, "leaving sweep\n"); } #endif @@ -420,7 +420,7 @@ wave_sweep_goodbye (void *dummy1, void *dummy2, void *dummy3) SCM ly_version () { - char const* vs = "\'(" MAJOR_VERSION " " MINOR_VERSION " " PATCH_LEVEL " " MY_PATCH_LEVEL ")" ; + char const* vs = "\' (" MAJOR_VERSION " " MINOR_VERSION " " PATCH_LEVEL " " MY_PATCH_LEVEL ")" ; return gh_eval_str ((char*)vs); @@ -443,7 +443,7 @@ init_functions () #endif } -ADD_SCM_INIT_FUNC(funcs, init_functions); +ADD_SCM_INIT_FUNC (funcs, init_functions); SCM ly_deep_copy (SCM l) diff --git a/lily/line-group-group-engraver.cc b/lily/line-group-group-engraver.cc index 7a4f64c4a4..d637cdeedd 100644 --- a/lily/line-group-group-engraver.cc +++ b/lily/line-group-group-engraver.cc @@ -15,7 +15,7 @@ #include "spanner.hh" -Line_group_engraver_group::Line_group_engraver_group() +Line_group_engraver_group::Line_group_engraver_group () { staffline_p_ =0; } @@ -31,24 +31,24 @@ Line_group_engraver_group::typeset_grob (Grob *elem) void -Line_group_engraver_group::finalize() +Line_group_engraver_group::finalize () { Engraver_group_engraver::finalize (); Grob * it = unsmob_grob (get_property (ly_symbol2scm ("currentCommandColumn"))); - staffline_p_->set_bound(RIGHT,it); + staffline_p_->set_bound (RIGHT,it); Engraver_group_engraver::typeset_grob (staffline_p_); staffline_p_ = 0; } void -Line_group_engraver_group::initialize() +Line_group_engraver_group::initialize () { create_line_spanner (); Grob * it = unsmob_grob (get_property (ly_symbol2scm ("currentCommandColumn"))); - staffline_p_->set_bound(LEFT,it); + staffline_p_->set_bound (LEFT,it); Engraver::announce_grob (staffline_p_,0); } @@ -64,5 +64,5 @@ Line_group_engraver_group::create_line_spanner () -ADD_THIS_TRANSLATOR(Line_group_engraver_group); +ADD_THIS_TRANSLATOR (Line_group_engraver_group); diff --git a/lily/line-of-score.cc b/lily/line-of-score.cc index c662d33599..b788a54857 100644 --- a/lily/line-of-score.cc +++ b/lily/line-of-score.cc @@ -32,7 +32,7 @@ fixup_refpoints (SCM s) } -Line_of_score::Line_of_score(SCM s) +Line_of_score::Line_of_score (SCM s) : Spanner (s) { rank_i_ = 0; @@ -44,7 +44,7 @@ Line_of_score::Line_of_score(SCM s) int Line_of_score::element_count () const { - return scm_ilength ( get_grob_property ("all-elements")); + return scm_ilength (get_grob_property ("all-elements")); } void @@ -93,7 +93,7 @@ Line_of_score::output_lines () handle_broken_dependencies (); if (verbose_global_b) - progress_indication ( _f("Element count %d.", count + element_count())); + progress_indication (_f ("Element count %d.", count + element_count ())); for (int i=0; i < broken_into_l_arr_.size (); i++) @@ -129,15 +129,15 @@ Line_of_score::break_into_pieces (Array const &breaking) { for (int i=0; i < breaking.size (); i++) { - Line_of_score *line_l = dynamic_cast (clone()); + Line_of_score *line_l = dynamic_cast (clone ()); line_l->rank_i_ = i; - // line_l->set_immutable_grob_property ("rank", gh_int2scm( i)); + // line_l->set_immutable_grob_property ("rank", gh_int2scm (i)); Link_array c (breaking[i].cols_); pscore_l_->typeset_line (line_l); - line_l->set_bound(LEFT,c[0]); - line_l->set_bound(RIGHT,c.top ()); - for (int j=0; j < c.size(); j++) + line_l->set_bound (LEFT,c[0]); + line_l->set_bound (RIGHT,c.top ()); + for (int j=0; j < c.size (); j++) { c[j]->translate_axis (breaking[i].config_[j],X_AXIS); dynamic_cast (c[j])->line_l_ = line_l; @@ -156,14 +156,14 @@ cname ## _init_func () \ cname = ly_symbol2scm (name); \ scm_permanent_object (cname); \ } \ -ADD_SCM_INIT_FUNC(cname,cname ## _init_func);\ +ADD_SCM_INIT_FUNC (cname,cname ## _init_func);\ -GLOBAL_SYMBOL( offset_sym , "translate-molecule"); -GLOBAL_SYMBOL( placebox_sym , "placebox"); -GLOBAL_SYMBOL( combine_sym , "combine-molecule"); -GLOBAL_SYMBOL( no_origin_sym , "no-origin"); -GLOBAL_SYMBOL( define_origin_sym , "define-origin"); +GLOBAL_SYMBOL (offset_sym , "translate-molecule"); +GLOBAL_SYMBOL (placebox_sym , "placebox"); +GLOBAL_SYMBOL (combine_sym , "combine-molecule"); +GLOBAL_SYMBOL (no_origin_sym , "no-origin"); +GLOBAL_SYMBOL (define_origin_sym , "define-origin"); @@ -183,7 +183,7 @@ Line_of_score::output_molecule (SCM expr, Offset o) pscore_l_->outputter_l_->output_scheme (gh_list (define_origin_sym, - ly_str02scm (ip->file_str ().ch_C()), + ly_str02scm (ip->file_str ().ch_C ()), gh_int2scm (ip->line_number ()), gh_int2scm (ip->column_number ()), SCM_UNDEFINED)); @@ -249,8 +249,8 @@ Line_of_score::pre_processing () for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s)) unsmob_grob (gh_car (s))->discretionary_processing (); - if(verbose_global_b) - progress_indication ( _f("Element count %d ", element_count ())); + if (verbose_global_b) + progress_indication (_f ("Element count %d ", element_count ())); for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s)) @@ -264,7 +264,7 @@ Line_of_score::pre_processing () sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback")); } - progress_indication ("\n" + _ ("Calculating column positions...") + " " ); + progress_indication ("\n" + _ ("Calculating column positions...") + " "); for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s)) { Grob * e = unsmob_grob (gh_car (s)); @@ -285,8 +285,8 @@ Line_of_score::post_processing (bool last_line) ly_symbol2scm ("after-line-breaking-callback")); } - Interval i(extent(this, Y_AXIS)); - if (i.empty_b()) + Interval i (extent (this, Y_AXIS)); + if (i.empty_b ()) programming_error ("Huh? Empty Line_of_score?"); else translate_axis (- i[MAX], Y_AXIS); @@ -301,7 +301,7 @@ Line_of_score::post_processing (bool last_line) /* generate all molecules to trigger all font loads. - (ugh. This is not very memory efficient.) */ + (ugh. This is not very memory efficient.) */ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s)) { unsmob_grob (gh_car (s))->get_molecule (); @@ -309,7 +309,7 @@ Line_of_score::post_processing (bool last_line) /* font defs; */ - SCM font_names = ly_quote_scm (paper_l()->font_descriptions ()); + SCM font_names = ly_quote_scm (paper_l ()->font_descriptions ()); output_scheme (gh_list (ly_symbol2scm ("define-fonts"), font_names, SCM_UNDEFINED)); @@ -371,18 +371,18 @@ Line_of_score::broken_col_range (Item const*l, Item const*r) const SCM s = get_grob_property ("columns"); while (gh_pair_p (s) && gh_car (s) != r->self_scm ()) - s = gh_cdr (s); + s = gh_cdr (s); if (gh_pair_p (s)) s = gh_cdr (s); while (gh_pair_p (s) && gh_car (s) != l->self_scm ()) { - Paper_column*c = dynamic_cast ( unsmob_grob (gh_car (s))); + Paper_column*c = dynamic_cast (unsmob_grob (gh_car (s))); if (Item::breakable_b (c) && !c->line_l_) ret.push (c); - s = gh_cdr (s); + s = gh_cdr (s); } ret.reverse (); @@ -399,7 +399,7 @@ Line_of_score::column_l_arr ()const Link_array acs = Pointer_group_interface__extract_elements (this, (Grob*) 0, "columns"); bool bfound = false; - for (int i= acs.size (); i -- ; ) + for (int i= acs.size (); i -- ;) { bool brb = Item::breakable_b (acs[i]); bfound = bfound || brb; diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index 5ea4c1a687..7ce8aa82f3 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -79,7 +79,7 @@ Line_spanner::get_broken_offset (Grob *me, Direction dir) Y_AXIS) }; - return Offset ( abs (bound->extent (common[X_AXIS], X_AXIS)[-dir]), + return Offset (abs (bound->extent (common[X_AXIS], X_AXIS)[-dir]), bound->extent (common[Y_AXIS], Y_AXIS).center ()); } return Offset (); @@ -105,9 +105,9 @@ Line_spanner::broken_trend_offset (Grob *me, Direction dir) Offset me_o = get_broken_offset (me, -dir); // Hmm, why not return me_o[X], but recalc in brew_mol? o = Offset (0, - (neighbour_o[Y_AXIS]*me_o[X_AXIS] + (neighbour_o[Y_AXIS]*me_o[X_AXIS] - me_o[Y_AXIS]*neighbour_o[X_AXIS]) * dir / - (me_o[X_AXIS] + neighbour_o[X_AXIS])); + (me_o[X_AXIS] + neighbour_o[X_AXIS])); break; } } @@ -119,7 +119,7 @@ Line_spanner::broken_trend_offset (Grob *me, Direction dir) /* Warning: this thing is a cross-staff object, so it should have empty Y-dimensions. - (If not, you risk that this is called from the staff-alignment + (If not, you risk that this is called from the staff-alignment routine, via molecule_extent. At this point, the staffs aren't separated yet, so it doesn't work cross-staff. @@ -189,8 +189,8 @@ Line_spanner::brew_molecule (SCM smob) dxy[Y_AXIS] = bound[RIGHT]->extent (common[Y_AXIS], Y_AXIS).center () - bound[LEFT]->extent (common[Y_AXIS], Y_AXIS).center (); - dist = sqrt(dxy[X_AXIS]*dxy[X_AXIS]+dxy[Y_AXIS]*dxy[Y_AXIS]); - ofxy = dxy*(off/dist); + dist = sqrt (dxy[X_AXIS]*dxy[X_AXIS]+dxy[Y_AXIS]*dxy[Y_AXIS]); + ofxy = dxy* (off/dist); dxy -= 2*ofxy; my_off = Offset (me->relative_coordinate (common[X_AXIS], X_AXIS), diff --git a/lily/local-key-engraver.cc b/lily/local-key-engraver.cc index e4ac502388..d4be97cc62 100644 --- a/lily/local-key-engraver.cc +++ b/lily/local-key-engraver.cc @@ -30,10 +30,10 @@ struct Local_key_engraver : Engraver { Item *key_item_p_; protected: - VIRTUAL_COPY_CONS(Translator); - virtual void process_music(); + VIRTUAL_COPY_CONS (Translator); + virtual void process_music (); virtual void acknowledge_grob (Grob_info); - virtual void stop_translation_timestep(); + virtual void stop_translation_timestep (); virtual void initialize (); virtual void create_grobs (); virtual void finalize (); @@ -52,12 +52,12 @@ public: Link_array support_l_arr_; Link_array forced_l_arr_; Link_array tie_l_arr_; - Local_key_engraver(); + Local_key_engraver (); Item * grace_align_l_; }; -Local_key_engraver::Local_key_engraver() +Local_key_engraver::Local_key_engraver () { key_item_p_ =0; grace_align_l_ =0; @@ -74,11 +74,11 @@ Local_key_engraver::initialize () void Local_key_engraver::create_grobs () { - if (!key_item_p_ && mel_l_arr_.size()) + if (!key_item_p_ && mel_l_arr_.size ()) { SCM localsig = get_property ("localKeySignature"); - for (int i=0; i < mel_l_arr_.size(); i++) + for (int i=0; i < mel_l_arr_.size (); i++) { Grob * support_l = support_l_arr_[i]; Note_req * note_l = mel_l_arr_[i]; @@ -94,9 +94,9 @@ Local_key_engraver::create_grobs () SCM prev = scm_assoc (gh_cons (gh_int2scm (o), gh_int2scm (n)), localsig); if (prev == SCM_BOOL_F) prev = scm_assoc (gh_int2scm (n), localsig); - SCM prev_acc = (prev == SCM_BOOL_F) ? gh_int2scm(0) : gh_cdr (prev); - bool different = !gh_equal_p(prev_acc , gh_int2scm(a)); - int p = gh_number_p(prev_acc) ? gh_scm2int(prev_acc) : 0; + SCM prev_acc = (prev == SCM_BOOL_F) ? gh_int2scm (0) : gh_cdr (prev); + bool different = !gh_equal_p (prev_acc , gh_int2scm (a)); + int p = gh_number_p (prev_acc) ? gh_scm2int (prev_acc) : 0; Grob *tie_break_reminder = 0; bool tie_changes = false; @@ -122,14 +122,14 @@ Local_key_engraver::create_grobs () 2. when different and not tie-changes 3. maybe when at end of a tie: we must later see if we're after a line break */ - if (((to_boolean (note_l->get_mus_property ("force-accidental")) + if (( (to_boolean (note_l->get_mus_property ("force-accidental")) || different) && !tie_changes) || tie_break_reminder) { if (!key_item_p_) { - key_item_p_ = new Item(get_property ("Accidentals")); + key_item_p_ = new Item (get_property ("Accidentals")); Local_key_item::set_interface (key_item_p_); @@ -141,7 +141,7 @@ Local_key_engraver::create_grobs () bool extra_natural = sign (p) * (p - a) == 1 - && abs(p) == 2; + && abs (p) == 2; Local_key_item::add_pitch (key_item_p_, *unsmob_pitch (note_l->get_mus_property ("pitch")), to_boolean (note_l->get_mus_property ("cautionary")), @@ -203,7 +203,7 @@ Local_key_engraver::create_grobs () On which left, code or paper? - (Arpeggios are engraved left of accidentals, of course.) + (Arpeggios are engraved left of accidentals, of course.) */ for (int i=0; i < arpeggios_.size (); i++) Side_position_interface::add_support (arpeggios_[i], key_item_p_); @@ -219,11 +219,11 @@ Local_key_engraver::finalize () } void -Local_key_engraver::stop_translation_timestep() +Local_key_engraver::stop_translation_timestep () { if (key_item_p_) { - for (int i=0; i < support_l_arr_.size(); i++) + for (int i=0; i < support_l_arr_.size (); i++) Side_position_interface::add_support (key_item_p_,support_l_arr_[i]); typeset_grob (key_item_p_); @@ -231,11 +231,11 @@ Local_key_engraver::stop_translation_timestep() } grace_align_l_ = 0; - mel_l_arr_.clear(); + mel_l_arr_.clear (); arpeggios_.clear (); tie_l_arr_.clear (); - support_l_arr_.clear(); - forced_l_arr_.clear(); + support_l_arr_.clear (); + forced_l_arr_.clear (); } void @@ -276,10 +276,10 @@ Local_key_engraver::acknowledge_grob (Grob_info info) ugh. repeated deep_copy generates lots of garbage. */ void -Local_key_engraver::process_music() +Local_key_engraver::process_music () { SCM smp = get_property ("measurePosition"); - Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); + Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); SCM sig = get_property ("keySignature"); @@ -300,5 +300,5 @@ Local_key_engraver::process_music() -ADD_THIS_TRANSLATOR(Local_key_engraver); +ADD_THIS_TRANSLATOR (Local_key_engraver); diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index 422d82b990..634a4b7b3f 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -18,7 +18,7 @@ #include "lookup.hh" static SCM -pitch_less (SCM p1, SCM p2) +pitch_less (SCM p1, SCM p2) { return Pitch::less_p (gh_car (p1), gh_car (p2)); } @@ -31,7 +31,7 @@ init_pitch_funcs () pitch_less_proc = gh_new_procedure2_0 ("pits-less", &pitch_less); } -ADD_SCM_INIT_FUNC(lkpitch,init_pitch_funcs); +ADD_SCM_INIT_FUNC (lkpitch,init_pitch_funcs); void @@ -61,10 +61,10 @@ Local_key_item::add_pitch (Grob*me, Pitch p, bool cautionary, bool natural, Molecule Local_key_item::parenthesize (Grob*me, Molecule m) { - Molecule open = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-(")); + Molecule open = Font_interface::get_default_font (me)->find_by_name (String ("accidentals- (")); Molecule close = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-)")); - m.add_at_edge(X_AXIS, LEFT, Molecule(open), 0); - m.add_at_edge(X_AXIS, RIGHT, Molecule(close), 0); + m.add_at_edge (X_AXIS, LEFT, Molecule (open), 0); + m.add_at_edge (X_AXIS, RIGHT, Molecule (close), 0); return m; } @@ -84,7 +84,7 @@ Local_key_item::after_line_breaking (SCM smob) Grob *me = unsmob_grob (smob); SCM accs = me->get_grob_property ("accidentals"); - for (SCM s = accs; + for (SCM s = accs; gh_pair_p (s); s = gh_cdr (s)) { SCM opts = gh_cdar (s); @@ -113,7 +113,7 @@ Local_key_item::after_line_breaking (SCM smob) accidental placement is more complicated than this. */ -MAKE_SCHEME_CALLBACK(Local_key_item,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Local_key_item,brew_molecule,1); SCM Local_key_item::brew_molecule (SCM smob) { @@ -127,7 +127,7 @@ Local_key_item::brew_molecule (SCM smob) int lastoct = -100; SCM accs = me->get_grob_property ("accidentals"); - for (SCM s = accs; + for (SCM s = accs; gh_pair_p (s); s = gh_cdr (s)) { Pitch p (*unsmob_pitch (gh_caar (s))); @@ -161,7 +161,7 @@ Local_key_item::brew_molecule (SCM smob) if (scm_memq (ly_symbol2scm ("natural"), opts) != SCM_BOOL_F) { Molecule prefix = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-0")); - acc.add_at_edge(X_AXIS, LEFT, Molecule(prefix), 0); + acc.add_at_edge (X_AXIS, LEFT, Molecule (prefix), 0); } if (scm_memq (ly_symbol2scm ("cautionary"), opts) != SCM_BOOL_F) @@ -196,14 +196,14 @@ Local_key_item::brew_molecule (SCM smob) if (!gh_number_p (pads[d])) continue; - Box b(Interval (0, gh_scm2double (pads[d]) * note_distance), + Box b (Interval (0, gh_scm2double (pads[d]) * note_distance), Interval (0,0)); Molecule m (Lookup::blank (b)); mol.add_at_edge (X_AXIS, d, m, 0); - } while ( flip (&d)!= LEFT); + } while (flip (&d)!= LEFT); } - return mol.smobbed_copy(); + return mol.smobbed_copy (); } bool diff --git a/lily/lookup.cc b/lily/lookup.cc index 62f449b08c..f2e89466b6 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -33,7 +33,7 @@ Lookup::beam (Real slope, Real width, Real thick) - Box b( Interval (0, width), + Box b (Interval (0, width), Interval (min_y, max_y)); @@ -63,7 +63,7 @@ Lookup::dashed_slur (Bezier b, Real thick, Real dash) ly_quote_scm (l), SCM_UNDEFINED)); - Box box (Interval(0,0),Interval( 0,0)); + Box box (Interval (0,0),Interval (0,0)); return Molecule (box, at); } @@ -78,7 +78,7 @@ Lookup::blank (Box b) Molecule -Lookup::filledbox (Box b ) +Lookup::filledbox (Box b) { SCM at = (gh_list (ly_symbol2scm ("filledbox"), gh_double2scm (-b[X_AXIS][LEFT]), @@ -87,7 +87,7 @@ Lookup::filledbox (Box b ) gh_double2scm (b[Y_AXIS][UP]), SCM_UNDEFINED)); - return Molecule ( b,at); + return Molecule (b,at); } Molecule @@ -133,7 +133,7 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick) SCM scontrols[8]; for (int i=4; i--;) - scontrols[ i ] = ly_offset2scm(back.control_[i]); + scontrols[ i ] = ly_offset2scm (back.control_[i]); for (int i=4 ; i--;) scontrols[i+4] = ly_offset2scm (curve.control_[i]); @@ -142,7 +142,7 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick) */ int indices[]= {5, 6, 7, 4, 1, 2, 3, 0}; SCM list = SCM_EOL; - for (int i= 8; i--; ) + for (int i= 8; i--;) { list = gh_cons (scontrols[indices[i]], list); } @@ -153,7 +153,7 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick) gh_double2scm (linethick), SCM_UNDEFINED)); - Box b ( curve.extent (X_AXIS), curve.extent (Y_AXIS)); + Box b (curve.extent (X_AXIS), curve.extent (Y_AXIS)); return Molecule (b, at); } @@ -161,173 +161,173 @@ Molecule Lookup::accordion (SCM s, Real staff_space, Font_metric *fm) { Molecule m; - String sym = ly_scm2string(gh_car (s)); - String reg = ly_scm2string(gh_car (gh_cdr(s))); + String sym = ly_scm2string (gh_car (s)); + String reg = ly_scm2string (gh_car (gh_cdr (s))); if (sym == "Discant") { Molecule r = fm->find_by_name ("accordion-accDiscant"); - m.add_molecule(r); - if (reg.left_str(1) == "F") + m.add_molecule (r); + if (reg.left_str (1) == "F") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 2.5 PT, Y_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-1); + d.translate_axis (staff_space * 2.5 PT, Y_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-1); } int eflag = 0x00; - if (reg.left_str(3) == "EEE") + if (reg.left_str (3) == "EEE") { eflag = 0x07; - reg = reg.right_str(reg.length_i()-3); + reg = reg.right_str (reg.length_i ()-3); } - else if (reg.left_str(2) == "EE") + else if (reg.left_str (2) == "EE") { eflag = 0x05; - reg = reg.right_str(reg.length_i()-2); + reg = reg.right_str (reg.length_i ()-2); } - else if (reg.left_str(2) == "Eh") + else if (reg.left_str (2) == "Eh") { eflag = 0x04; - reg = reg.right_str(reg.length_i()-2); + reg = reg.right_str (reg.length_i ()-2); } - else if (reg.left_str(1) == "E") + else if (reg.left_str (1) == "E") { eflag = 0x02; - reg = reg.right_str(reg.length_i()-1); + reg = reg.right_str (reg.length_i ()-1); } if (eflag & 0x02) { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 1.5 PT, Y_AXIS); - m.add_molecule(d); + d.translate_axis (staff_space * 1.5 PT, Y_AXIS); + m.add_molecule (d); } if (eflag & 0x04) { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 1.5 PT, Y_AXIS); - d.translate_axis(0.8 * staff_space PT, X_AXIS); - m.add_molecule(d); + d.translate_axis (staff_space * 1.5 PT, Y_AXIS); + d.translate_axis (0.8 * staff_space PT, X_AXIS); + m.add_molecule (d); } if (eflag & 0x01) { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 1.5 PT, Y_AXIS); - d.translate_axis(-0.8 * staff_space PT, X_AXIS); - m.add_molecule(d); + d.translate_axis (staff_space * 1.5 PT, Y_AXIS); + d.translate_axis (-0.8 * staff_space PT, X_AXIS); + m.add_molecule (d); } - if (reg.left_str(2) == "SS") + if (reg.left_str (2) == "SS") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(0.5 * staff_space PT, Y_AXIS); - d.translate_axis(0.4 * staff_space PT, X_AXIS); - m.add_molecule(d); - d.translate_axis(-0.8 * staff_space PT, X_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-2); + d.translate_axis (0.5 * staff_space PT, Y_AXIS); + d.translate_axis (0.4 * staff_space PT, X_AXIS); + m.add_molecule (d); + d.translate_axis (-0.8 * staff_space PT, X_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-2); } - if (reg.left_str(1) == "S") + if (reg.left_str (1) == "S") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(0.5 * staff_space PT, Y_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-1); + d.translate_axis (0.5 * staff_space PT, Y_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-1); } } else if (sym == "Freebase") { Molecule r = fm->find_by_name ("accordion-accFreebase"); - m.add_molecule(r); - if (reg.left_str(1) == "F") + m.add_molecule (r); + if (reg.left_str (1) == "F") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 1.5 PT, Y_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-1); + d.translate_axis (staff_space * 1.5 PT, Y_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-1); } if (reg == "E") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 0.5 PT, Y_AXIS); - m.add_molecule(d); + d.translate_axis (staff_space * 0.5 PT, Y_AXIS); + m.add_molecule (d); } } else if (sym == "Bayanbase") { Molecule r = fm->find_by_name ("accordion-accBayanbase"); - m.add_molecule(r); - if (reg.left_str(1) == "T") + m.add_molecule (r); + if (reg.left_str (1) == "T") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 2.5 PT, Y_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-1); + d.translate_axis (staff_space * 2.5 PT, Y_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-1); } /* include 4' reed just for completeness. You don't want to use this. */ - if (reg.left_str(1) == "F") + if (reg.left_str (1) == "F") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 1.5 PT, Y_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-1); + d.translate_axis (staff_space * 1.5 PT, Y_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-1); } - if (reg.left_str(2) == "EE") + if (reg.left_str (2) == "EE") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 0.5 PT, Y_AXIS); - d.translate_axis(0.4 * staff_space PT, X_AXIS); - m.add_molecule(d); - d.translate_axis(-0.8 * staff_space PT, X_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-2); + d.translate_axis (staff_space * 0.5 PT, Y_AXIS); + d.translate_axis (0.4 * staff_space PT, X_AXIS); + m.add_molecule (d); + d.translate_axis (-0.8 * staff_space PT, X_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-2); } - if (reg.left_str(1) == "E") + if (reg.left_str (1) == "E") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 0.5 PT, Y_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-1); + d.translate_axis (staff_space * 0.5 PT, Y_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-1); } } else if (sym == "Stdbase") { Molecule r = fm->find_by_name ("accordion-accStdbase"); - m.add_molecule(r); - if (reg.left_str(1) == "T") + m.add_molecule (r); + if (reg.left_str (1) == "T") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 3.5 PT, Y_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-1); + d.translate_axis (staff_space * 3.5 PT, Y_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-1); } - if (reg.left_str(1) == "F") + if (reg.left_str (1) == "F") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 2.5 PT, Y_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-1); + d.translate_axis (staff_space * 2.5 PT, Y_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-1); } - if (reg.left_str(1) == "M") + if (reg.left_str (1) == "M") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 2 PT, Y_AXIS); - d.translate_axis(staff_space PT, X_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-1); + d.translate_axis (staff_space * 2 PT, Y_AXIS); + d.translate_axis (staff_space PT, X_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-1); } - if (reg.left_str(1) == "E") + if (reg.left_str (1) == "E") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 1.5 PT, Y_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-1); + d.translate_axis (staff_space * 1.5 PT, Y_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-1); } - if (reg.left_str(1) == "S") + if (reg.left_str (1) == "S") { Molecule d = fm->find_by_name ("accordion-accDot"); - d.translate_axis(staff_space * 0.5 PT, Y_AXIS); - m.add_molecule(d); - reg = reg.right_str(reg.length_i()-1); + d.translate_axis (staff_space * 0.5 PT, Y_AXIS); + m.add_molecule (d); + reg = reg.right_str (reg.length_i ()-1); } } /* ugh maybe try to use regular font for S.B. and B.B and only use one font @@ -335,22 +335,22 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm) else if (sym == "SB") { Molecule r = fm->find_by_name ("accordion-accSB"); - m.add_molecule(r); + m.add_molecule (r); } else if (sym == "BB") { Molecule r = fm->find_by_name ("accordion-accBB"); - m.add_molecule(r); + m.add_molecule (r); } else if (sym == "OldEE") { Molecule r = fm->find_by_name ("accordion-accOldEE"); - m.add_molecule(r); + m.add_molecule (r); } else if (sym == "OldEES") { Molecule r = fm->find_by_name ("accordion-accOldEES"); - m.add_molecule(r); + m.add_molecule (r); } return m; } diff --git a/lily/lyric-combine-music-iterator.cc b/lily/lyric-combine-music-iterator.cc index 139dcc4290..3d9eecc7e0 100644 --- a/lily/lyric-combine-music-iterator.cc +++ b/lily/lyric-combine-music-iterator.cc @@ -116,4 +116,4 @@ Lyric_combine_music_iterator::try_music_in_children (Music *m) const } -IMPLEMENT_CTOR_CALLBACK(Lyric_combine_music_iterator); +IMPLEMENT_CTOR_CALLBACK (Lyric_combine_music_iterator); diff --git a/lily/lyric-combine-music.cc b/lily/lyric-combine-music.cc index 8f7770ecf9..de706373bd 100644 --- a/lily/lyric-combine-music.cc +++ b/lily/lyric-combine-music.cc @@ -34,7 +34,7 @@ Lyric_combine_music::length_mom () const } Pitch -Lyric_combine_music::to_relative_octave ( Pitch p ) +Lyric_combine_music::to_relative_octave (Pitch p) { p = music_l ()->to_relative_octave (p); return lyrics_l () ->to_relative_octave (p); @@ -57,3 +57,10 @@ Lyric_combine_music::lyrics_l () const { return unsmob_music (get_mus_property ("lyrics")); } + +Lyric_combine_music::Lyric_combine_music () + : Music (SCM_EOL) +{ +} + +ADD_MUSIC (Lyric_combine_music); diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index 439d9602de..929ebf8191 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -21,7 +21,7 @@ class Lyric_engraver : public Engraver { protected: - virtual void stop_translation_timestep(); + virtual void stop_translation_timestep (); virtual bool try_music (Music *); virtual void create_grobs (); virtual void start_translation_timestep (); @@ -38,7 +38,7 @@ private: ADD_THIS_TRANSLATOR (Lyric_engraver); -Lyric_engraver::Lyric_engraver() +Lyric_engraver::Lyric_engraver () { text_p_ =0; req_l_ =0; @@ -70,7 +70,7 @@ Lyric_engraver::create_grobs () We can't reach the notehead where we're centered from here. So we kludge. - (UGH UGH, pulled amount of space out of thin air) + (UGH UGH, pulled amount of space out of thin air) */ text_p_->translate_axis (0.66, X_AXIS); @@ -81,7 +81,7 @@ Lyric_engraver::create_grobs () } void -Lyric_engraver::stop_translation_timestep() +Lyric_engraver::stop_translation_timestep () { if (text_p_) { diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc index 0cbce00123..57d790618f 100644 --- a/lily/lyric-extender.cc +++ b/lily/lyric-extender.cc @@ -16,7 +16,7 @@ #include "lyric-extender.hh" -MAKE_SCHEME_CALLBACK(Lyric_extender,brew_molecule,1) +MAKE_SCHEME_CALLBACK (Lyric_extender,brew_molecule,1) SCM Lyric_extender::brew_molecule (SCM smob) { @@ -28,7 +28,7 @@ Lyric_extender::brew_molecule (SCM smob) Real sl = sp->paper_l ()->get_var ("stafflinethickness"); Real righttrim = 0.5; // default to half a space gap on the right - SCM righttrim_scm = sp->get_grob_property("right-trim-amount"); + SCM righttrim_scm = sp->get_grob_property ("right-trim-amount"); if (gh_number_p (righttrim_scm)) { righttrim = gh_scm2double (righttrim_scm); } @@ -40,10 +40,10 @@ Lyric_extender::brew_molecule (SCM smob) } Real w = sp->spanner_length () - leftext - righttrim; - Real h = sl * gh_scm2double (sp->get_grob_property ("height")); - Molecule mol (Lookup::filledbox ( Box (Interval (0,w), Interval (0,h)))); + Real h = sl * gh_scm2double (sp->get_grob_property ("height")); + Molecule mol (Lookup::filledbox (Box (Interval (0,w), Interval (0,h)))); mol.translate (Offset (leftext, 0)); - return mol.smobbed_copy(); + return mol.smobbed_copy (); } void diff --git a/lily/lyric-performer.cc b/lily/lyric-performer.cc index 28551a700b..db78f744fe 100644 --- a/lily/lyric-performer.cc +++ b/lily/lyric-performer.cc @@ -14,7 +14,7 @@ class Lyric_performer : public Performer { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Lyric_performer (); protected: @@ -49,7 +49,7 @@ Lyric_performer::create_audio_elements () Audio_element_info info (audio_p_, lreq_arr_[0]); announce_element (info); } - lreq_arr_.clear(); + lreq_arr_.clear (); } void @@ -60,7 +60,7 @@ Lyric_performer::stop_translation_timestep () play_element (audio_p_); audio_p_ = 0; } - lreq_arr_.clear(); + lreq_arr_.clear (); } bool diff --git a/lily/lyric-phrasing-engraver.cc b/lily/lyric-phrasing-engraver.cc index a40c6149db..e24f7642c3 100644 --- a/lily/lyric-phrasing-engraver.cc +++ b/lily/lyric-phrasing-engraver.cc @@ -13,8 +13,8 @@ #include "spanner.hh" -String get_context_id(Translator_group * ancestor, const char * type); -String trim_suffix(String &id); +String get_context_id (Translator_group * ancestor, const char * type); +String trim_suffix (String &id); ADD_THIS_TRANSLATOR (Lyric_phrasing_engraver); @@ -60,13 +60,13 @@ ADD_THIS_TRANSLATOR (Lyric_phrasing_engraver); unnecessarily convoluted. */ -Lyric_phrasing_engraver::Lyric_phrasing_engraver() +Lyric_phrasing_engraver::Lyric_phrasing_engraver () { voice_alist_ = SCM_EOL; any_notehead_l_ = 0; } -Lyric_phrasing_engraver::~Lyric_phrasing_engraver() +Lyric_phrasing_engraver::~Lyric_phrasing_engraver () { /* No need to delete alist_; that's what Garbage collection is for. @@ -85,87 +85,87 @@ Lyric_phrasing_engraver::finalize () Syllable_group * -Lyric_phrasing_engraver::lookup_context_id(const String &context_id) +Lyric_phrasing_engraver::lookup_context_id (const String &context_id) { - SCM key = ly_str02scm(context_id.ch_C()); - if( ! gh_null_p(voice_alist_) ) { - SCM s = scm_assoc(key, voice_alist_); - if(! (gh_boolean_p(s) && !to_boolean(s))) { + SCM key = ly_str02scm (context_id.ch_C ()); + if (! gh_null_p (voice_alist_)) { + SCM s = scm_assoc (key, voice_alist_); + if (! (gh_boolean_p (s) && !to_boolean (s))) { /* match found */ - // ( key . ( (alist_entry . old_entry) . previous_entry) ) - if(to_boolean(gh_cdadr(s))) { // it's an old entry ... make it a new one - SCM val = gh_cons(gh_cons(gh_caadr(s), SCM_BOOL_F), gh_cddr(s)); - voice_alist_ = scm_assoc_set_x(voice_alist_, gh_car(s), val); - return unsmob_voice_entry (gh_caar(val)); + // (key . ((alist_entry . old_entry) . previous_entry)) + if (to_boolean (gh_cdadr (s))) { // it's an old entry ... make it a new one + SCM val = gh_cons (gh_cons (gh_caadr (s), SCM_BOOL_F), gh_cddr (s)); + voice_alist_ = scm_assoc_set_x (voice_alist_, gh_car (s), val); + return unsmob_voice_entry (gh_caar (val)); } else { // the entry is current ... return it. - SCM entry_scm = gh_caadr(s); - return unsmob_voice_entry(entry_scm); + SCM entry_scm = gh_caadr (s); + return unsmob_voice_entry (entry_scm); } } } - // ( ( alist_entry . old_entry ) . previous_entry ) - SCM val = gh_cons(gh_cons(Syllable_group::make_entry (), SCM_BOOL_F), + // ((alist_entry . old_entry) . previous_entry) + SCM val = gh_cons (gh_cons (Syllable_group::make_entry (), SCM_BOOL_F), Syllable_group::make_entry ()); - voice_alist_ = scm_acons(key, val, voice_alist_); - return unsmob_voice_entry (gh_caar(val)); + voice_alist_ = scm_acons (key, val, voice_alist_); + return unsmob_voice_entry (gh_caar (val)); } void -Lyric_phrasing_engraver::record_notehead(const String &context_id, +Lyric_phrasing_engraver::record_notehead (const String &context_id, Grob * notehead) { - Syllable_group * v = lookup_context_id(context_id); - v->set_notehead(notehead); - if(!any_notehead_l_) + Syllable_group * v = lookup_context_id (context_id); + v->set_notehead (notehead); + if (!any_notehead_l_) any_notehead_l_ = notehead; } void -Lyric_phrasing_engraver::record_lyric(const String &context_id, Grob * lyric) +Lyric_phrasing_engraver::record_lyric (const String &context_id, Grob * lyric) { - Syllable_group * v = lookup_context_id(context_id); - v->add_lyric(lyric); + Syllable_group * v = lookup_context_id (context_id); + v->add_lyric (lyric); } void -Lyric_phrasing_engraver::record_extender(const String &context_id, Grob * extender) +Lyric_phrasing_engraver::record_extender (const String &context_id, Grob * extender) { - SCM key = ly_str02scm(context_id.ch_C()); - if( ! gh_null_p(voice_alist_) ) { - SCM s = scm_assoc(key, voice_alist_); - if(! (gh_boolean_p(s) && !to_boolean(s))) { + SCM key = ly_str02scm (context_id.ch_C ()); + if (! gh_null_p (voice_alist_)) { + SCM s = scm_assoc (key, voice_alist_); + if (! (gh_boolean_p (s) && !to_boolean (s))) { /* match found */ - // ( key . ( (alist_entry . old_entry) . previous_entry) ) - SCM previous_scm = gh_cddr(s); - if(previous_scm != SCM_EOL) { - Syllable_group * v = unsmob_voice_entry(previous_scm); - v->add_extender(extender); + // (key . ((alist_entry . old_entry) . previous_entry)) + SCM previous_scm = gh_cddr (s); + if (previous_scm != SCM_EOL) { + Syllable_group * v = unsmob_voice_entry (previous_scm); + v->add_extender (extender); } } } } void -Lyric_phrasing_engraver::record_melisma(const String &context_id) +Lyric_phrasing_engraver::record_melisma (const String &context_id) { - Syllable_group * v = lookup_context_id(context_id); - v->set_melisma(); + Syllable_group * v = lookup_context_id (context_id); + v->set_melisma (); } void -Lyric_phrasing_engraver::acknowledge_grob(Grob_info i) +Lyric_phrasing_engraver::acknowledge_grob (Grob_info i) { - SCM p = get_property("automaticPhrasing"); - if(!to_boolean(p)) + SCM p = get_property ("automaticPhrasing"); + if (!to_boolean (p)) return; Grob *h = i.elem_l_; - if (Note_head::has_interface(h)) { + if (Note_head::has_interface (h)) { /* caught a note head ... do something with it */ /* ... but not if it's a grace note ... */ bool grace= to_boolean (i.elem_l_->get_grob_property ("grace")); @@ -175,12 +175,12 @@ Lyric_phrasing_engraver::acknowledge_grob(Grob_info i) return; /* what's its Voice context name? */ - String voice_context_id = get_context_id(i.origin_trans_l_->daddy_trans_l_, "Voice"); - record_notehead(voice_context_id, h); + String voice_context_id = get_context_id (i.origin_trans_l_->daddy_trans_l_, "Voice"); + record_notehead (voice_context_id, h); /* is it in a melisma ? */ - if(to_boolean(i.origin_trans_l_->get_property("melismaEngraverBusy"))) { - record_melisma(voice_context_id); + if (to_boolean (i.origin_trans_l_->get_property ("melismaEngraverBusy"))) { + record_melisma (voice_context_id); } return; } @@ -190,15 +190,15 @@ Lyric_phrasing_engraver::acknowledge_grob(Grob_info i) /* what's its LyricsVoice context name? */ String voice_context_id; - SCM voice_context_scm = i.origin_trans_l_->get_property("associatedVoice"); + SCM voice_context_scm = i.origin_trans_l_->get_property ("associatedVoice"); if (gh_string_p (voice_context_scm)) { - voice_context_id = ly_scm2string(voice_context_scm); + voice_context_id = ly_scm2string (voice_context_scm); } else { - voice_context_id = get_context_id(i.origin_trans_l_->daddy_trans_l_, "LyricsVoice"); - voice_context_id = trim_suffix(voice_context_id); + voice_context_id = get_context_id (i.origin_trans_l_->daddy_trans_l_, "LyricsVoice"); + voice_context_id = trim_suffix (voice_context_id); } - record_lyric(voice_context_id, h); + record_lyric (voice_context_id, h); return; } @@ -215,21 +215,21 @@ Lyric_phrasing_engraver::acknowledge_grob(Grob_info i) then ignore it and let the Extender_engraver take care of it (i.e. finish at next lyric). */ - if(h->has_interface (ly_symbol2scm ("lyric-extender-interface"))) { - String voice_context_id = get_context_id(i.origin_trans_l_->daddy_trans_l_, "LyricsVoice"); - record_extender(trim_suffix(voice_context_id), h); + if (h->has_interface (ly_symbol2scm ("lyric-extender-interface"))) { + String voice_context_id = get_context_id (i.origin_trans_l_->daddy_trans_l_, "LyricsVoice"); + record_extender (trim_suffix (voice_context_id), h); return; } } String -get_context_id(Translator_group * ancestor, const char *type) +get_context_id (Translator_group * ancestor, const char *type) { - while(ancestor != 0 && ancestor->type_str_ != type) { + while (ancestor != 0 && ancestor->type_str_ != type) { ancestor = ancestor->daddy_trans_l_; } - if(ancestor != 0) { + if (ancestor != 0) { return ancestor->id_str_; } @@ -237,11 +237,11 @@ get_context_id(Translator_group * ancestor, const char *type) } String -trim_suffix(String &id) +trim_suffix (String &id) { - int index = id.index_i('-'); - if(index >= 0) { - return id.left_str(index); + int index = id.index_i ('-'); + if (index >= 0) { + return id.left_str (index); } return id; } @@ -250,33 +250,33 @@ trim_suffix(String &id) void Lyric_phrasing_engraver::create_grobs () { /* iterate through entries in voice_alist_ - for each, call set_lyric_align(alignment). Issue a warning if this returns false. + for each, call set_lyric_align (alignment). Issue a warning if this returns false. */ String punc; - SCM sp = get_property("phrasingPunctuation"); - punc = gh_string_p(sp) ? ly_scm2string(sp) : ".,;:?!\""; + SCM sp = get_property ("phrasingPunctuation"); + punc = gh_string_p (sp) ? ly_scm2string (sp) : ".,;:?!\""; - for(SCM v=voice_alist_; gh_pair_p(v); v = gh_cdr(v)) { - SCM v_entry = gh_cdar(v); + for (SCM v=voice_alist_; gh_pair_p (v); v = gh_cdr (v)) { + SCM v_entry = gh_cdar (v); // ((current . oldflag) . previous) - if(!to_boolean(gh_cdar(v_entry))) { // not an old entry left over from a prior note ... - Syllable_group *entry = unsmob_voice_entry(gh_caar(v_entry)); + if (!to_boolean (gh_cdar (v_entry))) { // not an old entry left over from a prior note ... + Syllable_group *entry = unsmob_voice_entry (gh_caar (v_entry)); /* TODO: give context for warning. */ - if(! entry->set_lyric_align(punc.ch_C(), any_notehead_l_)) + if (! entry->set_lyric_align (punc.ch_C (), any_notehead_l_)) warning (_ ("lyrics found without any matching notehead")); // is this note melismatic? If so adjust alignment of previous one. - if(entry->get_melisma()) { - if(entry->lyric_count()) + if (entry->get_melisma ()) { + if (entry->lyric_count ()) warning (_ ("Huh? Melismatic note found to have associated lyrics.")); - SCM previous_scm = gh_cdr(v_entry); - if(previous_scm != SCM_EOL) { - Syllable_group *previous = unsmob_voice_entry(previous_scm); - if (previous->lyric_count()) - previous->adjust_melisma_align(); + SCM previous_scm = gh_cdr (v_entry); + if (previous_scm != SCM_EOL) { + Syllable_group *previous = unsmob_voice_entry (previous_scm); + if (previous->lyric_count ()) + previous->adjust_melisma_align (); } } } @@ -287,20 +287,20 @@ void Lyric_phrasing_engraver::create_grobs () void Lyric_phrasing_engraver::stop_translation_timestep () { - for(SCM v=voice_alist_; gh_pair_p(v); v = gh_cdr(v)) { - SCM entry_scm = gh_cdar(v); + for (SCM v=voice_alist_; gh_pair_p (v); v = gh_cdr (v)) { + SCM entry_scm = gh_cdar (v); // ((alist_entry . entry_is_old) . previous_entry) - Syllable_group * entry = unsmob_voice_entry(gh_caar(entry_scm)); + Syllable_group * entry = unsmob_voice_entry (gh_caar (entry_scm)); // set previous_entry, set entry_is_old, and resave it to alist_ // but only change if this current was not old. - if(! to_boolean(gh_cdar(entry_scm))) { - Syllable_group * previous_entry = unsmob_voice_entry(gh_cdr(entry_scm)); - previous_entry->copy(entry); - entry_scm = gh_cons(gh_cons(gh_caar(entry_scm), SCM_BOOL_T), gh_cdr(entry_scm)); - voice_alist_ = scm_assoc_set_x(voice_alist_, gh_caar(v), entry_scm); + if (! to_boolean (gh_cdar (entry_scm))) { + Syllable_group * previous_entry = unsmob_voice_entry (gh_cdr (entry_scm)); + previous_entry->copy (entry); + entry_scm = gh_cons (gh_cons (gh_caar (entry_scm), SCM_BOOL_T), gh_cdr (entry_scm)); + voice_alist_ = scm_assoc_set_x (voice_alist_, gh_caar (v), entry_scm); } - entry->next_lyric(); + entry->next_lyric (); } any_notehead_l_ = 0; } diff --git a/lily/main.cc b/lily/main.cc index 868dbbd077..7f122864d8 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -117,7 +117,7 @@ static Long_option_init options_static[] = { {0, "safe", 's', _i ("inhibit file output naming and exporting")}, {0, "no-timestamps", 'T', _i ("don't timestamp the output")}, {0, "version", 'v', _i ("print version number")}, - {0, "verbose", 'V', _i("verbose")}, + {0, "verbose", 'V', _i ("verbose")}, {0, "warranty", 'w', _i ("show warranty and copyright")}, {0, "midi-debug", 'X', _i ("write midi ouput in formatted ascii")}, {0,0,0,0} @@ -141,7 +141,7 @@ usage () cout << _ ("Typeset music and or play MIDI from FILE"); cout << "\n\n"; cout << -_( +_ ( "LilyPond is a music typesetter. It produces beautiful sheet music\n" "using a high level description file as input. LilyPond is part of \n" "the GNU Project.\n" @@ -239,10 +239,10 @@ setup_paths () urg; what *do* we want with $LILYPONDPREFIX, DIR_DATADIR and $prefix/share handy for multiple source-dir runs, though... */ - if (!prefix_directory.empty_b()) + if (!prefix_directory.empty_b ()) { lily_locale_dir = prefix_directory + "/share/locale"; - bindtextdomain (name.ch_C (), lily_locale_dir.ch_C()); + bindtextdomain (name.ch_C (), lily_locale_dir.ch_C ()); } else bindtextdomain (name.ch_C (), DIR_LOCALEDIR); @@ -269,7 +269,7 @@ setup_paths () global_path.add (p); #if !KPATHSEA - /* Urg: GNU make's $(word) index starts at 1 */ + /* Urg: GNU make's $ (word) index starts at 1 */ int i = 1; while (global_path.try_add (p + to_str (".") + to_str (i))) i++; @@ -404,8 +404,8 @@ main (int argc, char **argv) ly_init_kpath (argv[0]); - oparser_p_static = new Getopt_long(argc, argv, options_static); - while (Long_option_init const * opt = (*oparser_p_static)()) + oparser_p_static = new Getopt_long (argc, argv, options_static); + while (Long_option_init const * opt = (*oparser_p_static) ()) { switch (opt->shortname_ch_) { @@ -473,7 +473,7 @@ main (int argc, char **argv) #ifdef WINNT gh_enter (argc, argv, main_prog); #else - gh_enter (argc, argv, (void(*)(int, char**))main_prog); + gh_enter (argc, argv, (void (*) (int, char**))main_prog); #endif return 0; // unreachable diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index b860caba17..f0abdbc711 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1998--2001 Jan Nieuwenhuizen + (c) 1998--2001 Jan Nieuwenhuizen */ #include @@ -28,7 +28,7 @@ class Mark_engraver : public Engraver { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Mark_engraver (); protected: Item* text_p_; @@ -36,7 +36,7 @@ protected: protected: virtual void stop_translation_timestep (); virtual void acknowledge_grob (Grob_info); - void create_items(Request*); + void create_items (Request*); virtual bool try_music (Music *req_l); virtual void start_translation_timestep (); virtual void initialize (); @@ -90,7 +90,7 @@ Mark_engraver::stop_translation_timestep () { if (text_p_) { - text_p_->set_grob_property("side-support-elements" , get_property ("staffsFound")); + text_p_->set_grob_property ("side-support-elements" , get_property ("staffsFound")); typeset_grob (text_p_); text_p_ =0; } @@ -180,7 +180,7 @@ Mark_engraver::process_music () c++; next = to_str (c); } - m = ly_str02scm (next.ch_C()); + m = ly_str02scm (next.ch_C ()); } else { @@ -190,18 +190,18 @@ Mark_engraver::process_music () daddy_trans_l_->set_property ("rehearsalMark", m); text_p_->set_grob_property ("text", - ly_str02scm ( t.ch_C())); + ly_str02scm (t.ch_C ())); String style = "mark"; - for (int i=0; i < t.length_i(); i++) + for (int i=0; i < t.length_i (); i++) { - if (!isdigit(t[i])) + if (!isdigit (t[i])) { style = "large"; break; } } - SCM st = ly_symbol2scm (style.ch_C()); + SCM st = ly_symbol2scm (style.ch_C ()); text_p_->set_grob_property ("font-style", st); } diff --git a/lily/melisma-engraver.cc b/lily/melisma-engraver.cc index 98deeaca3f..83f0773876 100644 --- a/lily/melisma-engraver.cc +++ b/lily/melisma-engraver.cc @@ -18,31 +18,31 @@ class Melisma_engraver:public Engraver { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); bool try_music (Music *); }; -ADD_THIS_TRANSLATOR(Melisma_engraver); +ADD_THIS_TRANSLATOR (Melisma_engraver); bool -Melisma_engraver::try_music (Music *m ) +Melisma_engraver::try_music (Music *m) { - if (dynamic_cast(m)) + if (dynamic_cast (m)) { SCM plain (get_property ("melismaBusy")); SCM slur (get_property ("slurMelismaBusy")); SCM tie (get_property ("tieMelismaBusy")); SCM beam (get_property ("beamMelismaBusy")); - if( (to_boolean (plain)) + if ((to_boolean (plain)) || (to_boolean (slur)) || (to_boolean (tie)) || (to_boolean (beam))) { - daddy_trans_l_->set_property("melismaEngraverBusy",SCM_BOOL_T); + daddy_trans_l_->set_property ("melismaEngraverBusy",SCM_BOOL_T); return true; } } - daddy_trans_l_->set_property("melismaEngraverBusy",SCM_BOOL_F); + daddy_trans_l_->set_property ("melismaEngraverBusy",SCM_BOOL_F); return false; } diff --git a/lily/midi-def.cc b/lily/midi-def.cc index db149af33b..20174ca73f 100644 --- a/lily/midi-def.cc +++ b/lily/midi-def.cc @@ -13,7 +13,7 @@ #include "debug.hh" #include "scope.hh" -Midi_def::Midi_def() +Midi_def::Midi_def () { // ugh set_tempo (Moment (1, 4), 60); @@ -23,7 +23,7 @@ int Midi_def::get_tempo_i (Moment one_beat_mom) { Moment w = *unsmob_moment (scope_p_->scm_elem ("whole-in-seconds")); - Moment wholes_per_min = Moment(60) /w; + Moment wholes_per_min = Moment (60) /w; int beats_per_min = wholes_per_min / one_beat_mom; return int (beats_per_min); } @@ -33,8 +33,8 @@ Midi_def::set_tempo (Moment one_beat_mom, int beats_per_minute_i) { Moment beats_per_second = Moment (beats_per_minute_i) / Moment (60); - Moment m = Moment(1)/Moment(beats_per_second * one_beat_mom); - scope_p_->set ("whole-in-seconds", m.smobbed_copy()); + Moment m = Moment (1)/Moment (beats_per_second * one_beat_mom); + scope_p_->set ("whole-in-seconds", m.smobbed_copy ()); } diff --git a/lily/midi-item.cc b/lily/midi-item.cc index e4cc8262f4..7b54010474 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -330,7 +330,7 @@ String Midi_item::i2varint_str (int i) { int buffer_i = i & 0x7f; - while ( (i >>= 7) > 0) + while ((i >>= 7) > 0) { buffer_i <<= 8; buffer_i |= 0x80; @@ -472,7 +472,7 @@ Midi_dynamic::str () const */ static Real const full_scale = 127; - int volume = (int)(audio_l_->volume_*full_scale); + int volume = (int) (audio_l_->volume_*full_scale); if (volume <= 0) volume = 1; if (volume > full_scale) @@ -501,7 +501,7 @@ Midi_piano_pedal::str () const else if (audio_l_->type_str_ == "UnaChorda") str += to_str ((char)0x43); - int pedal = ((1 - audio_l_->dir_) / 2 ) * 0x7f; + int pedal = ((1 - audio_l_->dir_) / 2) * 0x7f; str += to_str ((char)pedal); return str; } diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc index 986a58ebdb..8be7056b36 100644 --- a/lily/midi-walker.cc +++ b/lily/midi-walker.cc @@ -15,7 +15,7 @@ #include "midi-stream.hh" #include "debug.hh" -Midi_note_event::Midi_note_event() +Midi_note_event::Midi_note_event () { ignore_b_ = false; } @@ -34,7 +34,7 @@ Midi_walker::Midi_walker (Audio_staff* audio_staff_l, Midi_track* track_l) last_mom_ = 0; } -Midi_walker::~Midi_walker() +Midi_walker::~Midi_walker () { // ugh do_stop_notes (last_mom_ + Moment (10, 1)); @@ -50,10 +50,10 @@ Midi_walker::do_start_note (Midi_note* note_p) Moment stop_mom = note_p->length_mom () + ptr->audio_column_l_->at_mom (); bool play_start = true; - for (int i=0; i < stop_note_queue.size(); i++) + for (int i=0; i < stop_note_queue.size (); i++) { /* if this pith already in queue */ - if (stop_note_queue[i].val->pitch_i() == note_p->pitch_i ()) + if (stop_note_queue[i].val->pitch_i () == note_p->pitch_i ()) { if (stop_note_queue[i].key < stop_mom) { @@ -93,9 +93,9 @@ Midi_walker::do_start_note (Midi_note* note_p) void Midi_walker::do_stop_notes (Moment max_mom) { - while (stop_note_queue.size() && stop_note_queue.front ().key <= max_mom) + while (stop_note_queue.size () && stop_note_queue.front ().key <= max_mom) { - Midi_note_event e = stop_note_queue.get(); + Midi_note_event e = stop_note_queue.get (); if (e.ignore_b_) { delete e.val; @@ -121,7 +121,7 @@ Midi_walker::output_event (Moment now_mom, Midi_item* l) } void -Midi_walker::process() +Midi_walker::process () { Audio_item* audio_p = (*item_l_arr_l_)[index_]; do_stop_notes (audio_p->audio_column_l_->at_mom ()); @@ -133,7 +133,7 @@ Midi_walker::process() if (Midi_item* midi_p = Midi_item::midi_p (audio_p)) { midi_p->channel_i_ = track_l_->number_i_; - if (Midi_note* note_p = dynamic_cast(midi_p)) + if (Midi_note* note_p = dynamic_cast (midi_p)) { if (note_p->length_mom ()) do_start_note (note_p); @@ -150,8 +150,8 @@ Midi_walker::ok () const } void -Midi_walker::operator ++(int) +Midi_walker::operator ++ (int) { - assert (ok()); + assert (ok ()); index_++; } diff --git a/lily/misc.cc b/lily/misc.cc index 1672a08787..45a055f8a6 100644 --- a/lily/misc.cc +++ b/lily/misc.cc @@ -14,7 +14,7 @@ Return the 2-log, rounded down */ int -intlog2(int d) +intlog2 (int d) { assert (d); int i=0; @@ -24,12 +24,12 @@ intlog2(int d) i++; } - assert (!(d/2)); + assert (! (d/2)); return i; } double -log_2(double x) +log_2 (double x) { return log (x) /log (2.0); } @@ -48,7 +48,7 @@ quantise_iv (Array positions, Real x) Real period = positions.top () - positions[0]; int n = int ((x - positions[0]) / period); - Real frac = (x - positions[0] ) - n * period; + Real frac = (x - positions[0]) - n * period; while (frac < 0) { @@ -57,7 +57,7 @@ quantise_iv (Array positions, Real x) } Real px = frac + positions[0]; - assert ( positions[0] <= px && px <= positions.top ()); + assert (positions[0] <= px && px <= positions.top ()); int i=0; for (; i < positions.size () - 1; i++) { diff --git a/lily/molecule.cc b/lily/molecule.cc index da4ef0cfcb..9ea0eb0a6a 100644 --- a/lily/molecule.cc +++ b/lily/molecule.cc @@ -23,13 +23,13 @@ SCM Molecule::smobbed_copy () const { - Molecule * m = new Molecule(*this); + Molecule * m = new Molecule (*this); return m->smobbed_self (); } Interval -Molecule::extent(Axis a) const +Molecule::extent (Axis a) const { return dim_[a]; } @@ -40,7 +40,7 @@ Molecule::Molecule (Box b, SCM func) dim_ = b; } -Molecule::Molecule() +Molecule::Molecule () { expr_ = SCM_EOL; set_empty (true); @@ -52,7 +52,7 @@ Molecule::translate (Offset o) Axis a = X_AXIS; while (a < NO_AXES) { - if (abs(o[a]) > 30 CM + if (abs (o[a]) > 30 CM || isinf (o[a]) || isnan (o[a])) { programming_error ("Improbable offset for translation: setting to zero"); @@ -72,7 +72,7 @@ Molecule::translate (Offset o) void Molecule::translate_axis (Real x,Axis a) { - Offset o(0,0); + Offset o (0,0); o[a] = x; translate (o); } @@ -98,7 +98,7 @@ Molecule::set_empty (bool e) } else { - dim_[X_AXIS] = Interval(0,0); + dim_[X_AXIS] = Interval (0,0); dim_[Y_AXIS] = Interval (0,0); } } @@ -108,7 +108,7 @@ void Molecule::align_to (Axis a, Direction d) { Interval i (extent (a)); - Real r = (d == CENTER) ? i.center () : i[d]; + Real r = (d == CENTER) ? i.center () : i[d]; translate_axis (-r, a); } @@ -154,7 +154,7 @@ Molecule::ly_set_molecule_extent_x (SCM mol, SCM axis, SCM np) if (m && axis_p (axis) && number_pair_p (np)) { Interval iv = ly_scm2interval (np); - m->dim_[Axis(gh_scm2int (axis))] = ly_scm2interval (np); + m->dim_[Axis (gh_scm2int (axis))] = ly_scm2interval (np); } else warning ("ly-set-molecule-extent!: invalid arguments"); @@ -208,7 +208,7 @@ molecule_init () scm_make_gsubr ("ly-set-molecule-extent!", 3 , 0, 0, (Scheme_function_unknown) Molecule::ly_set_molecule_extent_x); scm_make_gsubr ("ly-get-molecule-extent", 2 , 0, 0, (Scheme_function_unknown) Molecule::ly_get_molecule_extent); } -ADD_SCM_INIT_FUNC(molecule,molecule_init); +ADD_SCM_INIT_FUNC (molecule,molecule_init); bool @@ -218,7 +218,7 @@ Molecule::empty_b () const } SCM -fontify_atom(Font_metric * met, SCM f) +fontify_atom (Font_metric * met, SCM f) { if (f == SCM_EOL) return f; @@ -240,7 +240,7 @@ Molecule::extent_box () const { return dim_; } -IMPLEMENT_SIMPLE_SMOBS(Molecule); +IMPLEMENT_SIMPLE_SMOBS (Molecule); int @@ -249,8 +249,8 @@ Molecule::print_smob (SCM s, SCM port, scm_print_state *) Molecule *r = (Molecule *) gh_cdr (s); scm_puts ("#str()); - scm_puts ((char *)str.ch_C(), port);*/ + /* String str (r->str ()); + scm_puts ((char *)str.ch_C (), port);*/ scm_puts (" >", port); return 1; @@ -265,6 +265,6 @@ Molecule::mark_smob (SCM s) return r->expr_; } -IMPLEMENT_TYPE_P(Molecule, "molecule?"); -IMPLEMENT_DEFAULT_EQUAL_P(Molecule); -IMPLEMENT_UNSMOB(Molecule, molecule); +IMPLEMENT_TYPE_P (Molecule, "molecule?"); +IMPLEMENT_DEFAULT_EQUAL_P (Molecule); +IMPLEMENT_UNSMOB (Molecule, molecule); diff --git a/lily/moment.cc b/lily/moment.cc index c2e84fa314..a1c9e071ec 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -13,8 +13,8 @@ #include "warn.hh" #include "ly-smobs.icc" -IMPLEMENT_UNSMOB(Moment,moment); -IMPLEMENT_SIMPLE_SMOBS(Moment); +IMPLEMENT_UNSMOB (Moment,moment); +IMPLEMENT_SIMPLE_SMOBS (Moment); IMPLEMENT_TYPE_P (Moment, "moment?"); SCM @@ -28,7 +28,7 @@ SCM Moment::smobbed_copy () const { Moment * m = new Moment (*this); - return m->smobbed_self(); + return m->smobbed_self (); } @@ -38,8 +38,8 @@ Moment::print_smob (SCM s, SCM port, scm_print_state *) Moment *r = (Moment *) gh_cdr (s); scm_puts ("#str()); - scm_puts ((char *)str.ch_C(), port); + String str (r->str ()); + scm_puts ((char *)str.ch_C (), port); scm_puts (" >", port); return 1; @@ -53,7 +53,7 @@ make_rational (SCM n, SCM d) { Moment m (1,1); - if (SCM_INUMP (n) && SCM_INUMP(d)) + if (SCM_INUMP (n) && SCM_INUMP (d)) { m = Moment (gh_scm2int (n), gh_scm2int (d)); } @@ -72,7 +72,7 @@ init_moments () scm_make_gsubr ("make-moment", 2 , 0, 0, (Scheme_function_unknown) make_rational); } -ADD_SCM_INIT_FUNC(moms,init_moments); +ADD_SCM_INIT_FUNC (moms,init_moments); SCM Moment::equal_p (SCM a, SCM b) diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index 369f42dcd1..f207171f96 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -25,7 +25,7 @@ work at Voice level. Not a problem in practice, but aesthetically pleasing? class Multi_measure_rest_engraver : public Engraver { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Multi_measure_rest_engraver (); protected: @@ -79,11 +79,11 @@ Multi_measure_rest_engraver::try_music (Music* req_l) if (scm_equal_p (sp->get_mus_property ("span-type"), ly_str02scm ("rest")) == SCM_BOOL_T) { - if (sp->get_span_dir() == STOP) + if (sp->get_span_dir () == STOP) { stop_req_l_ = sp; } - else if (sp->get_span_dir() == START && !new_req_l_) + else if (sp->get_span_dir () == START && !new_req_l_) { new_req_l_ = sp; } @@ -137,7 +137,7 @@ void Multi_measure_rest_engraver::stop_translation_timestep () { SCM smp = get_property ("measurePosition"); - Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); + Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); if (mmrest_p_ && (now_mom () >= start_moment_) && !mp @@ -166,7 +166,7 @@ void Multi_measure_rest_engraver::start_translation_timestep () { SCM smp = get_property ("measurePosition"); - Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); + Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); if (mmrest_p_ && !mp) { diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 2138a3de0e..8b0f8dd5dd 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -32,11 +32,56 @@ Multi_measure_rest::has_interface (Grob*me) return me->has_interface (ly_symbol2scm ("multi-measure-rest-interface")); } +MAKE_SCHEME_CALLBACK (Multi_measure_rest,percent,1); +SCM +Multi_measure_rest::percent (SCM smob) +{ + Grob *me = unsmob_grob (smob); + Spanner *sp = dynamic_cast (me); + + Font_metric *musfont = Font_interface::get_default_font (me); + + Molecule r (musfont->find_by_name ("scripts-repeatsign")); + + // ugh copy & paste. + + Interval sp_iv; + Direction d = LEFT; + do + { + Item * col = sp->get_bound (d)->column_l (); + + Interval coldim = col->extent (0, X_AXIS); + + sp_iv[d] = coldim[-d] ; + } + while ((flip (&d)) != LEFT); + Real x_off = 0.0; + + Real rx = sp->get_bound (LEFT)->relative_coordinate (0, X_AXIS); /* + we gotta stay clear of sp_iv, so move a bit to the right if + needed. + */ + x_off += (sp_iv[LEFT] - rx) >? 0; + + /* + center between stuff. + */ + x_off += sp_iv.length ()/ 2; + + r.translate_axis (x_off,X_AXIS); + + + return r.smobbed_copy (); +} + + +/* [TODO] 17 - * variable-sized multi-measure rest symbol: |====| ?? + variable-sized multi-measure rest symbol: |====| ?? */ -MAKE_SCHEME_CALLBACK(Multi_measure_rest,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Multi_measure_rest,brew_molecule,1); SCM Multi_measure_rest::brew_molecule (SCM smob) { @@ -140,7 +185,7 @@ Multi_measure_rest::brew_molecule (SCM smob) } else { - String idx = ("rests-") + to_str (-4); + String idx = ("rests-") + to_str (-4); s = musfont->find_by_name (idx); } @@ -156,7 +201,7 @@ Multi_measure_rest::brew_molecule (SCM smob) mol.add_molecule (s); } mol.translate_axis (x_off, X_AXIS); - return mol.smobbed_copy(); + return mol.smobbed_copy (); } /* @@ -179,7 +224,7 @@ Multi_measure_rest::set_spacing_rods (SCM smob) Grob*me = unsmob_grob (smob); Spanner*sp = dynamic_cast (me); - if (!(sp->get_bound (LEFT) && sp->get_bound (RIGHT))) + if (! (sp->get_bound (LEFT) && sp->get_bound (RIGHT))) { programming_error ("Multi_measure_rest::get_rods (): I am not spanned!"); return SCM_UNSPECIFIED; diff --git a/lily/music-constructor.cc b/lily/music-constructor.cc new file mode 100644 index 0000000000..bd14326605 --- /dev/null +++ b/lily/music-constructor.cc @@ -0,0 +1,40 @@ +/* + music-constructor.cc -- implement Music_constructor + + source file of the GNU LilyPond music typesetter + + (c) 2001 Han-Wen Nienhuys + + */ + +#include // UGH. +#include "music-constructor.hh" +typedef Music* (*Music_ctor) (); + +static map *ctors_map_; + +void +add_music_ctor (String s, Music_ctor c) +{ + if (!ctors_map_) + ctors_map_ = new map; + + (*ctors_map_)[s] = c; +} + + +Music_ctor +get_music_ctor (String s) +{ + if (ctors_map_->find (s) == ctors_map_->end ()) + return 0; + + return (* ctors_map_)[s]; +} + +Music* +get_music (String s) +{ + return (*get_music_ctor (s)) (); +} + diff --git a/lily/music-ctor.cc b/lily/music-ctor.cc new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/lily/music-ctor.cc @@ -0,0 +1 @@ + diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index 1841c9d182..7d5a5155be 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -72,7 +72,7 @@ Music_iterator::ok () const } void -Music_iterator::skip (Moment ) +Music_iterator::skip (Moment) { } @@ -109,7 +109,7 @@ Music_iterator::static_get_iterator_p (Music *m) Moment -Music_iterator::music_length_mom() const +Music_iterator::music_length_mom () const { return music_length_; } @@ -155,7 +155,7 @@ Music_iterator::get_iterator_p (Music *m) const Music_iterator* Music_iterator::try_music (Music *m) const { - bool b = report_to_l ()->try_music ( (Music*)m); // ugh + bool b = report_to_l ()->try_music ((Music*)m); // ugh Music_iterator * it = b ? (Music_iterator*) this : 0; // ugh if (!it) it = try_music_in_children (m); @@ -168,4 +168,4 @@ Music_iterator::try_music_in_children (Music *) const return 0; } -IMPLEMENT_CTOR_CALLBACK(Music_iterator); +IMPLEMENT_CTOR_CALLBACK (Music_iterator); diff --git a/lily/music-list.cc b/lily/music-list.cc index f11985ca72..e3e188e9e2 100644 --- a/lily/music-list.cc +++ b/lily/music-list.cc @@ -24,19 +24,33 @@ Simultaneous_music::length_mom () const return maximum_length (); } -Simultaneous_music::Simultaneous_music(SCM head) +Simultaneous_music::Simultaneous_music (SCM head) : Music_sequence (head) { set_mus_property ("iterator-ctor", Simultaneous_music_iterator::constructor_cxx_function); } -Sequential_music::Sequential_music(SCM head) +Simultaneous_music::Simultaneous_music () + : Music_sequence () +{ + set_mus_property ("iterator-ctor", + Simultaneous_music_iterator::constructor_cxx_function); + +} + +Sequential_music::Sequential_music (SCM head) : Music_sequence (head) { set_mus_property ("iterator-ctor", Sequential_music_iterator::constructor_cxx_function); } +Sequential_music::Sequential_music () + : Music_sequence () +{ + set_mus_property ("iterator-ctor", + Sequential_music_iterator::constructor_cxx_function); +} Moment @@ -51,13 +65,19 @@ Simultaneous_music::to_relative_octave (Pitch p) return do_relative_octave (p, true); } -Request_chord::Request_chord(SCM s) +Request_chord::Request_chord (SCM s) : Simultaneous_music (s) { set_mus_property ("iterator-ctor", Request_chord_iterator::constructor_cxx_function); } +Request_chord::Request_chord () +{ + set_mus_property ("iterator-ctor", + Request_chord_iterator::constructor_cxx_function); +} + Pitch Request_chord::to_relative_octave (Pitch last) { @@ -69,7 +89,7 @@ Request_chord::to_relative_octave (Pitch last) Pitch pit = *unsmob_pitch (m->get_mus_property ("pitch")); pit.to_relative_octave (last); - m->set_mus_property ("pitch", pit.smobbed_copy()); + m->set_mus_property ("pitch", pit.smobbed_copy ()); return pit; } @@ -79,3 +99,6 @@ Request_chord::to_relative_octave (Pitch last) +ADD_MUSIC (Simultaneous_music); +ADD_MUSIC (Sequential_music); +ADD_MUSIC (Request_chord); diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index 395b7589d3..eb58cec14c 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -65,17 +65,17 @@ Music_output_def::Music_output_def (Music_output_def const &s) } -IMPLEMENT_SMOBS(Music_output_def); -IMPLEMENT_UNSMOB(Music_output_def,music_output_def); -IMPLEMENT_DEFAULT_EQUAL_P(Music_output_def); +IMPLEMENT_SMOBS (Music_output_def); +IMPLEMENT_UNSMOB (Music_output_def,music_output_def); +IMPLEMENT_DEFAULT_EQUAL_P (Music_output_def); SCM Music_output_def::mark_smob (SCM m) { Music_output_def * mo = (Music_output_def*) SCM_CELL_WORD_1 (m); scm_gc_mark (mo->style_sheet_); - scm_gc_mark (mo->translator_tab_->self_scm()); - scm_gc_mark (mo->variable_tab_->self_scm()); + scm_gc_mark (mo->translator_tab_->self_scm ()); + scm_gc_mark (mo->variable_tab_->self_scm ()); return mo->scaled_fonts_; } diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index 2ef13f02f7..5be315fcd1 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -47,11 +47,11 @@ void Music_sequence::append_music (Music *m) { set_mus_property ("elements", - gh_append2( music_list(), gh_cons (m->self_scm (), SCM_EOL))); + gh_append2 (music_list (), gh_cons (m->self_scm (), SCM_EOL))); scm_unprotect_object (m->self_scm ()); } -Music_sequence::Music_sequence(SCM l) +Music_sequence::Music_sequence (SCM l) : Music (l) { } @@ -107,7 +107,7 @@ Music_sequence::do_relative_octave (Pitch p, bool ret_first) for (SCM s = music_list (); gh_pair_p (s); s = gh_cdr (s)) { last = unsmob_music (gh_car (s))->to_relative_octave (last); - if (!count ++ ) + if (!count ++) retval = last; } @@ -123,3 +123,11 @@ Music_sequence::compress (Moment m) for (SCM s = music_list (); gh_pair_p (s); s = gh_cdr (s)) unsmob_music (gh_car (s))->compress (m); } + +ADD_MUSIC (Music_sequence); + +Music_sequence::Music_sequence () + : Music (SCM_EOL) +{ + +} diff --git a/lily/music-wrapper-iterator.cc b/lily/music-wrapper-iterator.cc index 32c1962891..a80577f387 100644 --- a/lily/music-wrapper-iterator.cc +++ b/lily/music-wrapper-iterator.cc @@ -81,4 +81,4 @@ Music_wrapper_iterator::try_music_in_children (Music *m) const return child_iter_p_->try_music (m); } -IMPLEMENT_CTOR_CALLBACK(Music_wrapper_iterator); +IMPLEMENT_CTOR_CALLBACK (Music_wrapper_iterator); diff --git a/lily/music-wrapper.cc b/lily/music-wrapper.cc index 72c161d487..3fc8d714c3 100644 --- a/lily/music-wrapper.cc +++ b/lily/music-wrapper.cc @@ -21,7 +21,7 @@ Music_wrapper::transpose (Pitch p) } -Music_wrapper::Music_wrapper(SCM l) +Music_wrapper::Music_wrapper (SCM l) : Music (l) { } @@ -50,3 +50,11 @@ Music_wrapper::compress (Moment m) { element ()->compress (m); } + +ADD_MUSIC (Music_wrapper); + +Music_wrapper::Music_wrapper () + : Music (SCM_EOL) +{ + +} diff --git a/lily/music.cc b/lily/music.cc index e3272b1989..64044b1f5a 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -43,7 +43,7 @@ Music::Music (Music const &m) } -Music::Music(SCM l) +Music::Music (SCM l) { immutable_property_alist_ = l; mutable_property_alist_ = SCM_EOL; @@ -53,7 +53,7 @@ Music::Music(SCM l) SCM Music::mark_smob (SCM m) { - Music * mus = (Music *)SCM_CELL_WORD_1(m); + Music * mus = (Music *)SCM_CELL_WORD_1 (m); scm_gc_mark (mus->immutable_property_alist_); scm_gc_mark (mus->mutable_property_alist_); return SCM_EOL; @@ -71,11 +71,11 @@ Music::length_mom () const { SCM l = get_mus_property ("length"); if (unsmob_moment (l)) - return *unsmob_moment(l); + return *unsmob_moment (l); else if (gh_procedure_p (l)) { - SCM res = gh_call1(l, self_scm( )); - return *unsmob_moment(res); + SCM res = gh_call1 (l, self_scm ()); + return *unsmob_moment (res); } return 0; @@ -94,11 +94,11 @@ print_alist (SCM a, SCM port) } int -Music::print_smob(SCM s, SCM p, scm_print_state*) +Music::print_smob (SCM s, SCM p, scm_print_state*) { scm_puts ("#mutable_property_alist_, p); print_alist (m->immutable_property_alist_, p); @@ -115,14 +115,14 @@ Music::to_relative_octave (Pitch m) void -Music::transpose (Pitch ) +Music::transpose (Pitch) { } -IMPLEMENT_TYPE_P(Music, "music?"); -IMPLEMENT_UNSMOB(Music,music); -IMPLEMENT_SMOBS(Music); -IMPLEMENT_DEFAULT_EQUAL_P(Music); +IMPLEMENT_TYPE_P (Music, "music?"); +IMPLEMENT_UNSMOB (Music,music); +IMPLEMENT_SMOBS (Music); +IMPLEMENT_DEFAULT_EQUAL_P (Music); /****************************/ @@ -136,7 +136,7 @@ Music::get_mus_property (const char *nm) const SCM Music::get_mus_property (SCM sym) const { - SCM s = scm_sloppy_assq(sym, mutable_property_alist_); + SCM s = scm_sloppy_assq (sym, mutable_property_alist_); if (s != SCM_BOOL_F) return gh_cdr (s); @@ -219,7 +219,7 @@ ly_get_mus_property (SCM mus, SCM sym) } else { - warning (_("ly_get_mus_property (): Not a Music")); + warning (_ ("ly_get_mus_property (): Not a Music")); scm_write (mus, scm_current_error_port ()); } return SCM_EOL; @@ -233,7 +233,7 @@ ly_set_mus_property (SCM mus, SCM sym, SCM val) if (!gh_symbol_p (sym)) { - warning (_("ly_set_mus_property (): Not a symbol")); + warning (_ ("ly_set_mus_property (): Not a symbol")); scm_write (mus, scm_current_error_port ()); return SCM_UNSPECIFIED; @@ -245,17 +245,38 @@ ly_set_mus_property (SCM mus, SCM sym, SCM val) } else { - warning (_("ly_set_mus_property (): not of type Music")); + warning (_ ("ly_set_mus_property (): not of type Music")); scm_write (mus, scm_current_error_port ()); } return SCM_UNSPECIFIED; } + +// to do property args +SCM +ly_make_music (SCM type) +{ + if (!gh_string_p (type)) + { + warning (_ ("ly_make_music (): Not a string")); + scm_write (type, scm_current_error_port ()); + + return SCM_UNSPECIFIED; + } + else + { + SCM s = get_music (ly_scm2string (type))->self_scm (); + scm_unprotect_object (s); + return s; + } +} + static void init_functions () { scm_make_gsubr ("ly-get-mus-property", 2, 0, 0, (Scheme_function_unknown)ly_get_mus_property); scm_make_gsubr ("ly-set-mus-property", 3, 0, 0, (Scheme_function_unknown)ly_set_mus_property); + scm_make_gsubr ("ly-make-music", 1, 0, 0, (Scheme_function_unknown)ly_make_music); } -ADD_SCM_INIT_FUNC(musicscm,init_functions); +ADD_SCM_INIT_FUNC (musicscm,init_functions); diff --git a/lily/musical-request.cc b/lily/musical-request.cc index a1ea36b4ed..463d0775e8 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -53,16 +53,16 @@ Rhythmic_req::do_equal_b (Request const* r) const Moment Rhythmic_req::length_mom () const { - return unsmob_duration ( get_mus_property( "duration"))->length_mom (); + return unsmob_duration (get_mus_property ("duration"))->length_mom (); } void Rhythmic_req::compress (Moment m) { - Duration *d = unsmob_duration (get_mus_property( "duration")); + Duration *d = unsmob_duration (get_mus_property ("duration")); - set_mus_property ("duration", d ->compressed (m).smobbed_copy()); + set_mus_property ("duration", d ->compressed (m).smobbed_copy ()); } bool @@ -101,7 +101,6 @@ Text_script_req::do_equal_b (Request const* r) const t->get_mus_property ("text")); } - bool Articulation_req::do_equal_b (Request const* r) const { @@ -111,3 +110,15 @@ Articulation_req::do_equal_b (Request const* r) const } + + + + + + + + + + + + diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index ff9cebe793..9000acf6e6 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -90,7 +90,7 @@ static Keyword_ent the_key_tab[]={ {0,0} }; -My_lily_lexer::My_lily_lexer() +My_lily_lexer::My_lily_lexer () { keytable_p_ = new Keyword_table (the_key_tab); toplevel_variable_tab_ = new Scheme_hash_table ; @@ -111,9 +111,9 @@ My_lily_lexer::lookup_keyword (String s) SCM My_lily_lexer::lookup_identifier (String s) { - SCM sym = ly_symbol2scm (s.ch_C()); + SCM sym = ly_symbol2scm (s.ch_C ()); - for (int i = scope_l_arr_.size (); i--; ) + for (int i = scope_l_arr_.size (); i--;) { SCM val = SCM_UNSPECIFIED; if (scope_l_arr_[i]->try_retrieve (sym, &val)) @@ -126,7 +126,7 @@ void My_lily_lexer::start_main_input () { new_input (main_input_str_, source_global_l); - allow_includes_b_ = allow_includes_b_ && !(safe_global_b); + allow_includes_b_ = allow_includes_b_ && ! (safe_global_b); } void @@ -134,13 +134,13 @@ My_lily_lexer::set_identifier (String name_str, SCM s) { if (lookup_keyword (name_str) >= 0) { - warning ( _f ("Identifier name is a keyword: `%s'", name_str)); + warning (_f ("Identifier name is a keyword: `%s'", name_str)); } scope_l_arr_.top ()->set (name_str, s); } -My_lily_lexer::~My_lily_lexer() +My_lily_lexer::~My_lily_lexer () { delete keytable_p_; scm_unprotect_object (toplevel_variable_tab_->self_scm ()); @@ -152,22 +152,22 @@ My_lily_lexer::~My_lily_lexer() void My_lily_lexer::LexerError (char const *s) { - if (include_stack_.empty()) + if (include_stack_.empty ()) { progress_indication (_f ("error at EOF: %s", s)+ String ("\n")); } else { errorlevel_i_ |= 1; - Input spot (source_file_l(),here_ch_C()); + Input spot (source_file_l (),here_ch_C ()); spot.error (s); } } char -My_lily_lexer::escaped_char(char c) const +My_lily_lexer::escaped_char (char c) const { - switch(c) + switch (c) { case 'n': return '\n'; diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index 821f49f4b2..7fa6ff7d04 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -26,14 +26,14 @@ My_lily_parser::My_lily_parser (Sources * source_l) default_header_p_ =0; } -My_lily_parser::~My_lily_parser() +My_lily_parser::~My_lily_parser () { delete lexer_p_; delete default_header_p_; } void -My_lily_parser::set_version_check (bool ) +My_lily_parser::set_version_check (bool) { } @@ -44,7 +44,7 @@ My_lily_parser::parse_file (String init, String s) lexer_p_->main_input_str_ = s; - progress_indication (_("Parsing...")); + progress_indication (_ ("Parsing...")); set_yydebug (flower_dstream &&!flower_dstream->silent_b ("Parser")); lexer_p_->new_input (init, source_l_); @@ -52,7 +52,7 @@ My_lily_parser::parse_file (String init, String s) progress_indication ("\n"); - if (!define_spot_array_.empty()) + if (!define_spot_array_.empty ()) { define_spot_array_.top ().warning (_ ("Braces don't match")); error_level_i_ = 1; @@ -64,21 +64,21 @@ My_lily_parser::parse_file (String init, String s) } void -My_lily_parser::remember_spot() +My_lily_parser::remember_spot () { - define_spot_array_.push (here_input()); + define_spot_array_.push (here_input ()); } char const * -My_lily_parser::here_ch_C() const +My_lily_parser::here_ch_C () const { - return lexer_p_->here_ch_C(); + return lexer_p_->here_ch_C (); } void My_lily_parser::parser_error (String s) { - here_input().error (s); + here_input ().error (s); error_level_i_ = 1; exit_status_global = 1; } @@ -91,13 +91,13 @@ My_lily_parser::set_last_duration (Duration const *d) Input -My_lily_parser::pop_spot() +My_lily_parser::pop_spot () { - return define_spot_array_.pop(); + return define_spot_array_.pop (); } Input -My_lily_parser::here_input() const +My_lily_parser::here_input () const { return lexer_p_->here_input (); } @@ -108,7 +108,7 @@ My_lily_parser::here_input() const My_lily_parser * current_parser; -MAKE_SCHEME_CALLBACK(My_lily_parser,paper_description, 0); +MAKE_SCHEME_CALLBACK (My_lily_parser,paper_description, 0); SCM My_lily_parser::paper_description () diff --git a/lily/note-column.cc b/lily/note-column.cc index 80e7b8c553..6cf77b6d5e 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -48,11 +48,11 @@ Item * Note_column::stem_l (Grob*me) { SCM s = me->get_grob_property ("stem"); - return dynamic_cast(unsmob_grob (s)); + return dynamic_cast (unsmob_grob (s)); } Slice -Note_column::head_positions_interval(Grob *me) +Note_column::head_positions_interval (Grob *me) { Slice iv; diff --git a/lily/note-head.cc b/lily/note-head.cc index 0ccd6dd981..fe74fcbb82 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -28,7 +28,7 @@ Note_head::ledger_line (Interval xwid, Grob *me) Molecule *e = &endings[LEFT]; endings[RIGHT] = *e; - Real thick = e->extent (Y_AXIS).length(); + Real thick = e->extent (Y_AXIS).length (); Real len = e->extent (X_AXIS).length () - thick; Molecule total; @@ -36,7 +36,7 @@ Note_head::ledger_line (Interval xwid, Grob *me) do { endings[d].translate_axis (xwid[d] - endings[d].extent (X_AXIS)[d], X_AXIS); total.add_molecule (endings[d]); - } while ((flip(&d)) != LEFT); + } while ((flip (&d)) != LEFT); Real xpos = xwid [LEFT] + len; @@ -51,7 +51,7 @@ Note_head::ledger_line (Interval xwid, Grob *me) } -MAKE_SCHEME_CALLBACK(Note_head,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Note_head,brew_molecule,1); SCM Note_head::brew_molecule (SCM smob) @@ -64,7 +64,7 @@ Note_head::brew_molecule (SCM smob) int p = (int) rint (Staff_symbol_referencer::position_f (me)); int streepjes_i = abs (p) < sz ? 0 - : (abs(p) - sz) /2; + : (abs (p) - sz) /2; SCM style = me->get_grob_property ("style"); if (!gh_symbol_p (style)) @@ -74,9 +74,9 @@ Note_head::brew_molecule (SCM smob) // ugh: use gh_call () Molecule out = Font_interface::get_default_font (me)->find_by_name (String ("noteheads-") + - ly_scm2string (scm_eval2 (gh_list (ly_symbol2scm("find-notehead-symbol"), + ly_scm2string (scm_eval2 (gh_list (ly_symbol2scm ("find-notehead-symbol"), me->get_grob_property ("duration-log"), - ly_quote_scm(style), + ly_quote_scm (style), SCM_UNDEFINED), SCM_EOL))); @@ -85,7 +85,7 @@ Note_head::brew_molecule (SCM smob) Direction dir = (Direction)sign (p); Interval hd = out.extent (X_AXIS); Real hw = hd.length ()/4; - Molecule ledger (ledger_line (Interval (hd[LEFT] - hw, + Molecule ledger (ledger_line (Interval (hd[LEFT] - hw, hd[RIGHT] + hw), me)); @@ -102,7 +102,7 @@ Note_head::brew_molecule (SCM smob) out.add_molecule (s); } } - return out.smobbed_copy(); + return out.smobbed_copy (); } bool @@ -112,7 +112,7 @@ Note_head::has_interface (Grob*m) } -MAKE_SCHEME_CALLBACK(Note_head,brew_ez_molecule,1); +MAKE_SCHEME_CALLBACK (Note_head,brew_ez_molecule,1); SCM Note_head::brew_ez_molecule (SCM smob) diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 954798be26..2b3b9e0827 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -25,14 +25,14 @@ class Note_heads_engraver : public Engraver Link_array note_req_l_arr_; Moment note_end_mom_; public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); protected: virtual void start_translation_timestep (); virtual bool try_music (Music *req_l) ; virtual void create_grobs (); virtual void acknowledge_grob (Grob_info) ; - virtual void stop_translation_timestep(); + virtual void stop_translation_timestep (); }; @@ -95,7 +95,7 @@ Note_heads_engraver::create_grobs () } Pitch *pit =unsmob_pitch (req->get_mus_property ("pitch")); - note_p->set_grob_property("staff-position", gh_int2scm (pit->steps ())); + note_p->set_grob_property ("staff-position", gh_int2scm (pit->steps ())); if (to_boolean (get_property ("easyPlay"))) { @@ -112,7 +112,7 @@ Note_heads_engraver::create_grobs () } void -Note_heads_engraver::stop_translation_timestep() +Note_heads_engraver::stop_translation_timestep () { for (int i=0; i < note_p_arr_.size (); i++) { @@ -133,7 +133,7 @@ Note_heads_engraver::start_translation_timestep () { /* TODO:make this settable? */ - if (note_end_mom_ > now_mom() ) + if (note_end_mom_ > now_mom ()) { Score_engraver * e = 0; Translator * t = daddy_grav_l (); @@ -151,5 +151,5 @@ Note_heads_engraver::start_translation_timestep () -ADD_THIS_TRANSLATOR(Note_heads_engraver); +ADD_THIS_TRANSLATOR (Note_heads_engraver); diff --git a/lily/note-name-engraver.cc b/lily/note-name-engraver.cc index 462045446c..c6e0261b2c 100644 --- a/lily/note-name-engraver.cc +++ b/lily/note-name-engraver.cc @@ -14,7 +14,7 @@ class Note_name_engraver : public Engraver { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Link_array req_l_arr_; Link_array texts_; virtual bool try_music (Music*m); @@ -45,10 +45,10 @@ Note_name_engraver::create_grobs () s += " "; s += unsmob_pitch (req_l_arr_[i]->get_mus_property ("pitch"))->str (); } - if (s.length_i()) + if (s.length_i ()) { Item * t = new Item (get_property ("NoteName")); - t->set_grob_property ("text", ly_str02scm ( s.ch_C())); + t->set_grob_property ("text", ly_str02scm (s.ch_C ())); announce_grob (t, req_l_arr_[0]); texts_.push (t); } @@ -61,8 +61,8 @@ Note_name_engraver::stop_translation_timestep () { typeset_grob (texts_[i]); } - texts_.clear() ; + texts_.clear () ; req_l_arr_.clear (); } -ADD_THIS_TRANSLATOR(Note_name_engraver); +ADD_THIS_TRANSLATOR (Note_name_engraver); diff --git a/lily/note-performer.cc b/lily/note-performer.cc index 5729d0aa1c..c2665f5495 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -18,7 +18,7 @@ Convert reqs to audio notes. */ class Note_performer : public Performer { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); protected: virtual bool try_music (Music *req_l) ; @@ -43,7 +43,7 @@ Note_performer::create_audio_elements () int transposing_i = 0; //urg SCM prop = get_property ("transposing"); - if (gh_number_p(prop)) + if (gh_number_p (prop)) transposing_i = gh_scm2int (prop); while (note_req_l_arr_.size ()) diff --git a/lily/output-property-engraver.cc b/lily/output-property-engraver.cc index 7676c82e1a..7db91b877d 100644 --- a/lily/output-property-engraver.cc +++ b/lily/output-property-engraver.cc @@ -14,7 +14,7 @@ class Output_property_engraver : public Engraver { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); protected: /* @@ -52,7 +52,7 @@ Output_property_engraver::try_music (Music* m) void Output_property_engraver::acknowledge_grob (Grob_info inf) { - for (int i=props_.size (); i--; ) + for (int i=props_.size (); i--;) { Music * o = props_[i]; SCM pred = o->get_mus_property ("predicate"); @@ -77,4 +77,4 @@ Output_property_engraver::stop_translation_timestep () props_.clear (); } -ADD_THIS_TRANSLATOR(Output_property_engraver); +ADD_THIS_TRANSLATOR (Output_property_engraver); diff --git a/lily/output-property-music-iterator.cc b/lily/output-property-music-iterator.cc index 882d9d63e3..5759b85b42 100644 --- a/lily/output-property-music-iterator.cc +++ b/lily/output-property-music-iterator.cc @@ -24,4 +24,4 @@ Output_property_music_iterator::process (Moment m) skip (m); } -IMPLEMENT_CTOR_CALLBACK(Output_property_music_iterator); +IMPLEMENT_CTOR_CALLBACK (Output_property_music_iterator); diff --git a/lily/paper-column.cc b/lily/paper-column.cc index 985b080a07..4e76ff5ed8 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -15,18 +15,18 @@ void Paper_column::do_break_processing () { - Spaceable_grob::remove_interface(this); + Spaceable_grob::remove_interface (this); Item::do_break_processing (); } int -Paper_column::rank_i(Grob*me) +Paper_column::rank_i (Grob*me) { return dynamic_cast (me)->rank_i_; } Line_of_score* -Paper_column::line_l() const +Paper_column::line_l () const { return line_l_; } @@ -34,7 +34,7 @@ Paper_column::line_l() const Paper_column* Paper_column::column_l () const { - return (Paper_column*)(this); + return (Paper_column*) (this); } Paper_column::Paper_column (SCM l) @@ -69,11 +69,11 @@ Paper_column::musical_b () const { s = *unsmob_moment (m); } - return s != Moment(0); + return s != Moment (0); } bool -Paper_column::used_b (Grob*me ) +Paper_column::used_b (Grob*me) { return gh_pair_p (me->get_grob_property ("elements")) || Item::breakable_b (me) || gh_pair_p (me->get_grob_property ("bounded-by-me")) diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 8b365ab7eb..5ad7799c11 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -36,13 +36,13 @@ Paper_def::Paper_def (Paper_def const&src) Real Paper_def::get_var (String s) const { - return get_realvar (ly_symbol2scm (s.ch_C())); + return get_realvar (ly_symbol2scm (s.ch_C ())); } SCM Paper_def::get_scmvar (String s) const { - return scope_p_->scm_elem (ly_symbol2scm (s.ch_C())); + return scope_p_->scm_elem (ly_symbol2scm (s.ch_C ())); } Real @@ -96,7 +96,7 @@ Paper_def::get_next_score_count () const } void -Paper_def::reset_score_count() +Paper_def::reset_score_count () { score_count_i_ = 0; } @@ -138,7 +138,7 @@ Paper_def::find_font (SCM fn, Real m) Font_metric* f = all_fonts_global_p->find_font (ly_scm2string (fn)); SCM val = Scaled_font_metric::make_scaled_font_metric (f, m); - scaled_fonts_ = scm_acons (key, val, scaled_fonts_ ); + scaled_fonts_ = scm_acons (key, val, scaled_fonts_); scm_unprotect_object (val); @@ -155,7 +155,7 @@ Paper_def::font_descriptions ()const SCM l = SCM_EOL; - for (SCM s = scaled_fonts_; gh_pair_p (s); s = gh_cdr(s)) + for (SCM s = scaled_fonts_; gh_pair_p (s); s = gh_cdr (s)) { SCM desc = gh_caar (s); SCM mdesc = unsmob_metrics (gh_cdar (s))->description_; diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 46016c7573..faa0551ab0 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -47,10 +47,10 @@ Paper_outputter::Paper_outputter (String name) { *stream_p_ << "" ";;; Usage: guile -s x.scm > x.tex\n" - "(primitive-load-path 'standalone.scm)\n" - ";(scm-tex-output)\n" - "(scm-ps-output)\n" - "(map (lambda (x) (display (ly-eval x))) '(\n" + " (primitive-load-path 'standalone.scm)\n" + "; (scm-tex-output)\n" + " (scm-ps-output)\n" + " (map (lambda (x) (display (ly-eval x))) ' (\n" ; } @@ -74,7 +74,7 @@ Paper_outputter::output_header () gh_define ("security-paranoia", SCM_BOOL_T); } - SCM exp = gh_list (ly_symbol2scm ((output_format_global + "-scm").ch_C()), + SCM exp = gh_list (ly_symbol2scm ((output_format_global + "-scm").ch_C ()), ly_quote_scm (ly_symbol2scm ("all-definitions")), SCM_UNDEFINED); exp = scm_eval2 (exp, SCM_EOL); @@ -117,7 +117,7 @@ void Paper_outputter::output_comment (String str) { output_scheme (gh_list (ly_symbol2scm ("comment"), - ly_str02scm ((char*)str.ch_C()), + ly_str02scm ((char*)str.ch_C ()), SCM_UNDEFINED) ); } @@ -137,13 +137,13 @@ Paper_outputter::output_scheme (SCM scm) /* UGH. - Should probably change interface to do less eval ( symbol ), and more + Should probably change interface to do less eval (symbol), and more apply (procedure, args) */ void Paper_outputter::dump_scheme (SCM s) { - if (verbatim_scheme_b_) + if (verbatim_scheme_b_) { *stream_p_ << ly_scm2string (ly_write2scm (s)); } @@ -192,8 +192,8 @@ Paper_outputter::output_version () else id_str += String (", ") + version_str (); - output_String_def ( "lilypondtagline", id_str); - output_String_def ( "LilyPondVersion", version_str ()); + output_String_def ("lilypondtagline", id_str); + output_String_def ("LilyPondVersion", version_str ()); } @@ -205,7 +205,7 @@ Paper_outputter::output_Real_def (String k, Real v) SCM scm = gh_list (ly_symbol2scm ("lily-def"), ly_str02scm (k.ch_l ()), - ly_str02scm (to_str(v).ch_l ()), + ly_str02scm (to_str (v).ch_l ()), SCM_UNDEFINED); output_scheme (scm); } diff --git a/lily/paper-score.cc b/lily/paper-score.cc index 82f275a098..6d659d7064 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -74,7 +74,7 @@ void Paper_score::process () { if (verbose_global_b) - progress_indication ( _f("Element count %d ", line_l_->element_count ())); + progress_indication (_f ("Element count %d ", line_l_->element_count ())); progress_indication (_ ("Preprocessing elements...") + " "); diff --git a/lily/parser.yy b/lily/parser.yy index 1583e0e6e4..21f657bdc8 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -48,7 +48,7 @@ bool is_duration_b (int t) { - return t && t == 1 << intlog2(t); + return t && t == 1 << intlog2 (t); } @@ -73,7 +73,7 @@ print_lilypond_versions (ostream &os) } -// needed for bison.simple's malloc() and free() +// needed for bison.simple's malloc () and free () #include #ifndef NDEBUG @@ -84,7 +84,8 @@ print_lilypond_versions (ostream &os) #define YYPARSE_PARAM my_lily_parser_l #define YYLEX_PARAM my_lily_parser_l -#define THIS ((My_lily_parser *) my_lily_parser_l) +#define THIS\ + ((My_lily_parser *) my_lily_parser_l) #define yyerror THIS->parser_error #define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f ("Expecting %d arguments", s)) @@ -347,7 +348,7 @@ notenames_body: if (!unsmob_pitch (pt)) THIS->parser_error ("Need pitch object."); else - scm_hashq_set_x (tab, gh_caar(s), pt); + scm_hashq_set_x (tab, gh_caar (s), pt); } $$ = tab; @@ -460,7 +461,7 @@ translator_spec_body: ->add_push_property (scm_string_to_symbol ($2), $4, $6); } | translator_spec_body STRING REVERT embedded_scm { - unsmob_translator_def($$)->add_pop_property ( + unsmob_translator_def ($$)->add_pop_property ( scm_string_to_symbol ($2), $4); } | translator_spec_body STRING '=' identifier_init semicolon { @@ -468,10 +469,10 @@ translator_spec_body: if (gh_string_p ($4) || gh_number_p ($4) || gh_boolean_p ($4)) v = $4; else - THIS->parser_error (_("Wrong type for property value")); + THIS->parser_error (_ ("Wrong type for property value")); /* ugh*/ - unsmob_translator_def($$)->add_property_assign ($2, v); + unsmob_translator_def ($$)->add_property_assign ($2, v); } | translator_spec_body NAME STRING semicolon { unsmob_translator_def ($$)->type_name_ = $3; @@ -550,7 +551,7 @@ score_body: output_def: music_output_def_body '}' { $$ = $1; - THIS-> lexer_p_-> scope_l_arr_.pop(); + THIS-> lexer_p_-> scope_l_arr_.pop (); } ; @@ -580,13 +581,13 @@ music_output_def_body: } | PAPER '{' MUSIC_OUTPUT_DEF_IDENTIFIER { Music_output_def *p = unsmob_music_output_def ($3); - p = p->clone(); + p = p->clone (); THIS->lexer_p_->scope_l_arr_.push (p->scope_p_); $$ = p; } | MIDI '{' MUSIC_OUTPUT_DEF_IDENTIFIER { Music_output_def *p = unsmob_music_output_def ($3); - p = p->clone(); + p = p->clone (); THIS->lexer_p_->scope_l_arr_.push (p->scope_p_); $$ = p; @@ -727,12 +728,12 @@ Simple_music: SCM pred = $2; if (!gh_symbol_p ($3)) { - THIS->parser_error (_("Second argument must be a symbol")); + THIS->parser_error (_ ("Second argument must be a symbol")); } /*hould check # args */ if (!gh_procedure_p (pred)) { - THIS->parser_error (_("First argument must be a procedure taking 1 argument")); + THIS->parser_error (_ ("First argument must be a procedure taking 1 argument")); } Music *m = new Music (SCM_EOL); @@ -751,7 +752,7 @@ Simple_music: | translator_change | Simple_music '*' bare_unsigned '/' bare_unsigned { $$ = $1; - $$->compress (Moment($3, $5 )); + $$->compress (Moment ($3, $5 )); } | Simple_music '*' bare_unsigned { $$ = $1; @@ -907,8 +908,8 @@ part_combined_music: p->set_mus_property ("one", $3->self_scm ()); p->set_mus_property ("two", $4->self_scm ()); - scm_unprotect_object ($3->self_scm()); - scm_unprotect_object ($4->self_scm()); + scm_unprotect_object ($3->self_scm ()); + scm_unprotect_object ($4->self_scm ()); $$ = p; @@ -1006,12 +1007,12 @@ scalar: request_chord: pre_requests simple_element post_requests { - Music_sequence *l = dynamic_cast($2); + Music_sequence *l = dynamic_cast ($2); if (l) { - for (int i=0; i < $1->size(); i++) - l->append_music ($1->elem(i)); - for (int i=0; i < $3->size(); i++) - l->append_music ($3->elem(i)); + for (int i=0; i < $1->size (); i++) + l->append_music ($1->elem (i)); + for (int i=0; i < $3->size (); i++) + l->append_music ($3->elem (i)); } else programming_error ("Need Sequence to add music to"); @@ -1051,7 +1052,7 @@ command_element: p->set_mus_property ("iterator-ctor", Property_iterator::constructor_cxx_function); - Moment m = - unsmob_duration($2)->length_mom (); + Moment m = - unsmob_duration ($2)->length_mom (); p->set_mus_property ("value", m.smobbed_copy ()); Context_specced_music * sp = new Context_specced_music (SCM_EOL); @@ -1068,7 +1069,7 @@ command_element: SCM l = SCM_EOL; for (SCM s = result ; gh_pair_p (s); s = gh_cdr (s)) { Music * p = new Music (SCM_EOL); - set_music_properties(p, gh_car (s)); + set_music_properties (p, gh_car (s)); l = gh_cons (p->self_scm (), l); scm_unprotect_object (p->self_scm ()); } @@ -1080,7 +1081,7 @@ command_element: scm_unprotect_object (seq->self_scm ()); $$ =sp ; - sp-> set_mus_property("context-type", ly_str02scm("Staff")); + sp-> set_mus_property ("context-type", ly_str02scm ("Staff")); } | TIME_T bare_unsigned '/' bare_unsigned ';' { Music * p = new Music (SCM_EOL); @@ -1121,13 +1122,13 @@ shorthand_command_req: } | '[' { Span_req*b= new Span_req; - b->set_span_dir(START); + b->set_span_dir (START); b->set_mus_property ("span-type", ly_str02scm ("beam")); $$ =b; } | ']' { Span_req*b= new Span_req; - b->set_span_dir( STOP); + b->set_span_dir ( STOP); b->set_mus_property ("span-type", ly_str02scm ("beam")); $$ = b; } @@ -1140,7 +1141,7 @@ shorthand_command_req: verbose_command_req: COMMANDSPANREQUEST bare_int STRING { /*TODO: junkme */ Span_req * sp_p = new Span_req; - sp_p-> set_span_dir ( Direction($2)); + sp_p-> set_span_dir ( Direction ($2)); sp_p->set_mus_property ("span-type",$3); sp_p->set_spot (THIS->here_input ()); $$ = sp_p; @@ -1178,7 +1179,7 @@ verbose_command_req: Key_change_req *key_p= new Key_change_req; key_p->set_mus_property ("pitch-alist", $3); - ((Music* )key_p)->transpose (* unsmob_pitch ($2)); + ((Music* )key_p)->transpose (* unsmob_pitch ($2)); $$ = key_p; } ; @@ -1246,7 +1247,7 @@ verbose_request: } | SPANREQUEST bare_int STRING { Span_req * sp_p = new Span_req; - sp_p->set_span_dir( Direction($2)); + sp_p->set_span_dir ( Direction ($2)); sp_p->set_mus_property ("span-type", $3); sp_p->set_spot (THIS->here_input ()); $$ = sp_p; @@ -1361,7 +1362,7 @@ explicit_duration: $$ = $2; if (!unsmob_duration ($2)) { - THIS->parser_error (_("Must have duration object")); + THIS->parser_error (_ ("Must have duration object")); $$ = Duration ().smobbed_copy (); } } @@ -1393,12 +1394,12 @@ close_request_parens: '(' { Span_req* s= new Span_req; $$ = s; - s->set_mus_property ("span-type", ly_str02scm( "slur")); + s->set_mus_property ("span-type", ly_str02scm ( "slur")); } | E_OPEN { Span_req* s= new Span_req; $$ = s; - s->set_mus_property ("span-type", ly_str02scm( "phrasing-slur")); + s->set_mus_property ("span-type", ly_str02scm ( "phrasing-slur")); } | E_SMALLER { Span_req*s =new Span_req; @@ -1430,12 +1431,12 @@ open_request_parens: | ')' { Span_req* s= new Span_req; $$ = s; - s->set_mus_property ("span-type", ly_str02scm( "slur")); + s->set_mus_property ("span-type", ly_str02scm ( "slur")); } | E_CLOSE { Span_req* s= new Span_req; $$ = s; - s->set_mus_property ("span-type", ly_str02scm( "phrasing-slur")); + s->set_mus_property ("span-type", ly_str02scm ( "phrasing-slur")); } ; @@ -1456,7 +1457,7 @@ gen_text_def: String ds = to_str ($1); Text_script_req* t = new Text_script_req; - t->set_mus_property ("text", ly_str02scm (ds.ch_C())); + t->set_mus_property ("text", ly_str02scm (ds.ch_C ())); t->set_mus_property ("text-type" , ly_symbol2scm ("finger")); t->set_spot (THIS->here_input ()); $$ = t; @@ -1465,10 +1466,10 @@ gen_text_def: script_abbreviation: '^' { - $$ = gh_str02scm ("hat"); + $$ = gh_str02scm ("hat"); } | '+' { - $$ = gh_str02scm("plus"); + $$ = gh_str02scm ("plus"); } | '-' { $$ = gh_str02scm ("dash"); @@ -1612,19 +1613,19 @@ FIXME: location is one off, since ptich & duration don't contain origin refs. Skip_req * skip_p = new Skip_req; skip_p->set_mus_property ("duration" ,$2); - skip_p->set_spot (THIS->here_input()); + skip_p->set_spot (THIS->here_input ()); e = skip_p->self_scm (); } else { Rest_req * rest_req_p = new Rest_req; rest_req_p->set_mus_property ("duration", $2); - rest_req_p->set_spot (THIS->here_input()); + rest_req_p->set_spot (THIS->here_input ()); e = rest_req_p->self_scm (); } Simultaneous_music* velt_p = new Request_chord (SCM_EOL); velt_p-> set_mus_property ("elements", gh_list (e,SCM_UNDEFINED)); - velt_p->set_spot (THIS->here_input()); + velt_p->set_spot (THIS->here_input ()); $$ = velt_p; @@ -1644,7 +1645,7 @@ FIXME: location is one off, since ptich & duration don't contain origin refs. rqc1->set_mus_property ("elements", gh_list (sp1->self_scm (), SCM_UNDEFINED)); Request_chord * rqc2 = new Request_chord (SCM_EOL); rqc2->set_mus_property ("elements", gh_list (sk->self_scm (), SCM_UNDEFINED));; - Request_chord * rqc3 = new Request_chord(SCM_EOL); + Request_chord * rqc3 = new Request_chord (SCM_EOL); rqc3->set_mus_property ("elements", gh_list (sp2->self_scm (), SCM_UNDEFINED));; SCM ms = gh_list (rqc1->self_scm (), rqc2->self_scm (), rqc3->self_scm (), SCM_UNDEFINED); @@ -1667,7 +1668,7 @@ FIXME: location is one off, since ptich & duration don't contain origin refs. Lyric_req* lreq_p = new Lyric_req; lreq_p->set_mus_property ("text", $1); lreq_p->set_mus_property ("duration",$3); - lreq_p->set_spot (THIS->here_input()); + lreq_p->set_spot (THIS->here_input ()); Simultaneous_music* velt_p = new Request_chord (SCM_EOL); velt_p->set_mus_property ("elements", gh_list (lreq_p->self_scm (), SCM_UNDEFINED)); @@ -1839,11 +1840,11 @@ bare_unsigned: $$ = gh_scm2int ($1); } else { - THIS->parser_error (_("need integer number arg")); + THIS->parser_error (_ ("need integer number arg")); $$ = 0; } if ($$ < 0) { - THIS->parser_error (_("Must be positive integer")); + THIS->parser_error (_ ("Must be positive integer")); $$ = -$$; } @@ -1857,7 +1858,7 @@ bare_int: $$ = k; } else { - THIS->parser_error (_("need integer number arg")); + THIS->parser_error (_ ("need integer number arg")); $$ = 0; } } diff --git a/lily/part-combine-music-iterator.cc b/lily/part-combine-music-iterator.cc index 595e3cf822..043f83c557 100644 --- a/lily/part-combine-music-iterator.cc +++ b/lily/part-combine-music-iterator.cc @@ -85,7 +85,7 @@ Part_combine_music_iterator::change_to (Music_iterator *it, String to_type, If \translator Staff = bass, then look for Staff = * */ - while (current && current->type_str_ != to_type) + while (current && current->type_str_ != to_type) { last = current; current = current->daddy_trans_l_; @@ -130,9 +130,9 @@ get_music_info (Moment m, Music_iterator* iter, SCM *pitches, SCM *durations) { Music *m = unsmob_music (gh_car (i)); if (Melodic_req *r = dynamic_cast (m)) - *pitches = gh_cons (r->get_mus_property("pitch"), *pitches); + *pitches = gh_cons (r->get_mus_property ("pitch"), *pitches); if (Rhythmic_req *r = dynamic_cast (m)) - *durations = gh_cons (r->get_mus_property("duration"), *durations); + *durations = gh_cons (r->get_mus_property ("duration"), *durations); } } } @@ -228,22 +228,22 @@ Part_combine_music_iterator::get_state (Moment) } if (first_pitches != SCM_EOL && second_pitches == SCM_EOL - && !(second_until_ > now)) + && ! (second_until_ > now)) { state |= UNRELATED; state &= ~UNISILENCE; - if (!(state & ~(UNRELATED | SOLO1 | UNISILENCE))) + if (! (state & ~ (UNRELATED | SOLO1 | UNISILENCE))) state |= SOLO1; } else state &= ~SOLO1; if (first_pitches == SCM_EOL && second_pitches != SCM_EOL - && !(first_until_ > now)) + && ! (first_until_ > now)) { state |= UNRELATED; state &= ~UNISILENCE; - if (!(state & ~(UNRELATED | SOLO2 | UNISILENCE))) + if (! (state & ~ (UNRELATED | SOLO2 | UNISILENCE))) state |= SOLO2; } else @@ -252,31 +252,31 @@ Part_combine_music_iterator::get_state (Moment) if (gh_equal_p (first_durations, second_durations)) { state &= ~UNISILENCE; - if (!(state & ~(UNIRHYTHM | UNISON))) + if (! (state & ~ (UNIRHYTHM | UNISON))) state |= UNIRHYTHM; } else - state &= ~(UNIRHYTHM | UNISILENCE); + state &= ~ (UNIRHYTHM | UNISILENCE); if (first_pitches != SCM_EOL && gh_equal_p (first_pitches, second_pitches)) { state &= ~UNISILENCE; - if (!(state & ~(UNIRHYTHM | UNISON))) + if (! (state & ~ (UNIRHYTHM | UNISON))) state |= UNISON; } else - state &= ~(UNISON); + state &= ~ (UNISON); if (first_pitches == SCM_EOL && second_pitches == SCM_EOL) { - if (!(state & ~(UNIRHYTHM | UNISILENCE))) + if (! (state & ~ (UNIRHYTHM | UNISILENCE))) state |= UNISILENCE; } else if (!state) state |= UNRELATED; else - state &= ~(UNISILENCE); + state &= ~ (UNISILENCE); if (gh_number_p (interval)) { @@ -288,11 +288,11 @@ Part_combine_music_iterator::get_state (Moment) && i >= gh_scm2int (gh_car (s)) && i <= gh_scm2int (gh_cdr (s))) { - if (!(state & ~(SPLIT_INTERVAL | UNIRHYTHM | UNISON))) + if (! (state & ~ (SPLIT_INTERVAL | UNIRHYTHM | UNISON))) state |= SPLIT_INTERVAL; } else - state &= ~(SPLIT_INTERVAL); + state &= ~ (SPLIT_INTERVAL); } if (first && first_pitches != SCM_EOL) @@ -349,7 +349,7 @@ Part_combine_music_iterator::process (Moment m) bool combine_b = previously_combined_b; - if (!(state & UNIRHYTHM) + if (! (state & UNIRHYTHM) || (state & SPLIT_INTERVAL) || (state & (SOLO1 | SOLO2))) combine_b = false; @@ -438,4 +438,4 @@ Part_combine_music_iterator::get_music (Moment m)const return s; } -IMPLEMENT_CTOR_CALLBACK(Part_combine_music_iterator); +IMPLEMENT_CTOR_CALLBACK (Part_combine_music_iterator); diff --git a/lily/part-combine-music.cc b/lily/part-combine-music.cc index 75edf8cbb8..316d4a117b 100644 --- a/lily/part-combine-music.cc +++ b/lily/part-combine-music.cc @@ -58,3 +58,11 @@ Part_combine_music::second_l () const { return unsmob_music (get_mus_property ("two")); } + + +Part_combine_music::Part_combine_music () + : Music (SCM_EOL) +{ +} + +ADD_MUSIC (Part_combine_music); diff --git a/lily/percent-repeat-engraver.cc b/lily/percent-repeat-engraver.cc new file mode 100644 index 0000000000..b063ad4660 --- /dev/null +++ b/lily/percent-repeat-engraver.cc @@ -0,0 +1,208 @@ +/* + new-chord-tremolo-engraver.cc -- implement Chord_tremolo_engraver + + source file of the GNU LilyPond music typesetter + + (c) 2000--2001 Han-Wen Nienhuys + + */ + +#include "engraver.hh" +#include "repeated-music.hh" +#include "engraver-group-engraver.hh" +#include "global-translator.hh" +#include "warn.hh" +#include "misc.hh" +#include "spanner.hh" +#include "item.hh" +#include "percent-repeat-iterator.hh" + +/** + This acknowledges repeated music with "percent" style. It typesets + a % sign. + + TODO: + + - BEAT case: Create items for single beat repeats, i.e. c4 / / / + + - DOUBLE_MEASURE case: attach a % to an appropriate barline. + +*/ +class Percent_repeat_engraver : public Engraver +{ + void typeset_perc (); +public: + VIRTUAL_COPY_CONS (Translator); + Percent_repeat_engraver (); +protected: + Repeated_music * repeat_; + + /// moment (global time) where beam started. + Moment start_mom_; + Moment stop_mom_; + + /// location within measure where beam started. + Moment beam_start_location_; + Moment next_moment_; + Moment body_length_; + + enum { + UNKNOWN, + BEAT, + MEASURE, + DOUBLE_MEASURE, + } repeat_sign_type_ ; + + Spanner * perc_p_; + Spanner * finished_perc_p_; + Item * stem_tremolo_; +protected: + virtual void finalize (); + virtual bool try_music (Music*); + virtual void acknowledge_grob (Grob_info); + virtual void stop_translation_timestep (); + virtual void start_translation_timestep (); + virtual void process_music (); +}; + +Percent_repeat_engraver::Percent_repeat_engraver () +{ + perc_p_ = finished_perc_p_ = 0; + repeat_ =0; + stem_tremolo_ = 0; +} + +bool +Percent_repeat_engraver::try_music (Music * m) +{ + Repeated_music * rp = dynamic_cast (m); + if (rp + && rp->get_mus_property ("iterator-ctor") + == Percent_repeat_iterator::constructor_cxx_function + && !repeat_) + { + body_length_ = rp->body_length_mom (); + int count = rp->repeat_count (); + + Moment now = now_mom (); + start_mom_ = now; + stop_mom_ = start_mom_ + Moment (count) * body_length_; + next_moment_ = start_mom_ + body_length_; + + SCM m = get_property ("timeSignatureFraction"); + Moment mlen (1, + gh_scm2int (gh_cdr (m))); + + if (mlen == body_length_) + repeat_sign_type_ = BEAT; + else + { + mlen *= gh_scm2int (gh_car (m)); + if (mlen == body_length_) + repeat_sign_type_ = MEASURE; + else if (Moment (2)* mlen == body_length_) + repeat_sign_type_ = DOUBLE_MEASURE; + + if (repeat_sign_type_ != MEASURE) + { + warning (_ ("Don't know yet how to handle this percent repeat.")); + return false; + } + } + + repeat_ = rp; + + + Global_translator *global_l =0; + Translator *t = this; + do + { + t = t->daddy_trans_l_ ; + global_l = dynamic_cast (t); + } + while (!global_l); + + for (int i = 0; i < count; i++) + global_l->add_moment_to_process (now + Moment (1+i) * body_length_); + + return true; + } + + return false; +} + +void +Percent_repeat_engraver::process_music () +{ + if (repeat_ && now_mom () == next_moment_) + { + if (repeat_sign_type_ == BEAT) + { + ; + } + else if (repeat_sign_type_ == MEASURE) + { + finished_perc_p_ = perc_p_; + typeset_perc (); + perc_p_ = new Spanner (get_property ("PercentRepeat")); + SCM col =get_property ("currentCommandColumn"); + perc_p_->set_bound (LEFT, unsmob_grob (col)); + announce_grob (perc_p_, repeat_); + } + + next_moment_ = next_moment_ + body_length_; + } +} +void +Percent_repeat_engraver::finalize () +{ + typeset_perc (); + if (perc_p_) + { + repeat_->origin ()->warning (_ ("unterminated chord tremolo")); + perc_p_->suicide (); + } +} + +void +Percent_repeat_engraver::typeset_perc () +{ + if (finished_perc_p_) + { + SCM col =get_property ("currentCommandColumn"); + finished_perc_p_->set_bound (RIGHT, unsmob_grob (col)); + typeset_grob (finished_perc_p_); + finished_perc_p_ = 0; + } +} + + +void +Percent_repeat_engraver::acknowledge_grob (Grob_info info) +{ +} + + +void +Percent_repeat_engraver::start_translation_timestep () +{ + if (perc_p_ && stop_mom_ == now_mom ()) + { + finished_perc_p_ = perc_p_; + typeset_perc (); + repeat_ = 0; + perc_p_ = 0; + repeat_sign_type_ = UNKNOWN; + } +} + + +void +Percent_repeat_engraver::stop_translation_timestep () +{ + typeset_perc (); +} + +ADD_THIS_TRANSLATOR (Percent_repeat_engraver); + + diff --git a/lily/percent-repeat-iterator.cc b/lily/percent-repeat-iterator.cc new file mode 100644 index 0000000000..b9248bb7a8 --- /dev/null +++ b/lily/percent-repeat-iterator.cc @@ -0,0 +1,85 @@ +/* + percent-repeat-iterator.cc -- implement Percent_repeat_iterator + + source file of the GNU LilyPond music typesetter + + (c) 2001 Han-Wen Nienhuys + + */ + +#include "percent-repeat-iterator.hh" +#include "repeated-music.hh" +#include "input.hh" + +IMPLEMENT_CTOR_CALLBACK (Percent_repeat_iterator); + + +Percent_repeat_iterator::Percent_repeat_iterator () +{ + +} + +Percent_repeat_iterator::Percent_repeat_iterator (Percent_repeat_iterator const & p) + : Music_iterator (p) +{ + child_iter_p_ = p.child_iter_p_ ? p.child_iter_p_->clone (): 0; + finish_mom_ = p.finish_mom_ ; +} + +bool +Percent_repeat_iterator::ok () const +{ + return child_iter_p_; +} + +void +Percent_repeat_iterator::construct_children () +{ + Repeated_music * mus =dynamic_cast (music_l_); + finish_mom_ = mus->length_mom (); + child_iter_p_ = get_iterator_p (mus->body ()); +} + + +void +Percent_repeat_iterator::process (Moment m) +{ + if (!m) + { + Music_iterator *yeah = try_music (music_l_); + if (yeah) + set_translator (yeah->report_to_l ()); + else + music_l_->origin ()->warning ( _ ("no one to print a percent")); + } + + if (child_iter_p_->ok ()) + child_iter_p_->process (m); + + if (finish_mom_ <= m ) + { + delete child_iter_p_; + child_iter_p_ = 0; + } +} + +Moment +Percent_repeat_iterator::pending_moment ()const +{ + if (child_iter_p_->ok ()) + return child_iter_p_->pending_moment (); + else + return finish_mom_ ; +} + +Music_iterator* +Percent_repeat_iterator::try_music_in_children (Music *m) const +{ + return child_iter_p_->try_music (m); +} + + +Percent_repeat_iterator::~Percent_repeat_iterator () +{ + delete child_iter_p_; +} diff --git a/lily/performance.cc b/lily/performance.cc index 9e8715b111..d2d214ab99 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -32,7 +32,7 @@ Performance::Performance () } -Performance::~Performance() +Performance::~Performance () { delete audio_elem_p_list_; } @@ -40,7 +40,7 @@ Performance::~Performance() void Performance::output (Midi_stream& midi_stream) { - int tracks_i = audio_staff_l_arr_.size() + 1; + int tracks_i = audio_staff_l_arr_.size () + 1; // ugh int clocks_per_4_i = 384; @@ -53,7 +53,7 @@ Performance::output (Midi_stream& midi_stream) for (int i =0; i < audio_staff_l_arr_.size (); i++) { Audio_staff *s = audio_staff_l_arr_[i]; - if(verbose_global_b) + if (verbose_global_b) progress_indication ("[" + to_str (i)) ; /* @@ -64,7 +64,7 @@ Performance::output (Midi_stream& midi_stream) if (channel == 9) channel++; s->output (midi_stream, channel++); - if(verbose_global_b) + if (verbose_global_b) progress_indication ("]"); } } @@ -76,11 +76,11 @@ Performance::output_header_track (Midi_stream& midi_stream) // perhaps multiple text events? String id_str; - String str = String (_("Creator: ")); + String str = String (_ ("Creator: ")); if (no_timestamps_global_b) id_str = gnu_lilypond_str (); else - id_str = gnu_lilypond_version_str(); + id_str = gnu_lilypond_version_str (); str += id_str; str += "\n"; @@ -99,10 +99,10 @@ Performance::output_header_track (Midi_stream& midi_stream) str += ".\n"; else { - str += _(", at "); + str += _ (", at "); time_t t (time (0)); str += ctime (&t); - str = str.left_str (str.length_i() - 1); + str = str.left_str (str.length_i () - 1); } /* @@ -140,7 +140,7 @@ Performance::add_element (Audio_element *p) { audio_staff_l_arr_.push (s); } - else if (Audio_column *c = dynamic_cast(p)) + else if (Audio_column *c = dynamic_cast (p)) { c->performance_l_ = this; } @@ -149,7 +149,7 @@ Performance::add_element (Audio_element *p) void -Performance::process() +Performance::process () { String out = output_name_global; if (out == "-") @@ -168,9 +168,9 @@ Performance::process() out = p.str (); Midi_stream midi_stream (out); - progress_indication ( _f ("MIDI output to %s...", out)); + progress_indication (_f ("MIDI output to %s...", out)); target_str_global_array.push (out); output (midi_stream); - progress_indication("\n"); + progress_indication ("\n"); } diff --git a/lily/performer-group-performer.cc b/lily/performer-group-performer.cc index 5b70ea297f..3b5ea7f6a3 100644 --- a/lily/performer-group-performer.cc +++ b/lily/performer-group-performer.cc @@ -13,7 +13,7 @@ #include "debug.hh" -ADD_THIS_TRANSLATOR(Performer_group_performer); +ADD_THIS_TRANSLATOR (Performer_group_performer); void @@ -28,7 +28,7 @@ Performer_group_performer::announce_element (Audio_element_info info) void Performer_group_performer::create_audio_elements () { - for (SCM p = simple_trans_list_; gh_pair_p (p); p = gh_cdr ( p)) + for (SCM p = simple_trans_list_; gh_pair_p (p); p = gh_cdr (p)) { Translator * t = unsmob_translator (gh_car (p)); Performer * eng = dynamic_cast (t); @@ -40,7 +40,7 @@ Performer_group_performer::create_audio_elements () void Performer_group_performer::acknowledge_audio_elements () { - for (int j =0; j < announce_info_arr_.size(); j++) + for (int j =0; j < announce_info_arr_.size (); j++) { Audio_element_info info = announce_info_arr_[j]; @@ -55,9 +55,9 @@ Performer_group_performer::acknowledge_audio_elements () } void -Performer_group_performer::do_announces() +Performer_group_performer::do_announces () { - for (SCM p = trans_group_list_; gh_pair_p (p); p =gh_cdr ( p)) + for (SCM p = trans_group_list_; gh_pair_p (p); p =gh_cdr (p)) { Translator * t = unsmob_translator (gh_car (p)); dynamic_cast (t)->do_announces (); diff --git a/lily/performer.cc b/lily/performer.cc index 205fb3e353..321ba9f0c4 100644 --- a/lily/performer.cc +++ b/lily/performer.cc @@ -18,9 +18,9 @@ Performer::play_element (Audio_element* p) } int -Performer::get_tempo_i() const +Performer::get_tempo_i () const { - return daddy_perf_l ()->get_tempo_i(); + return daddy_perf_l ()->get_tempo_i (); } Performer_group_performer* @@ -47,5 +47,5 @@ Performer::announce_element (Audio_element_info i) { if (!i.origin_trans_l_) i.origin_trans_l_= this; - daddy_perf_l()->announce_element (i); + daddy_perf_l ()->announce_element (i); } diff --git a/lily/phrasing-slur-engraver.cc b/lily/phrasing-slur-engraver.cc index 2e9a171a66..319c266883 100644 --- a/lily/phrasing-slur-engraver.cc +++ b/lily/phrasing-slur-engraver.cc @@ -64,7 +64,7 @@ Phrasing_slur_engraver::try_music (Music *req_l) /* Let's not start more than one phrasing slur per moment. */ - if (sl->get_span_dir() == START) + if (sl->get_span_dir () == START) { if (now_mom () > last_start_) { @@ -128,7 +128,7 @@ Phrasing_slur_engraver::create_grobs () { Span_req* phrasing_slur_req_l = new_phrasing_slur_req_l_arr_[i]; // end phrasing slur: move the phrasing slur to other array - if (phrasing_slur_req_l->get_span_dir() == STOP) + if (phrasing_slur_req_l->get_span_dir () == STOP) { if (phrasing_slur_l_stack_.empty ()) phrasing_slur_req_l->origin ()->warning (_f ("can't find start of phrasing slur")); @@ -144,7 +144,7 @@ Phrasing_slur_engraver::create_grobs () requests_arr_.pop (); } } - else if (phrasing_slur_req_l->get_span_dir() == START) + else if (phrasing_slur_req_l->get_span_dir () == START) { // push a new phrasing_slur onto stack. // (use temp. array to wait for all phrasing_slur STOPs) diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index 527bd396c7..09f5d1e093 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -51,7 +51,7 @@ Piano_pedal_engraver::Piano_pedal_engraver () info_list_ = 0; } void -Piano_pedal_engraver::initialize() +Piano_pedal_engraver::initialize () { info_list_ = new Pedal_info[4]; Pedal_info *p = info_list_; @@ -69,10 +69,10 @@ Piano_pedal_engraver::initialize() p++; } - while (*(np ++)); + while (* (np ++)); } -Piano_pedal_engraver::~Piano_pedal_engraver() +Piano_pedal_engraver::~Piano_pedal_engraver () { delete[] info_list_; } @@ -92,7 +92,7 @@ Piano_pedal_engraver::acknowledge_grob (Grob_info info) { Side_position_interface::add_support (p->item_p_, info.elem_l_); - if (Side_position_interface::get_axis(p->item_p_) == X_AXIS + if (Side_position_interface::get_axis (p->item_p_) == X_AXIS && !p->item_p_->parent_l (Y_AXIS)) p->item_p_->set_parent (info.elem_l_, Y_AXIS); } @@ -107,14 +107,14 @@ Piano_pedal_engraver::acknowledge_grob (Grob_info info) bool Piano_pedal_engraver::try_music (Music *m) { - if (Span_req * s = dynamic_cast(m)) + if (Span_req * s = dynamic_cast (m)) { for (Pedal_info*p = info_list_; p->name_; p ++) { if (scm_equal_p (s->get_mus_property ("span-type"), ly_str02scm (p->name_))==SCM_BOOL_T) { - p->req_l_drul_[s->get_span_dir()] = s; + p->req_l_drul_[s->get_span_dir ()] = s; return true; } } @@ -131,15 +131,15 @@ Piano_pedal_engraver::create_grobs () continue; SCM s = SCM_EOL; - SCM strings = get_property( ("pedal" + String (p->name_) + "Strings").ch_C()); - if( scm_ilength (strings) < 3) + SCM strings = get_property (("pedal" + String (p->name_) + "Strings").ch_C ()); + if (scm_ilength (strings) < 3) continue; if (p->req_l_drul_[STOP] && p->req_l_drul_[START]) { if (!p->start_req_l_) { - p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: %s", p->name_ )); + p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: %s", p->name_)); } else { @@ -151,7 +151,7 @@ Piano_pedal_engraver::create_grobs () { if (!p->start_req_l_) { - p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: %s", p->name_ )); + p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: %s", p->name_)); } else { @@ -168,7 +168,7 @@ Piano_pedal_engraver::create_grobs () if (gh_string_p (s)) { String propname = String (p->name_) + "Pedal"; - p->item_p_ = new Item (get_property (propname.ch_C())); + p->item_p_ = new Item (get_property (propname.ch_C ())); p->item_p_->set_grob_property ("text", s); announce_grob (p->item_p_, diff --git a/lily/piano-pedal-performer.cc b/lily/piano-pedal-performer.cc index bed707a87c..36f91d131d 100644 --- a/lily/piano-pedal-performer.cc +++ b/lily/piano-pedal-performer.cc @@ -49,7 +49,7 @@ Piano_pedal_performer::Piano_pedal_performer () info_alist_ = 0; } -Piano_pedal_performer::~Piano_pedal_performer() +Piano_pedal_performer::~Piano_pedal_performer () { delete[] info_alist_; } @@ -71,7 +71,7 @@ Piano_pedal_performer::initialize () p++; } - while (*(np ++)); + while (* (np ++)); } void @@ -130,14 +130,14 @@ Piano_pedal_performer::start_translation_timestep () bool Piano_pedal_performer::try_music (Music* r) { - if (Span_req * s = dynamic_cast(r)) + if (Span_req * s = dynamic_cast (r)) { for (Pedal_info*p = info_alist_; p->name_; p ++) { if (scm_equal_p (s->get_mus_property ("span-type"), ly_str02scm (p->name_)) == SCM_BOOL_T) { - p->req_l_drul_[s->get_span_dir()] = s; + p->req_l_drul_[s->get_span_dir ()] = s; return true; } } diff --git a/lily/pitch.cc b/lily/pitch.cc index a1d4121f8f..5219e5180b 100644 --- a/lily/pitch.cc +++ b/lily/pitch.cc @@ -22,7 +22,7 @@ Pitch::Pitch (int o, int n, int a) if (n < 0 || n >= 7 || a < -2 || a > 2) { - String s = _("Pitch arguments out of range"); + String s = _ ("Pitch arguments out of range"); s += ": alteration = " + to_str (a); s += ", notename = " + to_str (n); warning (s); @@ -150,7 +150,7 @@ String Pitch::str () const { int n = (notename_i_ + 2) % 7; - String s = to_str (char(n + 'a')); + String s = to_str (char (n + 'a')); if (alteration_i_) s += String (accname[alteration_i_ + 2]); @@ -239,15 +239,15 @@ pitch_transpose (SCM p, SCM delta) /****************************************************************/ -IMPLEMENT_TYPE_P(Pitch, "pitch?"); -IMPLEMENT_UNSMOB(Pitch, pitch); +IMPLEMENT_TYPE_P (Pitch, "pitch?"); +IMPLEMENT_UNSMOB (Pitch, pitch); SCM -Pitch::mark_smob (SCM ) +Pitch::mark_smob (SCM) { return SCM_EOL; } -IMPLEMENT_SIMPLE_SMOBS(Pitch); +IMPLEMENT_SIMPLE_SMOBS (Pitch); int @@ -256,7 +256,7 @@ Pitch::print_smob (SCM s, SCM port, scm_print_state *) Pitch *r = (Pitch *) gh_cdr (s); scm_puts ("#str().ch_C()), port); + scm_display (ly_str02scm (r->str ().ch_C ()), port); scm_puts (" >", port); return 1; @@ -275,14 +275,14 @@ Pitch::equal_p (SCM a , SCM b) return eq ? SCM_BOOL_T : SCM_BOOL_F; } -MAKE_SCHEME_CALLBACK(Pitch, less_p, 2); +MAKE_SCHEME_CALLBACK (Pitch, less_p, 2); SCM Pitch::less_p (SCM p1, SCM p2) { Pitch *a = unsmob_pitch (p1); Pitch *b = unsmob_pitch (p2); - if (compare(*a, *b) < 0 ) + if (compare (*a, *b) < 0) return SCM_BOOL_T; else return SCM_BOOL_F; @@ -307,7 +307,7 @@ pitch_octave (SCM pp) if (!p) warning ("Not a pitch"); else - q = p->octave_i(); + q = p->octave_i (); return gh_int2scm (q); } @@ -320,7 +320,7 @@ pitch_alteration (SCM pp) if (!p) warning ("Not a pitch"); else - q = p->alteration_i(); + q = p->alteration_i (); return gh_int2scm (q); } @@ -333,7 +333,7 @@ pitch_notename (SCM pp) if (!p) warning ("Not a pitch"); else - q = p->notename_i(); + q = p->notename_i (); return gh_int2scm (q); } @@ -346,15 +346,15 @@ pitch_semitones (SCM pp) if (!p) warning ("Not a pitch"); else - q = p->steps(); + q = p->steps (); return gh_int2scm (q); } static void -add_funcs() +add_funcs () { - // should take list?: (make-pitch '(octave name accidental)) + // should take list?: (make-pitch ' (octave name accidental)) scm_make_gsubr ("make-pitch", 3, 0, 0, (Scheme_function_unknown)make_pitch); scm_make_gsubr ("pitch-octave", 1, 0, 0, (Scheme_function_unknown)pitch_octave); @@ -364,7 +364,7 @@ add_funcs() scm_make_gsubr ("Pitch::transpose", 2, 0, 0, (Scheme_function_unknown) pitch_transpose); } -ADD_SCM_INIT_FUNC(pitch, add_funcs); +ADD_SCM_INIT_FUNC (pitch, add_funcs); SCM Pitch::smobbed_copy ()const diff --git a/lily/property-engraver.cc b/lily/property-engraver.cc index d56ee274c8..6c1a81c3bb 100644 --- a/lily/property-engraver.cc +++ b/lily/property-engraver.cc @@ -31,19 +31,19 @@ protected: virtual void initialize (); virtual void finalize (); public: - ~Property_engraver(); - Property_engraver(); - VIRTUAL_COPY_CONS(Translator); + ~Property_engraver (); + Property_engraver (); + VIRTUAL_COPY_CONS (Translator); }; -Property_engraver::Property_engraver() +Property_engraver::Property_engraver () { prop_dict_ = 0; } void -Property_engraver::finalize() +Property_engraver::finalize () { } @@ -103,7 +103,7 @@ Property_engraver::apply_properties (SCM p, Grob *e, Translator_group*origin) SCM type_p = gh_cadr (entry); SCM elt_prop_sym = gh_caddr (entry); - SCM preset = scm_assq(elt_prop_sym, e->mutable_property_alist_); + SCM preset = scm_assq (elt_prop_sym, e->mutable_property_alist_); if (preset != SCM_BOOL_F) continue; @@ -152,4 +152,4 @@ Property_engraver::apply_properties (SCM p, Grob *e, Translator_group*origin) } } -ADD_THIS_TRANSLATOR(Property_engraver); +ADD_THIS_TRANSLATOR (Property_engraver); diff --git a/lily/property-inspect.cc b/lily/property-inspect.cc index 30a6dc3372..e69de29bb2 100644 --- a/lily/property-inspect.cc +++ b/lily/property-inspect.cc @@ -1,9 +0,0 @@ -/* - property-inspect.cc -- implement Property inspect funcs. - - source file of the GNU LilyPond music typesetter - - (c) 1999--2001 Han-Wen Nienhuys - - */ - diff --git a/lily/property-iterator.cc b/lily/property-iterator.cc index 9d61539a12..171a872b3f 100644 --- a/lily/property-iterator.cc +++ b/lily/property-iterator.cc @@ -19,7 +19,7 @@ void Property_iterator::process (Moment m) { SCM sym = music_l_->get_mus_property ("symbol"); - if (gh_symbol_p(sym)) + if (gh_symbol_p (sym)) { SCM val = music_l_->get_mus_property ("value"); bool ok= true; @@ -38,7 +38,7 @@ Push_property_iterator::process (Moment m) SCM eprop = music_l_->get_mus_property ("grob-property"); SCM val = music_l_->get_mus_property ("grob-value"); - if (to_boolean (music_l_->get_mus_property ( "pop-first"))) + if (to_boolean (music_l_->get_mus_property ("pop-first"))) Translator_def::apply_pushpop_property (report_to_l (), syms, eprop, SCM_UNDEFINED); @@ -57,6 +57,6 @@ Pop_property_iterator::process (Moment m) Simple_music_iterator::process (m); } -IMPLEMENT_CTOR_CALLBACK(Pop_property_iterator); -IMPLEMENT_CTOR_CALLBACK(Push_property_iterator); -IMPLEMENT_CTOR_CALLBACK(Property_iterator); +IMPLEMENT_CTOR_CALLBACK (Pop_property_iterator); +IMPLEMENT_CTOR_CALLBACK (Push_property_iterator); +IMPLEMENT_CTOR_CALLBACK (Property_iterator); diff --git a/lily/protected-scm.cc b/lily/protected-scm.cc index 3628ef7078..3c4bcfabf6 100644 --- a/lily/protected-scm.cc +++ b/lily/protected-scm.cc @@ -17,22 +17,22 @@ Protected_scm::Protected_scm () Protected_scm::Protected_scm (SCM s) { - object_ = SCM_NIMP(s) ? scm_protect_object (s): s; + object_ = SCM_NIMP (s) ? scm_protect_object (s): s; } Protected_scm::Protected_scm (Protected_scm const &s) { - object_ = SCM_NIMP(s.object_) ? scm_protect_object (s.object_) : s.object_; + object_ = SCM_NIMP (s.object_) ? scm_protect_object (s.object_) : s.object_; } Protected_scm & -Protected_scm::operator =(SCM s) +Protected_scm::operator = (SCM s) { if (object_ == s) return *this; if (SCM_NIMP (object_)) - scm_unprotect_object(object_); + scm_unprotect_object (object_); object_ = SCM_NIMP (s) ? scm_protect_object (s): s; return *this; @@ -47,7 +47,7 @@ Protected_scm::operator = (Protected_scm const &s) Protected_scm::~Protected_scm () { - if (SCM_NIMP (object_)) + if (SCM_NIMP (object_)) { scm_unprotect_object (object_); } diff --git a/lily/relative-octave-music.cc b/lily/relative-octave-music.cc index 770fa11d61..3f69f920a0 100644 --- a/lily/relative-octave-music.cc +++ b/lily/relative-octave-music.cc @@ -17,11 +17,15 @@ Relative_octave_music::to_relative_octave (Pitch) } -Relative_octave_music::Relative_octave_music(SCM l) +Relative_octave_music::Relative_octave_music (SCM l) : Music_wrapper (l) { set_mus_property ("type", ly_symbol2scm ("relative-octave-music")); } +Relative_octave_music::Relative_octave_music () +{ + set_mus_property ("type", ly_symbol2scm ("relative-octave-music")); +} - +ADD_MUSIC (Relative_octave_music); diff --git a/lily/repeat-acknowledge-engraver.cc b/lily/repeat-acknowledge-engraver.cc index bba68ba1ae..d4891d97ac 100644 --- a/lily/repeat-acknowledge-engraver.cc +++ b/lily/repeat-acknowledge-engraver.cc @@ -26,7 +26,7 @@ class Repeat_acknowledge_engraver : public Engraver { public: VIRTUAL_COPY_CONS (Translator); - Repeat_acknowledge_engraver(); + Repeat_acknowledge_engraver (); virtual void start_translation_timestep (); virtual void process_music (); @@ -43,7 +43,7 @@ Repeat_acknowledge_engraver::initialize () } -Repeat_acknowledge_engraver::Repeat_acknowledge_engraver() +Repeat_acknowledge_engraver::Repeat_acknowledge_engraver () { } @@ -85,7 +85,7 @@ Repeat_acknowledge_engraver::process_music () cs = gh_cdr (cs); } - if (start && end ) + if (start && end) s = ":|:"; else if (start) s = "|:"; @@ -97,8 +97,8 @@ Repeat_acknowledge_engraver::process_music () */ if (s != "" || (volta_found && !gh_string_p (get_property ("whichBar")))) { - daddy_trans_l_->set_property ("whichBar", ly_str02scm(s.ch_C())); + daddy_trans_l_->set_property ("whichBar", ly_str02scm (s.ch_C ())); } } -ADD_THIS_TRANSLATOR(Repeat_acknowledge_engraver); +ADD_THIS_TRANSLATOR (Repeat_acknowledge_engraver); diff --git a/lily/repeated-music.cc b/lily/repeated-music.cc index 665b00e1c6..3935cc3a1d 100644 --- a/lily/repeated-music.cc +++ b/lily/repeated-music.cc @@ -21,10 +21,11 @@ Repeated_music::body ()const Music_sequence* Repeated_music::alternatives ()const { - return dynamic_cast (unsmob_music (get_mus_property ("alternatives"))); + return dynamic_cast (unsmob_music (get_mus_property ("alternatives"))); } -Repeated_music::Repeated_music(SCM l) + +Repeated_music::Repeated_music (SCM l) : Music (l) { set_mus_property ("type", ly_symbol2scm ("repeated-music")); @@ -69,10 +70,10 @@ Repeated_music::compress (Moment p) Moment Repeated_music::alternatives_length_mom (bool fold) const { - if (!alternatives () ) + if (!alternatives ()) return 0; - if (fold) + if (fold) return alternatives ()->maximum_length (); Moment m =0; @@ -109,6 +110,10 @@ Repeated_music::alternatives_volta_length_mom () const return m; } + +/* + Length of the body in THIS. Disregards REPEAT-COUNT. + */ Moment Repeated_music::body_length_mom () const { @@ -127,9 +132,9 @@ Repeated_music::repeat_count () const } -MAKE_SCHEME_CALLBACK(Repeated_music,unfolded_music_length, 1); -MAKE_SCHEME_CALLBACK(Repeated_music,folded_music_length, 1); -MAKE_SCHEME_CALLBACK(Repeated_music,volta_music_length, 1); +MAKE_SCHEME_CALLBACK (Repeated_music,unfolded_music_length, 1); +MAKE_SCHEME_CALLBACK (Repeated_music,folded_music_length, 1); +MAKE_SCHEME_CALLBACK (Repeated_music,volta_music_length, 1); SCM Repeated_music::unfolded_music_length (SCM m) @@ -156,3 +161,11 @@ Repeated_music::volta_music_length (SCM m) Moment l = r->body_length_mom () + r->alternatives_volta_length_mom (); return l.smobbed_copy (); } + +ADD_MUSIC (Repeated_music); + +Repeated_music::Repeated_music () + : Music (SCM_EOL) +{ + set_mus_property ("type", ly_symbol2scm ("repeated-music")); +} diff --git a/lily/request-chord-iterator.cc b/lily/request-chord-iterator.cc index 118279299b..55372a463f 100644 --- a/lily/request-chord-iterator.cc +++ b/lily/request-chord-iterator.cc @@ -33,10 +33,10 @@ Request_chord_iterator::get_req_translator_l () } void -Request_chord_iterator::construct_children() +Request_chord_iterator::construct_children () { Simple_music_iterator::construct_children (); - get_req_translator_l(); + get_req_translator_l (); } Request_chord* @@ -73,10 +73,10 @@ Request_chord_iterator::process (Moment m) bool gotcha = try_music (mus); if (!gotcha) - mus->origin ()->warning (_f ("Junking request: `%s'", classname(mus))); + mus->origin ()->warning (_f ("Junking request: `%s'", classname (mus))); } } skip (m); } -IMPLEMENT_CTOR_CALLBACK(Request_chord_iterator); +IMPLEMENT_CTOR_CALLBACK (Request_chord_iterator); diff --git a/lily/rest-collision-engraver.cc b/lily/rest-collision-engraver.cc index 0ebc5dde5e..1443d70790 100644 --- a/lily/rest-collision-engraver.cc +++ b/lily/rest-collision-engraver.cc @@ -20,16 +20,16 @@ class Rest_collision_engraver : public Engraver protected: virtual void acknowledge_grob (Grob_info); virtual void create_grobs (); - virtual void stop_translation_timestep(); + virtual void stop_translation_timestep (); public: - VIRTUAL_COPY_CONS(Translator); - Rest_collision_engraver(); + VIRTUAL_COPY_CONS (Translator); + Rest_collision_engraver (); }; -ADD_THIS_TRANSLATOR(Rest_collision_engraver); +ADD_THIS_TRANSLATOR (Rest_collision_engraver); -Rest_collision_engraver::Rest_collision_engraver() +Rest_collision_engraver::Rest_collision_engraver () { rest_collision_p_ =0; } @@ -44,7 +44,7 @@ Rest_collision_engraver::create_grobs () Rest_collision::set_interface (rest_collision_p_); announce_grob (rest_collision_p_, 0); for (int i=0; i< note_column_l_arr_.size (); i++) - Rest_collision::add_column ( rest_collision_p_,note_column_l_arr_[i]); + Rest_collision::add_column (rest_collision_p_,note_column_l_arr_[i]); } void @@ -55,7 +55,7 @@ Rest_collision_engraver::acknowledge_grob (Grob_info i) } void -Rest_collision_engraver::stop_translation_timestep() +Rest_collision_engraver::stop_translation_timestep () { if (rest_collision_p_) { diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index aaaa743fd1..bd4c308d0f 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -19,7 +19,7 @@ #include "staff-symbol-referencer.hh" #include "duration.hh" -MAKE_SCHEME_CALLBACK(Rest_collision,force_shift_callback,2); +MAKE_SCHEME_CALLBACK (Rest_collision,force_shift_callback,2); SCM Rest_collision::force_shift_callback (SCM element_smob, SCM axis) { @@ -52,7 +52,7 @@ Rest_collision::add_column (Grob*me,Grob *p) /* only add callback for the rests, since we don't move anything else. - (not?) + (not?) */ p->add_offset_callback (Rest_collision::force_shift_callback_proc, Y_AXIS); p->set_grob_property ("rest-collision", me->self_scm ()); @@ -96,7 +96,7 @@ Rest_collision::do_shift (Grob *me, SCM elts) if (!commony) commony = e; else - commony= commony->common_refpoint (e, Y_AXIS); + commony= commony->common_refpoint (e, Y_AXIS); if (unsmob_grob (e->get_grob_property ("rest"))) rests.push (e); @@ -115,21 +115,21 @@ Rest_collision::do_shift (Grob *me, SCM elts) */ // no rests to collide - if (!rests.size()) + if (!rests.size ()) return SCM_UNSPECIFIED; // no partners to collide with - if (rests.size() + notes.size () < 2) + if (rests.size () + notes.size () < 2) return SCM_UNSPECIFIED; // meisjes met meisjes - if (!notes.size()) + if (!notes.size ()) { - SCM characteristic = head_characteristic (rests[0]); + SCM characteristic = head_characteristic (rests[0]); int i = 1; for (; i < rests.size (); i++) { - if (!gh_equal_p (head_characteristic (rests[i]), characteristic)) + if (!gh_equal_p (head_characteristic (rests[i]), characteristic)) break; } @@ -137,7 +137,7 @@ Rest_collision::do_shift (Grob *me, SCM elts) If all durations are the same, we'll check if there are more rests than maximum-rest-count. Otherwise (different durations), we'll try to display them all - (urg: all 3 of them, currently). + (urg: all 3 of them, currently). */ int display_count; SCM s = me->get_grob_property ("maximum-rest-count"); @@ -187,11 +187,11 @@ Rest_collision::do_shift (Grob *me, SCM elts) { if (rests.size () > 1) { - warning (_("too many colliding rests")); + warning (_ ("too many colliding rests")); } if (notes.size () > 1) { - warning (_("too many notes for rest collision")); + warning (_ ("too many notes for rest collision")); } Grob * rcol = rests[0]; @@ -213,7 +213,7 @@ Rest_collision::do_shift (Grob *me, SCM elts) assumption: ref points are the same. */ Interval notedim; - for (int i = 0; i < notes.size(); i++) + for (int i = 0; i < notes.size (); i++) { Grob * stem = Note_column::stem_l (notes[i]); Grob * head = Stem::first_head (stem); diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index 69839a7e29..702b98b5aa 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -26,7 +26,7 @@ protected: public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Rest_engraver (); }; @@ -104,4 +104,4 @@ Rest_engraver::try_music (Music *m) } -ADD_THIS_TRANSLATOR(Rest_engraver); +ADD_THIS_TRANSLATOR (Rest_engraver); diff --git a/lily/rest.cc b/lily/rest.cc index f05f5c0f55..4bbdaa5146 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -15,7 +15,7 @@ #include "staff-symbol-referencer.hh" // -> offset callback -MAKE_SCHEME_CALLBACK(Rest,after_line_breaking,1); +MAKE_SCHEME_CALLBACK (Rest,after_line_breaking,1); SCM Rest::after_line_breaking (SCM smob) { @@ -37,7 +37,7 @@ Rest::after_line_breaking (SCM smob) } -MAKE_SCHEME_CALLBACK(Rest,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Rest,brew_molecule,1); SCM Rest::brew_internal_molecule (SCM smob) @@ -51,7 +51,7 @@ Rest::brew_internal_molecule (SCM smob) if (balltype == gh_int2scm (0) || balltype == gh_int2scm (1)) { int sz = Staff_symbol_referencer::line_count (me); - Real dif = abs(Staff_symbol_referencer::position_f (me) - (2* gh_scm2int (balltype) - 1)); + Real dif = abs (Staff_symbol_referencer::position_f (me) - (2* gh_scm2int (balltype) - 1)); ledger_b = dif > sz; } @@ -62,10 +62,10 @@ Rest::brew_internal_molecule (SCM smob) style = ly_scm2string (scm_symbol_to_string (style_sym)); } - String idx = ("rests-") + to_str (gh_scm2int (balltype)) + String idx = ("rests-") + to_str (gh_scm2int (balltype)) + (ledger_b ? "o" : "") + style; - return Font_interface::get_default_font (me)->find_by_name (idx).smobbed_copy(); + return Font_interface::get_default_font (me)->find_by_name (idx).smobbed_copy (); } SCM @@ -73,7 +73,7 @@ Rest::brew_molecule (SCM smob) { return brew_internal_molecule (smob); } -MAKE_SCHEME_CALLBACK(Rest,extent_callback,2); +MAKE_SCHEME_CALLBACK (Rest,extent_callback,2); /* We need the callback. The real molecule has ledgers depending on Y-position. The Y-position is known only after line breaking. */ diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index a7b89c7c7f..f5287f998c 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -25,19 +25,19 @@ class Rhythmic_column_engraver :public Engraver Grob *dotcol_l_; protected: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); virtual void acknowledge_grob (Grob_info); virtual void create_grobs (); - virtual void stop_translation_timestep(); - virtual void start_translation_timestep(); + virtual void stop_translation_timestep (); + virtual void start_translation_timestep (); public: - Rhythmic_column_engraver(); + Rhythmic_column_engraver (); }; -Rhythmic_column_engraver::Rhythmic_column_engraver() +Rhythmic_column_engraver::Rhythmic_column_engraver () { stem_l_ =0; ncol_p_=0; @@ -52,14 +52,14 @@ Rhythmic_column_engraver::create_grobs () { if (!ncol_p_) { - ncol_p_ = new Item (get_property("NoteColumn")); + ncol_p_ = new Item (get_property ("NoteColumn")); Note_column::set_interface (ncol_p_); announce_grob (ncol_p_, 0); } for (int i=0; i < rhead_l_arr_.size (); i++) { - if (!rhead_l_arr_[i]->parent_l(X_AXIS)) + if (!rhead_l_arr_[i]->parent_l (X_AXIS)) Note_column::add_head (ncol_p_, rhead_l_arr_[i]); } rhead_l_arr_.set_size (0); @@ -75,7 +75,7 @@ Rhythmic_column_engraver::create_grobs () } if (stem_l_ - && !stem_l_->parent_l(X_AXIS)) + && !stem_l_->parent_l (X_AXIS)) { Note_column::set_stem (ncol_p_, stem_l_); stem_l_ = 0; @@ -85,7 +85,7 @@ Rhythmic_column_engraver::create_grobs () bool wegrace = to_boolean (wg); if (!wegrace) - for (int i=0; i < grace_slur_endings_.size(); i++) + for (int i=0; i < grace_slur_endings_.size (); i++) Slur::add_column (grace_slur_endings_[i], ncol_p_); grace_slur_endings_.clear (); } @@ -125,7 +125,7 @@ Rhythmic_column_engraver::acknowledge_grob (Grob_info i) } void -Rhythmic_column_engraver::stop_translation_timestep() +Rhythmic_column_engraver::stop_translation_timestep () { if (ncol_p_) { @@ -135,12 +135,12 @@ Rhythmic_column_engraver::stop_translation_timestep() } void -Rhythmic_column_engraver::start_translation_timestep() +Rhythmic_column_engraver::start_translation_timestep () { grace_slur_endings_.clear (); dotcol_l_ =0; stem_l_ =0; } -ADD_THIS_TRANSLATOR(Rhythmic_column_engraver); +ADD_THIS_TRANSLATOR (Rhythmic_column_engraver); diff --git a/lily/rod.cc b/lily/rod.cc index 52d71b3812..932133f339 100644 --- a/lily/rod.cc +++ b/lily/rod.cc @@ -35,10 +35,10 @@ Rod::columnize () void Rod::add_to_cols () { - columnize(); + columnize (); if (item_l_drul_[LEFT] != item_l_drul_[RIGHT]) Spaceable_grob::add_rod (item_l_drul_[LEFT], item_l_drul_[RIGHT], - distance_f_ ); + distance_f_); } diff --git a/lily/scaled-font-metric.cc b/lily/scaled-font-metric.cc index 6b9be2b972..c815c086cc 100644 --- a/lily/scaled-font-metric.cc +++ b/lily/scaled-font-metric.cc @@ -35,7 +35,7 @@ Scaled_font_metric::find_by_name (String s) const Molecule m = orig_l_->find_by_name (s); Box b = m.extent_box (); b.scale (magnification_f_); - Molecule q(b,fontify_atom ((Font_metric*) this, m.get_expr ())); + Molecule q (b,fontify_atom ((Font_metric*) this, m.get_expr ())); return q ; } diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index cd8841a5ea..2dfca6d4e6 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -25,7 +25,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) { Scm_stl_map::operator = (src); @@ -39,9 +39,9 @@ Scheme_hash_table::mark_smob (SCM s) can't typecheck naively, since GC bit lives in CAR of S */ - Scheme_hash_table *me = (Scheme_hash_table*) SCM_CELL_WORD_1(s); + Scheme_hash_table *me = (Scheme_hash_table*) SCM_CELL_WORD_1 (s); - for (Scm_stl_map::const_iterator i= me->begin (); i != me->end(); i++) + for (Scm_stl_map::const_iterator i= me->begin (); i != me->end (); i++) { scm_gc_mark ((*i).first); scm_gc_mark ((*i).second); @@ -56,8 +56,8 @@ Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state*) char str[1000]; sprintf (str, "#begin (); i != me->end(); i++) + Scheme_hash_table *me = unsmob (s); + for (Scm_stl_map::const_iterator i = me->begin (); i != me->end (); i++) { scm_display ((*i).first, p); scm_puts (" = ",p); @@ -88,18 +88,18 @@ Scheme_hash_table::elem_b (SCM k) const void Scheme_hash_table::set (SCM k, SCM v) { - (*this)[k] = v; + (*this)[k] = v; } // UGH. SCM Scheme_hash_table::get (SCM k)const { - return (*(Scheme_hash_table*)this)[k]; + return (* (Scheme_hash_table*)this)[k]; } -Scheme_hash_table::~Scheme_hash_table( ) +Scheme_hash_table::~Scheme_hash_table () { } @@ -107,15 +107,15 @@ SCM Scheme_hash_table::to_alist () const { SCM l = SCM_EOL; - for (Scm_stl_map ::const_iterator i = begin (); i != end(); i++) + for (Scm_stl_map ::const_iterator i = begin (); i != end (); i++) l = gh_cons (gh_cons ((*i).first, (*i).second), l); return l; } -IMPLEMENT_UNSMOB(Scheme_hash_table,scheme_hash); -IMPLEMENT_SMOBS(Scheme_hash_table); -IMPLEMENT_DEFAULT_EQUAL_P(Scheme_hash_table); +IMPLEMENT_UNSMOB (Scheme_hash_table,scheme_hash); +IMPLEMENT_SMOBS (Scheme_hash_table); +IMPLEMENT_DEFAULT_EQUAL_P (Scheme_hash_table); diff --git a/lily/scope.cc b/lily/scope.cc index 8fec4384b1..f578433a80 100644 --- a/lily/scope.cc +++ b/lily/scope.cc @@ -20,7 +20,7 @@ Scope::Scope (Scheme_hash_table * st) bool Scope::elem_b (String s) const { - return id_dict_->elem_b (ly_symbol2scm (s.ch_C())); + return id_dict_->elem_b (ly_symbol2scm (s.ch_C ())); } bool @@ -39,14 +39,14 @@ Scope::scm_elem (SCM s)const SCM Scope::scm_elem (String s) const { - return scm_elem (ly_symbol2scm (s.ch_C())); + return scm_elem (ly_symbol2scm (s.ch_C ())); } void Scope::set (String s, SCM id) { - return id_dict_->set (ly_symbol2scm (s.ch_C()), id); + return id_dict_->set (ly_symbol2scm (s.ch_C ()), id); } SCM diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 5f39102e27..a85c72c895 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -19,7 +19,7 @@ #include "translator-def.hh" -Score_engraver::Score_engraver() +Score_engraver::Score_engraver () { scoreline_l_ =0; command_column_l_ =0; @@ -40,11 +40,11 @@ Score_engraver::make_columns (Moment w) set_columns (new Paper_column (get_property (ly_symbol2scm ("NonMusicalPaperColumn"))), new Paper_column (get_property (ly_symbol2scm ("PaperColumn")))); - command_column_l_->set_grob_property ("when", w.smobbed_copy()); - musical_column_l_->set_grob_property ("when", w.smobbed_copy()); + command_column_l_->set_grob_property ("when", w.smobbed_copy ()); + musical_column_l_->set_grob_property ("when", w.smobbed_copy ()); command_column_l_->set_grob_property ("breakable", SCM_BOOL_T); - Grob_info i1(command_column_l_, 0), i2 (musical_column_l_,0); + Grob_info i1 (command_column_l_, 0), i2 (musical_column_l_,0); i1.origin_trans_l_ = this; i2.origin_trans_l_ = this; @@ -59,17 +59,17 @@ Score_engraver::prepare (Moment w) Global_translator::prepare (w); make_columns (w); - post_move_processing(); + post_move_processing (); } void -Score_engraver::finish() +Score_engraver::finish () { if ((breaks_i_%8)) - progress_indication ("[" + to_str ( breaks_i_) + "]"); + progress_indication ("[" + to_str (breaks_i_) + "]"); - check_removal(); - removal_processing(); + check_removal (); + removal_processing (); } /* @@ -83,7 +83,7 @@ Score_engraver::initialize () assert (dynamic_cast (output_def_l_)); assert (!daddy_trans_l_); pscore_p_ = new Paper_score; - pscore_p_->paper_l_ = dynamic_cast(output_def_l_); + pscore_p_->paper_l_ = dynamic_cast (output_def_l_); SCM props = get_property (ly_symbol2scm ("LineOfScore")); @@ -92,19 +92,19 @@ Score_engraver::initialize () make_columns (Moment (0)); scoreline_l_ = pscore_p_->line_l_; - scoreline_l_->set_bound(LEFT, command_column_l_); + scoreline_l_->set_bound (LEFT, command_column_l_); command_column_l_->set_grob_property ("breakable", SCM_BOOL_T); - Engraver_group_engraver::initialize(); + Engraver_group_engraver::initialize (); } void -Score_engraver::finalize() +Score_engraver::finalize () { - Engraver_group_engraver::finalize(); - scoreline_l_->set_bound(RIGHT,command_column_l_); + Engraver_group_engraver::finalize (); + scoreline_l_->set_bound (RIGHT,command_column_l_); command_column_l_->set_grob_property ("breakable", SCM_BOOL_T); typeset_all (); @@ -113,12 +113,12 @@ Score_engraver::finalize() } void -Score_engraver::one_time_step() +Score_engraver::one_time_step () { - process_music(); - announces(); - pre_move_processing(); - check_removal(); + process_music (); + announces (); + pre_move_processing (); + check_removal (); } void @@ -131,17 +131,17 @@ Score_engraver::announce_grob (Grob_info info) /* All elements are propagated to the top upon announcement. If something was created during one run of Engraver_group_engraver::do_announces, then - announce_info_arr_.size() will be nonzero again + announce_info_arr_.size () will be nonzero again */ /* junkme? Done by Engraver_group_engraver::do_announces ()? */ void -Score_engraver::do_announces() +Score_engraver::do_announces () { ////// do - Engraver_group_engraver::do_announces(); - //////while (announce_info_arr_.size()); + Engraver_group_engraver::do_announces (); + //////while (announce_info_arr_.size ()); } @@ -157,9 +157,9 @@ Score_engraver::typeset_grob (Grob *elem_p) void -Score_engraver::typeset_all() +Score_engraver::typeset_all () { - for (int i =0; i < elem_p_arr_.size(); i++) + for (int i =0; i < elem_p_arr_.size (); i++) { Grob * elem_p = elem_p_arr_[i]; @@ -173,7 +173,7 @@ Score_engraver::typeset_all() do { if (!s->get_bound (d)) { - s->set_bound(d, command_column_l_); + s->set_bound (d, command_column_l_); /* don't warn for empty/suicided spanners, it makes real warningsinvisible. maybe should be junked earlier? */ @@ -193,24 +193,24 @@ Score_engraver::typeset_all() } } - if (!elem_p->parent_l(Y_AXIS)) + if (!elem_p->parent_l (Y_AXIS)) Axis_group_interface::add_element (scoreline_l_, elem_p); } - elem_p_arr_.clear(); + elem_p_arr_.clear (); } void -Score_engraver::stop_translation_timestep() +Score_engraver::stop_translation_timestep () { // this generates all items. - Engraver_group_engraver::stop_translation_timestep(); + Engraver_group_engraver::stop_translation_timestep (); - typeset_all(); + typeset_all (); if (to_boolean (command_column_l_->get_grob_property ("breakable"))) { breaks_i_ ++; if (! (breaks_i_%8)) - progress_indication ("[" + to_str ( breaks_i_) + "]"); + progress_indication ("[" + to_str (breaks_i_) + "]"); } } @@ -257,9 +257,9 @@ Score_engraver::try_music (Music*r) gotcha = true; - SCM pen = command_column_l_->get_grob_property ("penalty"); + SCM pen = command_column_l_->get_grob_property ("penalty"); Real total_penalty = gh_number_p (pen) - ? gh_scm2double(pen) + ? gh_scm2double (pen) : 0.0; SCM rpen = b->get_mus_property ("penalty"); @@ -289,6 +289,6 @@ Score_engraver::forbid_breaks () command_column_l_->remove_grob_property ("breakable"); } -ADD_THIS_TRANSLATOR(Score_engraver); +ADD_THIS_TRANSLATOR (Score_engraver); diff --git a/lily/score-performer.cc b/lily/score-performer.cc index ff25e4cef4..e3d966e6e8 100644 --- a/lily/score-performer.cc +++ b/lily/score-performer.cc @@ -32,7 +32,7 @@ Score_performer::~Score_performer () void Score_performer::play_element (Audio_element * p) { - if (Audio_item * i=dynamic_cast (p)) + if (Audio_item * i=dynamic_cast (p)) { audio_column_l_->add_audio_item (i); } @@ -68,29 +68,29 @@ void Score_performer::one_time_step () { // fixme: put this back. - // process_music(); + // process_music (); announces (); - pre_move_processing(); - check_removal(); + pre_move_processing (); + check_removal (); } void -Score_performer::start() +Score_performer::start () { } int -Score_performer::get_tempo_i() const +Score_performer::get_tempo_i () const { return performance_p_->midi_l_->get_tempo_i (Moment (1, 4)); } void -Score_performer::finish() +Score_performer::finish () { check_removal (); - removal_processing(); + removal_processing (); } Music_output * @@ -107,7 +107,7 @@ Score_performer::initialize () unsmob_translator_def (definition_)->apply_property_operations (this); assert (dynamic_cast (output_def_l_)); performance_p_ = new Performance; - performance_p_->midi_l_ = dynamic_cast(output_def_l_); + performance_p_->midi_l_ = dynamic_cast (output_def_l_); Translator_group::initialize (); } diff --git a/lily/score.cc b/lily/score.cc index f864b58433..962f820257 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -26,8 +26,8 @@ TODO: junkme. */ -Score::Score() - : Input() +Score::Score () + : Input () { header_p_ = 0; music_ = SCM_EOL; @@ -43,22 +43,22 @@ Score::Score (Score const &s) smobify_self (); Music * m =unsmob_music (s.music_); - music_ = m?m->clone()->self_scm () : SCM_EOL; + music_ = m?m->clone ()->self_scm () : SCM_EOL; scm_unprotect_object (music_); for (int i=0; i < s.def_p_arr_.size (); i++) - def_p_arr_.push(s.def_p_arr_[i]->clone()); + def_p_arr_.push (s.def_p_arr_[i]->clone ()); errorlevel_i_ = s.errorlevel_i_; if (s.header_p_) { - header_p_ = (s.header_p_) ? new Scheme_hash_table (*s.header_p_): 0; + header_p_ = (s.header_p_) ? new Scheme_hash_table (*s.header_p_): 0; - scm_unprotect_object(header_p_->self_scm ()); + scm_unprotect_object (header_p_->self_scm ()); } } -Score::~Score() +Score::~Score () { } @@ -69,27 +69,27 @@ Score::run_translator (Music_output_def *odef_l) Cpu_timer timer; - Global_translator * trans_p = odef_l->get_global_translator_p(); + Global_translator * trans_p = odef_l->get_global_translator_p (); if (!trans_p) { programming_error ("no toplevel translator"); return ; } - progress_indication (_("Interpreting music...")); + progress_indication (_ ("Interpreting music...")); Music * music = unsmob_music (music_); trans_p->final_mom_ = music->length_mom (); Music_iterator * iter = Music_iterator::static_get_iterator_p (music); - iter->init_translator(music, trans_p); + iter->init_translator (music, trans_p); - iter->construct_children(); + iter->construct_children (); - if (! iter->ok()) + if (! iter->ok ()) { delete iter; - warning (_("Need music in a score")); + warning (_ ("Need music in a score")); errorlevel_i_ =1; return ; } @@ -105,20 +105,20 @@ Score::run_translator (Music_output_def *odef_l) warning (_ ("Errors found/*, not processing score*/")); } - Music_output * output = trans_p->get_output_p(); + Music_output * output = trans_p->get_output_p (); scm_unprotect_object (trans_p->self_scm ()); - if(verbose_global_b) + if (verbose_global_b) progress_indication (_f ("elapsed time: %.2f seconds", timer.read ())); if (!header_p_) header_p_ = new Scheme_hash_table; // ugh Scope bla (header_p_); output->header_l_ = &bla; - output->origin_str_ = location_str(); + output->origin_str_ = location_str (); progress_indication ("\n"); - output->process(); + output->process (); delete output ; /* @@ -126,11 +126,11 @@ Score::run_translator (Music_output_def *odef_l) the system. */ - scm_gc(); + scm_gc (); } void -Score::process() +Score::process () { if (!unsmob_music (music_)) return; @@ -139,7 +139,7 @@ Score::process() for (int i=0; i < def_p_arr_.size (); i++) { if (no_paper_global_b - && dynamic_cast(def_p_arr_[i])) + && dynamic_cast (def_p_arr_[i])) continue; run_translator (def_p_arr_[i]); } @@ -151,17 +151,17 @@ Score::process() void Score::add_output (Music_output_def *pap_p) { - def_p_arr_.push(pap_p); + def_p_arr_.push (pap_p); } -IMPLEMENT_SMOBS(Score); -IMPLEMENT_DEFAULT_EQUAL_P(Score); -IMPLEMENT_UNSMOB(Score, score); +IMPLEMENT_SMOBS (Score); +IMPLEMENT_DEFAULT_EQUAL_P (Score); +IMPLEMENT_UNSMOB (Score, score); SCM Score::mark_smob (SCM s) { - Score * sc = (Score*) SCM_CELL_WORD_1(s); + Score * sc = (Score*) SCM_CELL_WORD_1 (s); if (sc->header_p_) scm_gc_mark (sc->header_p_->self_scm ()); for (int i = sc->def_p_arr_.size (); i--;) diff --git a/lily/scores.cc b/lily/scores.cc index c6d9d15994..2e4e6b8bb5 100644 --- a/lily/scores.cc +++ b/lily/scores.cc @@ -57,7 +57,7 @@ void write_dependency_file (String fn, Array targets, #endif for (int i=0; i < deps.size (); i ++) { - if (out.length_i() > WRAPWIDTH) + if (out.length_i () > WRAPWIDTH) { f << out << "\\\n"; out = " "; @@ -79,7 +79,7 @@ void write_dependency_file (String fn, Array targets, } void -do_deps() +do_deps () { if (dependency_global_b) { @@ -93,22 +93,22 @@ do_deps() void -do_scores() +do_scores () { if (!global_header_p) global_header_p = new Scheme_hash_table; - for (int i=0; i < score_global_array.size(); i++) + for (int i=0; i < score_global_array.size (); i++) { Score* is_p = score_global_array[i]; if (is_p->errorlevel_i_) { - is_p->warning (_("Score contains errors; will not process it")); + is_p->warning (_ ("Score contains errors; will not process it")); exit_status_global |= 1; } else { - is_p->process(); + is_p->process (); } } do_deps (); @@ -119,7 +119,7 @@ clear_scores () { for (int i=0; i < score_global_array.size (); i++) scm_unprotect_object (score_global_array[i]->self_scm ()); - score_global_array.clear(); + score_global_array.clear (); inclusion_global_array.clear (); if (global_header_p) @@ -134,7 +134,7 @@ do_one_file (String init_str, String file_str) if (init_str.length_i () && global_path.find (init_str).empty_b ()) { warning (_f ("can't find file: `%s'", init_str)); - warning (_f ("(search path: `%s')", global_path.str ().ch_C())); + warning (_f ("(search path: `%s')", global_path.str ().ch_C ())); return; } if ((file_str != "-") && global_path.find (file_str).empty_b ()) diff --git a/lily/script-column-engraver.cc b/lily/script-column-engraver.cc index 5f0b41db4e..93083a1cb0 100644 --- a/lily/script-column-engraver.cc +++ b/lily/script-column-engraver.cc @@ -22,7 +22,7 @@ class Script_column_engraver : public Engraver public: Script_column_engraver (); - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); protected: virtual void acknowledge_grob (Grob_info); virtual void create_grobs (); @@ -31,7 +31,7 @@ protected: }; -Script_column_engraver::Script_column_engraver() +Script_column_engraver::Script_column_engraver () { scol_p_ =0; } @@ -54,7 +54,7 @@ Script_column_engraver::start_translation_timestep () } void -Script_column_engraver::acknowledge_grob(Grob_info inf) +Script_column_engraver::acknowledge_grob (Grob_info inf) { Item *thing = dynamic_cast (inf.elem_l_); if (thing && Side_position_interface::has_interface (inf.elem_l_)) // ugh FIXME @@ -85,4 +85,4 @@ Script_column_engraver::create_grobs () script_l_arr_.clear (); } } -ADD_THIS_TRANSLATOR(Script_column_engraver); +ADD_THIS_TRANSLATOR (Script_column_engraver); diff --git a/lily/script-column.cc b/lily/script-column.cc index 1bddead770..68e21514a7 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -33,7 +33,7 @@ staff_side_compare (Grob * const &i1, return gh_scm2int (p1) - gh_scm2int (p2); } -MAKE_SCHEME_CALLBACK(Script_column,before_line_breaking,1); +MAKE_SCHEME_CALLBACK (Script_column,before_line_breaking,1); SCM Script_column::before_line_breaking (SCM smob) @@ -52,7 +52,7 @@ Script_column::before_line_breaking (SCM smob) Direction d = DOWN; do { - Link_array &arr(arrs[d]); + Link_array &arr (arrs[d]); arr.sort (staff_side_compare); @@ -61,7 +61,7 @@ Script_column::before_line_breaking (SCM smob) { if (last) - Side_position_interface::add_support( arr[i],last); + Side_position_interface::add_support (arr[i],last); arr[i]->remove_grob_property ("script-priority"); last = arr[i]; diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index ee65cbcb26..4b2c44773d 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -32,7 +32,7 @@ protected: void Script_engraver::initialize () { - script_req_l_arr_.clear(); + script_req_l_arr_.clear (); } bool @@ -40,7 +40,7 @@ Script_engraver::try_music (Music *r_l) { if (Articulation_req *mr = dynamic_cast (r_l)) { - for (int i=0; i < script_req_l_arr_.size(); i++) + for (int i=0; i < script_req_l_arr_.size (); i++) { if (script_req_l_arr_[i]->equal_b (mr)) return true; @@ -54,7 +54,7 @@ Script_engraver::try_music (Music *r_l) void Script_engraver::process_music () { - for (int i=0; i < script_req_l_arr_.size(); i++) + for (int i=0; i < script_req_l_arr_.size (); i++) { Articulation_req* l=script_req_l_arr_[i]; @@ -64,7 +64,7 @@ Script_engraver::process_music () if (art == SCM_BOOL_F) { String a = ly_scm2string (l->get_mus_property ("articulation-type")); - l->origin ()->warning (_f ("Don't know how to interpret articulation `%s'", a.ch_C())); + l->origin ()->warning (_f ("Don't know how to interpret articulation `%s'", a.ch_C ())); continue; } @@ -74,17 +74,17 @@ Script_engraver::process_music () p->set_grob_property ("molecule", gh_car (art)); - art = gh_cdr(art); + art = gh_cdr (art); bool follow_staff = gh_scm2bool (gh_car (art)); - art = gh_cdr(art); + art = gh_cdr (art); SCM relative_stem_dir = gh_car (art); - art = gh_cdr(art); + art = gh_cdr (art); SCM force_dir = l->get_mus_property ("direction"); if (isdir_b (force_dir) && !to_dir (force_dir)) force_dir = gh_car (art); - art = gh_cdr(art); + art = gh_cdr (art); SCM priority = gh_car (art); @@ -128,7 +128,7 @@ Script_engraver::acknowledge_grob (Grob_info inf) if (Stem::has_interface (inf.elem_l_)) { - for (int i=0; i < script_p_arr_.size(); i++) + for (int i=0; i < script_p_arr_.size (); i++) { Grob*e = script_p_arr_[i]; @@ -139,7 +139,7 @@ Script_engraver::acknowledge_grob (Grob_info inf) } else if (Rhythmic_head::has_interface (inf.elem_l_)) { - for (int i=0; i < script_p_arr_.size(); i++) + for (int i=0; i < script_p_arr_.size (); i++) { Grob *e = script_p_arr_[i]; @@ -157,9 +157,9 @@ Script_engraver::acknowledge_grob (Grob_info inf) } void -Script_engraver::stop_translation_timestep() +Script_engraver::stop_translation_timestep () { - for (int i=0; i < script_p_arr_.size(); i++) + for (int i=0; i < script_p_arr_.size (); i++) { Grob * sc = script_p_arr_[i]; if (to_boolean (sc->get_grob_property ("staff-support"))) @@ -168,13 +168,13 @@ Script_engraver::stop_translation_timestep() } typeset_grob (sc); } - script_p_arr_.clear(); + script_p_arr_.clear (); } void -Script_engraver::start_translation_timestep() +Script_engraver::start_translation_timestep () { - script_req_l_arr_.clear(); + script_req_l_arr_.clear (); } ADD_THIS_TRANSLATOR (Script_engraver); diff --git a/lily/script.cc b/lily/script.cc index 78fbff9db1..2a43afc134 100644 --- a/lily/script.cc +++ b/lily/script.cc @@ -17,12 +17,12 @@ #include "lookup.hh" Molecule -Script::get_molecule(Grob * me, Direction d) +Script::get_molecule (Grob * me, Direction d) { SCM s = me->get_grob_property ("molecule"); assert (gh_pair_p (s)); - SCM key = gh_car (s); + SCM key = gh_car (s); if (key == ly_symbol2scm ("feta")) { return Font_interface::get_default_font (me)->find_by_name ("scripts-" + @@ -38,38 +38,44 @@ Script::get_molecule(Grob * me, Direction d) return Molecule (); } -MAKE_SCHEME_CALLBACK(Script,after_line_breaking,1); +MAKE_SCHEME_CALLBACK (Script,before_line_breaking,1); SCM -Script::after_line_breaking (SCM smob) +Script::before_line_breaking (SCM smob) { Grob * me = unsmob_grob (smob); Direction d = Side_position_interface::get_direction (me); + + if (!d) + { + /* + we should not have `arbitrary' directions. + */ + programming_error ("Script direction not yet known!"); + d = DOWN; + } + Side_position_interface::set_direction (me,d); return SCM_UNSPECIFIED; } -MAKE_SCHEME_CALLBACK(Script,brew_molecule,1); + +MAKE_SCHEME_CALLBACK (Script,brew_molecule,1); SCM Script::brew_molecule (SCM smob) { Grob *me= unsmob_grob (smob); -#if 0 - - SCM d = me->get_grob_property ("direction"); - if (isdir_b (d)) - dir = to_dir (d); -#endif - Direction dir = Side_position_interface::get_direction(me); + + Direction dir = Side_position_interface::get_direction (me); if (!dir) { programming_error ("Script direction not known, but molecule wanted."); dir= DOWN; } - return get_molecule (me, dir).smobbed_copy(); + return get_molecule (me, dir).smobbed_copy (); } bool @@ -83,3 +89,4 @@ Script::set_interface (Grob*me) { return me->set_interface (ly_symbol2scm ("script-interface")); } + diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index 643d67b912..dbef68ff5a 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -34,7 +34,7 @@ do_rod (Item *l, Item *r) rod.add_to_cols (); } -MAKE_SCHEME_CALLBACK(Separating_group_spanner,set_spacing_rods,1); +MAKE_SCHEME_CALLBACK (Separating_group_spanner,set_spacing_rods,1); SCM Separating_group_spanner::set_spacing_rods (SCM smob) { @@ -49,18 +49,18 @@ Separating_group_spanner::set_spacing_rods (SCM smob) SCM next_elt = gh_car (s); Item *l = dynamic_cast (unsmob_grob (elt)); - Item *r = dynamic_cast (unsmob_grob ( next_elt)); + Item *r = dynamic_cast (unsmob_grob (next_elt)); if (!r || !l) continue; Item *lb - = dynamic_cast(l->find_prebroken_piece (RIGHT)); + = dynamic_cast (l->find_prebroken_piece (RIGHT)); Item *rb - = dynamic_cast(r->find_prebroken_piece (LEFT)); + = dynamic_cast (r->find_prebroken_piece (LEFT)); - do_rod(l, r); + do_rod (l, r); if (lb) { do_rod (lb, r); @@ -83,7 +83,7 @@ Separating_group_spanner::set_spacing_rods (SCM smob) */ for (SCM s = me->get_grob_property ("elements"); gh_pair_p (s); s = gh_cdr (s)) { - Item * it =dynamic_cast(unsmob_grob (gh_car (s))); + Item * it =dynamic_cast (unsmob_grob (gh_car (s))); if (it && it->broken_b ()) { it->find_prebroken_piece (LEFT) ->suicide (); diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index cb3f54040e..39cfa193c2 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -62,7 +62,7 @@ Separating_line_group_engraver::acknowledge_grob (Grob_info i) return; if (it->parent_l (X_AXIS) && it->parent_l (X_AXIS)->has_extent_callback_b - (Axis_group_interface::group_extent_callback_proc, X_AXIS)) + (Axis_group_interface::group_extent_callback_proc, X_AXIS)) return; @@ -73,7 +73,7 @@ Separating_line_group_engraver::acknowledge_grob (Grob_info i) if (!p_ref_) { p_ref_ = new Item - (get_property ("SeparationItem")); + (get_property ("SeparationItem")); if (ib) p_ref_->set_grob_property ("breakable", SCM_BOOL_T); @@ -102,5 +102,5 @@ Separating_line_group_engraver::stop_translation_timestep () -ADD_THIS_TRANSLATOR(Separating_line_group_engraver); +ADD_THIS_TRANSLATOR (Separating_line_group_engraver); diff --git a/lily/separation-item.cc b/lily/separation-item.cc index 8a777a0df9..b5642dbc26 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -44,7 +44,7 @@ Separation_item::my_width (Grob *me) if (pc != il->column_l ()) { /* this shouldn't happen, but let's continue anyway. */ - programming_error (_("Separation_item: I've been drinking too much")); + programming_error (_ ("Separation_item: I've been drinking too much")); continue; /*UGH UGH*/ } @@ -56,7 +56,7 @@ Separation_item::my_width (Grob *me) Interval iv (il->extent (pc, X_AXIS)); if (!iv.empty_b ()) { - w.unite (iv); + w.unite (iv); } } diff --git a/lily/sequential-music-iterator.cc b/lily/sequential-music-iterator.cc index 1538cb72ad..ad1ae7b934 100644 --- a/lily/sequential-music-iterator.cc +++ b/lily/sequential-music-iterator.cc @@ -24,7 +24,7 @@ The length of musiclist from start to up to cursor_ (cursor_ not including), is summed - here_mom_ = sum (length (musiclist [start ... cursor> )) %) + here_mom_ = sum (length (musiclist [start ... cursor>)) %) */ @@ -48,13 +48,13 @@ Sequential_music_iterator::Sequential_music_iterator (Sequential_music_iterator iter_p_ = 0; } -Sequential_music_iterator::~Sequential_music_iterator() +Sequential_music_iterator::~Sequential_music_iterator () { delete iter_p_; } void -Sequential_music_iterator::construct_children() +Sequential_music_iterator::construct_children () { cursor_ = dynamic_cast (music_l_)->music_list (); @@ -67,7 +67,7 @@ Sequential_music_iterator::construct_children() /* iter_p_->ok () is tautology, but what the heck. */ - if (iter_p_ && iter_p_->ok()) + if (iter_p_ && iter_p_->ok ()) descend_to_child (); } @@ -146,7 +146,7 @@ Sequential_music_iterator::get_music (Moment until)const s = gh_append2 (nm, s); Moment m = 0; - for (SCM i = nm; gh_pair_p(i); i = gh_cdr (i)) + for (SCM i = nm; gh_pair_p (i); i = gh_cdr (i)) m = m >? unsmob_music (gh_car (i))->length_mom (); if (m > Moment (0)) @@ -202,14 +202,14 @@ Sequential_music_iterator::process (Moment until) } Moment -Sequential_music_iterator::pending_moment() const +Sequential_music_iterator::pending_moment () const { - return iter_p_->pending_moment() + here_mom_; + return iter_p_->pending_moment () + here_mom_; } bool -Sequential_music_iterator::ok() const +Sequential_music_iterator::ok () const { return iter_p_; } @@ -219,4 +219,4 @@ Sequential_music_iterator::try_music_in_children (Music *m) const { return iter_p_ ? iter_p_->try_music (m) : 0; } -IMPLEMENT_CTOR_CALLBACK(Sequential_music_iterator); +IMPLEMENT_CTOR_CALLBACK (Sequential_music_iterator); diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 273ad4a88a..5c947d8b20 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -39,17 +39,17 @@ Side_position_interface::get_direction (Grob*me) } SCM other_elt = me->get_grob_property ("direction-source"); - Grob * e = unsmob_grob(other_elt); + Grob * e = unsmob_grob (other_elt); if (e) { - return (Direction)(relative_dir * Directional_element_interface::get (e)); + return (Direction) (relative_dir * Directional_element_interface::get (e)); } return CENTER; } -MAKE_SCHEME_CALLBACK(Side_position_interface,aligned_on_support_extents, 2); +MAKE_SCHEME_CALLBACK (Side_position_interface,aligned_on_support_extents, 2); SCM Side_position_interface::aligned_on_support_extents (SCM element_smob, SCM axis) { @@ -79,7 +79,7 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte Interval dim; for (SCM s = support; s != SCM_EOL; s = gh_cdr (s)) { - Grob * e = unsmob_grob ( gh_car (s)); + Grob * e = unsmob_grob (gh_car (s)); if (e) if (use_extents) dim.unite (e->extent (common, a)); @@ -92,7 +92,7 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte if (dim.empty_b ()) { - dim = Interval(0,0); + dim = Interval (0,0); } Direction dir = Side_position_interface::get_direction (me); @@ -123,7 +123,7 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte /* Cut & paste (ugh.) */ -MAKE_SCHEME_CALLBACK(Side_position_interface,aligned_on_support_refpoints,2); +MAKE_SCHEME_CALLBACK (Side_position_interface,aligned_on_support_refpoints,2); SCM Side_position_interface::aligned_on_support_refpoints (SCM smob, SCM axis) { @@ -137,7 +137,7 @@ Side_position_interface::aligned_on_support_refpoints (SCM smob, SCM axis) /** callback that centers the element on itself */ -MAKE_SCHEME_CALLBACK(Side_position_interface,aligned_on_self,2); +MAKE_SCHEME_CALLBACK (Side_position_interface,aligned_on_self,2); SCM Side_position_interface::aligned_on_self (SCM element_smob, SCM axis) { @@ -145,12 +145,12 @@ Side_position_interface::aligned_on_self (SCM element_smob, SCM axis) Axis a = (Axis) gh_scm2int (axis); String s ("self-alignment-"); - s += (a == X_AXIS) ? "X" : "Y"; + s += (a == X_AXIS) ? "X" : "Y"; - SCM align (me->get_grob_property (s.ch_C())); + SCM align (me->get_grob_property (s.ch_C ())); if (gh_number_p (align)) { - Interval ext(me->extent (me,a)); + Interval ext (me->extent (me,a)); if (ext.empty_b ()) { @@ -185,10 +185,10 @@ directed_round (Real f, Direction d) of the elements "direction" elt property. Only rounds when we're inside the staff, as determined by - Staff_symbol_referencer::staff_radius() */ -MAKE_SCHEME_CALLBACK(Side_position_interface,quantised_position,2); + Staff_symbol_referencer::staff_radius () */ +MAKE_SCHEME_CALLBACK (Side_position_interface,quantised_position,2); SCM -Side_position_interface::quantised_position (SCM element_smob, SCM ) +Side_position_interface::quantised_position (SCM element_smob, SCM) { Grob *me = unsmob_grob (element_smob); @@ -200,7 +200,7 @@ Side_position_interface::quantised_position (SCM element_smob, SCM ) Real p = Staff_symbol_referencer::position_f (me); Real rp = directed_round (p, d); Real rad = Staff_symbol_referencer::staff_radius (me) *2 ; - int ip = int (rp); + int ip = int (rp); if (abs (ip) <= rad && Staff_symbol_referencer::on_staffline (me,ip)) { @@ -216,7 +216,7 @@ Side_position_interface::quantised_position (SCM element_smob, SCM ) /* Position next to support, taking into account my own dimensions and padding. */ -MAKE_SCHEME_CALLBACK(Side_position_interface,aligned_side,2); +MAKE_SCHEME_CALLBACK (Side_position_interface,aligned_side,2); SCM Side_position_interface::aligned_side (SCM element_smob, SCM axis) { @@ -248,7 +248,7 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis) /* Position centered on parent. */ -MAKE_SCHEME_CALLBACK(Side_position_interface,centered_on_parent,2); +MAKE_SCHEME_CALLBACK (Side_position_interface,centered_on_parent,2); SCM Side_position_interface::centered_on_parent (SCM element_smob, SCM axis) { @@ -317,8 +317,8 @@ Side_position_interface::has_interface (Grob*me) bool Side_position_interface::supported_b (Grob*me) { - SCM s = me->get_grob_property ("side-support-elements"); - return gh_pair_p(s); + SCM s = me->get_grob_property ("side-support-elements"); + return gh_pair_p (s); } diff --git a/lily/simple-music-iterator.cc b/lily/simple-music-iterator.cc index 712e4745ea..ef83a5abda 100644 --- a/lily/simple-music-iterator.cc +++ b/lily/simple-music-iterator.cc @@ -55,4 +55,4 @@ Simple_music_iterator::process (Moment m) skip (m); } -IMPLEMENT_CTOR_CALLBACK(Simple_music_iterator); +IMPLEMENT_CTOR_CALLBACK (Simple_music_iterator); diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index 40ed6a0c86..edf841a773 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -141,7 +141,7 @@ Simple_spacer::my_solve_linelen () if (conf < line_len_f_) { - force_f_ += (line_len_f_ - conf) * active_springs_stiffness (); + force_f_ += (line_len_f_ - conf) * active_springs_stiffness (); break; } else @@ -202,7 +202,7 @@ Simple_spacer::add_columns (Link_array cols) } desc.block_force_f_ = - desc.hooke_f_ * desc.ideal_f_; // block at distance 0 - springs_.push (desc); + springs_.push (desc); } for (int i=0; i < cols.size () - 1; i++) @@ -239,12 +239,12 @@ Simple_spacer::solve (Column_x_positions *positions) const positions->config_.push (positions->config_.top () + springs_[i].length (force_f_)); } - positions->satisfies_constraints_b_ = (line_len_f_ < 0) || active_b (); + positions->satisfies_constraints_b_ = (line_len_f_ < 0) || active_b (); } -Spring_description::Spring_description( ) +Spring_description::Spring_description () { ideal_f_ =0.0; hooke_f_ =0.0; diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc index 12e0b16c68..3265bee03d 100644 --- a/lily/simultaneous-music-iterator.cc +++ b/lily/simultaneous-music-iterator.cc @@ -45,13 +45,13 @@ Simultaneous_music_iterator::get_music (Moment m)const } void -Simultaneous_music_iterator::construct_children() +Simultaneous_music_iterator::construct_children () { int j = 0; Music_sequence const *sim = dynamic_cast (music_l_); SCM i = sim->music_list (); - for (; gh_pair_p(i); i = gh_cdr(i), j++) + for (; gh_pair_p (i); i = gh_cdr (i), j++) { Music *mus = unsmob_music (gh_car (i)); Music_iterator * mi = static_get_iterator_p (mus); @@ -60,7 +60,7 @@ Simultaneous_music_iterator::construct_children() number number as name */ Translator_group * t = (j && separate_contexts_b_) - ? report_to_l ()->find_create_translator_l (report_to_l()->type_str_, + ? report_to_l ()->find_create_translator_l (report_to_l ()->type_str_, to_str (j)) : report_to_l (); @@ -70,7 +70,7 @@ Simultaneous_music_iterator::construct_children() mi->init_translator (mus, t); mi->construct_children (); - if (mi->ok()) + if (mi->ok ()) { children_p_list_.append (new Killing_cons (mi,0)); } @@ -86,14 +86,14 @@ Simultaneous_music_iterator::process (Moment until) for (Cons **pp = &children_p_list_.head_; *pp;) { Music_iterator * i = (*pp)->car_; - if (i->pending_moment() == until) + if (i->pending_moment () == until) { i->process (until); } - if (!i->ok()) + if (!i->ok ()) delete children_p_list_.remove_cons (pp); else - pp = &(*pp)->next_; + pp = & (*pp)->next_; } } @@ -103,32 +103,32 @@ Simultaneous_music_iterator::skip (Moment until) for (Cons **pp = &children_p_list_.head_; *pp;) { Music_iterator * i = (*pp)->car_; - if (i->pending_moment() <= until) + if (i->pending_moment () <= until) { i->skip (until); } - if (!i->ok()) + if (!i->ok ()) delete children_p_list_.remove_cons (pp); else - pp = &(*pp)->next_; + pp = & (*pp)->next_; } } Moment -Simultaneous_music_iterator::pending_moment() const +Simultaneous_music_iterator::pending_moment () const { Moment next; next.set_infinite (1); for (Cons *p = children_p_list_.head_; p; p = p->next_) - next = next car_->pending_moment() ; + next = next car_->pending_moment () ; return next; } bool -Simultaneous_music_iterator::ok() const +Simultaneous_music_iterator::ok () const { return children_p_list_.head_; } @@ -144,4 +144,4 @@ Simultaneous_music_iterator::try_music_in_children (Music *m) const -IMPLEMENT_CTOR_CALLBACK(Simultaneous_music_iterator); +IMPLEMENT_CTOR_CALLBACK (Simultaneous_music_iterator); diff --git a/lily/slur-bezier-bow.cc b/lily/slur-bezier-bow.cc index de36d7e5eb..d7395d2518 100644 --- a/lily/slur-bezier-bow.cc +++ b/lily/slur-bezier-bow.cc @@ -103,17 +103,17 @@ Slur_bezier_bow::enclosed_area_f () const x = Interval ((encompass_[i-1][X_AXIS] + encompass_[i][X_AXIS])/2, encompass_[i][X_AXIS]); y = Interval (0, - (curve_.get_other_coordinate (X_AXIS, - (x[MIN] + x[MAX]) / 2))); + (curve_.get_other_coordinate (X_AXIS, + (x[MIN] + x[MAX]) / 2))); } else { x = Interval ((encompass_[i-1][X_AXIS] + encompass_[i][X_AXIS]) / 2, - (encompass_[i][X_AXIS] + encompass_[i+1][X_AXIS]) / 2); + (encompass_[i][X_AXIS] + encompass_[i+1][X_AXIS]) / 2); y = Interval (encompass_[i][Y_AXIS], - (curve_.get_other_coordinate (X_AXIS, x[MIN]) + (curve_.get_other_coordinate (X_AXIS, x[MIN]) + curve_.get_other_coordinate (X_AXIS, - (x[MIN] + x[MAX]) / 2) + (x[MIN] + x[MAX]) / 2) + curve_.get_other_coordinate (X_AXIS, x[MAX])) / 3); } @@ -193,7 +193,7 @@ Slur_bezier_bow::minimise_enclosed_area (Real beauty, /* - max ( encompass.y / curve.y ) + max (encompass.y / curve.y) */ Real diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 9c26cddd89..6f57a925c3 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -66,7 +66,7 @@ Slur_engraver::try_music (Music *req_l) /* Let's not start more than one slur per moment. */ - if (sl->get_span_dir() == START) + if (sl->get_span_dir () == START) { if (now_mom () > last_start_) { @@ -136,7 +136,7 @@ Slur_engraver::create_grobs () { Span_req* slur_req_l = new_slur_req_l_arr_[i]; // end slur: move the slur to other array - if (slur_req_l->get_span_dir() == STOP) + if (slur_req_l->get_span_dir () == STOP) { if (slur_l_stack_.empty ()) /* How to shut up this warning, when Voice_devnull_engraver has @@ -154,7 +154,7 @@ Slur_engraver::create_grobs () requests_arr_.pop (); } } - else if (slur_req_l->get_span_dir() == START) + else if (slur_req_l->get_span_dir () == START) { // push a new slur onto stack. // (use temp. array to wait for all slur STOPs) diff --git a/lily/slur.cc b/lily/slur.cc index 9c3fa7866a..316774e37d 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -14,7 +14,7 @@ * begin and end should be treated as a/acknowledge Scripts. * smart changing of endings * smart changing of (Y-?)offsets to avoid ugly beziers - (along-side-stem) + (along-side-stem) */ #include "directional-element-interface.hh" @@ -53,7 +53,7 @@ Slur::add_column (Grob*me, Grob*n) me->add_dependency (n); } - add_bound_item (dynamic_cast (me), dynamic_cast(n)); + add_bound_item (dynamic_cast (me), dynamic_cast (n)); } void @@ -63,7 +63,7 @@ Slur::de_uglyfy (Grob*me, Slur_bezier_bow* bb, Real default_height) Real ff = bb->fit_factor (); for (int i = 1; i < 3; i++) { - Real ind = abs (bb->curve_.control_[(i-1)*3][X_AXIS] + Real ind = abs (bb->curve_.control_[ (i-1)*3][X_AXIS] - bb->curve_.control_[i][X_AXIS]) / length; Real h = bb->curve_.control_[i][Y_AXIS] * ff / length; @@ -151,7 +151,7 @@ Slur::check_slope (Grob *me) { Real staff_space = Staff_symbol_referencer::staff_space ((Grob*)me); Direction dir = (Direction)gh_scm2int (me->get_grob_property ("direction")); - Direction d = (Direction)(- dir * (sign (dy))); + Direction d = (Direction) (- dir * (sign (dy))); SCM a = me->get_grob_property ("attachment-offset"); Drul_array o; o[LEFT] = ly_scm2offset (index_cell (a, LEFT)); @@ -201,9 +201,9 @@ Slur::get_first_notecolumn_y (Grob *me, Direction dir) { Grob *col = dir == LEFT ? unsmob_grob (gh_car (scm_reverse (me->get_grob_property - ("note-columns")))) + ("note-columns")))) : unsmob_grob - (gh_car (me->get_grob_property ("note-columns"))); + (gh_car (me->get_grob_property ("note-columns"))); Grob *common[] = { @@ -248,7 +248,7 @@ Slur::broken_trend_offset (Grob *me, Direction dir) int neighbour_cols = scm_ilength (neighbour->get_grob_property ("note-columns")); int cols = scm_ilength (me->get_grob_property ("note-columns")); o = Offset (0, (y*neighbour_cols + neighbour_y*cols) / - (cols + neighbour_cols)); + (cols + neighbour_cols)); break; } } @@ -267,7 +267,7 @@ Slur::get_attachment (Grob *me, Direction dir, s = me->get_grob_property ("attachment"); } SCM a = dir == LEFT ? gh_car (s) : gh_cdr (s); - Spanner*sp = dynamic_cast(me); + Spanner*sp = dynamic_cast (me); String str = ly_symbol2string (a); Real staff_space = Staff_symbol_referencer::staff_space ((Grob*)me); Real hs = staff_space / 2.0; @@ -309,7 +309,7 @@ Slur::get_attachment (Grob *me, Direction dir, Default position is on stem X, at stem end Y */ o += Offset (0.5 * - (n->extent (n,X_AXIS).length () + (n->extent (n,X_AXIS).length () - stem->extent (stem,X_AXIS).length ()) * (1 + Stem::get_direction (stem)), 0); @@ -339,7 +339,7 @@ Slur::get_attachment (Grob *me, Direction dir, int stemdir = stem ? Stem::get_direction (stem) : 1; int slurdir = gh_scm2int (me->get_grob_property ("direction")); SCM l = scm_assoc - (scm_listify (a, + (scm_listify (a, gh_int2scm (stemdir * dir), gh_int2scm (slurdir * dir), SCM_UNDEFINED), alist); @@ -411,7 +411,7 @@ Slur::encompass_offset (Grob*me, Array Slur::get_encompass_offset_arr (Grob *me) { - Spanner*sp = dynamic_cast(me); + Spanner*sp = dynamic_cast (me); SCM eltlist = me->get_grob_property ("note-columns"); Grob *common[] = {me->common_refpoint (eltlist, X_AXIS), me->common_refpoint (eltlist, Y_AXIS)}; @@ -479,14 +479,14 @@ Slur::get_encompass_offset_arr (Grob *me) } -MAKE_SCHEME_CALLBACK(Slur,set_spacing_rods,1); +MAKE_SCHEME_CALLBACK (Slur,set_spacing_rods,1); SCM Slur::set_spacing_rods (SCM smob) { Grob*me = unsmob_grob (smob); Rod r; - Spanner*sp = dynamic_cast(me); + Spanner*sp = dynamic_cast (me); r.item_l_drul_[LEFT] = sp->get_bound (LEFT); r.item_l_drul_[RIGHT] = sp->get_bound (RIGHT); r.distance_f_ = @@ -507,7 +507,7 @@ Slur::height (SCM smob, SCM ax) { Axis a = (Axis)gh_scm2int (ax); Grob * me = unsmob_grob (smob); - assert ( a == Y_AXIS); + assert (a == Y_AXIS); SCM mol = me->get_uncached_molecule (); return ly_interval2scm (unsmob_molecule (mol)->extent (a)); @@ -542,7 +542,7 @@ Slur::brew_molecule (SCM smob) else a = Lookup::slur (one, Directional_element_interface::get (me) * thick, thick); - return a.smobbed_copy(); + return a.smobbed_copy (); } void @@ -571,7 +571,7 @@ Slur::set_control_points (Grob*me) if (gh_number_p (ssb)) sb = gh_scm2double (ssb); - bb.minimise_enclosed_area ( sb, details); + bb.minimise_enclosed_area (sb, details); SCM sbf = scm_assq (ly_symbol2scm ("force-blowfit"), details); Real bff = 1.0; if (gh_pair_p (sbf) && gh_number_p (gh_cdr (sbf))) @@ -598,7 +598,7 @@ Slur::set_control_points (Grob*me) SCM controls = SCM_EOL; for (int i= 4; i--;) { - controls = gh_cons ( ly_offset2scm (b.control_[i]), controls); + controls = gh_cons (ly_offset2scm (b.control_[i]), controls); /* BRRR WHURG. All these null control-points, where do they all come from? @@ -650,7 +650,7 @@ Slur::get_curve (Grob*me) if (x > x1 && x ? dir * (enc[i][Y_AXIS] - y); + off = off >? dir * (enc[i][Y_AXIS] - y); } } b.translate (Offset (0, dir * off)); diff --git a/lily/spaceable-element.cc b/lily/spaceable-element.cc index 9a57db0f14..b0d6779c7d 100644 --- a/lily/spaceable-element.cc +++ b/lily/spaceable-element.cc @@ -12,7 +12,7 @@ #include "warn.hh" SCM -Spaceable_grob::get_minimum_distances ( Grob*me) +Spaceable_grob::get_minimum_distances (Grob*me) { return me->get_grob_property ("minimum-distances"); } @@ -49,7 +49,7 @@ Spaceable_grob::add_spring (Grob*me, Grob * p, Real d, Real strength) SCM dist = gh_car (s); if (gh_car (dist) == p->self_scm ()) { - programming_error("already have that spring"); + programming_error ("already have that spring"); return ; } } diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index e5e3f5c1f0..0b3b586731 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -22,7 +22,7 @@ struct Rhythmic_tuple Rhythmic_tuple () { } - Rhythmic_tuple (Grob_info i, Moment m ) + Rhythmic_tuple (Grob_info i, Moment m) { info_ = i; end_ = m; @@ -44,7 +44,7 @@ class Spacing_engraver : public Engraver Spanner * spacing_p_; protected: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); virtual void acknowledge_grob (Grob_info); virtual void start_translation_timestep (); virtual void stop_translation_timestep (); @@ -64,10 +64,10 @@ int Rhythmic_tuple::time_compare (Rhythmic_tuple const &h1, Rhythmic_tuple const &h2) { - return (h1.end_ - h2.end_ ).sign (); + return (h1.end_ - h2.end_).sign (); } -Spacing_engraver::Spacing_engraver() +Spacing_engraver::Spacing_engraver () { spacing_p_ = 0; } @@ -99,9 +99,9 @@ Spacing_engraver::acknowledge_grob (Grob_info i) if (to_boolean (i.elem_l_->get_grob_property ("non-rhythmic"))) return; - if (Rhythmic_req * r = dynamic_cast(i.req_l_)) + if (Rhythmic_req * r = dynamic_cast (i.req_l_)) { - Rhythmic_tuple t(i, now_mom () + r->length_mom ()); + Rhythmic_tuple t (i, now_mom () + r->length_mom ()); now_durations_.push (t); } } @@ -138,8 +138,8 @@ Spacing_engraver::stop_translation_timestep () Paper_column * sc = dynamic_cast (unsmob_grob (get_property ("currentMusicalColumn"))); - SCM sh = shortest_playing.smobbed_copy( ); - SCM st = starter.smobbed_copy(); + SCM sh = shortest_playing.smobbed_copy (); + SCM st = starter.smobbed_copy (); sc->set_grob_property ("shortest-playing-duration", sh); sc->set_grob_property ("shortest-starter-duration", st); @@ -156,6 +156,6 @@ Spacing_engraver::start_translation_timestep () stopped_durations_.push (playing_durations_.get ()); } -ADD_THIS_TRANSLATOR(Spacing_engraver); +ADD_THIS_TRANSLATOR (Spacing_engraver); diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index c4c6b100f0..bf85b60683 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -54,7 +54,7 @@ Spacing_spanner::do_measure (Grob*me, Link_array cols) if (dynamic_cast (cols[i])->musical_b ()) { SCM st = cols[i]->get_grob_property ("shortest-starter-duration"); - Moment this_shortest = *unsmob_moment(st); + Moment this_shortest = *unsmob_moment (st); shortest = shortest cols) { Item * l = dynamic_cast (cols[i]); Item * r = dynamic_cast (cols[i+1]); - Item * lb = dynamic_cast ( l->find_prebroken_piece (RIGHT)); - Item * rb = dynamic_cast ( r->find_prebroken_piece (LEFT)); + Item * lb = dynamic_cast (l->find_prebroken_piece (RIGHT)); + Item * rb = dynamic_cast (r->find_prebroken_piece (LEFT)); Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}}; @@ -108,12 +108,12 @@ Spacing_spanner::do_measure (Grob*me, Link_array cols) { left_distance = gh_scm2double (gh_cdr (hint)); } - // 2nd condition should be (i+1 < col_count()), ie. not the last column in score. FIXME - else if (!lc->musical_b() && i+1 < cols.size ()) + // 2nd condition should be (i+1 < col_count ()), ie. not the last column in score. FIXME + else if (!lc->musical_b () && i+1 < cols.size ()) { left_distance= default_bar_spacing (me,lc,rc,shortest musical_b()) + else if (lc->musical_b ()) { left_distance = note_spacing (me,lc, rc, shortest cols) else { Interval ext (rc->extent (rc, X_AXIS)); - right_dist = ext.empty_b() ? 0.0 : - ext [LEFT]; + right_dist = ext.empty_b () ? 0.0 : - ext [LEFT]; } /* @@ -172,13 +172,13 @@ Spacing_spanner::do_measure (Grob*me, Link_array cols) if (gh_pair_p (next_stretch_hint)) // see regtest spacing-tight - stretch_dist += - gh_scm2double (gh_car (next_stretch_hint)); + stretch_dist += - gh_scm2double (gh_car (next_stretch_hint)); else stretch_dist += right_dist; if (s.distance_f_ <0) { - programming_error("Negative dist, setting to 1.0 PT"); + programming_error ("Negative dist, setting to 1.0 PT"); s.distance_f_ = 1.0; } if (stretch_dist == 0.0) @@ -233,7 +233,7 @@ Real Spacing_spanner::get_duration_space (Grob*me, Moment d, Moment shortest) { Real log = log_2 (shortest); - Real k = gh_scm2double (me->get_grob_property ("arithmetic-basicspace")) + Real k = gh_scm2double (me->get_grob_property ("arithmetic-basicspace")) - log; return (log_2 (d) + k) * gh_scm2double (me->get_grob_property ("arithmetic-multiplier")); @@ -249,7 +249,7 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc, // SCM s = lc->get_grob_property ("mean-playing-duration"); if (unsmob_moment (s)) - shortest_playing_len = *unsmob_moment(s); + shortest_playing_len = *unsmob_moment (s); if (! shortest_playing_len) { @@ -264,7 +264,7 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc, } Moment delta_t = Paper_column::when_mom (rc) - Paper_column::when_mom (lc); Real dist = get_duration_space (me, shortest_playing_len, shortest); - dist *= (double)(delta_t / shortest_playing_len); + dist *= (double) (delta_t / shortest_playing_len); /* UGH: KLUDGE! @@ -305,7 +305,7 @@ Spacing_spanner::stem_dir_correction (Grob*me, Grob*l, Grob*r) dl = gh_car (dl); dr = gh_car (dr); - assert (gh_number_p (dl) && gh_number_p(dr)); + assert (gh_number_p (dl) && gh_number_p (dr)); int d1 = gh_scm2int (dl); int d2 = gh_scm2int (dr); @@ -314,7 +314,7 @@ Spacing_spanner::stem_dir_correction (Grob*me, Grob*l, Grob*r) Real correction = 0.0; - Real ssc = gh_scm2double (me->get_grob_property("stem-spacing-correction")); + Real ssc = gh_scm2double (me->get_grob_property ("stem-spacing-correction")); if (d1 && d2 && d1 * d2 == -1) { @@ -326,7 +326,7 @@ Spacing_spanner::stem_dir_correction (Grob*me, Grob*l, Grob*r) } -MAKE_SCHEME_CALLBACK(Spacing_spanner, set_springs,1); +MAKE_SCHEME_CALLBACK (Spacing_spanner, set_springs,1); SCM Spacing_spanner::set_springs (SCM smob) { diff --git a/lily/span-bar-engraver.cc b/lily/span-bar-engraver.cc index cb026be67f..a4e19592d0 100644 --- a/lily/span-bar-engraver.cc +++ b/lily/span-bar-engraver.cc @@ -29,16 +29,16 @@ class Span_bar_engraver : public Engraver Link_array bar_l_arr_; public: - VIRTUAL_COPY_CONS(Translator); - Span_bar_engraver(); + VIRTUAL_COPY_CONS (Translator); + Span_bar_engraver (); protected: virtual void acknowledge_grob (Grob_info); - virtual void stop_translation_timestep(); + virtual void stop_translation_timestep (); }; -Span_bar_engraver::Span_bar_engraver() +Span_bar_engraver::Span_bar_engraver () { spanbar_p_ =0; } @@ -48,14 +48,14 @@ Span_bar_engraver::Span_bar_engraver() void Span_bar_engraver::acknowledge_grob (Grob_info i) { - int depth = i.origin_trans_l_arr (this).size(); + int depth = i.origin_trans_l_arr (this).size (); if (depth > 1 && Bar::has_interface (i.elem_l_)) { - Item * it = dynamic_cast(i.elem_l_); + Item * it = dynamic_cast (i.elem_l_); bar_l_arr_.push (it); - if (bar_l_arr_.size() >= 2 && !spanbar_p_) + if (bar_l_arr_.size () >= 2 && !spanbar_p_) { spanbar_p_ = new Item (get_property ("SpanBar")); Span_bar::set_interface (spanbar_p_); @@ -68,12 +68,12 @@ Span_bar_engraver::acknowledge_grob (Grob_info i) } } void -Span_bar_engraver::stop_translation_timestep() +Span_bar_engraver::stop_translation_timestep () { if (spanbar_p_) { - for (int i=0; i < bar_l_arr_.size() ; i++) - Span_bar::add_bar( spanbar_p_,bar_l_arr_[i]); + for (int i=0; i < bar_l_arr_.size () ; i++) + Span_bar::add_bar (spanbar_p_,bar_l_arr_[i]); SCM vissym =ly_symbol2scm ("visibility-lambda"); SCM vis = bar_l_arr_[0]->get_grob_property (vissym); @@ -88,7 +88,7 @@ Span_bar_engraver::stop_translation_timestep() -ADD_THIS_TRANSLATOR(Span_bar_engraver); +ADD_THIS_TRANSLATOR (Span_bar_engraver); diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 50345c1341..fddeb470fe 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -25,7 +25,7 @@ Span_bar::add_bar (Grob*me, Grob*b) me->add_dependency (b); } -MAKE_SCHEME_CALLBACK(Span_bar,width_callback,2); +MAKE_SCHEME_CALLBACK (Span_bar,width_callback,2); SCM Span_bar::width_callback (SCM element_smob, SCM scm_axis) { @@ -39,10 +39,10 @@ Span_bar::width_callback (SCM element_smob, SCM scm_axis) */ Molecule m = Bar::compound_barline (se, gl, 40 PT); - return ly_interval2scm ( m.extent (X_AXIS)); + return ly_interval2scm (m.extent (X_AXIS)); } -MAKE_SCHEME_CALLBACK(Span_bar,before_line_breaking,1); +MAKE_SCHEME_CALLBACK (Span_bar,before_line_breaking,1); SCM Span_bar::before_line_breaking (SCM smob) { @@ -51,12 +51,12 @@ Span_bar::before_line_breaking (SCM smob) /* no need to call Bar::before_line_breaking (), because the info - in ELEMENTS already has been procced by Bar::before_line_breaking(). + in ELEMENTS already has been procced by Bar::before_line_breaking (). */ return SCM_UNSPECIFIED; } -MAKE_SCHEME_CALLBACK(Span_bar,center_on_spanned_callback,2); +MAKE_SCHEME_CALLBACK (Span_bar,center_on_spanned_callback,2); SCM Span_bar::center_on_spanned_callback (SCM element_smob, SCM axis) @@ -72,7 +72,7 @@ Span_bar::center_on_spanned_callback (SCM element_smob, SCM axis) interval that we span. */ if (i.empty_b ()) { - me->suicide(); + me->suicide (); return gh_double2scm (0.0); } @@ -85,7 +85,7 @@ Span_bar::evaluate_empty (Grob*me) /* TODO: filter all hara-kiried out of ELEMENS list, and then optionally do suicide. Call this cleanage function from - center_on_spanned_callback() as well. + center_on_spanned_callback () as well. */ if (!gh_pair_p (me->get_grob_property ("elements"))) @@ -122,7 +122,7 @@ Span_bar::evaluate_glyph (Grob*me) type = ".|."; } - gl = ly_str02scm (type.ch_C()); + gl = ly_str02scm (type.ch_C ()); if (scm_equal_p (me->get_grob_property (glsym), gl) != SCM_BOOL_T) me->set_grob_property (glsym, gl); } @@ -130,11 +130,11 @@ Span_bar::evaluate_glyph (Grob*me) Interval Span_bar::get_spanned_interval (Grob*me) { - return ly_scm2interval (Axis_group_interface::group_extent_callback (me->self_scm(), gh_int2scm (Y_AXIS))); + return ly_scm2interval (Axis_group_interface::group_extent_callback (me->self_scm (), gh_int2scm (Y_AXIS))); } -MAKE_SCHEME_CALLBACK(Span_bar,get_bar_size,1); +MAKE_SCHEME_CALLBACK (Span_bar,get_bar_size,1); SCM Span_bar::get_bar_size (SCM smob) { diff --git a/lily/span-dynamic-performer.cc b/lily/span-dynamic-performer.cc index edc3add567..7276bd6c70 100644 --- a/lily/span-dynamic-performer.cc +++ b/lily/span-dynamic-performer.cc @@ -146,14 +146,14 @@ Span_dynamic_performer::stop_translation_timestep () dv = (Real)finished_dir_ * 0.2; if (!start_volume) start_volume = finished_dynamic_tuple_arr_.top - ().audio_l_->volume_ - dv; + ().audio_l_->volume_ - dv; } Moment start_mom = finished_dynamic_tuple_arr_[0].mom_; Moment dt = finished_dynamic_tuple_arr_.top ().mom_ - start_mom; for (int i=0; i < finished_dynamic_tuple_arr_.size (); i++) { Audio_dynamic_tuple* a = &finished_dynamic_tuple_arr_[i]; - Real volume = start_volume + dv * (Real)(a->mom_ - start_mom) + Real volume = start_volume + dv * (Real) (a->mom_ - start_mom) / (Real)dt; a->audio_l_->volume_ = volume; } @@ -177,12 +177,12 @@ Span_dynamic_performer::start_translation_timestep () bool Span_dynamic_performer::try_music (Music* r) { - if (Span_req * s = dynamic_cast(r)) + if (Span_req * s = dynamic_cast (r)) { String t = ly_scm2string (s->get_mus_property ("span-type")); if (t == "crescendo" || t == "decrescendo") { - span_req_l_drul_[s->get_span_dir()] = s; + span_req_l_drul_[s->get_span_dir ()] = s; return true; } } diff --git a/lily/spanner.cc b/lily/spanner.cc index 6f45027f37..b51c332d5f 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -41,7 +41,7 @@ Spanner::do_break_processing () if (!parent->spanned_rank_iv ().contains_b (this->spanned_rank_iv ())) { programming_error (to_str ("Spanner `%s' is not fully contained in parent spanner `%s'.", - name().ch_C(), + name ().ch_C (), parent->name ().ch_C ())); } } @@ -50,7 +50,7 @@ Spanner::do_break_processing () if (line_l () || broken_b ()) return; - if (left == right) + if (left == right) { /* If we have a spanner spanning one column, we must break it @@ -63,7 +63,7 @@ Spanner::do_break_processing () programming_error ("no broken bound"); else if (bound->line_l ()) { - Spanner * span_p = dynamic_cast( clone ()); + Spanner * span_p = dynamic_cast (clone ()); span_p->set_bound (LEFT, bound); span_p->set_bound (RIGHT, bound); @@ -72,7 +72,7 @@ Spanner::do_break_processing () broken_into_l_arr_.push (span_p); } } - while ((flip(&d))!= LEFT); + while ((flip (&d))!= LEFT); } else { @@ -81,7 +81,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]; @@ -89,10 +89,10 @@ Spanner::do_break_processing () Direction d = LEFT; do { - if (!bounds[d]->line_l()) - bounds[d] = bounds[d]->find_prebroken_piece(- d); + if (!bounds[d]->line_l ()) + bounds[d] = bounds[d]->find_prebroken_piece (- d); } - while ((flip(&d))!= LEFT); + while ((flip (&d))!= LEFT); if (!bounds[LEFT] || ! bounds[RIGHT]) { @@ -100,9 +100,9 @@ Spanner::do_break_processing () continue; } - Spanner *span_p = dynamic_cast(clone ()); - span_p->set_bound(LEFT,bounds[LEFT]); - span_p->set_bound(RIGHT,bounds[RIGHT]); + Spanner *span_p = dynamic_cast (clone ()); + span_p->set_bound (LEFT,bounds[LEFT]); + span_p->set_bound (RIGHT,bounds[RIGHT]); if (!bounds[LEFT]->line_l () @@ -123,15 +123,15 @@ Spanner::do_break_processing () } void -Spanner::set_my_columns() +Spanner::set_my_columns () { Direction i = (Direction) LEFT; do { - if (!spanned_drul_[i]->line_l()) - set_bound(i,spanned_drul_[i]->find_prebroken_piece((Direction) -i)); + if (!spanned_drul_[i]->line_l ()) + set_bound (i,spanned_drul_[i]->find_prebroken_piece ((Direction) -i)); } - while (flip(&i) != LEFT); + while (flip (&i) != LEFT); } Interval_t @@ -161,7 +161,7 @@ Spanner::get_bound (Direction d) const X-axis parent of THIS to S. */ void -Spanner::set_bound(Direction d, Grob*s) +Spanner::set_bound (Direction d, Grob*s) { Item * i = dynamic_cast (s); if (!i) @@ -208,7 +208,7 @@ Spanner::Spanner (Spanner const &s) } Real -Spanner::spanner_length() const +Spanner::spanner_length () const { Real l = spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS); Real r = spanned_drul_[RIGHT]->relative_coordinate (0, X_AXIS); @@ -220,20 +220,20 @@ Spanner::spanner_length() const } Line_of_score * -Spanner::line_l() const +Spanner::line_l () const { if (!spanned_drul_[LEFT] || !spanned_drul_[RIGHT]) return 0; if (spanned_drul_[LEFT]->line_l () != spanned_drul_[RIGHT]->line_l ()) return 0; - return spanned_drul_[LEFT]->line_l(); + return spanned_drul_[LEFT]->line_l (); } Grob* Spanner::find_broken_piece (Line_of_score*l) const { - int idx = binsearch_link_array (broken_into_l_arr_, (Spanner*)l, Spanner::compare); + int idx = binsearch_link_array (broken_into_l_arr_, (Spanner*)l, Spanner::compare); if (idx < 0) return 0; @@ -249,9 +249,9 @@ Spanner::compare (Spanner * const &p1, Spanner * const &p2) } bool -Spanner::broken_b() const +Spanner::broken_b () const { - return broken_into_l_arr_.size(); + return broken_into_l_arr_.size (); } @@ -264,10 +264,10 @@ Spanner::broken_b() const Real Spanner::get_broken_left_end_align () const { - Paper_column *sc = dynamic_cast (spanned_drul_[LEFT]->column_l()); + Paper_column *sc = dynamic_cast (spanned_drul_[LEFT]->column_l ()); // Relevant only if left span point is first column in line - if(sc != NULL && + if (sc != NULL && sc->break_status_dir () == RIGHT) { /* @@ -346,12 +346,12 @@ extend_spanner_over_elements (SCM value, SCM extremal_pair) } else if (unsmob_grob (value)) { - if (Spanner * sp = dynamic_cast (unsmob_grob(value))) + if (Spanner * sp = dynamic_cast (unsmob_grob (value))) { extend_spanner_over_item (sp->get_bound (LEFT), extremal_pair); extend_spanner_over_item (sp->get_bound (RIGHT), extremal_pair); } - else if (Item * it= dynamic_cast (unsmob_grob(value))) + else if (Item * it= dynamic_cast (unsmob_grob (value))) extend_spanner_over_item (it, extremal_pair); } } diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index c8baab0edd..41e7d1cf92 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -14,13 +14,13 @@ #include "performer-group-performer.hh" /** Perform a staff. Individual notes should have their instrument - (staff-wide) set, so we override play_element() + (staff-wide) set, so we override play_element () */ class Staff_performer : public Performer_group_performer { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Staff_performer (); @@ -128,7 +128,7 @@ Staff_performer::new_instrument_str () // mustn't ask Score for instrument: it will return piano! SCM minstr = get_property (ly_symbol2scm ("midiInstrument")); - if (!gh_string_p(minstr)) + if (!gh_string_p (minstr)) minstr = get_property (ly_symbol2scm ("instrument")); if (!gh_string_p (minstr) diff --git a/lily/staff-symbol-engraver.cc b/lily/staff-symbol-engraver.cc index a9337fe80e..c1a27bcd17 100644 --- a/lily/staff-symbol-engraver.cc +++ b/lily/staff-symbol-engraver.cc @@ -20,41 +20,41 @@ class Staff_symbol_engraver : public Engraver { Spanner *span_p_; public: - VIRTUAL_COPY_CONS(Translator); - Staff_symbol_engraver(); + VIRTUAL_COPY_CONS (Translator); + Staff_symbol_engraver (); protected: - virtual ~Staff_symbol_engraver(); + virtual ~Staff_symbol_engraver (); virtual void acknowledge_grob (Grob_info); - virtual void finalize(); - virtual void initialize(); + virtual void finalize (); + virtual void initialize (); }; -Staff_symbol_engraver::~Staff_symbol_engraver() +Staff_symbol_engraver::~Staff_symbol_engraver () { assert (!span_p_); } -Staff_symbol_engraver::Staff_symbol_engraver() +Staff_symbol_engraver::Staff_symbol_engraver () { span_p_ = 0; } void -Staff_symbol_engraver::initialize() +Staff_symbol_engraver::initialize () { span_p_ = new Spanner (get_property ("StaffSymbol")); - span_p_->set_bound(LEFT, unsmob_grob (get_property ("currentCommandColumn"))); + span_p_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn"))); announce_grob (span_p_, 0); } void -Staff_symbol_engraver::finalize() +Staff_symbol_engraver::finalize () { - span_p_->set_bound(RIGHT,unsmob_grob (get_property ("currentCommandColumn"))); + span_p_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn"))); typeset_grob (span_p_); span_p_ =0; } @@ -69,5 +69,5 @@ Staff_symbol_engraver::acknowledge_grob (Grob_info s) } -ADD_THIS_TRANSLATOR(Staff_symbol_engraver); +ADD_THIS_TRANSLATOR (Staff_symbol_engraver); diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index d569d52abc..13cf324351 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -43,7 +43,7 @@ Grob* Staff_symbol_referencer::staff_symbol_l (Grob*me) { SCM st = me->get_grob_property ("staff-symbol"); - return unsmob_grob(st); + return unsmob_grob (st); } Real @@ -86,9 +86,9 @@ Staff_symbol_referencer::position_f (Grob*me) /* should use offset callback! */ -MAKE_SCHEME_CALLBACK(Staff_symbol_referencer,callback,2); +MAKE_SCHEME_CALLBACK (Staff_symbol_referencer,callback,2); SCM -Staff_symbol_referencer::callback (SCM element_smob, SCM ) +Staff_symbol_referencer::callback (SCM element_smob, SCM) { Grob *me = unsmob_grob (element_smob); @@ -125,7 +125,7 @@ void Staff_symbol_referencer::set_position (Grob*me,Real p) { Grob * st = staff_symbol_l (me); - if (st && me->common_refpoint(st, Y_AXIS)) + if (st && me->common_refpoint (st, Y_AXIS)) { Real oldpos = position_f (me); me->set_grob_property ("staff-position", gh_double2scm (p - oldpos)); @@ -149,15 +149,15 @@ Staff_symbol_referencer::set_position (Grob*me,Real p) Real Staff_symbol_referencer::staff_radius (Grob*me) { - return (line_count (me) -1) / 2; + return (line_count (me) -1) / 2; } int compare_position (Grob *const &a, Grob * const &b) { - return sign (Staff_symbol_referencer::position_f((Grob*)a) - - Staff_symbol_referencer::position_f((Grob*)b)); + return sign (Staff_symbol_referencer::position_f ((Grob*)a) - + Staff_symbol_referencer::position_f ((Grob*)b)); } diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 4980a34636..cbb5784ab1 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -17,7 +17,7 @@ -MAKE_SCHEME_CALLBACK(Staff_symbol,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Staff_symbol,brew_molecule,1); SCM Staff_symbol::brew_molecule (SCM smob) @@ -52,7 +52,7 @@ Staff_symbol::brew_molecule (SCM smob) } int -Staff_symbol::steps_i(Grob*me) +Staff_symbol::steps_i (Grob*me) { return line_count (me) * 2; } @@ -68,7 +68,7 @@ Staff_symbol::line_count (Grob*me) } Real -Staff_symbol::staff_space (Grob*me ) +Staff_symbol::staff_space (Grob*me) { Real ss = 1.0; diff --git a/lily/stanza-number-engraver.cc b/lily/stanza-number-engraver.cc index 2676c7f44e..a91e6bac79 100644 --- a/lily/stanza-number-engraver.cc +++ b/lily/stanza-number-engraver.cc @@ -23,14 +23,14 @@ class Stanza_number_engraver : public Engraver void create_text (SCM s); public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Stanza_number_engraver (); virtual void acknowledge_grob (Grob_info); virtual void stop_translation_timestep (); }; -ADD_THIS_TRANSLATOR(Stanza_number_engraver); +ADD_THIS_TRANSLATOR (Stanza_number_engraver); Stanza_number_engraver::Stanza_number_engraver () { @@ -39,7 +39,7 @@ Stanza_number_engraver::Stanza_number_engraver () } void -Stanza_number_engraver::acknowledge_grob(Grob_info i) +Stanza_number_engraver::acknowledge_grob (Grob_info i) { SCM s = get_property ("stanza"); @@ -50,11 +50,11 @@ Stanza_number_engraver::acknowledge_grob(Grob_info i) { // if (i.elem_l_->has_interface (symbol ("lyric-syllable-interface"))) // Tried catching lyric items to generate stanza numbers, but it spoils lyric spacing. - if (Bar::has_interface (i.elem_l_) || now_mom() == Moment(0)) + if (Bar::has_interface (i.elem_l_) || now_mom () == Moment (0)) // Works, but requires bar_engraver in LyricsVoice context apart from at beginning. // Is there any score element we can catch that will do the trick? // if (! i.elem_l_->has_interface (symbol ("lyric-syllable-interface")) || -// now_mom() == Moment(0)) +// now_mom () == Moment (0)) // What happens if we try anything at all EXCEPT a lyric? Is there anything else? // Not sure what it's catching, but it still mucks up lyrics. create_text (s); @@ -75,7 +75,7 @@ Stanza_number_engraver::stop_translation_timestep () void Stanza_number_engraver::create_text (SCM txt) { - if(!text_) + if (!text_) { text_ = new Item (get_property ("StanzaNumber")); text_->set_grob_property ("text", txt); diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index 374a3b1f1a..9375bd9a7f 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -24,7 +24,7 @@ class Stem_engraver : public Engraver public: VIRTUAL_COPY_CONS (Translator); - Stem_engraver(); + Stem_engraver (); protected: virtual void acknowledge_grob (Grob_info); @@ -50,7 +50,7 @@ Stem_engraver::Stem_engraver () void -Stem_engraver::acknowledge_grob(Grob_info i) +Stem_engraver::acknowledge_grob (Grob_info i) { Grob* h = i.elem_l_; if (Rhythmic_head::has_interface (h)) @@ -64,7 +64,7 @@ Stem_engraver::acknowledge_grob(Grob_info i) { stem_p_ = new Item (get_property ("Stem")); Stem::set_interface (stem_p_); - Staff_symbol_referencer::set_interface(stem_p_); + Staff_symbol_referencer::set_interface (stem_p_); stem_p_->set_grob_property ("duration-log", gh_int2scm (duration_log)); @@ -120,7 +120,7 @@ Stem_engraver::acknowledge_grob(Grob_info i) } void -Stem_engraver::stop_translation_timestep() +Stem_engraver::stop_translation_timestep () { if (tremolo_p_) { @@ -132,13 +132,13 @@ Stem_engraver::stop_translation_timestep() if (stem_p_) { SCM prop = get_property ("stemLeftBeamCount"); - if (gh_number_p(prop)) + if (gh_number_p (prop)) { Stem::set_beaming (stem_p_,gh_scm2int (prop),LEFT); daddy_trans_l_->set_property ("stemLeftBeamCount", SCM_UNDEFINED); } prop = get_property ("stemRightBeamCount"); - if (gh_number_p(prop)) + if (gh_number_p (prop)) { Stem::set_beaming (stem_p_,gh_scm2int (prop), RIGHT); daddy_trans_l_->set_property ("stemRightBeamCount", SCM_UNDEFINED); @@ -151,12 +151,12 @@ Stem_engraver::stop_translation_timestep() to forced), if we have a Chord_tremolo. */ SCM dir = stem_p_->get_grob_property ("direction"); - if (gh_number_p (dir) && to_dir(dir)) + if (gh_number_p (dir) && to_dir (dir)) { stem_p_->set_grob_property ("dir-forced", SCM_BOOL_T); } - typeset_grob(stem_p_); + typeset_grob (stem_p_); stem_p_ = 0; } diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index e053bda195..eaf6bd962f 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -34,18 +34,18 @@ Stem_tremolo::has_interface (Grob *me) return me->has_interface (ly_symbol2scm ("stem-tremolo")); } -MAKE_SCHEME_CALLBACK(Stem_tremolo,dim_callback,2); +MAKE_SCHEME_CALLBACK (Stem_tremolo,dim_callback,2); /* todo: init with cons. */ SCM -Stem_tremolo::dim_callback (SCM e, SCM ) +Stem_tremolo::dim_callback (SCM e, SCM) { Grob * se = unsmob_grob (e); Real space = Staff_symbol_referencer::staff_space (se); - return ly_interval2scm ( Interval (-space, space)); + return ly_interval2scm (Interval (-space, space)); } /* @@ -57,14 +57,14 @@ Stem_tremolo::height (SCM smob, SCM ax) { Axis a = (Axis)gh_scm2int (ax); Grob * me = unsmob_grob (smob); - assert ( a == Y_AXIS); + assert (a == Y_AXIS); SCM mol = me->get_uncached_molecule (); return ly_interval2scm (unsmob_molecule (mol)->extent (a)); } -MAKE_SCHEME_CALLBACK(Stem_tremolo,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Stem_tremolo,brew_molecule,1); SCM Stem_tremolo::brew_molecule (SCM smob) { @@ -122,9 +122,9 @@ Stem_tremolo::brew_molecule (SCM smob) if (beam) { // ugh, rather calc from Stem_tremolo_req - int beams_i = Stem::beam_count(stem, RIGHT) >? Stem::beam_count (stem, LEFT); - mol.translate (Offset(stem->relative_coordinate (0, X_AXIS) - me->relative_coordinate (0, X_AXIS), - Stem::stem_end_position (stem ) * ss / 2 - + int beams_i = Stem::beam_count (stem, RIGHT) >? Stem::beam_count (stem, LEFT); + mol.translate (Offset (stem->relative_coordinate (0, X_AXIS) - me->relative_coordinate (0, X_AXIS), + Stem::stem_end_position (stem) * ss / 2 - Directional_element_interface::get (beam) * beams_i * interbeam_f)); } else @@ -132,17 +132,17 @@ Stem_tremolo::brew_molecule (SCM smob) /* Beams should intersect one beamthickness below stem end */ - Real dy = Stem::stem_end_position (stem ) * ss / 2; - dy -= mol.extent (Y_AXIS).length () / 2 * Stem::get_direction (stem ); + Real dy = Stem::stem_end_position (stem) * ss / 2; + dy -= mol.extent (Y_AXIS).length () / 2 * Stem::get_direction (stem); /* uhg. Should use relative coords and placement */ Real whole_note_correction; - if (Stem::invisible_b (stem )) + if (Stem::invisible_b (stem)) { - Grob *hed = Stem::support_head (stem ); - whole_note_correction = -Stem::get_direction (stem ) + Grob *hed = Stem::support_head (stem); + whole_note_correction = -Stem::get_direction (stem) *hed->extent (hed, X_AXIS).length () / 2; } else diff --git a/lily/stem.cc b/lily/stem.cc index f144ba137e..f17dcae0b2 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -29,7 +29,7 @@ void -Stem::set_beaming (Grob*me ,int i, Direction d ) +Stem::set_beaming (Grob*me ,int i, Direction d) { SCM pair = me->get_grob_property ("beaming"); @@ -63,14 +63,14 @@ Stem::head_positions (Grob*me) Drul_array e (extremal_heads (me)); return Interval (Staff_symbol_referencer::position_f (e[DOWN]), - Staff_symbol_referencer::position_f ( e[UP])); + Staff_symbol_referencer::position_f (e[UP])); } Real Stem::chord_start_f (Grob*me) { - return head_positions(me)[get_direction (me)] + return head_positions (me)[get_direction (me)] * Staff_symbol_referencer::staff_space (me)/2.0; } @@ -112,7 +112,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) warning (_ ("Weird stem size; check for narrow beams")); me->set_grob_property ("stem-end-position", gh_double2scm (se)); @@ -181,7 +181,7 @@ Stem::extremal_heads (Grob*me) Grob * n = unsmob_grob (gh_car (s)); - int p = int(Staff_symbol_referencer::position_f (n)); + int p = int (Staff_symbol_referencer::position_f (n)); Direction d = LEFT; do { @@ -215,14 +215,14 @@ Stem::add_head (Grob*me, Grob *n) bool Stem::invisible_b (Grob*me) { - return !(heads_i (me) && Rhythmic_head::balltype_i (support_head (me)) >= 1); + return ! (heads_i (me) && Rhythmic_head::balltype_i (support_head (me)) >= 1); } int Stem::get_center_distance (Grob*me, Direction d) { int staff_center = 0; - int distance = (int) (d*(head_positions(me)[d] - staff_center)); + int distance = (int) (d* (head_positions (me)[d] - staff_center)); return distance >? 0; } @@ -246,19 +246,19 @@ Stem::get_default_stem_end_position (Grob*me) Array a; Real length_f = 0.; - SCM scm_len = me->get_grob_property("length"); + SCM scm_len = me->get_grob_property ("length"); if (gh_number_p (scm_len)) { length_f = gh_scm2double (scm_len); } else { - s = me->get_grob_property("lengths"); + s = me->get_grob_property ("lengths"); for (SCM q = s; q != SCM_EOL; q = gh_cdr (q)) a.push (gh_scm2double (gh_car (q))); // stem uses half-spaces - length_f = a[((flag_i (me) - 2) >? 0) ? 0) ? 0) ? 0) get_grob_property ("no-stem-extend")); if (!grace_b && !no_extend_b && dir * st < 0) // junkme? @@ -308,7 +308,7 @@ int Stem::flag_i (Grob*me) { SCM s = me->get_grob_property ("duration-log"); - return (gh_number_p (s)) ? gh_scm2int (s) : 2; + return (gh_number_p (s)) ? gh_scm2int (s) : 2; } void @@ -357,7 +357,7 @@ Stem::position_noteheads (Grob*me) } } -MAKE_SCHEME_CALLBACK(Stem,before_line_breaking,1); +MAKE_SCHEME_CALLBACK (Stem,before_line_breaking,1); SCM Stem::before_line_breaking (SCM smob) { @@ -368,7 +368,7 @@ Stem::before_line_breaking (SCM smob) if (invisible_b (me)) { me->remove_grob_property ("molecule-callback"); - // suicide(); + // suicide (); } set_spacing_hints (me); @@ -387,7 +387,7 @@ Stem::height (SCM smob, SCM ax) { Axis a = (Axis)gh_scm2int (ax); Grob * me = unsmob_grob (smob); - assert ( a == Y_AXIS); + assert (a == Y_AXIS); SCM mol = me->get_uncached_molecule (); Interval iv; @@ -427,7 +427,7 @@ Stem::flag (Grob*me) { String style; SCM st = me->get_grob_property ("flag-style"); - if ( gh_string_p (st)) + if (gh_string_p (st)) { style = ly_scm2string (st); } @@ -436,11 +436,11 @@ Stem::flag (Grob*me) Molecule m = Font_interface::get_default_font (me)->find_by_name (String ("flags-") + to_str (c) + to_str (flag_i (me))); if (!style.empty_b ()) - m.add_molecule(Font_interface::get_default_font (me)->find_by_name (String ("flags-") + to_str (c) + style)); + m.add_molecule (Font_interface::get_default_font (me)->find_by_name (String ("flags-") + to_str (c) + style)); return m; } -MAKE_SCHEME_CALLBACK(Stem,dim_callback,2); +MAKE_SCHEME_CALLBACK (Stem,dim_callback,2); SCM Stem::dim_callback (SCM e, SCM ax) { @@ -454,12 +454,12 @@ Stem::dim_callback (SCM e, SCM ax) { r = flag (se).extent (X_AXIS); } - return ly_interval2scm ( r); + return ly_interval2scm (r); } -MAKE_SCHEME_CALLBACK(Stem,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Stem,brew_molecule,1); SCM Stem::brew_molecule (SCM smob) @@ -472,7 +472,7 @@ Stem::brew_molecule (SCM smob) Real y1 = Staff_symbol_referencer::position_f (first_head (me)); Real y2 = stem_end_position (me); - Interval stem_y(y1,y2); + Interval stem_y (y1,y2); stem_y.unite (Interval (y2,y1)); Real dy = Staff_symbol_referencer::staff_space (me)/2.0; @@ -485,7 +485,7 @@ Stem::brew_molecule (SCM smob) angle = gh_scm2double (hed->get_grob_property ("attachment-angle")); } - stem_y[Direction(-d)] += d * head_wid * tan(angle)/(2*dy); + stem_y[Direction (-d)] += d * head_wid * tan (angle)/ (2*dy); if (!invisible_b (me)) { @@ -498,7 +498,7 @@ Stem::brew_molecule (SCM smob) if (!beam_l (me) && abs (flag_i (me)) > 2) { Molecule fl = flag (me); - fl.translate_axis(stem_y[d]*dy, Y_AXIS); + fl.translate_axis (stem_y[d]*dy, Y_AXIS); mol.add_molecule (fl); } @@ -508,19 +508,19 @@ Stem::brew_molecule (SCM smob) /* move the stem to right of the notehead if it is up. */ -MAKE_SCHEME_CALLBACK(Stem,off_callback,2); +MAKE_SCHEME_CALLBACK (Stem,off_callback,2); SCM -Stem::off_callback (SCM element_smob, SCM ) +Stem::off_callback (SCM element_smob, SCM) { Grob *me = unsmob_grob (element_smob); Real r=0; if (Grob * f = first_head (me)) { - Interval head_wid(0, f->extent (f,X_AXIS).length ()); + Interval head_wid (0, f->extent (f,X_AXIS).length ()); if (to_boolean (me->get_grob_property ("stem-centered"))) - return gh_double2scm ( head_wid.center ()); + return gh_double2scm (head_wid.center ()); Real rule_thick = gh_scm2double (me->get_grob_property ("thickness")) * me->paper_l ()->get_var ("stafflinethickness"); Direction d = get_direction (me); @@ -575,7 +575,7 @@ Stem::calc_stem_info (Grob*me) Array a; SCM s; - s = me->get_grob_property("beamed-minimum-lengths"); + s = me->get_grob_property ("beamed-minimum-lengths"); a.clear (); for (SCM q = s; q != SCM_EOL; q = gh_cdr (q)) a.push (gh_scm2double (gh_car (q))); @@ -584,7 +584,7 @@ Stem::calc_stem_info (Grob*me) Real minimum_length = a[multiplicity get_grob_property ("beamed-lengths"); - a.clear(); + a.clear (); for (SCM q = s; q != SCM_EOL; q = gh_cdr (q)) a.push (gh_scm2double (gh_car (q))); @@ -646,7 +646,7 @@ Stem::calc_stem_info (Grob*me) Grob *common = me->common_refpoint (beam, Y_AXIS); Real interstaff_f = beam_dir * - (me->relative_coordinate (common, Y_AXIS) + (me->relative_coordinate (common, Y_AXIS) - beam->relative_coordinate (common, Y_AXIS)); info.idealy_f_ += interstaff_f; diff --git a/lily/sustain-pedal.cc b/lily/sustain-pedal.cc index 851fddb88a..0d8c21fe41 100644 --- a/lily/sustain-pedal.cc +++ b/lily/sustain-pedal.cc @@ -30,11 +30,11 @@ struct Sustain_pedal { public: - DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM)); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM)); }; -MAKE_SCHEME_CALLBACK(Sustain_pedal,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Sustain_pedal,brew_molecule,1); SCM Sustain_pedal::brew_molecule (SCM smob) { diff --git a/lily/swallow-perf.cc b/lily/swallow-perf.cc index 30cdba8bd5..7ff03f174f 100644 --- a/lily/swallow-perf.cc +++ b/lily/swallow-perf.cc @@ -10,4 +10,4 @@ -ADD_THIS_TRANSLATOR(Swallow_performer); +ADD_THIS_TRANSLATOR (Swallow_performer); diff --git a/lily/syllable-group.cc b/lily/syllable-group.cc index 6965162778..afe3ad1078 100644 --- a/lily/syllable-group.cc +++ b/lily/syllable-group.cc @@ -15,18 +15,18 @@ member of the Lyric_phrasing_engraver class. */ -Syllable_group::Syllable_group() +Syllable_group::Syllable_group () { first_in_phrase_b_=true; melisma_b_ = false; - clear(); + clear (); } void -Syllable_group::clear() +Syllable_group::clear () { notehead_l_=0; - lyric_list_.clear(); + lyric_list_.clear (); longest_lyric_l_=0; shortest_lyric_l_=0; melisma_b_ = false; @@ -34,7 +34,7 @@ Syllable_group::clear() } void -Syllable_group::copy( Syllable_group *from) +Syllable_group::copy (Syllable_group *from) { notehead_l_ = from->notehead_l_; lyric_list_ = from->lyric_list_; @@ -47,29 +47,29 @@ Syllable_group::copy( Syllable_group *from) } void -Syllable_group::set_first_in_phrase(bool f) +Syllable_group::set_first_in_phrase (bool f) { first_in_phrase_b_ = f; } void -Syllable_group::set_notehead(Grob * notehead) +Syllable_group::set_notehead (Grob * notehead) { - if(!notehead_l_) { + if (!notehead_l_) { /* there should only be a single notehead, so silently ignore any extras */ notehead_l_=notehead; } } void -Syllable_group::add_lyric(Grob * lyric) +Syllable_group::add_lyric (Grob * lyric) { - lyric_list_.push(lyric); + lyric_list_.push (lyric); /* record longest and shortest lyrics */ - if( longest_lyric_l_ ) { - if(lyric->extent(lyric,X_AXIS).length() > (longest_lyric_l_->extent(longest_lyric_l_, X_AXIS)).length()) + if (longest_lyric_l_) { + if (lyric->extent (lyric,X_AXIS).length () > (longest_lyric_l_->extent (longest_lyric_l_, X_AXIS)).length ()) longest_lyric_l_ = lyric; - if(lyric->extent(lyric, X_AXIS).length() < (shortest_lyric_l_->extent(shortest_lyric_l_, X_AXIS)).length()) + if (lyric->extent (lyric, X_AXIS).length () < (shortest_lyric_l_->extent (shortest_lyric_l_, X_AXIS)).length ()) shortest_lyric_l_ = lyric; } else @@ -77,52 +77,52 @@ Syllable_group::add_lyric(Grob * lyric) } void -Syllable_group::add_extender(Grob * extender) +Syllable_group::add_extender (Grob * extender) { - if(notehead_l_ && melisma_b_) { - dynamic_cast(extender)->set_bound (RIGHT, notehead_l_); + if (notehead_l_ && melisma_b_) { + dynamic_cast (extender)->set_bound (RIGHT, notehead_l_); // should the extender finish at the right of the last note of the melisma, or the left? // Comments in lyric-extender.hh say left, but right looks better to me. GP. // Left: -// extender->set_grob_property("right-trim-amount", gh_double2scm(0.0)); +// extender->set_grob_property ("right-trim-amount", gh_double2scm (0.0)); // Right: Real ss = 1.0; - extender->set_grob_property("right-trim-amount", - gh_double2scm(-notehead_l_->extent(notehead_l_, X_AXIS).length()/ss)); + extender->set_grob_property ("right-trim-amount", + gh_double2scm (-notehead_l_->extent (notehead_l_, X_AXIS).length ()/ss)); } } bool -Syllable_group::set_lyric_align(const char *punc, Grob *default_notehead_l) +Syllable_group::set_lyric_align (const char *punc, Grob *default_notehead_l) { - if(lyric_list_.size()==0) { + if (lyric_list_.size ()==0) { // No lyrics: nothing to do. return true; } Grob * lyric; - alignment_i_ = appropriate_alignment(punc); + alignment_i_ = appropriate_alignment (punc); // If there was no notehead in the matching voice context, use the first // notehead caught from any voice context (any port in a storm). - if(!notehead_l_) { + if (!notehead_l_) { notehead_l_ = default_notehead_l; } - group_translation_f_ = amount_to_translate(); + group_translation_f_ = amount_to_translate (); // set the x alignment of each lyric - for(int l = 0; l < lyric_list_.size(); l++) { + for (int l = 0; l < lyric_list_.size (); l++) { lyric = lyric_list_[l]; - lyric->set_grob_property("self-alignment-X", gh_int2scm(alignment_i_)); + lyric->set_grob_property ("self-alignment-X", gh_int2scm (alignment_i_)); // centre on notehead ... if we have one. - if(notehead_l_) { - lyric->set_parent(notehead_l_, X_AXIS); + if (notehead_l_) { + lyric->set_parent (notehead_l_, X_AXIS); lyric->add_offset_callback (Side_position_interface::centered_on_parent_proc, X_AXIS); // reference is on the right of the notehead; move it left half way, and add translation - lyric->translate_axis (group_translation_f_-(notehead_l_->extent(notehead_l_, X_AXIS)).center(), X_AXIS); + lyric->translate_axis (group_translation_f_- (notehead_l_->extent (notehead_l_, X_AXIS)).center (), X_AXIS); } } return (notehead_l_); @@ -137,13 +137,13 @@ Syllable_group::set_lyric_align(const char *punc, Grob *default_notehead_l) - move so shortest lyric just reaches notehead centre */ Real -Syllable_group::amount_to_translate() +Syllable_group::amount_to_translate () { Real translate = 0.0; - if(alignment_i_ != CENTER) { + if (alignment_i_ != CENTER) { // FIXME: do we really know the lyric extent here? Some font sizing comes later? - Real l1 = longest_lyric_l_->extent(longest_lyric_l_, X_AXIS).length() / 2; - Real l2 = shortest_lyric_l_->extent(shortest_lyric_l_, X_AXIS).length(); + Real l1 = longest_lyric_l_->extent (longest_lyric_l_, X_AXIS).length () / 2; + Real l2 = shortest_lyric_l_->extent (shortest_lyric_l_, X_AXIS).length (); translate = l1 get_grob_property("text"); - String lyric_str = gh_string_p(lyric_scm)?ly_scm2string(lyric_scm):""; + SCM lyric_scm = lyric->get_grob_property ("text"); + String lyric_str = gh_string_p (lyric_scm)?ly_scm2string (lyric_scm):""; char lastchar; - if(lyric_str.length_i()>0) { - lastchar = lyric_str[lyric_str.length_i()-1]; + if (lyric_str.length_i ()>0) { + lastchar = lyric_str[lyric_str.length_i ()-1]; /* If it doesn't end in punctuation then it ain't an end of phrase */ - if(! strchr(punc, lastchar)) { + if (! strchr (punc, lastchar)) { /* Special case: trailing space. Here examine the previous character and reverse the sense of the test (i.e. trailing space makes a break without punctuation, or suppresses a break with punctuation). @@ -184,10 +184,10 @@ Syllable_group::appropriate_alignment(const char *punc) FIXME: The extra space throws alignment out a bit. */ - if(lastchar == ' ') { - if(lyric_str.length_i()>1) { - lastchar = lyric_str[lyric_str.length_i()-2]; - if(strchr(punc, lastchar)) + if (lastchar == ' ') { + if (lyric_str.length_i ()>1) { + lastchar = lyric_str[lyric_str.length_i ()-2]; + if (strchr (punc, lastchar)) end_phrase=false; } } @@ -196,7 +196,7 @@ Syllable_group::appropriate_alignment(const char *punc) } } } - if(end_phrase) + if (end_phrase) return RIGHT; return CENTER; @@ -206,23 +206,23 @@ Syllable_group::appropriate_alignment(const char *punc) back and fix the alignment when we DO know. */ void -Syllable_group::adjust_melisma_align() +Syllable_group::adjust_melisma_align () { - if(notehead_l_ && lyric_list_.size()) { + if (notehead_l_ && lyric_list_.size ()) { // override any previous offset adjustments Real translation = -group_translation_f_; // melisma aligning: switch (alignment_i_) { // case LEFT: // that's all case CENTER: // move right so smallest lyric is left-aligned on notehead - translation += (shortest_lyric_l_->extent(shortest_lyric_l_, X_AXIS)).length()/2; + translation += (shortest_lyric_l_->extent (shortest_lyric_l_, X_AXIS)).length ()/2; break; case RIGHT: // move right so smallest lyric is left-aligned on notehead - translation += (shortest_lyric_l_->extent(shortest_lyric_l_, X_AXIS)).length(); + translation += (shortest_lyric_l_->extent (shortest_lyric_l_, X_AXIS)).length (); break; } group_translation_f_ += translation; - for(int l = 0; l < lyric_list_.size(); l++) { + for (int l = 0; l < lyric_list_.size (); l++) { lyric_list_[l]->translate_axis (translation, X_AXIS); } } @@ -230,16 +230,16 @@ Syllable_group::adjust_melisma_align() bool -Syllable_group::is_empty() +Syllable_group::is_empty () { - return lyric_list_.size()==0; + return lyric_list_.size ()==0; } void -Syllable_group::next_lyric() +Syllable_group::next_lyric () { first_in_phrase_b_ = (alignment_i_ == RIGHT); - clear(); + clear (); } /* SMOB */ @@ -250,15 +250,15 @@ Syllable_group::mark_smob (SCM) } int -Syllable_group::print_smob (SCM, SCM port, scm_print_state * ) +Syllable_group::print_smob (SCM, SCM port, scm_print_state *) { scm_puts ("#", port); return 1; } -IMPLEMENT_UNSMOB(Syllable_group, voice_entry); -IMPLEMENT_SIMPLE_SMOBS(Syllable_group); -IMPLEMENT_DEFAULT_EQUAL_P(Syllable_group); +IMPLEMENT_UNSMOB (Syllable_group, voice_entry); +IMPLEMENT_SIMPLE_SMOBS (Syllable_group); +IMPLEMENT_DEFAULT_EQUAL_P (Syllable_group); SCM Syllable_group::make_entry () diff --git a/lily/symbol-cache.cc b/lily/symbol-cache.cc index 2cd999d356..d247ccd3d5 100644 --- a/lily/symbol-cache.cc +++ b/lily/symbol-cache.cc @@ -1,6 +1,6 @@ /* symbol-cache.cc -- implement a cache for literal symbols, eg - symbol("foo-bar") + symbol ("foo-bar") source file of the GNU LilyPond music typesetter @@ -22,7 +22,7 @@ SCM symbol (const char*s) { Literal_symbol_map::const_iterator i = literal_map.find (s); - if (i != literal_map.end()) + if (i != literal_map.end ()) return (*i).second; SCM sym = gh_symbol2scm ((char*)s); @@ -36,7 +36,7 @@ symbol (const char*s) This is a gory trick to cache the value gh_symbol2scm (), without cluttering up the C code with snarf macros. - You should *ONLY* use symbol() for arguments that are literal + You should *ONLY* use symbol () for arguments that are literal strings! without (wtk1-fugue2) diff --git a/lily/system-start-delimiter-engraver.cc b/lily/system-start-delimiter-engraver.cc index 8f172865a3..1f4504a733 100644 --- a/lily/system-start-delimiter-engraver.cc +++ b/lily/system-start-delimiter-engraver.cc @@ -19,8 +19,8 @@ class System_start_delimiter_engraver : public Engraver { public: - VIRTUAL_COPY_CONS(Translator); - System_start_delimiter_engraver(); + VIRTUAL_COPY_CONS (Translator); + System_start_delimiter_engraver (); protected: Spanner * delim_; @@ -29,7 +29,7 @@ protected: virtual void finalize (); }; -ADD_THIS_TRANSLATOR(System_start_delimiter_engraver); +ADD_THIS_TRANSLATOR (System_start_delimiter_engraver); void System_start_delimiter_engraver::acknowledge_grob (Grob_info inf) @@ -37,7 +37,7 @@ System_start_delimiter_engraver::acknowledge_grob (Grob_info inf) if (Staff_symbol::has_interface (inf.elem_l_)) { /* - don't add as Axis_group_interface::add_element (delim_, ), + don't add as Axis_group_interface::add_element (delim_,), because that would set the parent as well */ Pointer_group_interface::add_element (delim_, "elements", inf.elem_l_); @@ -52,18 +52,18 @@ System_start_delimiter_engraver::acknowledge_grob (Grob_info inf) */ if (gh_symbol_p (gl) && gl == ly_symbol2scm ("brace") && gh_symbol_p (my_gl) && my_gl == ly_symbol2scm ("bracket")) - inf.elem_l_->translate_axis ( -1.0, X_AXIS); // ugh + inf.elem_l_->translate_axis (-1.0, X_AXIS); // ugh } } -System_start_delimiter_engraver::System_start_delimiter_engraver() +System_start_delimiter_engraver::System_start_delimiter_engraver () { delim_ = 0; } void -System_start_delimiter_engraver::initialize() +System_start_delimiter_engraver::initialize () { delim_ = new Spanner (get_property ("SystemStartDelimiter")); diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 85d4947d59..39bd68040e 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -21,7 +21,7 @@ Molecule System_start_delimiter::staff_bracket (Grob*me,Real height) { - Real arc_height = gh_scm2double (me->get_grob_property("arch-height")) ; + Real arc_height = gh_scm2double (me->get_grob_property ("arch-height")) ; SCM at = gh_list (ly_symbol2scm ("bracket"), me->get_grob_property ("arch-angle"), @@ -56,10 +56,10 @@ System_start_delimiter::simple_bar (Grob*me,Real h) { Real w = me->paper_l ()->get_var ("stafflinethickness") * gh_scm2double (me->get_grob_property ("thickness")); - return Lookup::filledbox (Box (Interval(0,w), Interval(-h/2, h/2))); + return Lookup::filledbox (Box (Interval (0,w), Interval (-h/2, h/2))); } -MAKE_SCHEME_CALLBACK(System_start_delimiter,after_line_breaking,1); +MAKE_SCHEME_CALLBACK (System_start_delimiter,after_line_breaking,1); SCM System_start_delimiter::after_line_breaking (SCM smob) @@ -81,7 +81,7 @@ System_start_delimiter::try_collapse (Grob*me) } -MAKE_SCHEME_CALLBACK(System_start_delimiter,brew_molecule,1); +MAKE_SCHEME_CALLBACK (System_start_delimiter,brew_molecule,1); SCM System_start_delimiter::brew_molecule (SCM smob) @@ -97,13 +97,13 @@ System_start_delimiter::brew_molecule (SCM smob) Real staff_space = Staff_symbol_referencer::staff_space (me); Interval ext = ly_scm2interval (Axis_group_interface::group_extent_callback - (me->self_scm(), gh_int2scm (Y_AXIS))); + (me->self_scm (), gh_int2scm (Y_AXIS))); Real l = ext.length () / staff_space; if (ext.empty_b () || (gh_number_p (c) && l <= gh_scm2double (c))) { - me->suicide(); + me->suicide (); return SCM_EOL; } @@ -133,7 +133,7 @@ System_start_delimiter::staff_brace (Grob*me,Real y) int cmp = (lo + hi) / 2; b = fm->get_char (cmp); - if (b[Y_AXIS].empty_b () || b[Y_AXIS].length () > y ) + if (b[Y_AXIS].empty_b () || b[Y_AXIS].length () > y) hi = cmp; else lo = cmp; @@ -146,6 +146,6 @@ System_start_delimiter::staff_brace (Grob*me,Real y) b = fm->get_char (lo); b[X_AXIS] = Interval (0,0); - return Molecule(b, at); + return Molecule (b, at); } diff --git a/lily/template5.cc b/lily/template5.cc index 105aa44668..15ed4d4c66 100644 --- a/lily/template5.cc +++ b/lily/template5.cc @@ -14,7 +14,7 @@ #include "compare.hh" Rational -Interval_t::infinity() +Interval_t::infinity () { Rational infty; infty.set_infinite (1); @@ -29,4 +29,4 @@ Interval_t::T_to_str (Rational a) -template INTERVAL__INSTANTIATE(Rational); +template INTERVAL__INSTANTIATE (Rational); diff --git a/lily/tempo-performer.cc b/lily/tempo-performer.cc index 5691cdf5e2..53ca7c056c 100644 --- a/lily/tempo-performer.cc +++ b/lily/tempo-performer.cc @@ -13,10 +13,10 @@ class Tempo_performer : public Performer { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); - Tempo_performer(); - ~Tempo_performer(); + Tempo_performer (); + ~Tempo_performer (); protected: @@ -53,7 +53,7 @@ Tempo_performer::create_audio_elements () audio_p_ = new Audio_tempo (d->length_mom () / Moment (1, 4) - * Moment(gh_scm2int (met))); + * Moment (gh_scm2int (met))); Audio_element_info info (audio_p_, tempo_req_l_); announce_element (info); diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index e4d2bbc882..ed9473e000 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -24,7 +24,7 @@ class Text_engraver : public Engraver Link_array reqs_; Link_array texts_; public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); protected: virtual bool try_music (Music* m); virtual void stop_translation_timestep (); @@ -58,10 +58,10 @@ Text_engraver::acknowledge_grob (Grob_info inf) /* ugh. */ - if (Side_position_interface::get_axis( t) == X_AXIS + if (Side_position_interface::get_axis (t) == X_AXIS && !t->parent_l (Y_AXIS)) t->set_parent (inf.elem_l_, Y_AXIS); - else if (Side_position_interface::get_axis(t) == Y_AXIS + else if (Side_position_interface::get_axis (t) == Y_AXIS && !t->parent_l (X_AXIS)) t->set_parent (inf.elem_l_, X_AXIS); } @@ -71,7 +71,7 @@ Text_engraver::acknowledge_grob (Grob_info inf) { for (int i=0; i < texts_.size (); i++) { - Side_position_interface::add_support(texts_[i],inf.elem_l_); + Side_position_interface::add_support (texts_[i],inf.elem_l_); } } } @@ -157,5 +157,5 @@ Text_engraver::start_translation_timestep () reqs_.clear (); } -ADD_THIS_TRANSLATOR(Text_engraver); +ADD_THIS_TRANSLATOR (Text_engraver); diff --git a/lily/text-item.cc b/lily/text-item.cc index 25a0a0d3fb..9c40d40e9e 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1998--2001 Han-Wen Nienhuys + (c) 1998--2001 Han-Wen Nienhuys Jan Nieuwenhuizen */ #include @@ -53,8 +53,8 @@ Text_item::string2molecule (Grob *me, SCM text, SCM alist_chain) { SCM style = ly_assoc_chain (ly_symbol2scm ("font-style"), alist_chain); - if (gh_pair_p (style) && gh_symbol_p (gh_cdr (style))) - alist_chain = Font_interface::add_style (me, gh_cdr(style), alist_chain); + if (gh_pair_p (style) && gh_symbol_p (gh_cdr (style))) + alist_chain = Font_interface::add_style (me, gh_cdr (style), alist_chain); Font_metric *fm = Font_interface::get_font (me, alist_chain); @@ -122,7 +122,7 @@ Text_item::markup_text2molecule (Grob *me, SCM markup_text, SCM text = gh_cdr (markup_text); #if 1 - SCM p = gh_cons (gh_call2 (f, sheet, markup), alist_chain); + SCM p = gh_cons (gh_call2 (f, sheet, markup), alist_chain); #else SCM pp = gh_call2 (f, sheet, markup); gh_newline (); @@ -163,7 +163,7 @@ Text_item::markup_text2molecule (Grob *me, SCM markup_text, Molecule m = text2molecule (me, gh_car (text), p); SCM m_p = SCM_EOL; if (gh_pair_p (gh_car (text))) - m_p = gh_cons (gh_call2 (f, sheet, gh_caar (text)), alist_chain); + m_p = gh_cons (gh_call2 (f, sheet, gh_caar (text)), alist_chain); SCM m_k = ly_assoc_chain (ly_symbol2scm ("kern"), m_p); Real m_kern = kern[align]; if (gh_pair_p (m_k) && gh_number_p (gh_cdr (m_k))) diff --git a/lily/text-spanner-engraver.cc b/lily/text-spanner-engraver.cc index bba9f9be4e..f0321e3532 100644 --- a/lily/text-spanner-engraver.cc +++ b/lily/text-spanner-engraver.cc @@ -76,7 +76,7 @@ Text_spanner_engraver::try_music (Music *m) } else if (t == "text") { - req_drul_[s->get_span_dir()] = s; + req_drul_[s->get_span_dir ()] = s; return true; } } @@ -91,7 +91,7 @@ Text_spanner_engraver::create_grobs () if (!span_) { req_drul_[STOP]->origin ()->warning - (_ ("can't find start of text spanner")); + (_ ("can't find start of text spanner")); } else { @@ -111,7 +111,7 @@ Text_spanner_engraver::create_grobs () if (current_req_) { req_drul_[START]->origin ()->warning - (_ ("already have a text spanner")); + (_ ("already have a text spanner")); } else { diff --git a/lily/tfm-reader.cc b/lily/tfm-reader.cc index 37d3ecf7c3..42a51b8446 100644 --- a/lily/tfm-reader.cc +++ b/lily/tfm-reader.cc @@ -15,7 +15,8 @@ #include "warn.hh" #define format_str String_convert::form_str -#define FIX_UNITY (1 << 20) +#define FIX_UNITY \ + (1 << 20) static const Real fix_to_real (Fix f); @@ -70,7 +71,7 @@ void Tex_font_metric_reader::read_header () { U16 file_length = input_.get_U16 (); - (void) file_length; + (void) file_length; U16 header_length = input_.get_U16 (); info_.first_charcode = input_.get_U16 (); @@ -81,9 +82,9 @@ Tex_font_metric_reader::read_header () U16 italic_correction_word_count = input_.get_U16 (); U16 lig_kern_word_count = input_.get_U16 (); U16 kern_word_count = input_.get_U16 (); - (void)kern_word_count; + (void)kern_word_count; U16 extensible_word_count = input_.get_U16 (); - (void)extensible_word_count; + (void)extensible_word_count; header_.param_word_count = input_.get_U16 (); info_.parameter_count = header_.param_word_count; @@ -102,7 +103,7 @@ Tex_font_metric_reader::read_header () /* We don't care about the extensible table. */ if (header_length < 2) - error (_f ("TFM header of `%s' has only %u word(s)", + error (_f ("TFM header of `%s' has only %u word (s)", input_.name_str ().ch_C (), header_length)); info_.checksum = input_.get_U32 (); @@ -145,7 +146,7 @@ Tex_font_metric_reader::read_params () /* The first parameter is different than all the rest, because it isn't scaled by the design size. */ - info_.parameters[(TFM_SLANT_PARAMETER) - 1] = get_U32_fix_f (); + info_.parameters[ (TFM_SLANT_PARAMETER) - 1] = get_U32_fix_f (); for (Char_code i = 2; i <= header_.param_word_count; i++) info_.parameters[i - 1] = get_U32_fix_scaled_f (); @@ -227,10 +228,10 @@ Tex_font_metric_reader::read_char () * info_.design_size; \ } - GET_CHAR_DIMEN(width); - GET_CHAR_DIMEN(height); - GET_CHAR_DIMEN(depth); - GET_CHAR_DIMEN(italic_correction); + GET_CHAR_DIMEN (width); + GET_CHAR_DIMEN (height); + GET_CHAR_DIMEN (depth); + GET_CHAR_DIMEN (italic_correction); /* The other condition for a character existing is that it be between the first and last character codes given in the header. We've diff --git a/lily/tfm.cc b/lily/tfm.cc index 0999e49146..3bf4f94632 100644 --- a/lily/tfm.cc +++ b/lily/tfm.cc @@ -26,7 +26,7 @@ Tex_font_char_metric::dimensions () const } Real d = -depth_; - return Box (Interval (0, width_),Interval ( d ? height_)); + return Box (Interval (0, width_),Interval (d ? height_)); } Tex_font_char_metric::Tex_font_char_metric () @@ -70,7 +70,7 @@ static Tex_font_char_metric dummy_static_char_metric; Tex_font_char_metric const * Tex_font_metric::find_ascii (int ascii, bool warn) const { - if (ascii < ascii_to_metric_idx_.size() && ascii_to_metric_idx_[ascii] >= 0) + if (ascii < ascii_to_metric_idx_.size () && ascii_to_metric_idx_[ascii] >= 0) return & char_metrics_[ascii_to_metric_idx_ [ascii]]; else if (warn) { diff --git a/lily/tie-column.cc b/lily/tie-column.cc index bbd6b8d102..4f9536427b 100644 --- a/lily/tie-column.cc +++ b/lily/tie-column.cc @@ -53,7 +53,7 @@ int tie_compare (Grob* const & s1, Grob* const & s2) { - return sign (Tie::position_f (s1) - Tie::position_f(s2)); + return sign (Tie::position_f (s1) - Tie::position_f (s2)); } /* @@ -71,12 +71,12 @@ Tie_column::set_directions (Grob*me) Link_array ties = Pointer_group_interface__extract_elements (me, (Grob*)0, "ties"); - for (int i = ties.size (); i--; ) + for (int i = ties.size (); i--;) if (Directional_element_interface::get (ties[i])) ties.del (i); - if(!ties.size()) + if (!ties.size ()) return ; @@ -99,11 +99,11 @@ Tie_column::set_directions (Grob*me) } ties.sort (tie_compare); - Directional_element_interface::set( ties[0], DOWN); + Directional_element_interface::set (ties[0], DOWN); ties.del (0); - Directional_element_interface ::set(ties.pop (), UP); - for (int i=ties.size(); i--; ) + Directional_element_interface ::set (ties.pop (), UP); + for (int i=ties.size (); i--;) { Grob * t = ties[i]; Real p = Tie::position_f (t); @@ -115,7 +115,7 @@ Tie_column::set_directions (Grob*me) } -MAKE_SCHEME_CALLBACK(Tie_column,after_line_breaking,1); +MAKE_SCHEME_CALLBACK (Tie_column,after_line_breaking,1); SCM Tie_column::after_line_breaking (SCM smob) { diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index b81db0a02a..283e5aac4d 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -65,13 +65,13 @@ protected: virtual void create_grobs (); void typeset_tie (Grob*); public: - VIRTUAL_COPY_CONS(Translator); - Tie_engraver(); + VIRTUAL_COPY_CONS (Translator); + Tie_engraver (); }; -Tie_engraver::Tie_engraver() +Tie_engraver::Tie_engraver () { req_l_ = 0; tie_column_p_ = 0; @@ -112,7 +112,7 @@ Tie_engraver::acknowledge_grob (Grob_info i) Note_req * m = dynamic_cast (i.req_l_); if (!m) return; - now_heads_.push (CHead_melodic_tuple (i.elem_l_, m, now_mom()+ m->length_mom ())); + now_heads_.push (CHead_melodic_tuple (i.elem_l_, m, now_mom ()+ m->length_mom ())); } } @@ -123,22 +123,22 @@ Tie_engraver::create_grobs () if (req_l_) { now_heads_.sort (CHead_melodic_tuple::pitch_compare); - stopped_heads_.sort(CHead_melodic_tuple::pitch_compare); + stopped_heads_.sort (CHead_melodic_tuple::pitch_compare); SCM head_list = SCM_EOL; int j = stopped_heads_.size ()-1; int i = now_heads_.size ()-1; - while (i >= 0 && j >=0) + while (i >= 0 && j >=0) { int comp - = Pitch::compare (*unsmob_pitch (now_heads_[i].req_l_->get_mus_property ("pitch") ), + = Pitch::compare (*unsmob_pitch (now_heads_[i].req_l_->get_mus_property ("pitch")), *unsmob_pitch (stopped_heads_[j].req_l_->get_mus_property ("pitch"))); if (comp) { - (comp < 0) ? j -- : i--; + (comp < 0) ? j -- : i--; continue; } else @@ -189,7 +189,7 @@ Tie_engraver::create_grobs () { tie_column_p_ = new Spanner (get_property ("TieColumn")); Tie_column::set_interface (tie_column_p_); - for (int i = tie_p_arr_.size (); i--; ) + for (int i = tie_p_arr_.size (); i--;) Tie_column::add_tie (tie_column_p_,tie_p_arr_ [i]); announce_grob (tie_column_p_, 0); } @@ -228,20 +228,20 @@ Tie_engraver::stop_translation_timestep () void Tie_engraver::typeset_tie (Grob *her) { - if (!(Tie::head (her,LEFT) && Tie::head (her,RIGHT))) + if (! (Tie::head (her,LEFT) && Tie::head (her,RIGHT))) warning (_ ("lonely tie")); Direction d = LEFT; Drul_array new_head_drul; - new_head_drul[LEFT] = Tie::head(her,LEFT); + new_head_drul[LEFT] = Tie::head (her,LEFT); new_head_drul[RIGHT] = Tie::head (her,RIGHT); do { if (!Tie::head (her,d)) - new_head_drul[d] = Tie::head(her,(Direction)-d); - } while (flip(&d) != LEFT); + new_head_drul[d] = Tie::head (her, (Direction)-d); + } while (flip (&d) != LEFT); - index_set_cell (her->get_grob_property ("heads"), LEFT, new_head_drul[LEFT]->self_scm () ); - index_set_cell (her->get_grob_property ("heads"), RIGHT, new_head_drul[RIGHT]->self_scm () ); + index_set_cell (her->get_grob_property ("heads"), LEFT, new_head_drul[LEFT]->self_scm ()); + index_set_cell (her->get_grob_property ("heads"), RIGHT, new_head_drul[RIGHT]->self_scm ()); typeset_grob (her); } @@ -267,7 +267,7 @@ Tie_engraver::start_translation_timestep () } -ADD_THIS_TRANSLATOR(Tie_engraver); +ADD_THIS_TRANSLATOR (Tie_engraver); CHead_melodic_tuple::CHead_melodic_tuple () @@ -302,5 +302,5 @@ int CHead_melodic_tuple::time_compare (CHead_melodic_tuple const&h1, CHead_melodic_tuple const &h2) { - return (h1.end_ - h2.end_ ).sign (); + return (h1.end_ - h2.end_).sign (); } diff --git a/lily/tie-performer.cc b/lily/tie-performer.cc index 211cfbb925..ab1ef29966 100644 --- a/lily/tie-performer.cc +++ b/lily/tie-performer.cc @@ -39,7 +39,7 @@ inline int compare (CNote_melodic_tuple const &a, CNote_melodic_tuple const &b) class Tie_performer : public Performer { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Tie_performer (); private: bool done_; @@ -108,7 +108,7 @@ Tie_performer::acknowledge_audio_element (Audio_element_info i) Note_req * m = dynamic_cast (i.req_l_); if (!m) return; - now_notes_.push (CNote_melodic_tuple (nh, m, now_mom()+ m->length_mom ())); + now_notes_.push (CNote_melodic_tuple (nh, m, now_mom ()+ m->length_mom ())); } } @@ -131,19 +131,19 @@ Tie_performer::create_audio_elements () if (req_l_) { now_notes_.sort (CNote_melodic_tuple::pitch_compare); - stopped_notes_.sort(CNote_melodic_tuple::pitch_compare); + stopped_notes_.sort (CNote_melodic_tuple::pitch_compare); int i=0; int j=0; int tie_count=0; - while ( i < now_notes_.size () && j < stopped_notes_.size ()) + while (i < now_notes_.size () && j < stopped_notes_.size ()) { int comp - = Pitch::compare (*unsmob_pitch (now_notes_[i].req_l_->get_mus_property ("pitch") ), + = Pitch::compare (*unsmob_pitch (now_notes_[i].req_l_->get_mus_property ("pitch")), *unsmob_pitch (stopped_notes_[j].req_l_->get_mus_property ("pitch"))); if (comp) { - (comp < 0) ? i ++ : j++; + (comp < 0) ? i ++ : j++; continue; } else @@ -170,7 +170,7 @@ Tie_performer::create_audio_elements () if (!tie_p_arr_.size ()) { - req_l_->origin ()->warning (_("No ties were created!")); + req_l_->origin ()->warning (_ ("No ties were created!")); } } } @@ -231,5 +231,5 @@ int CNote_melodic_tuple::time_compare (CNote_melodic_tuple const&h1, CNote_melodic_tuple const &h2) { - return (h1.end_ - h2.end_ ).sign (); + return (h1.end_ - h2.end_).sign (); } diff --git a/lily/tie.cc b/lily/tie.cc index 6a762fc3e0..d465ae8b66 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -87,8 +87,8 @@ Tie::position_f (Grob*me) Direction Tie::get_default_dir (Grob*me) { - Item * sl = head(me,LEFT) ? Rhythmic_head::stem_l (head (me,LEFT)) :0; - Item * sr = head(me,RIGHT) ? Rhythmic_head::stem_l (head (me,RIGHT)) :0; + Item * sl = head (me,LEFT) ? Rhythmic_head::stem_l (head (me,LEFT)) :0; + Item * sr = head (me,RIGHT) ? Rhythmic_head::stem_l (head (me,RIGHT)) :0; if (sl && sr) { @@ -114,7 +114,7 @@ Tie::get_control_points (SCM smob) Direction headdir = CENTER; if (head (me,LEFT)) headdir = LEFT; - else if (head(me,RIGHT)) + else if (head (me,RIGHT)) headdir = RIGHT; else { @@ -142,7 +142,7 @@ Tie::get_control_points (SCM smob) this is a kludge: the tie has to be long enough to be visible, but should not go through key sigs. - (please fixme) + (please fixme) */ Real lambda = 0.5; @@ -174,7 +174,7 @@ Tie::get_control_points (SCM smob) - 2 * x_gap_f; } - Direction dir = Directional_element_interface::get(me); + Direction dir = Directional_element_interface::get (me); SCM details = me->get_grob_property ("details"); @@ -215,7 +215,7 @@ Tie::get_control_points (SCM smob) todo: tie / stem collision */ - b = slur_shape(width,h_inf, r_0); + b = slur_shape (width,h_inf, r_0); b.scale (1, dir); b.translate (Offset (left_x, ypos)); @@ -249,7 +249,7 @@ Tie::get_control_points (SCM smob) Real y1 = ry + clear; Real y2 = ry - clear; - newy = (fabs (y1 - y) < fabs (y2 - y)) ? y1 : y2; + newy = (fabs (y1 - y) < fabs (y2 - y)) ? y1 : y2; // newy = ry - 0.5 * staff_space * sign (diff) ; @@ -265,7 +265,7 @@ Tie::get_control_points (SCM smob) Real y0 = b.control_ [0][Y_AXIS]; b.control_[2][Y_AXIS] = b.control_[1][Y_AXIS] = - (b.control_[1][Y_AXIS] - y0) * ((newy - y0) / (y - y0)) + y0; + (b.control_[1][Y_AXIS] - y0) * ((newy - y0) / (y - y0)) + y0; } else programming_error ("Tie is nowhere horizontal"); @@ -274,11 +274,11 @@ Tie::get_control_points (SCM smob) SCM controls = SCM_EOL; for (int i= 4; i--;) - controls = gh_cons ( ly_offset2scm (b.control_[i]), controls); + controls = gh_cons (ly_offset2scm (b.control_[i]), controls); return controls; } -MAKE_SCHEME_CALLBACK(Tie,set_spacing_rods,1); +MAKE_SCHEME_CALLBACK (Tie,set_spacing_rods,1); /* TODO: set minimum distances for begin/end of line @@ -300,7 +300,7 @@ Tie::set_spacing_rods (SCM smob) return SCM_UNSPECIFIED; } -MAKE_SCHEME_CALLBACK(Tie,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Tie,brew_molecule,1); SCM Tie::brew_molecule (SCM smob) { diff --git a/lily/time-scaled-music-iterator.cc b/lily/time-scaled-music-iterator.cc index b9fbb76010..ee8074c6bc 100644 --- a/lily/time-scaled-music-iterator.cc +++ b/lily/time-scaled-music-iterator.cc @@ -22,10 +22,10 @@ Time_scaled_music_iterator::process (Moment m) if (yeah) set_translator (yeah->report_to_l ()); else - music_l_->origin ()->warning ( _("no one to print a tuplet start bracket")); + music_l_->origin ()->warning (_ ("no one to print a tuplet start bracket")); } Music_wrapper_iterator::process (m); } -IMPLEMENT_CTOR_CALLBACK(Time_scaled_music_iterator); +IMPLEMENT_CTOR_CALLBACK (Time_scaled_music_iterator); diff --git a/lily/time-scaled-music.cc b/lily/time-scaled-music.cc index 6ff67f2963..62eed79c98 100644 --- a/lily/time-scaled-music.cc +++ b/lily/time-scaled-music.cc @@ -18,6 +18,11 @@ Time_scaled_music::Time_scaled_music (SCM l) } +Time_scaled_music::Time_scaled_music () +{ + +} +ADD_MUSIC (Time_scaled_music); diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index caabdb6e25..4d9f071010 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -19,24 +19,24 @@ */ class Time_signature_engraver : public Engraver { protected: - virtual void stop_translation_timestep(); + virtual void stop_translation_timestep (); virtual void create_grobs (); public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); Item * time_signature_p_; SCM last_time_fraction_; - Time_signature_engraver(); + Time_signature_engraver (); }; -Time_signature_engraver::Time_signature_engraver() +Time_signature_engraver::Time_signature_engraver () { time_signature_p_ =0; last_time_fraction_ = SCM_BOOL_F; } void -Time_signature_engraver::create_grobs() +Time_signature_engraver::create_grobs () { /* not rigorously safe, since the value might get GC'd and @@ -57,7 +57,7 @@ Time_signature_engraver::create_grobs() void -Time_signature_engraver::stop_translation_timestep() +Time_signature_engraver::stop_translation_timestep () { if (time_signature_p_) { @@ -67,6 +67,6 @@ Time_signature_engraver::stop_translation_timestep() } -ADD_THIS_TRANSLATOR(Time_signature_engraver); +ADD_THIS_TRANSLATOR (Time_signature_engraver); diff --git a/lily/time-signature-performer.cc b/lily/time-signature-performer.cc index 0bcf5a4c40..e17b77d353 100644 --- a/lily/time-signature-performer.cc +++ b/lily/time-signature-performer.cc @@ -14,10 +14,10 @@ class Time_signature_performer : public Performer { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); - Time_signature_performer(); - ~Time_signature_performer(); + Time_signature_performer (); + ~Time_signature_performer (); protected: @@ -26,7 +26,7 @@ protected: SCM prev_fraction_; private: - Time_signature_change_req* time_signature_req_l_; + Audio_time_signature* audio_p_; }; @@ -56,7 +56,7 @@ Time_signature_performer::create_audio_elements () audio_p_ = new Audio_time_signature (b,o); Audio_element_info info (audio_p_, 0); announce_element (info); - time_signature_req_l_ = 0; + } } diff --git a/lily/time-signature.cc b/lily/time-signature.cc index cf1efd7e94..8e516e8ccd 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -14,7 +14,7 @@ #include "paper-def.hh" #include "font-interface.hh" -MAKE_SCHEME_CALLBACK(Time_signature,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Time_signature,brew_molecule,1); /* TODO: make different functions for special and normal timesigs. */ @@ -70,7 +70,7 @@ Time_signature::special_time_signature (Grob*me, String s, int n, int d) String symbolname = "timesig-" + s + to_str (n) + "/" + to_str (d); Molecule m = feta->find_by_name (symbolname); - if (!m.empty_b()) + if (!m.empty_b ()) return m; /* diff --git a/lily/timing-engraver.cc b/lily/timing-engraver.cc index da097bc7d5..ba462c1673 100644 --- a/lily/timing-engraver.cc +++ b/lily/timing-engraver.cc @@ -22,13 +22,13 @@ protected: virtual void stop_translation_timestep (); virtual void process_music (); public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); }; -ADD_THIS_TRANSLATOR(Timing_engraver); +ADD_THIS_TRANSLATOR (Timing_engraver); void -Timing_engraver::start_translation_timestep( ) +Timing_engraver::start_translation_timestep () { Timing_translator::start_translation_timestep (); @@ -46,7 +46,7 @@ Timing_engraver::start_translation_timestep( ) || (to_boolean (always))) { /* should this work, or be junked? See input/bugs/no-bars.ly */ - which=get_property ("defaultBarType" ); + which=get_property ("defaultBarType"); } } diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 11b5d69c6f..ec677a56fa 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -31,7 +31,7 @@ Timing_translator::try_music (Music*r) } void -Timing_translator::process_music() +Timing_translator::process_music () { if (check_ && measure_position ()) { @@ -40,7 +40,7 @@ Timing_translator::process_music() Moment zero; if (!to_boolean (get_property ("barCheckNoSynchronize"))) - daddy_trans_l_->set_property("measurePosition", zero.smobbed_copy ()); + daddy_trans_l_->set_property ("measurePosition", zero.smobbed_copy ()); } SCM fr = get_property ("timeSignatureFraction"); @@ -54,7 +54,7 @@ Timing_translator::process_music() void -Timing_translator::stop_translation_timestep() +Timing_translator::stop_translation_timestep () { check_ = 0; @@ -84,10 +84,10 @@ Timing_translator::stop_translation_timestep() } -ADD_THIS_TRANSLATOR(Timing_translator); +ADD_THIS_TRANSLATOR (Timing_translator); void -Timing_translator::initialize() +Timing_translator::initialize () { Moment m; daddy_trans_l_->set_property ("timing" , SCM_BOOL_T); @@ -102,8 +102,8 @@ Timing_translator::initialize() Moment Timing_translator::measure_length () const { - SCM l = get_property("measureLength"); - if (unsmob_moment(l)) + SCM l = get_property ("measureLength"); + if (unsmob_moment (l)) return *unsmob_moment (l); else return Moment (1); @@ -124,7 +124,7 @@ Timing_translator::set_time_signature () daddy_trans_l_->set_property ("beatLength", one_beat.smobbed_copy ()); } -Timing_translator::Timing_translator() +Timing_translator::Timing_translator () { last_time_sig_ = SCM_BOOL_F; @@ -140,7 +140,7 @@ Timing_translator::measure_position () const Moment m =0; if (unsmob_moment (sm)) { - m = *unsmob_moment(sm); + m = *unsmob_moment (sm); while (m < Moment (0)) m += measure_length (); } @@ -149,7 +149,7 @@ Timing_translator::measure_position () const } void -Timing_translator::start_translation_timestep() +Timing_translator::start_translation_timestep () { check_ =00; Translator *t = this; @@ -176,24 +176,24 @@ Timing_translator::start_translation_timestep() SCM s = get_property ("measurePosition"); if (unsmob_moment (s)) { - measposp = *unsmob_moment(s); + measposp = *unsmob_moment (s); } else { - daddy_trans_l_->set_property ("measurePosition", measposp.smobbed_copy()); + daddy_trans_l_->set_property ("measurePosition", measposp.smobbed_copy ()); } measposp += dt; SCM barn = get_property ("currentBarNumber"); int b = 0; - if (gh_number_p(barn)) + if (gh_number_p (barn)) { b = gh_scm2int (barn); } SCM cad = get_property ("timing"); - bool c= to_boolean (cad ); + bool c= to_boolean (cad); Moment len = measure_length (); while (c && measposp >= len) @@ -203,6 +203,6 @@ Timing_translator::start_translation_timestep() } daddy_trans_l_->set_property ("currentBarNumber", gh_int2scm (b)); - daddy_trans_l_->set_property ("measurePosition", measposp.smobbed_copy()); + daddy_trans_l_->set_property ("measurePosition", measposp.smobbed_copy ()); } diff --git a/lily/translator-ctors.cc b/lily/translator-ctors.cc index 4e57c28fa5..3a66cefb75 100644 --- a/lily/translator-ctors.cc +++ b/lily/translator-ctors.cc @@ -25,7 +25,7 @@ add_translator (Translator *t) if (!global_translator_dict_p) global_translator_dict_p = new Dictionary; - (*global_translator_dict_p)[classname (t)] = t; + (*global_translator_dict_p)[classname (t)] = t; } Translator* diff --git a/lily/translator-def.cc b/lily/translator-def.cc index a54b1715d1..917a31d7f0 100644 --- a/lily/translator-def.cc +++ b/lily/translator-def.cc @@ -20,7 +20,7 @@ Translator_def::print_smob (SCM smob, SCM port, scm_print_state*) { Translator_def* me = (Translator_def*) SCM_CELL_WORD_1 (smob); - scm_puts("#type_name_, port); scm_puts (">", port); return 1; @@ -49,7 +49,7 @@ foo_init () assign_sym = scm_permanent_object (ly_symbol2scm ("assign")); } -ADD_SCM_INIT_FUNC(transdef, foo_init); +ADD_SCM_INIT_FUNC (transdef, foo_init); Translator_def::Translator_def () { @@ -99,8 +99,8 @@ Translator_def::modify_definition (SCM list, SCM str, bool add) { if (scm_memq (str, list) != SCM_BOOL_F) { - warning (_f("Already contains: `%s'", s)); - warning (_f("Not adding translator: `%s'", s)); + warning (_f ("Already contains: `%s'", s)); + warning (_f ("Not adding translator: `%s'", s)); } else list= gh_cons (str, list); @@ -154,9 +154,9 @@ void Translator_def::apply_pushpop_property (Translator_group* me,SCM syms, SCM eprop, SCM val) { if (gh_symbol_p (syms)) - dynamic_cast(me)->execute_single_pushpop_property (syms, eprop, val); + dynamic_cast (me)->execute_single_pushpop_property (syms, eprop, val); else for (SCM s = syms; gh_pair_p (s); s = gh_cdr (s)) - dynamic_cast(me)->execute_single_pushpop_property (gh_car (s), eprop, val); + dynamic_cast (me)->execute_single_pushpop_property (gh_car (s), eprop, val); } @@ -199,9 +199,9 @@ Translator_def::path_to_acceptable_translator (SCM type_str, Music_output_def* o return best_result; } -IMPLEMENT_UNSMOB(Translator_def,translator_def); -IMPLEMENT_SMOBS(Translator_def); -IMPLEMENT_DEFAULT_EQUAL_P(Translator_def); +IMPLEMENT_UNSMOB (Translator_def,translator_def); +IMPLEMENT_SMOBS (Translator_def); +IMPLEMENT_DEFAULT_EQUAL_P (Translator_def); static SCM @@ -268,7 +268,7 @@ Translator_def::apply_property_operations (Translator_group*tg) } else if (type == assign_sym) { - tg->set_property (gh_car(entry), gh_cadr (entry)); + tg->set_property (gh_car (entry), gh_cadr (entry)); } } } diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 4a60731dd4..d1276c95ec 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -16,13 +16,13 @@ #include "translator-def.hh" Translator_group::Translator_group (Translator_group const&s) - : Translator(s) + : Translator (s) { iterator_count_ =0; Scheme_hash_table * tab = new Scheme_hash_table (*s.properties_dict ()); properties_scm_ = tab->self_scm (); - scm_unprotect_object (tab->self_scm( )); + scm_unprotect_object (tab->self_scm ()); } Scheme_hash_table* @@ -34,11 +34,11 @@ Translator_group::properties_dict () const Translator_group::~Translator_group () { - //assert (removable_b()); + //assert (removable_b ()); } -Translator_group::Translator_group() +Translator_group::Translator_group () { iterator_count_ = 0; Scheme_hash_table *tab = new Scheme_hash_table ; @@ -48,7 +48,7 @@ Translator_group::Translator_group() } void -Translator_group::check_removal() +Translator_group::check_removal () { SCM next = SCM_EOL; for (SCM p = trans_group_list_; gh_pair_p (p); p = next) @@ -58,7 +58,7 @@ Translator_group::check_removal() Translator_group *trg = dynamic_cast (unsmob_translator (gh_car (p))); trg->check_removal (); - if (trg->removable_b()) + if (trg->removable_b ()) terminate_translator (trg); } } @@ -87,7 +87,7 @@ Translator_group::add_group_translator (Translator *t) bool -Translator_group::removable_b() const +Translator_group::removable_b () const { return trans_group_list_ == SCM_EOL && ! iterator_count_; } @@ -120,7 +120,7 @@ Translator_group::find_create_translator_l (String n, String id) return existing; Link_array path - = unsmob_translator_def (definition_)->path_to_acceptable_translator (ly_str02scm ((char*)n.ch_C()), output_def_l ()); + = unsmob_translator_def (definition_)->path_to_acceptable_translator (ly_str02scm ((char*)n.ch_C ()), output_def_l ()); if (path.size ()) { @@ -172,9 +172,9 @@ Translator_group::try_music (Music* m) } int -Translator_group::depth_i() const +Translator_group::depth_i () const { - return (daddy_trans_l_) ? daddy_trans_l_->depth_i() + 1 : 0; + return (daddy_trans_l_) ? daddy_trans_l_->depth_i () + 1 : 0; } Translator_group* @@ -189,7 +189,7 @@ Translator_group::ancestor_l (int level) void Translator_group::terminate_translator (Translator*r_l) { - r_l->removal_processing(); + r_l->removal_processing (); /* Return value ignored. GC does the rest. */ @@ -218,7 +218,7 @@ Translator_group::is_bottom_translator_b () const } Translator_group* -Translator_group::get_default_interpreter() +Translator_group::get_default_interpreter () { if (!is_bottom_translator_b ()) { @@ -228,7 +228,7 @@ Translator_group::get_default_interpreter() Translator_def *t = unsmob_translator_def (st); if (!t) { - warning (_f ("can't find or create: `%s'", ly_scm2string (nm).ch_C())); + warning (_f ("can't find or create: `%s'", ly_scm2string (nm).ch_C ())); t = unsmob_translator_def (this->definition_); } Translator_group *tg = t->instantiate (output_def_l_); @@ -245,8 +245,8 @@ Translator_group::get_default_interpreter() static void static_each (SCM list, Method_pointer method) { - for (SCM p = list; gh_pair_p (p); p = gh_cdr(p)) - (unsmob_translator (gh_car (p))->*method) (); + for (SCM p = list; gh_pair_p (p); p = gh_cdr (p)) + (unsmob_translator (gh_car (p))->*method) (); } @@ -291,7 +291,7 @@ Translator_group::get_property (SCM sym) const void Translator_group::set_property (String id, SCM val) { - set_property (ly_symbol2scm (id.ch_C()), val); + set_property (ly_symbol2scm (id.ch_C ()), val); } void @@ -307,7 +307,7 @@ Translator_group::set_property (SCM sym, SCM val) void Translator_group::execute_single_pushpop_property (SCM prop, SCM eltprop, SCM val) { - if (gh_symbol_p(prop)) + if (gh_symbol_p (prop)) { if (val != SCM_UNDEFINED) { @@ -395,7 +395,7 @@ type_check_assignment (SCM val, SCM sym, SCM type_symbol) bool ok = true; SCM type_p = SCM_EOL; - if (gh_symbol_p(sym)) + if (gh_symbol_p (sym)) type_p = scm_object_property (sym, type_symbol); if (type_p != SCM_EOL && !gh_procedure_p (type_p)) @@ -416,7 +416,7 @@ type_check_assignment (SCM val, SCM sym, SCM type_symbol) scm_puts (_f ("Type check for `%s' failed; value `%s' must be of type `%s'", ly_symbol2string (sym).ch_C (), - ly_scm2string (ly_write2scm( val)).ch_C (), + ly_scm2string (ly_write2scm (val)).ch_C (), ly_scm2string (type_name).ch_C ()).ch_C (), errport); scm_puts ("\n", errport); @@ -462,4 +462,4 @@ add_trans_scm_funcs () scm_make_gsubr ("ly-set-trans-property", 3, 0, 0, (Scheme_function_unknown)ly_set_trans_property); } -ADD_SCM_INIT_FUNC(trans_scm, add_trans_scm_funcs); +ADD_SCM_INIT_FUNC (trans_scm, add_trans_scm_funcs); diff --git a/lily/translator.cc b/lily/translator.cc index 41111b075e..ce9ac35a0f 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -15,9 +15,9 @@ #include "ly-smobs.icc" char const* -Translator::name() const +Translator::name () const { - return classname(this); + return classname (this); } Translator::~Translator () @@ -155,7 +155,7 @@ Translator::finalize () SCM Translator::mark_smob (SCM sm) { - Translator * me = (Translator*) SCM_CELL_WORD_1(sm); + Translator * me = (Translator*) SCM_CELL_WORD_1 (sm); scm_gc_mark (me->simple_trans_list_); scm_gc_mark (me->trans_group_list_); scm_gc_mark (me->definition_); @@ -177,14 +177,10 @@ Translator::print_smob (SCM s, SCM port, scm_print_state *) don't try to print properties, that is too much hassle. */ scm_puts (" >", port); - - return 1; } - - -IMPLEMENT_UNSMOB(Translator, translator); -IMPLEMENT_SMOBS(Translator); -IMPLEMENT_DEFAULT_EQUAL_P(Translator); +IMPLEMENT_UNSMOB (Translator, translator); +IMPLEMENT_SMOBS (Translator); +IMPLEMENT_DEFAULT_EQUAL_P (Translator); diff --git a/lily/transposed-music.cc b/lily/transposed-music.cc index c8aa3780e9..9efae9e62a 100644 --- a/lily/transposed-music.cc +++ b/lily/transposed-music.cc @@ -23,5 +23,8 @@ Transposed_music::to_relative_octave (Pitch p) return p; } +ADD_MUSIC (Transposed_music); +Transposed_music::Transposed_music () +{ - +} diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index a835f21c5b..d7c2fe94fa 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -32,7 +32,7 @@ Tuplet_bracket::set_interface (Grob*me) /* TODO: use stem->beam fields to find Beams. Autobeams aren't found through the engraver mechanism. */ -MAKE_SCHEME_CALLBACK(Tuplet_bracket,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Tuplet_bracket,brew_molecule,1); SCM Tuplet_bracket::brew_molecule (SCM smob) { @@ -65,8 +65,8 @@ Tuplet_bracket::brew_molecule (SCM smob) Link_array column_arr= Pointer_group_interface__extract_elements (me, (Grob*)0, "columns"); - Real ncw = column_arr.top ()->extent(column_arr.top (), X_AXIS).length (); - Real w = dynamic_cast(me)->spanner_length () + ncw; + Real ncw = column_arr.top ()->extent (column_arr.top (), X_AXIS).length (); + Real w = dynamic_cast (me)->spanner_length () + ncw; Real staff_space = 1.0; Direction dir = Directional_element_interface::get (me); @@ -93,7 +93,7 @@ Tuplet_bracket::brew_molecule (SCM smob) SCM thick = me->get_grob_property ("thick"); SCM gap = me->get_grob_property ("number-gap"); - SCM at =gh_list(ly_symbol2scm ("tuplet"), + SCM at =gh_list (ly_symbol2scm ("tuplet"), gh_double2scm (1.0), gap, gh_double2scm (w), @@ -131,11 +131,11 @@ 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 = l && Note_column::rest_b(column_arr[r])) + while (r >= l && Note_column::rest_b (column_arr[r])) r--; if (l < r) @@ -155,7 +155,7 @@ Tuplet_bracket::calc_position_and_height (Grob*me,Real *offset, Real * dy) Real x0 = column_arr[0]->relative_coordinate (commonx, X_AXIS); Real x1 = column_arr.top ()->relative_coordinate (commonx, X_AXIS); - Real factor = column_arr.size () > 1 ? 1/(x1 - x0) : 1.0; + Real factor = column_arr.size () > 1 ? 1/ (x1 - x0) : 1.0; for (int i = 0; i < column_arr.size (); i++) { @@ -186,7 +186,7 @@ Tuplet_bracket::calc_dy (Grob*me,Real * dy) *dy = column_arr.top ()->extent (column_arr.top (), Y_AXIS) [d] - column_arr[0]->extent (column_arr[0], Y_AXIS) [d]; } -MAKE_SCHEME_CALLBACK(Tuplet_bracket,after_line_breaking,1); +MAKE_SCHEME_CALLBACK (Tuplet_bracket,after_line_breaking,1); SCM Tuplet_bracket::after_line_breaking (SCM smob) diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc index 8781845df6..7568a08679 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -20,7 +20,7 @@ class Tuplet_engraver : public Engraver { public: - VIRTUAL_COPY_CONS(Translator); + VIRTUAL_COPY_CONS (Translator); protected: Link_array time_scaled_music_arr_; @@ -52,7 +52,7 @@ Tuplet_engraver::try_music (Music *r) stop_moments_.push (m); SCM s = get_property ("tupletSpannerDuration"); - if (unsmob_moment(s)) + if (unsmob_moment (s)) m = m self_scm (), SCM_UNDEFINED)); glep->set_grob_property ("text", t); @@ -102,11 +102,11 @@ Tuplet_engraver::acknowledge_grob (Grob_info i) if (grace != wgb) return; - if (Note_column::has_interface(i.elem_l_)) + if (Note_column::has_interface (i.elem_l_)) { for (int j =0; j (i.elem_l_)); + Tuplet_bracket::add_column (started_span_p_arr_[j], dynamic_cast (i.elem_l_)); } else if (Beam::has_interface (i.elem_l_)) { @@ -126,7 +126,7 @@ Tuplet_engraver::start_translation_timestep () if (unsmob_moment (s)) tsd = *unsmob_moment (s); - for (int i= started_span_p_arr_.size (); i--; ) + for (int i= started_span_p_arr_.size (); i--;) { if (now >= span_stop_moments_[i]) { @@ -143,9 +143,9 @@ Tuplet_engraver::start_translation_timestep () if (now >= stop_moments_[i]) { started_span_p_arr_.del (i); - stop_moments_.del(i); + stop_moments_.del (i); span_stop_moments_.del (i); - time_scaled_music_arr_.del(i); + time_scaled_music_arr_.del (i); } } } @@ -160,6 +160,6 @@ Tuplet_engraver::finalize () } } -ADD_THIS_TRANSLATOR(Tuplet_engraver); +ADD_THIS_TRANSLATOR (Tuplet_engraver); diff --git a/lily/type-swallow-translator.cc b/lily/type-swallow-translator.cc index f73ef586be..e16b9e316a 100644 --- a/lily/type-swallow-translator.cc +++ b/lily/type-swallow-translator.cc @@ -20,4 +20,4 @@ Type_swallow_translator::try_music (Music*r) -DECLARE_REQUEST_SWALLOWER(Skip_req); +DECLARE_REQUEST_SWALLOWER (Skip_req); diff --git a/lily/unfolded-repeat-iterator.cc b/lily/unfolded-repeat-iterator.cc index 1c2136c625..93bc97d5f3 100644 --- a/lily/unfolded-repeat-iterator.cc +++ b/lily/unfolded-repeat-iterator.cc @@ -56,7 +56,7 @@ public: /// pointer to the alternative that will be processed next. SCM alternative_cons_; - ~Unfolded_repeat_iterator(); + ~Unfolded_repeat_iterator (); Unfolded_repeat_iterator (); Unfolded_repeat_iterator (Unfolded_repeat_iterator const &); protected: @@ -76,7 +76,7 @@ class Volta_repeat_iterator : public Unfolded_repeat_iterator public: Volta_repeat_iterator (); static SCM constructor_cxx_function; - VIRTUAL_COPY_CONS(Music_iterator); + VIRTUAL_COPY_CONS (Music_iterator); }; @@ -166,7 +166,7 @@ Unfolded_repeat_iterator::next_element (bool side_effect) if (do_repcommands) add_repeat_command (gh_list (ly_symbol2scm ("volta"), - ly_str02scm (repstr.ch_C()), SCM_UNDEFINED)); + ly_str02scm (repstr.ch_C ()), SCM_UNDEFINED)); } } else if (volta_b_) @@ -224,7 +224,7 @@ Unfolded_repeat_iterator::next_element (bool side_effect) { String repstr = to_str (done_count_ + 1) + "."; add_repeat_command (gh_list (ly_symbol2scm ("volta"), - ly_str02scm (repstr.ch_C()), SCM_UNDEFINED)); + ly_str02scm (repstr.ch_C ()), SCM_UNDEFINED)); add_repeat_command (ly_symbol2scm ("end-repeat")); } @@ -276,9 +276,9 @@ Unfolded_repeat_iterator::construct_children () do_main_b_ = false; } - while (current_iter_p_ && !current_iter_p_-> ok()) + while (current_iter_p_ && !current_iter_p_-> ok ()) { - next_element(true); + next_element (true); } } @@ -289,7 +289,7 @@ void Unfolded_repeat_iterator::add_repeat_command (SCM what) { SCM reps = ly_symbol2scm ("repeatCommands"); - SCM current_reps = report_to_l ()->get_property(reps); + SCM current_reps = report_to_l ()->get_property (reps); Translator_group * where = report_to_l ()->where_defined (reps); if (where @@ -312,7 +312,7 @@ Unfolded_repeat_iterator::process (Moment m) { while (!current_iter_p_->ok ()) { - next_element(true); + next_element (true); if (!current_iter_p_) return; @@ -360,7 +360,7 @@ Unfolded_repeat_iterator::get_music (Moment until)const s = gh_append2 (nm, s); Moment m = 0; - for (SCM i = nm; gh_pair_p(i); i = gh_cdr (i)) + for (SCM i = nm; gh_pair_p (i); i = gh_cdr (i)) m = m >? unsmob_music (gh_car (i))->length_mom (); if (m > Moment (0)) @@ -381,8 +381,8 @@ Unfolded_repeat_iterator::try_music_in_children (Music * m) const return current_iter_p_->try_music (m); } -IMPLEMENT_CTOR_CALLBACK(Unfolded_repeat_iterator); -IMPLEMENT_CTOR_CALLBACK(Volta_repeat_iterator); +IMPLEMENT_CTOR_CALLBACK (Unfolded_repeat_iterator); +IMPLEMENT_CTOR_CALLBACK (Volta_repeat_iterator); Volta_repeat_iterator::Volta_repeat_iterator () { diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index cee4a10387..c91890775f 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -18,31 +18,31 @@ class Vertical_align_engraver : public Engraver Spanner * valign_p_; bool qualifies_b (Grob_info) const; public: - VIRTUAL_COPY_CONS(Translator); - Vertical_align_engraver(); + VIRTUAL_COPY_CONS (Translator); + Vertical_align_engraver (); protected: virtual void acknowledge_grob (Grob_info); - virtual void initialize(); - virtual void finalize(); + virtual void initialize (); + virtual void finalize (); }; -Vertical_align_engraver::Vertical_align_engraver() +Vertical_align_engraver::Vertical_align_engraver () { valign_p_ =0; } void -Vertical_align_engraver::initialize() +Vertical_align_engraver::initialize () { valign_p_ =new Spanner (get_property ("VerticalAlignment")); - valign_p_->set_bound(LEFT,unsmob_grob (get_property ("currentCommandColumn"))); + valign_p_->set_bound (LEFT,unsmob_grob (get_property ("currentCommandColumn"))); announce_grob (valign_p_ , 0); } void -Vertical_align_engraver::finalize() +Vertical_align_engraver::finalize () { - valign_p_->set_bound(RIGHT,unsmob_grob (get_property ("currentCommandColumn"))); + valign_p_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn"))); typeset_grob (valign_p_); valign_p_ =0; } @@ -51,7 +51,7 @@ Vertical_align_engraver::finalize() bool Vertical_align_engraver::qualifies_b (Grob_info i) const { - int sz = i.origin_trans_l_arr ((Translator*)this).size() ; + int sz = i.origin_trans_l_arr ((Translator*)this).size () ; return sz > 1 && Axis_group_interface::has_interface (i.elem_l_) && !i.elem_l_->parent_l (Y_AXIS) && Axis_group_interface::axis_b (i.elem_l_, Y_AXIS); @@ -66,4 +66,4 @@ Vertical_align_engraver::acknowledge_grob (Grob_info i) } } -ADD_THIS_TRANSLATOR(Vertical_align_engraver); +ADD_THIS_TRANSLATOR (Vertical_align_engraver); diff --git a/lily/voice-devnull-engraver.cc b/lily/voice-devnull-engraver.cc index 9869784a70..94859cf819 100644 --- a/lily/voice-devnull-engraver.cc +++ b/lily/voice-devnull-engraver.cc @@ -50,7 +50,7 @@ Voice_devnull_engraver::try_music (Music *m) if (Span_req *s = dynamic_cast (m)) { SCM t = s->get_mus_property ("span-type"); - + for (char const **p = eat_spanners; *p; p++) { if (t == ly_str02scm (*p)) @@ -63,7 +63,7 @@ Voice_devnull_engraver::try_music (Music *m) } return false; } - + static char const *junk_interfaces[] = { "beam-interface", "dynamic-interface", @@ -104,9 +104,10 @@ Voice_devnull_engraver::acknowledge_grob (Grob_info i) else ; #endif - /* Ugh, we can suicide them, but they remain living */ + /* Ugh, we can suicide them, but they remain living */ i.elem_l_->suicide (); return; } } + diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index a6a9bbd7ba..a3e14ce483 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -22,8 +22,8 @@ class Volta_engraver : public Engraver { public: - Volta_engraver(); - VIRTUAL_COPY_CONS(Translator); + Volta_engraver (); + VIRTUAL_COPY_CONS (Translator); protected: virtual void acknowledge_grob (Grob_info); @@ -39,7 +39,7 @@ protected: SCM start_str_; }; -ADD_THIS_TRANSLATOR(Volta_engraver); +ADD_THIS_TRANSLATOR (Volta_engraver); Volta_engraver::Volta_engraver () { @@ -84,7 +84,7 @@ Volta_engraver::process_music () if (end && !volta_span_p_) { - warning (_("No volta spanner to end")); // fixme: be more verbose. + warning (_ ("No volta spanner to end")); // fixme: be more verbose. } else if (end) { @@ -148,7 +148,7 @@ Volta_engraver::acknowledge_grob (Grob_info i) if (volta_span_p_) Volta_spanner::add_bar (volta_span_p_, item); if (end_volta_span_p_) - Volta_spanner::add_bar(end_volta_span_p_ , item); + Volta_spanner::add_bar (end_volta_span_p_ , item); } } } @@ -158,7 +158,7 @@ Volta_engraver::finalize () { if (volta_span_p_) { - typeset_grob(volta_span_p_); + typeset_grob (volta_span_p_); } if (end_volta_span_p_) { @@ -175,7 +175,7 @@ Volta_engraver::stop_translation_timestep () { Side_position_interface::add_staff_support (end_volta_span_p_); - typeset_grob (end_volta_span_p_ ); + typeset_grob (end_volta_span_p_); end_volta_span_p_ =0; } } diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index 0385af35c2..356d696d52 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -35,7 +35,7 @@ Volta_spanner::set_interface (Grob*) */ -MAKE_SCHEME_CALLBACK(Volta_spanner,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Volta_spanner,brew_molecule,1); SCM Volta_spanner::brew_molecule (SCM smob) { @@ -60,7 +60,7 @@ Volta_spanner::brew_molecule (SCM smob) Real staff_thick = me->paper_l ()->get_var ("stafflinethickness"); Real half_space = 0.5; - Item * bound = dynamic_cast(me)->get_bound (LEFT); + Item * bound = dynamic_cast (me)->get_bound (LEFT); /* not a start, but really broken in two @@ -79,7 +79,7 @@ Volta_spanner::brew_molecule (SCM smob) */ } - Real w = dynamic_cast(me)->spanner_length () - left - half_space; + Real w = dynamic_cast (me)->spanner_length () - left - half_space; Real h = gh_scm2double (me->get_grob_property ("height")); Real t = staff_thick * gh_scm2double (me->get_grob_property ("thickness")); @@ -96,7 +96,7 @@ Volta_spanner::brew_molecule (SCM smob) Box b (Interval (0, w), Interval (0, h)); Molecule mol (b, at); - SCM text = me->get_grob_property("text"); + SCM text = me->get_grob_property ("text"); SCM properties = gh_list (me->mutable_property_alist_, me->immutable_property_alist_,SCM_UNDEFINED); Molecule num = Text_item::text2molecule (me, text, properties); @@ -108,11 +108,11 @@ Volta_spanner::brew_molecule (SCM smob) void -Volta_spanner::add_bar (Grob *me, Item* b) +Volta_spanner::add_bar (Grob *me, Item* b) { - Pointer_group_interface::add_element(me, "bars",b); + Pointer_group_interface::add_element (me, "bars",b); Side_position_interface::add_support (me,b); - add_bound_item (dynamic_cast(me), b); + add_bound_item (dynamic_cast (me), b); } void diff --git a/ly/engraver.ly b/ly/engraver.ly index b5aad036d9..91cba44360 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -121,6 +121,7 @@ VoiceContext = \translator { \consists "Auto_beam_engraver"; \consists "Chord_tremolo_engraver"; + \consists "Percent_repeat_engraver"; \consists "Melisma_engraver"; %{ diff --git a/mf/feta-bolletjes.mf b/mf/feta-bolletjes.mf index eccb52238c..9b0b1150c8 100644 --- a/mf/feta-bolletjes.mf +++ b/mf/feta-bolletjes.mf @@ -440,18 +440,120 @@ fet_beginchar("Quart diamondhead", "2diamond", "diamondhead") fill black; fet_endchar; -fet_beginchar("Crossed notehead", "2cross", "crossedhead") - set_char_box(0, black_notehead_width#, noteheight#/2, noteheight#/2); - pickup pencircle scaled 1.5 stafflinethickness; - lft x1 = 0; - bot y1 = -d; - top y2 = h; - rt x2 = w; +save triangle; path triangle; +triangle = (-sqrt3/4,-1/2) -- (0,1) -- (sqrt3/4,-1/2) -- cycle; + +fet_beginchar("Whole trianglehead", "0triangle", "wholetrianglehead") + set_char_box(0, 2(noteheight#+stafflinethickness#)/sqrt3*7/8, + (noteheight#+stafflinethickness#)/2,(noteheight#+stafflinethickness#)/2); + fill triangle scaled (7h/6) shifted (w/2,-h/6); + unfill triangle scaled 0.72h shifted (w/2,-h/6); +fet_endchar; +fet_beginchar("Half trianglehead", "1triangle", "halftrianglehead") + thick := 1.2stafflinethickness; + set_char_box(0, 2noteheight#/sqrt3*7/8,noteheight#/2,noteheight#/2); + fill triangle scaled (7h/6) shifted (w/2,-h/6); + unfill triangle scaled 0.7h shifted (w/2,-h/6); +fet_endchar; +fet_beginchar("Quart trianglehead", "2triangle", "trianglehead") + thick := 1.2stafflinethickness; + set_char_box(0, 2noteheight#/sqrt3*7/8,noteheight#/2,noteheight#/2); + fill triangle scaled (7h/6) shifted (w/2,-h/6); +fet_endchar; + - draw z1 .. z2; - draw (z1 .. z2) yscaled -1; -fet_endchar +slw := staff_space; +slw# := staff_space#; +slt := 1.25stafflinethickness; +slt# := 1.25stafflinethickness#; +slxt = 1.5slt; +slxt# := 1.5slt#; +slh := 1.5staff_space; +slh# := 1.5staff_space#; + +fet_beginchar("Whole slashhead","0slash","wholeslashhead") + wid := slw#+2slxt#+staff_space#; + set_char_box(0,wid-stafflinethickness#,slh#/2,slh#/2); + define_pixels (wid); + pickup penrazor scaled slxt; + draw (-b+slxt/2-stafflinethickness/2,-d) -- (-b+slxt/2+slw-stafflinethickness/2,h); + draw (w-slxt/2-slw+stafflinethickness/2,-d) -- (w-slxt/2+stafflinethickness/2,h); + pickup penrazor scaled slt rotated 90; + draw (-b+slxt-stafflinethickness/2,-d+slt/2) -- (w-slw+stafflinethickness/2,-d+slt/2); + draw (-b+slw-stafflinethickness/2,h-slt/2) -- (w-slxt+stafflinethickness/2,h-slt/2); +fet_endchar; + +fet_beginchar("Half slashhead","1slash","halfslashhead") + wid := slw#+2slxt#+0.6staff_space#; + set_char_box(0,wid-stafflinethickness#,slh#/2,slh#/2); + define_pixels (wid); + pickup penrazor scaled slxt; + draw (b+slxt/2-stafflinethickness/2,-d) -- (b+slxt/2+slw-stafflinethickness/2,h); + draw (w-slxt/2-slw+stafflinethickness/2,-d) -- (w-slxt/2+stafflinethickness/2,h); + pickup penrazor scaled slt rotated 90; + draw (b+slxt-stafflinethickness/2,-d+slt/2) -- (w-slw+stafflinethickness/2,-d+slt/2); + draw (b+slw-stafflinethickness/2,h-slt/2) -- (w-slxt+stafflinethickness/2,h-slt/2); +fet_endchar; +fet_beginchar("Quart slashhead","2slash","quartslashhead") + wid := slw#+slxt#; + set_char_box(0,slw#+slxt#-stafflinethickness#,slh#/2,slh#/2); + define_pixels (wid); + pickup penrazor scaled slxt; + draw (b+slxt/2-stafflinethickness/2,-d) -- (b+slxt/2+slw-stafflinethickness/2,h); +fet_endchar; + +% thick is the distance between the two parallel lines in the cross (distance between centres of lines) +def draw_cross(expr thick) = + pent := 1.2stafflinethickness; + pickup pencircle scaled pent; + % alfa is the slant of the lines (i.e. 1 means 45 degrees) + alfa := (2h-pent)/(w-pent); + % llen is the length of the little outer lines + % llen = thick / sin(2atan(alfa)) + llen := thick/(ypart(dir(2angle(1,alfa)))); + xa := llen/sqrt(1+alfa**2); + ya := xa*alfa; + xl := w/2-xa-pent/2; + yl := h-ya-pent/2; + save crz; path crz; + crz = (xa,0) -- (xa+xl,yl) -- (xl,yl+ya) -- (0,ya); + draw crz shifted(w/2,0); + draw crz xscaled -1 shifted(w/2,0); + draw crz yscaled -1 shifted(w/2,0); + draw crz scaled -1 shifted(w/2,0); +enddef; + +fet_beginchar("Whole Crossed notehead", "0cross", "wholecrossedhead") + wid# := black_notehead_width#+4stafflinethickness#; + hei# := noteheight#+stafflinethickness#; + set_char_box(0, wid#,hei#/2,hei#/2); + draw_cross(3.75stafflinethickness); +fet_endchar; + +fet_beginchar("Half Crossed notehead", "1cross", "halfcrossedhead") + wid# := black_notehead_width#+2stafflinethickness#; + hei# := noteheight#+stafflinethickness#/2; + set_char_box(0, wid#,hei#/2,hei#/2); + draw_cross(3stafflinethickness); +fet_endchar; + +fet_beginchar("Crossed notehead", "2cross", "crossedhead") + wid# := black_notehead_width#; + hei# := noteheight#; + set_char_box(0, wid#,hei#/2,hei#/2); + draw_cross(stafflinethickness/4); +fet_endchar; + +fet_beginchar("X-Circled notehead", "2xcircle", "xcircledhead") + set_char_box(0, noteheight#+stafflinethickness#, + noteheight#/2+stafflinethickness#/2,noteheight#/2+stafflinethickness#/2); + pickup pencircle scaled 1.2stafflinethickness; + draw fullcircle scaled 2h shifted (h,0); + pos := h/sqrt2; + draw (-pos+h,-pos) -- (pos+h,pos); + draw (-pos+h,pos) -- (pos+h,-pos); +fet_endchar; fet_endgroup("noteheads"); define_pixels(black_notehead_width); diff --git a/mf/feta-klef.mf b/mf/feta-klef.mf index 847045bb44..8e46d41427 100644 --- a/mf/feta-klef.mf +++ b/mf/feta-klef.mf @@ -1054,10 +1054,11 @@ def draw_percussion_clef(expr reduction) = save reduced_il; reduced_il# = staff_space# * reduction; define_pixels(reduced_il); - set_char_box(.5reduced_il#,1.25reduced_il#,reduced_il#,reduced_il#); - pickup pencircle scaled 3.33 stafflinethickness; - draw (b,h) -- (b,-d); - draw (w,h) -- (w,-d); + set_char_box(-.67reduced_il#,2.0reduced_il#,reduced_il#,reduced_il#); + razt := 0.45reduced_il; + pickup penrazor scaled razt; + draw (-b+razt/2,h) -- (-b+razt/2,-d); + draw (w-razt/2,h) -- (w-razt/2,-d); enddef; fet_beginchar("percussion clef", "percussion", "percussionclef") @@ -1068,4 +1069,39 @@ fet_beginchar("percussion clef", "percussion_change", "cpercussionclef") draw_percussion_clef(.8); fet_endchar; +def draw_tab_clef(expr reduction) = + save reduced_il; + reduced_il# = staff_space# * reduction; + define_pixels(reduced_il); + set_char_box(-.5reduced_il#,1.8reduced_il#,2.25reduced_il#,2.25reduced_il#); + bs := -d+0.65reduced_il; + cx := 0.5(-b+w); + xp := 0.32 reduced_il; + yp := 0.25reduced_il; + pickup pensquare xscaled xp yscaled yp; + + draw (-b,h) -- (w,h); + draw (cx,h) -- (cx,h-1.2reduced_il); + + pickup penrazor scaled yp rotated 90; + draw (-0.85b+0.15w,-0.25reduced_il) -- (-0.15b+0.85w,-0.25reduced_il); + pickup penrazor scaled xp; + draw (-b,-0.6reduced_il-yp/2) -- (cx,0.6reduced_il+yp/2) -- (w,-0.6reduced_il-yp/2); + + + pickup pensquare xscaled xp yscaled yp; + draw (-b,-d+1.2reduced_il) -- (-b,-d); + pickup pencircle xscaled xp yscaled yp; + draw (-b,-d) --- (cx,-d) .. (w,0.5(bs-d)) .. (cx,bs) --- (-b,bs) --- (cx,bs) + .. (0.3cx+0.7w,0.5(bs-d+1.2reduced_il)) .. (cx,-d+1.2reduced_il) --- (-b,-d+1.2reduced_il) +enddef; + +fet_beginchar("tab clef", "tab", "tabclef") + draw_tab_clef(1.0); +fet_endchar; + +fet_beginchar("tab clef", "tab_change", "ctabclef") + draw_tab_clef(.8); +fet_endchar; + fet_endgroup("clefs"); diff --git a/mf/feta-puntje.mf b/mf/feta-puntje.mf index 62a1076013..67199364fb 100644 --- a/mf/feta-puntje.mf +++ b/mf/feta-puntje.mf @@ -17,5 +17,11 @@ fet_beginchar("repeat dots", "repeatcolon", "repeatcolon") set_char_box(0, dot_diam#, staff_space#/2, staff_space#/2); fet_endchar; +fet_beginchar("even repeat dots", "evenrepeatcolon", "evenrepeatcolon") + pickup pencircle scaled dot_diam; + draw (dot_diam/2, staff_space); + addto currentpicture also currentpicture yscaled -1; + set_char_box(0, dot_diam#, staff_space#, staff_space#); +fet_endchar; fet_endgroup("dots"); diff --git a/scm/c++.scm b/scm/c++.scm index 8cd3d7b2bf..b995d72b30 100644 --- a/scm/c++.scm +++ b/scm/c++.scm @@ -119,6 +119,8 @@ (length . ,Repeated_music::unfolded_music_length))) ("fold" . ((iterator-ctor . ,Folded_repeat_iterator::constructor) (length . ,Repeated_music::folded_music_length))) + ("percent" . ((iterator-ctor . ,Percent_repeat_iterator::constructor) + (length . ,Repeated_music::unfolded_music_length))) ("tremolo" . ((iterator-ctor . ,Chord_tremolo_iterator::constructor) (length . ,Repeated_music::unfolded_music_length))))) @@ -128,5 +130,5 @@ (cdr handle) (begin (ly-warn - (string-append "Unknown repeat type `" name "'\nSee scm/lily.scm for supported repeats")) + (string-append "Unknown repeat type `" name "'\nSee scm/c++.scm for supported repeats")) '(type . 'repeated-music))))) diff --git a/scm/clef.scm b/scm/clef.scm index d9eecfb6b9..1a80cc09fd 100644 --- a/scm/clef.scm +++ b/scm/clef.scm @@ -20,6 +20,7 @@ ("F" . ( "clefs-F" 2 0)) ("subbass" . ("clefs-F" 4 0)) ("percussion" . ("clefs-percussion" 0 0)) + ("tab" . ("clefs-tab" 0 0)) ;; should move mensural stuff to separate file? ("vaticana_do1" . ("clefs-vaticana_do" -1 0)) diff --git a/scm/grob-description.scm b/scm/grob-description.scm index 2918e7685f..3b302aa63d 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -402,12 +402,25 @@ (slope-limit . 0.8) (meta . ,(grob-description "PhrasingSlur" slur-interface)) )) + (NonMusicalPaperColumn . ( (axes 0) (before-musical-spacing-factor . 1.0) (column-space-strength . 2.0) (meta . ,(grob-description "NonMusicalPaperColumn" paper-column-interface axis-group-interface spaceable-element-interface)) )) + + (PercentRepeat . ( + (spacing-procedure . ,Multi_measure_rest::set_spacing_rods) + (molecule-callback . ,Multi_measure_rest::percent) + (staff-position . 0) + (expand-limit . 10) + (padding . 2.0) ; staffspace + (minimum-width . 12.5) ; staffspace + (font-family . music) + (meta . ,(grob-description "PercentRepeat" multi-measure-rest-interface font-interface)) + )) + (Rest . ( (after-line-breaking-callback . ,Rest::after_line_breaking) @@ -430,7 +443,7 @@ ;; don't set direction here: it breaks staccato. (molecule-callback . ,Script::brew_molecule) (X-offset-callbacks . (,Side_position_interface::centered_on_parent)) - (after-line-breaking-callback . ,Script::after_line_breaking) + (before-line-breaking-callback . ,Script::before_line_breaking) (meta . ,(grob-description "Script" script-interface side-position-interface font-interface)) )) diff --git a/scm/output-lib.scm b/scm/output-lib.scm index b2668b4004..941eb94ee7 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -63,7 +63,7 @@ ;; silly, use alist? (define (find-notehead-symbol duration style) (case style - ((cross) "2cross") + ((xcircle) "2xcircle") ((harmonic) "0mensural") ((baroque) (string-append (number->string duration) -- 2.39.2