From 5af7cd44435fd26fade6e700a3912630e1553a87 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 18 Oct 2015 15:22:53 +0200 Subject: [PATCH] Revert "Issue 4550 (2/2) Avoid "using namespace std;" in included files" This reverts commit cb0b407e567feca71cbc5f9479a06b266c69a26c. Conflicts: lily/include/slur-proto-engraver.hh lily/scm-hash.cc --- flower/file-cookie.cc | 1 + flower/file-name.cc | 1 + flower/getopt-long.cc | 2 +- flower/include/cpu-timer.hh | 1 + flower/include/direction.hh | 4 +- flower/include/file-cookie.hh | 1 + flower/include/file-name.hh | 16 +++--- flower/include/file-path.hh | 22 ++++---- flower/include/flower-proto.hh | 1 + flower/include/getopt-long.hh | 6 +- flower/include/international.hh | 8 +-- flower/include/interval-set.hh | 8 +-- flower/include/interval.hh | 8 +-- flower/include/interval.tcc | 17 +++--- flower/include/libc-extension.hh | 1 + flower/include/matrix.hh | 4 +- flower/include/memory-stream.hh | 1 + flower/include/offset.hh | 2 +- flower/include/parray.hh | 3 +- flower/include/polynomial.hh | 14 ++--- flower/include/pqueue.hh | 2 +- flower/include/rational.hh | 2 +- flower/include/real.hh | 1 + flower/include/std-string.hh | 27 ++++----- flower/include/std-vector.hh | 41 +++++++------- flower/include/string-convert.hh | 61 +++++++++++---------- flower/include/virtual-methods.hh | 1 + flower/include/warn.hh | 22 ++++---- flower/interval-set.cc | 2 +- flower/libc-extension.cc | 1 + flower/memory-stream.cc | 1 + flower/polynomial.cc | 3 +- flower/rational.cc | 1 + flower/real.cc | 1 + flower/std-string.cc | 2 +- flower/string-convert.cc | 5 +- flower/test-file-name.cc | 1 + flower/test-file-path.cc | 2 +- flower/test-interval-set.cc | 1 + flower/test-std.cc | 11 ++-- flower/test-string.cc | 1 + flower/warn.cc | 1 + lily/align-interface.cc | 12 ++-- lily/audio-item.cc | 2 +- lily/auto-beam-engraver.cc | 2 +- lily/axis-group-interface.cc | 10 ++-- lily/beam-engraver.cc | 2 +- lily/beam-quanting.cc | 25 +++++---- lily/beam.cc | 22 ++++---- lily/beaming-pattern.cc | 10 ++-- lily/book.cc | 1 + lily/break-alignment-interface.cc | 2 +- lily/break-substitution.cc | 1 + lily/chord-tremolo-engraver.cc | 4 +- lily/clef-engraver.cc | 1 + lily/cluster-engraver.cc | 4 +- lily/completion-note-heads-engraver.cc | 3 +- lily/completion-rest-engraver.cc | 3 +- lily/constrained-breaking.cc | 4 +- lily/cue-clef-engraver.cc | 1 + lily/custos.cc | 1 + lily/dot-column.cc | 1 + lily/dot-configuration.cc | 2 +- lily/drum-note-engraver.cc | 1 + lily/figured-bass-engraver.cc | 2 +- lily/file-name-map.cc | 1 + lily/font-metric.cc | 1 + lily/fretboard-engraver.cc | 1 + lily/function-documentation.cc | 1 + lily/general-scheme.cc | 1 + lily/global-context.cc | 1 + lily/grob-interface.cc | 2 +- lily/grob-pq-engraver.cc | 2 +- lily/hairpin.cc | 2 +- lily/hara-kiri-group-spanner.cc | 2 +- lily/includable-lexer.cc | 1 + lily/include/accidental-placement.hh | 6 +- lily/include/align-interface.hh | 8 +-- lily/include/all-font-metrics.hh | 10 ++-- lily/include/articulations.hh | 4 +- lily/include/audio-column.hh | 2 +- lily/include/audio-element-info.hh | 2 +- lily/include/audio-item.hh | 14 ++--- lily/include/audio-staff.hh | 2 +- lily/include/axis-group-interface.hh | 8 +-- lily/include/beam-scoring-problem.hh | 28 +++++----- lily/include/beam.hh | 4 +- lily/include/beaming-pattern.hh | 2 +- lily/include/bezier.hh | 14 ++--- lily/include/break-align-interface.hh | 2 +- lily/include/change-iterator.hh | 6 +- lily/include/change-sequence-iterator.hh | 2 +- lily/include/coherent-ligature-engraver.hh | 6 +- lily/include/column-x-positions.hh | 6 +- lily/include/constrained-breaking.hh | 22 ++++---- lily/include/context-def.hh | 6 +- lily/include/context.hh | 20 +++---- lily/include/dimensions.hh | 2 +- lily/include/dot-configuration.hh | 2 +- lily/include/dot-formatting-problem.hh | 2 +- lily/include/duration.hh | 2 +- lily/include/engraver-group.hh | 2 +- lily/include/file-name-map.hh | 2 +- lily/include/font-metric.hh | 14 ++--- lily/include/freetype.hh | 2 +- lily/include/global-context.hh | 2 +- lily/include/gregorian-ligature-engraver.hh | 4 +- lily/include/gregorian-ligature.hh | 2 +- lily/include/grob-array.hh | 10 ++-- lily/include/grob-info.hh | 2 +- lily/include/grob.hh | 12 ++-- lily/include/horizontal-bracket.hh | 2 +- lily/include/includable-lexer.hh | 14 ++--- lily/include/input.hh | 22 ++++---- lily/include/interval-minefield.hh | 2 +- lily/include/keyword.hh | 2 +- lily/include/least-squares.hh | 2 +- lily/include/ligature-engraver.hh | 6 +- lily/include/lily-guile-macros.hh | 18 +++--- lily/include/lily-guile.hh | 28 +++++----- lily/include/lily-lexer.hh | 14 ++--- lily/include/lily-parser.hh | 16 +++--- lily/include/lily-version.hh | 6 +- lily/include/lilypond-version.hh | 6 +- lily/include/lookup.hh | 4 +- lily/include/main.hh | 24 ++++---- lily/include/midi-chunk.hh | 18 +++--- lily/include/midi-item.hh | 26 ++++----- lily/include/midi-stream.hh | 7 ++- lily/include/midi-walker.hh | 4 +- lily/include/misc.hh | 3 +- lily/include/modified-font-metric.hh | 8 +-- lily/include/moment.hh | 2 +- lily/include/music-iterator.hh | 2 +- lily/include/note-collision.hh | 6 +- lily/include/note-head.hh | 2 +- lily/include/open-type-font.hh | 14 ++--- lily/include/output-def.hh | 2 +- lily/include/page-breaking.hh | 32 +++++------ lily/include/page-layout-problem.hh | 20 +++---- lily/include/page-spacing-result.hh | 4 +- lily/include/page-spacing.hh | 6 +- lily/include/page-turn-page-breaking.hh | 8 +-- lily/include/pango-font.hh | 8 +-- lily/include/paper-column-engraver.hh | 6 +- lily/include/paper-outputter.hh | 4 +- lily/include/paper-score.hh | 14 ++--- lily/include/performance.hh | 8 +-- lily/include/performer-group.hh | 2 +- lily/include/pitch.hh | 2 +- lily/include/pointer-group-interface.hh | 8 +-- lily/include/prob.hh | 2 +- lily/include/program-option.hh | 2 +- lily/include/relocate.hh | 8 +-- lily/include/rest.hh | 2 +- lily/include/scale.hh | 4 +- lily/include/score-engraver.hh | 2 +- lily/include/score.hh | 2 +- lily/include/script-column.hh | 2 +- lily/include/separation-item.hh | 2 +- lily/include/simple-spacer.hh | 8 +-- lily/include/skyline-pair.hh | 6 +- lily/include/skyline.hh | 16 +++--- lily/include/slur-configuration.hh | 8 +-- lily/include/slur-proto-engraver.hh | 14 ++--- lily/include/slur-scoring.hh | 14 ++--- lily/include/slur.hh | 2 +- lily/include/smobs.hh | 10 ++-- lily/include/smobs.tcc | 4 +- lily/include/source-file.hh | 25 +++++---- lily/include/sources.hh | 4 +- lily/include/spacing-interface.hh | 4 +- lily/include/spacing-spanner.hh | 12 ++-- lily/include/spanner.hh | 2 +- lily/include/spring.hh | 2 +- lily/include/staff-symbol.hh | 4 +- lily/include/stem.hh | 2 +- lily/include/stencil.hh | 1 + lily/include/system.hh | 14 ++--- lily/include/tie-configuration.hh | 24 ++++---- lily/include/tie-formatting-problem.hh | 32 +++++------ lily/include/translator-dispatch-list.hh | 2 +- lily/include/translator-group.hh | 2 +- lily/include/translator.hh | 2 +- lily/include/translator.icc | 6 +- lily/include/tuplet-bracket.hh | 2 +- lily/include/tuplet-number.hh | 2 +- lily/input.cc | 1 + lily/keyword.cc | 1 + lily/ledger-line-spanner.cc | 9 +-- lily/lexer.ll | 1 + lily/lily-guile.cc | 1 + lily/lily-lexer.cc | 1 + lily/line-interface.cc | 8 +-- lily/lookup.cc | 7 ++- lily/lyric-combine-music-iterator.cc | 2 +- lily/lyric-extender.cc | 8 +-- lily/lyric-hyphen.cc | 4 +- lily/main.cc | 1 + lily/mark-engraver.cc | 1 + lily/metronome-engraver.cc | 1 + lily/midi-item.cc | 2 +- lily/midi-stream.cc | 1 + lily/misc.cc | 2 +- lily/modified-font-metric.cc | 1 + lily/multi-measure-rest.cc | 10 ++-- lily/music-iterator.cc | 1 + lily/music-sequence.cc | 4 +- lily/new-fingering-engraver.cc | 2 +- lily/note-collision.cc | 6 +- lily/note-column.cc | 1 + lily/note-head.cc | 7 ++- lily/note-heads-engraver.cc | 1 + lily/note-spacing.cc | 8 +-- lily/one-line-page-breaking.cc | 4 +- lily/open-type-font.cc | 1 + lily/ottava-bracket.cc | 2 +- lily/page-breaking.cc | 32 +++++------ lily/page-layout-problem.cc | 6 +- lily/page-spacing.cc | 4 +- lily/page-turn-engraver.cc | 8 +-- lily/page-turn-page-breaking.cc | 2 +- lily/paper-column.cc | 2 +- lily/paper-outputter.cc | 1 + lily/parse-scm.cc | 1 + lily/parser.yy | 1 + lily/part-combine-iterator.cc | 2 +- lily/pdf-scheme.cc | 1 + lily/performance.cc | 3 +- lily/pfb.cc | 1 + lily/program-option-scheme.cc | 3 +- lily/quote-iterator.cc | 4 +- lily/rest-collision.cc | 3 +- lily/score.cc | 1 + lily/separation-item.cc | 2 +- lily/side-position-interface.cc | 5 +- lily/simple-spacer.cc | 10 ++-- lily/simultaneous-music-iterator.cc | 2 +- lily/skyline-pair.cc | 4 +- lily/skyline.cc | 14 ++--- lily/slur-configuration.cc | 24 ++++---- lily/slur-scoring.cc | 4 +- lily/slur.cc | 2 +- lily/source-file.cc | 9 +-- lily/spacing-basic.cc | 8 +-- lily/spacing-determine-loose-columns.cc | 4 +- lily/spacing-engraver.cc | 6 +- lily/spacing-interface.cc | 2 +- lily/spacing-loose-columns.cc | 6 +- lily/spacing-spanner.cc | 14 ++--- lily/spring.cc | 14 ++--- lily/staff-spacing.cc | 17 +++--- lily/stem-tremolo.cc | 6 +- lily/stem.cc | 33 +++++------ lily/stencil-integral.cc | 9 +-- lily/stencil.cc | 2 +- lily/system-start-delimiter.cc | 2 +- lily/tab-note-heads-engraver.cc | 1 + lily/tab-tie-follow-engraver.cc | 1 + lily/text-interface.cc | 2 +- lily/tie-column.cc | 1 + lily/tie-formatting-problem.cc | 8 +-- lily/tuplet-bracket.cc | 2 +- lily/tuplet-iterator.cc | 4 +- lily/tuplet-number.cc | 6 +- lily/vaticana-ligature-engraver.cc | 2 +- lily/vaticana-ligature.cc | 2 +- lily/volta-bracket.cc | 1 + 268 files changed, 896 insertions(+), 815 deletions(-) diff --git a/flower/file-cookie.cc b/flower/file-cookie.cc index 36871d705d..762acb1c06 100644 --- a/flower/file-cookie.cc +++ b/flower/file-cookie.cc @@ -1,6 +1,7 @@ #include #include +using namespace std; #include "memory-stream.hh" diff --git a/flower/file-name.cc b/flower/file-name.cc index 24db2021b0..71b3bf27b5 100644 --- a/flower/file-name.cc +++ b/flower/file-name.cc @@ -25,6 +25,7 @@ #include #include +using namespace std; #include "config.hh" diff --git a/flower/getopt-long.cc b/flower/getopt-long.cc index 658faed921..49f7c8831d 100644 --- a/flower/getopt-long.cc +++ b/flower/getopt-long.cc @@ -318,7 +318,7 @@ Long_option_init::table_string (Long_option_init *l) size_t wid = 0; for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++) - wid = std::max (wid, l[i].str_for_help ().length ()); + wid = max (wid, l[i].str_for_help ().length ()); for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++) { diff --git a/flower/include/cpu-timer.hh b/flower/include/cpu-timer.hh index e77cc1f2a6..3c492eeef9 100644 --- a/flower/include/cpu-timer.hh +++ b/flower/include/cpu-timer.hh @@ -21,6 +21,7 @@ #define CPU_TIMER_HH #include +using namespace std; #include "real.hh" diff --git a/flower/include/direction.hh b/flower/include/direction.hh index dff5467497..0d36c0f7c7 100644 --- a/flower/include/direction.hh +++ b/flower/include/direction.hh @@ -71,9 +71,9 @@ operator - (Direction d) template T minmax (Direction d, T a, T b) { if (d == UP) - return std::max (a, b); + return max (a, b); else - return std::min (a, b); + return min (a, b); } #endif // DIRECTION_HH diff --git a/flower/include/file-cookie.hh b/flower/include/file-cookie.hh index d55a918c87..6bdb236699 100644 --- a/flower/include/file-cookie.hh +++ b/flower/include/file-cookie.hh @@ -5,6 +5,7 @@ extern "C" { #include #include + using namespace std; #if (! defined (__off64_t) && ! defined (__off64_t_defined)) || ! defined (__cplusplus) #define off64_t unsigned long long diff --git a/flower/include/file-name.hh b/flower/include/file-name.hh index 6f05a03635..6f2da75093 100644 --- a/flower/include/file-name.hh +++ b/flower/include/file-name.hh @@ -29,18 +29,18 @@ std::string get_working_directory (); class File_name { public: - std::string root_; - std::string dir_; - std::string base_; - std::string ext_; + string root_; + string dir_; + string base_; + string ext_; - File_name (std::string = ""); + File_name (string = ""); bool is_absolute () const; - std::string to_string () const; + string to_string () const; File_name canonicalized () const; - std::string dir_part () const; - std::string file_part () const; + string dir_part () const; + string file_part () const; }; #endif /* FILE_NAME */ diff --git a/flower/include/file-path.hh b/flower/include/file-path.hh index c3597934d9..1c039cf4ab 100644 --- a/flower/include/file-path.hh +++ b/flower/include/file-path.hh @@ -34,20 +34,20 @@ class File_path { - std::vector dirs_; + vector dirs_; public: - std::vector directories () const; - std::string find (const std::string &name) const; - std::string find (const std::string &name, char const *extensions[]); - std::string to_string () const; - bool try_append (std::string str); - void append (const std::string&); - void parse_path (const std::string&); - void prepend (const std::string&); + vector directories () const; + string find (const string &name) const; + string find (const string &name, char const *extensions[]); + string to_string () const; + bool try_append (string str); + void append (const string&); + void parse_path (const string&); + void prepend (const string&); }; -bool is_file (const std::string &file_name); -bool is_dir (std::string file_name); +bool is_file (const string &file_name); +bool is_dir (string file_name); #endif /* FILE_PATH */ diff --git a/flower/include/flower-proto.hh b/flower/include/flower-proto.hh index 1ba3760f2e..33e587d000 100644 --- a/flower/include/flower-proto.hh +++ b/flower/include/flower-proto.hh @@ -27,6 +27,7 @@ typedef long long I64; class String_convert; #include "real.hh" +using namespace std; template struct Interval_t; template struct PQueue; diff --git a/flower/include/getopt-long.hh b/flower/include/getopt-long.hh index 2e13188a60..52c819822c 100644 --- a/flower/include/getopt-long.hh +++ b/flower/include/getopt-long.hh @@ -20,12 +20,12 @@ struct Long_option_init char const *help_str0_; - std::string to_string () const; - std::string str_for_help () const; + string to_string () const; + string str_for_help () const; // NO constructor! static int compare (Long_option_init const &, Long_option_init const &); - static std::string table_string (Long_option_init *); + static string table_string (Long_option_init *); }; /** C++ for version of long_getopt. For processing GNU style command diff --git a/flower/include/international.hh b/flower/include/international.hh index 90495578cd..f2f48996de 100644 --- a/flower/include/international.hh +++ b/flower/include/international.hh @@ -35,19 +35,19 @@ /** Internationalisation: _ ("to be translated") gets "translated" by GNU gettext */ -std::string _ (char const *ch); +string _ (char const *ch); /** Internationalisation: _f ("Usage: %s [FILE]", "lilypond") gets "translated" by GNU gettext */ -std::string _f (char const *format, ...) +string _f (char const *format, ...) __attribute__ ((format (printf, 1, 2))); -std::string _f (char const *format, const std::string &s, const std::string &s2 = "", const std::string &s3 = ""); +string _f (char const *format, const string &s, const string &s2 = "", const string &s3 = ""); /** va_list version of _f */ -std::string v_f (char const *format, va_list args); +string v_f (char const *format, va_list args); #endif // INTERNATIONAL_HH diff --git a/flower/include/interval-set.hh b/flower/include/interval-set.hh index 610866be32..84f6debb30 100644 --- a/flower/include/interval-set.hh +++ b/flower/include/interval-set.hh @@ -28,15 +28,15 @@ class Interval_set public: Interval_set (); - static Interval_set interval_union (std::vector); + static Interval_set interval_union (vector); - std::vector const &intervals () const { return intervals_; } - std::vector::const_iterator upper_bound (Real x) const; + vector const &intervals () const { return intervals_; } + vector::const_iterator upper_bound (Real x) const; Real nearest_point (Real x, Direction dir = CENTER) const; Interval_set complement () const; private: - std::vector intervals_; + vector intervals_; }; #endif /* INTERVAL_SET_HH */ diff --git a/flower/include/interval.hh b/flower/include/interval.hh index c4beb9bb99..88cd01f89f 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -35,7 +35,7 @@ struct Interval_t : public Drul_array using Drul_array::at; static T infinity (); - static std::string T_to_string (T arg); + static string T_to_string (T arg); T center () const; void translate (T t) { @@ -65,8 +65,8 @@ struct Interval_t : public Drul_array void intersect (Interval_t h); void add_point (T p) { - at (LEFT) = std::min (at (LEFT), p); - at (RIGHT) = std::max (at (RIGHT), p); + at (LEFT) = min (at (LEFT), p); + at (RIGHT) = max (at (RIGHT), p); } T length () const; @@ -120,7 +120,7 @@ struct Interval_t : public Drul_array } Real linear_combination (Real x) const; - std::string to_string () const; + string to_string () const; bool contains (T r) const; void negate () diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index f0973b8b09..72be6e81e9 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -27,6 +27,7 @@ // MacOS 10.3 problems: // #include +using namespace std; template int @@ -102,8 +103,8 @@ template void Interval_t::unite (Interval_t h) { - at (LEFT) = std::min (h.at (LEFT), at (LEFT)); - at (RIGHT) = std::max (h.at (RIGHT), at (RIGHT)); + at (LEFT) = min (h.at (LEFT), at (LEFT)); + at (RIGHT) = max (h.at (RIGHT), at (RIGHT)); } /* Unites h and this interval, but in such a way @@ -135,20 +136,20 @@ template void Interval_t::intersect (Interval_t h) { - at (LEFT) = std::max (h.at (LEFT), at (LEFT)); - at (RIGHT) = std::min (h.at (RIGHT), at (RIGHT)); + at (LEFT) = max (h.at (LEFT), at (LEFT)); + at (RIGHT) = min (h.at (RIGHT), at (RIGHT)); } template -std::string +string Interval_t::to_string () const { if (is_empty ()) return "[empty]"; - std::string s ("["); + string s ("["); - return (s + T_to_string (at (LEFT)) + std::string (",") - + T_to_string (at (RIGHT)) + std::string ("]")); + return (s + T_to_string (at (LEFT)) + string (",") + + T_to_string (at (RIGHT)) + string ("]")); } template diff --git a/flower/include/libc-extension.hh b/flower/include/libc-extension.hh index 974b5521ab..04056e6c49 100644 --- a/flower/include/libc-extension.hh +++ b/flower/include/libc-extension.hh @@ -22,6 +22,7 @@ #include #include +using namespace std; #include "config.hh" diff --git a/flower/include/matrix.hh b/flower/include/matrix.hh index 6b2e61c359..a6c13f837c 100644 --- a/flower/include/matrix.hh +++ b/flower/include/matrix.hh @@ -57,7 +57,7 @@ public: data_.resize (rows * columns, t); else { - std::vector new_data; + vector new_data; new_data.resize (rows * columns, t); vsize cur_cols = rank_ ? data_.size () / rank_ : 0; @@ -70,7 +70,7 @@ public: } private: - std::vector data_; + vector data_; vsize rank_; }; diff --git a/flower/include/memory-stream.hh b/flower/include/memory-stream.hh index 3a355e9337..2cce5986b5 100644 --- a/flower/include/memory-stream.hh +++ b/flower/include/memory-stream.hh @@ -22,6 +22,7 @@ #include #include +using namespace std; #include "libc-extension.hh" #include "file-cookie.hh" diff --git a/flower/include/offset.hh b/flower/include/offset.hh index b34964c9e8..8f395398b7 100644 --- a/flower/include/offset.hh +++ b/flower/include/offset.hh @@ -101,7 +101,7 @@ public: coordinate_a_[X_AXIS] = coordinate_a_[Y_AXIS] = 0.0; } - std::string to_string () const; + string to_string () const; Offset &mirror (Axis a) { diff --git a/flower/include/parray.hh b/flower/include/parray.hh index 471b9f5858..9ef9ddb217 100644 --- a/flower/include/parray.hh +++ b/flower/include/parray.hh @@ -22,9 +22,10 @@ #include "std-vector.hh" +using namespace std; template -class Link_array : public std::vector +class Link_array : public vector { }; diff --git a/flower/include/polynomial.hh b/flower/include/polynomial.hh index 379609bcaf..f80b53c2ee 100644 --- a/flower/include/polynomial.hh +++ b/flower/include/polynomial.hh @@ -36,7 +36,7 @@ struct Polynomial ssize_t degree ()const; /// coefficients - std::vector coefs_; + vector coefs_; // leading coef Real &lc (); @@ -46,8 +46,8 @@ struct Polynomial void print () const; Real eval (Real) const; Real minmax (Real, Real, bool) const; - void print_sols (std::vector) const; - void check_sols (std::vector) const; + void print_sols (vector) const; + void check_sols (vector) const; void check_sol (Real x) const; static Polynomial multiply (const Polynomial &p1, const Polynomial &p2); static Polynomial power (int exponent, const Polynomial &src); @@ -73,11 +73,11 @@ struct Polynomial void debug_clean (); - std::vector solve_quadric ()const; - std::vector solve_cubic ()const; - std::vector solve_linear ()const; + vector solve_quadric ()const; + vector solve_cubic ()const; + vector solve_linear ()const; - std::vector solve () const; + vector solve () const; }; IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, -); diff --git a/flower/include/pqueue.hh b/flower/include/pqueue.hh index 923773f500..6f1ebc53b6 100644 --- a/flower/include/pqueue.hh +++ b/flower/include/pqueue.hh @@ -45,7 +45,7 @@ int compare (PQueue_ent const &e1, PQueue_ent const &e2) template class PQueue { - std::vector heap_array_; + vector heap_array_; T &elt (vsize i) { return heap_array_[i - 1]; diff --git a/flower/include/rational.hh b/flower/include/rational.hh index d8051c922a..f829e531ec 100644 --- a/flower/include/rational.hh +++ b/flower/include/rational.hh @@ -86,7 +86,7 @@ public: Rational &operator %= (Rational); static int compare (Rational const &, Rational const &); int sign () const; - std::string to_string () const; + string to_string () const; }; #include "arithmetic-operator.hh" diff --git a/flower/include/real.hh b/flower/include/real.hh index 0b0cf59419..d7208b4e56 100644 --- a/flower/include/real.hh +++ b/flower/include/real.hh @@ -23,6 +23,7 @@ #include #include #include +using namespace std; typedef double Real; extern const Real infinity_f; diff --git a/flower/include/std-string.hh b/flower/include/std-string.hh index 2e2908f7a2..bdb85795ab 100644 --- a/flower/include/std-string.hh +++ b/flower/include/std-string.hh @@ -33,24 +33,25 @@ #include +using namespace std; typedef size_t ssize; #define NPOS std::string::npos -std::string to_string (const std::string&); -std::string to_string (char c, int n = 1); -std::string to_string (int i, char const *format = 0); -std::string to_string (double f, char const *format = 0); -std::string to_string (long); -std::string to_string (long unsigned); -std::string to_string (I64, char const *format = 0); -std::string to_string (unsigned); -std::string to_string (bool b); -std::string to_string (char const *format, ...) +string to_string (const string&); +string to_string (char c, int n = 1); +string to_string (int i, char const *format = 0); +string to_string (double f, char const *format = 0); +string to_string (long); +string to_string (long unsigned); +string to_string (I64, char const *format = 0); +string to_string (unsigned); +string to_string (bool b); +string to_string (char const *format, ...) __attribute__ ((format (printf, 1, 2))); -std::string &replace_all (std::string *str, std::string const &find, std::string const &replace); -std::string &replace_all (std::string *str, char find, char replace); -char *string_copy (const std::string &s); +string &replace_all (string *str, string const &find, string const &replace); +string &replace_all (string *str, char find, char replace); +char *string_copy (const string &s); #endif /* STD_STRING_HH */ diff --git a/flower/include/std-vector.hh b/flower/include/std-vector.hh index 3bd7a17833..589f7c0db2 100644 --- a/flower/include/std-vector.hh +++ b/flower/include/std-vector.hh @@ -36,6 +36,7 @@ #include #include +using namespace std; template int default_compare (T const &a, T const &b) @@ -71,7 +72,7 @@ typedef size_t vsize; template T const & -boundary (std::vector const &v, int dir, vsize i) +boundary (vector const &v, int dir, vsize i) { assert (dir); return v[dir == -1 ? i : v.size () - 1 - i]; @@ -79,7 +80,7 @@ boundary (std::vector const &v, int dir, vsize i) template T & -boundary (std::vector &v, int dir, vsize i) +boundary (vector &v, int dir, vsize i) { assert (dir); return v[dir == -1 ? i : v.size () - 1 - i]; @@ -87,35 +88,35 @@ boundary (std::vector &v, int dir, vsize i) template T const & -back (std::vector const &v, vsize i) +back (vector const &v, vsize i) { return v[v.size () - i - 1]; } template T & -back (std::vector &v, vsize i) +back (vector &v, vsize i) { return v[v.size () - i - 1]; } template void -concat (std::vector &v, std::vector const &w) +concat (vector &v, vector const &w) { v.insert (v.end (), w.begin (), w.end ()); } template vsize -lower_bound (std::vector const &v, +lower_bound (vector const &v, T const &key, Compare less, vsize b = 0, vsize e = VPOS) { if (e == VPOS) e = v.size (); - typename std::vector::const_iterator i = lower_bound (v.begin () + b, + typename vector::const_iterator i = lower_bound (v.begin () + b, v.begin () + e, key, less); @@ -125,7 +126,7 @@ lower_bound (std::vector const &v, template vsize -upper_bound (std::vector const &v, +upper_bound (vector const &v, T const &key, Compare less, vsize b = 0, vsize e = VPOS) @@ -133,7 +134,7 @@ upper_bound (std::vector const &v, if (e == VPOS) e = v.size (); - typename std::vector::const_iterator i = upper_bound (v.begin () + b, + typename vector::const_iterator i = upper_bound (v.begin () + b, v.begin () + e, key, less); @@ -143,7 +144,7 @@ upper_bound (std::vector const &v, template vsize -binary_search (std::vector const &v, +binary_search (vector const &v, T const &key, Compare less, vsize b = 0, vsize e = VPOS) @@ -157,7 +158,7 @@ binary_search (std::vector const &v, template void -vector_sort (std::vector &v, +vector_sort (vector &v, Compare less, vsize b = 0, vsize e = VPOS) { @@ -169,28 +170,28 @@ vector_sort (std::vector &v, template void -reverse (std::vector &v) +reverse (vector &v) { - // CHECKME: for a simple vector, like std::vector, this should + // CHECKME: for a simple vector, like vector, this should // expand to memrev. reverse (v.begin (), v.end ()); } template void -uniq (std::vector &v) +uniq (vector &v) { v.erase (unique (v.begin (), v.end ()), v.end ()); } template -typename std::vector::const_iterator -find (std::vector const &v, T const &key) +typename vector::const_iterator +find (vector const &v, T const &key) { return find (v.begin (), v.end (), key); } -template struct del : public std::unary_function +template struct del : public unary_function { void operator () (T x) { @@ -201,15 +202,15 @@ template struct del : public std::unary_function template void -junk_pointers (std::vector &v) +junk_pointers (vector &v) { // Hmm. for_each (v.begin (), v.end (), del ()); v.clear (); } -std::vector string_split (std::string str, char c); -std::string string_join (std::vector const &strs, const std::string &infix); +vector string_split (string str, char c); +string string_join (vector const &strs, const string &infix); #define iterof(i,s) typeof((s).begin()) i((s).begin()) diff --git a/flower/include/string-convert.hh b/flower/include/string-convert.hh index f8984de0cc..8e1695bd5c 100644 --- a/flower/include/string-convert.hh +++ b/flower/include/string-convert.hh @@ -1,51 +1,52 @@ /* PROJECT: FlowerSoft C++ library - FILE : std::string-convert.hh + FILE : string-convert.hh */ #ifndef STRING_CONVERT_HH #define STRING_CONVERT_HH #include +using namespace std; #include "flower-proto.hh" #include "std-string.hh" -/** The functor string_convert handles all conversions to/from std::string +/** The functor string_convert handles all conversions to/from string (some time, anyway). The class is quite empty from data view. */ class String_convert { - static int hex2bin (std::string hex_string, std::string &bin_string_r); + static int hex2bin (string hex_string, string &bin_string_r); static int hex2nibble (Byte byte); static Byte nibble2hex_byte (Byte byte); public: - static std::string pad_to (const std::string &s, size_t length); - static std::string bool_string (bool b); - static std::string bin2hex (Byte bin_char); - static std::string bin2hex (const std::string &bin_string); - static int bin2int (const std::string &bin_string); - static unsigned bin2unsigned (const std::string &bin_string); - static std::string char_string (char c, int n); - static int dec2int (const std::string &dec_string); - static double dec2double (const std::string &dec_string); - static std::string double_string (double f, char const *fmt = 0); - static std::string form_string (char const *format, ...) __attribute__ ((format (printf, 1, 2))); - static std::string vform_string (char const *format, va_list args); - static std::string hex2bin (const std::string &str); - static std::string int_string (int i, char const *fmt = 0); - static std::string unsigned_string (unsigned); - static std::string unsigned_long_string (unsigned long); - static std::string long_string (long); - static std::string int2hex (int i, size_t length_i, char ch); - static std::string unsigned2hex (unsigned u, size_t length, char ch); - static std::string int2dec (int i, size_t length_i, char ch); - static std::string rational_string (Rational); - static std::string pointer_string (void const *); - static std::string precision_string (double x, int n); - static std::string i64_string (I64, char const *fmt = 0); - static std::string to_lower (std::string s); - static std::string to_upper (std::string s); - static std::string reverse (std::string s); + static string pad_to (const string &s, size_t length); + static string bool_string (bool b); + static string bin2hex (Byte bin_char); + static string bin2hex (const string &bin_string); + static int bin2int (const string &bin_string); + static unsigned bin2unsigned (const string &bin_string); + static string char_string (char c, int n); + static int dec2int (const string &dec_string); + static double dec2double (const string &dec_string); + static string double_string (double f, char const *fmt = 0); + static string form_string (char const *format, ...) __attribute__ ((format (printf, 1, 2))); + static string vform_string (char const *format, va_list args); + static string hex2bin (const string &str); + static string int_string (int i, char const *fmt = 0); + static string unsigned_string (unsigned); + static string unsigned_long_string (unsigned long); + static string long_string (long); + static string int2hex (int i, size_t length_i, char ch); + static string unsigned2hex (unsigned u, size_t length, char ch); + static string int2dec (int i, size_t length_i, char ch); + static string rational_string (Rational); + static string pointer_string (void const *); + static string precision_string (double x, int n); + static string i64_string (I64, char const *fmt = 0); + static string to_lower (string s); + static string to_upper (string s); + static string reverse (string s); }; #endif // __STRING_CONVERT_HH // diff --git a/flower/include/virtual-methods.hh b/flower/include/virtual-methods.hh index 5a907b2cf7..dc91d7b669 100644 --- a/flower/include/virtual-methods.hh +++ b/flower/include/virtual-methods.hh @@ -21,6 +21,7 @@ #define VIRTUAL_METHODS_HH #include +using namespace std; /* Virtual copy constructor. Make up for C++'s lack of a standard diff --git a/flower/include/warn.hh b/flower/include/warn.hh index dcc6f0ee24..f52d3818cc 100644 --- a/flower/include/warn.hh +++ b/flower/include/warn.hh @@ -44,25 +44,25 @@ extern int loglevel; extern bool warning_as_error; /* output messages, in decreasing order of importance */ -void error (std::string s, const std::string &location = ""); // Fatal error, exits lilypond! -void programming_error (const std::string &s, const std::string &location = ""); -void non_fatal_error (const std::string&, const std::string &location = ""); -void warning (const std::string &s, const std::string &location = ""); -void basic_progress (const std::string &s, const std::string &location = ""); +void error (string s, const string &location = ""); // Fatal error, exits lilypond! +void programming_error (const string &s, const string &location = ""); +void non_fatal_error (const string&, const string &location = ""); +void warning (const string &s, const string &location = ""); +void basic_progress (const string &s, const string &location = ""); /* progress_indication does by default *NOT* start on a new line */ -void progress_indication (const std::string &s, bool newline = false, const std::string &location = ""); -void message (const std::string &s, bool newline = true, const std::string &location = ""); -void debug_output (const std::string &s, bool newline = true, const std::string &location = ""); +void progress_indication (const string &s, bool newline = false, const string &location = ""); +void message (const string &s, bool newline = true, const string &location = ""); +void debug_output (const string &s, bool newline = true, const string &location = ""); /* Helper functions that always print out the message. Callers should ensure that the loglevel is obeyed */ -void print_message (int level, const std::string &location, std::string s, bool newline = true); +void print_message (int level, const string &location, string s, bool newline = true); bool is_loglevel (int level); void set_loglevel (int level); -void set_loglevel (std::string level); +void set_loglevel (string level); -void expect_warning (const std::string &msg); +void expect_warning (const string &msg); void check_expected_warnings (); #endif /* WARN_HH */ diff --git a/flower/interval-set.cc b/flower/interval-set.cc index fca942b966..acc282bbdb 100644 --- a/flower/interval-set.cc +++ b/flower/interval-set.cc @@ -58,7 +58,7 @@ Interval_set::interval_union (vector ivs) if (last[RIGHT] >= iv[LEFT]) // overlapping intervals: merge them - last[RIGHT] = std::max (last[RIGHT], iv[RIGHT]); + last[RIGHT] = max (last[RIGHT], iv[RIGHT]); else if (!iv.is_empty ()) ret.intervals_.push_back (iv); } diff --git a/flower/libc-extension.cc b/flower/libc-extension.cc index 2e4b58407f..1b8060cde2 100644 --- a/flower/libc-extension.cc +++ b/flower/libc-extension.cc @@ -24,6 +24,7 @@ #include #include +using namespace std; #include "libc-extension.hh" diff --git a/flower/memory-stream.cc b/flower/memory-stream.cc index cc4608c383..511657f5fc 100644 --- a/flower/memory-stream.cc +++ b/flower/memory-stream.cc @@ -20,6 +20,7 @@ #include #include #include +using namespace std; #include "memory-stream.hh" diff --git a/flower/polynomial.cc b/flower/polynomial.cc index ad218b29bb..a3f679cd60 100644 --- a/flower/polynomial.cc +++ b/flower/polynomial.cc @@ -23,6 +23,7 @@ #include +using namespace std; using std::vector; /* @@ -82,7 +83,7 @@ Polynomial::minmax (Real l, Real r, bool ret_max) const for (vsize i = 0; i < maxmins.size (); i++) if (maxmins[i] >= l && maxmins[i] <= r) sols.push_back (eval (maxmins[i])); - vector_sort (sols, std::less ()); + vector_sort (sols, less ()); return ret_max ? sols.back () : sols[0]; } diff --git a/flower/rational.cc b/flower/rational.cc index 4214237f35..e93f65112e 100644 --- a/flower/rational.cc +++ b/flower/rational.cc @@ -22,6 +22,7 @@ #include #include #include +using namespace std; #include "string-convert.hh" #include "libc-extension.hh" diff --git a/flower/real.cc b/flower/real.cc index e81577c05f..20d8069669 100644 --- a/flower/real.cc +++ b/flower/real.cc @@ -1,6 +1,7 @@ #include "real.hh" #include +using namespace std; #ifdef INFINITY const Real infinity_f = INFINITY; diff --git a/flower/std-string.cc b/flower/std-string.cc index 5dc5a3dce8..b03d3cca59 100644 --- a/flower/std-string.cc +++ b/flower/std-string.cc @@ -33,7 +33,7 @@ to_string (const string &s) string to_string (char c, int n) { - return string (std::max (n, 0), c); + return string (max (n, 0), c); } string diff --git a/flower/string-convert.cc b/flower/string-convert.cc index cbbde1e9d6..13788a4a84 100644 --- a/flower/string-convert.cc +++ b/flower/string-convert.cc @@ -8,6 +8,7 @@ #include #include +using namespace std; #include "libc-extension.hh" #include "rational.hh" @@ -298,7 +299,7 @@ String_convert::pointer_string (void const *l) string String_convert::precision_string (double x, int n) { - string format = "%." + ::to_string (std::max (0, n - 1)) + "e"; + string format = "%." + ::to_string (max (0, n - 1)) + "e"; string str = double_string (abs (x), format.c_str ()); int exp = dec2int (str.substr (str.length () - 3)); @@ -353,7 +354,7 @@ String_convert::unsigned_long_string (unsigned long ul) string String_convert::pad_to (const string &s, size_t n) { - return s + string (std::max (int (n - s.length ()), 0), ' '); + return s + string (max (int (n - s.length ()), 0), ' '); } string diff --git a/flower/test-file-name.cc b/flower/test-file-name.cc index 04aa6afdb5..04ee34b51f 100644 --- a/flower/test-file-name.cc +++ b/flower/test-file-name.cc @@ -2,6 +2,7 @@ #include "yaffut-parameters.hh" +using namespace std; using std::string; string slashify (string file_name); diff --git a/flower/test-file-path.cc b/flower/test-file-path.cc index fa23bddedd..e55309a3f7 100644 --- a/flower/test-file-path.cc +++ b/flower/test-file-path.cc @@ -15,7 +15,7 @@ TEST (File_path, Find) char cwd[PATH_MAX]; if (!getcwd (cwd, PATH_MAX)) { - std::cerr << "Could not get current work directory\n"; + cerr << "Could not get current work directory\n"; exit (1); } string ly_dir = string (getenv ("top-src-dir")) + "/ly"; diff --git a/flower/test-interval-set.cc b/flower/test-interval-set.cc index d78bbdfdf6..6d8d3823d3 100644 --- a/flower/test-interval-set.cc +++ b/flower/test-interval-set.cc @@ -21,6 +21,7 @@ #include "yaffut.hh" +using namespace std; using std::vector; FUNC (interval_set_union) diff --git a/flower/test-std.cc b/flower/test-std.cc index 667afc124a..711e9237b6 100644 --- a/flower/test-std.cc +++ b/flower/test-std.cc @@ -6,6 +6,7 @@ #define YAFFUT_MAIN #include "yaffut.hh" +using namespace std; using std::vector; template @@ -13,8 +14,8 @@ void print (vector v) { for (vsize i = 0; i < v.size (); i++) - std::cout << "v[" << i << "] = " << v[i] << std::endl; - std::cout << std::endl; + cout << "v[" << i << "] = " << v[i] << endl; + cout << endl; } FUNC (vector_erase) @@ -63,7 +64,7 @@ FUNC (vector_sorting) v.sort (default_compare); #else //sort (v.begin (), v.end ()); - vector_sort (v, std::less ()); + vector_sort (v, less ()); #endif EQUAL (v[0], 0); EQUAL (v[1], 1); @@ -136,7 +137,7 @@ FUNC (parray_uniq) v.push_back (0); v.push_back (1); v.push_back (0); - vector_sort (v, std::less ()); + vector_sort (v, less ()); uniq (v); EQUAL (v.size (), vsize (2)); } @@ -147,6 +148,6 @@ FUNC (vector_search) v.push_back (0); v.push_back (1); v.push_back (2); - vsize i = binary_search (v, 1, std::less ()); + vsize i = binary_search (v, 1, less ()); EQUAL (i, vsize (1)); } diff --git a/flower/test-string.cc b/flower/test-string.cc index 1ab747d9bb..f5524bba74 100644 --- a/flower/test-string.cc +++ b/flower/test-string.cc @@ -5,6 +5,7 @@ #include "yaffut.hh" +using namespace std; using std::string; using std::vector; diff --git a/flower/warn.cc b/flower/warn.cc index 39723ae8a3..422dea8027 100644 --- a/flower/warn.cc +++ b/flower/warn.cc @@ -25,6 +25,7 @@ #include "std-vector.hh" #include "international.hh" +using namespace std; using std::string; using std::vector; diff --git a/lily/align-interface.cc b/lily/align-interface.cc index d5f2140d62..fed8f39746 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -234,11 +234,11 @@ Align_interface::internal_get_minimum_translations (Grob *me, Real spec_distance = 0; if (Page_layout_problem::read_spacing_spec (spec, &spec_distance, ly_symbol2scm ("minimum-distance"))) - dy = std::max (dy, spec_distance); + dy = max (dy, spec_distance); // Consider the likely final spacing when estimating distance between staves of the full score if (INT_MAX == end && 0 == start && Page_layout_problem::read_spacing_spec (spec, &spec_distance, ly_symbol2scm ("basic-distance"))) - dy = std::max (dy, spec_distance); + dy = max (dy, spec_distance); if (include_fixed_spacing && Page_layout_problem::is_spaceable (elems[j]) && last_spaceable_element) { @@ -250,21 +250,21 @@ Align_interface::internal_get_minimum_translations (Grob *me, Page_layout_problem::read_spacing_spec (spec, &spaceable_padding, ly_symbol2scm ("padding")); - dy = std::max (dy, (last_spaceable_skyline.distance (skyline[-stacking_dir]) + dy = max (dy, (last_spaceable_skyline.distance (skyline[-stacking_dir]) + stacking_dir * (last_spaceable_element_pos - where) + spaceable_padding)); Real spaceable_min_distance = 0; if (Page_layout_problem::read_spacing_spec (spec, &spaceable_min_distance, ly_symbol2scm ("minimum-distance"))) - dy = std::max (dy, spaceable_min_distance + stacking_dir * (last_spaceable_element_pos - where)); + dy = max (dy, spaceable_min_distance + stacking_dir * (last_spaceable_element_pos - where)); - dy = std::max (dy, Page_layout_problem::get_fixed_spacing (last_spaceable_element, elems[j], spaceable_count, + dy = max (dy, Page_layout_problem::get_fixed_spacing (last_spaceable_element, elems[j], spaceable_count, pure, start, end)); } } - dy = std::max (0.0, dy); + dy = max (0.0, dy); down_skyline.raise (-stacking_dir * dy); down_skyline.merge (skyline[stacking_dir]); where += stacking_dir * dy; diff --git a/lily/audio-item.cc b/lily/audio-item.cc index 0639508b6f..5f1814f98e 100644 --- a/lily/audio-item.cc +++ b/lily/audio-item.cc @@ -169,7 +169,7 @@ Audio_span_dynamic::render () // The dynamic spanner does not end with an explicit dynamic script // event. Adjust the end volume by at most 1/4 of the available // volume range in this case. - dynamics_.back ()->volume_ = std::max (std::min (start_v + grow_dir_ * (max_volume_ - min_volume_) * 0.25, max_volume_), min_volume_); + dynamics_.back ()->volume_ = max (min (start_v + grow_dir_ * (max_volume_ - min_volume_) * 0.25, max_volume_), min_volume_); } Real delta_v = dynamics_.back ()->volume_ - dynamics_[0]->volume_; diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 6f3a4c0179..c1be5d985f 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -442,7 +442,7 @@ Auto_beam_engraver::acknowledge_stem (Grob_info info) (to_boolean (stem->get_property ("tuplet-start")))); stems_->push_back (stem); last_add_mom_ = now; - extend_mom_ = std::max (extend_mom_, now) + get_event_length (ev, now); + extend_mom_ = max (extend_mom_, now) + get_event_length (ev, now); if (recheck_needed) recheck_beam (); } diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index a053fd2fdb..7c11cb7e97 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -273,7 +273,7 @@ Axis_group_interface::adjacent_pure_heights (SCM smob) d = (d == CENTER) ? UP : d; Interval_t rank_span = g->spanned_rank_interval (); - vsize first_break = lower_bound (ranks, (vsize)rank_span[LEFT], std::less ()); + vsize first_break = lower_bound (ranks, (vsize)rank_span[LEFT], less ()); if (first_break > 0 && ranks[first_break] >= (vsize)rank_span[LEFT]) first_break--; @@ -327,7 +327,7 @@ Interval Axis_group_interface::relative_pure_height (Grob *me, int start, int end) { /* It saves a _lot_ of time if we assume a VerticalAxisGroup is additive - (ie. height (i, k) = std::max (height (i, j) height (j, k)) for all i <= j <= k). + (ie. height (i, k) = max (height (i, j) height (j, k)) for all i <= j <= k). Unfortunately, it isn't always true, particularly if there is a VerticalAlignment somewhere in the descendants. @@ -689,8 +689,8 @@ avoid_outside_staff_collisions (Grob *elt, for (vsize j = 0; j < other_v_skylines.size (); j++) { Skyline_pair const &v_other = other_v_skylines[j]; - Real pad = std::max (padding, other_padding[j]); - Real horizon_pad = std::max (horizon_padding, other_horizon_padding[j]); + Real pad = max (padding, other_padding[j]); + Real horizon_pad = max (horizon_padding, other_horizon_padding[j]); // We need to push elt up by at least this much to be above v_other. Real up = (*v_skyline)[DOWN].distance (v_other[UP], horizon_pad) + pad; @@ -841,7 +841,7 @@ add_grobs_of_one_priority (Grob *me, (*all_paddings)[dir].push_back (padding); (*all_horizon_paddings)[dir].push_back (horizon_padding); } - std::swap (elements, skipped_elements); + swap (elements, skipped_elements); skipped_elements.clear (); } } diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 753a056449..e6ca4caf16 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -305,7 +305,7 @@ Beam_engraver::acknowledge_stem (Grob_info info) stem->set_property ("duration-log", scm_from_int (durlog)); Moment stem_location = now - beam_start_mom_ + beam_start_location_; beam_info_->add_stem (stem_location, - std::max (durlog - 2, 0), + max (durlog - 2, 0), Stem::is_invisible (stem), stem_duration->factor (), (to_boolean (stem->get_property ("tuplet-start")))); diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index 8cf8a345a3..740f286908 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -23,6 +23,7 @@ #include #include #include +using namespace std; #include "align-interface.hh" #include "beam.hh" @@ -448,8 +449,8 @@ set_minimum_dy (Grob *me, Real *dy) Real inter = 0.5; Real hang = 1.0 - (beam_thickness - slt) / 2; - *dy = sign (*dy) * std::max (fabs (*dy), - std::min (std::min (sit, inter), hang)); + *dy = sign (*dy) * max (fabs (*dy), + min (min (sit, inter), hang)); } } @@ -613,7 +614,7 @@ is_concave_single_notes (vector const &positions, Direction beam_dir) note is reached in the opposite direction as the last-first dy */ int dy = positions.back () - positions[0]; - int closest = std::max (beam_dir * positions.back (), beam_dir * positions[0]); + int closest = max (beam_dir * positions.back (), beam_dir * positions[0]); for (vsize i = 2; !concave && i + 1 < positions.size (); i++) { int inner_dy = positions[i] - positions[i - 1]; @@ -644,7 +645,7 @@ calc_positions_concaveness (vector const &positions, Direction beam_dir) { Real line_y = slope * i + positions[0]; - concaveness += std::max (beam_dir * (positions[i] - line_y), 0.0); + concaveness += max (beam_dir * (positions[i] - line_y), 0.0); } concaveness /= positions.size (); @@ -1080,7 +1081,7 @@ Beam_scoring_problem::score_stem_lengths (Beam_configuration *config) const Stem_info info = stem_infos_[i]; Direction d = info.dir_; - score[d] += limit_penalty * std::max (0.0, (d * (info.shortest_y_ - current_y))); + score[d] += limit_penalty * max (0.0, (d * (info.shortest_y_ - current_y))); Real ideal_diff = d * (current_y - info.ideal_y_); Real ideal_score = shrink_extra_weight (ideal_diff, 1.5); @@ -1097,7 +1098,7 @@ Beam_scoring_problem::score_stem_lengths (Beam_configuration *config) const /* Divide by number of stems, to make the measure scale-free. */ for (DOWN_and_UP (d)) - score[d] /= std::max (count[d], 1); + score[d] /= max (count[d], 1); /* sometimes, two perfectly symmetric kneed beams will have the same score @@ -1147,7 +1148,7 @@ Beam_scoring_problem::score_slope_musical (Beam_configuration *config) const { Real dy = config->y.delta (); Real dem = parameters_.MUSICAL_DIRECTION_FACTOR - * std::max (0.0, (fabs (dy) - fabs (musical_dy_))); + * max (0.0, (fabs (dy) - fabs (musical_dy_))); config->add (dem, "Sm"); } @@ -1206,7 +1207,7 @@ Beam_scoring_problem::score_forbidden_quants (Beam_configuration *config) const Real extra_demerit = parameters_.SECONDARY_BEAM_DEMERIT - / std::max (edge_beam_counts_[LEFT], edge_beam_counts_[RIGHT]); + / max (edge_beam_counts_[LEFT], edge_beam_counts_[RIGHT]); Real dem = 0.0; Real eps = parameters_.BEAM_EPS; @@ -1236,7 +1237,7 @@ Beam_scoring_problem::score_forbidden_quants (Beam_configuration *config) const k <= staff_radius_ + eps; k += 1.0) if (gap.contains (k)) { - Real dist = std::min (fabs (gap[UP] - k), fabs (gap[DOWN] - k)); + Real dist = min (fabs (gap[UP] - k), fabs (gap[DOWN] - k)); /* this parameter is tuned to grace-stem-length.ly @@ -1259,7 +1260,7 @@ Beam_scoring_problem::score_forbidden_quants (Beam_configuration *config) const config->add (dem, "Fl"); dem = 0.0; - if (std::max (edge_beam_counts_[LEFT], edge_beam_counts_[RIGHT]) >= 2) + if (max (edge_beam_counts_[LEFT], edge_beam_counts_[RIGHT]) >= 2) { Real straddle = 0.0; Real sit = (beam_thickness_ - line_thickness_) / 2; @@ -1315,12 +1316,12 @@ Beam_scoring_problem::score_collisions (Beam_configuration *config) const if (!intersection (beam_y, collision_y).is_empty ()) dist = 0.0; else - dist = std::min (beam_y.distance (collision_y[DOWN]), + dist = min (beam_y.distance (collision_y[DOWN]), beam_y.distance (collision_y[UP])); Real scale_free - = std::max (parameters_.COLLISION_PADDING - dist, 0.0) + = max (parameters_.COLLISION_PADDING - dist, 0.0) / parameters_.COLLISION_PADDING; Real collision_demerit = collisions_[i].base_penalty_ * pow (scale_free, 3) * parameters_.COLLISION_PENALTY; diff --git a/lily/beam.cc b/lily/beam.cc index d1032184a9..6bdaab9d9f 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -142,7 +142,7 @@ Beam::get_beam_count (Grob *me) for (vsize i = 0; i < stems.size (); i++) { Grob *stem = stems[i]; - m = std::max (m, (Stem::beam_multiplicity (stem).length () + 1)); + m = max (m, (Stem::beam_multiplicity (stem).length () + 1)); } return m; } @@ -441,7 +441,7 @@ Beam::calc_beam_segments (SCM smob) i != stem_segments.end (); i++) { vector segs = (*i).second; - vector_sort (segs, std::less ()); + vector_sort (segs, less ()); Beam_segment current; @@ -515,7 +515,7 @@ Beam::calc_beam_segments (SCM smob) Grob *neighbor_stem = stems[seg.stem_index_ + event_dir]; Real neighbor_stem_x = neighbor_stem->relative_coordinate (commonx, X_AXIS); - length = std::min (length, + length = min (length, fabs (neighbor_stem_x - seg.stem_x_) * max_proportion[seg.dir_]); } current.horizontal_[event_dir] += event_dir * length; @@ -540,7 +540,7 @@ Beam::calc_beam_segments (SCM smob) for (vsize k = 0; k < heads.size (); k++) current.horizontal_[event_dir] - = event_dir * std::min (event_dir * current.horizontal_[event_dir], + = event_dir * min (event_dir * current.horizontal_[event_dir], - gap_length / 2 + event_dir * heads[k]->extent (commonx, @@ -773,7 +773,7 @@ Beam::get_default_dir (Grob *me) for (DOWN_and_UP (d)) { if (sign (positions[d]) == d) - extremes[d] = d * std::max (d * positions[d], d * extremes[d]); + extremes[d] = d * max (d * positions[d], d * extremes[d]); } } @@ -800,7 +800,7 @@ Beam::get_default_dir (Grob *me) if (stem_dir) { count[stem_dir]++; - total[stem_dir] += std::max (int (- stem_dir * Stem::head_positions (s) [-stem_dir]), 0); + total[stem_dir] += max (int (- stem_dir * Stem::head_positions (s) [-stem_dir]), 0); } } @@ -1153,7 +1153,7 @@ Beam::set_beaming (Grob *me, Beaming_pattern const *beaming) if (i > 0 && i + 1 < stems.size () && Stem::is_invisible (stem)) - count = std::min (count, beaming->beamlet_count (i, -d)); + count = min (count, beaming->beamlet_count (i, -d)); if ( ((i == 0 && d == LEFT) || (i == stems.size () - 1 && d == RIGHT)) @@ -1288,7 +1288,7 @@ Beam::rest_collision_callback (SCM smob, SCM prev_offset) = staff_space * (robust_scm2double (stem->get_property ("stemlet-length"), 0.0) + robust_scm2double (rest->get_property ("minimum-distance"), 0.0)); - Real shift = d * std::min (d * (beam_y - d * minimum_distance - rest_dim), 0.0); + Real shift = d * min (d * (beam_y - d * minimum_distance - rest_dim), 0.0); shift /= staff_space; @@ -1367,7 +1367,7 @@ Beam::pure_rest_collision_callback (SCM smob, + Stem::head_positions (right)[beamdir]) / 2.0 + 4.0 * beamdir; // four staff-positions /* and that the closest beam never crosses staff center by more than two positions */ - beam_pos = std::max (-2.0, beam_pos * beamdir) * beamdir; + beam_pos = max (-2.0, beam_pos * beamdir) * beamdir; Real minimum_distance = ss * (robust_scm2double (stem->get_property ("stemlet-length"), 0.0) @@ -1377,7 +1377,7 @@ Beam::pure_rest_collision_callback (SCM smob, - me->extent (me, Y_AXIS)[beamdir]; /* Always move by a whole number of staff spaces, always away from the beam */ - offset = floor (std::min (0.0, (offset - previous) / ss * beamdir)) + offset = floor (min (0.0, (offset - previous) / ss * beamdir)) * ss * beamdir + previous; return scm_from_double (offset); @@ -1439,7 +1439,7 @@ Beam::get_direction_beam_count (Grob *me, Direction d) Should we take invisible stems into account? */ if (get_grob_direction (stems[i]) == d) - bc = std::max (bc, (Stem::beam_multiplicity (stems[i]).length () + 1)); + bc = max (bc, (Stem::beam_multiplicity (stems[i]).length () + 1)); } return bc; diff --git a/lily/beaming-pattern.cc b/lily/beaming-pattern.cc index 53a8c354ea..5510965c31 100644 --- a/lily/beaming-pattern.cc +++ b/lily/beaming-pattern.cc @@ -173,7 +173,7 @@ Beaming_pattern::beamify (Beaming_options const &options) int importance = infos_[i + 1].rhythmic_importance_; int count = (importance < 0 && options.subdivide_beams_) ? subdivide_beam_count - : std::min (std::min (infos_[i].count (non_flag_dir), + : min (min (infos_[i].count (non_flag_dir), infos_[i + non_flag_dir].count (-non_flag_dir)), infos_[i - non_flag_dir].count (non_flag_dir)); @@ -317,7 +317,7 @@ Beaming_pattern::unbeam_invisible_stems () for (vsize i = 1; i < infos_.size (); i++) if (infos_[i].invisible_) { - int b = std::min (infos_[i].count (LEFT), infos_[i - 1].count (LEFT)); + int b = min (infos_[i].count (LEFT), infos_[i - 1].count (LEFT)); infos_[i].beam_count_drul_[LEFT] = b; infos_[i].beam_count_drul_[RIGHT] = b; } @@ -326,7 +326,7 @@ Beaming_pattern::unbeam_invisible_stems () for (vsize i = infos_.size () - 1; i--;) if (infos_[i].invisible_) { - int b = std::min (infos_[i].count (LEFT), infos_[i + 1].count (LEFT)); + int b = min (infos_[i].count (LEFT), infos_[i + 1].count (LEFT)); infos_[i].beam_count_drul_[LEFT] = b; infos_[i].beam_count_drul_[RIGHT] = b; } @@ -357,7 +357,7 @@ Beaming_pattern::start_moment (int i) const Moment Beaming_pattern::end_moment (int i) const { - Duration dur (2 + std::max (beamlet_count (i, LEFT), + Duration dur (2 + max (beamlet_count (i, LEFT), beamlet_count (i, RIGHT)), 0); @@ -396,7 +396,7 @@ Beaming_pattern::split_pattern (int i) new_pattern = new Beaming_pattern (); for (vsize j = i + 1; j < infos_.size (); j++) { - count = std::max (beamlet_count (j, LEFT), beamlet_count (j, RIGHT)); + count = max (beamlet_count (j, LEFT), beamlet_count (j, RIGHT)); new_pattern->add_stem (start_moment (j), count, invisibility (j), diff --git a/lily/book.cc b/lily/book.cc index b591641554..c7f5dd0237 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -20,6 +20,7 @@ #include "book.hh" #include +using namespace std; #include "main.hh" #include "music.hh" diff --git a/lily/break-alignment-interface.cc b/lily/break-alignment-interface.cc index 305f764ad3..4b1e06d98c 100644 --- a/lily/break-alignment-interface.cc +++ b/lily/break-alignment-interface.cc @@ -218,7 +218,7 @@ Break_alignment_interface::calc_positioning_done (SCM smob) - extents[next_idx][LEFT]; /* should probably junk minimum-space */ else if (scm_is_eq (type, ly_symbol2scm ("minimum-space"))) - offsets[next_idx] = std::max (extents[idx][RIGHT], distance); + offsets[next_idx] = max (extents[idx][RIGHT], distance); } else { diff --git a/lily/break-substitution.cc b/lily/break-substitution.cc index 25fd607dd6..33d5d4c9c5 100644 --- a/lily/break-substitution.cc +++ b/lily/break-substitution.cc @@ -19,6 +19,7 @@ #include #include +using namespace std; #include "item.hh" #include "system.hh" diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index 95fdaeef9d..9de2bbffc8 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -120,9 +120,9 @@ Chord_tremolo_engraver::acknowledge_stem (Grob_info info) if (beam_) { int tremolo_type = robust_scm2int (repeat_->get_property ("tremolo-type"), 1); - int flags = std::max (0, intlog2 (tremolo_type) - 2); + int flags = max (0, intlog2 (tremolo_type) - 2); int repeat_count = robust_scm2int (repeat_->get_property ("repeat-count"), 1); - int gap_count = std::min (flags, intlog2 (repeat_count) + 1); + int gap_count = min (flags, intlog2 (repeat_count) + 1); Grob *s = info.grob (); if (previous_stem_) diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index dc239ca1e2..940a18d201 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -19,6 +19,7 @@ */ #include +using namespace std; #include "item.hh" #include "context.hh" diff --git a/lily/cluster-engraver.cc b/lily/cluster-engraver.cc index 2e06e1de4b..c934fd0ba3 100644 --- a/lily/cluster-engraver.cc +++ b/lily/cluster-engraver.cc @@ -107,8 +107,8 @@ Cluster_spanner_engraver::process_music () int p = (pit ? pit->steps () : 0) + c0; - pmax = std::max (pmax, p); - pmin = std::min (pmin, p); + pmax = max (pmax, p); + pmin = min (pmin, p); } beacon_ = make_item ("ClusterSpannerBeacon", cluster_notes_[0]->self_scm ()); diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index 27d950b690..f5abe73e43 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -18,6 +18,7 @@ */ #include +using namespace std; #include "dot-column.hh" #include "dots.hh" @@ -100,7 +101,7 @@ Completion_heads_engraver::listen_note (Stream_event *ev) Moment now = now_mom (); Moment musiclen = get_event_length (ev, now); - note_end_mom_ = std::max (note_end_mom_, (now + musiclen)); + note_end_mom_ = max (note_end_mom_, (now + musiclen)); do_nothing_until_ = Rational (0, 0); } diff --git a/lily/completion-rest-engraver.cc b/lily/completion-rest-engraver.cc index a60b400efc..b7e76c82bc 100644 --- a/lily/completion-rest-engraver.cc +++ b/lily/completion-rest-engraver.cc @@ -19,6 +19,7 @@ */ #include +using namespace std; #include "dot-column.hh" #include "dots.hh" @@ -96,7 +97,7 @@ Completion_rest_engraver::listen_rest (Stream_event *ev) Moment now = now_mom (); Moment musiclen = get_event_length (ev, now); - rest_end_mom_ = std::max (rest_end_mom_, (now + musiclen)); + rest_end_mom_ = max (rest_end_mom_, (now + musiclen)); do_nothing_until_ = Rational (0, 0); } diff --git a/lily/constrained-breaking.cc b/lily/constrained-breaking.cc index d9054087e1..463e84bf11 100644 --- a/lily/constrained-breaking.cc +++ b/lily/constrained-breaking.cc @@ -621,7 +621,7 @@ Line_details::spring_length (Line_details const &next_line) const // the top of next_line's extent. Real refpoint_dist = tallness_ + refpoint_extent_[DOWN] - next_line.refpoint_extent_[UP]; Real space = next_line.title_ ? title_space_ : space_; - return std::max (0.0, space - refpoint_dist); + return max (0.0, space - refpoint_dist); } Line_shape::Line_shape (Interval begin, Interval rest) @@ -633,7 +633,7 @@ Line_shape::Line_shape (Interval begin, Interval rest) Line_shape Line_shape::piggyback (Line_shape mount, Real padding) const { - Real elevation = std::max (begin_[UP] - mount.begin_[DOWN], rest_[UP] - mount.rest_[DOWN]); + Real elevation = max (begin_[UP] - mount.begin_[DOWN], rest_[UP] - mount.rest_[DOWN]); Interval begin = Interval (begin_[DOWN], elevation + mount.begin_[UP] + padding); Interval rest = Interval (rest_[DOWN], elevation + mount.rest_[UP] + padding); return Line_shape (begin, rest); diff --git a/lily/cue-clef-engraver.cc b/lily/cue-clef-engraver.cc index 9e0372de18..383c9a1b1f 100644 --- a/lily/cue-clef-engraver.cc +++ b/lily/cue-clef-engraver.cc @@ -20,6 +20,7 @@ */ #include +using namespace std; #include "item.hh" #include "context.hh" diff --git a/lily/custos.cc b/lily/custos.cc index b2289f267d..3ba5db834e 100644 --- a/lily/custos.cc +++ b/lily/custos.cc @@ -26,6 +26,7 @@ #include #include // rint +using namespace std; #include "custos.hh" #include "direction.hh" diff --git a/lily/dot-column.cc b/lily/dot-column.cc index 56ef578847..84ace8228f 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -22,6 +22,7 @@ #include #include +using namespace std; #include "axis-group-interface.hh" #include "directional-element-interface.hh" diff --git a/lily/dot-configuration.cc b/lily/dot-configuration.cc index 20c44297a0..25d35eb691 100644 --- a/lily/dot-configuration.cc +++ b/lily/dot-configuration.cc @@ -158,7 +158,7 @@ Dot_configuration::x_offset () const Real off = 0.0; for (Dot_configuration::const_iterator i (begin ()); i != end (); i++) - off = std::max (off, problem_->head_skyline_.height ((*i).first)); + off = max (off, problem_->head_skyline_.height ((*i).first)); return off; } diff --git a/lily/drum-note-engraver.cc b/lily/drum-note-engraver.cc index 37cf47a217..40e3aaf936 100644 --- a/lily/drum-note-engraver.cc +++ b/lily/drum-note-engraver.cc @@ -18,6 +18,7 @@ */ #include +using namespace std; #include "item.hh" #include "duration.hh" diff --git a/lily/figured-bass-engraver.cc b/lily/figured-bass-engraver.cc index a0998ef4c9..5463be534d 100644 --- a/lily/figured-bass-engraver.cc +++ b/lily/figured-bass-engraver.cc @@ -195,7 +195,7 @@ Figured_bass_engraver::listen_bass_figure (Stream_event *ev) { new_event_found_ = true; Moment stop = now_mom () + get_event_length (ev, now_mom ()); - stop_moment_ = std::max (stop_moment_, stop); + stop_moment_ = max (stop_moment_, stop); // Handle no-continuation here, don't even add it to the already existing // spanner... This fixes some layout issues (figure will be placed separately) diff --git a/lily/file-name-map.cc b/lily/file-name-map.cc index 39a2349395..d9b9711ba1 100644 --- a/lily/file-name-map.cc +++ b/lily/file-name-map.cc @@ -18,6 +18,7 @@ */ #include +using namespace std; #include "file-name-map.hh" #include "lily-guile.hh" diff --git a/lily/font-metric.cc b/lily/font-metric.cc index 200c1eb877..73104615a0 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -21,6 +21,7 @@ #include #include +using namespace std; #include "dimensions.hh" #include "modified-font-metric.hh" diff --git a/lily/fretboard-engraver.cc b/lily/fretboard-engraver.cc index 7f99713d9e..5ce6763cb7 100644 --- a/lily/fretboard-engraver.cc +++ b/lily/fretboard-engraver.cc @@ -19,6 +19,7 @@ #include #include +using namespace std; #include "articulations.hh" #include "context.hh" diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc index cda424e9d1..e04188c7b5 100644 --- a/lily/function-documentation.cc +++ b/lily/function-documentation.cc @@ -19,6 +19,7 @@ #include #include +using namespace std; #include "std-string.hh" #include "lily-guile.hh" diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index d661c177a5..de5a2cc225 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -24,6 +24,7 @@ #include #include /* memset */ #include +using namespace std; #include "dimensions.hh" #include "file-name.hh" diff --git a/lily/global-context.cc b/lily/global-context.cc index cffc4512c8..72ccc5be89 100644 --- a/lily/global-context.cc +++ b/lily/global-context.cc @@ -20,6 +20,7 @@ #include "global-context.hh" #include +using namespace std; #include "context-def.hh" #include "dispatcher.hh" diff --git a/lily/grob-interface.cc b/lily/grob-interface.cc index ec7108c15c..1dfd0f2c9e 100644 --- a/lily/grob-interface.cc +++ b/lily/grob-interface.cc @@ -34,7 +34,7 @@ SCM add_interface (char const *cxx_name, { string suffix ("-interface"); string lispy_name = camel_case_to_lisp_identifier (cxx_name); - vsize end = std::max (int (0), int (lispy_name.length () - suffix.length ())); + vsize end = max (int (0), int (lispy_name.length () - suffix.length ())); if (lispy_name.substr (end) != suffix) lispy_name += suffix; diff --git a/lily/grob-pq-engraver.cc b/lily/grob-pq-engraver.cc index a869f031ee..d3cd356a04 100644 --- a/lily/grob-pq-engraver.cc +++ b/lily/grob-pq-engraver.cc @@ -101,7 +101,7 @@ Grob_pq_engraver::acknowledge_grob (Grob_info gi) void Grob_pq_engraver::process_acknowledged () { - vector_sort (started_now_, std::less ()); + vector_sort (started_now_, less ()); SCM lst = SCM_EOL; SCM *tail = &lst; for (vsize i = 0; i < started_now_.size (); i++) diff --git a/lily/hairpin.cc b/lily/hairpin.cc index b14872573e..01d8fd93de 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -177,7 +177,7 @@ Hairpin::print (SCM smob) { Spanner *span_elt = dynamic_cast (chp[i]); if (span_elt->get_bound (RIGHT)->break_status_dir () == LEFT) - broken_bound_padding = std::max (broken_bound_padding, + broken_bound_padding = max (broken_bound_padding, robust_scm2double (span_elt->get_property ("broken-bound-padding"), 0.0)); } x_points[d] -= d * broken_bound_padding; diff --git a/lily/hara-kiri-group-spanner.cc b/lily/hara-kiri-group-spanner.cc index ecfb6a9ac5..a4389a5818 100644 --- a/lily/hara-kiri-group-spanner.cc +++ b/lily/hara-kiri-group-spanner.cc @@ -123,7 +123,7 @@ Hara_kiri_group_spanner::request_suicide_alone (Grob *me, int start, int end) for (int j = iv[LEFT]; j <= iv[RIGHT]; j++) ranks.push_back (j); } - vector_sort (ranks, std::less ()); + vector_sort (ranks, less ()); uniq (ranks); SCM scm_vec = scm_c_make_vector (ranks.size (), SCM_EOL); diff --git a/lily/includable-lexer.cc b/lily/includable-lexer.cc index 3e9c54857d..564b6024cd 100644 --- a/lily/includable-lexer.cc +++ b/lily/includable-lexer.cc @@ -20,6 +20,7 @@ #include "includable-lexer.hh" #include +using namespace std; #include "config.hh" diff --git a/lily/include/accidental-placement.hh b/lily/include/accidental-placement.hh index a8f3ddeafa..4c362cbd93 100644 --- a/lily/include/accidental-placement.hh +++ b/lily/include/accidental-placement.hh @@ -29,10 +29,10 @@ public: DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element)); static void add_accidental (Grob *, Grob *, bool, long); - static std::vector get_relevant_accidentals (std::vector const &elts, Grob *left); + static vector get_relevant_accidentals (vector const &elts, Grob *left); static void split_accidentals (Grob *accs, - std::vector *break_reminder, - std::vector *real_acc); + vector *break_reminder, + vector *real_acc); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM)); }; diff --git a/lily/include/align-interface.hh b/lily/include/align-interface.hh index 4d798ae1eb..612c31c0d5 100644 --- a/lily/include/align-interface.hh +++ b/lily/include/align-interface.hh @@ -31,9 +31,9 @@ public: DECLARE_SCHEME_CALLBACK (align_to_ideal_distances, (SCM)); static void align_elements_to_minimum_distances (Grob *, Axis a); static void align_elements_to_ideal_distances (Grob *); - static std::vector get_minimum_translations (Grob *, std::vector const &, Axis a); - static std::vector get_minimum_translations_without_min_dist (Grob *, std::vector const &, Axis a); - static std::vector get_pure_minimum_translations (Grob *, std::vector const &, + static vector get_minimum_translations (Grob *, vector const &, Axis a); + static vector get_minimum_translations_without_min_dist (Grob *, vector const &, Axis a); + static vector get_pure_minimum_translations (Grob *, vector const &, Axis a, int start, int end); static void set_ordered (Grob *); static Axis axis (Grob *); @@ -44,7 +44,7 @@ public: static Real get_pure_child_y_translation (Grob *, Grob *child, int start, int end); protected: - static std::vector internal_get_minimum_translations (Grob *, std::vector const &, + static vector internal_get_minimum_translations (Grob *, vector const &, Axis a, bool include_fixed_spacing, bool pure, int start, int end); diff --git a/lily/include/all-font-metrics.hh b/lily/include/all-font-metrics.hh index 53488cc9f7..a2d090a6df 100644 --- a/lily/include/all-font-metrics.hh +++ b/lily/include/all-font-metrics.hh @@ -44,24 +44,24 @@ class All_font_metrics : public Smob int pango_dpi_; #endif - std::map filename_charcode_maps_map_; + map filename_charcode_maps_map_; All_font_metrics (All_font_metrics const &); public: SCM mark_smob () const; - Index_to_charcode_map const *get_index_to_charcode_map (const std::string &filename, + Index_to_charcode_map const *get_index_to_charcode_map (const string &filename, int face_index, FT_Face face); - All_font_metrics (const std::string &search_path); + All_font_metrics (const string &search_path); ~All_font_metrics (); Pango_font *find_pango_font (PangoFontDescription const *description, Real scale); - Font_metric *find_font (const std::string &name); - Open_type_font *find_otf (const std::string &name); + Font_metric *find_font (const string &name); + Open_type_font *find_otf (const string &name); SCM font_descriptions () const; }; diff --git a/lily/include/articulations.hh b/lily/include/articulations.hh index 26446d4056..543bbf51e0 100644 --- a/lily/include/articulations.hh +++ b/lily/include/articulations.hh @@ -23,8 +23,8 @@ #include "lily-guile.hh" #include "stream-event.hh" -SCM articulation_list (std::vector notes, - std::vector articulations, +SCM articulation_list (vector notes, + vector articulations, char const *articulation_name); #endif /* ARTICULATIONS_HH */ diff --git a/lily/include/audio-column.hh b/lily/include/audio-column.hh index 0212a45268..059321f7c9 100644 --- a/lily/include/audio-column.hh +++ b/lily/include/audio-column.hh @@ -37,7 +37,7 @@ public: void add_audio_item (Audio_item *i); Moment when () const; - std::vector audio_items_; + vector audio_items_; Moment when_; int ticks () const; protected: diff --git a/lily/include/audio-element-info.hh b/lily/include/audio-element-info.hh index 4cb52bb51b..9b2f18f525 100644 --- a/lily/include/audio-element-info.hh +++ b/lily/include/audio-element-info.hh @@ -33,7 +33,7 @@ public: Stream_event *event_; Translator *origin_trans_; - std::vector origin_contexts (Translator *) const; + vector origin_contexts (Translator *) const; Audio_element_info (Audio_element *, Stream_event *); Audio_element_info (); diff --git a/lily/include/audio-item.hh b/lily/include/audio-item.hh index dbd4c38251..8c41d18a52 100644 --- a/lily/include/audio-item.hh +++ b/lily/include/audio-item.hh @@ -53,7 +53,7 @@ class Audio_span_dynamic : public Audio_element { public: Direction grow_dir_; - std::vector dynamics_; + vector dynamics_; Real min_volume_; Real max_volume_; @@ -74,9 +74,9 @@ public: class Audio_instrument : public Audio_item { public: - Audio_instrument (std::string instrument_string); + Audio_instrument (string instrument_string); - std::string str_; + string str_; }; class Audio_note : public Audio_item @@ -87,7 +87,7 @@ public: // with tieWaitForNote, there might be a skip between the tied notes! void tie_to (Audio_note *, Moment skip = 0); Audio_note *tie_head (); - virtual std::string to_string () const; + virtual string to_string () const; Pitch pitch_; Moment length_mom_; @@ -102,7 +102,7 @@ public: class Audio_piano_pedal : public Audio_item { public: - std::string type_string_; + string type_string_; Direction dir_; }; @@ -115,10 +115,10 @@ public: MARKER, CUE_POINT }; - Audio_text (Audio_text::Type type, const std::string &text_string); + Audio_text (Audio_text::Type type, const string &text_string); Type type_; - std::string text_string_; + string text_string_; }; class Audio_tempo : public Audio_item diff --git a/lily/include/audio-staff.hh b/lily/include/audio-staff.hh index ca5c36fa94..a4a9d8a0d1 100644 --- a/lily/include/audio-staff.hh +++ b/lily/include/audio-staff.hh @@ -33,7 +33,7 @@ struct Audio_staff : public Audio_element bool percussion_; bool merge_unisons_; - std::vector audio_items_; + vector audio_items_; }; // Subtype to identify a staff that represents the "control track" of a MIDI diff --git a/lily/include/axis-group-interface.hh b/lily/include/axis-group-interface.hh index fc7e3c19d0..5e5152d237 100644 --- a/lily/include/axis-group-interface.hh +++ b/lily/include/axis-group-interface.hh @@ -47,10 +47,10 @@ class Axis_group_interface DECLARE_SCHEME_CALLBACK (calc_pure_staff_staff_spacing, (SCM, SCM, SCM)); DECLARE_SCHEME_CALLBACK (calc_pure_relevant_grobs, (SCM)); DECLARE_SCHEME_CALLBACK (calc_pure_y_common, (SCM)); - static SCM internal_calc_pure_relevant_grobs (Grob *, const std::string&); - static Interval relative_group_extent (std::vector const &list, + static SCM internal_calc_pure_relevant_grobs (Grob *, const string&); + static Interval relative_group_extent (vector const &list, Grob *common, Axis); - static Interval relative_maybe_bound_group_extent (std::vector const &list, + static Interval relative_maybe_bound_group_extent (vector const &list, Grob *common, Axis, bool); static Interval relative_pure_height (Grob *me, int start, int end); static Interval combine_pure_heights (Grob *me, SCM, int, int); @@ -64,7 +64,7 @@ class Axis_group_interface static void add_element (Grob *me, Grob *); static void set_axes (Grob *, Axis, Axis); static bool has_axis (Grob *, Axis); - static void get_children (Grob *, std::vector *); + static void get_children (Grob *, vector *); static Interval staff_extent (Grob *me, Grob *ref, Axis, Grob *staff, Axis); static SCM calc_common (Grob *, Axis); static Real minimum_distance (Grob *, Grob *, Axis); diff --git a/lily/include/beam-scoring-problem.hh b/lily/include/beam-scoring-problem.hh index 022c42a85a..bbabfde7de 100644 --- a/lily/include/beam-scoring-problem.hh +++ b/lily/include/beam-scoring-problem.hh @@ -48,14 +48,14 @@ struct Beam_configuration Interval y; Real demerits; #if DEBUG_BEAM_SCORING - std::string score_card_; + string score_card_; #endif int next_scorer_todo; Beam_configuration (); bool done () const; - void add (Real demerit, const std::string &reason); + void add (Real demerit, const string &reason); static Beam_configuration *new_config (Interval start, Interval offset); }; @@ -140,14 +140,14 @@ private: affine linear in YL and YR. If YL == YR == 0, then we might have stem_y != 0.0, when we're cross staff. */ - std::vector stem_infos_; - std::vector chord_start_y_; - std::vector head_positions_; - std::vector beam_multiplicity_; - std::vector is_normal_; - std::vector base_lengths_; - std::vector stem_xpositions_; - std::vector stem_ypositions_; + vector stem_infos_; + vector chord_start_y_; + vector head_positions_; + vector beam_multiplicity_; + vector is_normal_; + vector base_lengths_; + vector stem_xpositions_; + vector stem_ypositions_; bool is_xstaff_; bool is_knee_; @@ -164,8 +164,8 @@ private: // Beam_configurations. Drul_array quant_range_; Real beam_translation_; - std::vector collisions_; - std::vector segments_; + vector collisions_; + vector segments_; vsize first_normal_index (); vsize last_normal_index (); @@ -180,7 +180,7 @@ private: void one_scorer (Beam_configuration *config) const; Beam_configuration *force_score (SCM inspect_quants, - const std::vector &configs) const; + const vector &configs) const; Real y_at (Real x, Beam_configuration const *c) const; // Scoring functions: @@ -190,7 +190,7 @@ private: void score_slope_direction (Beam_configuration *config) const; void score_slope_musical (Beam_configuration *config) const; void score_stem_lengths (Beam_configuration *config) const; - void generate_quants (std::vector *scores) const; + void generate_quants (vector *scores) const; void score_collisions (Beam_configuration *config) const; }; diff --git a/lily/include/beam.hh b/lily/include/beam.hh index c6913eee2f..6dbdf4b23f 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -66,7 +66,7 @@ public: static Real get_beam_translation (Grob *me); static Real get_beam_thickness (Grob *me); static void connect_beams (Grob *me); - static std::vector get_beam_segments (Grob *me_grob, Grob **common); + static vector get_beam_segments (Grob *me_grob, Grob **common); DECLARE_SCHEME_CALLBACK (rest_collision_callback, (SCM element, SCM prev_off)); DECLARE_SCHEME_CALLBACK (pure_rest_collision_callback, (SCM element, SCM, SCM, SCM prev_off)); @@ -88,7 +88,7 @@ private: friend class Beam_scoring_problem; static Direction get_default_dir (Grob *); - static std::vector get_beam_segments (Grob *); + static vector get_beam_segments (Grob *); static void set_stem_directions (Grob *, Direction); static void consider_auto_knees (Grob *); static void set_stem_shorten (Grob *); diff --git a/lily/include/beaming-pattern.hh b/lily/include/beaming-pattern.hh index 4a1d970ef3..217af19088 100644 --- a/lily/include/beaming-pattern.hh +++ b/lily/include/beaming-pattern.hh @@ -76,7 +76,7 @@ public: Beaming_pattern *split_pattern (int idx); private: - std::vector infos_; + vector infos_; Direction flag_direction (Beaming_options const &, vsize) const; void find_rhythmic_importance (Beaming_options const &); void unbeam_invisible_stems (); diff --git a/lily/include/bezier.hh b/lily/include/bezier.hh index 2222c80125..959afc5c4e 100644 --- a/lily/include/bezier.hh +++ b/lily/include/bezier.hh @@ -39,10 +39,10 @@ public: Bezier extract (Real, Real) const; Real get_other_coordinate (Axis a, Real x) const; - std::vector get_other_coordinates (Axis a, Real x) const; - std::vector solve_point (Axis, Real coordinate) const; + vector get_other_coordinates (Axis a, Real x) const; + vector solve_point (Axis, Real coordinate) const; Real minmax (Axis, Real, Real, Direction) const; - std::vector solve_derivative (Offset) const; + vector solve_derivative (Offset) const; Interval extent (Axis) const; Interval control_point_extent (Axis) const; @@ -55,15 +55,15 @@ public: /* Bezier curves always have 4 control points. Making this into an - std::vector<> gives unnecessary overhead, and makes debugging a royal + vector<> gives unnecessary overhead, and makes debugging a royal pain. */ Offset control_[4]; }; -void scale (std::vector *array, Real xscale, Real yscale); -void rotate (std::vector *array, Real phi); -void translate (std::vector *array, Offset o); +void scale (vector *array, Real xscale, Real yscale); +void rotate (vector *array, Real phi); +void translate (vector *array, Offset o); Bezier slur_shape (Real width, Real height_limit, Real height_proportion); diff --git a/lily/include/break-align-interface.hh b/lily/include/break-align-interface.hh index 87e9073b5b..cbb7f00c74 100644 --- a/lily/include/break-align-interface.hh +++ b/lily/include/break-align-interface.hh @@ -26,7 +26,7 @@ class Break_alignment_interface { public: - static std::vector ordered_elements (Grob *me); + static vector ordered_elements (Grob *me); static void add_element (Grob *me, Grob *add); static SCM break_align_order (Item *me); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element)); diff --git a/lily/include/change-iterator.hh b/lily/include/change-iterator.hh index d7473706dd..1ba16c0907 100644 --- a/lily/include/change-iterator.hh +++ b/lily/include/change-iterator.hh @@ -31,11 +31,11 @@ public: DECLARE_CLASSNAME (Change_iterator); // returns an error message (empty on success) - static std::string change_to (Music_iterator &it, - SCM to_type, const std::string &to_id); + static string change_to (Music_iterator &it, + SCM to_type, const string &to_id); private: - void error (const std::string&); + void error (const string&); }; #endif diff --git a/lily/include/change-sequence-iterator.hh b/lily/include/change-sequence-iterator.hh index 2c1ae65a22..2c2dfe3eb0 100644 --- a/lily/include/change-sequence-iterator.hh +++ b/lily/include/change-sequence-iterator.hh @@ -35,7 +35,7 @@ protected: private: // implement in derived class to effect a context change - virtual void change_to (const std::string &id) = 0; + virtual void change_to (const string &id) = 0; private: // There is no need to protect this in derived_mark() because it is protected diff --git a/lily/include/coherent-ligature-engraver.hh b/lily/include/coherent-ligature-engraver.hh index 0aad39c110..19e731815a 100644 --- a/lily/include/coherent-ligature-engraver.hh +++ b/lily/include/coherent-ligature-engraver.hh @@ -29,12 +29,12 @@ public: protected: virtual void build_ligature (Spanner *ligature, - std::vector const &primitives) = 0; + vector const &primitives) = 0; virtual void typeset_ligature (Spanner *ligature, - std::vector const &primitives); + vector const &primitives); virtual void move_related_items_to_column (Item *, Paper_column *, Real); private: - void collect_accidentals (Spanner *, std::vector const &); + void collect_accidentals (Spanner *, vector const &); }; #endif // COHERENT_LIGATURE_ENGRAVER_HH diff --git a/lily/include/column-x-positions.hh b/lily/include/column-x-positions.hh index dc35c0dc89..f4ef6a02dc 100644 --- a/lily/include/column-x-positions.hh +++ b/lily/include/column-x-positions.hh @@ -25,10 +25,10 @@ struct Column_x_positions { - std::vector cols_; - std::vector loose_cols_; + vector cols_; + vector loose_cols_; - std::vector config_; + vector config_; Real force_; bool satisfies_constraints_; diff --git a/lily/include/constrained-breaking.hh b/lily/include/constrained-breaking.hh index bb8dcf0c3c..e35fcc0bbe 100644 --- a/lily/include/constrained-breaking.hh +++ b/lily/include/constrained-breaking.hh @@ -45,10 +45,10 @@ struct Line_details Grob *last_column_; Real force_; Line_shape shape_; - std::vector footnote_heights_; /* The footnotes at the bottom of the + vector footnote_heights_; /* The footnotes at the bottom of the page, where each stencil represents a different footnote. */ - std::vector in_note_heights_; /* The in-notes under a system, + vector in_note_heights_; /* The in-notes under a system, where each stencil represents a different in-note. */ Interval refpoint_extent_; /* The refpoints of the first and last @@ -154,12 +154,12 @@ struct Constrained_break_node class Constrained_breaking { public: - std::vector solve (vsize start, vsize end, vsize sys_count); - std::vector best_solution (vsize start, vsize end); - std::vector line_details (vsize start, vsize end, vsize sys_count); + vector solve (vsize start, vsize end, vsize sys_count); + vector best_solution (vsize start, vsize end); + vector line_details (vsize start, vsize end, vsize sys_count); Constrained_breaking (Paper_score *ps); - Constrained_breaking (Paper_score *ps, std::vector const &start_col_posns); + Constrained_breaking (Paper_score *ps, vector const &start_col_posns); int max_system_count (vsize start, vsize end); int min_system_count (vsize start, vsize end); @@ -186,13 +186,13 @@ private: /* the [i](j,k)th entry is the score for fitting the first k bars onto the first j systems, starting at the i'th allowed starting column */ - std::vector > state_; + vector > state_; - std::vector start_; /* the columns at which we might be asked to start breaking */ - std::vector starting_breakpoints_; /* the corresponding index in breaks_ */ + vector start_; /* the columns at which we might be asked to start breaking */ + vector starting_breakpoints_; /* the corresponding index in breaks_ */ - std::vector all_; - std::vector breaks_; + vector all_; + vector breaks_; void initialize (); void resize (vsize systems); diff --git a/lily/include/context-def.hh b/lily/include/context-def.hh index 46f9d5560d..c49fee1e30 100644 --- a/lily/include/context-def.hh +++ b/lily/include/context-def.hh @@ -65,13 +65,13 @@ public: VIRTUAL_COPY_CONSTRUCTOR (Context_def, Context_def); - std::vector path_to_acceptable_context (SCM type_string, + vector path_to_acceptable_context (SCM type_string, Output_def *, SCM) const; - std::vector internal_path_to_acceptable_context (SCM type_string, + vector internal_path_to_acceptable_context (SCM type_string, Output_def *, SCM, - std::set *seen) const; + set *seen) const; Context *instantiate (SCM extra_ops); SCM to_alist () const; diff --git a/lily/include/context.hh b/lily/include/context.hh index dbcbf2b728..c4af7bce05 100644 --- a/lily/include/context.hh +++ b/lily/include/context.hh @@ -63,7 +63,7 @@ protected: SCM default_child_; SCM aliases_; Translator_group *implementation_; - std::string id_string_; + string id_string_; /* Events reported in the context is sent to this dispatcher. */ Dispatcher *event_source_; @@ -83,7 +83,7 @@ protected: void unset_property_from_event (SCM); public: - std::string id_string () const { return id_string_; } + string id_string () const { return id_string_; } SCM children_contexts () const { return context_list_; } SCM default_child_context_name () const; @@ -108,21 +108,21 @@ public: void instrumented_set_property (SCM, SCM, const char *, int, const char *); void internal_set_property (SCM var_sym, SCM value); - Context *create_context (Context_def *, const std::string&, SCM); + Context *create_context (Context_def *, const string&, SCM); void create_context_from_event (SCM); void acknowledge_infant (SCM); void remove_context (SCM); void change_parent (SCM); void disconnect_from_parent (); void check_removal (); - std::string context_name () const; + string context_name () const; SCM context_name_symbol () const; Global_context *get_global_context () const; virtual Context *get_score_context () const; virtual Output_def *get_output_def () const; virtual Moment now_mom () const; - virtual Context *get_default_interpreter (const std::string &context_id = ""); + virtual Context *get_default_interpreter (const string &context_id = ""); bool is_alias (SCM) const; void add_alias (SCM); @@ -131,10 +131,10 @@ public: bool is_removable () const; Context *find_create_context (SCM context_name, - const std::string &id, SCM ops); - Context *create_unique_context (SCM context_name, const std::string &context_id, + const string &id, SCM ops); + Context *create_unique_context (SCM context_name, const string &context_id, SCM ops); - std::vector path_to_acceptable_context (SCM alias) const; + vector path_to_acceptable_context (SCM alias) const; }; /* @@ -158,13 +158,13 @@ Context *find_context_above_by_parent_type (Context *where, SCM parent_type); // context and moving toward the leaves of the tree. If the starting context // matches, it is returned. An empty ID matches any context of the given type. Context *find_context_below (Context *where, - SCM type_sym, const std::string &id); + SCM type_sym, const string &id); // Search for a context of the given type and ID starting with the given // context, then searching its descendants, then its parent's descendants, etc. // An empty ID matches any context of the given type. Context *find_context_near (Context *where, - SCM type_sym, const std::string &id); + SCM type_sym, const string &id); // Search for the top context (i.e. the ancestor with no parent) starting with // the given context. diff --git a/lily/include/dimensions.hh b/lily/include/dimensions.hh index aa01197611..a0e2f25edd 100644 --- a/lily/include/dimensions.hh +++ b/lily/include/dimensions.hh @@ -37,7 +37,7 @@ const Real PT_TO_MM = (1.0 / MM_TO_PT); #endif -std::string print_dimen (Real); +string print_dimen (Real); const Real point_constant = 1 PT; const Real inch_constant = 1 INCH; const Real cm_constant = 1 CM; diff --git a/lily/include/dot-configuration.hh b/lily/include/dot-configuration.hh index cfc5ec67ca..b4e2219e6c 100644 --- a/lily/include/dot-configuration.hh +++ b/lily/include/dot-configuration.hh @@ -42,7 +42,7 @@ struct Dot_position } }; -struct Dot_configuration : public std::map +struct Dot_configuration : public map { Dot_formatting_problem const *problem_; diff --git a/lily/include/dot-formatting-problem.hh b/lily/include/dot-formatting-problem.hh index 7c2aca3115..fcb6d19a22 100644 --- a/lily/include/dot-formatting-problem.hh +++ b/lily/include/dot-formatting-problem.hh @@ -14,7 +14,7 @@ struct Dot_formatting_problem void register_configuration (Dot_configuration const &); Dot_configuration *best () const; - Dot_formatting_problem (std::vector const &boxes, Interval base_x); + Dot_formatting_problem (vector const &boxes, Interval base_x); ~Dot_formatting_problem (); }; diff --git a/lily/include/duration.hh b/lily/include/duration.hh index 303fecbeff..7a57cf53af 100644 --- a/lily/include/duration.hh +++ b/lily/include/duration.hh @@ -33,7 +33,7 @@ struct Duration : public Simple_smob Duration (); Duration (int, int); Duration (Rational, bool scale); - std::string to_string () const; + string to_string () const; Duration compressed (Rational) const; Rational get_length () const; diff --git a/lily/include/engraver-group.hh b/lily/include/engraver-group.hh index e3cb3b1218..aa3cd478bc 100644 --- a/lily/include/engraver-group.hh +++ b/lily/include/engraver-group.hh @@ -26,7 +26,7 @@ class Engraver_group : public Translator_group { protected: - std::vector announce_infos_; + vector announce_infos_; Drul_array acknowledge_hash_table_drul_; void override (SCM); void revert (SCM); diff --git a/lily/include/file-name-map.hh b/lily/include/file-name-map.hh index c0091a3b1e..3fb22d6a2a 100644 --- a/lily/include/file-name-map.hh +++ b/lily/include/file-name-map.hh @@ -22,7 +22,7 @@ #include "std-string.hh" -std::string map_file_name (const std::string &s); +string map_file_name (const string &s); #endif /* FILE_NAME_MAP_HH */ diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index 4d4694cb21..d74c8157ca 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -42,22 +42,22 @@ private: public: SCM description_; - std::string file_name_; + string file_name_; - // Return stencil for given std::string. output_state may be modified to + // Return stencil for given string. output_state may be modified to // record the font. virtual Stencil text_stencil (Output_def *output_state, - const std::string &text, bool music) const; + const string &text, bool music) const; - virtual std::string font_name () const; + virtual string font_name () const; virtual size_t count () const; - virtual Offset attachment_point (const std::string&) const; + virtual Offset attachment_point (const string&) const; virtual Offset get_indexed_wxwy (size_t) const; virtual Box get_indexed_char_dimensions (size_t index) const; - virtual size_t name_to_index (std::string) const=0; + virtual size_t name_to_index (string) const=0; virtual size_t index_to_charcode (size_t) const; virtual Real design_size () const; - virtual Stencil find_by_name (std::string) const; + virtual Stencil find_by_name (string) const; virtual SCM sub_fonts () const; virtual SCM font_file_name () const; diff --git a/lily/include/freetype.hh b/lily/include/freetype.hh index 43907d87d0..e4009ba072 100644 --- a/lily/include/freetype.hh +++ b/lily/include/freetype.hh @@ -30,7 +30,7 @@ void init_freetype (); extern FT_Library freetype2_library; -std::string freetype_error_string (FT_Error code); +string freetype_error_string (FT_Error code); SCM box_to_scheme_lines (Box b); Box ly_FT_get_unscaled_indexed_char_dimensions (FT_Face const &face, size_t signed_idx); diff --git a/lily/include/global-context.hh b/lily/include/global-context.hh index 1779280acc..75b52c95ae 100644 --- a/lily/include/global-context.hh +++ b/lily/include/global-context.hh @@ -46,7 +46,7 @@ public: virtual SCM get_output (); virtual Output_def *get_output_def () const; virtual Moment now_mom () const; - virtual Context *get_default_interpreter (const std::string &context_id = ""); + virtual Context *get_default_interpreter (const string &context_id = ""); Moment previous_moment () const; protected: diff --git a/lily/include/gregorian-ligature-engraver.hh b/lily/include/gregorian-ligature-engraver.hh index 5727910666..5aea42662b 100644 --- a/lily/include/gregorian-ligature-engraver.hh +++ b/lily/include/gregorian-ligature-engraver.hh @@ -34,9 +34,9 @@ protected: virtual void listen_pes_or_flexa (Stream_event *ev); virtual void build_ligature (Spanner *ligature, - std::vector const &primitives); + vector const &primitives); virtual void transform_heads (Spanner *ligature, - std::vector const &primitives) = 0; + vector const &primitives) = 0; void stop_translation_timestep (); }; diff --git a/lily/include/gregorian-ligature.hh b/lily/include/gregorian-ligature.hh index 251766062a..0089434163 100644 --- a/lily/include/gregorian-ligature.hh +++ b/lily/include/gregorian-ligature.hh @@ -27,7 +27,7 @@ class Grob; class Gregorian_ligature { public: - static std::string prefixes_to_str (Grob *); + static string prefixes_to_str (Grob *); }; /* diff --git a/lily/include/grob-array.hh b/lily/include/grob-array.hh index f5e88a6d34..1a755fe661 100644 --- a/lily/include/grob-array.hh +++ b/lily/include/grob-array.hh @@ -31,7 +31,7 @@ public: SCM mark_smob () const; static const char type_p_name_[]; private: - std::vector grobs_; + vector grobs_; bool ordered_; @@ -47,9 +47,9 @@ public: void remove_duplicates (); void clear () { grobs_.clear (); } void add (Grob *x) { grobs_.push_back (x); } - void set_array (std::vector const &src) { grobs_ = src; } - std::vector &array_reference () { return grobs_; } - std::vector const &array () const { return grobs_; } + void set_array (vector const &src) { grobs_ = src; } + vector &array_reference () { return grobs_; } + vector const &array () const { return grobs_; } static SCM make_array (); // Remove grobs that do not satisfy the predicate, leaving the order @@ -67,7 +67,7 @@ public: }; -std::vector const &ly_scm2link_array (SCM x); +vector const &ly_scm2link_array (SCM x); SCM grob_list_to_grob_array (SCM lst); SCM grob_array_to_list (Grob_array *array); diff --git a/lily/include/grob-info.hh b/lily/include/grob-info.hh index 1faeb5a2da..1df88ce749 100644 --- a/lily/include/grob-info.hh +++ b/lily/include/grob-info.hh @@ -42,7 +42,7 @@ public: Context *context () const; Stream_event *event_cause () const; Stream_event *ultimate_event_cause () const; - std::vector origin_contexts (Translator *) const; + vector origin_contexts (Translator *) const; Grob_info (Translator *, Grob *); Grob_info (); diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 5dda5112b2..db51e02e73 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -102,7 +102,7 @@ public: bool is_live () const; /* naming. */ - std::string name () const; + string name () const; /* Properties */ SCM get_property_alist_chain (SCM) const; @@ -118,8 +118,8 @@ public: void internal_set_property (SCM sym, SCM val); /* messages */ - void warning (const std::string&) const; - void programming_error (const std::string&) const; + void warning (const string&) const; + void programming_error (const string&) const; /* class hierarchy */ virtual System *get_system () const; @@ -181,12 +181,12 @@ inline bool has_interface(Grob *g) } /* unification */ -void uniquify (std::vector &); +void uniquify (vector &); /* refpoints */ Grob *common_refpoint_of_list (SCM elt_list, Grob *, Axis a); -Grob *common_refpoint_of_array (std::vector const &, Grob *, Axis a); -Grob *common_refpoint_of_array (std::set const &, Grob *, Axis a); +Grob *common_refpoint_of_array (vector const &, Grob *, Axis a); +Grob *common_refpoint_of_array (set const &, Grob *, Axis a); System *get_root_system (Grob *me); /* extents */ diff --git a/lily/include/horizontal-bracket.hh b/lily/include/horizontal-bracket.hh index 0b30949c25..3a1692fc11 100644 --- a/lily/include/horizontal-bracket.hh +++ b/lily/include/horizontal-bracket.hh @@ -29,7 +29,7 @@ struct Horizontal_bracket DECLARE_SCHEME_CALLBACK (print, (SCM)); static Stencil make_bracket (Grob *, Real, Axis, Direction); static Stencil make_enclosing_bracket (Grob *me, Grob *refpoint, - std::vector grobs, + vector grobs, Axis a, Direction dir); }; diff --git a/lily/include/includable-lexer.hh b/lily/include/includable-lexer.hh index a4c3c0545d..bfc3d81718 100644 --- a/lily/include/includable-lexer.hh +++ b/lily/include/includable-lexer.hh @@ -36,26 +36,26 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; */ class Includable_lexer : public yyFlexLexer { - std::vector state_stack_; + vector state_stack_; protected: bool close_input (); - std::vector include_stack_; - std::vector char_count_stack_; + vector include_stack_; + vector char_count_stack_; public: Includable_lexer (); ~Includable_lexer (); - std::string main_input_name_; + string main_input_name_; /// store dependencies for Makefile stuff. - std::vector file_name_strings_; + vector file_name_strings_; Source_file *get_source_file () const; - virtual void new_input (const std::string &s, Sources *); + virtual void new_input (const string &s, Sources *); - void new_input (const std::string &name, std::string data, Sources *); + void new_input (const string &name, string data, Sources *); char const *here_str0 () const; }; diff --git a/lily/include/input.hh b/lily/include/input.hh index dbe3a2b525..b77db2d66f 100644 --- a/lily/include/input.hh +++ b/lily/include/input.hh @@ -41,21 +41,21 @@ public: char const *end () const; void set (Source_file *, char const *, char const *); - void error (const std::string&) const; - void programming_error (const std::string&) const; - void non_fatal_error (const std::string&) const; - void warning (const std::string&) const; - void message (const std::string&) const; - void debug_output (const std::string&) const; + void error (const string&) const; + void programming_error (const string&) const; + void non_fatal_error (const string&) const; + void warning (const string&) const; + void message (const string&) const; + void debug_output (const string&) const; void set_spot (Input const &); void step_forward (); void set_location (Input const &, Input const &); Input spot () const; - std::string location_string () const; - std::string line_number_string () const; - std::string file_string ()const; + string location_string () const; + string line_number_string () const; + string file_string ()const; int line_number ()const; int column_number ()const; @@ -67,8 +67,8 @@ public: Input (Input const &i); Input (); protected: - std::string message_location () const; - std::string message_string (const std::string &msg) const; + string message_location () const; + string message_string (const string &msg) const; }; extern Input dummy_input_global; diff --git a/lily/include/interval-minefield.hh b/lily/include/interval-minefield.hh index 8977707e6b..fc748c17b6 100644 --- a/lily/include/interval-minefield.hh +++ b/lily/include/interval-minefield.hh @@ -34,7 +34,7 @@ public: void solve (); private: - std::vector forbidden_intervals_; + vector forbidden_intervals_; Interval feasible_placements_; Real bulk_; }; diff --git a/lily/include/keyword.hh b/lily/include/keyword.hh index 119345ea59..0f36fe812b 100644 --- a/lily/include/keyword.hh +++ b/lily/include/keyword.hh @@ -34,7 +34,7 @@ struct Keyword_ent */ struct Keyword_table { - std::vector table_; + vector table_; Keyword_table (Keyword_ent *); vsize lookup (char const *s) const; diff --git a/lily/include/least-squares.hh b/lily/include/least-squares.hh index cee025d3cb..5a8c39bacc 100644 --- a/lily/include/least-squares.hh +++ b/lily/include/least-squares.hh @@ -25,7 +25,7 @@ /** Least squares minimisation in 2 variables. */ -void minimise_least_squares (Real *coef, Real *offset, std::vector const &); +void minimise_least_squares (Real *coef, Real *offset, vector const &); #endif // LEASTSQUARE_HH diff --git a/lily/include/ligature-engraver.hh b/lily/include/ligature-engraver.hh index 0af8d1466a..6f53331a4e 100644 --- a/lily/include/ligature-engraver.hh +++ b/lily/include/ligature-engraver.hh @@ -36,7 +36,7 @@ protected: void process_music (); virtual Spanner *create_ligature_spanner () = 0; virtual void typeset_ligature (Spanner *ligature, - std::vector const &primitives) = 0; + vector const &primitives) = 0; virtual Spanner *current_ligature (); SCM brew_ligature_primitive_proc; @@ -48,10 +48,10 @@ private: Drul_array events_drul_; Spanner *ligature_; - std::vector primitives_; + vector primitives_; Spanner *finished_ligature_; - std::vector finished_primitives_; + vector finished_primitives_; Stream_event *prev_start_event_; diff --git a/lily/include/lily-guile-macros.hh b/lily/include/lily-guile-macros.hh index d1728d8fd2..869a52af32 100644 --- a/lily/include/lily-guile-macros.hh +++ b/lily/include/lily-guile-macros.hh @@ -25,7 +25,7 @@ #if GUILEV2 // if Guile's internal representation switches to utf8, this should be // changed accordingly for efficiency's sake. This is used for -// strings known to be in ASCII entirely, including any std::string +// strings known to be in ASCII entirely, including any string // constants in the C code. #define scm_from_ascii_string scm_from_latin1_string #define scm_from_ascii_stringn scm_from_latin1_stringn @@ -77,7 +77,7 @@ scm_or_str2symbol (SCM s) } /* Using this trick we cache the value of scm_from_locale_symbol ("fooo") where - "fooo" is a constant std::string. This is done at the cost of one static + "fooo" is a constant string. This is done at the cost of one static variable per ly_symbol2scm() use, and one boolean evaluation for every call. */ @@ -107,10 +107,10 @@ inline SCM ly_symbol2scm (char const *x) { return scm_from_utf8_symbol ((x)); } static SCM NAME ARGS; \ static SCM NAME ## _proc -std::string mangle_cxx_identifier (std::string); +string mangle_cxx_identifier (string); -void ly_add_type_predicate (void *ptr, const std::string &name); -std::string predicate_to_typename (void *ptr); +void ly_add_type_predicate (void *ptr, const string &name); +string predicate_to_typename (void *ptr); /* Make TYPE::FUNC available as a Scheme function. @@ -120,8 +120,8 @@ std::string predicate_to_typename (void *ptr); void \ TYPE ## _ ## FUNC ## _init_functions () \ { \ - std::string cxx = std::string (#TYPE) + "::" + std::string (#FUNC); \ - std::string id = mangle_cxx_identifier (cxx); \ + string cxx = string (#TYPE) + "::" + string (#FUNC); \ + string id = mangle_cxx_identifier (cxx); \ TYPE ::FUNC ## _proc = scm_c_define_gsubr (id.c_str(), \ (ARGCOUNT-OPTIONAL_COUNT), OPTIONAL_COUNT, 0, \ (scm_t_subr) TYPE::FUNC); \ @@ -139,8 +139,8 @@ std::string predicate_to_typename (void *ptr); #define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT) \ MAKE_SCHEME_CALLBACK_WITH_OPTARGS(TYPE,FUNC,ARGCOUNT, 0, ""); -void ly_add_function_documentation (SCM proc, const std::string &fname, const std::string &varlist, const std::string &doc); -void ly_check_name (const std::string &cxx, const std::string &fname); +void ly_add_function_documentation (SCM proc, const string &fname, const string &varlist, const string &doc); +void ly_check_name (const string &cxx, const string &fname); #define ADD_SCM_INIT_FUNC(name, func) \ class name ## _scm_initter \ diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index a014e018a6..34578511b8 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -43,16 +43,16 @@ A ly_B2A (B b); */ SCM ly_last (SCM list); -std::string ly_scm_write_string (SCM s); +string ly_scm_write_string (SCM s); SCM ly_deep_copy (SCM); SCM ly_truncate_list (int k, SCM lst); -std::string gulp_file_to_string (const std::string &fn, bool must_exist, int size); +string gulp_file_to_string (const string &fn, bool must_exist, int size); -SCM ly_string2scm (std::string const &s); -std::string ly_scm2string (SCM s); -std::string ly_symbol2string (SCM); -std::string robust_symbol2string (SCM, const std::string&); +SCM ly_string2scm (string const &s); +string ly_scm2string (SCM s); +string ly_symbol2string (SCM); +string robust_symbol2string (SCM, const string&); Rational ly_scm2rational (SCM); SCM ly_rational2scm (Rational); SCM ly_offset2scm (Offset); @@ -75,14 +75,14 @@ Drul_array robust_scm2drul (SCM, Drul_array); Drul_array robust_scm2booldrul (SCM, Drul_array); Interval robust_scm2interval (SCM, Drul_array); Offset robust_scm2offset (SCM, Offset); -std::string robust_scm2string (SCM, const std::string&); +string robust_scm2string (SCM, const string&); Rational robust_scm2rational (SCM, Rational); -std::vector ly_scm2floatvector (SCM); -SCM ly_floatvector2scm (std::vector v); +vector ly_scm2floatvector (SCM); +SCM ly_floatvector2scm (vector v); SCM ly_quote_scm (SCM s); bool type_check_assignment (SCM val, SCM sym, SCM type_symbol); -std::string print_scm_val (SCM val); +string print_scm_val (SCM val); SCM ly_number2string (SCM s); SCM parse_symbol_list (char const *); @@ -137,7 +137,7 @@ extern "C" { void ly_display_scm (SCM s); } -void read_lily_scm_file (std::string); +void read_lily_scm_file (string); void ly_c_init_guile (); bool is_direction (SCM s); @@ -202,7 +202,7 @@ inline bool ly_is_pair (SCM x) { return SCM_I_CONSP (x); } template SCM -ly_cxx_vector_to_list (std::vector const &src) +ly_cxx_vector_to_list (vector const &src) { SCM l = SCM_EOL; for (vsize i = src.size (); i--;) @@ -211,8 +211,8 @@ ly_cxx_vector_to_list (std::vector const &src) return l; } -SCM ly_offsets2scm (std::vector os); -std::vector ly_scm2offsets (SCM s); +SCM ly_offsets2scm (vector os); +vector ly_scm2offsets (SCM s); /* For backward compatability with Guile 1.8 */ #if !HAVE_GUILE_HASH_FUNC diff --git a/lily/include/lily-lexer.hh b/lily/include/lily-lexer.hh index 588da0d8f2..0e001ec187 100644 --- a/lily/include/lily-lexer.hh +++ b/lily/include/lily-lexer.hh @@ -39,10 +39,10 @@ public: static const char type_p_name_[]; virtual ~Lily_lexer (); private: - int lookup_keyword (const std::string&); - int scan_bare_word (const std::string&); - int scan_escaped_word (const std::string&); - int scan_shorthand (const std::string&); + int lookup_keyword (const string&); + int scan_bare_word (const string&); + int scan_escaped_word (const string&); + int scan_shorthand (const string&); int scan_scm_id (SCM); int identifier_type (SCM); char escaped_char (char) const; @@ -93,12 +93,12 @@ public: void start_main_input (); - virtual void new_input (const std::string &s, Sources *); - virtual void new_input (const std::string &s, std::string d, Sources *); + virtual void new_input (const string &s, Sources *); + virtual void new_input (const string &s, string d, Sources *); bool top_input () { return include_stack_.size () < 2; } SCM keyword_list () const; - SCM lookup_identifier (const std::string &s); + SCM lookup_identifier (const string &s); SCM lookup_identifier_symbol (SCM s); void push_extra_token (Input const &where, int token_type, SCM scm = SCM_UNSPECIFIED); diff --git a/lily/include/lily-parser.hh b/lily/include/lily-parser.hh index 0a8656fd15..b08df7c7a4 100644 --- a/lily/include/lily-parser.hh +++ b/lily/include/lily-parser.hh @@ -42,7 +42,7 @@ public: Sources *sources_; Duration default_duration_; int default_tremolo_type_; - std::string output_basename_; + string output_basename_; SCM closures_; int fatal_error_; @@ -57,14 +57,14 @@ public: void clear (); void do_init_file (); - void include_string (const std::string &ly_code); - void parse_file (const std::string &init, const std::string &name, const std::string &out_name); - void parse_string (const std::string &ly_code); - SCM parse_string_expression (const std::string &ly_code, const std::string &filename, int line); - void parser_error (const std::string&); - void parser_error (Input const &, const std::string&); + void include_string (const string &ly_code); + void parse_file (const string &init, const string &name, const string &out_name); + void parse_string (const string &ly_code); + SCM parse_string_expression (const string &ly_code, const string &filename, int line); + void parser_error (const string&); + void parser_error (Input const &, const string&); // The following is called as yyerror - static void parser_error (Input const *i, Lily_parser *parser, SCM *, const std::string &s); + static void parser_error (Input const *i, Lily_parser *parser, SCM *, const string &s); void set_yydebug (bool); SCM make_scope () const; diff --git a/lily/include/lily-version.hh b/lily/include/lily-version.hh index 842e35cc57..edb46c6c58 100644 --- a/lily/include/lily-version.hh +++ b/lily/include/lily-version.hh @@ -22,9 +22,9 @@ #include "std-string.hh" -std::string version_string (); -std::string gnu_lilypond_string (); -std::string gnu_lilypond_version_string (); +string version_string (); +string gnu_lilypond_string (); +string gnu_lilypond_version_string (); #endif // LILY_VERSION_HH diff --git a/lily/include/lilypond-version.hh b/lily/include/lilypond-version.hh index 1d25de986e..818414abdf 100644 --- a/lily/include/lilypond-version.hh +++ b/lily/include/lilypond-version.hh @@ -26,16 +26,16 @@ struct Lilypond_version { Lilypond_version (int major, int minor, int patch); - Lilypond_version (const std::string &str); + Lilypond_version (const string &str); - std::string to_string () const; + string to_string () const; operator bool () const; static int compare (const Lilypond_version &, const Lilypond_version &); int major_; int minor_; int patch_; - std::string extra_patch_string_; + string extra_patch_string_; }; INSTANTIATE_COMPARE (const Lilypond_version &, Lilypond_version::compare); diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 74968f1603..5fe7404825 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -29,7 +29,7 @@ namespace Lookup Stencil bracket (Axis a, Interval iv, Real thick, Real protrude, Real blot); Stencil circle (Real rad, Real thick, bool filled); Stencil rotated_box (Real slope, Real width, Real thick, Real blot); - Stencil round_filled_polygon (std::vector const &points, Real blotdiameter, Real extroversion = -1.0); + Stencil round_filled_polygon (vector const &points, Real blotdiameter, Real extroversion = -1.0); Stencil frame (Box b, Real thick, Real blot); Stencil slur (Bezier controls, Real cthick, Real thick, SCM dash_definition); @@ -42,7 +42,7 @@ namespace Lookup Stencil repeat_slash (Real w, Real slope, Real th); Stencil horizontal_line (Interval w, Real th); Stencil triangle (Interval iv, Real thick, Real protrude); - Stencil points_to_line_stencil (Real thick, std::vector const &points); + Stencil points_to_line_stencil (Real thick, vector const &points); }; #endif // LOOKUP_HH diff --git a/lily/include/main.hh b/lily/include/main.hh index 5d72793c9f..1e6e2caf51 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -29,32 +29,32 @@ void do_scores (); void clear_scores (); void add_score (Score *s); void call_constructors (); -std::vector get_inclusion_names (); -void set_inclusion_names (std::vector); +vector get_inclusion_names (); +void set_inclusion_names (vector); -extern std::string init_name_global; +extern string init_name_global; /* options */ -extern std::vector dump_header_fieldnames_global; -extern std::vector start_environment_global; -extern std::string output_backend_global; -extern std::string output_name_global; +extern vector dump_header_fieldnames_global; +extern vector start_environment_global; +extern string output_backend_global; +extern string output_name_global; extern bool bigpdfs; extern bool be_safe_global; extern bool do_internal_type_checking_global; -extern std::string lilypond_datadir; +extern string lilypond_datadir; extern bool use_object_keys; extern bool strict_infinity_checking; -extern std::string init_scheme_code_global; -extern std::string init_scheme_variables_global; +extern string init_scheme_code_global; +extern string init_scheme_variables_global; /* todo: collect in Output_option struct? */ -extern std::string output_format_global; +extern string output_format_global; /* misc */ -extern std::vector failed_files; +extern vector failed_files; extern int exit_status_global; extern File_path global_path; extern const char *LILYPOND_DATADIR; diff --git a/lily/include/midi-chunk.hh b/lily/include/midi-chunk.hh index bf01cd7568..0786a4871d 100644 --- a/lily/include/midi-chunk.hh +++ b/lily/include/midi-chunk.hh @@ -34,7 +34,7 @@ public: int delta_ticks_; Midi_item *midi_; - std::string to_string () const; + string to_string () const; }; /** @@ -43,15 +43,15 @@ public: class Midi_chunk { public: - void set (const std::string &header_string, const std::string &data_string, const std::string &footer_string); - virtual std::string to_string () const; - virtual std::string data_string () const; + void set (const string &header_string, const string &data_string, const string &footer_string); + virtual string to_string () const; + virtual string data_string () const; DECLARE_CLASSNAME (Midi_chunk); virtual ~Midi_chunk (); private: - std::string data_string_; - std::string footer_string_; - std::string header_string_; + string data_string_; + string footer_string_; + string header_string_; }; class Midi_header : public Midi_chunk @@ -69,13 +69,13 @@ public: int port_; DECLARE_CLASSNAME (Midi_track); - std::vector events_; + vector events_; Midi_track (int number, bool port); ~Midi_track (); void add (int, Midi_item *midi); - virtual std::string data_string () const; + virtual string data_string () const; }; #endif /* MIDI_CHUNK_HH */ diff --git a/lily/include/midi-item.hh b/lily/include/midi-item.hh index 5d9e100ca8..b593ce1527 100644 --- a/lily/include/midi-item.hh +++ b/lily/include/midi-item.hh @@ -23,7 +23,7 @@ #include "audio-item.hh" #include "std-vector.hh" -std::string int2midi_varint_string (int i); +string int2midi_varint_string (int i); /** Any piece of midi information. @@ -40,7 +40,7 @@ public: static Midi_item *get_midi (Audio_item *a); - virtual std::string to_string () const = 0; + virtual string to_string () const = 0; }; class Midi_channel_item : public Midi_item @@ -61,7 +61,7 @@ public: DECLARE_CLASSNAME (Midi_control_function_value_change); Midi_control_function_value_change (Audio_control_function_value_change *ai); virtual ~Midi_control_function_value_change (); - virtual std::string to_string () const; + virtual string to_string () const; Audio_control_function_value_change::Control control_; Real value_; }; @@ -71,7 +71,7 @@ class Midi_duration : public Midi_item public: Midi_duration (Real seconds_f); - virtual std::string to_string () const; + virtual string to_string () const; Real seconds_; }; @@ -84,7 +84,7 @@ public: Midi_instrument (Audio_instrument *); DECLARE_CLASSNAME (Midi_instrument); - virtual std::string to_string () const; + virtual string to_string () const; Audio_instrument *audio_; }; @@ -95,7 +95,7 @@ public: Midi_key (Audio_key *); DECLARE_CLASSNAME (Midi_key); - virtual std::string to_string () const; + virtual string to_string () const; Audio_key *audio_; }; @@ -106,7 +106,7 @@ public: Midi_time_signature (Audio_time_signature *); DECLARE_CLASSNAME (Midi_time_signature); - virtual std::string to_string () const; + virtual string to_string () const; Audio_time_signature *audio_; int clocks_per_1_; @@ -120,7 +120,7 @@ public: int get_semitone_pitch () const; int get_fine_tuning () const; - virtual std::string to_string () const; + virtual string to_string () const; Audio_note *audio_; @@ -134,7 +134,7 @@ public: Midi_note_off (Midi_note *); DECLARE_CLASSNAME (Midi_note_off); - virtual std::string to_string () const; + virtual string to_string () const; Midi_note *on_; Byte aftertouch_byte_; @@ -152,7 +152,7 @@ public: Midi_text (Audio_text *); - virtual std::string to_string () const; + virtual string to_string () const; Audio_text *audio_; }; @@ -163,7 +163,7 @@ public: Midi_dynamic (Audio_dynamic *); DECLARE_CLASSNAME (Midi_dynamic); - virtual std::string to_string () const; + virtual string to_string () const; Audio_dynamic *audio_; }; @@ -174,7 +174,7 @@ public: Midi_piano_pedal (Audio_piano_pedal *); DECLARE_CLASSNAME (Midi_piano_pedal); - virtual std::string to_string () const; + virtual string to_string () const; Audio_piano_pedal *audio_; }; @@ -185,7 +185,7 @@ public: Midi_tempo (Audio_tempo *); DECLARE_CLASSNAME (Midi_tempo); - virtual std::string to_string () const; + virtual string to_string () const; Audio_tempo *audio_; }; diff --git a/lily/include/midi-stream.hh b/lily/include/midi-stream.hh index 544aa884ba..a14ac80e20 100644 --- a/lily/include/midi-stream.hh +++ b/lily/include/midi-stream.hh @@ -21,6 +21,7 @@ #define MIDI_STREAM_HH #include +using namespace std; #include #include "std-string.hh" @@ -28,15 +29,15 @@ struct Midi_stream { - Midi_stream (const std::string &file_name_string); + Midi_stream (const string &file_name_string); ~Midi_stream (); - void write (const std::string&); + void write (const string&); void write (Midi_chunk const &); void open (); FILE *out_file_; - std::string file_name_string_; + string file_name_string_; }; #endif // MIDI_STREAM_HH diff --git a/lily/include/midi-walker.hh b/lily/include/midi-walker.hh index 3267a2d047..f23b7407e8 100644 --- a/lily/include/midi-walker.hh +++ b/lily/include/midi-walker.hh @@ -56,11 +56,11 @@ private: bool percussion_; bool merge_unisons_; vsize index_; - std::vector items_; + vector items_; PQueue stop_note_queue; int last_tick_; - std::vector midi_events_; + vector midi_events_; }; #endif // MIDI_WALKER_HH diff --git a/lily/include/misc.hh b/lily/include/misc.hh index 206e74e3ea..7226aceef8 100644 --- a/lily/include/misc.hh +++ b/lily/include/misc.hh @@ -21,6 +21,7 @@ #define MISC_HH #include +using namespace std; #include "std-vector.hh" #include "interval.hh" @@ -62,7 +63,7 @@ Real directed_round (Real f, Direction d); Real peak_around (Real epsilon, Real threshold, Real x); Real convex_amplifier (Real standard_x, Real increase_factor, Real x); -std::string camel_case_to_lisp_identifier (const std::string &in); +string camel_case_to_lisp_identifier (const string &in); #endif diff --git a/lily/include/modified-font-metric.hh b/lily/include/modified-font-metric.hh index 1716502267..c63c532fbd 100644 --- a/lily/include/modified-font-metric.hh +++ b/lily/include/modified-font-metric.hh @@ -26,14 +26,14 @@ struct Modified_font_metric : public Font_metric { public: - Stencil text_stencil (Output_def *output_state, const std::string&, bool) const; + Stencil text_stencil (Output_def *output_state, const string&, bool) const; Real get_magnification () const; static SCM make_scaled_font_metric (Font_metric *fm, Real magnification); size_t count () const; Offset get_indexed_wxwy (size_t) const; - Offset attachment_point (const std::string&) const; - size_t name_to_index (std::string) const; + Offset attachment_point (const string&) const; + size_t name_to_index (string) const; size_t index_to_charcode (size_t) const; Font_metric *original_font () const; @@ -43,7 +43,7 @@ protected: Modified_font_metric (Font_metric *fm, Real magnification); SCM sub_fonts () const; - std::string font_name () const; + string font_name () const; Real design_size () const; void derived_mark () const; Box get_indexed_char_dimensions (size_t) const; diff --git a/lily/include/moment.hh b/lily/include/moment.hh index 9f825970af..d84a992b40 100644 --- a/lily/include/moment.hh +++ b/lily/include/moment.hh @@ -59,7 +59,7 @@ public: /* Deliver a copy of THIS as a smobified SCM */ - std::string to_string () const; + string to_string () const; static int compare (Moment const &, Moment const &); SCM as_scheme () const; }; diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index d5c69d4390..810d230aac 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -114,7 +114,7 @@ bool is_child_context (Context *me, Context *child); #define IMPLEMENT_CTOR_CALLBACK(Class) \ LY_DEFINE_MEMBER_FUNCTION (Class, constructor, \ - mangle_cxx_identifier (std::string (#Class) + "::constructor").c_str(), \ + mangle_cxx_identifier (string (#Class) + "::constructor").c_str(), \ 0, 0, 0, \ (), \ "") \ diff --git a/lily/include/note-collision.hh b/lily/include/note-collision.hh index 62b29e8318..ad2ed5345d 100644 --- a/lily/include/note-collision.hh +++ b/lily/include/note-collision.hh @@ -37,11 +37,11 @@ class Note_collision_interface { public: - static SCM automatic_shift (Grob *, Drul_array >); + static SCM automatic_shift (Grob *, Drul_array >); static SCM forced_shift (Grob *); - static std::vector note_head_positions (Grob *me); - static Drul_array > get_clash_groups (Grob *me); + static vector note_head_positions (Grob *me); + static Drul_array > get_clash_groups (Grob *me); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM smob)); static void add_column (Grob *me, Grob *ncol); }; diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index d57d3e41e9..1e167d58b2 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -34,7 +34,7 @@ public: static Real stem_attachment_coordinate (Grob *, Axis a); static int get_balltype (Grob *); - static Offset get_stem_attachment (Font_metric *, const std::string&); + static Offset get_stem_attachment (Font_metric *, const string&); }; #endif // NOTEHEAD_HH diff --git a/lily/include/open-type-font.hh b/lily/include/open-type-font.hh index 49b257586c..f08d4fa71c 100644 --- a/lily/include/open-type-font.hh +++ b/lily/include/open-type-font.hh @@ -48,22 +48,22 @@ public: SCM glyph_list () const; SCM get_glyph_outline (size_t signed_idx) const; Box get_glyph_outline_bbox (size_t signed_idx) const; - std::string get_otf_table (const std::string &tag) const; - static SCM make_otf (const std::string&); - std::string font_name () const; + string get_otf_table (const string &tag) const; + static SCM make_otf (const string&); + string font_name () const; ~Open_type_font (); - Offset attachment_point (const std::string&) const; + Offset attachment_point (const string&) const; size_t count () const; Box get_indexed_char_dimensions (size_t) const; Box get_unscaled_indexed_char_dimensions (size_t) const; - size_t name_to_index (std::string) const; + size_t name_to_index (string) const; size_t index_to_charcode (size_t) const; void derived_mark () const; SCM sub_fonts () const; Real design_size () const; }; -std::string get_otf_table (FT_Face face, const std::string &tag); -FT_Face open_ft_face (const std::string&, FT_Long idx); +string get_otf_table (FT_Face face, const string &tag); +FT_Face open_ft_face (const string&, FT_Long idx); #endif /* OPEN_TYPE_FONT_HH */ diff --git a/lily/include/output-def.hh b/lily/include/output-def.hh index e41cf75846..5de672e67a 100644 --- a/lily/include/output-def.hh +++ b/lily/include/output-def.hh @@ -66,7 +66,7 @@ public: /* variables. */ - SCM c_variable (const std::string &id) const; + SCM c_variable (const string &id) const; SCM lookup_variable (SCM sym) const; void set_variable (SCM sym, SCM val); void normalize (); diff --git a/lily/include/page-breaking.hh b/lily/include/page-breaking.hh index cab51e001c..9a38485c28 100644 --- a/lily/include/page-breaking.hh +++ b/lily/include/page-breaking.hh @@ -101,7 +101,7 @@ class Page_breaking public: typedef bool (*Break_predicate) (Grob *); typedef bool (*Prob_break_predicate) (Prob *); - typedef std::vector Line_division; + typedef vector Line_division; /* TODO: naming. @@ -142,7 +142,7 @@ protected: vsize next_system (Break_position const &break_pos) const; - SCM make_pages (std::vector lines_per_page, SCM lines); + SCM make_pages (vector lines_per_page, SCM lines); vsize min_system_count (vsize start, vsize end); vsize max_system_count (vsize start, vsize end); @@ -179,11 +179,11 @@ protected: vsize last_break_position () const; - std::vector system_specs_; + vector system_specs_; private: - std::vector breaks_; - std::vector chunks_; - std::vector line_breaking_; + vector breaks_; + vector chunks_; + vector line_breaking_; bool ragged_; bool ragged_last_; int systems_per_page_; @@ -197,8 +197,8 @@ private: Real footnote_footer_padding_; int orphan_penalty_; - std::vector current_configurations_; - std::vector current_chunks_; + vector current_configurations_; + vector current_chunks_; vsize current_start_breakpoint_; vsize current_end_breakpoint_; @@ -206,15 +206,15 @@ private: void compute_line_heights (); void clear_line_details_cache (); vsize cached_configuration_index_; - std::vector cached_line_details_; - std::vector uncompressed_line_details_; + vector cached_line_details_; + vector uncompressed_line_details_; Real paper_height_; - mutable std::vector page_height_cache_; - mutable std::vector last_page_height_cache_; + mutable vector page_height_cache_; + mutable vector last_page_height_cache_; - std::vector chunk_list (vsize start, vsize end); - Line_division system_count_bounds (std::vector const &chunks, bool min); + vector chunk_list (vsize start, vsize end); + Line_division system_count_bounds (vector const &chunks, bool min); void line_breaker_args (vsize i, Break_position const &start, Break_position const &end, @@ -226,8 +226,8 @@ private: Line_division const &max, Line_division *cur); - std::vector line_details (vsize start, vsize end, Line_division const &div); - Page_spacing_result space_systems_on_1_page (std::vector const &lines, Real page_height, bool ragged); + vector line_details (vsize start, vsize end, Line_division const &div); + Page_spacing_result space_systems_on_1_page (vector const &lines, Real page_height, bool ragged); Page_spacing_result space_systems_on_2_pages (vsize configuration_index, vsize first_page_num); Page_spacing_result finalize_spacing_result (vsize configuration_index, Page_spacing_result); void create_system_list (); diff --git a/lily/include/page-layout-problem.hh b/lily/include/page-layout-problem.hh index f2b5d6a961..a98d264354 100644 --- a/lily/include/page-layout-problem.hh +++ b/lily/include/page-layout-problem.hh @@ -37,7 +37,7 @@ public: static bool read_spacing_spec (SCM spec, Real *dest, SCM sym); static bool is_spaceable (Grob *g); static SCM get_details (Grob *g); - static std::vector get_footnote_grobs (SCM lines); + static vector get_footnote_grobs (SCM lines); static vsize get_footnote_count (SCM lines); static SCM get_footnotes_from_lines (SCM lines); static void add_footnotes_to_lines (SCM lines, int counter, Paper_book *pb); @@ -52,24 +52,24 @@ protected: void solve_rod_spring_problem (bool ragged, Real fixed_force); SCM find_system_offsets (); - void distribute_loose_lines (std::vector const &, std::vector const &, Real, Real); + void distribute_loose_lines (vector const &, vector const &, Real, Real); - static void build_system_skyline (std::vector const &, std::vector const &, Skyline *up, Skyline *down); - static std::vector filter_dead_elements (std::vector const &); + static void build_system_skyline (vector const &, vector const &, Skyline *up, Skyline *down); + static vector filter_dead_elements (vector const &); // This is a union (in spirit). // Either staves must be empty or prob must be null. typedef struct Element { Prob *prob; - std::vector staves; - std::vector min_offsets; + vector staves; + vector min_offsets; // Store the appropriate '*-*-spacing 'padding, and skyline-distance, // considering indentation, from the previous system. Real min_distance; Real padding; - Element (std::vector const &a, std::vector const &o, Real m, Real p) + Element (vector const &a, vector const &o, Real m, Real p) { staves = a; min_offsets = o; @@ -93,9 +93,9 @@ protected: static void alter_spring_from_spacing_spec (SCM spec, Spring *spring); static void mark_as_spaceable (Grob *); - std::vector springs_; - std::vector elements_; - std::vector solution_; + vector springs_; + vector elements_; + vector solution_; Real force_; Skyline bottom_skyline_; Real bottom_loose_baseline_; diff --git a/lily/include/page-spacing-result.hh b/lily/include/page-spacing-result.hh index 31c157141f..ccba917b07 100644 --- a/lily/include/page-spacing-result.hh +++ b/lily/include/page-spacing-result.hh @@ -36,8 +36,8 @@ typedef enum struct Page_spacing_result { - std::vector systems_per_page_; - std::vector force_; + vector systems_per_page_; + vector force_; Real penalty_; Real demerits_; int system_count_status_; diff --git a/lily/include/page-spacing.hh b/lily/include/page-spacing.hh index 60b95530ba..4775baf674 100644 --- a/lily/include/page-spacing.hh +++ b/lily/include/page-spacing.hh @@ -50,7 +50,7 @@ const Real TERRIBLE_SPACING_PENALTY = 1e8; class Page_spacer { public: - Page_spacer (std::vector const &lines, vsize first_page_num, Page_breaking const *); + Page_spacer (vector const &lines, vsize first_page_num, Page_breaking const *); Page_spacing_result solve (vsize page_count); Page_spacing_result solve (); @@ -77,14 +77,14 @@ private: Page_breaking const *breaker_; vsize first_page_num_; - std::vector lines_; + vector lines_; // If a page-count is requested, we use state_, which // is indexed by page*system, for our dynamic programming // intermediate storage. Otherwise, we use simple_state_, // which is indexed only by system. Matrix state_; - std::vector simple_state_; + vector simple_state_; vsize max_page_count_; bool ragged_; diff --git a/lily/include/page-turn-page-breaking.hh b/lily/include/page-turn-page-breaking.hh index 061ef8a0bf..93fdaceada 100644 --- a/lily/include/page-turn-page-breaking.hh +++ b/lily/include/page-turn-page-breaking.hh @@ -47,7 +47,7 @@ protected: vsize break_pos_; /* index into breaks_ */ Line_division div_; - std::vector system_count_; /* systems per page */ + vector system_count_; /* systems per page */ Break_node () { @@ -59,7 +59,7 @@ protected: } }; - std::vector state_; + vector state_; vsize total_page_count (Break_node const &b); Break_node put_systems_on_pages (vsize start, @@ -67,8 +67,8 @@ protected: vsize configuration, vsize page_number); - SCM make_lines (std::vector *breaks); - SCM make_pages (std::vector const &breaks, SCM systems); + SCM make_lines (vector *breaks); + SCM make_pages (vector const &breaks, SCM systems); void calc_subproblem (vsize i); void print_break_node (Break_node const &b); diff --git a/lily/include/pango-font.hh b/lily/include/pango-font.hh index 58f5a884f5..ff5e6302f0 100644 --- a/lily/include/pango-font.hh +++ b/lily/include/pango-font.hh @@ -46,11 +46,11 @@ public: Real); ~Pango_font (); - std::string description_string () const; + string description_string () const; SCM font_file_name () const; - void register_font_file (const std::string &filename, const std::string &ps_name, int face_index); + void register_font_file (const string &filename, const string &ps_name, int face_index); - size_t name_to_index (std::string) const; + size_t name_to_index (string) const; SCM get_glyph_outline (size_t signed_idx) const; Box get_glyph_outline_bbox (size_t signed_idx) const; Box get_unscaled_indexed_char_dimensions (size_t) const; @@ -59,7 +59,7 @@ public: Stencil pango_item_string_stencil (PangoGlyphItem const *) const; virtual Stencil text_stencil (Output_def *output_state, - const std::string &text, bool music) const; + const string &text, bool music) const; virtual void derived_mark () const; }; diff --git a/lily/include/paper-column-engraver.hh b/lily/include/paper-column-engraver.hh index 9274988e05..1279ff17c9 100644 --- a/lily/include/paper-column-engraver.hh +++ b/lily/include/paper-column-engraver.hh @@ -50,12 +50,12 @@ protected: DECLARE_ACKNOWLEDGER (staff_spacing); System *system_; - std::vector break_events_; - std::vector label_events_; + vector break_events_; + vector label_events_; int breaks_; // used for stat printing Paper_column *command_column_; Paper_column *musical_column_; - std::vector items_; + vector items_; bool first_; bool made_columns_; Moment last_moment_; diff --git a/lily/include/paper-outputter.hh b/lily/include/paper-outputter.hh index 33a5f0ec40..cd1a5e2c92 100644 --- a/lily/include/paper-outputter.hh +++ b/lily/include/paper-outputter.hh @@ -37,11 +37,11 @@ public: virtual ~Paper_outputter (); private: SCM output_module_; - std::string file_name_; + string file_name_; SCM file_; public: - Paper_outputter (SCM port, const std::string &format); + Paper_outputter (SCM port, const string &format); void close (); SCM dump_string (SCM); diff --git a/lily/include/paper-score.hh b/lily/include/paper-score.hh index 3a73bad210..3d4d5840e1 100644 --- a/lily/include/paper-score.hh +++ b/lily/include/paper-score.hh @@ -31,9 +31,9 @@ class Paper_score : public Music_output SCM systems_; SCM paper_systems_; - mutable std::vector cols_; - mutable std::vector break_indices_; - mutable std::vector break_ranks_; + mutable vector cols_; + mutable vector break_indices_; + mutable vector break_ranks_; public: Paper_score (Output_def *); @@ -43,10 +43,10 @@ public: System *root_system () const; void typeset_system (System *); - std::vector calc_breaking (); - std::vector get_break_indices () const; - std::vector get_break_ranks () const; - std::vector get_columns () const; + vector calc_breaking (); + vector get_break_indices () const; + vector get_break_ranks () const; + vector get_columns () const; SCM get_paper_systems (); protected: void find_break_indices () const; diff --git a/lily/include/performance.hh b/lily/include/performance.hh index d70ff03385..f9c53ff2e8 100644 --- a/lily/include/performance.hh +++ b/lily/include/performance.hh @@ -39,14 +39,14 @@ public: void add_element (Audio_element *p); virtual void process (); void remap_grace_durations (); - void output (Midi_stream &midi_stream, const std::string &performance_name) const; + void output (Midi_stream &midi_stream, const string &performance_name) const; void output_header_track (Midi_stream &midi_stream) const; void print () const; - void write_output (std::string filename, const std::string &performance_name) const; + void write_output (string filename, const string &performance_name) const; - std::vector audio_staffs_; - std::vector audio_elements_; + vector audio_staffs_; + vector audio_elements_; Output_def *midi_; bool ports_; SCM header_; diff --git a/lily/include/performer-group.hh b/lily/include/performer-group.hh index bc65491079..350af84de2 100644 --- a/lily/include/performer-group.hh +++ b/lily/include/performer-group.hh @@ -35,7 +35,7 @@ public: virtual void announce_element (Audio_element_info); protected: - std::vector announce_infos_; + vector announce_infos_; virtual void acknowledge_audio_elements (); }; diff --git a/lily/include/pitch.hh b/lily/include/pitch.hh index 8ba72b3701..daade82e81 100644 --- a/lily/include/pitch.hh +++ b/lily/include/pitch.hh @@ -72,7 +72,7 @@ public: int rounded_semitone_pitch () const; int rounded_quartertone_pitch () const; Pitch negated () const; - std::string to_string () const; + string to_string () const; DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b)); }; diff --git a/lily/include/pointer-group-interface.hh b/lily/include/pointer-group-interface.hh index c457250181..26ff640610 100644 --- a/lily/include/pointer-group-interface.hh +++ b/lily/include/pointer-group-interface.hh @@ -36,8 +36,8 @@ public: static Grob *find_grob (Grob *, SCM, bool (*pred) (Grob *)); }; -std::vector const &internal_extract_grob_array (Grob const *elt, SCM symbol); -std::vector internal_extract_item_array (Grob const *elt, SCM symbol); +vector const &internal_extract_grob_array (Grob const *elt, SCM symbol); +vector internal_extract_item_array (Grob const *elt, SCM symbol); #define extract_grob_array(x, prop) internal_extract_grob_array (x, ly_symbol2scm (prop)) #define extract_item_array(x, prop) internal_extract_item_array (x, ly_symbol2scm (prop)) @@ -47,9 +47,9 @@ std::vector internal_extract_item_array (Grob const *elt, SCM symbol); representation of grob sets again. */ #define extract_grob_set(grob, prop, set) \ - std::vector const &set (internal_extract_grob_array (grob, ly_symbol2scm (prop))) + vector const &set (internal_extract_grob_array (grob, ly_symbol2scm (prop))) #define extract_item_set(grob, prop, set) \ - std::vector set (internal_extract_item_array (grob, ly_symbol2scm (prop))) + vector set (internal_extract_item_array (grob, ly_symbol2scm (prop))) #endif /* POINTER_GROUP_INTERFACE_HH */ diff --git a/lily/include/prob.hh b/lily/include/prob.hh index bcdb125098..7a06e47737 100644 --- a/lily/include/prob.hh +++ b/lily/include/prob.hh @@ -55,7 +55,7 @@ protected: public: Prob (SCM, SCM); Prob (Prob const &); - virtual std::string name () const; + virtual string name () const; SCM type () const { return type_; } SCM get_property_alist (bool _mutable) const; SCM internal_get_property (SCM sym) const; diff --git a/lily/include/program-option.hh b/lily/include/program-option.hh index c5e8e1ca69..acf1a93b5c 100644 --- a/lily/include/program-option.hh +++ b/lily/include/program-option.hh @@ -27,6 +27,6 @@ SCM ly_get_option (SCM); SCM ly_set_option (SCM, SCM); bool get_program_option (const char *); -std::string get_output_backend_name (); +string get_output_backend_name (); #endif /* SCM_OPTION_HH */ diff --git a/lily/include/relocate.hh b/lily/include/relocate.hh index 6f93d10491..c531d97cfb 100644 --- a/lily/include/relocate.hh +++ b/lily/include/relocate.hh @@ -22,11 +22,11 @@ #include "std-string.hh" -void read_relocation_dir (const std::string &dirname); -void read_relocation_file (const std::string &filename); -std::string expand_environment_variables (const std::string &orig); +void read_relocation_dir (const string &dirname); +void read_relocation_file (const string &filename); +string expand_environment_variables (const string &orig); -int sane_putenv (char const *key, const std::string &value, bool overwrite); +int sane_putenv (char const *key, const string &value, bool overwrite); void setup_paths (char const *argv0); extern bool relocate_binary; diff --git a/lily/include/rest.hh b/lily/include/rest.hh index 9235f746ce..644aa1450c 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -29,7 +29,7 @@ class Rest public: DECLARE_SCHEME_CALLBACK (y_offset_callback, (SCM)); DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM)); - static std::string glyph_name (Grob *, int durlog, const std::string &style, bool, Real); + static string glyph_name (Grob *, int durlog, const string &style, bool, Real); static Real staff_position_internal (Grob *, int /* duration_log */, int /* dir */); static SCM brew_internal_stencil (Grob *, bool); diff --git a/lily/include/scale.hh b/lily/include/scale.hh index 11e9837c2b..19cd175c79 100644 --- a/lily/include/scale.hh +++ b/lily/include/scale.hh @@ -27,7 +27,7 @@ struct Scale : public Smob { virtual ~Scale (); - Scale (std::vector const &); + Scale (vector const &); Scale (Scale const &); Rational tones_at_step (int step, int octave) const; @@ -37,7 +37,7 @@ struct Scale : public Smob private: - std::vector step_tones_; + vector step_tones_; }; extern Scale *default_global_scale; diff --git a/lily/include/score-engraver.hh b/lily/include/score-engraver.hh index 86bbad2500..9b7927ddab 100644 --- a/lily/include/score-engraver.hh +++ b/lily/include/score-engraver.hh @@ -26,7 +26,7 @@ class Score_engraver : public Engraver_group { System *system_; - std::vector elems_; + vector elems_; Paper_score *pscore_; void typeset_all (); diff --git a/lily/include/score.hh b/lily/include/score.hh index d1659a0622..b3ece8960a 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -40,7 +40,7 @@ private: public: Input *origin () const; - std::vector defs_; + vector defs_; bool error_found_; Score (); diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh index a5942a9698..fe4816eae1 100644 --- a/lily/include/script-column.hh +++ b/lily/include/script-column.hh @@ -30,7 +30,7 @@ public: static void add_side_positioned (Grob *, Grob *); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM)); DECLARE_SCHEME_CALLBACK (row_before_line_breaking, (SCM)); - static void order_grobs (std::vector grobs); + static void order_grobs (vector grobs); }; diff --git a/lily/include/separation-item.hh b/lily/include/separation-item.hh index bb365b2ff6..81ea523fe2 100644 --- a/lily/include/separation-item.hh +++ b/lily/include/separation-item.hh @@ -30,7 +30,7 @@ struct Separation_item DECLARE_SCHEME_CALLBACK (calc_skylines, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); - static std::vector boxes (Grob *me, Grob *left); + static vector boxes (Grob *me, Grob *left); static Skyline conditional_skyline (Grob *, Grob *); static Grob *extremal_break_aligned_grob (Grob *, Direction, Interval *); static Real set_distance (Item *left, Item *right, Real padding); diff --git a/lily/include/simple-spacer.hh b/lily/include/simple-spacer.hh index ca709a6133..d036dd191d 100644 --- a/lily/include/simple-spacer.hh +++ b/lily/include/simple-spacer.hh @@ -36,7 +36,7 @@ public: Real range_ideal_len (int l, int r) const; Real range_stiffness (int l, int r, bool stretch) const; Real configuration_length (Real) const; - std::vector spring_positions () const; + vector spring_positions () const; void set_force (Real force); Real force () const; @@ -49,7 +49,7 @@ private: Real compress_line (); Real rod_force (int l, int r, Real dist); - std::vector springs_; + vector springs_; Real line_len_; Real force_; bool ragged_; @@ -57,12 +57,12 @@ private: }; /* returns a vector of dimensions breaks.size () * breaks.size () */ -std::vector get_line_forces (std::vector const &columns, +vector get_line_forces (vector const &columns, Real line_len, Real indent, bool ragged); -Column_x_positions get_line_configuration (std::vector const &columns, +Column_x_positions get_line_configuration (vector const &columns, Real line_len, Real indent, bool ragged); diff --git a/lily/include/skyline-pair.hh b/lily/include/skyline-pair.hh index a174204cd2..6d7cea0ac2 100644 --- a/lily/include/skyline-pair.hh +++ b/lily/include/skyline-pair.hh @@ -31,9 +31,9 @@ private: public: Skyline_pair (); - Skyline_pair (std::vector const &boxes, Axis a); - Skyline_pair (std::vector > const &buildings, Axis a); - Skyline_pair (std::vector const &skypairs); + Skyline_pair (vector const &boxes, Axis a); + Skyline_pair (vector > const &buildings, Axis a); + Skyline_pair (vector const &skypairs); Skyline_pair (Box const &, Axis a); Real left () const; diff --git a/lily/include/skyline.hh b/lily/include/skyline.hh index c8a8a14234..21693420c8 100644 --- a/lily/include/skyline.hh +++ b/lily/include/skyline.hh @@ -53,12 +53,12 @@ class Skyline : public Simple_smob public: static const char type_p_name_[]; private: - std::list buildings_; + list buildings_; Direction sky_; - void internal_merge_skyline (std::list *, std::list *, - std::list *result) const; - std::list internal_build_skyline (std::list *) const; + void internal_merge_skyline (list *, list *, + list *result) const; + list internal_build_skyline (list *) const; Real internal_distance (Skyline const &, Real horizon_padding, Real *touch_point) const; Real internal_distance (Skyline const &, Real *touch_point) const; void normalize (); @@ -67,12 +67,12 @@ private: public: Skyline (); Skyline (Direction sky); - Skyline (std::vector const &bldgs, Axis a, Direction sky); - Skyline (std::vector > const &bldgs, Axis a, Direction sky); - Skyline (std::vector const &skypairs, Direction sky); + Skyline (vector const &bldgs, Axis a, Direction sky); + Skyline (vector > const &bldgs, Axis a, Direction sky); + Skyline (vector const &skypairs, Direction sky); Skyline (Box const &b, Axis a, Direction sky); - std::vector to_points (Axis) const; + vector to_points (Axis) const; void merge (Skyline const &); void insert (Box const &, Axis); void print () const; diff --git a/lily/include/slur-configuration.hh b/lily/include/slur-configuration.hh index c0ae07fd57..be30352676 100644 --- a/lily/include/slur-configuration.hh +++ b/lily/include/slur-configuration.hh @@ -27,7 +27,7 @@ class Slur_configuration { Real score_; - std::string score_card_; + string score_card_; public: Drul_array attachment_; @@ -50,11 +50,11 @@ public: Slur_configuration (); Real score () const { return score_; } - std::string card () const { return score_card_; } - void add_score (Real, const std::string&); + string card () const { return score_card_; } + void add_score (Real, const string&); void generate_curve (Slur_score_state const &state, Real r0, Real h_inf, - std::vector const &); + vector const &); void run_next_scorer (Slur_score_state const &); bool done () const; static Slur_configuration *new_config (Drul_array const &offs, int idx); diff --git a/lily/include/slur-proto-engraver.hh b/lily/include/slur-proto-engraver.hh index 06eed9d7dd..c11926b21a 100644 --- a/lily/include/slur-proto-engraver.hh +++ b/lily/include/slur-proto-engraver.hh @@ -40,14 +40,14 @@ protected: { } }; // protected so that subclasses can see them - std::vector start_events_; - std::vector stop_events_; + vector start_events_; + vector stop_events_; typedef std::multimap Note_slurs; Drul_array note_slurs_; - std::vector slurs_; - std::vector end_slurs_; - std::vector objects_to_acknowledge_; + vector slurs_; + vector end_slurs_; + vector objects_to_acknowledge_; const char* double_property_name_; const char* grob_name_; const char* object_name_; @@ -69,8 +69,8 @@ protected: void stop_translation_timestep (); void process_music (); - bool can_create_slur (const std::string&, vsize, vsize *, Stream_event *); - void create_slur (const std::string &spanner_id, Event_info evi, Grob *g_cause, Direction dir, bool left_broken); + bool can_create_slur (const string&, vsize, vsize *, Stream_event *); + void create_slur (const string &spanner_id, Event_info evi, Grob *g_cause, Direction dir, bool left_broken); bool try_to_end (Event_info evi); virtual void set_melisma (bool); diff --git a/lily/include/slur-scoring.hh b/lily/include/slur-scoring.hh index d516993d55..1ae187477b 100644 --- a/lily/include/slur-scoring.hh +++ b/lily/include/slur-scoring.hh @@ -90,15 +90,15 @@ struct Slur_score_state bool has_same_beam_; Real musical_dy_; - std::vector columns_; - std::vector encompass_infos_; - std::vector extra_encompass_infos_; + vector columns_; + vector encompass_infos_; + vector extra_encompass_infos_; Direction dir_; Slur_score_parameters parameters_; Drul_array extremes_; Drul_array base_attachments_; - std::vector configurations_; + vector configurations_; Real staff_space_; Real line_thickness_; Real thickness_; @@ -111,14 +111,14 @@ struct Slur_score_state void fill (Grob *); Direction slur_direction () const; - std::vector generate_avoid_offsets () const; + vector generate_avoid_offsets () const; Drul_array get_bound_info () const; void generate_curves () const; - std::vector enumerate_attachments (Drul_array end_ys) const; + vector enumerate_attachments (Drul_array end_ys) const; Drul_array get_base_attachments () const; Drul_array get_y_attachment_range () const; Encompass_info get_encompass_info (Grob *col) const; - std::vector get_extra_encompass_infos () const; + vector get_extra_encompass_infos () const; Real move_away_from_staffline (Real y, Grob *on_staff) const; Interval breakable_bound_extent (Direction) const; diff --git a/lily/include/slur.hh b/lily/include/slur.hh index 7656ff26e1..ae85ac24d3 100644 --- a/lily/include/slur.hh +++ b/lily/include/slur.hh @@ -30,7 +30,7 @@ public: static void add_column (Grob *me, Grob *col); static void add_extra_encompass (Grob *me, Grob *col); static void replace_breakable_encompass_objects (Grob *me); - static void auxiliary_acknowledge_extra_object (Grob_info const &, std::vector &, std::vector &); + static void auxiliary_acknowledge_extra_object (Grob_info const &, vector &, vector &); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM)); DECLARE_SCHEME_CALLBACK (calc_direction, (SCM)); diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index 14ee09101c..9ccaa61345 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -120,7 +120,7 @@ debugging purposes. If the class does not define this function, the output will be # when printing. - - a static const type_p_name_[] std::string set to something like + - a static const type_p_name_[] string set to something like "ly:grob?". When provided, an accordingly named function for checking for the given smob type will be available in Scheme. @@ -150,7 +150,7 @@ class Smob_base static scm_t_bits smob_tag_; static Scm_init scm_init_; static void init (void); - static std::string smob_name_; + static string smob_name_; protected: static Super *unchecked_unsmob (SCM s) { @@ -186,9 +186,9 @@ private: static void smob_proc_init (scm_t_bits) { }; // type_p_name_ can be overriden in the Super class with a static - // const char [] std::string. This requires both a declaration in the + // const char [] string. This requires both a declaration in the // class as well as a single instantiation outside. Using a - // template specialization for supplying a different std::string name + // template specialization for supplying a different string name // right in Smob_base itself seems tempting, but the C++ // rules would then require a specialization declaration at the // class definition site as well as a specialization instantiation @@ -330,7 +330,7 @@ public: extern bool parsed_objects_should_be_dead; class parsed_dead { - static std::vector elements; + static vector elements; SCM data; SCM readout_one () { diff --git a/lily/include/smobs.tcc b/lily/include/smobs.tcc index dd815e59db..b8dfc1f67f 100644 --- a/lily/include/smobs.tcc +++ b/lily/include/smobs.tcc @@ -111,7 +111,7 @@ template Scm_init Smob_base::scm_init_ (init); template -std::string Smob_base::smob_name_; +string Smob_base::smob_name_; template void Smob_base::init () @@ -142,7 +142,7 @@ void Smob_base::init () { SCM subr = scm_c_define_gsubr (Super::type_p_name_, 1, 0, 0, (scm_t_subr) smob_p); - std::string fundoc = std::string("Is @var{x} a @code{") + smob_name_ + string fundoc = string("Is @var{x} a @code{") + smob_name_ + "} object?"; ly_add_function_documentation (subr, Super::type_p_name_, "(SCM x)", fundoc); diff --git a/lily/include/source-file.hh b/lily/include/source-file.hh index 46a5947cee..6686389289 100644 --- a/lily/include/source-file.hh +++ b/lily/include/source-file.hh @@ -25,6 +25,7 @@ #include "smobs.hh" #include +using namespace std; /** class for reading and mapping a file. @@ -42,9 +43,9 @@ public: static const char type_p_name_[]; virtual ~Source_file (); private: - std::vector newline_locations_; - std::istream *istream_; - std::vector characters_; + vector newline_locations_; + istream *istream_; + vector characters_; SCM str_port_; void load_stdin (); @@ -52,30 +53,30 @@ private: void init (); public: - Source_file (const std::string &fn); - Source_file (const std::string&, const std::string&); + Source_file (const string &fn); + Source_file (const string&, const string&); char const *c_str () const; - virtual std::string quote_input (char const *pos_str0) const; - std::istream *get_istream (); + virtual string quote_input (char const *pos_str0) const; + istream *get_istream (); bool contains (char const *pos_str0) const; int length () const; virtual int get_line (char const *pos_str0) const; void set_line (char const *pos_str0, int i); - std::string name_string () const; - std::string file_line_column_string (char const *str0) const; + string name_string () const; + string file_line_column_string (char const *str0) const; Slice line_slice (char const *pos_str0) const; - std::string line_string (char const *pos_str0) const; + string line_string (char const *pos_str0) const; void get_counts (char const *pos_str0, int *, int *, int *, int *) const; SCM get_port () const; - std::string name_; + string name_; protected: int line_offset_; }; -std::vector gulp_file (const std::string &fn, int desired); +vector gulp_file (const string &fn, int desired); #endif /* SOURCE_FILE_HH */ diff --git a/lily/include/sources.hh b/lily/include/sources.hh index a4efd7886e..2db87cee97 100644 --- a/lily/include/sources.hh +++ b/lily/include/sources.hh @@ -26,13 +26,13 @@ class Sources { Sources (Sources const &); // Do not define! Not copyable! - std::vector sourcefiles_; + vector sourcefiles_; public: Sources (); ~Sources (); - Source_file *get_file (std::string file_name, std::string const ¤tpath); + Source_file *get_file (string file_name, string const ¤tpath); void add (Source_file *sourcefile); void set_path (File_path *); diff --git a/lily/include/spacing-interface.hh b/lily/include/spacing-interface.hh index 03fb72bc72..ddfe2efb1c 100644 --- a/lily/include/spacing-interface.hh +++ b/lily/include/spacing-interface.hh @@ -25,8 +25,8 @@ struct Spacing_interface { static Real minimum_distance (Grob *me, Grob *right_col); - static std::vector right_note_columns (Grob *me); - static std::vector left_note_columns (Grob *me); + static vector right_note_columns (Grob *me); + static vector left_note_columns (Grob *me); static Item *right_column (Grob *me); static Item *left_column (Grob *me); static Drul_array skylines (Grob *me, Grob *right_col); diff --git a/lily/include/spacing-spanner.hh b/lily/include/spacing-spanner.hh index d24b6008ec..fcfba90417 100644 --- a/lily/include/spacing-spanner.hh +++ b/lily/include/spacing-spanner.hh @@ -35,16 +35,16 @@ private: Paper_column *nextr, Spacing_options const *options); static Real default_bar_spacing (Grob *, Grob *, Grob *, Moment); - static Rational effective_shortest_duration (Grob *me, std::vector const &all); + static Rational effective_shortest_duration (Grob *me, vector const &all); static void breakable_column_spacing (Grob *, Item *l, Item *r, Spacing_options const *); - static void prune_loose_columns (Grob *, std::vector *cols, Spacing_options *); - static void set_explicit_neighbor_columns (std::vector const &cols); - static void set_implicit_neighbor_columns (std::vector const &cols); - static void generate_springs (Grob *me, std::vector const &cols, Spacing_options const *); + static void prune_loose_columns (Grob *, vector *cols, Spacing_options *); + static void set_explicit_neighbor_columns (vector const &cols); + static void set_implicit_neighbor_columns (vector const &cols); + static void generate_springs (Grob *me, vector const &cols, Spacing_options const *); static void musical_column_spacing (Grob *, Item *, Item *, Spacing_options const *); static bool fills_measure (Grob *, Item *, Item *); public: - static std::vector get_columns (Grob *me); + static vector get_columns (Grob *me); static Spring note_spacing (Grob *, Grob *, Grob *, Spacing_options const *); static Spring standard_breakable_column_spacing (Grob *me, Item *l, Item *r, Spacing_options const *); diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index 72b295232d..79032dfb30 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -52,7 +52,7 @@ public: DECLARE_SCHEME_CALLBACK (bounds_width, (SCM)); DECLARE_SCHEME_CALLBACK (kill_zero_spanned_time, (SCM)); - std::vector broken_intos_; + vector broken_intos_; vsize get_break_index () const; Spanner *broken_neighbor (Direction d) const; diff --git a/lily/include/spring.hh b/lily/include/spring.hh index 9c6c418279..fd01ca048c 100644 --- a/lily/include/spring.hh +++ b/lily/include/spring.hh @@ -65,6 +65,6 @@ public: bool operator > (Spring const &) const; }; -Spring merge_springs (std::vector const &springs); +Spring merge_springs (vector const &springs); #endif /* SPRING_HH */ diff --git a/lily/include/staff-symbol.hh b/lily/include/staff-symbol.hh index c86fb4ae31..9454ebe7f4 100644 --- a/lily/include/staff-symbol.hh +++ b/lily/include/staff-symbol.hh @@ -33,8 +33,8 @@ public: static Real get_line_thickness (Grob *); static Real get_ledger_line_thickness (Grob *); - static std::vector line_positions (Grob *); - static std::vector ledger_positions (Grob *me, int pos); + static vector line_positions (Grob *); + static vector ledger_positions (Grob *me, int pos); static int line_count (Grob *); static bool on_line (Grob *me, int pos, bool allow_ledger = true); static Interval line_span (Grob *); diff --git a/lily/include/stem.hh b/lily/include/stem.hh index ab325d427a..7c4612552a 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -28,7 +28,7 @@ class Stem { public: - static std::vector note_head_positions (Grob *, bool filter = false); + static vector note_head_positions (Grob *, bool filter = false); static int duration_log (Grob *); static void set_beaming (Grob *, int, Direction d); static int get_beaming (Grob *, Direction d); diff --git a/lily/include/stencil.hh b/lily/include/stencil.hh index 543aafcc92..6ccb9252bb 100644 --- a/lily/include/stencil.hh +++ b/lily/include/stencil.hh @@ -20,6 +20,7 @@ #define STENCIL_HH #include // size_t +using namespace std; #include "lily-proto.hh" #include "box.hh" diff --git a/lily/include/system.hh b/lily/include/system.hh index 387cbfd71e..4e402ffeca 100644 --- a/lily/include/system.hh +++ b/lily/include/system.hh @@ -44,10 +44,10 @@ public: Grob *get_pure_bound (Direction dir, int start, int end); Grob *get_maybe_pure_bound (Direction dir, bool pure, int start, int end); int get_rank () const; - std::vector get_footnote_heights_in_range (vsize st, vsize end); - std::vector get_in_note_heights_in_range (vsize st, vsize end); - std::vector internal_get_note_heights_in_range (vsize st, vsize end, bool foot); - std::vector get_footnote_grobs_in_range (vsize st, vsize end); + vector get_footnote_heights_in_range (vsize st, vsize end); + vector get_in_note_heights_in_range (vsize st, vsize end); + vector internal_get_note_heights_in_range (vsize st, vsize end, bool foot); + vector get_footnote_grobs_in_range (vsize st, vsize end); vsize num_footnotes (); void do_break_substitution_and_fixup_refpoints (); void post_processing (); @@ -73,10 +73,10 @@ public: int element_count () const; int spanner_count () const; - void break_into_pieces (std::vector const &); + void break_into_pieces (vector const &); - std::vector broken_col_range (Item const *, Item const *) const; - std::vector used_columns () const; + vector broken_col_range (Item const *, Item const *) const; + vector used_columns () const; Paper_column *column (vsize i) const; void add_column (Paper_column *); diff --git a/lily/include/tie-configuration.hh b/lily/include/tie-configuration.hh index 93f575ca52..aaf0746a4a 100644 --- a/lily/include/tie-configuration.hh +++ b/lily/include/tie-configuration.hh @@ -28,7 +28,7 @@ class Tie_configuration { #if DEBUG_SLUR_SCORING - std::string score_card_; + string score_card_; #endif Real score_; bool scored_; @@ -36,7 +36,7 @@ class Tie_configuration public: Real score () const { return score_; } - std::string card () const { return score_card_; } + string card () const { return score_card_; } int position_; Direction dir_; @@ -46,7 +46,7 @@ public: /* computed. */ Interval attachment_x_; - void add_score (Real, const std::string&); + void add_score (Real, const string&); Tie_configuration (); void center_tie_vertically (Tie_details const &); Bezier get_transformed_bezier (Tie_details const &) const; @@ -62,24 +62,24 @@ public: INSTANTIATE_COMPARE (Tie_configuration, Tie_configuration::compare); -class Ties_configuration : public std::vector +class Ties_configuration : public vector { Real score_; - std::string score_card_; + string score_card_; bool scored_; - std::vector tie_score_cards_; + vector tie_score_cards_; friend class Tie_formatting_problem; public: Ties_configuration (); - void add_score (Real amount, const std::string &description); - void add_tie_score (Real amount, int i, const std::string &description); + void add_score (Real amount, const string &description); + void add_tie_score (Real amount, int i, const string &description); Real score () const; void reset_score (); - std::string card () const; - std::string tie_card (int i) const { return tie_score_cards_[i]; } - std::string complete_tie_card (vsize i) const; - std::string complete_score_card () const; + string card () const; + string tie_card (int i) const { return tie_score_cards_[i]; } + string complete_tie_card (vsize i) const; + string complete_score_card () const; }; #endif /* TIE_CONFIGURATION_HH */ diff --git a/lily/include/tie-formatting-problem.hh b/lily/include/tie-formatting-problem.hh index 14376a9ef0..2d3ce617b4 100644 --- a/lily/include/tie-formatting-problem.hh +++ b/lily/include/tie-formatting-problem.hh @@ -30,20 +30,20 @@ #include #include -typedef std::map< Tuple, Tie_configuration *> Tie_configuration_map; +typedef map< Tuple, Tie_configuration *> Tie_configuration_map; struct Tie_configuration_variation { - std::vector > index_suggestion_pairs_; + vector > index_suggestion_pairs_; void add_suggestion (int index, Tie_configuration *suggestion) { - index_suggestion_pairs_.push_back (std::make_pair (index, suggestion)); + index_suggestion_pairs_.push_back (make_pair (index, suggestion)); } }; -typedef std::map < Tuple, Skyline> Chord_outline_map; -typedef std::map < Tuple, Box> Column_extent_map; -typedef std::map Position_extent_map; +typedef map < Tuple, Skyline> Chord_outline_map; +typedef map < Tuple, Box> Column_extent_map; +typedef map Position_extent_map; class Tie_formatting_problem { @@ -52,9 +52,9 @@ class Tie_formatting_problem Column_extent_map head_extents_; Position_extent_map head_positions_; - std::set dot_positions_; + set dot_positions_; Interval dot_x_; - std::vector specifications_; + vector specifications_; bool use_horizontal_spacing_; Tie_configuration_map possibilities_; @@ -65,9 +65,9 @@ class Tie_formatting_problem Tie_configuration *get_configuration (int position, Direction dir, Drul_array cols, bool tune_y) const; Tie_configuration *generate_configuration (int position, Direction dir, Drul_array cols, bool tune_y) const; - std::vector generate_collision_variations (Ties_configuration const &ties) const; - std::vector generate_extremal_tie_variations (Ties_configuration const &ties) const; - std::vector generate_single_tie_variations (Ties_configuration const &ties) const; + vector generate_collision_variations (Ties_configuration const &ties) const; + vector generate_extremal_tie_variations (Ties_configuration const &ties) const; + vector generate_single_tie_variations (Ties_configuration const &ties) const; void score_configuration (Tie_configuration *) const; Real score_aptitude (Tie_configuration *, Tie_specification const &, @@ -80,7 +80,7 @@ class Tie_formatting_problem Slice head_positions_slice (int) const; Ties_configuration generate_base_chord_configuration (); Ties_configuration find_best_variation (Ties_configuration const &base, - std::vector const &vars); + vector const &vars); public: Tie_details details_; @@ -97,11 +97,11 @@ public: Ties_configuration generate_optimal_configuration (); Ties_configuration generate_ties_configuration (Ties_configuration const &); - void from_ties (std::vector const &ties); + void from_ties (vector const &ties); void from_tie (Grob *tie); - void from_semi_ties (std::vector const &, Direction head_dir); - void set_chord_outline (std::vector, Direction); - void set_column_chord_outline (std::vector, Direction, int rank); + void from_semi_ties (vector const &, Direction head_dir); + void set_chord_outline (vector, Direction); + void set_column_chord_outline (vector, Direction, int rank); void set_manual_tie_configuration (SCM); Interval get_attachment (Real, Drul_array) const; Grob *common_x_refpoint () const; diff --git a/lily/include/translator-dispatch-list.hh b/lily/include/translator-dispatch-list.hh index 29f7ff16c7..6c365d088e 100644 --- a/lily/include/translator-dispatch-list.hh +++ b/lily/include/translator-dispatch-list.hh @@ -33,7 +33,7 @@ struct Engraver_dispatch_entry class Engraver_dispatch_list : public Simple_smob { - std::vector dispatch_entries_; + vector dispatch_entries_; public: void apply (Grob_info); SCM static create (SCM trans_list, diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index a2c6f8de2d..d90c2929de 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -56,7 +56,7 @@ public: virtual ~Translator_group (); private: void precompute_method_bindings (); - std::vector + vector precomputed_method_bindings_[TRANSLATOR_METHOD_PRECOMPUTE_COUNT]; Translator_group_void_method diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 78a4691742..8154409efc 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -33,7 +33,7 @@ NAME (); \ VIRTUAL_COPY_CONSTRUCTOR (Translator, NAME); \ static SCM static_description_; \ - static Drul_array > acknowledge_static_array_drul_; \ + static Drul_array > acknowledge_static_array_drul_; \ virtual void fetch_precomputable_methods (Callback methods[]); \ virtual SCM static_translator_description () const; \ virtual SCM translator_description () const; \ diff --git a/lily/include/translator.icc b/lily/include/translator.icc index 827908901d..7fc128fe72 100644 --- a/lily/include/translator.icc +++ b/lily/include/translator.icc @@ -52,7 +52,7 @@ /* end define */ #define DEFINE_ACKNOWLEDGERS(classname) \ - Drul_array< std::vector > classname::acknowledge_static_array_drul_; \ + Drul_array< vector > classname::acknowledge_static_array_drul_; \ Translator::Grob_info_callback \ classname::static_get_acknowledger (SCM sym) \ { \ @@ -107,11 +107,11 @@ void add_acknowledger (Translator::Grob_info_callback ptr, char const *func_name, - std::vector *ack_array); + vector *ack_array); Translator::Grob_info_callback generic_get_acknowledger (SCM sym, - std::vector const *ack_array); + vector const *ack_array); #define ADD_ACKNOWLEDGER(CLASS, NAME) \ void CLASS ## NAME ## _ack_adder () \ diff --git a/lily/include/tuplet-bracket.hh b/lily/include/tuplet-bracket.hh index c34a78c0a4..1e41154fbf 100644 --- a/lily/include/tuplet-bracket.hh +++ b/lily/include/tuplet-bracket.hh @@ -40,7 +40,7 @@ public: static void add_column (Grob *me, Item *); static void add_script (Grob *me, Item *); static void add_beam (Grob *me, Grob *); - static Grob *parallel_beam (Grob *me, std::vector const &cols, + static Grob *parallel_beam (Grob *me, vector const &cols, bool *equally_long); static void calc_position_and_height (Grob *, Real *, Real *dy); static Stencil make_bracket (Grob *me, Axis protrusion_axis, diff --git a/lily/include/tuplet-number.hh b/lily/include/tuplet-number.hh index 82bb9a9110..24ba77a377 100644 --- a/lily/include/tuplet-number.hh +++ b/lily/include/tuplet-number.hh @@ -33,7 +33,7 @@ struct Tuplet_number static Real calc_offset (Spanner *me, Axis a); // not used - static Grob *select_reference_stem (Grob *me, std::vector const &cols); + static Grob *select_reference_stem (Grob *me, vector const &cols); static Drul_array adjacent_note_columns (Grob *me, Grob *ref_stem); static bool knee_position_against_beam (Grob *me, Grob *ref_stem); }; diff --git a/lily/input.cc b/lily/input.cc index 19f6ac019e..74b7a61b32 100644 --- a/lily/input.cc +++ b/lily/input.cc @@ -20,6 +20,7 @@ #include "input.hh" #include +using namespace std; #include "international.hh" #include "lily-imports.hh" diff --git a/lily/keyword.cc b/lily/keyword.cc index 4eb7c83594..b5f7947ada 100644 --- a/lily/keyword.cc +++ b/lily/keyword.cc @@ -6,6 +6,7 @@ #include #include +using namespace std; /* for qsort */ bool tab_less (Keyword_ent const &p1, Keyword_ent const &p2) diff --git a/lily/ledger-line-spanner.cc b/lily/ledger-line-spanner.cc index 4849cdfee5..7463f676e9 100644 --- a/lily/ledger-line-spanner.cc +++ b/lily/ledger-line-spanner.cc @@ -18,6 +18,7 @@ */ #include +using namespace std; #include "note-head.hh" #include "staff-symbol-referencer.hh" @@ -131,7 +132,7 @@ Ledger_line_spanner::set_spacing_rods (SCM smob) continue; current_extents[vdir].unite (head_extent); - current_head_width = std::max (current_head_width, head_extent.length ()); + current_head_width = max (current_head_width, head_extent.length ()); } if (previous_column && current_column) @@ -216,7 +217,7 @@ Ledger_line_spanner::print (SCM smob) reqs[rank][vdir].ledger_extent_.unite (ledger_extent); reqs[rank][vdir].head_extent_.unite (head_extent); reqs[rank][vdir].position_ - = vdir * std::max (vdir * reqs[rank][vdir].position_, vdir * pos); + = vdir * max (vdir * reqs[rank][vdir].position_, vdir * pos); } } @@ -251,7 +252,7 @@ Ledger_line_spanner::print (SCM smob) - sign (i->second[d].position_))); Real limit = (center + (both ? which * gap / 2 : 0)); lr.ledger_extent_.at (-which) - = which * std::max (which * lr.ledger_extent_[-which], which * limit); + = which * max (which * lr.ledger_extent_[-which], which * limit); } } } @@ -296,7 +297,7 @@ Ledger_line_spanner::print (SCM smob) head_size[LEFT]), 0.0); - Real left_shorten = std::max (-ledger_size[LEFT] + d, 0.0); + Real left_shorten = max (-ledger_size[LEFT] + d, 0.0); x_extent[LEFT] += left_shorten; /* diff --git a/lily/lexer.ll b/lily/lexer.ll index 82c1e9ac8b..870c466d16 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -51,6 +51,7 @@ #define LEXER_CC #include +using namespace std; #include "context-def.hh" #include "duration.hh" diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 3c033d70f5..5a54e864dd 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -25,6 +25,7 @@ #include /* strdup, strchr */ #include +using namespace std; #include "dimensions.hh" #include "direction.hh" diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index 7cfec596c8..c58885a895 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -21,6 +21,7 @@ #include #include +using namespace std; #include "context.hh" // for nested_property_alist #include "international.hh" diff --git a/lily/line-interface.cc b/lily/line-interface.cc index c12019ce01..0aeec91540 100644 --- a/lily/line-interface.cc +++ b/lily/line-interface.cc @@ -124,9 +124,9 @@ Stencil Line_interface::make_dashed_line (Real thick, Offset from, Offset to, Real dash_period, Real dash_fraction) { - dash_fraction = std::min (std::max (dash_fraction, 0.0), 1.0); + dash_fraction = min (max (dash_fraction, 0.0), 1.0); Real on = dash_fraction * dash_period + thick; - Real off = std::max (0.0, dash_period - on); + Real off = max (0.0, dash_period - on); SCM at = scm_list_n (ly_symbol2scm ("dashed-line"), scm_from_double (thick), @@ -220,7 +220,7 @@ Line_interface::line (Grob *me, Offset from, Offset to) ? 0.0 : robust_scm2double (me->get_property ("dash-fraction"), 0.4); - fraction = std::min (std::max (fraction, 0.0), 1.0); + fraction = min (max (fraction, 0.0), 1.0); Real period = Staff_symbol_referencer::staff_space (me) * robust_scm2double (me->get_property ("dash-period"), 1.0); @@ -230,7 +230,7 @@ Line_interface::line (Grob *me, Offset from, Offset to) Real len = (to - from).length (); int n = (int) rint ((len - period * fraction) / period); - n = std::max (0, n); + n = max (0, n); if (n > 0) { /* diff --git a/lily/lookup.cc b/lily/lookup.cc index 5678c35b57..c88e37700f 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -23,6 +23,7 @@ #include #include +using namespace std; #include "line-interface.hh" #include "warn.hh" @@ -169,9 +170,9 @@ Stencil Lookup::round_filled_box (Box b, Real blotdiameter) { Real width = b.x ().delta (); - blotdiameter = std::min (blotdiameter, width); + blotdiameter = min (blotdiameter, width); Real height = b.y ().delta (); - blotdiameter = std::min (blotdiameter, height); + blotdiameter = min (blotdiameter, height); if (blotdiameter < 0.0) { @@ -608,7 +609,7 @@ Lookup::triangle (Interval iv, Real thick, Real protrude) { Box b; b[X_AXIS] = Interval (0, iv.length ()); - b[Y_AXIS] = Interval (std::min (0., protrude), std::max (0.0, protrude)); + b[Y_AXIS] = Interval (min (0., protrude), max (0.0, protrude)); vector points; points.push_back (Offset (iv[LEFT], 0)); diff --git a/lily/lyric-combine-music-iterator.cc b/lily/lyric-combine-music-iterator.cc index 38d9333684..6e8c617ef4 100644 --- a/lily/lyric-combine-music-iterator.cc +++ b/lily/lyric-combine-music-iterator.cc @@ -103,7 +103,7 @@ Lyric_combine_music_iterator::set_busy (SCM se) if ((e->in_event_class ("note-event") || e->in_event_class ("cluster-note-event")) && music_context_) - busy_moment_ = std::max (music_context_->now_mom (), + busy_moment_ = max (music_context_->now_mom (), busy_moment_); } diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc index bb841e4140..8afe2c5569 100644 --- a/lily/lyric-extender.cc +++ b/lily/lyric-extender.cc @@ -70,21 +70,21 @@ Lyric_extender::print (SCM smob) Real right_point = left_point + (robust_scm2double (minlen, 0)); - right_point = std::min (right_point, me->get_system ()->get_bound (RIGHT)->relative_coordinate (common, X_AXIS)); + right_point = min (right_point, me->get_system ()->get_bound (RIGHT)->relative_coordinate (common, X_AXIS)); if (heads.size ()) - right_point = std::max (right_point, heads.back ()->extent (common, X_AXIS)[RIGHT]); + right_point = max (right_point, heads.back ()->extent (common, X_AXIS)[RIGHT]); Real h = sl * robust_scm2double (me->get_property ("thickness"), 0); Drul_array paddings (robust_scm2double (me->get_property ("left-padding"), h), robust_scm2double (me->get_property ("right-padding"), h)); if (right_text) - right_point = std::min (right_point, (robust_relative_extent (right_text, common, X_AXIS)[LEFT] - paddings[RIGHT])); + right_point = min (right_point, (robust_relative_extent (right_text, common, X_AXIS)[LEFT] - paddings[RIGHT])); /* run to end of line. */ if (me->get_bound (RIGHT)->break_status_dir ()) - right_point = std::max (right_point, (robust_relative_extent (me->get_bound (RIGHT), common, X_AXIS)[LEFT] - paddings[RIGHT])); + right_point = max (right_point, (robust_relative_extent (me->get_bound (RIGHT), common, X_AXIS)[LEFT] - paddings[RIGHT])); left_point += paddings[LEFT]; Real w = right_point - left_point; diff --git a/lily/lyric-hyphen.cc b/lily/lyric-hyphen.cc index 236e7e315a..029391f92f 100644 --- a/lily/lyric-hyphen.cc +++ b/lily/lyric-hyphen.cc @@ -81,7 +81,7 @@ Lyric_hyphen::print (SCM smob) && !bounds[RIGHT]->break_status_dir ()) { Real minimum_length = robust_scm2double (me->get_property ("minimum-length"), .3); - dash_length = std::max ((l - 2 * padding), minimum_length); + dash_length = max ((l - 2 * padding), minimum_length); } Real space_left = l - dash_length - (n - 1) * dash_period; @@ -94,7 +94,7 @@ Lyric_hyphen::print (SCM smob) && !bounds[RIGHT]->break_status_dir ()) return SCM_EOL; - space_left = std::max (space_left, 0.0); + space_left = max (space_left, 0.0); Box b (Interval (0, dash_length), Interval (h, h + th)); Stencil dash_mol (Lookup::round_filled_box (b, 0.8 * lt)); diff --git a/lily/main.cc b/lily/main.cc index 1283bcfcc6..001dc3a882 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -25,6 +25,7 @@ #include #include #include +using namespace std; #include #include diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index 51add1233e..7db0a781cc 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -18,6 +18,7 @@ */ #include +using namespace std; #include "engraver.hh" diff --git a/lily/metronome-engraver.cc b/lily/metronome-engraver.cc index f5bc107981..e1de3e23e0 100644 --- a/lily/metronome-engraver.cc +++ b/lily/metronome-engraver.cc @@ -18,6 +18,7 @@ */ #include +using namespace std; #include "engraver.hh" diff --git a/lily/midi-item.cc b/lily/midi-item.cc index 542e2b0df2..a602edc6fe 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -195,7 +195,7 @@ Midi_time_signature::to_string () const Midi_note::Midi_note (Audio_note *a) : Midi_channel_item (a), audio_ (a), - dynamic_byte_ (std::min (std::max (Byte ((a->dynamic_ && a->dynamic_->volume_ >= 0 + dynamic_byte_ (min (max (Byte ((a->dynamic_ && a->dynamic_->volume_ >= 0 ? a->dynamic_->volume_ * 0x7f : 0x5a) + a->extra_velocity_), Byte (0)), Byte (0x7f))) diff --git a/lily/midi-stream.cc b/lily/midi-stream.cc index ff979a8974..801919fa8b 100644 --- a/lily/midi-stream.cc +++ b/lily/midi-stream.cc @@ -20,6 +20,7 @@ #include "midi-stream.hh" #include +using namespace std; #include "international.hh" #include "main.hh" diff --git a/lily/misc.cc b/lily/misc.cc index 77fbb21374..7bb417bd62 100644 --- a/lily/misc.cc +++ b/lily/misc.cc @@ -67,7 +67,7 @@ peak_around (Real epsilon, Real threshold, Real x) { if (x < 0) return 1.0; - return std::max (- epsilon * (x - threshold) / ((x + epsilon) * threshold), 0.0); + return max (- epsilon * (x - threshold) / ((x + epsilon) * threshold), 0.0); } /* diff --git a/lily/modified-font-metric.cc b/lily/modified-font-metric.cc index b746fdaa68..2256eb9d18 100644 --- a/lily/modified-font-metric.cc +++ b/lily/modified-font-metric.cc @@ -17,6 +17,7 @@ along with LilyPond. If not, see . */ #include +using namespace std; #include "modified-font-metric.hh" #include "pango-font.hh" diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 056989a60e..7f2a720d6f 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -80,7 +80,7 @@ Multi_measure_rest::percent (SCM smob) we gotta stay clear of sp_iv, so move a bit to the right if needed. */ - x_off += std::max (sp_iv[LEFT] - rx, 0.0); + x_off += max (sp_iv[LEFT] - rx, 0.0); /* center between stuff. @@ -107,7 +107,7 @@ Multi_measure_rest::print (SCM smob) we gotta stay clear of sp_iv, so move a bit to the right if needed. */ - Real x_off = std::max (sp_iv[LEFT] - rx, 0.0); + Real x_off = max (sp_iv[LEFT] - rx, 0.0); Stencil mol; mol.add_stencil (symbol_stencil (me, space)); @@ -251,9 +251,9 @@ Multi_measure_rest::big_rest (Grob *me, Real width) Real slt = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness")); Real y = slt * thick_thick / 2 * ss; Real ythick = hair_thick * slt * ss; - Box b (Interval (0.0, std::max (0.0, (width - 2 * ythick))), Interval (-y, y)); + Box b (Interval (0.0, max (0.0, (width - 2 * ythick))), Interval (-y, y)); - Real blot = width ? (.8 * std::min (y, ythick)) : 0.0; + Real blot = width ? (.8 * min (y, ythick)) : 0.0; Stencil m = Lookup::round_filled_box (b, blot); Stencil yb = Lookup::round_filled_box (Box (Interval (-0.5, 0.5) * ythick, Interval (-ss, ss)), blot); @@ -392,7 +392,7 @@ Multi_measure_rest::calculate_spacing_rods (Grob *me, Real length) rod.item_drul_[LEFT] = li; rod.item_drul_[RIGHT] = ri; - rod.distance_ = std::max (Paper_column::minimum_distance (li, ri) + length, + rod.distance_ = max (Paper_column::minimum_distance (li, ri) + length, minlen); rod.add_to_cols (); } diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index f1ef8d6488..b89e92c28e 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -18,6 +18,7 @@ */ #include +using namespace std; #include "warn.hh" #include "music.hh" diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index 33a035d8a3..d280953714 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -66,7 +66,7 @@ Music_sequence::maximum_length (SCM l) else { Moment l = m->get_length (); - dur = std::max (dur, l); + dur = max (dur, l); } } @@ -153,7 +153,7 @@ Music_sequence::minimum_start (SCM l) Moment m; for (SCM s = l; scm_is_pair (s); s = scm_cdr (s)) - m = std::min (m, unsmob (scm_car (s))->start_mom ()); + m = min (m, unsmob (scm_car (s))->start_mom ()); return m; } diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc index f75ccd69dc..e0b0d09809 100644 --- a/lily/new-fingering-engraver.cc +++ b/lily/new-fingering-engraver.cc @@ -230,7 +230,7 @@ New_fingering_engraver::position_scripts (SCM orientations, } } - vector_sort (*scripts, std::less ()); + vector_sort (*scripts, less ()); bool up_p = scm_is_true (scm_c_memq (ly_symbol2scm ("up"), orientations)); bool down_p = scm_is_true (scm_c_memq (ly_symbol2scm ("down"), orientations)); diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 18e8e00dba..4d1303b739 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -524,11 +524,11 @@ Note_collision_interface::automatic_shift (Grob *me, // check if we cross the opposite-stemmed voices if (d * extents[d][i][-d] < d * extent_union[-d][d]) - offset = std::max (offset, 0.5); + offset = max (offset, 0.5); if (extents[-d].size () && extents[d][i][UP] > extents[-d][0][DOWN] && extents[d][i][DOWN] < extents[-d][0][UP]) - offset = std::max (offset, 1.0); + offset = max (offset, 1.0); } offsets[d].push_back (d * offset); } @@ -595,7 +595,7 @@ Note_collision_interface::note_head_positions (Grob *me) out.insert (out.end (), nhp.begin (), nhp.end ()); } - vector_sort (out, std::less ()); + vector_sort (out, less ()); return out; } diff --git a/lily/note-column.cc b/lily/note-column.cc index 87396b5a13..1d79fee652 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -20,6 +20,7 @@ #include "note-column.hh" #include // ceil +using namespace std; #include "accidental-placement.hh" #include "axis-group-interface.hh" diff --git a/lily/note-head.cc b/lily/note-head.cc index af516bef2b..dda8e040b9 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -23,6 +23,7 @@ #include #include // min, max +using namespace std; #include "directional-element-interface.hh" #include "font-interface.hh" @@ -39,7 +40,7 @@ internal_print (Grob *me, string *font_char) { string style = robust_symbol2string (me->get_property ("style"), "default"); - string suffix = ::to_string (std::min (robust_scm2int (me->get_property ("duration-log"), 2), 2)); + string suffix = ::to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2)); if (style != "default") suffix = robust_scm2string (me->get_property ("glyph-name"), ""); @@ -145,8 +146,8 @@ Note_head::include_ledger_line_height (SCM smob) // The +1 and -1 come from the fact that we only want to add // the interval between the note and the first ledger line, not // the whole interval between the note and the staff. - Interval iv (std::min (0.0, lines[UP] - my_ext[DOWN] + 1), - std::max (0.0, lines[DOWN] - my_ext[UP] - 1)); + Interval iv (min (0.0, lines[UP] - my_ext[DOWN] + 1), + max (0.0, lines[DOWN] - my_ext[UP] - 1)); return ly_interval2scm (iv); } diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 9c12fc78b2..20036d021f 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -20,6 +20,7 @@ #include "engraver.hh" #include +using namespace std; #include "duration.hh" #include "item.hh" diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index 63a3587475..eab3651520 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -78,7 +78,7 @@ Note_spacing::get_spacing (Grob *me, Item *right_col, Real ideal = base.distance () - increment + left_head_end; Drul_array skys = Spacing_interface::skylines (me, right_col); Real distance = skys[LEFT].distance (skys[RIGHT], robust_scm2double (right_col->get_property ("skyline-vertical-padding"), 0.0)); - Real min_dist = std::max (0.0, distance); + Real min_dist = max (0.0, distance); base.set_min_distance (min_dist); /* If we have a NonMusical column on the right, we measure the ideal distance @@ -99,13 +99,13 @@ Note_spacing::get_spacing (Grob *me, Item *right_col, but keep at least half the gap we would have had to a note */ Real min_desired_space = (ideal + min_dist) / 2.0; ideal -= right_col->extent (right_col, X_AXIS)[RIGHT]; - ideal = std::max (ideal, min_desired_space); + ideal = max (ideal, min_desired_space); } } stem_dir_correction (me, right_col, increment, &ideal); - base.set_distance (std::max (0.0, ideal)); + base.set_distance (max (0.0, ideal)); return base; } @@ -147,7 +147,7 @@ different_directions_correction (Grob *note_spacing, /* Ugh. 7 is hardcoded. */ - ret = std::min (ret / 7, 1.0) + ret = min (ret / 7, 1.0) * left_stem_dir * robust_scm2double (note_spacing->get_property ("stem-spacing-correction"), 0); } diff --git a/lily/one-line-page-breaking.cc b/lily/one-line-page-breaking.cc index a96b37fc00..9110cdad96 100644 --- a/lily/one-line-page-breaking.cc +++ b/lily/one-line-page-breaking.cc @@ -60,7 +60,7 @@ One_line_page_breaking::solve () vector cols = ps->root_system ()->used_columns (); // No indent, "infinite" line width, ragged. - Column_x_positions pos = get_line_configuration (cols, std::numeric_limits::max (), 0, true); + Column_x_positions pos = get_line_configuration (cols, numeric_limits::max (), 0, true); vector positions; positions.push_back (pos); @@ -73,7 +73,7 @@ One_line_page_breaking::solve () SCM systems = scm_list_1 (system->self_scm ()); SCM pages = make_pages (lines_per_page, systems); - max_width = std::max (max_width, system->extent (system, X_AXIS).length ()); + max_width = max (max_width, system->extent (system, X_AXIS).length ()); all_pages = scm_cons (scm_car (pages), all_pages); } else if (Prob *pb = system_specs_[i].prob_) diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index b200b1188d..8a7bdf7221 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -22,6 +22,7 @@ #include +using namespace std; #include FT_TRUETYPE_TABLES_H diff --git a/lily/ottava-bracket.cc b/lily/ottava-bracket.cc index 9116f19f04..63a9d3ebca 100644 --- a/lily/ottava-bracket.cc +++ b/lily/ottava-bracket.cc @@ -129,7 +129,7 @@ Ottava_bracket::print (SCM smob) ? 0.0 : text.extent (X_AXIS)[RIGHT] + 0.3; span_points[LEFT] - = std::min (span_points[LEFT], + = min (span_points[LEFT], (span_points[RIGHT] - text_size - robust_scm2double (me->get_property ("minimum-length"), -1.0))); diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index 94a76f9a19..20ae15271a 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -251,9 +251,9 @@ Page_breaking::Page_breaking (Paper_book *pb, Break_predicate is_break, Prob_bre paper_height_ = robust_scm2double (pb->paper_->c_variable ("paper-height"), 1.0); ragged_ = to_boolean (pb->paper_->c_variable ("ragged-bottom")); ragged_last_ = to_boolean (pb->paper_->c_variable ("ragged-last-bottom")); - systems_per_page_ = std::max (0, robust_scm2int (pb->paper_->c_variable ("systems-per-page"), 0)); - max_systems_per_page_ = std::max (0, robust_scm2int (pb->paper_->c_variable ("max-systems-per-page"), 0)); - min_systems_per_page_ = std::max (0, robust_scm2int (pb->paper_->c_variable ("min-systems-per-page"), 0)); + systems_per_page_ = max (0, robust_scm2int (pb->paper_->c_variable ("systems-per-page"), 0)); + max_systems_per_page_ = max (0, robust_scm2int (pb->paper_->c_variable ("max-systems-per-page"), 0)); + min_systems_per_page_ = max (0, robust_scm2int (pb->paper_->c_variable ("min-systems-per-page"), 0)); orphan_penalty_ = robust_scm2int (pb->paper_->c_variable ("orphan-penalty"), 100000); Stencil footnote_separator = Page_layout_problem::get_footnote_separator_stencil (pb->paper_); @@ -927,7 +927,7 @@ Page_breaking::set_current_breakpoints (vsize start, dems_and_indices.push_back (pair (dem, i)); } - vector_sort (dems_and_indices, std::less > ()); + vector_sort (dems_and_indices, less > ()); vector best_5_configurations; for (vsize i = 0; i < 5; i++) @@ -1031,9 +1031,9 @@ Page_breaking::line_divisions_rec (vsize system_count, others_min += min_sys[i]; others_max += max_sys[i]; } - others_max = std::min (others_max, (int) system_count); - int real_min = std::max ((int) min_sys[my_index], (int) system_count - others_max); - int real_max = std::min ((int) max_sys[my_index], (int) system_count - others_min); + others_max = min (others_max, (int) system_count); + int real_min = max ((int) min_sys[my_index], (int) system_count - others_max); + int real_max = min ((int) max_sys[my_index], (int) system_count - others_min); if (real_min > real_max || real_min < 0) { @@ -1073,7 +1073,7 @@ Page_breaking::compute_line_heights () Real a = shape.begin_[UP]; Real b = shape.rest_[UP]; bool title = cur.title_; - Real refpoint_hanging = std::max (prev_hanging_begin + a, prev_hanging_rest + b); + Real refpoint_hanging = max (prev_hanging_begin + a, prev_hanging_rest + b); if (i > 0) { @@ -1086,14 +1086,14 @@ Page_breaking::compute_line_heights () Real min_dist = title ? prev.title_min_distance_ : prev.min_distance_; - refpoint_hanging = std::max (refpoint_hanging + padding, + refpoint_hanging = max (refpoint_hanging + padding, prev_refpoint_hanging - prev.refpoint_extent_[DOWN] + cur.refpoint_extent_[UP] + min_dist); } Real hanging_begin = refpoint_hanging - shape.begin_[DOWN]; Real hanging_rest = refpoint_hanging - shape.rest_[DOWN]; - Real hanging = std::max (hanging_begin, hanging_rest); + Real hanging = max (hanging_begin, hanging_rest); cur.tallness_ = hanging - prev_hanging; prev_hanging = hanging; prev_hanging_begin = hanging_begin; @@ -1449,7 +1449,7 @@ Page_breaking::finalize_spacing_result (vsize configuration, Page_spacing_result { Real f = res.force_[i]; - page_demerits += std::min (f * f, BAD_SPACING_PENALTY); + page_demerits += min (f * f, BAD_SPACING_PENALTY); } /* for a while we tried averaging page and line forces across pages instead @@ -1483,7 +1483,7 @@ Page_breaking::space_systems_on_1_page (vector const &lines, Real } ret.systems_per_page_.push_back (lines.size ()); - ret.force_.push_back (ragged ? std::min (space.force_, 0.0) : space.force_); + ret.force_.push_back (ragged ? min (space.force_, 0.0) : space.force_); ret.penalty_ = line_count_penalty (line_count) + lines.back ().page_penalty_ + lines.back ().turn_penalty_; ret.system_count_status_ |= line_count_status (line_count); @@ -1657,8 +1657,8 @@ Page_breaking::min_whitespace_at_top_of_page (Line_details const &line) const ly_symbol2scm ("padding")); // FIXME: take into account the height of the header - Real translate = std::max (line.shape_.begin_[UP], line.shape_.rest_[UP]); - return std::max (0.0, std::max (padding, min_distance - translate)); + Real translate = max (line.shape_.begin_[UP], line.shape_.rest_[UP]); + return max (0.0, max (padding, min_distance - translate)); } Real @@ -1676,8 +1676,8 @@ Page_breaking::min_whitespace_at_bottom_of_page (Line_details const &line) const ly_symbol2scm ("padding")); // FIXME: take into account the height of the footer - Real translate = std::min (line.shape_.begin_[DOWN], line.shape_.rest_[DOWN]); - return std::max (0.0, std::max (padding, min_distance + translate)); + Real translate = min (line.shape_.begin_[DOWN], line.shape_.rest_[DOWN]); + return max (0.0, max (padding, min_distance + translate)); } int diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc index ebe147d59e..b0ef9ab36d 100644 --- a/lily/page-layout-problem.cc +++ b/lily/page-layout-problem.cc @@ -189,7 +189,7 @@ Page_layout_problem::add_footnotes_to_lines (SCM lines, int counter, Paper_book numbers = scm_cons (stencil, numbers); if (!st->extent (X_AXIS).is_empty ()) - max_length = std::max (max_length, st->extent (X_AXIS)[RIGHT]); + max_length = max (max_length, st->extent (X_AXIS)[RIGHT]); counter++; } @@ -665,7 +665,7 @@ Page_layout_problem::append_prob (Prob *prob, Spring const &spring, Real padding if (sky) { - minimum_distance = std::max ((*sky)[UP].distance (bottom_skyline_), + minimum_distance = max ((*sky)[UP].distance (bottom_skyline_), bottom_loose_baseline_); bottom_skyline_ = (*sky)[DOWN]; } @@ -1126,7 +1126,7 @@ Page_layout_problem::get_fixed_spacing (Grob *before, Grob *after, int spaceable { SCM forced = robust_list_ref (spaceable_index - 1, manual_dists); if (scm_is_number (forced)) - ret = std::max (ret, scm_to_double (forced)); + ret = max (ret, scm_to_double (forced)); } } diff --git a/lily/page-spacing.cc b/lily/page-spacing.cc index f9cb9540d1..ce9aabedac 100644 --- a/lily/page-spacing.cc +++ b/lily/page-spacing.cc @@ -37,7 +37,7 @@ Page_spacing::calc_force () force_ = -infinity_f; else force_ = (height - rod_height_ - last_line_.bottom_padding_ - spring_len_) - / std::max (0.1, inverse_spring_k_); + / max (0.1, inverse_spring_k_); } void @@ -356,7 +356,7 @@ Page_spacer::calc_subproblem (vsize page, vsize line) // Clamp the demerits at BAD_SPACING_PENALTY, even if the page // is overfull. This ensures that TERRIBLE_SPACING_PENALTY takes // precedence over overfull pages. - demerits = std::min (demerits, BAD_SPACING_PENALTY); + demerits = min (demerits, BAD_SPACING_PENALTY); demerits += (prev ? prev->demerits_ : 0); Real penalty = breaker_->line_count_penalty (line_count); diff --git a/lily/page-turn-engraver.cc b/lily/page-turn-engraver.cc index 874ebe7e7e..82b33aadfb 100644 --- a/lily/page-turn-engraver.cc +++ b/lily/page-turn-engraver.cc @@ -64,7 +64,7 @@ public: return ret; } - Real new_pen = std::max (penalty_, penalty.penalty_); + Real new_pen = max (penalty_, penalty.penalty_); if (duration_[LEFT] < penalty.duration_[LEFT]) ret.push_back (Page_turn_event (duration_[LEFT], penalty.duration_[LEFT], permission_, penalty_)); @@ -121,8 +121,8 @@ Page_turn_engraver::Page_turn_engraver () Grob * Page_turn_engraver::breakable_column (Page_turn_event const &brk) { - vsize start = lower_bound (breakable_moments_, brk.duration_[LEFT], std::less ()); - vsize end = upper_bound (breakable_moments_, brk.duration_[RIGHT], std::less ()); + vsize start = lower_bound (breakable_moments_, brk.duration_[LEFT], less ()); + vsize end = upper_bound (breakable_moments_, brk.duration_[RIGHT], less ()); if (start == breakable_moments_.size ()) return NULL; @@ -323,7 +323,7 @@ Page_turn_engraver::finalize () if (pc) { SCM perm = max_permission (pc->get_property ("page-turn-permission"), brk.permission_); - Real pen = std::min (robust_scm2double (pc->get_property ("page-turn-penalty"), infinity_f), brk.penalty_); + Real pen = min (robust_scm2double (pc->get_property ("page-turn-penalty"), infinity_f), brk.penalty_); pc->set_property ("page-turn-permission", perm); pc->set_property ("page-turn-penalty", scm_from_double (pen)); } diff --git a/lily/page-turn-page-breaking.cc b/lily/page-turn-page-breaking.cc index daa060c939..85a090f6ea 100644 --- a/lily/page-turn-page-breaking.cc +++ b/lily/page-turn-page-breaking.cc @@ -173,7 +173,7 @@ Page_turn_page_breaking::calc_subproblem (vsize ending_breakpoint) /* heuristic: we've just added a breakpoint, we'll need at least as many systems as before */ - min_sys_count = std::max (min_sys_count, prev_best_system_count); + min_sys_count = max (min_sys_count, prev_best_system_count); for (vsize sys_count = min_sys_count; sys_count <= max_sys_count && ok_page; sys_count++) { set_current_breakpoints (start, end, sys_count, min_division, max_division); diff --git a/lily/paper-column.cc b/lily/paper-column.cc index 90182f50a7..6fbefdd6cb 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -179,7 +179,7 @@ Paper_column::minimum_distance (Grob *left, Grob *right) skys[RIGHT].merge (Separation_item::conditional_skyline (right, left)); - return std::max (0.0, skys[LEFT].distance (skys[RIGHT])); + return max (0.0, skys[LEFT].distance (skys[RIGHT])); } Interval diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 943c3561f4..87f14570e2 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -23,6 +23,7 @@ #include #include +using namespace std; #include "dimensions.hh" #include "file-name.hh" diff --git a/lily/parse-scm.cc b/lily/parse-scm.cc index 72ddff3632..576591dc97 100644 --- a/lily/parse-scm.cc +++ b/lily/parse-scm.cc @@ -20,6 +20,7 @@ #include "parse-scm.hh" #include +using namespace std; #include "lily-parser.hh" #include "lily-lexer.hh" diff --git a/lily/parser.yy b/lily/parser.yy index b69c934bbe..e4a0b2d0c7 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -116,6 +116,7 @@ FIXME: #include #include #include +using namespace std; #include "book.hh" #include "context-def.hh" diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc index d7d159bed0..f742d75a73 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -99,7 +99,7 @@ Part_combine_iterator::pending_moment () const for (size_t i = 0; i < NUM_PARTS; i++) if (iterators_[i]->ok ()) - p = std::min (p, iterators_[i]->pending_moment ()); + p = min (p, iterators_[i]->pending_moment ()); return p; } diff --git a/lily/pdf-scheme.cc b/lily/pdf-scheme.cc index 79cc21a5d5..da2ce2cef3 100644 --- a/lily/pdf-scheme.cc +++ b/lily/pdf-scheme.cc @@ -18,6 +18,7 @@ */ #include +using namespace std; #include "international.hh" #include "warn.hh" diff --git a/lily/performance.cc b/lily/performance.cc index af083021ce..3024ea69af 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -20,6 +20,7 @@ #include "performance.hh" #include +using namespace std; #include "audio-column.hh" #include "audio-item.hh" @@ -81,7 +82,7 @@ Performance::output (Midi_stream &midi_stream, Moment start_mom = 0; for (vsize i = 0; i < audio_elements_.size (); i++) if (Audio_item *item = dynamic_cast(audio_elements_[i])) - start_mom = std::min (start_mom, item->audio_column_->when ()); + start_mom = min (start_mom, item->audio_column_->when ()); for (vsize i = 0; i < audio_staffs_.size (); i++) { diff --git a/lily/pfb.cc b/lily/pfb.cc index f62cea6d2a..c971024548 100644 --- a/lily/pfb.cc +++ b/lily/pfb.cc @@ -20,6 +20,7 @@ #include #include #include +using namespace std; #include "program-option.hh" #include "source-file.hh" diff --git a/lily/program-option-scheme.cc b/lily/program-option-scheme.cc index 405e5d17c2..b7003c085c 100644 --- a/lily/program-option-scheme.cc +++ b/lily/program-option-scheme.cc @@ -21,6 +21,7 @@ #include #include +using namespace std; #include "profile.hh" #include "international.hh" @@ -171,7 +172,7 @@ get_help_string () } string help ("Options supported by `ly:set-option':\n\n"); - vector_sort (opts, std::less ()); + vector_sort (opts, less ()); for (vsize i = 0; i < opts.size (); i++) help += opts[i]; return help; diff --git a/lily/quote-iterator.cc b/lily/quote-iterator.cc index f222e5a8e4..c433625011 100644 --- a/lily/quote-iterator.cc +++ b/lily/quote-iterator.cc @@ -178,14 +178,14 @@ Quote_iterator::pending_moment () const Moment m (infty); if (Music_wrapper_iterator::ok ()) - m = std::min (m, Music_wrapper_iterator::pending_moment ()); + m = min (m, Music_wrapper_iterator::pending_moment ()); /* In case event_idx_ < 0, we're not initted yet, and the wrapped music expression determines the starting moment. */ if (quote_ok ()) - m = std::min (m, vector_moment (event_idx_) - start_moment_); + m = min (m, vector_moment (event_idx_) - start_moment_); return m; } diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 1abd13646c..8425e6eee2 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -20,6 +20,7 @@ #include "rest-collision.hh" #include // ceil. +using namespace std; #include "directional-element-interface.hh" #include "duration.hh" @@ -255,7 +256,7 @@ Rest_collision::calc_positioning_done (SCM smob) notedim.unite (notes[i]->extent (common, Y_AXIS)); } - Real y = dir * std::max (0.0, + Real y = dir * max (0.0, -dir * restdim[-dir] + dir * notedim[dir] + minimum_dist); // move discretely by half spaces. diff --git a/lily/score.cc b/lily/score.cc index 102a549cc4..da48e8f103 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -21,6 +21,7 @@ #include +using namespace std; #include "book.hh" #include "cpu-timer.hh" diff --git a/lily/separation-item.cc b/lily/separation-item.cc index 20fc2c564a..632f6bcccf 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -64,7 +64,7 @@ Separation_item::set_distance (Item *l, Item *r, Real padding) rod.add_to_cols (); } - return std::max (dist, 0.0); + return max (dist, 0.0); } bool diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 2e4591153a..efb182092f 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -24,6 +24,7 @@ #include #include +using namespace std; #include "accidental-interface.hh" #include "accidental-placement.hh" @@ -347,7 +348,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i total_off = minimum_space * dir; if (current_off) - total_off = dir * std::max (dir * total_off, + total_off = dir * max (dir * total_off, dir * (*current_off)); /* FIXME: 1000 should relate to paper size. */ @@ -406,7 +407,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i Real diff = (dir * staff_extent[dir] + staff_padding - dir * total_off + dir * (staff_position - parent_position)); - total_off += dir * std::max (diff, 0.0); + total_off += dir * max (diff, 0.0); } } return scm_from_double (total_off); diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index 5244d33c9e..5b8183d96a 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -127,9 +127,9 @@ Simple_spacer::add_rod (int l, int r, Real dist) return; } - force_ = std::max (force_, block_force); + force_ = max (force_, block_force); for (int i = l; i < r; i++) - springs_[i].set_blocking_force (std::max (block_force, springs_[i].blocking_force ())); + springs_[i].set_blocking_force (max (block_force, springs_[i].blocking_force ())); } Real @@ -225,7 +225,7 @@ Simple_spacer::compress_line () if (line_len_ > (1 + 1e-6) * cur_len) programming_error ("misuse of compress_line"); vector sorted_springs = springs_; - sort (sorted_springs.begin (), sorted_springs.end (), std::greater ()); + sort (sorted_springs.begin (), sorted_springs.end (), greater ()); /* inv_hooke is the total flexibility of currently-active springs */ double inv_hooke = 0; @@ -269,7 +269,7 @@ Simple_spacer::compress_line () void Simple_spacer::add_spring (Spring const &sp) { - force_ = std::max (force_, sp.blocking_force ()); + force_ = max (force_, sp.blocking_force ()); springs_.push_back (sp); } @@ -291,7 +291,7 @@ Simple_spacer::force_penalty (bool ragged) const but according to the amount of whitespace that is present after the end of the line. */ if (ragged) - return std::max (0.0, line_len_ - configuration_length (0.0)); + return max (0.0, line_len_ - configuration_length (0.0)); /* Use a convex compression penalty. */ Real f = force_; diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc index abcc6aaee3..e892776b61 100644 --- a/lily/simultaneous-music-iterator.cc +++ b/lily/simultaneous-music-iterator.cc @@ -135,7 +135,7 @@ Simultaneous_music_iterator::pending_moment () const for (SCM s = children_list_; scm_is_pair (s); s = scm_cdr (s)) { Music_iterator *it = unsmob (scm_car (s)); - next = std::min (next, it->pending_moment ()); + next = min (next, it->pending_moment ()); } return next; diff --git a/lily/skyline-pair.cc b/lily/skyline-pair.cc index 5dc217d342..67fef4c51a 100644 --- a/lily/skyline-pair.cc +++ b/lily/skyline-pair.cc @@ -87,13 +87,13 @@ Skyline_pair::print () const Real Skyline_pair::left () const { - return std::min (skylines_[UP].left (), skylines_[DOWN].left ()); + return min (skylines_[UP].left (), skylines_[DOWN].left ()); } Real Skyline_pair::right () const { - return std::max (skylines_[UP].right (), skylines_[DOWN].right ()); + return max (skylines_[UP].right (), skylines_[DOWN].right ()); } void diff --git a/lily/skyline.cc b/lily/skyline.cc index 88e699a6eb..5ce66cb999 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -131,7 +131,7 @@ Building::precompute (Real start, Real start_height, Real end_height, Real end) // too steep to be stored in slope-intercept form, given round-off error { slope_ = 0.0; - y_intercept_ = std::max (start_height, end_height); + y_intercept_ = max (start_height, end_height); } else y_intercept_ = start_height - slope_ * start; @@ -251,7 +251,7 @@ Skyline::internal_merge_skyline (list *sb, list *sc, } /* 'c' continues further, so move it into 'b' for the next pass. */ b = c; - std::swap (sb, sc); + swap (sb, sc); } else /* b.end_ > c.end_ so finish with c */ { @@ -456,7 +456,7 @@ Skyline::Skyline (vector > const &segments, Axis horizon_axis Offset left = seg[LEFT]; Offset right = seg[RIGHT]; if (left[horizon_axis] > right[horizon_axis]) - std::swap (left, right); + swap (left, right); Real x1 = left[horizon_axis]; Real x2 = right[horizon_axis]; @@ -671,10 +671,10 @@ Skyline::internal_distance (Skyline const &other, Real *touch_point) const Real touch = -infinity_f; while (i != buildings_.end () && j != other.buildings_.end ()) { - Real end = std::min (i->end_, j->end_); + Real end = min (i->end_, j->end_); Real start_dist = i->height (start) + j->height (start); Real end_dist = i->height (end) + j->height (end); - dist = std::max (dist, std::max (start_dist, end_dist)); + dist = max (dist, max (start_dist, end_dist)); if (end_dist == dist) touch = end; @@ -716,8 +716,8 @@ Skyline::max_height () const list::const_iterator i; for (i = buildings_.begin (); i != buildings_.end (); ++i) { - ret = std::max (ret, i->height (i->start_)); - ret = std::max (ret, i->height (i->end_)); + ret = max (ret, i->height (i->start_)); + ret = max (ret, i->height (i->end_)); } return sky_ * ret; diff --git a/lily/slur-configuration.cc b/lily/slur-configuration.cc index 4bd0c71139..aac2a97a0e 100644 --- a/lily/slur-configuration.cc +++ b/lily/slur-configuration.cc @@ -122,7 +122,7 @@ fit_factor (Offset dz_unit, Offset dz_perp, Real close_to_edge_length, Real y = curve.get_other_coordinate (X_AXIS, p[X_AXIS]); if (y) - fit_factor = std::max (fit_factor, (p[Y_AXIS] / y)); + fit_factor = max (fit_factor, (p[Y_AXIS] / y)); } return fit_factor; } @@ -154,7 +154,7 @@ Slur_configuration::generate_curve (Slur_score_state const &state, (control3 - control0). */ Real max_indent = len / 3.1; - indent = std::min (indent, max_indent); + indent = min (indent, max_indent); Real a1 = sqr (len) / 3.0; Real a2 = 0.75 * sqr (indent + len / 3.0); @@ -184,7 +184,7 @@ Slur_configuration::generate_curve (Slur_score_state const &state, Real ff = fit_factor (dz_unit, dz_perp, state.parameters_.close_to_edge_length_, curve, state.dir_, avoid); - height = std::max (height, std::min (height * ff, max_h)); + height = max (height, min (height * ff, max_h)); curve.control_[0] = attachment_[LEFT]; curve.control_[1] = attachment_[LEFT] + dz_perp * height * state.dir_ @@ -258,7 +258,7 @@ Slur_configuration::score_encompass (Slur_score_state const &state) Real hd = (head_dy) ? (1 / fabs (head_dy) - 1 / state.parameters_.free_head_distance_) : state.parameters_.head_encompass_penalty_; - hd = std::min (std::max (hd, 0.0), state.parameters_.head_encompass_penalty_); + hd = min (max (hd, 0.0), state.parameters_.head_encompass_penalty_); demerit += hd; } @@ -273,7 +273,7 @@ Slur_configuration::score_encompass (Slur_score_state const &state) { Real closest - = state.dir_ * std::max (state.dir_ * state.encompass_infos_[j].get_point (state.dir_), state.dir_ * line_y); + = state.dir_ * max (state.dir_ * state.encompass_infos_[j].get_point (state.dir_), state.dir_ * line_y); Real d = fabs (closest - y); convex_head_distances.push_back (d); @@ -299,7 +299,7 @@ Slur_configuration::score_encompass (Slur_score_state const &state) for (vsize j = 0; j < n; j++) { - min_dist = std::min (min_dist, convex_head_distances[j]); + min_dist = min (min_dist, convex_head_distances[j]); avg_distance += convex_head_distances[j]; } @@ -322,9 +322,9 @@ Slur_configuration::score_encompass (Slur_score_state const &state) Real variance_penalty = state.parameters_.head_slur_distance_max_ratio_; if (min_dist > 0.0) variance_penalty - = std::min ((avg_distance / (min_dist + state.parameters_.absolute_closeness_measure_) - 1.0), variance_penalty); + = min ((avg_distance / (min_dist + state.parameters_.absolute_closeness_measure_) - 1.0), variance_penalty); - variance_penalty = std::max (variance_penalty, 0.0); + variance_penalty = max (variance_penalty, 0.0); variance_penalty *= state.parameters_.head_slur_distance_factor_; add_score (variance_penalty, "variance"); @@ -427,7 +427,7 @@ Slur_configuration::score_extra_encompass (Slur_score_state const &state) else programming_error ("unknown avoidance type"); - dist = std::max (dist, 0.0); + dist = max (dist, 0.0); Real penalty = info.penalty_ * peak_around (0.1 * state.parameters_.extra_encompass_free_distance_, state.parameters_.extra_encompass_free_distance_, @@ -473,7 +473,7 @@ Slur_configuration::score_slopes (Slur_score_state const &state) Real slur_dy = slur_dz[Y_AXIS]; Real demerit = 0.0; - demerit += std::max ((fabs (slur_dy / slur_dz[X_AXIS]) + demerit += max ((fabs (slur_dy / slur_dz[X_AXIS]) - state.parameters_.max_slope_), 0.0) * state.parameters_.max_slope_factor_; @@ -484,9 +484,9 @@ Slur_configuration::score_slopes (Slur_score_state const &state) if (!state.is_broken_) demerit += state.parameters_.steeper_slope_factor_ - * (std::max (fabs (slur_dy) - max_dy, 0.0)); + * (max (fabs (slur_dy) - max_dy, 0.0)); - demerit += std::max ((fabs (slur_dy / slur_dz[X_AXIS]) + demerit += max ((fabs (slur_dy / slur_dz[X_AXIS]) - state.parameters_.max_slope_), 0.0) * state.parameters_.max_slope_factor_; diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index afe2dd1585..29bc0d93f7 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -472,7 +472,7 @@ Slur_score_state::get_y_attachment_range () const slur_->warning ("slur trying to encompass an empty note column."); else end_ys[d] = dir_ - * std::max (std::max (dir_ * (base_attachments_[d][Y_AXIS] + * max (max (dir_ * (base_attachments_[d][Y_AXIS] + parameters_.region_size_ * dir_), dir_ * (dir_ + nc_extent[dir_])), dir_ * base_attachments_[-d][Y_AXIS]); @@ -641,7 +641,7 @@ Slur_score_state::generate_avoid_offsets () const continue; Encompass_info inf (get_encompass_info (encompasses[i])); - Real y = dir_ * (std::max (dir_ * inf.head_, dir_ * inf.stem_)); + Real y = dir_ * (max (dir_ * inf.head_, dir_ * inf.stem_)); avoid.push_back (Offset (inf.x_, y + dir_ * parameters_.free_head_distance_)); } diff --git a/lily/slur.cc b/lily/slur.cc index efd6224803..d3beb33625 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -360,7 +360,7 @@ Slur::outside_slur_callback (SCM grob, SCM offset_scm) } } - Real avoidance_offset = do_shift ? curve.minmax (X_AXIS, std::max (xext[LEFT], curve.control_[0][X_AXIS] + EPS), std::min (xext[RIGHT], curve.control_[3][X_AXIS] - EPS), dir) - yext[-dir] : 0.0; + Real avoidance_offset = do_shift ? curve.minmax (X_AXIS, max (xext[LEFT], curve.control_[0][X_AXIS] + EPS), min (xext[RIGHT], curve.control_[3][X_AXIS] - EPS), dir) - yext[-dir] : 0.0; return scm_from_double (offset + avoidance_offset); } diff --git a/lily/source-file.cc b/lily/source-file.cc index 98d4a0f878..a3c08d29ba 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -34,6 +34,7 @@ #else #include #endif +using namespace std; #include "file-name-map.hh" #include "international.hh" @@ -81,7 +82,7 @@ gulp_file (const string &filename, int desired_size) int read_count = real_size; if (desired_size > 0) - read_count = std::min (read_count, desired_size); + read_count = min (read_count, desired_size); rewind (f); @@ -174,8 +175,8 @@ Source_file::get_istream () else { istream_ = new istringstream (""); - istream_->setstate (std::ios::eofbit); - // istream_->set (std::ios::eofbit); + istream_->setstate (ios::eofbit); + // istream_->set (ios::eofbit); } } return istream_; @@ -329,7 +330,7 @@ Source_file::get_line (char const *pos_str0) const /* this will find the '\n' character at the end of our line */ vsize lo = lower_bound (newline_locations_, pos_str0, - std::less ()); + less ()); /* the return value will be indexed from 1 */ return lo + 1 + line_offset_; diff --git a/lily/spacing-basic.cc b/lily/spacing-basic.cc index 4ed797d673..ff245aa30f 100644 --- a/lily/spacing-basic.cc +++ b/lily/spacing-basic.cc @@ -40,7 +40,7 @@ Spring Spacing_spanner::standard_breakable_column_spacing (Grob *me, Item *l, Item *r, Spacing_options const *options) { - Real min_dist = std::max (0.0, Paper_column::minimum_distance (l, r)); + Real min_dist = max (0.0, Paper_column::minimum_distance (l, r)); if (Paper_column::is_breakable (l) && Paper_column::is_breakable (r)) { @@ -136,13 +136,13 @@ Spacing_spanner::note_spacing (Grob * /* me */, if (Moment *measure_len = get_measure_length (lc)) { - delta_t = std::min (delta_t, *measure_len); + delta_t = min (delta_t, *measure_len); /* The following is an extra safety measure, such that the length of a mmrest event doesn't cause havoc. */ - shortest_playing_len = std::min (shortest_playing_len, *measure_len); + shortest_playing_len = min (shortest_playing_len, *measure_len); } Spring ret; @@ -157,7 +157,7 @@ Spacing_spanner::note_spacing (Grob * /* me */, ret = Spring (fraction * len, fraction * min); // Stretch proportional to the space between canonical bare noteheads - ret.set_inverse_stretch_strength (fraction * std::max (0.1, (len - min))); + ret.set_inverse_stretch_strength (fraction * max (0.1, (len - min))); } else if (delta_t.grace_part_) { diff --git a/lily/spacing-determine-loose-columns.cc b/lily/spacing-determine-loose-columns.cc index 00e6e125dd..12859cb191 100644 --- a/lily/spacing-determine-loose-columns.cc +++ b/lily/spacing-determine-loose-columns.cc @@ -161,13 +161,13 @@ Spacing_spanner::set_distances_for_loose_col (Grob *me, Grob *c, Spring base = note_spacing (me, lc, rc, options); Spring spring = Note_spacing::get_spacing (sp, rc, base, options->increment_); - dists[d] = std::max (dists[d], spring.min_distance ()); + dists[d] = max (dists[d], spring.min_distance ()); } else if (has_interface (sp)) { Spring spring = Staff_spacing::get_spacing (sp, rc, 0.0); - dists[d] = std::max (dists[d], spring.min_distance ()); + dists[d] = max (dists[d], spring.min_distance ()); } else programming_error ("Subversive spacing wish"); diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index 7efa1e649c..244a55b376 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -222,7 +222,7 @@ Spacing_engraver::stop_translation_timestep () if (ev) { Moment m = get_event_length (ev); - shortest_playing = std::min (shortest_playing, m); + shortest_playing = min (shortest_playing, m); } } Moment starter; @@ -233,13 +233,13 @@ Spacing_engraver::stop_translation_timestep () Moment m = get_event_length (now_durations_[i].info_.event_cause ()); if (m.to_bool ()) { - starter = std::min (starter, m); + starter = min (starter, m); playing_durations_.insert (now_durations_[i]); } } now_durations_.clear (); - shortest_playing = std::min (shortest_playing, starter); + shortest_playing = min (shortest_playing, starter); assert (starter.to_bool ()); SCM sh = shortest_playing.smobbed_copy (); diff --git a/lily/spacing-interface.cc b/lily/spacing-interface.cc index 8f9875ff97..bcad9d741c 100644 --- a/lily/spacing-interface.cc +++ b/lily/spacing-interface.cc @@ -98,7 +98,7 @@ Spacing_interface::minimum_distance (Grob *me, Grob *right) { Drul_array skylines = Spacing_interface::skylines (me, right); - return std::max (0.0, skylines[LEFT].distance (skylines[RIGHT])); + return max (0.0, skylines[LEFT].distance (skylines[RIGHT])); } /* diff --git a/lily/spacing-loose-columns.cc b/lily/spacing-loose-columns.cc index 32ffe22032..462a793b06 100644 --- a/lily/spacing-loose-columns.cc +++ b/lily/spacing-loose-columns.cc @@ -175,8 +175,8 @@ set_loose_columns (System *which, Column_x_positions const *posns) } Real loose_col_horizontal_length = loose_col->extent (loose_col, X_AXIS).length (); - base_note_space = std::max (base_note_space, loose_col_horizontal_length); - tight_note_space = std::max (tight_note_space, loose_col_horizontal_length); + base_note_space = max (base_note_space, loose_col_horizontal_length); + tight_note_space = max (tight_note_space, loose_col_horizontal_length); clique_spacing.push_back (base_note_space); clique_tight_spacing.push_back (tight_note_space); @@ -195,7 +195,7 @@ set_loose_columns (System *which, Column_x_positions const *posns) sum_tight_spacing += clique_tight_spacing[j]; sum_spacing += clique_spacing[j]; } - Real scale_factor = std::max (0.0, std::min (1.0, (permissible_distance - left_padding - sum_tight_spacing) / (sum_spacing - sum_tight_spacing))); + Real scale_factor = max (0.0, min (1.0, (permissible_distance - left_padding - sum_tight_spacing) / (sum_spacing - sum_tight_spacing))); for (vsize j = clique.size () - 2; j > 0; j--) { Paper_column *clique_col = dynamic_cast (clique[j]); diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 12f18e865f..7ee6e3ef95 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -119,7 +119,7 @@ Spacing_spanner::calc_common_shortest_duration (SCM grob) SCM st = cols[i]->get_property ("shortest-starter-duration"); Moment this_shortest = *unsmob (st); assert (this_shortest.to_bool ()); - shortest_in_measure = std::min (shortest_in_measure, this_shortest.main_part_); + shortest_in_measure = min (shortest_in_measure, this_shortest.main_part_); } else if (!shortest_in_measure.is_infinity () && Paper_column::is_breakable (cols[i])) @@ -167,7 +167,7 @@ Spacing_spanner::calc_common_shortest_duration (SCM grob) d = m->main_part_; if (max_idx != VPOS) - d = std::min (d, durations[max_idx]); + d = min (d, durations[max_idx]); return Moment (d).smobbed_copy (); } @@ -246,7 +246,7 @@ set_column_rods (vector const &cols, Real padding) /* min rather than max because stickout will be negative if the right-hand column sticks out a lot to the left */ - Real stickout = std::min (skys ? (*skys)[LEFT].max_height () : 0.0, + Real stickout = min (skys ? (*skys)[LEFT].max_height () : 0.0, Separation_item::conditional_skyline (r, cols[i - 1]).max_height ()); Real prev_distances = 0.0; @@ -263,7 +263,7 @@ set_column_rods (vector const &cols, Real padding) Item *lb = l->find_prebroken_piece (RIGHT); Real dist = Separation_item::set_distance (l, r, padding); - distances[i] = std::max (distances[i], dist - prev_distances); + distances[i] = max (distances[i], dist - prev_distances); if (lb) { @@ -272,7 +272,7 @@ set_column_rods (vector const &cols, Real padding) // right than the unbroken version, by extending farther and/or // nesting more closely; if (j == i - 1) // check this, the first time we see each lb. - overhangs[j] = std::max (overhangs[j], + overhangs[j] = max (overhangs[j], lb->extent (lb, X_AXIS)[RIGHT] + distances[i] - dist); } @@ -283,7 +283,7 @@ set_column_rods (vector const &cols, Real padding) prev_distances += distances[j]; } - overhangs[i] = std::max (overhangs[i], + overhangs[i] = max (overhangs[i], overhangs[i - 1] - distances[i]); } } @@ -420,7 +420,7 @@ Spacing_spanner::musical_column_spacing (Grob *me, if (Paper_column::is_extraneous_column_from_ligature (left_col)) spring.set_distance (spring.min_distance ()); else - spring.set_distance (std::max (left_col->extent (left_col, X_AXIS)[RIGHT], + spring.set_distance (max (left_col->extent (left_col, X_AXIS)[RIGHT], spring.min_distance ())); spring.set_inverse_stretch_strength (1.0); diff --git a/lily/spring.cc b/lily/spring.cc index 5dfc3c804c..105ae73d1d 100644 --- a/lily/spring.cc +++ b/lily/spring.cc @@ -86,8 +86,8 @@ Spring::update_blocking_force () void Spring::operator *= (Real r) { - distance_ = std::max (min_distance_, distance_ * r); - inverse_compress_strength_ = std::max (0.0, distance_ - min_distance_); + distance_ = max (min_distance_, distance_ * r); + inverse_compress_strength_ = max (0.0, distance_ - min_distance_); inverse_stretch_strength_ *= r; update_blocking_force (); } @@ -113,13 +113,13 @@ merge_springs (vector const &springs) avg_distance += springs[i].distance (); avg_stretch += springs[i].inverse_stretch_strength (); avg_compress += 1 / springs[i].inverse_compress_strength (); - min_distance = std::max (springs[i].min_distance (), min_distance); + min_distance = max (springs[i].min_distance (), min_distance); } avg_stretch /= Real (springs.size ()); avg_compress /= Real (springs.size ()); avg_distance /= Real (springs.size ()); - avg_distance = std::max (min_distance + 0.3, avg_distance); + avg_distance = max (min_distance + 0.3, avg_distance); Spring ret = Spring (avg_distance, min_distance); ret.set_inverse_stretch_strength (avg_stretch); @@ -155,7 +155,7 @@ Spring::set_min_distance (Real d) void Spring::ensure_min_distance (Real d) { - set_min_distance (std::max (d, min_distance_)); + set_min_distance (max (d, min_distance_)); } void @@ -217,7 +217,7 @@ Spring::set_default_stretch_strength () Real Spring::length (Real f) const { - Real force = std::max (f, blocking_force_); + Real force = max (f, blocking_force_); Real inv_k = force < 0.0 ? inverse_compress_strength_ : inverse_stretch_strength_; if (isinf (force)) @@ -229,6 +229,6 @@ Spring::length (Real f) const // There is a corner case here: if min_distance_ is larger than // distance_ but the spring is fixed, then inv_k will be zero // and we need to make sure that we return min_distance_. - return std::max (min_distance_, distance_ + force * inv_k); + return max (min_distance_, distance_ + force * inv_k); } diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index 52dedd5d77..d693feaee1 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -20,6 +20,7 @@ #include "staff-spacing.hh" #include +using namespace std; #include "international.hh" #include "paper-column.hh" @@ -61,7 +62,7 @@ Staff_spacing::optical_correction (Grob *me, Grob *g, Interval bar_height) stem_posns.intersect (bar_height); - ret = std::min (abs (stem_posns.length () / 7.0), 1.0); + ret = min (abs (stem_posns.length () / 7.0), 1.0); ret *= robust_scm2double (me->get_property ("stem-spacing-correction"), 1); } } @@ -105,7 +106,7 @@ Staff_spacing::next_notes_correction (Grob *me, Real max_optical = 0.0; for (vsize i = 0; i < note_columns.size (); i++) - max_optical = std::max (max_optical, optical_correction (me, note_columns[i], bar_size)); + max_optical = max (max_optical, optical_correction (me, note_columns[i], bar_size)); return max_optical; } @@ -180,10 +181,10 @@ Staff_spacing::get_spacing (Grob *me, Grob *right_col, Real situational_space) ideal = fixed + distance / 2; } else if (scm_is_eq (type, ly_symbol2scm ("minimum-space"))) - ideal = last_ext[LEFT] + std::max (last_ext.length (), distance); + ideal = last_ext[LEFT] + max (last_ext.length (), distance); else if (scm_is_eq (type, ly_symbol2scm ("minimum-fixed-space"))) { - fixed = last_ext[LEFT] + std::max (last_ext.length (), distance); + fixed = last_ext[LEFT] + max (last_ext.length (), distance); ideal = fixed; } @@ -200,13 +201,13 @@ Staff_spacing::get_spacing (Grob *me, Grob *right_col, Real situational_space) Real min_dist = Paper_column::minimum_distance (left_col, right_col); /* ensure that the "fixed" distance will leave a gap of at least 0.3 ss. */ - Real min_dist_correction = std::max (0.0, 0.3 + min_dist - fixed); + Real min_dist_correction = max (0.0, 0.3 + min_dist - fixed); fixed += min_dist_correction; - ideal = std::max (ideal, fixed); + ideal = max (ideal, fixed); Spring ret (ideal, min_dist); - ret.set_inverse_stretch_strength (std::max (0.0, stretchability)); - ret.set_inverse_compress_strength (std::max (0.0, ideal - fixed)); + ret.set_inverse_stretch_strength (max (0.0, stretchability)); + ret.set_inverse_compress_strength (max (0.0, ideal - fixed)); return ret; } diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 1c44a67924..f88b41c450 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -180,7 +180,7 @@ Stem_tremolo::pure_height (SCM smob, SCM, SCM) int beam_count = Stem::beam_multiplicity (stem).length () + 1; Real beam_translation = get_beam_translation (me); - ph = ph - dir * std::max (beam_count, 1) * beam_translation; + ph = ph - dir * max (beam_count, 1) * beam_translation; ph = ph - ph.center (); return ly_interval2scm (ph); @@ -304,14 +304,14 @@ Stem_tremolo::y_offset (Grob *me, bool pure) Stem_info si = Stem::get_stem_info (stem); ph[-dir] = si.shortest_y_; - return (ph - dir * std::max (beam_count, 1) * beam_translation)[dir] - dir * 0.5 * me->pure_y_extent (me, 0, INT_MAX).length (); + return (ph - dir * max (beam_count, 1) * beam_translation)[dir] - dir * 0.5 * me->pure_y_extent (me, 0, INT_MAX).length (); } Real end_y = (pure ? stem->pure_y_extent (stem, 0, INT_MAX)[dir] : stem->extent (stem, Y_AXIS)[dir]) - - dir * std::max (beam_count, 1) * beam_translation + - dir * max (beam_count, 1) * beam_translation - Stem::beam_end_corrective (stem); if (!beam && Stem::duration_log (stem) >= 3) diff --git a/lily/stem.cc b/lily/stem.cc index 9d32e0b625..a8105c9402 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -41,6 +41,7 @@ #include "spanner.hh" #include // rint +using namespace std; #include "beam.hh" #include "directional-element-interface.hh" @@ -94,7 +95,7 @@ Stem::get_beaming (Grob *me, Direction d) SCM lst = index_get_cell (pair, d); int len = scm_ilength (lst); - return std::max (len, 0); + return max (len, 0); } Interval @@ -154,7 +155,7 @@ Stem::set_stem_positions (Grob *me, Real se) height[-d] = (height[d] - d * (0.5 * beam_thickness - + beam_translation * std::max (0, (beam_count - 1)) + + beam_translation * max (0, (beam_count - 1)) + stemlet_length)); } else if (!stemlet && beam) @@ -259,7 +260,7 @@ Stem::note_head_positions (Grob *me, bool filter) ps.push_back (p); } - vector_sort (ps, std::less ()); + vector_sort (ps, less ()); return ps; } @@ -344,8 +345,8 @@ Stem::internal_pure_height (Grob *me, bool calc_beam) for (vsize i = 0; i < my_stems.size (); i++) { coords.push_back (my_stems[i]->pure_relative_y_coordinate (common, 0, INT_MAX)); - min_pos = std::min (min_pos, coords[i]); - max_pos = std::max (max_pos, coords[i]); + min_pos = min (min_pos, coords[i]); + max_pos = max (max_pos, coords[i]); } for (vsize i = 0; i < heights.size (); i++) { @@ -430,7 +431,7 @@ Stem::internal_calc_stem_end_position (Grob *me, bool calc_beam) { SCM sshorten = ly_assoc_get (ly_symbol2scm ("stem-shorten"), details, SCM_EOL); SCM scm_shorten = scm_is_pair (sshorten) - ? robust_list_ref (std::max (duration_log (me) - 2, 0), sshorten) : SCM_EOL; + ? robust_list_ref (max (duration_log (me) - 2, 0), sshorten) : SCM_EOL; Real shorten_property = 2 * robust_scm2double (scm_shorten, 0); /* change in length between full-size and shortened stems is executed gradually. "transition area" = stems between full-sized and fully-shortened. @@ -442,14 +443,14 @@ Stem::internal_calc_stem_end_position (Grob *me, bool calc_beam) (but not greater than 1/2 and not smaller than 1/4). value 6 is heuristic; it determines the suggested transition slope steepnesas. */ - Real shortening_step = std::min (std::max (0.25, (shorten_property / 6)), 0.5); + Real shortening_step = min (max (0.25, (shorten_property / 6)), 0.5); /* Shortening of unflagged stems should begin on the first stem that sticks more than 1 staffspace (2 units) out of the staff. Shortening of flagged stems begins in the same moment as unflagged ones, but not earlier than on the middle line note. */ - Real which_step = (std::min (1.0, quarter_stem_length - (2 * staff_rad) - 2.0)) + abs (hp[dir]); - Real shorten = std::min (std::max (0.0, (shortening_step * which_step)), shorten_property); + Real which_step = (min (1.0, quarter_stem_length - (2 * staff_rad) - 2.0)) + abs (hp[dir]); + Real shorten = min (max (0.0, (shortening_step * which_step)), shorten_property); length -= shorten; } @@ -483,7 +484,7 @@ Stem::internal_calc_stem_end_position (Grob *me, bool calc_beam) if (dir == UP) minlen += beam_trans; } - length = std::max (length, minlen + 1.0); + length = max (length, minlen + 1.0); } Real stem_end = dir ? hp[dir] + dir * length : 0; @@ -743,7 +744,7 @@ Stem::internal_height (Grob *me, bool calc_beam) Real half_space = Staff_symbol_referencer::staff_space (me) * 0.5; - Interval stem_y = Interval (std::min (y1, y2), std::max (y2, y1)) * half_space; + Interval stem_y = Interval (min (y1, y2), max (y2, y1)) * half_space; return stem_y; } @@ -884,7 +885,7 @@ Stem::print (SCM smob) Real half_space = Staff_symbol_referencer::staff_space (me) * 0.5; - Interval stem_y = Interval (std::min (y1, y2), std::max (y2, y1)) * half_space; + Interval stem_y = Interval (min (y1, y2), max (y2, y1)) * half_space; stem_y[dir] -= beam_end_corrective (me); @@ -1048,7 +1049,7 @@ Stem::calc_stem_info (SCM smob) /* stem only extends to center of beam */ - 0.5 * beam_thickness; - ideal_length = std::max (ideal_length, ideal_minimum_length); + ideal_length = max (ideal_length, ideal_minimum_length); /* Convert to Y position, calculate for dir == UP */ Real note_start @@ -1078,9 +1079,9 @@ Stem::calc_stem_info (SCM smob) { /* Highest beam of (UP) beam must never be lower than middle staffline */ - ideal_y = std::max (ideal_y, 0.0); + ideal_y = max (ideal_y, 0.0); /* Lowest beam of (UP) beam must never be lower than second staffline */ - ideal_y = std::max (ideal_y, (-staff_space + ideal_y = max (ideal_y, (-staff_space - beam_thickness + height_of_my_beams)); } @@ -1096,7 +1097,7 @@ Stem::calc_stem_info (SCM smob) * length_fraction) : 0.0); - Real minimum_length = std::max (minimum_free, height_of_my_trem) + Real minimum_length = max (minimum_free, height_of_my_trem) + height_of_my_beams /* stem only extends to center of beam */ - 0.5 * beam_thickness; diff --git a/lily/stencil-integral.cc b/lily/stencil-integral.cc index 9a23d2f38c..a6e6d7c84b 100644 --- a/lily/stencil-integral.cc +++ b/lily/stencil-integral.cc @@ -55,6 +55,7 @@ when this transforms a point (x,y), the point is written as matrix: #include "skyline.hh" #include "skyline-pair.hh" #include "spanner.hh" +using namespace std; using std::string; using std::vector; @@ -186,8 +187,8 @@ make_draw_line_boxes (vector &boxes, vector > &buildings ////////////////////// if (x1 < x0) { - std::swap (x0, x1); - std::swap (y0, y1); + swap (x0, x1); + swap (y0, y1); } Offset left (x0, y0); Offset right (x1, y1); @@ -280,7 +281,7 @@ make_partial_ellipse_boxes (vector &boxes, Offset ep (cos (end) * x_rad, sin (end) * y_rad); ////////////////////// Drul_array > points; - int quantization = std::max (1, (int) (((x_rad * trans.xx) + (y_rad * trans.yy)) * M_PI / QUANTIZATION_UNIT)); + int quantization = max (1, (int) (((x_rad * trans.xx) + (y_rad * trans.yy)) * M_PI / QUANTIZATION_UNIT)); for (DOWN_and_UP (d)) { for (vsize i = 0; i < 1 + (vsize) quantization; i++) @@ -777,7 +778,7 @@ make_glyph_string_boxes (vector &boxes, { assert (abs (xlen - ylen) < 10e-3); - Real scale_factor = std::max (xlen, ylen); + Real scale_factor = max (xlen, ylen); // the three operations below move the stencil from its original coordinates to current coordinates pango_matrix_translate (&transcopy, kerned_bbox[X_AXIS][LEFT], kerned_bbox[Y_AXIS][DOWN] - real_bbox[Y_AXIS][DOWN]); diff --git a/lily/stencil.cc b/lily/stencil.cc index 7c1c918655..34b68d9b3a 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -249,7 +249,7 @@ Stencil::align_to (Axis a, Real x) /* See scheme Function. */ // Any stencil that is empty in the orthogonal axis is spacing. -// Spacing is not subjected to the std::max (0) rule and can thus be +// Spacing is not subjected to the max (0) rule and can thus be // negative. void diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 7eb8c99871..e5460a0f04 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -154,7 +154,7 @@ System_start_delimiter::staff_brace (Grob *me, Real y) int lo = 0; - int hi = std::max ((int) fm->count () - 1, 2); + int hi = max ((int) fm->count () - 1, 2); /* do a binary search for each Y, not very efficient, but passable? */ Box b; diff --git a/lily/tab-note-heads-engraver.cc b/lily/tab-note-heads-engraver.cc index 700ec99994..51ea30da01 100644 --- a/lily/tab-note-heads-engraver.cc +++ b/lily/tab-note-heads-engraver.cc @@ -22,6 +22,7 @@ #include "engraver.hh" +using namespace std; #include "articulations.hh" #include "duration.hh" diff --git a/lily/tab-tie-follow-engraver.cc b/lily/tab-tie-follow-engraver.cc index defbe19668..fbc5f0c3b2 100644 --- a/lily/tab-tie-follow-engraver.cc +++ b/lily/tab-tie-follow-engraver.cc @@ -22,6 +22,7 @@ #include "engraver.hh" +using namespace std; #include "context.hh" #include "item.hh" diff --git a/lily/text-interface.cc b/lily/text-interface.cc index b8ec1d6c88..7c5ce5019c 100644 --- a/lily/text-interface.cc +++ b/lily/text-interface.cc @@ -47,7 +47,7 @@ replace_special_characters (string &str, SCM props) int max_length = 0; for (SCM s = replacement_alist; scm_is_pair (s); s = scm_cdr (s)) { - max_length = std::max (max_length, scm_to_int + max_length = max (max_length, scm_to_int (scm_string_length (scm_caar (s)))); } diff --git a/lily/tie-column.cc b/lily/tie-column.cc index 1fb17a6f58..b814e4c442 100644 --- a/lily/tie-column.cc +++ b/lily/tie-column.cc @@ -32,6 +32,7 @@ #include "tie-formatting-problem.hh" #include "tie-configuration.hh" +using namespace std; using std::vector; void diff --git a/lily/tie-formatting-problem.cc b/lily/tie-formatting-problem.cc index d4a7be2cfb..6a5e62fde1 100644 --- a/lily/tie-formatting-problem.cc +++ b/lily/tie-formatting-problem.cc @@ -284,7 +284,7 @@ Tie_formatting_problem::set_chord_outline (vector bounds, for (vsize i = 0; i < bounds.size (); i++) ranks.push_back (bounds[i]->get_column ()->get_rank ()); - vector_sort (ranks, std::less ()); + vector_sort (ranks, less ()); uniq (ranks); for (vsize i = 0; i < ranks.size (); i++) @@ -481,7 +481,7 @@ Tie_formatting_problem::generate_configuration (int pos, Direction dir, } if (y_tune - && std::max (fabs (get_head_extent (columns[LEFT], LEFT, Y_AXIS)[dir] - y), + && max (fabs (get_head_extent (columns[LEFT], LEFT, Y_AXIS)[dir] - y), fabs (get_head_extent (columns[RIGHT], RIGHT, Y_AXIS)[dir] - y)) < 0.25 && !Staff_symbol_referencer::on_line (details_.staff_symbol_referencer_, pos)) { @@ -577,7 +577,7 @@ Tie_formatting_problem::generate_configuration (int pos, Direction dir, continue; conf->attachment_x_[d] - = d * std::min (d * conf->attachment_x_[d], + = d * min (d * conf->attachment_x_[d], d * (get_stem_extent (conf->column_ranks_[d], d, X_AXIS)[-d] - d * details_.stem_gap_)); } } @@ -625,7 +625,7 @@ Tie_formatting_problem::score_aptitude (Tie_configuration *conf, } { - Real relevant_dist = std::max (fabs (curve_y - tie_y) - 0.5, 0.0); + Real relevant_dist = max (fabs (curve_y - tie_y) - 0.5, 0.0); Real p = details_.vertical_distance_penalty_factor_ * convex_amplifier (1.0, 0.9, relevant_dist); if (ties_conf) ties_conf->add_tie_score (p, tie_idx, "vdist"); diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 4a8487adc5..1bad21ba40 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -238,7 +238,7 @@ Tuplet_bracket::calc_x_positions (SCM smob) if (to_boolean (me->get_property ("full-length-to-extent"))) coord = robust_relative_extent (bounds[d], commonx, X_AXIS)[LEFT]; - coord = std::max (coord, x_span[LEFT]); + coord = max (coord, x_span[LEFT]); x_span[d] = coord - padding; } diff --git a/lily/tuplet-iterator.cc b/lily/tuplet-iterator.cc index ad0d3c7361..c43e630c43 100644 --- a/lily/tuplet-iterator.cc +++ b/lily/tuplet-iterator.cc @@ -92,7 +92,7 @@ Moment Tuplet_iterator::pending_moment () const { Moment next_mom = Music_wrapper_iterator::pending_moment (); - next_mom = std::min (next_mom, next_split_mom_); + next_mom = min (next_mom, next_split_mom_); return next_mom; } @@ -110,7 +110,7 @@ Tuplet_iterator::process (Moment m) if (m.main_part_ < music_get_length ().main_part_) { spanner_duration_ = - std::min (music_get_length () - next_split_mom_, spanner_duration_); + min (music_get_length () - next_split_mom_, spanner_duration_); tuplet_handler_.set_context (get_outlet ()); report_event (create_event (START)); diff --git a/lily/tuplet-number.cc b/lily/tuplet-number.cc index a28458b2b8..df97093988 100644 --- a/lily/tuplet-number.cc +++ b/lily/tuplet-number.cc @@ -342,7 +342,7 @@ count_beams_not_touching_stem (SCM beaming) ++count; } - return std::max (0, count - 1); + return max (0, count - 1); } MAKE_SCHEME_CALLBACK (Tuplet_number, calc_y_offset, 1); @@ -418,8 +418,8 @@ Tuplet_number::calc_y_offset (SCM smob) : staff_ext_y[DOWN] > ref_stem_ext[UP]; if (move) { - Interval ledger_domain = Interval (std::min (staff_ext_y[UP], ref_stem_ext[UP]), - std::max (staff_ext_y[DOWN], ref_stem_ext[DOWN])); + Interval ledger_domain = Interval (min (staff_ext_y[UP], ref_stem_ext[UP]), + max (staff_ext_y[DOWN], ref_stem_ext[DOWN])); Interval num_y (me->extent (commony, Y_AXIS)); num_y.translate (y_offset); Interval num_ledger_overlap (num_y); diff --git a/lily/vaticana-ligature-engraver.cc b/lily/vaticana-ligature-engraver.cc index 36959d0518..f0e14849e8 100644 --- a/lily/vaticana-ligature-engraver.cc +++ b/lily/vaticana-ligature-engraver.cc @@ -732,7 +732,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, add_mora_column (prev_primitive->get_column ()); #if 0 // experimental code to collapse spacing after ligature - /* TODO: set to std::max (old/new spacing-increment), since other + /* TODO: set to max (old/new spacing-increment), since other voices/staves also may want to set this property. */ Item *first_primitive = dynamic_cast (primitives[0].grob ()); Paper_column *paper_column = first_primitive->get_column (); diff --git a/lily/vaticana-ligature.cc b/lily/vaticana-ligature.cc index c8be288013..eb38442c3f 100644 --- a/lily/vaticana-ligature.cc +++ b/lily/vaticana-ligature.cc @@ -108,7 +108,7 @@ vaticana_brew_flexa (Grob *me, */ Real left_height = right_height - + std::min (0.12 * abs (interval), 0.3) * staff_space; + + min (0.12 * abs (interval), 0.3) * staff_space; /* * Compensate optical illusion regarding vertical position of left diff --git a/lily/volta-bracket.cc b/lily/volta-bracket.cc index 65e57ea3b1..b135e8e198 100644 --- a/lily/volta-bracket.cc +++ b/lily/volta-bracket.cc @@ -18,6 +18,7 @@ */ #include +using namespace std; #include "warn.hh" #include "font-interface.hh" -- 2.39.2