From 31568c504806f35aac420a394c9eab07abd9faa7 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 11 Feb 2006 11:35:18 +0000 Subject: [PATCH] * flower/include/std-string.hh: * flower/include/std-vector.hh: Finish std:: conversion; move flower extensions from std:: namespace. Update users. * lily/include/lily-proto.hh: Replace Link_array__*_ macros by their expansion to vector<*>. Update users. --- ChangeLog | 9 + flower/file-name.cc | 22 +- flower/file-path.cc | 39 +- flower/getopt-long.cc | 34 +- flower/include/file-name.hh | 12 +- flower/include/file-path.hh | 22 +- flower/include/flower-proto.hh | 15 +- flower/include/getopt-long.hh | 6 +- flower/include/international.hh | 6 +- flower/include/interval-set.hh | 2 +- flower/include/interval.hh | 4 +- flower/include/interval.tcc | 8 +- flower/include/offset.hh | 2 +- flower/include/parray.hh | 2 +- flower/include/polynomial.hh | 14 +- flower/include/pqueue.hh | 2 +- flower/include/rational.hh | 2 +- flower/include/real.hh | 2 +- flower/include/std-string.hh | 39 +- flower/include/std-vector.hh | 378 ++++++++++---------- flower/include/string-convert.hh | 64 ++-- flower/include/warn.hh | 12 +- flower/international.cc | 12 +- flower/interval.cc | 8 +- flower/offset.cc | 8 +- flower/polynomial.cc | 18 +- flower/rational.cc | 10 +- flower/std-string.cc | 180 +++++----- flower/string-convert.cc | 106 +++--- flower/test-std.cc | 2 +- flower/warn.cc | 12 +- lily/accidental-engraver.cc | 10 +- lily/accidental-placement.cc | 34 +- lily/accidental.cc | 12 +- lily/align-interface.cc | 12 +- lily/all-font-metrics.cc | 24 +- lily/ambitus.cc | 2 +- lily/audio-element-info.cc | 4 +- lily/audio-item.cc | 4 +- lily/auto-beam-engraver.cc | 4 +- lily/auto-change-iterator.cc | 10 +- lily/axis-group-interface-scheme.cc | 2 +- lily/axis-group-interface.cc | 4 +- lily/bar-engraver.cc | 2 +- lily/bar-line.cc | 4 +- lily/beam-concave.cc | 10 +- lily/beam-engraver.cc | 2 +- lily/beam-quanting.cc | 26 +- lily/beam.cc | 16 +- lily/beaming-info.cc | 4 +- lily/bezier.cc | 20 +- lily/binary-source-file.cc | 10 +- lily/break-algorithm.cc | 18 +- lily/break-align-interface.cc | 16 +- lily/break-substitution.cc | 12 +- lily/change-iterator.cc | 14 +- lily/chord-name-engraver.cc | 2 +- lily/chord-tremolo-engraver.cc | 2 +- lily/clef.cc | 4 +- lily/cluster-engraver.cc | 2 +- lily/cluster.cc | 14 +- lily/coherent-ligature-engraver.cc | 10 +- lily/collision-engraver.cc | 2 +- lily/completion-note-heads-engraver.cc | 12 +- lily/context-def.cc | 8 +- lily/context-specced-music-iterator.cc | 2 +- lily/context.cc | 26 +- lily/custos-engraver.cc | 4 +- lily/custos.cc | 4 +- lily/dot-column-engraver.cc | 2 +- lily/dot-column.cc | 2 +- lily/dots.cc | 2 +- lily/drum-note-engraver.cc | 8 +- lily/drum-note-performer.cc | 4 +- lily/duration.cc | 10 +- lily/dynamic-engraver.cc | 8 +- lily/figured-bass-engraver.cc | 18 +- lily/file-name-map.cc | 6 +- lily/fingering-engraver.cc | 4 +- lily/font-config.cc | 4 +- lily/font-metric.cc | 14 +- lily/function-documentation.cc | 2 +- lily/general-scheme.cc | 8 +- lily/glissando-engraver.cc | 2 +- lily/global-ctor.cc | 4 +- lily/gourlay-breaking.cc | 20 +- lily/gregorian-ligature-engraver.cc | 6 +- lily/gregorian-ligature.cc | 6 +- lily/grid-line-span-engraver.cc | 2 +- lily/grob-array.cc | 6 +- lily/grob-info.cc | 4 +- lily/grob-interface.cc | 4 +- lily/grob-pq-engraver.cc | 2 +- lily/grob.cc | 8 +- lily/hara-kiri-group-spanner.cc | 2 +- lily/horizontal-bracket-engraver.cc | 4 +- lily/horizontal-bracket.cc | 2 +- lily/includable-lexer.cc | 10 +- lily/include/accidental-interface.hh | 4 +- lily/include/accidental-placement.hh | 4 +- lily/include/all-font-metrics.hh | 8 +- lily/include/audio-column.hh | 2 +- lily/include/audio-element-info.hh | 2 +- lily/include/audio-item.hh | 10 +- lily/include/audio-staff.hh | 2 +- lily/include/axis-group-engraver.hh | 2 +- lily/include/axis-group-interface.hh | 4 +- lily/include/bar-line.hh | 2 +- lily/include/bar.hh | 2 +- lily/include/beam.hh | 8 +- lily/include/beaming.hh | 2 +- lily/include/bezier.hh | 12 +- lily/include/binary-source-file.hh | 4 +- lily/include/book.hh | 2 +- lily/include/break-algorithm.hh | 12 +- lily/include/break-align-interface.hh | 2 +- lily/include/change-iterator.hh | 2 +- lily/include/coherent-ligature-engraver.hh | 6 +- lily/include/column-x-positions.hh | 6 +- lily/include/context-def.hh | 2 +- lily/include/context.hh | 24 +- lily/include/dimensions.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 | 16 +- lily/include/freetype.hh | 2 +- lily/include/gourlay-breaking.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 | 8 +- lily/include/horizontal-bracket.hh | 2 +- lily/include/includable-lexer.hh | 12 +- lily/include/input.hh | 14 +- lily/include/keyword.hh | 2 +- lily/include/kpath.hh | 2 +- lily/include/least-squares.hh | 2 +- lily/include/ligature-engraver.hh | 6 +- lily/include/lily-guile-macros.hh | 4 +- lily/include/lily-guile.hh | 10 +- lily/include/lily-lexer.hh | 12 +- lily/include/lily-parser.hh | 14 +- lily/include/lily-proto.hh | 26 +- lily/include/lily-version.hh | 6 +- lily/include/lilypond-input-version.hh | 6 +- lily/include/lilypond-key.hh | 16 +- lily/include/lookup.hh | 2 +- lily/include/main.hh | 22 +- lily/include/midi-item.hh | 40 +-- lily/include/midi-stream.hh | 6 +- lily/include/midi-walker.hh | 2 +- lily/include/misc.hh | 2 +- lily/include/modified-font-metric.hh | 12 +- lily/include/moment.hh | 2 +- lily/include/music-iterator.hh | 2 +- lily/include/note-collision.hh | 4 +- lily/include/open-type-font.hh | 16 +- lily/include/output-def.hh | 4 +- lily/include/pango-font.hh | 6 +- lily/include/paper-column-engraver.hh | 2 +- lily/include/paper-outputter.hh | 6 +- lily/include/paper-score.hh | 2 +- lily/include/performance.hh | 4 +- lily/include/performer-group.hh | 2 +- lily/include/pitch.hh | 4 +- lily/include/pointer-group-interface.hh | 8 +- lily/include/prob.hh | 2 +- lily/include/relocate.hh | 2 +- lily/include/rest.hh | 2 +- lily/include/score-engraver.hh | 2 +- lily/include/score.hh | 4 +- lily/include/separating-group-spanner.hh | 2 +- lily/include/simple-spacer.hh | 8 +- lily/include/skyline.hh | 18 +- lily/include/slur-configuration.hh | 4 +- lily/include/slur-scoring.hh | 14 +- lily/include/source-file.hh | 22 +- lily/include/source.hh | 2 +- lily/include/spacing-spanner.hh | 12 +- lily/include/spanner.hh | 2 +- lily/include/stem.hh | 2 +- lily/include/stream.hh | 4 +- lily/include/system.hh | 6 +- lily/include/text-metrics.hh | 2 +- lily/include/tfm-reader.hh | 12 +- lily/include/tfm.hh | 18 +- lily/include/tie-column-format.hh | 8 +- lily/include/tie-configuration.hh | 2 +- lily/include/tie-formatting-problem.hh | 12 +- 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/type-swallow-translator.hh | 2 +- lily/input-scheme.cc | 2 +- lily/input-smob.cc | 2 +- lily/input.cc | 14 +- lily/key-signature-interface.cc | 4 +- lily/laissez-vibrer-engraver.cc | 2 +- lily/laissez-vibrer-tie-column.cc | 2 +- lily/least-squares.cc | 2 +- lily/lexer.ll | 78 ++-- lily/ligature-bracket-engraver.cc | 4 +- lily/ligature-engraver.cc | 2 +- lily/lily-guile.cc | 32 +- lily/lily-lexer.cc | 6 +- lily/lily-parser-scheme.cc | 8 +- lily/lily-parser.cc | 10 +- lily/lily-version.cc | 14 +- lily/lilypond-key.cc | 8 +- lily/lilypond-version.cc | 10 +- lily/line-interface.cc | 2 +- lily/lookup.cc | 10 +- lily/lyric-engraver.cc | 2 +- lily/lyric-performer.cc | 2 +- lily/main.cc | 52 +-- lily/melody-spanner.cc | 2 +- lily/mensural-ligature-engraver.cc | 16 +- lily/midi-item.cc | 120 +++---- lily/midi-stream.cc | 6 +- lily/misc.cc | 6 +- lily/modified-font-metric.cc | 12 +- lily/moment.cc | 6 +- lily/multi-measure-rest-engraver.cc | 6 +- lily/music-function.cc | 2 +- lily/new-fingering-engraver.cc | 16 +- lily/new-lyric-combine-music-iterator.cc | 4 +- lily/note-collision.cc | 34 +- lily/note-head.cc | 12 +- lily/note-heads-engraver.cc | 6 +- lily/note-name-engraver.cc | 6 +- lily/note-performer.cc | 4 +- lily/note-spacing.cc | 6 +- lily/open-type-font-scheme.cc | 4 +- lily/open-type-font.cc | 22 +- lily/output-def.cc | 2 +- lily/output-property-engraver.cc | 2 +- lily/pango-font.cc | 14 +- lily/pango-select.cc | 4 +- lily/paper-book.cc | 6 +- lily/paper-column.cc | 6 +- lily/paper-outputter-scheme.cc | 4 +- lily/paper-outputter.cc | 4 +- lily/paper-score.cc | 8 +- lily/parser.yy | 2 +- lily/part-combine-iterator.cc | 4 +- lily/performance.cc | 6 +- lily/pfb.cc | 6 +- lily/phrasing-slur-engraver.cc | 4 +- lily/piano-pedal-engraver.cc | 16 +- lily/piano-pedal-performer.cc | 10 +- lily/pitch.cc | 8 +- lily/pitched-trill-engraver.cc | 2 +- lily/pointer-group-interface.cc | 10 +- lily/prob.cc | 2 +- lily/program-option.cc | 22 +- lily/relative-octave-check.cc | 2 +- lily/relocate.cc | 64 ++-- lily/repeat-acknowledge-engraver.cc | 2 +- lily/rest-collision-engraver.cc | 2 +- lily/rest-collision.cc | 6 +- lily/rest.cc | 10 +- lily/rhythmic-column-engraver.cc | 2 +- lily/script-column-engraver.cc | 2 +- lily/script-column.cc | 2 +- lily/script-engraver.cc | 2 +- lily/separating-group-spanner.cc | 2 +- lily/separating-line-group-engraver.cc | 2 +- lily/side-position-interface.cc | 2 +- lily/simple-spacer-scheme.cc | 2 +- lily/simple-spacer.cc | 4 +- lily/skyline.cc | 24 +- lily/slur-configuration.cc | 8 +- lily/slur-engraver.cc | 4 +- lily/slur-scoring.cc | 16 +- lily/slur.cc | 2 +- lily/source-file.cc | 26 +- lily/source.cc | 4 +- lily/spacing-determine-loose-columns.cc | 8 +- lily/spacing-engraver.cc | 4 +- lily/spacing-loose-columns.cc | 2 +- lily/spacing-spanner.cc | 12 +- lily/span-arpeggio-engraver.cc | 2 +- lily/span-bar-engraver.cc | 2 +- lily/span-bar.cc | 8 +- lily/span-dynamic-performer.cc | 4 +- lily/spanner.cc | 2 +- lily/staff-performer.cc | 8 +- lily/staff-spacing.cc | 2 +- lily/stanza-number-align-engraver.cc | 4 +- lily/stem.cc | 18 +- lily/sustain-pedal.cc | 6 +- lily/system-start-delimiter-engraver.cc | 2 +- lily/system.cc | 16 +- lily/tab-note-heads-engraver.cc | 8 +- lily/template5.cc | 2 +- lily/text-engraver.cc | 4 +- lily/text-interface.cc | 2 +- lily/text-metrics.cc | 8 +- lily/tfm-reader.cc | 8 +- lily/tfm.cc | 6 +- lily/tie-column.cc | 2 +- lily/tie-engraver.cc | 6 +- lily/tie-formatting-problem.cc | 24 +- lily/tie-performer.cc | 4 +- lily/time-signature.cc | 4 +- lily/translator-group.cc | 2 +- lily/translator.cc | 6 +- lily/ttf.cc | 8 +- lily/tuplet-bracket.cc | 4 +- lily/tuplet-engraver.cc | 4 +- lily/vaticana-ligature-engraver.cc | 16 +- lily/vaticana-ligature.cc | 2 +- lily/vertical-align-engraver.cc | 4 +- lily/volta-bracket.cc | 2 +- lily/volta-repeat-iterator.cc | 2 +- 319 files changed, 1662 insertions(+), 1688 deletions(-) diff --git a/ChangeLog b/ChangeLog index 093249f287..c4a39c8147 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-02-11 Jan Nieuwenhuizen + + * flower/include/std-string.hh: + * flower/include/std-vector.hh: Finish std:: conversion; move + flower extensions from std:: namespace. Update users. + + * lily/include/lily-proto.hh: Replace Link_array__*_ macros by + their expansion to vector<*>. Update users. + 2006-02-10 Graham Percival * Documentation/user/invoking.itely: add example to File structure. diff --git a/flower/file-name.cc b/flower/file-name.cc index 3ec427640b..e0ecc58e92 100644 --- a/flower/file-name.cc +++ b/flower/file-name.cc @@ -36,8 +36,8 @@ using namespace std; #endif #ifdef __CYGWIN__ -static std::string -dos_to_posix (std::string file_name) +static string +dos_to_posix (string file_name) { char buf[PATH_MAX] = ""; char *s = file_name.get_copy_str0 (); @@ -55,34 +55,34 @@ dos_to_posix (std::string file_name) #if 0 static /* avoid warning */ #endif -std::string -slashify (std::string file_name) +string +slashify (string file_name) { replace_all (file_name, '\\', '/'); - replace_all (file_name, std::string ("//"), "/"); + replace_all (file_name, string ("//"), "/"); return file_name; } /* Join components to full file_name. */ -std::string +string File_name::to_string () const { - std::string s; + string s; if (!root_.empty ()) - s = root_ + std::to_string (ROOTSEP); + s = root_ + ::to_string (ROOTSEP); if (!dir_.empty ()) { s += dir_; if (!base_.empty () || !ext_.empty ()) - s += std::to_string (DIRSEP); + s += ::to_string (DIRSEP); } s += base_; if (!ext_.empty ()) - s += std::to_string (EXTSEP) + ext_; + s += ::to_string (EXTSEP) + ext_; return s; } -File_name::File_name (std::string file_name) +File_name::File_name (string file_name) { #ifdef __CYGWIN__ /* All system functions would work, even if we do not convert to diff --git a/flower/file-path.cc b/flower/file-path.cc index c896a650fe..0b1b979b6b 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -13,7 +13,6 @@ #include #include -using namespace std; #include "config.hh" #if HAVE_SYS_STAT_H @@ -31,7 +30,7 @@ using namespace std; #define PATHSEP ':' #endif -std::vector +vector File_path::directories () const { return dirs_; @@ -44,7 +43,7 @@ File_path::directories () const #include void -File_path::parse_path (std::string p) +File_path::parse_path (string p) { ssize len; while ((len = p.length ())) @@ -53,12 +52,12 @@ File_path::parse_path (std::string p) if (i == NPOS) i = len; append (p.substr (0, i)); - p = p.substr (std::min (len, i + 1)); + p = p.substr (min (len, i + 1)); } } bool -is_file (std::string file_name) +is_file (string file_name) { #if !STAT_MACROS_BROKEN struct stat sbuf; @@ -78,7 +77,7 @@ is_file (std::string file_name) } bool -is_dir (std::string file_name) +is_dir (string file_name) { #if !STAT_MACROS_BROKEN struct stat sbuf; @@ -105,8 +104,8 @@ directory, in this order. @return The file name if found, or empty string if not found. */ -std::string -File_path::find (std::string name) const +string +File_path::find (string name) const { if (!name.length () || (name == "-")) return name; @@ -124,14 +123,14 @@ File_path::find (std::string name) const for (vsize i = 0; i < dirs_.size (); i++) { File_name file_name (name); - File_name dir = (std::string) dirs_[i]; + File_name dir = (string) dirs_[i]; file_name.root_ = dir.root_; dir.root_ = ""; if (file_name.dir_.empty ()) file_name.dir_ = dir.to_string (); else if (!dir.to_string ().empty ()) file_name.dir_ = dir.to_string () - + std::to_string (DIRSEP) + file_name.dir_; + + ::to_string (DIRSEP) + file_name.dir_; if (is_file (file_name.to_string ())) return file_name.to_string (); } @@ -145,21 +144,21 @@ File_path::find (std::string name) const where EXT is from EXTENSIONS. */ -std::string -File_path::find (std::string name, char const *extensions[]) +string +File_path::find (string name, char const *extensions[]) { if (name.empty () || name == "-") return name; File_name file_name (name); - std::string orig_ext = file_name.ext_; + string orig_ext = file_name.ext_; for (int i = 0; extensions[i]; i++) { file_name.ext_ = orig_ext; if (*extensions[i] && !file_name.ext_.empty ()) file_name.ext_ += "."; file_name.ext_ += extensions[i]; - std::string found = find (file_name.to_string ()); + string found = find (file_name.to_string ()); if (!found.empty ()) return found; } @@ -169,7 +168,7 @@ File_path::find (std::string name, char const *extensions[]) /** Append a directory, return false if failed. */ bool -File_path::try_append (std::string s) +File_path::try_append (string s) { if (s == "") s = "."; @@ -181,27 +180,27 @@ File_path::try_append (std::string s) return false; } -std::string +string File_path::to_string () const { - std::string s; + string s; for (vsize i = 0; i < dirs_.size (); i++) { s = s + dirs_[i]; if (i < dirs_.size () - 1) - s += std::to_string (PATHSEP); + s += ::to_string (PATHSEP); } return s; } void -File_path::append (std::string str) +File_path::append (string str) { dirs_.push_back (str); } void -File_path::prepend (std::string str) +File_path::prepend (string str) { dirs_.insert (dirs_.begin (), str); } diff --git a/flower/getopt-long.cc b/flower/getopt-long.cc index 561210dc60..17c1eafb7d 100644 --- a/flower/getopt-long.cc +++ b/flower/getopt-long.cc @@ -86,25 +86,25 @@ Getopt_long::parselong () return found_option_; } -std::string +string Long_option_init::to_string () const { - std::string str; + string str; if (shortname_char_) str += "-" + shortname_char_; if (shortname_char_ && longname_str0_) str += ", "; if (longname_str0_) - str += std::string ("`--") + longname_str0_ + "'"; + str += string ("`--") + longname_str0_ + "'"; return str; } -std::string +string Long_option_init::str_for_help () const { - std::string s; + string s; if (shortname_char_) - s = "-" + std::to_string (shortname_char_); + s = "-" + ::to_string (shortname_char_); else s = " "; @@ -133,7 +133,7 @@ Getopt_long::report (Errorcod c) if (!error_out_) return; - std::string str = arg_value_char_a_a_[0]; + string str = arg_value_char_a_a_[0]; str += ": "; switch (c) { @@ -147,9 +147,9 @@ Getopt_long::report (Errorcod c) break; case E_UNKNOWNOPTION: str += _f ("unrecognized option: `%s'", - std::string (argument_index_ - ? std::string ("-" + std::string (1, arg_value_char_a_a_[array_index_][argument_index_])) - : std::string (arg_value_char_a_a_[array_index_]))); + string (argument_index_ + ? string ("-" + string (1, arg_value_char_a_a_[array_index_][argument_index_])) + : string (arg_value_char_a_a_[array_index_]))); break; case E_ILLEGALARG: str += _f ("invalid argument `%s' to option `%s'", @@ -296,23 +296,23 @@ Getopt_long::get_next_arg () const int EXTRA_SPACES = 5; -std::string +string Long_option_init::table_string (Long_option_init *l) { - std::string tabstr = ""; + string tabstr = ""; int wid = 0; for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++) - wid = std::max (int(wid), int(l[i].str_for_help ().length ())); + wid = max (int(wid), int(l[i].str_for_help ().length ())); for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++) { - std::string s = " " + l[i].str_for_help (); - s += std::string (wid - s.length () + EXTRA_SPACES, ' '); + string s = " " + l[i].str_for_help (); + s += string (wid - s.length () + EXTRA_SPACES, ' '); - std::string help_text (gettext (l[i].help_str0_)); + string help_text (gettext (l[i].help_str0_)); replace_all (help_text, "\n", - "\n" + std::string (wid + EXTRA_SPACES + 2, ' ')); + "\n" + string (wid + EXTRA_SPACES + 2, ' ')); tabstr += s + help_text + "\n"; } diff --git a/flower/include/file-name.hh b/flower/include/file-name.hh index 253df35ee8..5fcadc2ce3 100644 --- a/flower/include/file-name.hh +++ b/flower/include/file-name.hh @@ -15,15 +15,15 @@ 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; }; #endif /* FILE_NAME */ diff --git a/flower/include/file-path.hh b/flower/include/file-path.hh index 9379eda5ad..bb69df245b 100644 --- a/flower/include/file-path.hh +++ b/flower/include/file-path.hh @@ -23,20 +23,20 @@ class File_path { - std::vector dirs_; + vector dirs_; public: - std::vector directories () const; - std::string find (std::string name) const; - std::string find (std::string name, char const *extensions[]); - std::string to_string () const; - bool try_append (std::string str); - void append (std::string str); - void parse_path (std::string); - void prepend (std::string str); + vector directories () const; + string find (string name) const; + string find (string name, char const *extensions[]); + string to_string () const; + bool try_append (string str); + void append (string str); + void parse_path (string); + void prepend (string str); }; -bool is_file (std::string file_name); -bool is_dir (std::string file_name); +bool is_file (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 650622eef9..91e2e36aae 100644 --- a/flower/include/flower-proto.hh +++ b/flower/include/flower-proto.hh @@ -15,16 +15,19 @@ template struct Hash_table; template struct Hash_table_iter; typedef unsigned char Byte; -namespace std { - struct String_data; - struct String_handle; - //template struct Array; - template struct Link_array; -} struct String_convert; +#if 0 +namespace std { +struct string; +template struct vector; +} +#else #include "std-string.hh" #include "std-vector.hh" +#endif +using namespace std; + #include "real.hh" template struct Link_list; diff --git a/flower/include/getopt-long.hh b/flower/include/getopt-long.hh index 0ab316fc94..ba5eb8df28 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 fdf41a9b96..1b29c45fa9 100644 --- a/flower/include/international.hh +++ b/flower/include/international.hh @@ -22,14 +22,14 @@ /** 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, ...); -std::string _f (char const *format, std::string s, std::string s2 = "", std::string s3 = ""); +string _f (char const *format, ...); +string _f (char const *format, string s, string s2 = "", string s3 = ""); #endif // INTERNATIONAL_HH diff --git a/flower/include/interval-set.hh b/flower/include/interval-set.hh index 6a6ad9e3cb..eda3a5ef26 100644 --- a/flower/include/interval-set.hh +++ b/flower/include/interval-set.hh @@ -21,7 +21,7 @@ */ struct Interval_set { - std::vector allowed_regions_; + vector allowed_regions_; Interval_set (); void set_full (); diff --git a/flower/include/interval.hh b/flower/include/interval.hh index 6cc16eb696..1b095dedc3 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -23,7 +23,7 @@ struct Interval_t : public Drul_array 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) { @@ -110,7 +110,7 @@ struct Interval_t : public Drul_array Drul_array da (at (LEFT), at (RIGHT)); return ::linear_combination (da, x); } - 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 a72837bd9f..f43d52587f 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -105,15 +105,15 @@ Interval_t::intersect (Interval_t h) } 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/offset.hh b/flower/include/offset.hh index 73684355ae..f45ec7f90e 100644 --- a/flower/include/offset.hh +++ b/flower/include/offset.hh @@ -93,7 +93,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 3d24532bcc..69b7add103 100644 --- a/flower/include/parray.hh +++ b/flower/include/parray.hh @@ -14,7 +14,7 @@ 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 c3bbc17d6c..faf52d2026 100644 --- a/flower/include/polynomial.hh +++ b/flower/include/polynomial.hh @@ -19,7 +19,7 @@ struct Polynomial int degree ()const; /// coefficients - std::vector coefs_; + vector coefs_; // leading coef Real &lc (); @@ -28,8 +28,8 @@ struct Polynomial Real lc () const; void print () const; Real eval (Real) 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); @@ -55,11 +55,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 17d45f32b5..6a936b8e6f 100644 --- a/flower/include/pqueue.hh +++ b/flower/include/pqueue.hh @@ -34,7 +34,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 461b2522a2..290d02b960 100644 --- a/flower/include/rational.hh +++ b/flower/include/rational.hh @@ -69,7 +69,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 5f0fcd91ea..5d8457e42a 100644 --- a/flower/include/real.hh +++ b/flower/include/real.hh @@ -13,7 +13,7 @@ #include /* - MacOS 10.3 uses g++ 3.3 which doesn't have std::isinf() + MacOS 10.3 uses g++ 3.3 which doesn't have isinf() */ // #include #include diff --git a/flower/include/std-string.hh b/flower/include/std-string.hh index ca48190875..d9552b4820 100644 --- a/flower/include/std-string.hh +++ b/flower/include/std-string.hh @@ -1,5 +1,5 @@ /* - std-string.hh -- declare std::string + std-string.hh -- declare string source file of the GNU LilyPond music typesetter @@ -13,29 +13,28 @@ #include -namespace std { +using namespace std; - typedef size_t ssize; -#define NPOS std::string::npos +typedef size_t ssize; +#define NPOS string::npos - string to_string (string s); - 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 (unsigned); - string to_string (bool b); - string to_string (char const *format, ...); +string to_string (string s); +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 (unsigned); +string to_string (bool b); +string to_string (char const *format, ...); - string &replace_all (string &str, string find, string replace); - string &replace_all (string &str, char find, char replace); - char *string_copy (string s); - - int string_compare (string const &, string const &); +string &replace_all (string &str, string find, string replace); +string &replace_all (string &str, char find, char replace); +char *string_copy (string s); + +int string_compare (string const &, string const &); - INSTANTIATE_COMPARE (string const &, string_compare); -} +INSTANTIATE_COMPARE (string const &, string_compare); #endif /* STD_STRING_HH */ diff --git a/flower/include/std-vector.hh b/flower/include/std-vector.hh index d7056b62c4..69fecfdc31 100644 --- a/flower/include/std-vector.hh +++ b/flower/include/std-vector.hh @@ -1,5 +1,5 @@ /* - std-vector.hh -- declare std::vector + std-vector.hh -- declare vector source file of the GNU LilyPond music typesetter @@ -13,6 +13,8 @@ #include /* unary_function */ #include +using namespace std; + #if HAVE_BOOST_LAMBDA #include #endif @@ -20,12 +22,12 @@ template int default_compare (T const &a, T const &b) { - if (a < b) - return -1; - else if (a > b) - return 1; - else - return 0; + if (a < b) + return -1; + else if (a > b) + return 1; + else + return 0; } template @@ -42,6 +44,12 @@ int default_compare (T *const &a, T *const &b) #include "compare.hh" #include "config.hh" +#ifndef VSIZE +#define VSIZE +typedef size_t vsize; +#define VPOS UINT_MAX +#endif + #if HAVE_STL_DATA_METHOD #include #else /* !HAVE_STL_DATA_METHOD */ @@ -51,12 +59,6 @@ int default_compare (T *const &a, T *const &b) namespace std { - #ifndef VSIZE - #define VSIZE - typedef size_t vsize; - #define VPOS UINT_MAX - #endif - /* Interface without pointer arithmetic (iterator) semantics. */ template class vector : public __vector @@ -112,227 +114,215 @@ namespace std { } while (*hi - *lo > 1); } -} +} /* namespace std */ #endif /* !HAVE_STL_DATA_METHOD */ -namespace std { - - #ifndef VSIZE - #define VSIZE - typedef size_t vsize; - #define VPOS UINT_MAX - #endif - - template - T const & - boundary (vector const &v, int dir, vsize i) - { - assert (dir); - return v[dir == -1 ? i : v.size () - 1 - i]; - } +template +T const & +boundary (vector const &v, int dir, vsize i) +{ + assert (dir); + return v[dir == -1 ? i : v.size () - 1 - i]; +} - template - T & - boundary (vector &v, int dir, vsize i) - { - assert (dir); - return v[dir == -1 ? i : v.size () - 1 - i]; - } +template +T & +boundary (vector &v, int dir, vsize i) +{ + assert (dir); + return v[dir == -1 ? i : v.size () - 1 - i]; +} - template - T const & - back (vector const &v, vsize i) - { - return v[v.size () - i - 1]; - } +template +T const & +back (vector const &v, vsize i) +{ + return v[v.size () - i - 1]; +} - template - T& - back (vector &v, vsize i) - { - return v[v.size () - i - 1]; - } +template +T& +back (vector &v, vsize i) +{ + return v[v.size () - i - 1]; +} - template - void - concat (vector &v, vector const& w) - { - v.insert (v.end (), w.begin (), w.end ()); - } +template +void +concat (vector &v, vector const& w) +{ + v.insert (v.end (), w.begin (), w.end ()); +} - template - void - binary_search_bounds (vector const &table, - T const &key, int (*compare) (T const &, T const &), - vsize *lo, - vsize *hi) - { - if (*lo >= *hi) - return; +template +void +binary_search_bounds (vector const &table, + T const &key, int (*compare) (T const &, T const &), + vsize *lo, + vsize *hi) +{ + if (*lo >= *hi) + return; - int cmp; - int result; + int cmp; + int result; - /* binary search */ - do - { - cmp = (*lo + *hi) / 2; + /* binary search */ + do + { + cmp = (*lo + *hi) / 2; - result = (*compare) (key, table[cmp]); + result = (*compare) (key, table[cmp]); - if (result < 0) - *hi = cmp; - else - *lo = cmp; - } - while (*hi - *lo > 1); - } + if (result < 0) + *hi = cmp; + else + *lo = cmp; + } + while (*hi - *lo > 1); +} #if 0 - /* FIXME: what if COMPARE is named: int operator == (T const&, T const&), - wouldn't that work for most uses of BINARY_SEARCH? - */ - template - vsize - binary_search (vector const &v, - T const &key, int (*compare) (T const &, T const &), - vsize b=0, vsize e=VPOS) - { - if (e == VPOS) - e = v.size (); - typename vector::const_iterator i = find (v.begin () + b, - v.begin () + e, - key); - if (i != v.end ()) - return i - v.begin (); - return VPOS; - } +/* FIXME: what if COMPARE is named: int operator == (T const&, T const&), + wouldn't that work for most uses of BINARY_SEARCH? +*/ +template +vsize +binary_search (vector const &v, + T const &key, int (*compare) (T const &, T const &), + vsize b=0, vsize e=VPOS) +{ + if (e == VPOS) + e = v.size (); + typename vector::const_iterator i = find (v.begin () + b, + v.begin () + e, + key); + if (i != v.end ()) + return i - v.begin (); + return VPOS; +} #else // c&p from array.icc; cannot easily use stl_algo:find b.o. compare func. - template - vsize - binary_search (vector const &table, - T const &key, - int (*compare) (T const &, T const &), - vsize lo=0, - vsize hi=VPOS) - { - if (hi == VPOS) - hi = table.size (); +template +vsize +binary_search (vector const &table, + T const &key, + int (*compare) (T const &, T const &), + vsize lo=0, + vsize hi=VPOS) +{ + if (hi == VPOS) + hi = table.size (); - if (lo >= hi) - return VPOS; + if (lo >= hi) + return VPOS; - binary_search_bounds (table, key, compare, &lo, &hi); + binary_search_bounds (table, key, compare, &lo, &hi); - if (! (*compare) (key, table[lo])) - return lo; + if (! (*compare) (key, table[lo])) + return lo; - /* not found */ - return VPOS; - } + /* not found */ + return VPOS; +} #endif #if 0 - /* FIXME: the COMPARE functionality is broken? */ - template - void - vector_sort (vector &v, int (*compare) (T const &, T const &), - vsize lower=VPOS, vsize upper=VPOS) - { - typename vector::iterator b = v.begin (); - typename vector::iterator e = v.begin (); - if (lower == VPOS) - { - lower = 0; - upper = v.size (); - } - ::std::sort (b + lower, e + upper, compare); - } +/* FIXME: the COMPARE functionality is broken? */ +template +void +vector_sort (vector &v, int (*compare) (T const &, T const &), + vsize lower=VPOS, vsize upper=VPOS) +{ + typename vector::iterator b = v.begin (); + typename vector::iterator e = v.begin (); + if (lower == VPOS) + { + lower = 0; + upper = v.size (); + } + sort (b + lower, e + upper, compare); +} #else - // ugh, c&p - template void - vector_sort (vector &v, int (*compare) (T const &, T const &), - vsize lower=VPOS, vsize upper=VPOS) - { - if (lower == VPOS) - { - lower = 0; - upper = v.size () - 1; +// ugh, c&p +template void +vector_sort (vector &v, int (*compare) (T const &, T const &), + vsize lower=VPOS, vsize upper=VPOS) +{ + if (lower == VPOS) + { + lower = 0; + upper = v.size () - 1; } - if (upper == VPOS || lower >= upper) - return; - swap (v[lower], v[(lower + upper) / 2]); - vsize last = lower; - for (vsize i = lower +1; i <= upper; i++) - if (compare (v[i], v[lower]) < 0) - swap (v[++last], v[i]); - swap (v[lower], v[last]); - vector_sort (v, compare, lower, last - 1); - vector_sort (v, compare, last + 1, upper); - } + if (upper == VPOS || lower >= upper) + return; + swap (v[lower], v[(lower + upper) / 2]); + vsize last = lower; + for (vsize i = lower +1; i <= upper; i++) + if (compare (v[i], v[lower]) < 0) + swap (v[++last], v[i]); + swap (v[lower], v[last]); + vector_sort (v, compare, lower, last - 1); + vector_sort (v, compare, last + 1, upper); +} #endif - template - void - reverse (vector &v) - { - // CHECKME: for a simple vector, like vector, this should - // expand to memrev. - ::std::reverse (v.begin (), v.end ()); - } +template +void +reverse (vector &v) +{ + // CHECKME: for a simple vector, like vector, this should + // expand to memrev. + reverse (v.begin (), v.end ()); +} - template - void - uniq (vector &v) - { - v.erase (unique (v.begin (), v.end ()), v.end ()); - } +template +void +uniq (vector &v) +{ + v.erase (unique (v.begin (), v.end ()), v.end ()); +} - template - typename vector::const_iterator - find (vector const &v, T const &key) - { - return ::std::find (v.begin (), v.end (), key); - } +template +typename vector::const_iterator +find (vector const &v, T const &key) +{ + return find (v.begin (), v.end (), key); +} #if HAVE_BOOST_LAMBDA #include - using namespace boost::lambda; - template - void - junk_pointers (vector &v) - { - for_each (v.begin (), v.end (), (delete _1, _1 = 0)); - v.clear (); - } +using namespace boost::lambda; +template +void +junk_pointers (vector &v) +{ + for_each (v.begin (), v.end (), (delete _1, _1 = 0)); + v.clear (); +} #else - template struct del : public unary_function - { - void operator() (T x) - { - delete x; - x = 0; - } - }; - - template - void - junk_pointers (vector &v) +template struct del : public unary_function +{ + void operator() (T x) { - // Hmm. - ::std::for_each (v.begin (), v.end (), del ()); - v.clear (); + delete x; + x = 0; } -#endif /* HAVE_BOOST_LAMBDA */ +}; +template +void +junk_pointers (vector &v) +{ + // Hmm. + for_each (v.begin (), v.end (), del ()); + v.clear (); } - -using namespace std; +#endif /* HAVE_BOOST_LAMBDA */ #endif /* STD_VECTOR_HH */ diff --git a/flower/include/string-convert.hh b/flower/include/string-convert.hh index c7ba970266..2cd863f495 100644 --- a/flower/include/string-convert.hh +++ b/flower/include/string-convert.hh @@ -12,44 +12,44 @@ using namespace std; #include "std-string.hh" #include "flower-proto.hh" -/** The functor std::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 (std::string s, int length); - static std::string bool_string (bool b); - static std::string bin2dec (std::string bin_string); - static std::string bin2hex (std::string bin_string); - static std::string dec2bin (std::string str); - static int bin2int (std::string bin_string); - static unsigned bin2unsigned (std::string bin_string); - static std::string char_string (char c, int n); - static int dec2int (std::string dec_string); - static double dec2double (std::string dec_string); - static std::string double_string (double f, char const *fmt = 0); - static std::string form_string (char const *format, ...); - static std::string vform_string (char const *format, va_list args); - static int hex2int (std::string str); - static unsigned hex2unsigned (std::string str); - static std::string hex2bin (std::string str); - static std::string int_string (int i, char const *fmt = 0); - static std::string unsigned_string (unsigned); - static std::string long_string (long); - static std::string int2hex (int i, int length_i, char ch); - static std::string unsigned2hex (unsigned u, ssize length, char ch); - static std::string int2dec (int i, int 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::vector split (std::string str, char c); - 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 (string s, int length); + static string bool_string (bool b); + static string bin2dec (string bin_string); + static string bin2hex (string bin_string); + static string dec2bin (string str); + static int bin2int (string bin_string); + static unsigned bin2unsigned (string bin_string); + static string char_string (char c, int n); + static int dec2int (string dec_string); + static double dec2double (string dec_string); + static string double_string (double f, char const *fmt = 0); + static string form_string (char const *format, ...); + static string vform_string (char const *format, va_list args); + static int hex2int (string str); + static unsigned hex2unsigned (string str); + static string hex2bin (string str); + static string int_string (int i, char const *fmt = 0); + static string unsigned_string (unsigned); + static string long_string (long); + static string int2hex (int i, int length_i, char ch); + static string unsigned2hex (unsigned u, ssize length, char ch); + static string int2dec (int i, int length_i, char ch); + static string rational_string (Rational); + static string pointer_string (void const *); + static string precision_string (double x, int n); + static vector split (string str, char c); + 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/warn.hh b/flower/include/warn.hh index 6b4cd85322..5171b2efb7 100644 --- a/flower/include/warn.hh +++ b/flower/include/warn.hh @@ -11,11 +11,11 @@ #include "std-string.hh" -void error (std::string s); -void message (std::string s); -void non_fatal_error (std::string); -void programming_error (std::string s); -void progress_indication (std::string s); -void warning (std::string s); +void error (string s); +void message (string s); +void non_fatal_error (string); +void programming_error (string s); +void progress_indication (string s); +void warning (string s); #endif /* WARN_HH */ diff --git a/flower/international.cc b/flower/international.cc index c50a3bad33..7bb4130856 100644 --- a/flower/international.cc +++ b/flower/international.cc @@ -21,24 +21,24 @@ gettext (char const *s) #include #endif -std::string +string _ (char const *ch) { - return std::string (gettext (ch)); + return string (gettext (ch)); } -std::string +string _f (char const *format, ...) { va_list args; va_start (args, format); - std::string str = String_convert::vform_string (gettext (format), args); + string str = String_convert::vform_string (gettext (format), args); va_end (args); return str; } -std::string -_f (char const *format, std::string s, std::string s2, std::string s3) +string +_f (char const *format, string s, string s2, string s3) { return String_convert::form_string (gettext (format), s.c_str (), s2.c_str (), s3.c_str ()); diff --git a/flower/interval.cc b/flower/interval.cc index 7b0c34d02e..b785796851 100644 --- a/flower/interval.cc +++ b/flower/interval.cc @@ -18,10 +18,10 @@ Interval_t::infinity () } template<> -std::string +string Interval_t::T_to_string (Real r) { - return std::to_string (r); + return ::to_string (r); } template<> @@ -32,10 +32,10 @@ Interval_t::infinity () } template<> -std::string +string Interval_t::T_to_string (int i) { - return std::to_string (i); + return ::to_string (i); } template INTERVAL__INSTANTIATE (int); diff --git a/flower/offset.cc b/flower/offset.cc index b45809e0b9..a0e87b58cf 100644 --- a/flower/offset.cc +++ b/flower/offset.cc @@ -10,12 +10,12 @@ #ifndef STANDALONE -std::string +string Offset::to_string () const { - std::string s; - s = std::string (" (") + std::to_string (coordinate_a_[X_AXIS]) + ", " - + std::to_string (coordinate_a_[Y_AXIS]) + ")"; + string s; + s = string (" (") + ::to_string (coordinate_a_[X_AXIS]) + ", " + + ::to_string (coordinate_a_[Y_AXIS]) + ")"; return s; } #endif diff --git a/flower/polynomial.cc b/flower/polynomial.cc index 5f71914767..f6f2291280 100644 --- a/flower/polynomial.cc +++ b/flower/polynomial.cc @@ -174,7 +174,7 @@ Polynomial::check_sol (Real x) const } void -Polynomial::check_sols (std::vector roots) const +Polynomial::check_sols (vector roots) const { for (vsize i = 0; i < roots.size (); i++) check_sol (roots[i]); @@ -203,10 +203,10 @@ iszero (Real r) return !r; } -std::vector +vector Polynomial::solve_cubic ()const { - std::vector sol; + vector sol; /* normal form: x^3 + Ax^2 + Bx + C = 0 */ Real A = coefs_[2] / coefs_[3]; @@ -295,10 +295,10 @@ Polynomial::degree ()const /* all roots of quadratic eqn. */ -std::vector +vector Polynomial::solve_quadric ()const { - std::vector sol; + vector sol; /* normal form: x^2 + px + q = 0 */ Real p = coefs_[1] / (2 * coefs_[2]); Real q = coefs_[0] / coefs_[2]; @@ -316,16 +316,16 @@ Polynomial::solve_quadric ()const } /* solve linear equation */ -std::vector +vector Polynomial::solve_linear ()const { - std::vector s; + vector s; if (coefs_[1]) s.push_back (-coefs_[0] / coefs_[1]); return s; } -std::vector +vector Polynomial::solve () const { Polynomial *me = (Polynomial *) this; @@ -340,7 +340,7 @@ Polynomial::solve () const case 3: return solve_cubic (); } - std::vector s; + vector s; return s; } diff --git a/flower/rational.cc b/flower/rational.cc index 3e8c421886..a0c0d22410 100644 --- a/flower/rational.cc +++ b/flower/rational.cc @@ -269,18 +269,18 @@ Rational::operator -= (Rational r) return (*this += r); } -std::string +string Rational::to_string () const { if (is_infinity ()) { - std::string s (sign_ > 0 ? "" : "-"); - return std::string (s + "infinity"); + string s (sign_ > 0 ? "" : "-"); + return string (s + "infinity"); } - std::string s = std::to_string (num ()); + string s = ::to_string (num ()); if (den () != 1 && num ()) - s += "/" + std::to_string (den ()); + s += "/" + ::to_string (den ()); return s; } diff --git a/flower/std-string.cc b/flower/std-string.cc index 666a4bee7e..0fdc96f5f6 100644 --- a/flower/std-string.cc +++ b/flower/std-string.cc @@ -9,97 +9,93 @@ #include "std-string.hh" #include "string-convert.hh" -namespace std { - - std::string - to_string (std::string s) - { - return s; - } - - std::string - to_string (char c, int n) - { - return std::string (max (n, 0), c); - } - - std::string - to_string (double f, char const *format) - { - return String_convert::double_string (f, format); - } - - std::string - to_string (int i, char const *format) - { - return String_convert::int_string (i, format); - } - - std::string - to_string (bool b) - { - return String_convert::bool_string (b); - } - - std::string - to_string (long b) - { - return String_convert::long_string (b); - } - - std::string - to_string (long unsigned b) - { - return String_convert::unsigned_string (b); - } - - std::string - to_string (unsigned u) - { - return String_convert::unsigned_string (u); - } - - std::string - to_string (char const *format, ...) - { - va_list args; - va_start (args, format); - std::string str = String_convert::vform_string (format, args); - va_end (args); - return str; - } - - std::string & - replace_all (std::string &str, std::string find, std::string replace) - { - ssize len = find.length (); - for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + len)) - str = str.replace (i, len, replace); - return str; - } - - std::string & - replace_all (std::string &str, char find, char replace) - { - for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + 1)) - str[i] = replace; - return str; - } - - char * - string_copy (std::string s) - { - ssize len = s.length (); - char *dest = new char[len + 1]; - //s.copy (dest, len + 1); - memcpy (dest, s.c_str (), len + 1); - return dest; - } - - int - string_compare (std::string const &a, std::string const &b) - { - return a.compare (b); - } +string +to_string (string s) +{ + return s; +} + +string +to_string (char c, int n) +{ + return string (max (n, 0), c); +} + +string +to_string (double f, char const *format) +{ + return String_convert::double_string (f, format); +} + +string +to_string (int i, char const *format) +{ + return String_convert::int_string (i, format); +} + +string +to_string (bool b) +{ + return String_convert::bool_string (b); +} + +string +to_string (long b) +{ + return String_convert::long_string (b); +} + +string +to_string (long unsigned b) +{ + return String_convert::unsigned_string (b); +} + +string +to_string (unsigned u) +{ + return String_convert::unsigned_string (u); +} + +string +to_string (char const *format, ...) +{ + va_list args; + va_start (args, format); + string str = String_convert::vform_string (format, args); + va_end (args); + return str; +} + +string & +replace_all (string &str, string find, string replace) +{ + ssize len = find.length (); + for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + len)) + str = str.replace (i, len, replace); + return str; +} + +string & +replace_all (string &str, char find, char replace) +{ + for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + 1)) + str[i] = replace; + return str; +} + +char * +string_copy (string s) +{ + ssize len = s.length (); + char *dest = new char[len + 1]; + //s.copy (dest, len + 1); + memcpy (dest, s.c_str (), len + 1); + return dest; +} +int +string_compare (string const &a, string const &b) +{ + return a.compare (b); } diff --git a/flower/string-convert.cc b/flower/string-convert.cc index 738a396606..2175dd8cd4 100644 --- a/flower/string-convert.cc +++ b/flower/string-convert.cc @@ -27,16 +27,16 @@ using namespace std; */ static const int STRING_BUFFER_LEN = 1024; -std::string +string String_convert::bool_string (bool b) { - return std::string (b ? "true" : "false"); + return string (b ? "true" : "false"); } -std::string -String_convert::bin2hex (std::string bin_string) +string +String_convert::bin2hex (string bin_string) { - std::string str; + string str; Byte const *byte = (Byte const*)bin_string.data (); for (ssize i = 0; i < bin_string.length (); i++) { @@ -47,13 +47,13 @@ String_convert::bin2hex (std::string bin_string) } int -String_convert::bin2int (std::string bin_string) +String_convert::bin2int (string bin_string) { return bin2unsigned (bin_string); } unsigned -String_convert::bin2unsigned (std::string bin_string) +String_convert::bin2unsigned (string bin_string) { assert (bin_string.length () <= (int)sizeof (unsigned)); @@ -66,9 +66,9 @@ String_convert::bin2unsigned (std::string bin_string) return result_u; } -// breendet imp from std::string +// breendet imp from string int -String_convert::dec2int (std::string dec_string) +String_convert::dec2int (string dec_string) { if (!dec_string.length ()) return 0; @@ -80,17 +80,17 @@ String_convert::dec2int (std::string dec_string) return (int)l; } -std::string +string String_convert::i64_string (I64 i64, char const *fmt) { char buffer[STRING_BUFFER_LEN]; snprintf (buffer, STRING_BUFFER_LEN, (fmt ? fmt : "%Ld"), i64); // assume radix 10 - return std::string (buffer); + return string (buffer); } -// breendet imp from std::string +// breendet imp from string double -String_convert::dec2double (std::string dec_string) +String_convert::dec2double (string dec_string) { if (!dec_string.length ()) return 0; @@ -101,7 +101,7 @@ String_convert::dec2double (std::string dec_string) } int -String_convert::hex2bin (std::string hex_string, std::string &bin_string_r) +String_convert::hex2bin (string hex_string, string &bin_string_r) { if (hex_string.length () % 2) hex_string = "0" + hex_string; @@ -121,10 +121,10 @@ String_convert::hex2bin (std::string hex_string, std::string &bin_string_r) return 0; } -std::string -String_convert::hex2bin (std::string hex_string) +string +String_convert::hex2bin (string hex_string) { - std::string str; + string str; // silly, asserts should alway be "on"! // assert (!hex2bin (hex_string, str) ); int error_i = hex2bin (hex_string, str); @@ -145,7 +145,7 @@ String_convert::hex2nibble (Byte byte) } // stupido. Should use int_string () -std::string +string String_convert::int2dec (int i, int length_i, char ch) { char fill_char = ch; @@ -153,17 +153,17 @@ String_convert::int2dec (int i, int length_i, char ch) fill_char = '0'; // ugh - std::string dec_string = to_string (i); + string dec_string = to_string (i); // ugh return to_string (fill_char, length_i - dec_string.length ()) + dec_string; } // stupido. Should use int_string () -std::string +string String_convert::unsigned2hex (unsigned u, ssize length, char fill_char) { - std::string str; + string str; if (!u) str = "0"; @@ -184,7 +184,7 @@ String_convert::unsigned2hex (unsigned u, ssize length, char fill_char) return str; } -std::string +string String_convert::int2hex (int i, int length_i, char fill_char) { return unsigned2hex ((unsigned)i, length_i, fill_char); @@ -204,16 +204,16 @@ String_convert::nibble2hex_byte (Byte byte) @param #fmt# is a printf style format, default assumes "%d" as format. */ -std::string +string String_convert::int_string (int i, char const *fmt) { char buffer[STRING_BUFFER_LEN]; snprintf (buffer, STRING_BUFFER_LEN, (fmt ? fmt : "%d"), i); // assume radix 10 - return std::string (buffer); + return string (buffer); } -std::string +string String_convert::form_string (char const *format, ...) { va_list args; @@ -221,15 +221,15 @@ String_convert::form_string (char const *format, ...) char buffer[STRING_BUFFER_LEN]; vsnprintf (buffer, STRING_BUFFER_LEN, format, args); va_end (args); - return std::string (buffer); + return string (buffer); } -std::string +string String_convert::vform_string (char const *format, va_list args) { char buffer[STRING_BUFFER_LEN]; vsnprintf (buffer, STRING_BUFFER_LEN, format, args); - return std::string (buffer); + return string (buffer); } /** @@ -237,13 +237,13 @@ String_convert::vform_string (char const *format, va_list args) @param #fmt# is a printf style format, default assumes "%lf" as format */ -std::string +string String_convert::double_string (double f, char const *fmt) { char buf[STRING_BUFFER_LEN]; snprintf (buf, STRING_BUFFER_LEN, fmt ? fmt : "%f", f); - return std::string (buf); + return string (buf); } /** @@ -252,30 +252,30 @@ String_convert::double_string (double f, char const *fmt) @param #n# is a repetition count, default value is 1 */ -std::string +string String_convert::char_string (char c, int n) { n = n >= 0 ? n : 0; char *ch = new char[ n ]; memset (ch, c, n); - std::string s (ch, n); + string s (ch, n); delete[] ch; return s; } -std::string +string String_convert::rational_string (Rational r) { return r.to_string (); } -std::string +string String_convert::pointer_string (void const *l) { char buffer[STRING_BUFFER_LEN]; snprintf (buffer, STRING_BUFFER_LEN, "%p", l); // assume radix 10 - return std::string (buffer); + return string (buffer); } /** @@ -284,11 +284,11 @@ String_convert::pointer_string (void const *l) @param #n# is the number of nonzero digits */ -std::string +string String_convert::precision_string (double x, int n) { - std::string format = "%." + to_string (max (0, n - 1)) + "e"; - std::string str = double_string (abs (x), format.c_str ()); + 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)); str = str.substr (0, str.length () - 4); @@ -315,14 +315,14 @@ String_convert::precision_string (double x, int n) return (sign (x) > 0 ? str : "-" + str); } -std::vector -String_convert::split (std::string str, char c) +vector +String_convert::split (string str, char c) { - std::vector a; + vector a; ssize i = str.find (c); while (i != NPOS) { - std::string s = str.substr (0, i); + string s = str.substr (0, i); a.push_back (s); while (str[++i] == c) ; @@ -334,7 +334,7 @@ String_convert::split (std::string str, char c) return a; } -std::string +string String_convert::long_string (long l) { char s[STRING_BUFFER_LEN]; @@ -342,7 +342,7 @@ String_convert::long_string (long l) return s; } -std::string +string String_convert::unsigned_string (unsigned u) { char s[STRING_BUFFER_LEN]; @@ -350,26 +350,26 @@ String_convert::unsigned_string (unsigned u) return s; } -std::string -String_convert::pad_to (std::string s, int n) +string +String_convert::pad_to (string s, int n) { - return s + std::string (max (int(n - s.length ()), 0), ' '); + return s + string (max (int(n - s.length ()), 0), ' '); } -std::string -String_convert::to_upper (std::string s) +string +String_convert::to_upper (string s) { return strnupr ((char *)s.c_str (), s.length ()); } -std::string -String_convert::to_lower (std::string s) +string +String_convert::to_lower (string s) { return strnlwr ((char *)s.c_str (), s.length ()); } -std::string -String_convert::reverse (std::string s) +string +String_convert::reverse (string s) { return (char*) memrev ((unsigned char *)s.data (), s.length ()); } diff --git a/flower/test-std.cc b/flower/test-std.cc index e6f0da3d3e..c2214418a5 100644 --- a/flower/test-std.cc +++ b/flower/test-std.cc @@ -189,7 +189,7 @@ init_unit_test_suite (int, char**) vector w; binary_search_bounds (w, (char*)1, &default_compare, &i, &j); - test_suite *test = BOOST_TEST_SUITE("std::Flower"); + test_suite *test = BOOST_TEST_SUITE("Flower"); test->add (BOOST_TEST_CASE (vector_erase)); test->add (BOOST_TEST_CASE (vector_slice)); test->add (BOOST_TEST_CASE (vector_sorting)); diff --git a/flower/warn.cc b/flower/warn.cc index 1dcf357736..4014b73adb 100644 --- a/flower/warn.cc +++ b/flower/warn.cc @@ -20,7 +20,7 @@ static bool progress_newline = true; /* Display user information that is not a full message. */ void -progress_indication (std::string s) +progress_indication (string s) { /* Test if all silly progress_indication ("\n") can be dropped now. */ if (s == "\n") @@ -34,7 +34,7 @@ progress_indication (std::string s) /* Display a single user message. Always starts on a new line. */ void -message (std::string s) +message (string s) { if (!progress_newline) fputc ('\n', stderr); @@ -43,27 +43,27 @@ message (std::string s) /* Display a warning message. Always starts on a new line. */ void -warning (std::string s) +warning (string s) { message (_f ("warning: %s", s.c_str ()) + "\n"); } void -non_fatal_error (std::string s) +non_fatal_error (string s) { message (_f ("error: %s", s.c_str ()) + "\n"); } /* Display an error message. Always starts on a new line. */ void -error (std::string s) +error (string s) { non_fatal_error (s); exit (1); } void -programming_error (std::string s) +programming_error (string s) { message (_f ("programming error: %s", s) + "\n"); message (_ ("continuing, cross fingers") + "\n"); diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index 1c626529ca..0534eebbd3 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -77,13 +77,13 @@ public: to store all information before we can really create the accidentals. */ - std::vector left_objects_; - std::vector right_objects_; + vector left_objects_; + vector right_objects_; Grob *accidental_placement_; - std::vector accidentals_; - std::vector ties_; + vector accidentals_; + vector ties_; }; /* @@ -533,7 +533,7 @@ Accidental_engraver::acknowledge_rhythmic_head (Grob_info info) && note->is_mus_type ("note-event")) { /* - std::string harmonics usually don't have accidentals. + string harmonics usually don't have accidentals. */ if (to_boolean (get_property ("harmonicAccidentals")) || !ly_is_equal (info.grob ()->get_property ("style"), diff --git a/lily/accidental-placement.cc b/lily/accidental-placement.cc index f800047988..d8702520e1 100644 --- a/lily/accidental-placement.cc +++ b/lily/accidental-placement.cc @@ -57,8 +57,8 @@ Accidental_placement::add_accidental (Grob *me, Grob *a) */ void Accidental_placement::split_accidentals (Grob *accs, - Link_array__Grob_ *break_reminder, - Link_array__Grob_ *real_acc) + vector *break_reminder, + vector *real_acc) { for (SCM acs = accs->get_object ("accidental-grobs"); scm_is_pair (acs); acs = scm_cdr (acs)) @@ -82,8 +82,8 @@ Accidental_placement::get_relevant_accidental_extent (Grob *me, Item *item_col, Grob *left_object) { - Link_array__Grob_ br, ra; - Link_array__Grob_ *which = 0; + vector br, ra; + vector *which = 0; Accidental_placement::split_accidentals (me, &br, &ra); concat (br, ra); @@ -108,11 +108,11 @@ Accidental_placement::get_relevant_accidental_extent (Grob *me, struct Accidental_placement_entry { - std::vector left_skyline_; - std::vector right_skyline_; + vector left_skyline_; + vector right_skyline_; Interval vertical_extent_; - std::vector extents_; - Link_array__Grob_ grobs_; + vector extents_; + vector grobs_; Real offset_; int notename_; Accidental_placement_entry () @@ -149,9 +149,9 @@ int ape_rcompare (Accidental_placement_entry *const &a, placement */ void -stagger_apes (Link_array__Accidental_placement_entry_ *apes) +stagger_apes (vector *apes) { - Link_array__Accidental_placement_entry_ asc = *apes; + vector asc = *apes; vector_sort (asc, &ape_compare); @@ -233,7 +233,7 @@ Accidental_placement::calc_positioning_done (SCM smob) TODO: there is a bug in this code. If two accs are on the same Y-position, they share an Ape, and will be printed in overstrike. */ - Link_array__Accidental_placement_entry_ apes; + vector apes; for (SCM s = accs; scm_is_pair (s); s = scm_cdr (s)) { Accidental_placement_entry *ape = new Accidental_placement_entry; @@ -251,7 +251,7 @@ Accidental_placement::calc_positioning_done (SCM smob) First we must extract *all* pointers. We can only determine extents if we're sure that we've found the right common refpoint */ - Link_array__Grob_ note_cols, heads; + vector note_cols, heads; for (vsize i = apes.size (); i--;) { Accidental_placement_entry *ape = apes[i]; @@ -306,7 +306,7 @@ Accidental_placement::calc_positioning_done (SCM smob) { Grob *a = apes[i]->grobs_[j]; - std::vector boxes = Accidental_interface::accurate_boxes (a, common); + vector boxes = Accidental_interface::accurate_boxes (a, common); ape->extents_.insert (ape->extents_.end (), boxes.begin (), boxes.end ()); for (vsize j = boxes.size (); j--;) @@ -332,8 +332,8 @@ Accidental_placement::calc_positioning_done (SCM smob) Accidental_placement_entry *head_ape = new Accidental_placement_entry; common[X_AXIS] = common_refpoint_of_array (heads, common[X_AXIS], X_AXIS); - std::vector head_skyline (empty_skyline (LEFT)); - std::vector head_extents; + vector head_skyline (empty_skyline (LEFT)); + vector head_extents; for (vsize i = heads.size (); i--;) { Box b (heads[i]->extent (common[X_AXIS], X_AXIS), @@ -347,7 +347,7 @@ Accidental_placement::calc_positioning_done (SCM smob) Real padding = robust_scm2double (me->get_property ("padding"), 0.2); - std::vector left_skyline = head_ape->left_skyline_; + vector left_skyline = head_ape->left_skyline_; heighten_skyline (&left_skyline, -robust_scm2double (me->get_property ("right-padding"), 0)); /* @@ -364,7 +364,7 @@ Accidental_placement::calc_positioning_done (SCM smob) apes[i]->offset_ = offset; - std::vector new_left_skyline = apes[i]->left_skyline_; + vector new_left_skyline = apes[i]->left_skyline_; heighten_skyline (&new_left_skyline, apes[i]->offset_); merge_skyline (&new_left_skyline, left_skyline, LEFT); left_skyline = new_left_skyline; diff --git a/lily/accidental.cc b/lily/accidental.cc index 2996513543..d79c17a9e9 100644 --- a/lily/accidental.cc +++ b/lily/accidental.cc @@ -52,14 +52,14 @@ Accidental_interface::after_line_breaking (SCM smob) return SCM_UNSPECIFIED; } -std::vector +vector Accidental_interface::accurate_boxes (Grob *a, Grob **common) { Box b; b[X_AXIS] = a->extent (a, X_AXIS); b[Y_AXIS] = a->extent (a, Y_AXIS); - std::vector boxes; + vector boxes; bool parens = false; if (to_boolean (a->get_property ("cautionary"))) @@ -142,8 +142,8 @@ Accidental_interface::accurate_boxes (Grob *a, Grob **common) /* todo: this sort of stuff in Scheme. --hwn. */ -std::string -Accidental_interface::get_fontcharname (std::string style, int alteration) +string +Accidental_interface::get_fontcharname (string style, int alteration) { if (alteration == DOUBLE_FLAT || alteration == DOUBLE_SHARP) @@ -202,7 +202,7 @@ Accidental_interface::print (SCM smob) } SCM scm_style = me->get_property ("style"); - std::string style; + string style; if (scm_is_symbol (scm_style)) style = ly_symbol2string (scm_style); else @@ -232,7 +232,7 @@ Accidental_interface::print (SCM smob) scm_is_pair (s); s = scm_cdr (s)) { int alteration = scm_to_int (scm_car (s)); - std::string font_char = get_fontcharname (style, alteration); + string font_char = get_fontcharname (style, alteration); Stencil acc (fm->find_by_name ("accidentals." + font_char)); if (acc.is_empty ()) diff --git a/lily/align-interface.cc b/lily/align-interface.cc index 6faaa013c0..0b8bfc0b9c 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -89,13 +89,13 @@ Align_interface::align_to_fixed_distance (Grob *me, Axis a) extract_grob_set (me, "elements", elem_source); - Link_array__Grob_ elems (elem_source); // writable.. + vector elems (elem_source); // writable.. Real where_f = 0; Interval v; v.set_empty (); - std::vector translates; + vector translates; for (vsize j = elems.size (); j--;) { @@ -160,8 +160,8 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a) Interval threshold = robust_scm2interval (me->get_property ("threshold"), Interval (0, Interval::infinity ())); - std::vector dims; - Link_array__Grob_ elems; + vector dims; + vector elems; extract_grob_set (me, "elements", all_grobs); for (vsize i = 0; i < all_grobs.size (); i++) @@ -196,7 +196,7 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a) : SCM_EOL, extra_space); - std::vector translates; + vector translates; for (vsize j = 0; j < elems.size (); j++) { Real dy = -dims[j][-stacking_dir]; @@ -233,7 +233,7 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a) /* also move the grobs that were empty, to maintain spatial order. */ - std::vector all_translates; + vector all_translates; if (translates.size ()) { Real w = translates[0]; diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 576a9d86f1..f7334849b8 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -18,7 +18,7 @@ static char const *default_font_str0_ = "cmr10"; -All_font_metrics::All_font_metrics (std::string path) +All_font_metrics::All_font_metrics (string path) { tfm_dict_ = new Scheme_hash_table; otf_dict_ = new Scheme_hash_table; @@ -74,7 +74,7 @@ All_font_metrics::find_pango_font (PangoFontDescription *description, if (!pango_dict_->try_retrieve (key, &val)) { if (be_verbose_global) - progress_indication ("[" + std::string (pango_fn)); + progress_indication ("[" + string (pango_fn)); Pango_font *pf = new Pango_font (pango_ft2_fontmap_, description, @@ -97,11 +97,11 @@ All_font_metrics::find_pango_font (PangoFontDescription *description, #endif -std::string -kpathsea_find_file (std::string name, std::string ext) +string +kpathsea_find_file (string name, string ext) { name += "." + ext; - std::string path = global_path.find (name); + string path = global_path.find (name); if (path.length () > 0) return path; @@ -124,14 +124,14 @@ kpathsea_find_file (std::string name, std::string ext) } Open_type_font * -All_font_metrics::find_otf (std::string name) +All_font_metrics::find_otf (string name) { SCM sname = ly_symbol2scm (name.c_str ()); SCM name_string = scm_makfrom0str (name.c_str ()); SCM val; if (!otf_dict_->try_retrieve (sname, &val)) { - std::string file_name; + string file_name; if (file_name.empty ()) file_name = search_path_.find (name + ".otf"); @@ -157,20 +157,20 @@ All_font_metrics::find_otf (std::string name) } Tex_font_metric * -All_font_metrics::find_tfm (std::string name) +All_font_metrics::find_tfm (string name) { SCM sname = ly_symbol2scm (name.c_str ()); SCM name_string = scm_makfrom0str (name.c_str ()); SCM val; if (!tfm_dict_->try_retrieve (sname, &val)) { - std::string file_name; + string file_name; if (file_name.empty ()) { /* FIXME: should add "cork-" prefix to lm* fonts. How to do that, cleanly? */ - std::string p = kpathsea_find_file (name, "tfm"); + string p = kpathsea_find_file (name, "tfm"); if (p.length ()) file_name = p; } @@ -199,7 +199,7 @@ All_font_metrics::find_tfm (std::string name) } Font_metric * -All_font_metrics::find_font (std::string name) +All_font_metrics::find_font (string name) { Font_metric *f = find_otf (name); @@ -214,7 +214,7 @@ All_font_metrics::find_font (std::string name) warning (_ ("loading default font")); } - std::string def_name = default_font_str0_; + string def_name = default_font_str0_; if (!f) f = find_tfm (def_name); diff --git a/lily/ambitus.cc b/lily/ambitus.cc index 9f1f5e769d..c27ebc468d 100644 --- a/lily/ambitus.cc +++ b/lily/ambitus.cc @@ -30,7 +30,7 @@ Ambitus::print (SCM smob) && heads.size () > 1) { Grob *common - = common_refpoint_of_array (Link_array__Grob_ (heads.begin (), + = common_refpoint_of_array (vector (heads.begin (), heads.begin () + 2), me, Y_AXIS); diff --git a/lily/audio-element-info.cc b/lily/audio-element-info.cc index edc322a052..f6dd6b471f 100644 --- a/lily/audio-element-info.cc +++ b/lily/audio-element-info.cc @@ -25,11 +25,11 @@ Audio_element_info::Audio_element_info () origin_trans_ = 0; } -Link_array__Context_ +vector Audio_element_info::origin_contexts (Translator *end) const { Context *t = origin_trans_->context (); - Link_array__Context_ r; + vector r; do { r.push_back (t); diff --git a/lily/audio-item.cc b/lily/audio-item.cc index b5edac5fbb..0e4ded6386 100644 --- a/lily/audio-item.cc +++ b/lily/audio-item.cc @@ -11,7 +11,7 @@ #include "midi-item.hh" #include "audio-column.hh" -Audio_instrument::Audio_instrument (std::string instrument_string) +Audio_instrument::Audio_instrument (string instrument_string) { str_ = instrument_string; } @@ -62,7 +62,7 @@ Audio_time_signature::Audio_time_signature (int beats, int one_beat) one_beat_ = one_beat; } -Audio_text::Audio_text (Audio_text::Type type, std::string text_string) +Audio_text::Audio_text (Audio_text::Type type, string text_string) { text_string_ = text_string; type_ = type; diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index b7a9269057..a70755bc33 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -56,7 +56,7 @@ private: */ Moment shortest_mom_; Spanner *finished_beam_; - Link_array__Item_ *stems_; + vector *stems_; int process_acknowledged_count_; Moment last_add_mom_; @@ -210,7 +210,7 @@ Auto_beam_engraver::begin_beam () return; } - stems_ = new Link_array__Item_; + stems_ = new vector; grouping_ = new Beaming_info_list; beam_settings_ = updated_grob_properties (context (), ly_symbol2scm ("Beam")); diff --git a/lily/auto-change-iterator.cc b/lily/auto-change-iterator.cc index bc589b25bb..bbf2fe509f 100644 --- a/lily/auto-change-iterator.cc +++ b/lily/auto-change-iterator.cc @@ -22,11 +22,11 @@ protected: virtual void do_quit (); virtual void construct_children (); virtual void process (Moment); - std::vector pending_pitch (Moment) const; + vector pending_pitch (Moment) const; private: SCM split_list_; Direction where_dir_; - void change_to (Music_iterator *, SCM, std::string); + void change_to (Music_iterator *, SCM, string); Moment start_moment_; Context_handle up_; @@ -35,7 +35,7 @@ private: void Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym, - std::string to_id) + string to_id) { Context *current = it->get_outlet (); Context *last = 0; @@ -58,7 +58,7 @@ Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym, if (current && current->id_string () == to_id) { - std::string msg; + string msg; msg += _f ("can't change, already in translator: %s", to_id); } @@ -101,7 +101,7 @@ Auto_change_iterator::process (Moment m) if (d && d != where_dir_) { where_dir_ = d; - std::string to_id = (d >= 0) ? "up" : "down"; + string to_id = (d >= 0) ? "up" : "down"; change_to (child_iter_, ly_symbol2scm ("Staff"), to_id); diff --git a/lily/axis-group-interface-scheme.cc b/lily/axis-group-interface-scheme.cc index 8a672ea94f..bc1449f8da 100644 --- a/lily/axis-group-interface-scheme.cc +++ b/lily/axis-group-interface-scheme.cc @@ -22,7 +22,7 @@ LY_DEFINE (ly_relative_group_extent, "ly:relative-group-extent", SCM_ASSERT_TYPE (unsmob_grob (common), common, SCM_ARG2, __FUNCTION__, "grob"); SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis"); - Link_array__Grob_ elts; + vector elts; if (!ga) { for (SCM s = elements; scm_is_pair (s); s = scm_cdr (s)) diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index a994a2b321..b13eecd868 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -45,7 +45,7 @@ Axis_group_interface::has_axis (Grob *me, Axis a) } Interval -Axis_group_interface::relative_group_extent (Link_array__Grob_ const &elts, +Axis_group_interface::relative_group_extent (vector const &elts, Grob *common, Axis a) { Interval r; @@ -88,7 +88,7 @@ Axis_group_interface::generic_group_extent (Grob *me, Axis a) } void -Axis_group_interface::get_children (Grob *me, Link_array__Grob_ *found) +Axis_group_interface::get_children (Grob *me, vector *found) { found->push_back (me); diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index 85c98ead9c..af7d39929e 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -21,7 +21,7 @@ class Bar_engraver : public Engraver { public: TRANSLATOR_DECLARATIONS (Bar_engraver); - void request_bar (std::string type_string); + void request_bar (string type_string); protected: virtual void finalize (); diff --git a/lily/bar-line.cc b/lily/bar-line.cc index 28acd4f68a..4922a84d37 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -26,7 +26,7 @@ Bar_line::print (SCM smob) if (scm_is_string (s) && scm_is_number (barsize)) { - std::string str = ly_scm2string (s); + string str = ly_scm2string (s); Real sz = robust_scm2double (barsize, 0); if (sz <= 0) return SCM_EOL; @@ -37,7 +37,7 @@ Bar_line::print (SCM smob) } Stencil -Bar_line::compound_barline (Grob *me, std::string str, Real h, +Bar_line::compound_barline (Grob *me, string str, Real h, bool rounded) { Real kern = robust_scm2double (me->get_property ("kern"), 1); diff --git a/lily/beam-concave.cc b/lily/beam-concave.cc index 1b55e94004..47ee57bbf5 100644 --- a/lily/beam-concave.cc +++ b/lily/beam-concave.cc @@ -10,7 +10,7 @@ #include "directional-element-interface.hh" bool -is_concave_single_notes (std::vector const &positions, Direction beam_dir) +is_concave_single_notes (vector const &positions, Direction beam_dir) { Interval covering; covering.add_point (positions[0]); @@ -57,7 +57,7 @@ is_concave_single_notes (std::vector const &positions, Direction beam_dir) } Real -calc_positions_concaveness (std::vector const &positions, Direction beam_dir) +calc_positions_concaveness (vector const &positions, Direction beam_dir) { Real dy = positions.back () - positions[0]; Real slope = dy / Real (positions.size () - 1); @@ -87,7 +87,7 @@ Beam::calc_concaveness (SCM smob) { Grob *me = unsmob_grob (smob); - Link_array__Grob_ stems + vector stems = extract_grob_array (me, "stems"); if (is_knee (me)) @@ -108,8 +108,8 @@ Beam::calc_concaveness (SCM smob) if (stems.size () <= 2) return SCM_UNSPECIFIED; - std::vector close_positions; - std::vector far_positions; + vector close_positions; + vector far_positions; for (vsize i = 0; i < stems.size (); i++) { /* diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index e8a77ec1ff..d0ee1903d0 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -243,7 +243,7 @@ Beam_engraver::acknowledge_stem (Grob_info info) Music *m = info.ultimate_music_cause (); if (!m->is_mus_type ("rhythmic-event")) { - std::string s = _ ("stem must have Rhythmic structure"); + string s = _ ("stem must have Rhythmic structure"); if (info.music_cause ()) info.music_cause ()->origin ()->warning (s); else diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index 90e0bb7cde..3bfa11dfd1 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -62,7 +62,7 @@ struct Quant_score Real demerits; #if DEBUG_QUANTING - std::string score_card_; + string score_card_; #endif }; @@ -78,7 +78,7 @@ struct Quant_score */ int -best_quant_score_idx (std::vector const &qscores) +best_quant_score_idx (vector const &qscores) { Real best = 1e6; int best_idx = -1; @@ -123,8 +123,8 @@ Beam::quanting (SCM smob, SCM posns) Real quants [] = {straddle, sit, inter, hang }; int num_quants = int (sizeof (quants) / sizeof (Real)); - std::vector quantsl; - std::vector quantsr; + vector quantsl; + vector quantsr; /* going to REGION_SIZE == 2, yields another 0.6 second with @@ -139,11 +139,11 @@ Beam::quanting (SCM smob, SCM posns) Do stem computations. These depend on YL and YR linearly, so we can precompute for every stem 2 factors. */ - Link_array__Grob_ stems + vector stems = extract_grob_array (me, "stems"); - std::vector stem_infos; - std::vector base_lengths; - std::vector stem_xposns; + vector stem_infos; + vector base_lengths; + vector stem_xposns; Drul_array dirs_found (0, 0); Grob *common[2]; @@ -209,7 +209,7 @@ Beam::quanting (SCM smob, SCM posns) quantsr.push_back (i + quants[j] + int (yr)); } - std::vector qscores; + vector qscores; for (vsize l = 0; l < quantsl.size (); l++) for (vsize r = 0; r < quantsr.size (); r++) @@ -327,10 +327,10 @@ Beam::quanting (SCM smob, SCM posns) } Real -Beam::score_stem_lengths (Link_array__Grob_ const &stems, - std::vector const &stem_infos, - std::vector const &base_stem_ys, - std::vector const &stem_xs, +Beam::score_stem_lengths (vector const &stems, + vector const &stem_infos, + vector const &base_stem_ys, + vector const &stem_xs, Real xl, Real xr, bool knee, Real yl, Real yr, diff --git a/lily/beam.cc b/lily/beam.cc index ce0f1aff2c..49acbbd541 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -352,9 +352,9 @@ Beam::print (SCM grob) SCM left = (i > 0) ? scm_cdr (last_beaming) : SCM_EOL; SCM right = stem ? scm_car (this_beaming) : SCM_EOL; - std::vector full_beams; - std::vector lfliebertjes; - std::vector rfliebertjes; + vector full_beams; + vector lfliebertjes; + vector rfliebertjes; for (SCM s = left; scm_is_pair (s); s = scm_cdr (s)) @@ -506,7 +506,7 @@ Beam::print (SCM grob) should be switchable for those who want to twiddle with the parameters. */ - std::string str; + string str; SCM properties = Font_interface::text_font_alist_chain (me); Direction stem_dir = stems.size () ? to_dir (stems[0]->get_property ("direction")) : UP; @@ -614,7 +614,7 @@ Beam::consider_auto_knees (Grob *me) Grob *common = common_refpoint_of_array (stems, me, Y_AXIS); Real staff_space = Staff_symbol_referencer::staff_space (me); - std::vector head_extents_array; + vector head_extents_array; for (vsize i = 0; i < stems.size (); i++) { Grob *stem = stems[i]; @@ -785,7 +785,7 @@ Beam::calc_least_squares_positions (SCM smob, SCM posns) if (count < 1) return ly_interval2scm (pos); - std::vector x_posns; + vector x_posns; extract_grob_set (me, "stems", stems); Grob *commonx = common_refpoint_of_array (stems, me, X_AXIS); Grob *commony = common_refpoint_of_array (stems, me, Y_AXIS); @@ -845,7 +845,7 @@ Beam::calc_least_squares_positions (SCM smob, SCM posns) } else { - std::vector ideals; + vector ideals; for (vsize i = 0; i < stems.size (); i++) { Grob *s = stems[i]; @@ -891,7 +891,7 @@ Beam::shift_region_to_valid (SCM grob, SCM posns) /* Code dup. */ - std::vector x_posns; + vector x_posns; extract_grob_set (me, "stems", stems); Grob *commonx = common_refpoint_of_array (stems, me, X_AXIS); Grob *commony = common_refpoint_of_array (stems, me, Y_AXIS); diff --git a/lily/beaming-info.cc b/lily/beaming-info.cc index 27dcc68265..fb4b934a9e 100644 --- a/lily/beaming-info.cc +++ b/lily/beaming-info.cc @@ -68,9 +68,9 @@ Beaming_info_list::beamify (Moment &beat_length, bool subdivide) Drul_array splits; int m = best_splitpoint_index (beat_length, subdivide); bool split = subdivide && (m & at_beat); m = m & ~at_beat; - splits[LEFT].infos_ = std::vector (infos_.begin (), + splits[LEFT].infos_ = vector (infos_.begin (), infos_.begin () + m); - splits[RIGHT].infos_ = std::vector (infos_.begin () + m, + splits[RIGHT].infos_ = vector (infos_.begin () + m, infos_.end ()); Direction d = LEFT; diff --git a/lily/bezier.cc b/lily/bezier.cc index 47d0184329..f5489e7d40 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -30,7 +30,7 @@ binomial_coefficient (Real over, int under) } void -scale (std::vector *array, Real x, Real y) +scale (vector *array, Real x, Real y) { for (vsize i = 0; i < array->size (); i++) { @@ -40,7 +40,7 @@ scale (std::vector *array, Real x, Real y) } void -rotate (std::vector *array, Real phi) +rotate (vector *array, Real phi) { Offset rot (complex_exp (Offset (0, phi))); for (vsize i = 0; i < array->size (); i++) @@ -48,7 +48,7 @@ rotate (std::vector *array, Real phi) } void -translate (std::vector *array, Offset o) +translate (vector *array, Offset o) { for (vsize i = 0; i < array->size (); i++) (*array)[i] += o; @@ -67,7 +67,7 @@ Real Bezier::get_other_coordinate (Axis a, Real x) const { Axis other = Axis ((a +1) % NO_AXES); - std::vector ts = solve_point (a, x); + vector ts = solve_point (a, x); if (ts.size () == 0) { @@ -169,8 +169,8 @@ Bezier::polynomial (Axis a) const /** Remove all numbers outside [0, 1] from SOL */ -std::vector -filter_solutions (std::vector sol) +vector +filter_solutions (vector sol) { for (vsize i = sol.size (); i--;) if (sol[i] < 0 || sol[i] > 1) @@ -181,7 +181,7 @@ filter_solutions (std::vector sol) /** find t such that derivative is proportional to DERIV */ -std::vector +vector Bezier::solve_derivative (Offset deriv) const { Polynomial xp = polynomial (X_AXIS); @@ -197,13 +197,13 @@ Bezier::solve_derivative (Offset deriv) const /* Find t such that curve_point (t)[AX] == COORDINATE */ -std::vector +vector Bezier::solve_point (Axis ax, Real coordinate) const { Polynomial p (polynomial (ax)); p.coefs_[0] -= coordinate; - std::vector sol (p.solve ()); + vector sol (p.solve ()); return filter_solutions (sol); } @@ -217,7 +217,7 @@ Bezier::extent (Axis a) const Offset d; d[Axis (o)] = 1.0; Interval iv; - std::vector sols (solve_derivative (d)); + vector sols (solve_derivative (d)); sols.push_back (1.0); sols.push_back (0.0); for (vsize i = sols.size (); i--;) diff --git a/lily/binary-source-file.cc b/lily/binary-source-file.cc index 818d5a4f2b..90d4a4ac02 100644 --- a/lily/binary-source-file.cc +++ b/lily/binary-source-file.cc @@ -12,7 +12,7 @@ using namespace std; #include "binary-source-file.hh" #include "string-convert.hh" -Binary_source_file::Binary_source_file (std::string &file_name_string) +Binary_source_file::Binary_source_file (string &file_name_string) : Source_file (file_name_string) { } @@ -21,7 +21,7 @@ Binary_source_file::~Binary_source_file () { } -std::string +string Binary_source_file::quote_input (char const *pos_str0) const { assert (this); @@ -31,18 +31,18 @@ Binary_source_file::quote_input (char const *pos_str0) const char const *begin_str0 = max (pos_str0 - 8, c_str ()); char const *end_str0 = min (pos_str0 + 7, c_str () + length ()); - std::string pre_string (begin_str0, pos_str0 - begin_str0); + string pre_string (begin_str0, pos_str0 - begin_str0); pre_string = String_convert::bin2hex (pre_string); for (ssize i = 2; i < pre_string.length (); i += 3) pre_string = pre_string.substr (0, i) + " " + pre_string.substr (i, NPOS); - std::string post_string (pos_str0, end_str0 - pos_str0); + string post_string (pos_str0, end_str0 - pos_str0); post_string = String_convert::bin2hex (post_string); for (ssize i = 2; i < post_string.length (); i += 3) post_string = post_string.substr (0, i) + " " + post_string.substr (i, NPOS); - std::string str = pre_string + string str = pre_string + to_string ('\n') + to_string (' ', pre_string.length () + 1) + post_string; diff --git a/lily/break-algorithm.cc b/lily/break-algorithm.cc index 438bbe4c14..bf83b36def 100644 --- a/lily/break-algorithm.cc +++ b/lily/break-algorithm.cc @@ -15,11 +15,11 @@ #include "cpu-timer.hh" #include "simple-spacer.hh" -std::vector +vector Break_algorithm::find_break_indices () const { - Link_array__Grob_ all = pscore_->root_system ()->columns (); - std::vector retval; + vector all = pscore_->root_system ()->columns (); + vector retval; for (vsize i = 0; i < all.size (); i++) if (Item::is_breakable (all[i])) @@ -32,11 +32,11 @@ Break_algorithm::find_break_indices () const return retval; } -Link_array__Grob_ +vector Break_algorithm::find_breaks () const { - Link_array__Grob_ all = pscore_->root_system ()->columns (); - Link_array__Grob_ retval; + vector all = pscore_->root_system ()->columns (); + vector retval; for (vsize i = 0; i < all.size (); i++) if (Item::is_breakable (all[i])) @@ -50,7 +50,7 @@ Break_algorithm::find_breaks () const } Simple_spacer_wrapper * -Break_algorithm::generate_spacing_problem (Link_array__Grob_ const &curline, +Break_algorithm::generate_spacing_problem (vector const &curline, Interval line) const { Simple_spacer_wrapper *spw = new Simple_spacer_wrapper; @@ -88,10 +88,10 @@ Break_algorithm::set_pscore (Paper_score *s) linewidth_ = s->layout ()->get_dimension (ly_symbol2scm ("line-width")); } -std::vector +vector Break_algorithm::solve () const { - std::vector h= do_solve (); + vector h= do_solve (); return h; } diff --git a/lily/break-align-interface.cc b/lily/break-align-interface.cc index 854d2778ed..7e494de706 100644 --- a/lily/break-align-interface.cc +++ b/lily/break-align-interface.cc @@ -45,7 +45,7 @@ Break_align_interface::self_align_callback (SCM smob) So we return the correct order as an array. */ -Link_array__Grob_ +vector Break_align_interface::ordered_elements (Grob *grob) { Item *me = dynamic_cast (grob); @@ -56,14 +56,14 @@ Break_align_interface::ordered_elements (Grob *grob) || scm_c_vector_length (order_vec) < 3) return elts; - Link_array__Grob_ writable_elts (elts); + vector writable_elts (elts); SCM order = scm_vector_ref (order_vec, scm_from_int (me->break_status_dir () + 1)); /* Copy in order specified in BREAK-ALIGN-ORDER. */ - Link_array__Grob_ new_elts; + vector new_elts; for (; scm_is_pair (order); order = scm_cdr (order)) { SCM sym = scm_car (order); @@ -95,8 +95,8 @@ Break_align_interface::calc_positioning_done (SCM smob) Grob *grob = unsmob_grob (smob); Item *me = dynamic_cast (grob); - Link_array__Grob_ elems = ordered_elements (me); - std::vector extents; + vector elems = ordered_elements (me); + vector extents; int last_nonempty = -1; for (vsize i = 0; i < elems.size (); i++) @@ -111,7 +111,7 @@ Break_align_interface::calc_positioning_done (SCM smob) while (idx < extents.size () && extents[idx].is_empty ()) idx++; - std::vector offsets; + vector offsets; offsets.resize (elems.size ()); for (vsize i = 0; i < offsets.size ();i++) offsets[i] = 0.0; @@ -183,11 +183,11 @@ Break_align_interface::calc_positioning_done (SCM smob) bool entry_found = scm_is_pair (entry); if (!entry_found) { - std::string sym_string; + string sym_string; if (scm_is_symbol (rsym)) sym_string = ly_symbol2string (rsym); - std::string orig_string; + string orig_string; if (unsmob_grob (l->get_property ("cause"))) orig_string = unsmob_grob (l->get_property ("cause"))->name (); diff --git a/lily/break-substitution.cc b/lily/break-substitution.cc index 2c822f8548..0c1e996580 100644 --- a/lily/break-substitution.cc +++ b/lily/break-substitution.cc @@ -139,12 +139,12 @@ do_break_substitution (SCM src) /* Perform substitution on GROB_LIST using a constant amount of stack. */ -Link_array__Grob_ temporary_substition_array; +vector temporary_substition_array; void substitute_grob_array (Grob_array *grob_arr, Grob_array *new_arr) { - Link_array__Grob_ &old_grobs (grob_arr->array_reference ()); - Link_array__Grob_ *new_grobs (new_arr == grob_arr + vector &old_grobs (grob_arr->array_reference ()); + vector *new_grobs (new_arr == grob_arr ? & temporary_substition_array : &new_arr->array_reference ()); @@ -356,15 +356,15 @@ Spanner::fast_substitute_grob_array (SCM sym, qsort (vec, item_index, sizeof (Substitution_entry), &Substitution_entry::item_compare); - std::vector item_indices; - std::vector spanner_indices; + vector item_indices; + vector spanner_indices; for (int i = 0; i <= system_range.length (); i++) { item_indices.push_back (Slice (len, 0)); spanner_indices.push_back (Slice (len, 0)); } - std::vector *arrs[] + vector *arrs[] = { &item_indices, &spanner_indices }; diff --git a/lily/change-iterator.cc b/lily/change-iterator.cc index ff13c3d204..43631687c8 100644 --- a/lily/change-iterator.cc +++ b/lily/change-iterator.cc @@ -15,18 +15,18 @@ #include "warn.hh" void -Change_iterator::error (std::string reason) +Change_iterator::error (string reason) { - std::string to_type = ly_symbol2string (get_music ()->get_property ("change-to-type")); - std::string to_id = ly_scm2string (get_music ()->get_property ("change-to-id")); + string to_type = ly_symbol2string (get_music ()->get_property ("change-to-type")); + string to_id = ly_scm2string (get_music ()->get_property ("change-to-id")); - std::string warn1 = _f ("can't change `%s' to `%s'", to_type, to_id) + string warn1 = _f ("can't change `%s' to `%s'", to_type, to_id) + ": " + reason; /* GUHG! */ - std::string warn2= "Change_iterator::process (): " + string warn2= "Change_iterator::process (): " + get_outlet ()->context_name () + " = `" + get_outlet ()->id_string () + "': "; warning (warn2); @@ -43,7 +43,7 @@ Change_iterator::process (Moment m) Context *last = 0; SCM to_type = get_music ()->get_property ("change-to-type"); - std::string to_id = ly_scm2string (get_music ()->get_property ("change-to-id")); + string to_id = ly_scm2string (get_music ()->get_property ("change-to-id")); /* find the type of translator that we're changing. @@ -57,7 +57,7 @@ Change_iterator::process (Moment m) if (current && current->id_string () == to_id) { - std::string msg; + string msg; msg += _f ("can't change, already in translator: %s", to_id); } diff --git a/lily/chord-name-engraver.cc b/lily/chord-name-engraver.cc index a5da925e60..963c3033f2 100644 --- a/lily/chord-name-engraver.cc +++ b/lily/chord-name-engraver.cc @@ -31,7 +31,7 @@ private: void add_note (Music *); Item *chord_name_; - Link_array__Music_ notes_; + vector notes_; SCM last_chord_; }; diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index d28af332f6..9c6cd1069f 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -159,7 +159,7 @@ Chord_tremolo_engraver::acknowledge_stem (Grob_info info) Beam::add_stem (beam_, s); else { - std::string s = _ ("stem must have Rhythmic structure"); + string s = _ ("stem must have Rhythmic structure"); if (info.music_cause ()) info.music_cause ()->origin ()->warning (s); else diff --git a/lily/clef.cc b/lily/clef.cc index 59d9375c00..0718f8bd53 100644 --- a/lily/clef.cc +++ b/lily/clef.cc @@ -23,7 +23,7 @@ Clef::calc_glyph_name (SCM smob) if (scm_is_string (glyph)) { - std::string str = ly_scm2string (glyph); + string str = ly_scm2string (glyph); if (to_boolean (s->get_property ("non-default")) && s->break_status_dir () != RIGHT @@ -48,7 +48,7 @@ Clef::print (SCM smob) if (!scm_is_string (glyph_scm)) return SCM_EOL; - std::string glyph = std::string (ly_scm2string (glyph_scm)); + string glyph = string (ly_scm2string (glyph_scm)); Font_metric *fm = Font_interface::get_default_font (me); Stencil out = fm->find_by_name (glyph); if (out.is_empty ()) diff --git a/lily/cluster-engraver.cc b/lily/cluster-engraver.cc index d564a2bdfc..faac5f79d0 100644 --- a/lily/cluster-engraver.cc +++ b/lily/cluster-engraver.cc @@ -24,7 +24,7 @@ protected: void stop_translation_timestep (); virtual void finalize (); private: - Link_array__Music_ cluster_notes_; + vector cluster_notes_; Item *beacon_; void typeset_grobs (); diff --git a/lily/cluster.cc b/lily/cluster.cc index a9ac17408a..d4cb47eb0b 100644 --- a/lily/cluster.cc +++ b/lily/cluster.cc @@ -27,7 +27,7 @@ using namespace std; TODO: Add support for cubic spline segments. */ Stencil -brew_cluster_piece (Grob *me, std::vector bottom_points, std::vector top_points) +brew_cluster_piece (Grob *me, vector bottom_points, vector top_points) { Real blotdiameter = Staff_symbol_referencer::staff_space (me) / 2; @@ -38,7 +38,7 @@ brew_cluster_piece (Grob *me, std::vector bottom_points, std::vectorget_property ("style"); - std::string shape; + string shape; if (scm_is_symbol (shape_scm)) shape = ly_symbol2string (shape_scm); @@ -50,7 +50,7 @@ brew_cluster_piece (Grob *me, std::vector bottom_points, std::vector points; + vector points; points.clear (); int size = bottom_points.size (); if (shape == "leftsided-stairs") @@ -133,7 +133,7 @@ Cluster::print (SCM smob) Grob *commonx = left_bound->common_refpoint (right_bound, X_AXIS); - Link_array__Grob_ const &cols = extract_grob_array (me, "columns"); + vector const &cols = extract_grob_array (me, "columns"); if (cols.empty ()) { me->warning (_ ("junking empty cluster")); @@ -144,8 +144,8 @@ Cluster::print (SCM smob) commonx = common_refpoint_of_array (cols, commonx, X_AXIS); Grob *commony = common_refpoint_of_array (cols, me, Y_AXIS); - std::vector bottom_points; - std::vector top_points; + vector bottom_points; + vector top_points; Real left_coord = left_bound->relative_coordinate (commonx, X_AXIS); @@ -175,7 +175,7 @@ Cluster::print (SCM smob) if (spanner->get_break_index () < orig->broken_intos_.size () - 1) { Spanner *next = orig->broken_intos_[spanner->get_break_index () + 1]; - Link_array__Grob_ const &next_cols = extract_grob_array (next, "columns"); + vector const &next_cols = extract_grob_array (next, "columns"); if (next_cols.size () > 0) { Grob *next_commony = common_refpoint_of_array (next_cols, next, Y_AXIS); diff --git a/lily/coherent-ligature-engraver.cc b/lily/coherent-ligature-engraver.cc index 113c3b2666..ff1691ef64 100644 --- a/lily/coherent-ligature-engraver.cc +++ b/lily/coherent-ligature-engraver.cc @@ -35,7 +35,7 @@ * - collapse superflous space after each ligature (TODO). * * Concrete subclasses must implement function build_ligature (Spanner - * *, std::vector). This function is responsible for actually + * *, vector). This function is responsible for actually * building the ligature by transforming the array of noteheads. * * Currently, there are two subclasses: Gregorian_ligature_engraver @@ -116,7 +116,7 @@ Coherent_ligature_engraver::get_set_column (Item *item, Paper_column *column) return; } - std::string name = parent->name (); + string name = parent->name (); if (name != "PaperColumn") { // Change column not only for targeted item (NoteColumn), but @@ -159,13 +159,13 @@ Coherent_ligature_engraver::get_set_column (Item *item, Paper_column *column) * occurs within the broken ligatures any more. */ void -Coherent_ligature_engraver::collect_accidentals (Spanner *, std::vector) +Coherent_ligature_engraver::collect_accidentals (Spanner *, vector) { /* TODO */ } void -compute_delta_pitches (std::vector primitives) +compute_delta_pitches (vector primitives) { int prev_pitch = 0; int delta_pitch = 0; @@ -190,7 +190,7 @@ compute_delta_pitches (std::vector primitives) void Coherent_ligature_engraver::typeset_ligature (Spanner *ligature, - std::vector primitives) + vector primitives) { // compute some commonly needed context info stored as grob // properties diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index 1bdd960968..404c1a5c71 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -14,7 +14,7 @@ class Collision_engraver : public Engraver { Item *col_; - Link_array__Grob_ note_columns_; + vector note_columns_; protected: DECLARE_ACKNOWLEDGER (note_column); diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index af0cb783f9..6fe80dc309 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -43,13 +43,13 @@ using namespace std; class Completion_heads_engraver : public Engraver { - Link_array__Item_ notes_; - Link_array__Item_ prev_notes_; - Link_array__Grob_ ties_; + vector notes_; + vector prev_notes_; + vector ties_; - Link_array__Item_ dots_; - Link_array__Music_ note_events_; - Link_array__Music_ scratch_note_events_; + vector dots_; + vector note_events_; + vector scratch_note_events_; Moment note_end_mom_; bool is_first_; diff --git a/lily/context-def.cc b/lily/context-def.cc index 80663c9185..d8349f4d97 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -192,20 +192,20 @@ Context_def::get_default_child (SCM user_mod) const return name; } -Link_array__Context_def_ +vector Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const { assert (scm_is_symbol (type_sym)); SCM accepted = get_accepted (SCM_EOL); - Link_array__Context_def_ accepteds; + vector accepteds; for (SCM s = accepted; scm_is_pair (s); s = scm_cdr (s)) if (Context_def *t = unsmob_context_def (find_context_def (odef, scm_car (s)))) accepteds.push_back (t); - Link_array__Context_def_ best_result; + vector best_result; for (vsize i = 0; i < accepteds.size (); i++) { /* do not check aliases, because \context Staff should not @@ -222,7 +222,7 @@ Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const { Context_def *g = accepteds[i]; - Link_array__Context_def_ result + vector result = g->path_to_acceptable_context (type_sym, odef); if (result.size () && result.size () < best_depth) { diff --git a/lily/context-specced-music-iterator.cc b/lily/context-specced-music-iterator.cc index 323dd7ca50..9036d72fb6 100644 --- a/lily/context-specced-music-iterator.cc +++ b/lily/context-specced-music-iterator.cc @@ -22,7 +22,7 @@ Context_specced_music_iterator::construct_children () { SCM ct = get_music ()->get_property ("context-type"); - std::string c_id; + string c_id; SCM ci = get_music ()->get_property ("context-id"); if (scm_is_string (ci)) c_id = ly_scm2string (ci); diff --git a/lily/context.cc b/lily/context.cc index 0fbdc20731..b1e4a6629d 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -124,7 +124,7 @@ Context::create_unique_context (SCM n, SCM operations) /* TODO: use accepts_list_. */ - Link_array__Context_def_ path + vector path = unsmob_context_def (definition_)->path_to_acceptable_context (n, get_output_def ()); if (path.size ()) @@ -161,7 +161,7 @@ Context::create_unique_context (SCM n, SCM operations) } Context * -Context::find_create_context (SCM n, std::string id, SCM operations) +Context::find_create_context (SCM n, string id, SCM operations) { /* Don't create multiple score contexts. @@ -182,7 +182,7 @@ Context::find_create_context (SCM n, std::string id, SCM operations) /* TODO: use accepts_list_. */ - Link_array__Context_def_ path + vector path = unsmob_context_def (definition_)->path_to_acceptable_context (n, get_output_def ()); if (path.size ()) @@ -194,7 +194,7 @@ Context::find_create_context (SCM n, std::string id, SCM operations) { SCM ops = (i == path.size () -1) ? operations : SCM_EOL; - std::string this_id = ""; + string this_id = ""; if (i == path.size () -1) this_id = id; @@ -224,10 +224,10 @@ Context::find_create_context (SCM n, std::string id, SCM operations) Context * Context::create_context (Context_def *cdef, - std::string id, + string id, SCM ops) { - std::string type = ly_symbol2string (cdef->get_context_name ()); + string type = ly_symbol2string (cdef->get_context_name ()); Object_key const *key = get_context_key (type, id); Context *new_context = cdef->instantiate (ops, key); @@ -240,12 +240,12 @@ Context::create_context (Context_def *cdef, } Object_key const * -Context::get_context_key (std::string type, std::string id) +Context::get_context_key (string type, string id) { if (!use_object_keys) return 0; - std::string now_key = type + "@" + id; + string now_key = type + "@" + id; int disambiguation_count = 0; if (context_counts_.find (now_key) != context_counts_.end ()) @@ -260,7 +260,7 @@ Context::get_context_key (std::string type, std::string id) } Object_key const * -Context::get_grob_key (std::string name) +Context::get_grob_key (string name) { if (!use_object_keys) return 0; @@ -273,7 +273,7 @@ Context::get_grob_key (std::string name) unique identifier for each (book,score) tuple. */ Object_key const * -Context::create_grob_key (std::string name) +Context::create_grob_key (string name) { int disambiguation_count = 0; if (grob_counts_.find (name) != grob_counts_.end ()) @@ -314,7 +314,7 @@ Context::get_default_interpreter () SCM nm = default_child_context_name (); SCM st = find_context_def (get_output_def (), nm); - std::string name = ly_symbol2string (nm); + string name = ly_symbol2string (nm); Context_def *t = unsmob_context_def (st); if (!t) { @@ -425,7 +425,7 @@ Context::remove_context (Context *trans) */ Context * find_context_below (Context *where, - SCM type, std::string id) + SCM type, string id) { if (where->is_alias (type)) { @@ -458,7 +458,7 @@ Context::context_name_symbol () const return td->get_context_name (); } -std::string +string Context::context_name () const { return ly_symbol2string (context_name_symbol ()); diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index b68ed60388..3b3f7610e0 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -37,8 +37,8 @@ public: private: Item *create_custos (); bool custos_permitted_; - Link_array__Grob_ custodes_; - std::vector pitches_; + vector custodes_; + vector pitches_; }; Custos_engraver::Custos_engraver () diff --git a/lily/custos.cc b/lily/custos.cc index 5b6fc3df26..f57cdc20ea 100644 --- a/lily/custos.cc +++ b/lily/custos.cc @@ -33,7 +33,7 @@ Custos::print (SCM smob) Item *me = (Item *)unsmob_grob (smob); SCM scm_style = me->get_property ("style"); - std::string style; + string style; if (scm_is_symbol (scm_style)) style = ly_symbol2string (scm_style); else @@ -53,7 +53,7 @@ Custos::print (SCM smob) int pos = Staff_symbol_referencer::get_rounded_position (me); int sz = Staff_symbol_referencer::line_count (me) - 1; - std::string font_char = "custodes." + style + "."; + string font_char = "custodes." + style + "."; if (pos < neutral_pos) font_char += "u"; else if (pos > neutral_pos) diff --git a/lily/dot-column-engraver.cc b/lily/dot-column-engraver.cc index f5c4a8ad95..65a16a094e 100644 --- a/lily/dot-column-engraver.cc +++ b/lily/dot-column-engraver.cc @@ -17,7 +17,7 @@ class Dot_column_engraver : public Engraver { Grob *dotcol_; Grob *stem_; - Link_array__Item_ heads_; + vector heads_; public: TRANSLATOR_DECLARATIONS (Dot_column_engraver); diff --git a/lily/dot-column.cc b/lily/dot-column.cc index f3e2af55f9..2d01faa026 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -204,7 +204,7 @@ SCM Dot_column::calc_positioning_done (SCM smob) { Grob *me = unsmob_grob (smob); - Link_array__Grob_ dots + vector dots = extract_grob_array (me, "dots"); { /* diff --git a/lily/dots.cc b/lily/dots.cc index 0627b2b720..1b2c7be879 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -26,7 +26,7 @@ Dots::print (SCM d) if (scm_is_number (c)) { - Stencil d = Font_interface::get_default_font (sc)->find_by_name (std::string ("dots.dot")); + Stencil d = Font_interface::get_default_font (sc)->find_by_name (string ("dots.dot")); Real dw = d.extent (X_AXIS).length (); /* diff --git a/lily/drum-note-engraver.cc b/lily/drum-note-engraver.cc index 9293fc72bc..1d1b8d2331 100644 --- a/lily/drum-note-engraver.cc +++ b/lily/drum-note-engraver.cc @@ -18,10 +18,10 @@ using namespace std; class Drum_notes_engraver : public Engraver { - Link_array__Item_ notes_; - Link_array__Item_ dots_; - Link_array__Item_ scripts_; - Link_array__Music_ events_; + vector notes_; + vector dots_; + vector scripts_; + vector events_; public: TRANSLATOR_DECLARATIONS (Drum_notes_engraver); diff --git a/lily/drum-note-performer.cc b/lily/drum-note-performer.cc index 0dab3e2890..a29b7a1dee 100644 --- a/lily/drum-note-performer.cc +++ b/lily/drum-note-performer.cc @@ -25,8 +25,8 @@ protected: void process_music (); private: - Link_array__Music_ note_evs_; - Link_array__Audio_note_ notes_; + vector note_evs_; + vector notes_; }; Drum_note_performer::Drum_note_performer () diff --git a/lily/duration.cc b/lily/duration.cc index b21ca97a97..413ac889ec 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -60,17 +60,17 @@ Duration::get_length () const return mom * factor_; } -std::string +string Duration::to_string () const { - std::string s; + string s; if (durlog_ < 0) - s = "log = " + std::to_string (durlog_); + s = "log = " + ::to_string (durlog_); else - s = std::to_string (1 << durlog_); + s = ::to_string (1 << durlog_); - s += std::to_string ('.', dots_); + s += ::to_string ('.', dots_); if (factor_ != Moment (Rational (1, 1))) s += "*" + factor_.to_string (); return s; diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 3dcbea5ce6..8d4cb2880f 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -55,8 +55,8 @@ class Dynamic_engraver : public Engraver Drul_array accepted_spanevents_drul_; - Link_array__Note_column_ pending_columns_; - Link_array__Grob_ pending_elements_; + vector pending_columns_; + vector pending_elements_; void typeset_all (); @@ -187,7 +187,7 @@ Dynamic_engraver::process_music () { if (current_cresc_ev_) { - std::string msg = _ ("already have a decrescendo"); + string msg = _ ("already have a decrescendo"); if (current_cresc_ev_->is_mus_type ("decrescendo-event")) msg = _ ("already have a crescendo"); @@ -205,7 +205,7 @@ Dynamic_engraver::process_music () TODO: Use symbols. */ - std::string start_type + string start_type = ly_symbol2string (current_cresc_ev_->get_property ("name")); /* diff --git a/lily/figured-bass-engraver.cc b/lily/figured-bass-engraver.cc index 8d97f2998d..d6c5f78c26 100644 --- a/lily/figured-bass-engraver.cc +++ b/lily/figured-bass-engraver.cc @@ -63,12 +63,12 @@ struct Figured_bass_engraver : public Engraver void add_brackets (); void create_grobs (); - void center_continuations (Link_array__Spanner_ const &consecutive_lines); + void center_continuations (vector const &consecutive_lines); void center_repeated_continuations (); protected: - std::vector groups_; + vector groups_; Spanner *alignment_; - Link_array__Music_ new_musics_; + vector new_musics_; bool continuation_; bool new_music_found_; @@ -165,11 +165,11 @@ Figured_bass_engraver::try_music (Music *m) } void -Figured_bass_engraver::center_continuations (Link_array__Spanner_ const &consecutive_lines) +Figured_bass_engraver::center_continuations (vector const &consecutive_lines) { if (consecutive_lines.size () == 2) { - Link_array__Grob_ left_figs; + vector left_figs; for (vsize j = consecutive_lines.size(); j--;) left_figs.push_back (consecutive_lines[j]->get_bound (LEFT)); @@ -185,7 +185,7 @@ Figured_bass_engraver::center_continuations (Link_array__Spanner_ const &consecu void Figured_bass_engraver::center_repeated_continuations () { - Link_array__Spanner_ consecutive_lines; + vector consecutive_lines; for (vsize i = 0; i <= groups_.size(); i++) { if (i < groups_.size () @@ -220,7 +220,7 @@ Figured_bass_engraver::clear_spanners () void Figured_bass_engraver::add_brackets () { - Link_array__Grob_ encompass; + vector encompass; bool inside = false; for (vsize i = 0; i < groups_.size (); i ++) { @@ -318,7 +318,7 @@ Figured_bass_engraver::process_music () if (use_extenders) { - std::vector junk_continuations; + vector junk_continuations; for (vsize i = 0; i < groups_.size(); i++) { Figure_group &group = groups_[i]; @@ -349,7 +349,7 @@ Figured_bass_engraver::process_music () /* Ugh, repeated code. */ - Link_array__Spanner_ consecutive; + vector consecutive; if (to_boolean (get_property ("figuredBassCenterContinuations"))) { for (vsize i = 0; i <= junk_continuations.size (); i++) diff --git a/lily/file-name-map.cc b/lily/file-name-map.cc index 8d3eb19c8e..c5c168bc14 100644 --- a/lily/file-name-map.cc +++ b/lily/file-name-map.cc @@ -12,10 +12,10 @@ using namespace std; #include "file-name-map.hh" #include "lily-guile.hh" -map file_name_map_global; +map file_name_map_global; -std::string -map_file_name (std::string s) +string +map_file_name (string s) { if (file_name_map_global.find (s) != file_name_map_global.end ()) s = file_name_map_global[s]; diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index daace643e4..a8c4fcf680 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -15,8 +15,8 @@ class Fingering_engraver : public Engraver { - Link_array__Music_ events_; - Link_array__Item_ fingerings_; + vector events_; + vector fingerings_; public: TRANSLATOR_DECLARATIONS (Fingering_engraver); diff --git a/lily/font-config.cc b/lily/font-config.cc index c90598b72a..b404354e4d 100644 --- a/lily/font-config.cc +++ b/lily/font-config.cc @@ -37,14 +37,14 @@ init_fontconfig () if (!is_file ((char*)cache_file)) message (_f ("Rebuilding FontConfig cache %s. this may take a while...", cache_file)); - std::vector dirs; + vector dirs; dirs.push_back (prefix_directory + "/fonts/otf/"); dirs.push_back (prefix_directory + "/fonts/type1/"); for (vsize i = 0; i < dirs.size (); i++) { - std::string dir = dirs[i]; + string dir = dirs[i]; if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.c_str ())) error (_f ("adding font directory: %s", dir.c_str ())); else if (be_verbose_global) diff --git a/lily/font-metric.cc b/lily/font-metric.cc index 843d387014..eccc9d2441 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -30,7 +30,7 @@ Font_metric::design_size () const } Stencil -Font_metric::find_by_name (std::string s) const +Font_metric::find_by_name (string s) const { replace_all (s, '-', 'M'); int idx = name_to_index (s); @@ -83,7 +83,7 @@ Font_metric::get_indexed_char (vsize k) const } vsize -Font_metric::name_to_index (std::string) const +Font_metric::name_to_index (string) const { return VPOS; } @@ -129,10 +129,10 @@ Font_metric::font_file_name () const return scm_car (description_); } -std::string +string Font_metric::font_name () const { - std::string s ("unknown"); + string s ("unknown"); return s; } @@ -168,7 +168,7 @@ Font_metric::get_indexed_char_stencil (vsize code) const } Offset -Font_metric::attachment_point (std::string) const +Font_metric::attachment_point (string) const { return Offset (0, 0); } @@ -180,7 +180,7 @@ Font_metric::sub_fonts () const } Stencil -Font_metric::text_stencil (std::string str) const +Font_metric::text_stencil (string str) const { SCM lst = scm_list_3 (ly_symbol2scm ("text"), this->self_scm (), @@ -191,7 +191,7 @@ Font_metric::text_stencil (std::string str) const } Box -Font_metric::text_dimension (std::string) const +Font_metric::text_dimension (string) const { return Box (Interval (0, 0), Interval (0, 0)); } diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc index 27caa90fbf..5081d7eb58 100644 --- a/lily/function-documentation.cc +++ b/lily/function-documentation.cc @@ -25,7 +25,7 @@ void ly_add_function_documentation (SCM func, if (!doc_hash_table) doc_hash_table = scm_permanent_object (scm_c_make_hash_table (59)); - std::string s = std::string (" - ") + "LilyPond procedure: " + fname + " " + varlist + string s = string (" - ") + "LilyPond procedure: " + fname + " " + varlist + "\n" + doc; scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"), diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index 3e1d23cf11..5c672a858d 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -31,8 +31,8 @@ LY_DEFINE (ly_find_file, "ly:find-file", { SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string"); - std::string nm = ly_scm2string (name); - std::string file_name = global_path.find (nm); + string nm = ly_scm2string (name); + string file_name = global_path.find (nm); if (file_name.empty ()) return SCM_BOOL_F; @@ -56,7 +56,7 @@ LY_DEFINE (ly_gulp_file, "ly:gulp-file", sz = scm_to_int (size); } - std::string contents = gulp_file_to_string (ly_scm2string (name), true, sz); + string contents = gulp_file_to_string (ly_scm2string (name), true, sz); return scm_from_locale_stringn (contents.c_str (), contents.length ()); } @@ -224,7 +224,7 @@ LY_DEFINE (ly_output_formats, "ly:output-formats", "Formats passed to --format as a list of strings, " "used for the output.") { - std::vector output_formats = split_string (output_format_global, ','); + vector output_formats = split_string (output_format_global, ','); SCM lst = SCM_EOL; int output_formats_count = output_formats.size (); diff --git a/lily/glissando-engraver.cc b/lily/glissando-engraver.cc index b06ac56165..1219ac6573 100644 --- a/lily/glissando-engraver.cc +++ b/lily/glissando-engraver.cc @@ -88,7 +88,7 @@ Glissando_engraver::finalize () { if (line_) { - std::string msg = _ ("unterminated glissando"); + string msg = _ ("unterminated glissando"); if (event_) event_->origin ()->warning (msg); diff --git a/lily/global-ctor.cc b/lily/global-ctor.cc index 2a81321e0a..dd340e9941 100644 --- a/lily/global-ctor.cc +++ b/lily/global-ctor.cc @@ -10,13 +10,13 @@ #include "std-vector.hh" -static std::vector *ctor_global_statics_; +static vector *ctor_global_statics_; void add_constructor (Global_ctor c) { if (!ctor_global_statics_) - ctor_global_statics_ = new std::vector; + ctor_global_statics_ = new vector; ctor_global_statics_->push_back (c); } diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 798d2435f9..dfbd0b0f5c 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -57,7 +57,7 @@ struct Break_node }; void -print_break_nodes (std::vector const &arr) +print_break_nodes (vector const &arr) { for (vsize i = 0; i < arr.size (); i++) { @@ -74,14 +74,14 @@ print_break_nodes (std::vector const &arr) TODO: should rewrite. See the function in scm/page-layout.scm for inspiration. */ -std::vector +vector Gourlay_breaking::do_solve () const { - std::vector optimal_paths; - Link_array__Grob_ all + vector optimal_paths; + vector all = pscore_->root_system ()->columns (); - std::vector breaks = find_break_indices (); + vector breaks = find_break_indices (); Break_node first_node; optimal_paths.push_back (first_node); @@ -104,7 +104,7 @@ Gourlay_breaking::do_solve () const for (vsize start_idx = break_idx; start_idx--;) { - Link_array__Grob_ line (all.begin () + breaks[start_idx], + vector line (all.begin () + breaks[start_idx], all.begin () + breaks[break_idx] + 1); line[0] = dynamic_cast (line[0])->find_prebroken_piece (RIGHT); @@ -176,17 +176,17 @@ Gourlay_breaking::do_solve () const optimal_paths.push_back (bnod); if (! (break_idx % HAPPY_DOTS)) - progress_indication (std::string ("[") + to_string (break_idx) + "]"); + progress_indication (string ("[") + to_string (break_idx) + "]"); } /* do the last one */ if (breaks.size () % HAPPY_DOTS) - progress_indication (std::string ("[") + to_string (breaks.size ()) + "]"); + progress_indication (string ("[") + to_string (breaks.size ()) + "]"); progress_indication ("\n"); - std::vector final_breaks; - std::vector lines; + vector final_breaks; + vector lines; /* skip 0-th element, since it is a "dummy" elt*/ for (vsize i = optimal_paths.size () - 1; i > 0;) diff --git a/lily/gregorian-ligature-engraver.cc b/lily/gregorian-ligature-engraver.cc index 82c84ffc4c..31263e9a12 100644 --- a/lily/gregorian-ligature-engraver.cc +++ b/lily/gregorian-ligature-engraver.cc @@ -84,7 +84,7 @@ void fix_prefix_set (int *current_set, int min_set, int max_set, Grob *primitive fix_prefix ("pes_or_flexa", LINEA, current_set, min_set, max_set, primitive); } -void check_and_fix_all_prefixes (std::vector primitives) +void check_and_fix_all_prefixes (vector primitives) { /* Check for illegal head modifier combinations */ for (vsize i = 0; i < primitives.size (); i++) @@ -195,7 +195,7 @@ void check_and_fix_all_prefixes (std::vector primitives) * Marks those heads that participate in a pes or flexa. */ void -provide_context_info (std::vector primitives) +provide_context_info (vector primitives) { Grob *prev_primitive = 0; int prev_prefix_set = 0; @@ -242,7 +242,7 @@ provide_context_info (std::vector primitives) void Gregorian_ligature_engraver::build_ligature (Spanner *ligature, - std::vector primitives) + vector primitives) { // apply style-independent checking and transformation check_and_fix_all_prefixes (primitives); diff --git a/lily/gregorian-ligature.cc b/lily/gregorian-ligature.cc index 43cc3c5967..5047fa928b 100644 --- a/lily/gregorian-ligature.cc +++ b/lily/gregorian-ligature.cc @@ -10,7 +10,7 @@ #include "grob.hh" -void check_prefix (std::string name, int mask, int prefix_set, std::string *str) +void check_prefix (string name, int mask, int prefix_set, string *str) { if (prefix_set & mask) { @@ -20,10 +20,10 @@ void check_prefix (std::string name, int mask, int prefix_set, std::string *str) } } -std::string +string Gregorian_ligature::prefixes_to_str (Grob *primitive) { - std::string str; + string str; int prefix_set = scm_to_int (primitive->get_property ("prefix-set")); check_prefix ("virga", VIRGA, prefix_set, &str); diff --git a/lily/grid-line-span-engraver.cc b/lily/grid-line-span-engraver.cc index 742146402c..e4cccb3c80 100644 --- a/lily/grid-line-span-engraver.cc +++ b/lily/grid-line-span-engraver.cc @@ -13,7 +13,7 @@ class Grid_line_span_engraver : public Engraver { Item *spanline_; - Link_array__Item_ lines_; + vector lines_; public: TRANSLATOR_DECLARATIONS (Grid_line_span_engraver); diff --git a/lily/grob-array.cc b/lily/grob-array.cc index 99230a5ec3..1656fc821f 100644 --- a/lily/grob-array.cc +++ b/lily/grob-array.cc @@ -29,13 +29,13 @@ Grob_array::Grob_array () ordered_ = false; } -Link_array__Grob_ & +vector & Grob_array::array_reference () { return grobs_; } -Link_array__Grob_ const & +vector const & Grob_array::array () const { return grobs_; @@ -89,7 +89,7 @@ Grob_array::empty () const } void -Grob_array::set_array (Link_array__Grob_ const &src) +Grob_array::set_array (vector const &src) { grobs_ = src; } diff --git a/lily/grob-info.cc b/lily/grob-info.cc index 691d23b1a5..bd8279e5f7 100644 --- a/lily/grob-info.cc +++ b/lily/grob-info.cc @@ -33,11 +33,11 @@ Grob_info::music_cause () const return unsmob_music (cause); } -Link_array__Context_ +vector Grob_info::origin_contexts (Translator *end) const { Context *t = origin_trans_->context (); - Link_array__Context_ r; + vector r; do { r.push_back (t); diff --git a/lily/grob-interface.cc b/lily/grob-interface.cc index 779f54377b..9d52d4a56a 100644 --- a/lily/grob-interface.cc +++ b/lily/grob-interface.cc @@ -45,7 +45,7 @@ check_interfaces_for_property (Grob const *me, SCM sym) SCM iface = scm_hashq_ref (all_ifaces, scm_car (ifs), SCM_BOOL_F); if (iface == SCM_BOOL_F) { - std::string msg = to_string (_f ("Unknown interface `%s'", + string msg = to_string (_f ("Unknown interface `%s'", ly_symbol2string (scm_car (ifs)).c_str ())); programming_error (msg); continue; @@ -56,7 +56,7 @@ check_interfaces_for_property (Grob const *me, SCM sym) if (!found) { - std::string str = to_string (_f ("Grob `%s' has no interface for property `%s'", + string str = to_string (_f ("Grob `%s' has no interface for property `%s'", me->name ().c_str (), ly_symbol2string (sym).c_str ())); programming_error (str); diff --git a/lily/grob-pq-engraver.cc b/lily/grob-pq-engraver.cc index a8e1081704..e4e8b944f9 100644 --- a/lily/grob-pq-engraver.cc +++ b/lily/grob-pq-engraver.cc @@ -32,7 +32,7 @@ protected: void start_translation_timestep (); void stop_translation_timestep (); - std::vector started_now_; + vector started_now_; }; Grob_pq_engraver::Grob_pq_engraver () diff --git a/lily/grob.cc b/lily/grob.cc index bde3c630af..fc49f16d4d 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -430,7 +430,7 @@ Grob::fixup_refpoint () MESSAGES ****************************************************************/ void -Grob::warning (std::string s) const +Grob::warning (string s) const { SCM cause = self_scm (); while (Grob *g = unsmob_grob (cause)) @@ -443,7 +443,7 @@ Grob::warning (std::string s) const } -std::string +string Grob::name () const { SCM meta = get_property ("meta"); @@ -453,7 +453,7 @@ Grob::name () const } void -Grob::programming_error (std::string s) const +Grob::programming_error (string s) const { SCM cause = self_scm (); while (Grob *g = unsmob_grob (cause)) @@ -608,7 +608,7 @@ common_refpoint_of_list (SCM elist, Grob *common, Axis a) } Grob * -common_refpoint_of_array (Link_array__Grob_ const &arr, Grob *common, Axis a) +common_refpoint_of_array (vector const &arr, Grob *common, Axis a) { for (vsize i = arr.size (); i--;) if (Grob *s = arr[i]) diff --git a/lily/hara-kiri-group-spanner.cc b/lily/hara-kiri-group-spanner.cc index 04fe171428..3a686dfcf0 100644 --- a/lily/hara-kiri-group-spanner.cc +++ b/lily/hara-kiri-group-spanner.cc @@ -43,7 +43,7 @@ Hara_kiri_group_spanner::consider_suicide (Grob *me) == 0)) return; - Link_array__Grob_ childs; + vector childs; Axis_group_interface::get_children (me, &childs); for (vsize i = 0; i < childs.size (); i++) childs[i]->suicide (); diff --git a/lily/horizontal-bracket-engraver.cc b/lily/horizontal-bracket-engraver.cc index 15a4b57565..5c553374a3 100644 --- a/lily/horizontal-bracket-engraver.cc +++ b/lily/horizontal-bracket-engraver.cc @@ -19,8 +19,8 @@ class Horizontal_bracket_engraver : public Engraver { public: TRANSLATOR_DECLARATIONS (Horizontal_bracket_engraver); - Link_array__Spanner_ bracket_stack_; - Link_array__Music_ events_; + vector bracket_stack_; + vector events_; vsize pop_count_; vsize push_count_; diff --git a/lily/horizontal-bracket.cc b/lily/horizontal-bracket.cc index 10d65316e0..bd8435d032 100644 --- a/lily/horizontal-bracket.cc +++ b/lily/horizontal-bracket.cc @@ -47,7 +47,7 @@ Horizontal_bracket::make_bracket (Grob *me, Stencil Horizontal_bracket::make_enclosing_bracket (Grob *me, Grob *refpoint, - Link_array__Grob_ grobs, + vector grobs, Axis a, Direction dir) { Grob *common = common_refpoint_of_array (grobs, refpoint, a); diff --git a/lily/includable-lexer.cc b/lily/includable-lexer.cc index f43feee573..26eafeaf25 100644 --- a/lily/includable-lexer.cc +++ b/lily/includable-lexer.cc @@ -46,7 +46,7 @@ Includable_lexer::Includable_lexer () /** Set the new input file to NAME, remember old file. */ void -Includable_lexer::new_input (std::string name, Sources *sources) +Includable_lexer::new_input (string name, Sources *sources) { if (!allow_includes_b_) { @@ -57,7 +57,7 @@ Includable_lexer::new_input (std::string name, Sources *sources) Source_file *file = sources->get_file (name); if (!file) { - std::string msg = _f ("can't find file: `%s'", name); + string msg = _f ("can't find file: `%s'", name); msg += "\n"; msg += _f ("(search path: `%s')", sources->path_->to_string ().c_str ()); @@ -71,7 +71,7 @@ Includable_lexer::new_input (std::string name, Sources *sources) state_stack_.push_back (yy_current_buffer); if (be_verbose_global) - progress_indication (std::string ("[") + name); + progress_indication (string ("[") + name); include_stack_.push_back (file); @@ -83,7 +83,7 @@ Includable_lexer::new_input (std::string name, Sources *sources) } void -Includable_lexer::new_input (std::string name, std::string data, Sources *sources) +Includable_lexer::new_input (string name, string data, Sources *sources) { Source_file *file = new Source_file (name, data); sources->add (file); @@ -94,7 +94,7 @@ Includable_lexer::new_input (std::string name, std::string data, Sources *source state_stack_.push_back (yy_current_buffer); if (be_verbose_global) - progress_indication (std::string ("[") + name); + progress_indication (string ("[") + name); include_stack_.push_back (file); yy_switch_to_buffer (yy_create_buffer (file->get_istream (), YY_BUF_SIZE)); diff --git a/lily/include/accidental-interface.hh b/lily/include/accidental-interface.hh index b7154d59b5..77cc815a63 100644 --- a/lily/include/accidental-interface.hh +++ b/lily/include/accidental-interface.hh @@ -20,8 +20,8 @@ public: DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM)); static bool has_interface (Grob *); - static std::string get_fontcharname (std::string style, int alteration); - static std::vector accurate_boxes (Grob *me, + static string get_fontcharname (string style, int alteration); + static vector accurate_boxes (Grob *me, Grob **common); }; diff --git a/lily/include/accidental-placement.hh b/lily/include/accidental-placement.hh index bb6b681003..43c33b8a9f 100644 --- a/lily/include/accidental-placement.hh +++ b/lily/include/accidental-placement.hh @@ -21,8 +21,8 @@ public: Item *item_col, Grob *acc); static void split_accidentals (Grob *accs, - Link_array__Grob_ *break_reminder, - Link_array__Grob_ *real_acc); + vector *break_reminder, + vector *real_acc); DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM)); static bool has_interface (Grob *); diff --git a/lily/include/all-font-metrics.hh b/lily/include/all-font-metrics.hh index 414233124e..8243ccbe34 100644 --- a/lily/include/all-font-metrics.hh +++ b/lily/include/all-font-metrics.hh @@ -35,7 +35,7 @@ class All_font_metrics All_font_metrics (All_font_metrics const &); public: - All_font_metrics (std::string search_path); + All_font_metrics (string search_path); ~All_font_metrics (); #if HAVE_PANGO_FT2 @@ -44,9 +44,9 @@ public: Real scale); #endif - Tex_font_metric *find_tfm (std::string); - Font_metric *find_font (std::string name); - Open_type_font *find_otf (std::string name); + Tex_font_metric *find_tfm (string); + Font_metric *find_font (string name); + Open_type_font *find_otf (string name); SCM font_descriptions () const; }; diff --git a/lily/include/audio-column.hh b/lily/include/audio-column.hh index 0bffa4e45e..77eee19537 100644 --- a/lily/include/audio-column.hh +++ b/lily/include/audio-column.hh @@ -24,7 +24,7 @@ public: void add_audio_item (Audio_item *i); Moment at_mom () const; - Link_array__Audio_item_ audio_items_; + vector audio_items_; private: Audio_column (Audio_column const &); diff --git a/lily/include/audio-element-info.hh b/lily/include/audio-element-info.hh index 915fac9c5a..8eed595373 100644 --- a/lily/include/audio-element-info.hh +++ b/lily/include/audio-element-info.hh @@ -22,7 +22,7 @@ public: Music *event_; Translator *origin_trans_; - Link_array__Context_ origin_contexts (Translator *) const; + vector origin_contexts (Translator *) const; Audio_element_info (Audio_element *, Music *); Audio_element_info (); diff --git a/lily/include/audio-item.hh b/lily/include/audio-item.hh index 7def69e343..1e7bfec32a 100644 --- a/lily/include/audio-item.hh +++ b/lily/include/audio-item.hh @@ -47,9 +47,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 @@ -68,7 +68,7 @@ public: class Audio_piano_pedal : public Audio_item { public: - std::string type_string_; + string type_string_; Direction dir_; }; @@ -81,10 +81,10 @@ public: MARKER, CUE_POINT }; - Audio_text (Audio_text::Type type, std::string text_string); + Audio_text (Audio_text::Type type, 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 d2a2baeba3..e20fc1c4d7 100644 --- a/lily/include/audio-staff.hh +++ b/lily/include/audio-staff.hh @@ -16,7 +16,7 @@ struct Audio_staff : public Audio_element void add_audio_item (Audio_item *l); void output (Midi_stream &midi_stream_r, int track_i); - Link_array__Audio_item_ audio_items_; + vector audio_items_; int channel_; }; diff --git a/lily/include/axis-group-engraver.hh b/lily/include/axis-group-engraver.hh index 535828577a..42b4b8c35f 100644 --- a/lily/include/axis-group-engraver.hh +++ b/lily/include/axis-group-engraver.hh @@ -19,7 +19,7 @@ class Axis_group_engraver : public Engraver { protected: Spanner *staffline_; - Link_array__Grob_ elts_; + vector elts_; void process_music (); virtual void finalize (); DECLARE_ACKNOWLEDGER (grob); diff --git a/lily/include/axis-group-interface.hh b/lily/include/axis-group-interface.hh index 04da19759d..11e95233a6 100644 --- a/lily/include/axis-group-interface.hh +++ b/lily/include/axis-group-interface.hh @@ -19,13 +19,13 @@ struct Axis_group_interface static SCM generic_group_extent (Grob *me, Axis a); DECLARE_SCHEME_CALLBACK (width, (SCM smob)); DECLARE_SCHEME_CALLBACK (height, (SCM smob)); - static Interval relative_group_extent (Link_array__Grob_ const &list, + static Interval relative_group_extent (vector const &list, Grob *common, Axis); 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 *, Link_array__Grob_ *); + static void get_children (Grob *, vector *); static bool has_interface (Grob *); }; diff --git a/lily/include/bar-line.hh b/lily/include/bar-line.hh index dbc99745f2..4744aef855 100644 --- a/lily/include/bar-line.hh +++ b/lily/include/bar-line.hh @@ -18,7 +18,7 @@ class Bar_line public: static bool has_interface (Grob *); - static Stencil compound_barline (Grob *, std::string, Real height, bool rounded); + static Stencil compound_barline (Grob *, string, Real height, bool rounded); static Stencil simple_barline (Grob *, Real wid, Real height, bool rounded); DECLARE_SCHEME_CALLBACK (calc_bar_size, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); diff --git a/lily/include/bar.hh b/lily/include/bar.hh index 27fbe484a6..b7ebca69a5 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -18,7 +18,7 @@ class Bar public: static bool has_interface (Grob *); - static Stencil compound_barline (Grob *, std::string, Real height); + static Stencil compound_barline (Grob *, string, Real height); static Stencil simple_barline (Grob *, Real wid, Real height); DECLARE_SCHEME_CALLBACK (get_staff_bar_size, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); diff --git a/lily/include/beam.hh b/lily/include/beam.hh index c852b44301..15ddae2bf1 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -72,10 +72,10 @@ public: static Real score_slopes_dy (Real, Real, Real, Real, Real, bool, Beam_quant_parameters const *); - static Real score_stem_lengths (Link_array__Grob_ const &stems, - std::vector const &stem_infos, - std::vector const &base_stem_ys, - std::vector const &stem_xs, + static Real score_stem_lengths (vector const &stems, + vector const &stem_infos, + vector const &base_stem_ys, + vector const &stem_xs, Real xl, Real xr, bool knee, Real yl, Real yr, Beam_quant_parameters const *); diff --git a/lily/include/beaming.hh b/lily/include/beaming.hh index 0e877f684f..40603cb478 100644 --- a/lily/include/beaming.hh +++ b/lily/include/beaming.hh @@ -28,7 +28,7 @@ struct Beaming_info */ struct Beaming_info_list { - std::vector infos_; + vector infos_; int beam_extend_count (Direction) const; int best_splitpoint_index (Moment &beat_length, bool subdivide) const; diff --git a/lily/include/bezier.hh b/lily/include/bezier.hh index 2dc8ef22d6..94f207a33b 100644 --- a/lily/include/bezier.hh +++ b/lily/include/bezier.hh @@ -24,8 +24,8 @@ public: void translate (Offset); Real get_other_coordinate (Axis a, Real x) const; - std::vector solve_point (Axis, Real coordinate) const; - std::vector solve_derivative (Offset) const; + vector solve_point (Axis, Real coordinate) const; + vector solve_derivative (Offset) const; Interval extent (Axis) const; Interval control_point_extent (Axis) const; @@ -37,15 +37,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/binary-source-file.hh b/lily/include/binary-source-file.hh index 429a04d667..95d5b644de 100644 --- a/lily/include/binary-source-file.hh +++ b/lily/include/binary-source-file.hh @@ -11,7 +11,7 @@ class Binary_source_file : public Source_file { public: - Binary_source_file (std::string &file_name_string); + Binary_source_file (string &file_name_string); virtual ~Binary_source_file (); U8 get_U8 (); @@ -20,7 +20,7 @@ public: Byte get_Byte () {return get_U8 (); } int get_int () { return get_U32 (); } - virtual std::string quote_input (char const *pos_str0) const; + virtual string quote_input (char const *pos_str0) const; virtual int get_line (char const *pos_str0) const; }; diff --git a/lily/include/book.hh b/lily/include/book.hh index 50943dc0ad..9ef2ca2130 100644 --- a/lily/include/book.hh +++ b/lily/include/book.hh @@ -20,7 +20,7 @@ class Book : public Input DECLARE_SMOBS (Book, foo); public: - std::string user_key_; + string user_key_; SCM header_; Output_def *paper_; SCM scores_; diff --git a/lily/include/break-algorithm.hh b/lily/include/break-algorithm.hh index ed1164ffda..c4afa2d373 100644 --- a/lily/include/break-algorithm.hh +++ b/lily/include/break-algorithm.hh @@ -23,21 +23,21 @@ protected: Paper_score *pscore_; Real linewidth_; - Link_array__Grob_ find_breaks () const; - std::vector find_break_indices () const; + vector find_breaks () const; + vector find_break_indices () const; void solve_line (Column_x_positions *) const; - bool feasible (Link_array__Grob_ const &) const; + bool feasible (vector const &) const; - Simple_spacer_wrapper *generate_spacing_problem (Link_array__Grob_ const &, + Simple_spacer_wrapper *generate_spacing_problem (vector const &, Interval) const; - virtual std::vector do_solve () const = 0; + virtual vector do_solve () const = 0; public: virtual ~Break_algorithm (); Simple_spacer *(*get_line_spacer) (); Break_algorithm (); void set_pscore (Paper_score *); - std::vector solve () const; + vector solve () const; }; #endif // BREAK_HH diff --git a/lily/include/break-align-interface.hh b/lily/include/break-align-interface.hh index 289d432cdb..7fc83f3e83 100644 --- a/lily/include/break-align-interface.hh +++ b/lily/include/break-align-interface.hh @@ -14,7 +14,7 @@ class Break_align_interface { public: - static Link_array__Grob_ ordered_elements (Grob *me); + static vector ordered_elements (Grob *me); static bool has_interface (Grob *); static void add_element (Grob *me, Grob *add); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element)); diff --git a/lily/include/change-iterator.hh b/lily/include/change-iterator.hh index 75c84286d9..71aa7cb8d3 100644 --- a/lily/include/change-iterator.hh +++ b/lily/include/change-iterator.hh @@ -20,7 +20,7 @@ public: DECLARE_CLASSNAME(Change_iterator); private: - void error (std::string); + void error (string); }; #endif diff --git a/lily/include/coherent-ligature-engraver.hh b/lily/include/coherent-ligature-engraver.hh index ede15b3e34..e8422d9eb1 100644 --- a/lily/include/coherent-ligature-engraver.hh +++ b/lily/include/coherent-ligature-engraver.hh @@ -18,12 +18,12 @@ public: protected: virtual void build_ligature (Spanner *ligature, - std::vector primitives) = 0; + vector primitives) = 0; virtual void typeset_ligature (Spanner *ligature, - std::vector primitives); + vector primitives); virtual void get_set_column (Item *, Paper_column *); private: - void collect_accidentals (Spanner *, std::vector); + void collect_accidentals (Spanner *, vector); }; #endif // COHERENT_LIGATURE_ENGRAVER_HH diff --git a/lily/include/column-x-positions.hh b/lily/include/column-x-positions.hh index c5d0f928a7..aeb3060048 100644 --- a/lily/include/column-x-positions.hh +++ b/lily/include/column-x-positions.hh @@ -12,10 +12,10 @@ struct Column_x_positions { - Link_array__Grob_ cols_; - Link_array__Grob_ loose_cols_; + vector cols_; + vector loose_cols_; - std::vector config_; + vector config_; Real force_; bool satisfies_constraints_; diff --git a/lily/include/context-def.hh b/lily/include/context-def.hh index faddf38f73..4882892730 100644 --- a/lily/include/context-def.hh +++ b/lily/include/context-def.hh @@ -41,7 +41,7 @@ public: SCM get_translator_names (SCM) const; void set_acceptor (SCM accepts, bool add); - Link_array__Context_def_ path_to_acceptable_context (SCM type_string, + vector path_to_acceptable_context (SCM type_string, Output_def *) const; Context *instantiate (SCM extra_ops, Object_key const *); diff --git a/lily/include/context.hh b/lily/include/context.hh index 5c3b93fa14..22e7e14221 100644 --- a/lily/include/context.hh +++ b/lily/include/context.hh @@ -30,8 +30,8 @@ private: int iterator_count_; bool init_; - map grob_counts_; - map context_counts_; + map grob_counts_; + map context_counts_; protected: Object_key const *key_; @@ -43,19 +43,19 @@ protected: SCM accepts_list_; SCM aliases_; Translator_group *implementation_; - std::string id_string_; + string id_string_; friend class Context_def; void clear_key_disambiguations (); public: Object_key const *key () const { return key_; } - Object_key const *create_grob_key (std::string); - Object_key const *get_grob_key (std::string); - Object_key const *get_context_key (std::string, std::string); + Object_key const *create_grob_key (string); + Object_key const *get_grob_key (string); + Object_key const *get_context_key (string, string); - Context *create_context (Context_def *, std::string, SCM); - std::string id_string () const { return id_string_; } + Context *create_context (Context_def *, string, SCM); + string id_string () const { return id_string_; } SCM children_contexts () const { return context_list_; } SCM default_child_context_name () const; @@ -72,7 +72,7 @@ public: Context *remove_context (Context *trans); void check_removal (); - std::string context_name () const; + string context_name () const; SCM context_name_symbol () const; Global_context *get_global_context () const; @@ -89,10 +89,10 @@ public: bool try_music (Music *); Context *find_create_context (SCM context_name, - std::string id, SCM ops); + string id, SCM ops); Context *create_unique_context (SCM context_name, SCM ops); - Link_array__Context_ path_to_acceptable_context (SCM alias, + vector path_to_acceptable_context (SCM alias, Output_def *) const; }; @@ -106,7 +106,7 @@ void execute_general_pushpop_property (Context *context, SCM context_property, SCM grob_property_path, SCM val); SCM updated_grob_properties (Context *tg, SCM sym); Context *find_context_below (Context *where, - SCM type_sym, std::string id); + SCM type_sym, string id); bool melisma_busy (Context *); Context *get_voice_to_lyrics (Context *lyrics); 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/duration.hh b/lily/include/duration.hh index 6d7bdf6a32..377d54ef0e 100644 --- a/lily/include/duration.hh +++ b/lily/include/duration.hh @@ -20,7 +20,7 @@ public: Duration (); Duration (int, int); - 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 d894c9ada6..0af77fca31 100644 --- a/lily/include/engraver-group.hh +++ b/lily/include/engraver-group.hh @@ -15,7 +15,7 @@ class Engraver_group : public virtual Translator_group { protected: - std::vector announce_infos_; + vector announce_infos_; SCM acknowledge_hash_table_; public: VIRTUAL_COPY_CONSTRUCTOR (Translator_group, Engraver_group); diff --git a/lily/include/file-name-map.hh b/lily/include/file-name-map.hh index 28a5d30aec..35697d753d 100644 --- a/lily/include/file-name-map.hh +++ b/lily/include/file-name-map.hh @@ -11,7 +11,7 @@ #include "std-string.hh" -std::string map_file_name (std::string s); +string map_file_name (string s); #endif /* FILE_NAME_MAP_HH */ diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index 3deebd03ca..d4507a45ae 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -20,21 +20,21 @@ class Font_metric public: SCM description_; - std::string file_name_; + string file_name_; - virtual Stencil text_stencil (std::string) const; - virtual Box text_dimension (std::string) const; - virtual std::string font_name () const; + virtual Stencil text_stencil (string) const; + virtual Box text_dimension (string) const; + virtual string font_name () const; virtual vsize count () const; - virtual Offset attachment_point (std::string) const; + virtual Offset attachment_point (string) const; virtual Offset get_indexed_wxwy (vsize) const; virtual Box get_indexed_char (vsize index) const; virtual Box get_ascii_char (vsize ascii) const; - virtual vsize name_to_index (std::string) const; + virtual vsize name_to_index (string) const; virtual vsize index_to_charcode (vsize) const; virtual vsize index_to_ascii (vsize) const; virtual Real design_size () const; - virtual Stencil find_by_name (std::string) const; + virtual Stencil find_by_name (string) const; virtual Stencil get_indexed_char_stencil (vsize k) const; virtual Stencil get_ascii_char_stencil (vsize k) const; virtual SCM sub_fonts () const; @@ -51,7 +51,7 @@ protected: Font_metric (); }; -int get_encoded_index (Font_metric *m, std::string input_coding, int code); +int get_encoded_index (Font_metric *m, string input_coding, int code); class Simple_font_metric : public Font_metric { diff --git a/lily/include/freetype.hh b/lily/include/freetype.hh index 72ff32b99c..416c85984c 100644 --- a/lily/include/freetype.hh +++ b/lily/include/freetype.hh @@ -17,7 +17,7 @@ void init_freetype (); extern FT_Library freetype2_library; -FT_Face open_ft_face (std::string str); +FT_Face open_ft_face (string str); #endif /* FREETYPE_HH */ diff --git a/lily/include/gourlay-breaking.hh b/lily/include/gourlay-breaking.hh index 9d0e841824..23bb173d28 100644 --- a/lily/include/gourlay-breaking.hh +++ b/lily/include/gourlay-breaking.hh @@ -16,7 +16,7 @@ */ struct Gourlay_breaking : public Break_algorithm { - std::vector do_solve () const; + vector do_solve () const; Gourlay_breaking (); Real combine_demerits (Column_x_positions const &, Column_x_positions const &) const; }; diff --git a/lily/include/gregorian-ligature-engraver.hh b/lily/include/gregorian-ligature-engraver.hh index 2524d0669e..96b87f84f2 100644 --- a/lily/include/gregorian-ligature-engraver.hh +++ b/lily/include/gregorian-ligature-engraver.hh @@ -21,9 +21,9 @@ public: protected: Gregorian_ligature_engraver (); virtual bool try_music (Music *); - virtual void build_ligature (Spanner *ligature, std::vector primitives); + virtual void build_ligature (Spanner *ligature, vector primitives); virtual void transform_heads (Spanner *ligature, - std::vector primitives) = 0; + vector primitives) = 0; void stop_translation_timestep (); }; diff --git a/lily/include/gregorian-ligature.hh b/lily/include/gregorian-ligature.hh index d59833a161..a6d8adc950 100644 --- a/lily/include/gregorian-ligature.hh +++ b/lily/include/gregorian-ligature.hh @@ -16,7 +16,7 @@ class Gregorian_ligature { public: static bool has_interface (Grob *); - 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 7d8bf9be1d..47580b38d1 100644 --- a/lily/include/grob-array.hh +++ b/lily/include/grob-array.hh @@ -15,7 +15,7 @@ class Grob_array { - Link_array__Grob_ grobs_; + vector grobs_; bool ordered_; DECLARE_SIMPLE_SMOBS (Grob_array,); @@ -31,15 +31,15 @@ public: bool empty () const; void clear (); void add (Grob *x) { grobs_.push_back (x); } - void set_array (Link_array__Grob_ const &src); - Link_array__Grob_ &array_reference (); - Link_array__Grob_ const &array () const; + void set_array (vector const &src); + vector &array_reference (); + vector const &array () const; static SCM make_array (); }; DECLARE_UNSMOB (Grob_array, grob_array); -Link_array__Grob_ const &ly_scm2link_array (SCM x); +vector const &ly_scm2link_array (SCM x); SCM grob_list_to_grob_array (SCM lst); #endif /* GROB_ARRAY_HH */ diff --git a/lily/include/grob-info.hh b/lily/include/grob-info.hh index 89b1054552..35e3eab64e 100644 --- a/lily/include/grob-info.hh +++ b/lily/include/grob-info.hh @@ -29,7 +29,7 @@ public: Context *context () const; Music *music_cause () const; Music *ultimate_music_cause () const; - Link_array__Context_ 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 522cfd555c..6c3ef612bd 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -73,7 +73,7 @@ public: bool is_live () const; /* naming. */ - std::string name () const; + string name () const; /* Properties */ SCM get_property_alist_chain (SCM) const; @@ -85,8 +85,8 @@ public: void internal_set_object (SCM sym, SCM val); /* messages */ - void warning (std::string) const; - void programming_error (std::string) const; + void warning (string) const; + void programming_error (string) const; /* class hierarchy */ @@ -128,7 +128,7 @@ Item *unsmob_item (SCM); /* refpoints */ Grob *common_refpoint_of_list (SCM elt_list, Grob *, Axis a); -Grob *common_refpoint_of_array (Link_array__Grob_ const &, Grob *, Axis a); +Grob *common_refpoint_of_array (vector 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 79925bc934..7cc2b21b09 100644 --- a/lily/include/horizontal-bracket.hh +++ b/lily/include/horizontal-bracket.hh @@ -17,7 +17,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, - Link_array__Grob_ grobs, + vector grobs, Axis a, Direction dir); static bool has_interface (Grob *); }; diff --git a/lily/include/includable-lexer.hh b/lily/include/includable-lexer.hh index f495424f28..5f03e97854 100644 --- a/lily/include/includable-lexer.hh +++ b/lily/include/includable-lexer.hh @@ -25,12 +25,12 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; */ class Includable_lexer : public yyFlexLexer { - std::vector state_stack_; + vector state_stack_; protected: bool close_input (); - Link_array__Source_file_ include_stack_; - std::vector char_count_stack_; + vector include_stack_; + vector char_count_stack_; public: bool allow_includes_b_; @@ -39,11 +39,11 @@ public: ~Includable_lexer (); /// store dependencies for Makefile stuff. - std::vector file_name_strings_; + vector file_name_strings_; Source_file *get_source_file () const; - void new_input (std::string s, Sources *); - void new_input (std::string name, std::string data, Sources *); + void new_input (string s, Sources *); + void new_input (string name, string data, Sources *); char const *here_str0 () const; }; diff --git a/lily/include/input.hh b/lily/include/input.hh index 9c255b70f0..e1b4169841 100644 --- a/lily/include/input.hh +++ b/lily/include/input.hh @@ -27,17 +27,17 @@ public: char const *end () const; void set (Source_file *, char const *, char const *); - void warning (std::string) const; // should use member func? - void non_fatal_error (std::string) const; - void error (std::string) const; - void message (std::string) const; + void warning (string) const; // should use member func? + void non_fatal_error (string) const; + void error (string) const; + void message (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; diff --git a/lily/include/keyword.hh b/lily/include/keyword.hh index dfd355e1af..ba4867204d 100644 --- a/lily/include/keyword.hh +++ b/lily/include/keyword.hh @@ -21,7 +21,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/kpath.hh b/lily/include/kpath.hh index ec74c7027a..baffaf1ffc 100644 --- a/lily/include/kpath.hh +++ b/lily/include/kpath.hh @@ -11,7 +11,7 @@ #include "std-string.hh" -std::string kpathsea_find_tfm (char const *name); +string kpathsea_find_tfm (char const *name); void initialize_kpathsea (char *av0); #endif /* KPATH_HH */ diff --git a/lily/include/least-squares.hh b/lily/include/least-squares.hh index 8dcb2470b6..49a5574f1f 100644 --- a/lily/include/least-squares.hh +++ b/lily/include/least-squares.hh @@ -12,7 +12,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 16ce68f92b..c70523ae91 100644 --- a/lily/include/ligature-engraver.hh +++ b/lily/include/ligature-engraver.hh @@ -25,7 +25,7 @@ protected: void process_music (); virtual Spanner *create_ligature_spanner () = 0; virtual void typeset_ligature (Spanner *ligature, - std::vector primitives) = 0; + vector primitives) = 0; virtual Spanner *current_ligature (); SCM brew_ligature_primitive_proc; @@ -37,10 +37,10 @@ private: Drul_array events_drul_; Spanner *ligature_; - std::vector primitives_; + vector primitives_; Spanner *finished_ligature_; - std::vector finished_primitives_; + vector finished_primitives_; Music *prev_start_event_; diff --git a/lily/include/lily-guile-macros.hh b/lily/include/lily-guile-macros.hh index 5ee84590c3..ef0db47479 100644 --- a/lily/include/lily-guile-macros.hh +++ b/lily/include/lily-guile-macros.hh @@ -87,13 +87,13 @@ inline SCM ly_symbol2scm (char const *x) { return scm_str2symbol ((x)); } /* Make TYPE::FUNC available as a Scheme function. */ -std::string mangle_cxx_identifier (std::string); +string mangle_cxx_identifier (string); #define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT) \ SCM TYPE ::FUNC ## _proc; \ void \ TYPE ## _ ## FUNC ## _init_functions () \ { \ - std::string id = mangle_cxx_identifier (std::string (#TYPE) + "::" + std::string (#FUNC)); \ + string id = mangle_cxx_identifier (string (#TYPE) + "::" + string (#FUNC)); \ TYPE ::FUNC ## _proc = scm_c_define_gsubr (id.c_str(), \ (ARGCOUNT), 0, 0, \ (Scheme_function_unknown) TYPE::FUNC); \ diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index b51629fa15..98e7ceadcf 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -41,10 +41,10 @@ SCM ly_to_symbol (SCM scm); extern SCM global_lily_module; -std::string gulp_file_to_string (std::string fn, bool must_exist, int size); +string gulp_file_to_string (string fn, bool must_exist, int size); -std::string ly_scm2string (SCM s); -std::string ly_symbol2string (SCM); +string ly_scm2string (SCM s); +string ly_symbol2string (SCM); SCM ly_offset2scm (Offset); Offset ly_scm2offset (SCM); SCM ly_chain_assoc (SCM key, SCM achain); @@ -67,7 +67,7 @@ Offset robust_scm2offset (SCM, Offset); 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 *); @@ -121,7 +121,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); diff --git a/lily/include/lily-lexer.hh b/lily/include/lily-lexer.hh index fcad09d526..d0a188ab69 100644 --- a/lily/include/lily-lexer.hh +++ b/lily/include/lily-lexer.hh @@ -24,10 +24,10 @@ class Lily_lexer : public Includable_lexer DECLARE_SMOBS (Lily_lexer,); private: - int lookup_keyword (std::string); - int scan_bare_word (std::string); - SCM scan_markup_word (std::string); - int scan_escaped_word (std::string); + int lookup_keyword (string); + int scan_bare_word (string); + SCM scan_markup_word (string); + int scan_escaped_word (string); int identifier_type (SCM); char escaped_char (char) const; @@ -35,7 +35,7 @@ private: SCM scopes_; SCM start_module_; public: - std::string main_input_name_; + string main_input_name_; void *lexval; Input *lexloc; bool is_main_input_; @@ -65,7 +65,7 @@ public: void start_main_input (); - SCM lookup_identifier (std::string s); + SCM lookup_identifier (string s); SCM lookup_identifier_symbol (SCM s); void push_chord_state (SCM tab); void push_figuredbass_state (); diff --git a/lily/include/lily-parser.hh b/lily/include/lily-parser.hh index 7c89bdca0e..c460ffcd09 100644 --- a/lily/include/lily-parser.hh +++ b/lily/include/lily-parser.hh @@ -25,11 +25,11 @@ class Lily_parser DECLARE_SMOBS (Lily_parser,); friend int yyparse (void *); - std::vector define_spots_; + vector define_spots_; char const *here_str0 () const; Simultaneous_music *get_chord (Pitch tonic, - std::vector *adds, std::vector *subs, + vector *adds, vector *subs, Pitch *inversion, Pitch *bass, Duration d); void set_chord_tremolo (int type_i); void set_last_duration (Duration const *); @@ -39,7 +39,7 @@ public: Lily_lexer *lexer_; Sources *sources_; Duration default_duration_; - std::string output_basename_; + string output_basename_; int fatal_error_; int error_level_; @@ -52,10 +52,10 @@ public: void do_init_file (); void do_yyparse (); - void parse_file (std::string init, std::string name, std::string out_name); - void parse_string (std::string ly_code); - void parser_error (std::string); - void parser_error (Input const &, std::string); + void parse_file (string init, string name, string out_name); + void parse_string (string ly_code); + void parser_error (string); + void parser_error (Input const &, string); void set_yydebug (bool); }; diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 99c768d293..e13feab6ed 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -8,6 +8,7 @@ #ifndef LILY_PROTO_HH #define LILY_PROTO_HH + #include "flower-proto.hh" class All_font_metrics; @@ -177,29 +178,4 @@ class yyFlexLexer; typedef void (*Engraver_void_function_engraver_grob_info) (Engraver *, Grob_info); typedef void (*Translator_void_method_ptr) (Translator *); - -/* FIXME: when Link_array is dropped, do grand s/r to vector. */ - -#include "std-vector.hh" - -#define Link_array__char_ std::vector -#define Link_array__Grob_ std::vector -#define Link_array__Accidental_placement_entry_ std::vector -#define Link_array__Audio_item_ std::vector -#define Link_array__Audio_note_ std::vector -#define Link_array__Audio_piano_pedal_ std::vector -#define Link_array__Audio_staff_ std::vector -#define Link_array__Bracket_nesting_node_ std::vector -#define Link_array__Context_ std::vector -#define Link_array__Context_def_ std::vector -#define Link_array__Grob_ std::vector -#define Link_array__Item_ std::vector -#define Link_array__Music_ std::vector -#define Link_array__Note_column_ std::vector -#define Link_array__Output_def_ std::vector -#define Link_array__Slur_configuration_ std::vector -#define Link_array__Source_file_ std::vector -#define Link_array__Spanner_ std::vector -#define Link_array__Tie_configuration_ std::vector - #endif /* LILY_PROTO_HH */ diff --git a/lily/include/lily-version.hh b/lily/include/lily-version.hh index d4df9e0529..eab4462df2 100644 --- a/lily/include/lily-version.hh +++ b/lily/include/lily-version.hh @@ -11,9 +11,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-input-version.hh b/lily/include/lilypond-input-version.hh index 69e13e3b86..12c4782205 100644 --- a/lily/include/lilypond-input-version.hh +++ b/lily/include/lilypond-input-version.hh @@ -14,15 +14,15 @@ struct Lilypond_version { Lilypond_version (int major, int minor, int patch); - Lilypond_version (std::string str); + Lilypond_version (string str); - std::string to_string () const; + string to_string () const; operator int () const; int major_; int minor_; int patch_; - std::string extra_patch_string_; + string extra_patch_string_; }; extern Lilypond_version oldest_version; diff --git a/lily/include/lilypond-key.hh b/lily/include/lilypond-key.hh index dc27c98fea..4196ffd5f2 100644 --- a/lily/include/lilypond-key.hh +++ b/lily/include/lilypond-key.hh @@ -17,13 +17,13 @@ class Lilypond_grob_key : public Object_key { Object_key const *context_; Moment creation_moment_; - std::string grob_name_; + string grob_name_; int disambiguation_count_; public: Lilypond_grob_key (Object_key const *context, Moment start, - std::string name, int); + string name, int); static Object_key *from_scheme (SCM); protected: @@ -37,15 +37,15 @@ class Lilypond_context_key : public Object_key { Object_key const *parent_context_; Moment start_moment_; - std::string context_name_; - std::string id_; + string context_name_; + string id_; int disambiguation_count_; public: Lilypond_context_key (Object_key const *parent, Moment start, - std::string type, - std::string id, + string type, + string id, int count); static Object_key *from_scheme (SCM); @@ -59,10 +59,10 @@ protected: class Lilypond_general_key : public Object_key { Object_key const *parent_; - std::string name_; + string name_; int disambiguation_count_; public: - Lilypond_general_key (Object_key const *parent, std::string name, + Lilypond_general_key (Object_key const *parent, string name, int count); static Object_key *from_scheme (SCM); diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index bb3f030b71..edde194538 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -17,7 +17,7 @@ struct Lookup static Stencil dot (Offset p, Real radius); static Stencil bracket (Axis a, Interval iv, Real thick, Real protude, Real blot); static Stencil accordion (SCM arg, Real interline_f, Font_metric *fm); - static Stencil round_filled_polygon (std::vector const &points, Real blotdiameter); + static Stencil round_filled_polygon (vector const &points, Real blotdiameter); static Stencil frame (Box b, Real thick, Real blot); static Stencil slur (Bezier controls, Real cthick, Real thick); static Stencil bezier_sandwich (Bezier top_curve, Bezier bottom_curve); diff --git a/lily/include/main.hh b/lily/include/main.hh index a64b82a958..bd396a16f7 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -17,37 +17,37 @@ void set_debug (bool); void do_scores (); void clear_scores (); void add_score (Score *s); -void set_default_output (std::string s); -std::string find_file (std::string); +void set_default_output (string s); +string find_file (string); 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::string output_backend_global; -extern std::string output_name_global; +extern vector dump_header_fieldnames_global; +extern string output_backend_global; +extern string output_name_global; extern bool be_safe_global; extern bool be_verbose_global; extern bool do_internal_type_checking_global; extern bool is_pango_format_global; extern bool is_TeX_format_global; extern bool point_and_click_global; -extern std::string prefix_directory; +extern string prefix_directory; extern bool use_object_keys; /* todo: collect in Output_option struct? */ -extern std::string output_format_global; +extern string output_format_global; extern bool make_preview; extern bool make_print; /* 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-item.hh b/lily/include/midi-item.hh index 4f0e22a19f..178ddedbf5 100644 --- a/lily/include/midi-item.hh +++ b/lily/include/midi-item.hh @@ -26,9 +26,9 @@ public: /// factory static Midi_item *get_midi (Audio_item *a); - static std::string i2varint_string (int i); + static string i2varint_string (int i); - virtual std::string to_string () const = 0; + virtual string to_string () const = 0; int channel_; }; @@ -43,7 +43,7 @@ public: Moment delta_mom_; Midi_item *midi_; - std::string to_string () const; + string to_string () const; }; /** @@ -52,15 +52,15 @@ public: class Midi_chunk : public Midi_item { public: - void set (std::string header_string, std::string data_string, std::string footer_string); - virtual std::string to_string () const; - virtual std::string data_string () const; + void set (string header_string, string data_string, string footer_string); + virtual string to_string () const; + virtual string data_string () const; DECLARE_CLASSNAME(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_duration : public Midi_item @@ -68,7 +68,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_; }; @@ -89,7 +89,7 @@ public: Midi_instrument (Audio_instrument *); DECLARE_CLASSNAME(Midi_instrument); - virtual std::string to_string () const; + virtual string to_string () const; Audio_instrument *audio_; }; @@ -100,7 +100,7 @@ public: Midi_key (Audio_key *); DECLARE_CLASSNAME(Midi_key); - virtual std::string to_string () const; + virtual string to_string () const; Audio_key *audio_; }; @@ -111,7 +111,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_; @@ -129,7 +129,7 @@ public: Moment get_length () const; int get_pitch () const; int get_fine_tuning () const; - virtual std::string to_string () const; + virtual string to_string () const; Audio_note *audio_; @@ -146,7 +146,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_; @@ -164,7 +164,7 @@ public: Midi_text (Audio_text *); - virtual std::string to_string () const; + virtual string to_string () const; Audio_text *audio_; }; @@ -175,7 +175,7 @@ public: Midi_dynamic (Audio_dynamic *); DECLARE_CLASSNAME(Midi_dynamic); - virtual std::string to_string () const; + virtual string to_string () const; Audio_dynamic *audio_; }; @@ -186,7 +186,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_; }; @@ -197,7 +197,7 @@ public: Midi_tempo (Audio_tempo *); DECLARE_CLASSNAME(Midi_tempo); - virtual std::string to_string () const; + virtual string to_string () const; Audio_tempo *audio_; }; @@ -216,7 +216,7 @@ public: Midi_track (); void add (Moment delta_time_mom, Midi_item *midi); - virtual std::string data_string () const; + virtual string data_string () const; }; #endif // MIDI_ITEM_HH diff --git a/lily/include/midi-stream.hh b/lily/include/midi-stream.hh index 1d460c29da..4f02d6cbca 100644 --- a/lily/include/midi-stream.hh +++ b/lily/include/midi-stream.hh @@ -17,17 +17,17 @@ class Midi_item; /// Midi outputfile struct Midi_stream { - Midi_stream (std::string file_name_string); + Midi_stream (string file_name_string); ~Midi_stream (); - Midi_stream &operator << (std::string str); + Midi_stream &operator << (string str); Midi_stream &operator << (Midi_item const &midi_c_r); Midi_stream &operator << (int i); 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 396b721daf..a01add8f1e 100644 --- a/lily/include/midi-walker.hh +++ b/lily/include/midi-walker.hh @@ -41,7 +41,7 @@ private: Midi_track *track_; Audio_staff *staff_; vsize index_; - Link_array__Audio_item_ *items_; + vector *items_; PQueue stop_note_queue; Moment last_mom_; }; diff --git a/lily/include/misc.hh b/lily/include/misc.hh index 4799900b6c..c7dd1e51a9 100644 --- a/lily/include/misc.hh +++ b/lily/include/misc.hh @@ -28,7 +28,7 @@ sign (int i) else return 0; } -std::vector split_string (std::string s, char c); +vector split_string (string s, char c); inline Real linear_interpolate (Real x, Real x1, Real x2, Real y1, Real y2) diff --git a/lily/include/modified-font-metric.hh b/lily/include/modified-font-metric.hh index 823211ddf4..c2f66f9292 100644 --- a/lily/include/modified-font-metric.hh +++ b/lily/include/modified-font-metric.hh @@ -15,14 +15,14 @@ struct Modified_font_metric : public Font_metric { public: - Box text_dimension (std::string) const; - Stencil text_stencil (std::string) const; + Box text_dimension (string) const; + Stencil text_stencil (string) const; static SCM make_scaled_font_metric (Font_metric *fm, Real magnification); vsize count () const; Offset get_indexed_wxwy (vsize) const; - Offset attachment_point (std::string) const; - vsize name_to_index (std::string) const; + Offset attachment_point (string) const; + vsize name_to_index (string) const; vsize index_to_charcode (vsize) const; Font_metric *original_font () const; @@ -32,13 +32,13 @@ 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 (vsize) const; vsize index_to_ascii (vsize) const; Box get_ascii_char (vsize) const; - Box tex_kludge (std::string) const; + Box tex_kludge (string) const; }; #endif /* MODIFIED_FONT_METRIC_HH */ diff --git a/lily/include/moment.hh b/lily/include/moment.hh index 8d594d4931..f0c6fbb21b 100644 --- a/lily/include/moment.hh +++ b/lily/include/moment.hh @@ -46,7 +46,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 00ed6ad386..0b738aa0b3 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -94,7 +94,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 70be17119c..11f578ce81 100644 --- a/lily/include/note-collision.hh +++ b/lily/include/note-collision.hh @@ -26,10 +26,10 @@ class Note_collision_interface { public: - static SCM automatic_shift (Grob *, Drul_array); + static SCM automatic_shift (Grob *, Drul_array >); static SCM forced_shift (Grob *); - static Drul_array get_clash_groups (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); static bool has_interface (Grob *); diff --git a/lily/include/open-type-font.hh b/lily/include/open-type-font.hh index 57518b2b57..e1d798611b 100644 --- a/lily/include/open-type-font.hh +++ b/lily/include/open-type-font.hh @@ -38,22 +38,22 @@ public: SCM get_char_table () const; SCM glyph_list () const; - std::string get_otf_table (std::string tag) const; - static SCM make_otf (std::string); - std::string font_name () const; + string get_otf_table (string tag) const; + static SCM make_otf (string); + string font_name () const; ~Open_type_font (); - Offset attachment_point (std::string) const; + Offset attachment_point (string) const; vsize count () const; Box get_indexed_char (vsize) const; - vsize name_to_index (std::string) const; - //vsize glyph_name_to_charcode (std::string) const; + vsize name_to_index (string) const; + //vsize glyph_name_to_charcode (string) const; vsize index_to_charcode (vsize) const; void derived_mark () const; SCM sub_fonts () const; Real design_size () const; }; -std::string get_otf_table (FT_Face face, std::string tag); -FT_Face open_ft_face (std::string str); +string get_otf_table (FT_Face face, string tag); +FT_Face open_ft_face (string str); #endif /* OPEN_TYPE_FONT_HH */ diff --git a/lily/include/output-def.hh b/lily/include/output-def.hh index 8b4dfe943f..7d5563d474 100644 --- a/lily/include/output-def.hh +++ b/lily/include/output-def.hh @@ -47,7 +47,7 @@ public: Output_def *parent_; Input input_origin_; - std::string user_key_; + string user_key_; Lily_parser *parser_; Lily_parser *get_parser () const; @@ -58,7 +58,7 @@ public: /* variables. */ - SCM c_variable (std::string id) const; + SCM c_variable (string id) const; SCM lookup_variable (SCM sym) const; void set_variable (SCM sym, SCM val); Real get_dimension (SCM symbol) const; diff --git a/lily/include/pango-font.hh b/lily/include/pango-font.hh index b3d4ebd934..fcf5984bac 100644 --- a/lily/include/pango-font.hh +++ b/lily/include/pango-font.hh @@ -36,9 +36,9 @@ public: ~Pango_font (); SCM font_file_name () const; - void register_font_file (std::string, std::string); - Stencil text_stencil (std::string) const; - Stencil pango_item_string_stencil (PangoItem const *, std::string) const; + void register_font_file (string, string); + Stencil text_stencil (string) const; + Stencil pango_item_string_stencil (PangoItem const *, string) const; virtual void derived_mark () const; }; diff --git a/lily/include/paper-column-engraver.hh b/lily/include/paper-column-engraver.hh index ef0fc75363..c35a6a2e51 100644 --- a/lily/include/paper-column-engraver.hh +++ b/lily/include/paper-column-engraver.hh @@ -34,7 +34,7 @@ protected: int breaks_; // used for stat printing Paper_column *command_column_; Paper_column *musical_column_; - Link_array__Item_ items_; + vector items_; bool first_; Moment last_moment_; public: diff --git a/lily/include/paper-outputter.hh b/lily/include/paper-outputter.hh index 106b6645f5..4f31eb5125 100644 --- a/lily/include/paper-outputter.hh +++ b/lily/include/paper-outputter.hh @@ -22,7 +22,7 @@ class Paper_outputter { SCM output_module_; - std::string file_name_; + string file_name_; SCM file_; public: @@ -32,13 +32,13 @@ public: SCM file () const; SCM dump_string (SCM); void output_scheme (SCM scm); - Paper_outputter (SCM port, std::string format); + Paper_outputter (SCM port, string format); SCM scheme_to_string (SCM); void output_stencil (Stencil); void close (); }; -Paper_outputter *get_paper_outputter (std::string, std::string); +Paper_outputter *get_paper_outputter (string, string); DECLARE_UNSMOB (Paper_outputter, outputter); #endif /* PAPER_OUTPUTTER_HH */ diff --git a/lily/include/paper-score.hh b/lily/include/paper-score.hh index 3056b478aa..1082b3330a 100644 --- a/lily/include/paper-score.hh +++ b/lily/include/paper-score.hh @@ -28,7 +28,7 @@ public: System *root_system () const; void typeset_system (System *); - std::vector calc_breaking (); + vector calc_breaking (); SCM get_paper_systems () const; protected: diff --git a/lily/include/performance.hh b/lily/include/performance.hh index f264ecdb6c..ff90bfd417 100644 --- a/lily/include/performance.hh +++ b/lily/include/performance.hh @@ -25,9 +25,9 @@ public: void output_header_track (Midi_stream &midi_stream_r); void print () const; - void write_output (std::string filename); + void write_output (string filename); - Link_array__Audio_staff_ audio_staffs_; + vector audio_staffs_; Cons *audio_element_list_; Output_def *midi_; }; diff --git a/lily/include/performer-group.hh b/lily/include/performer-group.hh index 2b83f61496..f5c1256a22 100644 --- a/lily/include/performer-group.hh +++ b/lily/include/performer-group.hh @@ -24,7 +24,7 @@ public: virtual int get_tempo () const; protected: - std::vector announce_infos_; + vector announce_infos_; private: void acknowledge_audio_elements (); diff --git a/lily/include/pitch.hh b/lily/include/pitch.hh index cce03371f1..da61960ecb 100644 --- a/lily/include/pitch.hh +++ b/lily/include/pitch.hh @@ -57,7 +57,7 @@ public: int steps () const; int semitone_pitch () const; int quartertone_pitch () const; - std::string to_string () const; + string to_string () const; DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b)); DECLARE_SIMPLE_SMOBS (Pitch,); @@ -82,7 +82,7 @@ DECLARE_UNSMOB (Pitch, pitch); INSTANTIATE_COMPARE (Pitch, Pitch::compare); -int compare (std::vector *, std::vector *); +int compare (vector *, vector *); extern SCM pitch_less_proc; Pitch pitch_interval (Pitch const &from, Pitch const &to); diff --git a/lily/include/pointer-group-interface.hh b/lily/include/pointer-group-interface.hh index 7ec2d62513..52adf53942 100644 --- a/lily/include/pointer-group-interface.hh +++ b/lily/include/pointer-group-interface.hh @@ -21,8 +21,8 @@ public: static void add_grob (Grob *, SCM nm, SCM x); }; -Link_array__Grob_ const &internal_extract_grob_array (Grob const *elt, SCM symbol); -Link_array__Item_ 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)) @@ -32,9 +32,9 @@ Link_array__Item_ internal_extract_item_array (Grob const *elt, SCM symbol); representation of grob sets again. */ #define extract_grob_set(grob, prop, set) \ - Link_array__Grob_ 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) \ - Link_array__Item_ 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 719c140651..141aba49b3 100644 --- a/lily/include/prob.hh +++ b/lily/include/prob.hh @@ -36,7 +36,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 mutble) const; SCM internal_get_property (SCM sym) const; diff --git a/lily/include/relocate.hh b/lily/include/relocate.hh index c8ccacc029..18188e01b5 100644 --- a/lily/include/relocate.hh +++ b/lily/include/relocate.hh @@ -14,7 +14,7 @@ #include "std-string.hh" -int sane_putenv (char const *key, std::string value, bool overwrite); +int sane_putenv (char const *key, 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 19e3abc3d4..357b76bcb2 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -18,7 +18,7 @@ class Rest public: DECLARE_SCHEME_CALLBACK (y_offset_callback, (SCM)); static bool has_interface (Grob *); - static std::string glyph_name (Grob *, int, std::string, bool); + static string glyph_name (Grob *, int, string, bool); static SCM brew_internal_stencil (Grob*, bool); static SCM generic_extent_callback (Grob*, Axis); DECLARE_SCHEME_CALLBACK (polyphonic_offset_callback, (SCM)); diff --git a/lily/include/score-engraver.hh b/lily/include/score-engraver.hh index 286210dde5..aa23392888 100644 --- a/lily/include/score-engraver.hh +++ b/lily/include/score-engraver.hh @@ -17,7 +17,7 @@ class Score_engraver : public virtual Score_translator, { System *system_; - Link_array__Grob_ elems_; + vector elems_; Paper_score *pscore_; void typeset_all (); diff --git a/lily/include/score.hh b/lily/include/score.hh index 092ddd0c8d..004e251dd9 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -24,8 +24,8 @@ class Score : public Input SCM music_; public: - Link_array__Output_def_ defs_; - std::string user_key_; + vector defs_; + string user_key_; SCM header_; bool error_found_; diff --git a/lily/include/separating-group-spanner.hh b/lily/include/separating-group-spanner.hh index b1499339e7..15b6aecbe8 100644 --- a/lily/include/separating-group-spanner.hh +++ b/lily/include/separating-group-spanner.hh @@ -14,7 +14,7 @@ class Separating_group_spanner { static void find_rods (Item *, - Link_array__Grob_ const &separators, + vector const &separators, vsize idx, Real); public: diff --git a/lily/include/simple-spacer.hh b/lily/include/simple-spacer.hh index 16c9494ed6..c98d13a395 100644 --- a/lily/include/simple-spacer.hh +++ b/lily/include/simple-spacer.hh @@ -29,7 +29,7 @@ struct Spring_description class Simple_spacer { public: - std::vector springs_; + vector springs_; Real force_; Real indent_; Real line_len_; @@ -56,11 +56,11 @@ public: struct Simple_spacer_wrapper { Simple_spacer *spacer_; - Link_array__Grob_ spaced_cols_; - Link_array__Grob_ loose_cols_; + vector spaced_cols_; + vector loose_cols_; Simple_spacer_wrapper (); - void add_columns (Link_array__Grob_ const &); + void add_columns (vector const &); void solve (Column_x_positions *, bool); ~Simple_spacer_wrapper (); private: diff --git a/lily/include/skyline.hh b/lily/include/skyline.hh index f24781a750..fc8d3acedd 100644 --- a/lily/include/skyline.hh +++ b/lily/include/skyline.hh @@ -21,20 +21,20 @@ struct Skyline_entry }; void -merge_skyline (std::vector *a1, std::vector const &a2, +merge_skyline (vector *a1, vector const &a2, Direction); -void insert_extent_into_skyline (std::vector *line, Box b, Axis line_axis, +void insert_extent_into_skyline (vector *line, Box b, Axis line_axis, Direction d); -std::vector -extents_to_skyline (std::vector const &extents, Axis a, Direction d); -std::vector empty_skyline (Direction d); -void heighten_skyline (std::vector *buildings, Real ground); +vector +extents_to_skyline (vector const &extents, Axis a, Direction d); +vector empty_skyline (Direction d); +void heighten_skyline (vector *buildings, Real ground); Real -skyline_meshing_distance (std::vector const &buildings, - std::vector const &clouds); +skyline_meshing_distance (vector const &buildings, + vector const &clouds); Real -skyline_height (std::vector const &buildings, +skyline_height (vector const &buildings, Real airplane, Direction sky_dir); #endif /* SKYLINE_HH */ diff --git a/lily/include/slur-configuration.hh b/lily/include/slur-configuration.hh index 285a8da7df..de6a54ca37 100644 --- a/lily/include/slur-configuration.hh +++ b/lily/include/slur-configuration.hh @@ -24,13 +24,13 @@ public: int index_; #if DEBUG_SLUR_SCORING - std::string score_card_; + string score_card_; #endif Slur_configuration (); void generate_curve (Slur_score_state const &state, Real r0, Real h_inf, - std::vector const &); + vector const &); void score (Slur_score_state const &); protected: void score_extra_encompass (Slur_score_state const &); diff --git a/lily/include/slur-scoring.hh b/lily/include/slur-scoring.hh index 51be36672c..0164116a14 100644 --- a/lily/include/slur-scoring.hh +++ b/lily/include/slur-scoring.hh @@ -104,15 +104,15 @@ struct Slur_score_state bool has_same_beam_; Real musical_dy_; - Link_array__Grob_ 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_; - Link_array__Slur_configuration_ configurations_; + vector configurations_; Real staff_space_; Real thickness_; @@ -123,14 +123,14 @@ struct Slur_score_state void fill (Grob *); void set_next_direction (); - std::vector generate_avoid_offsets () const; + vector generate_avoid_offsets () const; Drul_array get_bound_info () const; void generate_curves () const; - Link_array__Slur_configuration_ 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; int get_closest_index (SCM inspect_quants) const; }; diff --git a/lily/include/source-file.hh b/lily/include/source-file.hh index 42a2be56b2..5463672446 100644 --- a/lily/include/source-file.hh +++ b/lily/include/source-file.hh @@ -29,19 +29,19 @@ using namespace std; class Source_file { public: - Source_file (std::string fn); - Source_file (std::string, std::string); + Source_file (string fn); + Source_file (string, string); virtual ~Source_file (); char const *c_str () const; - virtual std::string quote_input (char const *pos_str0) const; + 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; - 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; // return start + n char const *seek_str0 (int n); @@ -50,11 +50,11 @@ public: // return here + n bytes char const *forward_str0 (int n); char const *pos_str0 () { return pos_str0_; } - std::string get_string (int n); + string get_string (int n); void set_pos (char const *pos_str0); public: 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 *) const; /* @@ -65,13 +65,13 @@ public: char const *pos_str0_; SCM get_port () const; - std::string name_; + string name_; private: - Link_array__char_ newline_locations_; + vector newline_locations_; istream *istream_; char *contents_str0_; - std::vector chs_; + vector chs_; int length_; void load_stdin (); void init_port (); @@ -79,7 +79,7 @@ private: Protected_scm str_port_; }; -char *gulp_file (std::string fn, int *len); +char *gulp_file (string fn, int *len); #endif /* SOURCE_FILE_HH */ diff --git a/lily/include/source.hh b/lily/include/source.hh index a786bea4ae..eaa0a30850 100644 --- a/lily/include/source.hh +++ b/lily/include/source.hh @@ -22,7 +22,7 @@ public: Sources (); ~Sources (); - Source_file *get_file (std::string &file_name); + Source_file *get_file (string &file_name); Source_file *get_sourcefile (char const *); void add (Source_file *sourcefile); void set_path (File_path *); diff --git a/lily/include/spacing-spanner.hh b/lily/include/spacing-spanner.hh index 1b7a86b103..c713c8755a 100644 --- a/lily/include/spacing-spanner.hh +++ b/lily/include/spacing-spanner.hh @@ -43,13 +43,13 @@ public: static Real default_bar_spacing (Grob *, Grob *, Grob *, Moment); static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const *, bool *); static Real get_duration_space (Moment dur, Spacing_options const *, bool *); - static Rational find_shortest (Grob *, Link_array__Grob_ const &); - static Rational effective_shortest_duration (Grob *me, Link_array__Grob_ const &all); + static Rational find_shortest (Grob *, vector const &); + 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 *, Link_array__Grob_ *cols, Spacing_options const *); - static void set_explicit_neighbor_columns (Link_array__Grob_ const &cols); - static void set_implicit_neighbor_columns (Link_array__Grob_ const &cols); - static void generate_springs (Grob *me, Link_array__Grob_ const &cols, Spacing_options const *); + static void prune_loose_columns (Grob *, vector *cols, Spacing_options const *); + 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 *); DECLARE_SCHEME_CALLBACK (set_springs, (SCM)); static bool has_interface (Grob *); diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index 6f87f8d585..c64c61d636 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -36,7 +36,7 @@ class Spanner : public Grob public: DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM)); - Link_array__Spanner_ broken_intos_; + vector broken_intos_; vsize get_break_index () const; diff --git a/lily/include/stem.hh b/lily/include/stem.hh index b9d69c7ba5..09daee1d16 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -14,7 +14,7 @@ class Stem { public: - static std::vector note_head_positions (Grob *); + static vector note_head_positions (Grob *); 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/stream.hh b/lily/include/stream.hh index fe33920d64..4c938da685 100644 --- a/lily/include/stream.hh +++ b/lily/include/stream.hh @@ -16,10 +16,10 @@ using namespace std; #if __GNUC__ > 2 -ostream *open_file_stream (std::string file_name, +ostream *open_file_stream (string file_name, ios_base::openmode mode = ios::out); #else -ostream *open_file_stream (std::string file_name, int mode = ios::out); +ostream *open_file_stream (string file_name, int mode = ios::out); #endif void close_file_stream (ostream *os); diff --git a/lily/include/system.hh b/lily/include/system.hh index 8b82baeff2..2fe740fddb 100644 --- a/lily/include/system.hh +++ b/lily/include/system.hh @@ -38,11 +38,11 @@ public: int element_count () const; int spanner_count () const; - void break_into_pieces (std::vector const &); + void break_into_pieces (vector const &); static bool has_interface (Grob *); - Link_array__Item_ broken_col_range (Item const *, Item const *) const; - Link_array__Grob_ columns () const; + vector broken_col_range (Item const *, Item const *) const; + vector columns () const; void add_column (Paper_column *); void typeset_grob (Grob *); diff --git a/lily/include/text-metrics.hh b/lily/include/text-metrics.hh index 47004766e9..030a9ad344 100644 --- a/lily/include/text-metrics.hh +++ b/lily/include/text-metrics.hh @@ -12,7 +12,7 @@ #include "lily-guile.hh" #include "box.hh" -void try_load_text_metrics (std::string); +void try_load_text_metrics (string); SCM ly_load_text_dimensions (SCM); Box lookup_tex_text_dimension (Font_metric *font, SCM text); diff --git a/lily/include/tfm-reader.hh b/lily/include/tfm-reader.hh index 96979fbe47..91433ad7af 100644 --- a/lily/include/tfm-reader.hh +++ b/lily/include/tfm-reader.hh @@ -20,24 +20,24 @@ class Tex_font_metric_reader private: Real get_U32_fix (); Real get_U32_fix_scaled (); - std::string get_bcpl_string (); + string get_bcpl_string (); void read_header (); void read_params (); void read_char_metrics (); Tex_font_char_metric read_char_metric (Char_code code); Tex_font_char_metric read_char (); - void read_lig_kern_program (std::vector *ligatures, - std::vector *kerns); + void read_lig_kern_program (vector *ligatures, + vector *kerns); Binary_source_file input_; public: - Tex_font_metric_reader (std::string name); + Tex_font_metric_reader (string name); Tfm_info info_; Tfm_header header_; - std::vector char_metrics_; - std::vector ascii_to_metric_idx_; + vector char_metrics_; + vector ascii_to_metric_idx_; }; #endif /* TFM_READER_HH */ diff --git a/lily/include/tfm.hh b/lily/include/tfm.hh index 15a74268ec..4aa4845d7d 100644 --- a/lily/include/tfm.hh +++ b/lily/include/tfm.hh @@ -103,7 +103,7 @@ struct Tfm_info Char_code first_charcode, last_charcode; U32 checksum; Real design_size; - std::string coding_scheme; + string coding_scheme; unsigned parameter_count; // Real parameters [Tex_font_metric::MAX_FONTDIMENS]; Real parameters [TFM_MAX_FONTDIMENS]; @@ -132,8 +132,8 @@ struct Tex_font_char_metric Char_code code_; Real width_, height_, depth_, italic_correction_; Fix width_fix_, height_fix_, depth_fix_, italic_correction_fix_; - std::vector kerns_; - std::vector ligatures_; + vector kerns_; + vector ligatures_; Tex_font_char_metric (); @@ -145,24 +145,24 @@ class Tex_font_metric : public Simple_font_metric DECLARE_CLASSNAME(Tex_font_metric); public: - static SCM make_tfm (std::string file_name); + static SCM make_tfm (string file_name); vsize count () const; Box get_ascii_char (vsize) const; Real design_size () const; void derived_mark () const; - vsize name_to_index (std::string) const; - std::string font_name () const; + vsize name_to_index (string) const; + string font_name () const; Tfm_info const &info () const; protected: Tfm_info info_; Tfm_header header_; - std::vector char_metrics_; - std::vector ascii_to_metric_idx_; + vector char_metrics_; + vector ascii_to_metric_idx_; SCM encoding_table_; - std::string font_name_; + string font_name_; private: Tex_font_char_metric const *find_ascii (vsize ascii, bool warn = true) const; diff --git a/lily/include/tie-column-format.hh b/lily/include/tie-column-format.hh index 600e11eedd..1c82c4269e 100644 --- a/lily/include/tie-column-format.hh +++ b/lily/include/tie-column-format.hh @@ -13,8 +13,8 @@ #include "lily-proto.hh" #include "tie-configuration.hh" -void set_chord_outline (std::vector *skyline, - Link_array__Item_ bounds, +void set_chord_outline (vector *skyline, + vector bounds, Grob *common, Direction d); void set_tie_config_directions (Ties_configuration *tie_configs_ptr); @@ -25,8 +25,8 @@ void final_shape_adjustment (Tie_configuration &conf, Tie_formatting_problem const&, Grob *staff_referencer); void -set_chord_outlines (Drul_array< std::vector > *skyline_drul, - Link_array__Grob_ ties, +set_chord_outlines (Drul_array< vector > *skyline_drul, + vector ties, Grob *common); void diff --git a/lily/include/tie-configuration.hh b/lily/include/tie-configuration.hh index 3608a94bc6..999d1ea8b6 100644 --- a/lily/include/tie-configuration.hh +++ b/lily/include/tie-configuration.hh @@ -40,7 +40,7 @@ public: INSTANTIATE_COMPARE (Tie_configuration, Tie_configuration::compare); -typedef std::vector Ties_configuration; +typedef vector Ties_configuration; #endif /* TIE_CONFIGURATION_HH */ diff --git a/lily/include/tie-formatting-problem.hh b/lily/include/tie-formatting-problem.hh index 7f89b21a65..50b6bcba93 100644 --- a/lily/include/tie-formatting-problem.hh +++ b/lily/include/tie-formatting-problem.hh @@ -76,11 +76,11 @@ struct Tie_configuration_variation class Tie_formatting_problem { - Drul_array< std::vector > chord_outlines_; + Drul_array< vector > chord_outlines_; Drul_array< Box > stem_extents_; set dot_positions_; Interval dot_x_; - std::vector specifications_; + vector specifications_; Tie_configuration_map possibilities_; @@ -89,7 +89,7 @@ class Tie_formatting_problem Tie_configuration *get_configuration (int position, Direction dir); Tie_configuration *generate_configuration (int position, Direction dir) const; - std::vector get_variations (Ties_configuration const &ties); + vector get_variations (Ties_configuration const &ties); Real score_configuration (Tie_configuration const &) const; Real score_aptitude (Tie_configuration const &, Tie_specification const &) const; @@ -110,10 +110,10 @@ public: Ties_configuration generate_optimal_chord_configuration (); Ties_configuration generate_ties_configuration (Ties_configuration const &); Tie_configuration find_optimal_tie_configuration (Tie_specification const &) const; - void from_ties (Link_array__Grob_ const &ties); + void from_ties (vector const &ties); void from_tie (Grob *tie); - void from_lv_ties (Link_array__Grob_ const &); - void set_chord_outline (Link_array__Item_, Direction); + void from_lv_ties (vector const &); + void set_chord_outline (vector, Direction); void set_manual_tie_configuration (SCM); Interval get_attachment (Real) const; Grob *common_x_refpoint () const; diff --git a/lily/include/translator-dispatch-list.hh b/lily/include/translator-dispatch-list.hh index dd17643d2d..060ab173af 100644 --- a/lily/include/translator-dispatch-list.hh +++ b/lily/include/translator-dispatch-list.hh @@ -22,7 +22,7 @@ struct Engraver_dispatch_entry class Engraver_dispatch_list { - 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 625944ba2d..9a6940ac06 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -40,7 +40,7 @@ class 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 2121da90ef..ab587cb5d2 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -27,7 +27,7 @@ struct Acknowledge_information NAME (); \ VIRTUAL_COPY_CONSTRUCTOR (Translator, NAME); \ static SCM static_description_; \ - static std::vector acknowledge_static_array_; \ + static vector acknowledge_static_array_; \ virtual void fetch_precomputable_methods (Translator_void_method_ptr 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 68f44c816d..255adc3ff9 100644 --- a/lily/include/translator.icc +++ b/lily/include/translator.icc @@ -31,7 +31,7 @@ ADD_GLOBAL_CTOR (_ ## T ## _adder); #define ADD_TRANSLATOR(classname, desc, grobs, accepted, read, write) \ - std::vector classname::acknowledge_static_array_; \ + vector classname::acknowledge_static_array_; \ IMPLEMENT_FETCH_PRECOMPUTABLE_METHODS (classname); \ ADD_THIS_TRANSLATOR (classname); \ Engraver_void_function_engraver_grob_info \ @@ -92,11 +92,11 @@ void add_acknowledger (Engraver_void_function_engraver_grob_info ptr, char const *func_name, - std::vector *ack_array); + vector *ack_array); Engraver_void_function_engraver_grob_info 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 3b0c0d735d..fc6830dd12 100644 --- a/lily/include/tuplet-bracket.hh +++ b/lily/include/tuplet-bracket.hh @@ -25,7 +25,7 @@ public: static void get_bounds (Grob *, Grob **, Grob **); static void add_column (Grob *me, Item *); static void add_beam (Grob *me, Grob *); - static Grob *parallel_beam (Grob *me, Link_array__Grob_ const &cols, bool *equally_long); + 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 protusion_axis, Offset dz, Drul_array height, diff --git a/lily/include/type-swallow-translator.hh b/lily/include/type-swallow-translator.hh index f477beeb3e..637c68878b 100644 --- a/lily/include/type-swallow-translator.hh +++ b/lily/include/type-swallow-translator.hh @@ -17,7 +17,7 @@ class Type_swallow_translator : public Translator { protected: - std::string swallow_string_; + string swallow_string_; bool try_music (Music *); public: VIRTUAL_COPY_CONS (Translator); diff --git a/lily/input-scheme.cc b/lily/input-scheme.cc index bf5793f52d..a13ca876e7 100644 --- a/lily/input-scheme.cc +++ b/lily/input-scheme.cc @@ -28,7 +28,7 @@ LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 1, (SCM sip, SCM msg, SCM msg = scm_simple_format (SCM_BOOL_F, msg, rest); - std::string m = ly_scm2string (msg); + string m = ly_scm2string (msg); ip->message (m); return SCM_UNSPECIFIED; diff --git a/lily/input-smob.cc b/lily/input-smob.cc index be28167194..e3bc5d275d 100644 --- a/lily/input-smob.cc +++ b/lily/input-smob.cc @@ -26,7 +26,7 @@ SCM mark_smob (SCM) static int print_smob (SCM s, SCM port, scm_print_state *) { - std::string str = "#location_string () + ">"; + string str = "#location_string () + ">"; scm_puts (str.c_str (), port); return 1; } diff --git a/lily/input.cc b/lily/input.cc index ef78037fad..1379f1c7b5 100644 --- a/lily/input.cc +++ b/lily/input.cc @@ -67,7 +67,7 @@ Input::set_location (Input const &i_start, Input const &i_end) [file:line:column:][warning:]message */ void -Input::message (std::string s) const +Input::message (string s) const { if (source_file_) s = location_string () + ": " + s + "\n" @@ -76,13 +76,13 @@ Input::message (std::string s) const } void -Input::warning (std::string s) const +Input::warning (string s) const { message (_f ("warning: %s", s)); } void -Input::error (std::string s) const +Input::error (string s) const { message (_f ("error: %s", s)); // UGH, fix naming or usage @@ -90,12 +90,12 @@ Input::error (std::string s) const } void -Input::non_fatal_error (std::string s) const +Input::non_fatal_error (string s) const { message (_f ("error: %s", s)); } -std::string +string Input::location_string () const { if (source_file_) @@ -103,7 +103,7 @@ Input::location_string () const return " (" + _ ("position unknown") + ")"; } -std::string +string Input::line_number_string () const { if (source_file_) @@ -111,7 +111,7 @@ Input::line_number_string () const return "?"; } -std::string +string Input::file_string () const { if (source_file_) diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index d591d105d9..5705b46ccf 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -92,7 +92,7 @@ Key_signature_interface::print (SCM smob) Real inter = Staff_symbol_referencer::staff_space (me) / 2.0; SCM scm_style = me->get_property ("style"); - std::string style; + string style; if (scm_is_symbol (scm_style)) style = ly_symbol2string (scm_style); else @@ -116,7 +116,7 @@ Key_signature_interface::print (SCM smob) for (SCM s = newas; scm_is_pair (s); s = scm_cdr (s)) { int alteration = scm_to_int (scm_cdar (s)); - std::string font_char + string font_char = Accidental_interface::get_fontcharname (style, alteration); Stencil acc (fm->find_by_name ("accidentals." + font_char)); diff --git a/lily/laissez-vibrer-engraver.cc b/lily/laissez-vibrer-engraver.cc index 33cf854eb4..4568dd19e4 100644 --- a/lily/laissez-vibrer-engraver.cc +++ b/lily/laissez-vibrer-engraver.cc @@ -19,7 +19,7 @@ class Laissez_vibrer_engraver : public Engraver Music *event_; Grob *lv_column_; - Link_array__Grob_ lv_ties_; + vector lv_ties_; void stop_translation_timestep (); DECLARE_ACKNOWLEDGER (note_head); diff --git a/lily/laissez-vibrer-tie-column.cc b/lily/laissez-vibrer-tie-column.cc index 3553d35b70..7b99d6e3ce 100644 --- a/lily/laissez-vibrer-tie-column.cc +++ b/lily/laissez-vibrer-tie-column.cc @@ -42,7 +42,7 @@ Laissez_vibrer_tie_column::calc_positioning_done (SCM smob) Grob *me = unsmob_grob (smob); extract_grob_set (me, "ties", lv_ro_ties); - Link_array__Grob_ lv_ties (lv_ro_ties); + vector lv_ties (lv_ro_ties); vector_sort (lv_ties, &Laissez_vibrer_tie::compare); diff --git a/lily/least-squares.cc b/lily/least-squares.cc index cba93dd605..c7ca185bbf 100644 --- a/lily/least-squares.cc +++ b/lily/least-squares.cc @@ -12,7 +12,7 @@ void minimise_least_squares (Real *coef, Real *offset, - std::vector const &input) + vector const &input) { Real sx = 0.0; Real sy = 0.0; diff --git a/lily/lexer.ll b/lily/lexer.ll index abd0c101de..a31f25e43b 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -57,21 +57,21 @@ RH 7 fix (?) */ #define isatty HORRIBLEKLUDGE -void strip_trailing_white (std::string&); -void strip_leading_white (std::string&); -std::string lyric_fudge (std::string s); +void strip_trailing_white (string&); +void strip_leading_white (string&); +string lyric_fudge (string s); int music_function_type (SCM); -SCM lookup_markup_command (std::string s); -bool is_valid_version (std::string s); +SCM lookup_markup_command (string s); +bool is_valid_version (string s); #define start_quote() \ yy_push_state (quote);\ - yylval.string = new std::string + yylval.string = new string #define start_lyric_quote() \ yy_push_state (lyric_quote);\ - yylval.string = new std::string + yylval.string = new string #define yylval \ (*(YYSTYPE*)lexval) @@ -87,7 +87,7 @@ LYRICS ({AA}|{TEX})[^0-9 \t\n\f]* */ -SCM scan_fraction (std::string); +SCM scan_fraction (string); SCM (* scm_parse_error_handler) (void *); @@ -186,7 +186,7 @@ BOM_UTF8 \357\273\277 yy_push_state (sourcefilename); } \"[^"]*\" { /* got the version number */ - std::string s (YYText () + 1); + string s (YYText () + 1); s = s.substr (0, s.rfind ('\"')); yy_pop_state (); @@ -198,7 +198,7 @@ BOM_UTF8 \357\273\277 } \"[^"]*\" { - std::string s (YYText () + 1); + string s (YYText () + 1); s = s.substr (0, s.rfind ('\"')); yy_pop_state (); @@ -250,14 +250,14 @@ BOM_UTF8 \357\273\277 yy_push_state (incl); } \"[^"]*\" { /* got the include file name */ - std::string s (YYText ()+1); + string s (YYText ()+1); s = s.substr (0, s.rfind ('"')); new_input (s, sources_); yy_pop_state (); } \\{BLACK}*{WHITE} { /* got the include identifier */ - std::string s = YYText () + 1; + string s = YYText () + 1; strip_trailing_white (s); if (s.length () && (s[s.length () - 1] == ';')) s = s.substr (0, s.length () - 1); @@ -267,7 +267,7 @@ BOM_UTF8 \357\273\277 new_input (ly_scm2string (sid), sources_); yy_pop_state (); } else { - std::string msg (_f ("wrong or undefined identifier: `%s'", s )); + string msg (_f ("wrong or undefined identifier: `%s'", s )); LexerError (msg.c_str ()); SCM err = scm_current_error_port (); @@ -349,15 +349,15 @@ BOM_UTF8 \357\273\277 } {DIGIT} { - yylval.i = String_convert::dec2int (std::string (YYText ())); + yylval.i = String_convert::dec2int (string (YYText ())); return DIGIT; } {UNSIGNED} { - yylval.i = String_convert::dec2int (std::string (YYText ())); + yylval.i = String_convert::dec2int (string (YYText ())); return UNSIGNED; } {E_UNSIGNED} { - yylval.i = String_convert::dec2int (std::string (YYText () +1)); + yylval.i = String_convert::dec2int (string (YYText () +1)); return E_UNSIGNED; } \" { @@ -380,7 +380,7 @@ BOM_UTF8 \357\273\277 yy_pop_state (); /* yylval is union. Must remember STRING before setting SCM*/ - std::string *sp = yylval.string; + string *sp = yylval.string; yylval.scm = scm_makfrom0str (sp->c_str ()); delete sp; return STRING; @@ -401,7 +401,7 @@ BOM_UTF8 \357\273\277 yy_pop_state (); /* yylval is union. Must remember STRING before setting SCM*/ - std::string *sp = yylval.string; + string *sp = yylval.string; yylval.scm = scm_makfrom0str (sp->c_str ()); delete sp; return LYRICS_STRING; @@ -420,7 +420,7 @@ BOM_UTF8 \357\273\277 return FRACTION; } {UNSIGNED} { - yylval.i = String_convert::dec2int (std::string (YYText ())); + yylval.i = String_convert::dec2int (string (YYText ())); return UNSIGNED; } {NOTECOMMAND} { @@ -428,7 +428,7 @@ BOM_UTF8 \357\273\277 } {LYRICS} { /* ugr. This sux. */ - std::string s (YYText ()); + string s (YYText ()); if (s == "__") return yylval.i = EXTENDER; if (s == "--") @@ -460,7 +460,7 @@ BOM_UTF8 \357\273\277 return FRACTION; } {UNSIGNED} { - yylval.i = String_convert::dec2int (std::string (YYText ())); + yylval.i = String_convert::dec2int (string (YYText ())); return UNSIGNED; } \" { @@ -495,7 +495,7 @@ BOM_UTF8 \357\273\277 return SCORE; } {MARKUPCOMMAND} { - std::string str (YYText () + 1); + string str (YYText () + 1); SCM s = lookup_markup_command (str); if (scm_is_pair (s) && scm_is_symbol (scm_cdr (s)) ) { @@ -531,7 +531,7 @@ BOM_UTF8 \357\273\277 return YYText ()[0]; } [^#{}"\\ \t\n\r\f]+ { - std::string s (YYText ()); + string s (YYText ()); char c = s[s.length () - 1]; /* brace open is for not confusing dumb tools. */ @@ -587,7 +587,7 @@ BOM_UTF8 \357\273\277 } {UNSIGNED} { - yylval.i = String_convert::dec2int (std::string (YYText ())); + yylval.i = String_convert::dec2int (string (YYText ())); return UNSIGNED; } @@ -637,7 +637,7 @@ BOM_UTF8 \357\273\277 } <*>. { - std::string msg = _f ("invalid character: `%c'", YYText ()[0]); + string msg = _f ("invalid character: `%c'", YYText ()[0]); LexerError (msg.c_str ()); return YYText ()[0]; } @@ -699,7 +699,7 @@ Lily_lexer::identifier_type (SCM sid) int -Lily_lexer::scan_escaped_word (std::string str) +Lily_lexer::scan_escaped_word (string str) { // use more SCM for this. @@ -724,7 +724,7 @@ Lily_lexer::scan_escaped_word (std::string str) return identifier_type (sid); } - std::string msg (_f ("unknown escaped string: `\\%s'", str)); + string msg (_f ("unknown escaped string: `\\%s'", str)); LexerError (msg.c_str ()); yylval.scm = scm_makfrom0str (str.c_str ()); @@ -733,7 +733,7 @@ Lily_lexer::scan_escaped_word (std::string str) } int -Lily_lexer::scan_bare_word (std::string str) +Lily_lexer::scan_bare_word (string str) { SCM sym = ly_symbol2scm (str.c_str ()); if ((YYSTATE == notes) || (YYSTATE == chords)) { @@ -784,11 +784,11 @@ Lily_lexer::is_figure_state () const } /* - urg, belong to std::string (_convert) + urg, belong to string (_convert) and should be generalised */ void -strip_leading_white (std::string&s) +strip_leading_white (string&s) { ssize i = 0; for (; i < s.length (); i++) @@ -799,7 +799,7 @@ strip_leading_white (std::string&s) } void -strip_trailing_white (std::string&s) +strip_trailing_white (string&s) { ssize i = s.length (); while (i--) @@ -816,7 +816,7 @@ Lilypond_version oldest_version ("2.3.22"); bool -is_valid_version (std::string s) +is_valid_version (string s) { Lilypond_version current ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL ); Lilypond_version ver (s); @@ -833,8 +833,8 @@ is_valid_version (std::string s) /* substitute _ and \, */ -std::string -lyric_fudge (std::string s) +string +lyric_fudge (string s) { char *chars = string_copy (s); @@ -844,7 +844,7 @@ lyric_fudge (std::string s) *p = ' '; } - s = std::string (chars); + s = string (chars); delete[] chars; ssize i = 0; @@ -861,11 +861,11 @@ lyric_fudge (std::string s) Convert "NUM/DEN" into a '(NUM . DEN) cons. */ SCM -scan_fraction (std::string frac) +scan_fraction (string frac) { ssize i = frac.find ('/'); - std::string left = frac.substr (0, i); - std::string right = frac.substr (i + 1, (frac.length () - i + 1)); + string left = frac.substr (0, i); + string right = frac.substr (i + 1, (frac.length () - i + 1)); int n = String_convert::dec2int (left); int d = String_convert::dec2int (right); @@ -873,7 +873,7 @@ scan_fraction (std::string frac) } SCM -lookup_markup_command (std::string s) +lookup_markup_command (string s) { SCM proc = ly_lily_module_constant ("lookup-markup-command"); return scm_call_1 (proc, scm_makfrom0str (s.c_str ())); diff --git a/lily/ligature-bracket-engraver.cc b/lily/ligature-bracket-engraver.cc index 3382193a67..4e73a7df2f 100644 --- a/lily/ligature-bracket-engraver.cc +++ b/lily/ligature-bracket-engraver.cc @@ -22,7 +22,7 @@ class Ligature_bracket_engraver : public Ligature_engraver protected: virtual Spanner *create_ligature_spanner (); virtual void typeset_ligature (Spanner *ligature, - std::vector primitives); + vector primitives); DECLARE_ACKNOWLEDGER (rest); DECLARE_ACKNOWLEDGER (note_column); public: @@ -40,7 +40,7 @@ Ligature_bracket_engraver::create_ligature_spanner () } void -Ligature_bracket_engraver::typeset_ligature (Spanner *, std::vector) +Ligature_bracket_engraver::typeset_ligature (Spanner *, vector) { // no real ligature to typeset; the LigatureBracket just does it } diff --git a/lily/ligature-engraver.cc b/lily/ligature-engraver.cc index e120095cb0..0cb04c2c36 100644 --- a/lily/ligature-engraver.cc +++ b/lily/ligature-engraver.cc @@ -27,7 +27,7 @@ * * A concrete ligature engraver must subclass this class and provide * functions create_ligature_spanner () and typeset_ligature - * (Spanner *, std::vector). Subclasses of this class basically + * (Spanner *, vector). Subclasses of this class basically * fall into two categories. * * The first category consists of engravers that engrave ligatures in diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index ead2e3a835..935846a8ec 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -75,7 +75,7 @@ ly_quote_scm (SCM s) return scm_list_n (ly_symbol2scm ("quote"), s, SCM_UNDEFINED); } -std::string +string ly_symbol2string (SCM s) { /* @@ -85,15 +85,15 @@ ly_symbol2string (SCM s) return ly_scm2string (str); } -std::string -gulp_file_to_string (std::string fn, bool must_exist, int size) +string +gulp_file_to_string (string fn, bool must_exist, int size) { - std::string s = global_path.find (fn); + string s = global_path.find (fn); if (s == "") { if (must_exist) { - std::string e = _f ("can't find file: `%s'", fn); + string e = _f ("can't find file: `%s'", fn); e += " "; e += _f ("(load path: `%s')", global_path.to_string ()); error (e); @@ -107,7 +107,7 @@ gulp_file_to_string (std::string fn, bool must_exist, int size) int n = size; char *str = gulp_file (s, &n); - std::string result (str, n); + string result (str, n); delete[] str; if (be_verbose_global) @@ -126,11 +126,11 @@ extern "C" { } }; -std::string +string ly_scm2string (SCM str) { assert (scm_is_string (str)); - return std::string (scm_i_string_chars (str), + return string (scm_i_string_chars (str), (int) scm_i_string_length (str)); } @@ -179,12 +179,12 @@ is_number_pair (SCM p) } typedef void (*Void_fptr) (); -std::vector *scm_init_funcs_; +vector *scm_init_funcs_; void add_scm_init_func (void (*f) ()) { if (!scm_init_funcs_) - scm_init_funcs_ = new std::vector; + scm_init_funcs_ = new vector; scm_init_funcs_->push_back (f); } @@ -356,7 +356,7 @@ ly_assoc_cdr (SCM key, SCM alist) } SCM -ly_string_array_to_scm (std::vector a) +ly_string_array_to_scm (vector a) { SCM s = SCM_EOL; for (vsize i = a.size (); i ; i--) @@ -370,7 +370,7 @@ parse_symbol_list (char const *symbols) { while (isspace (*symbols)) *symbols++; - std::string s = symbols; + string s = symbols; replace_all (s, '\n', ' '); replace_all (s, '\t', ' '); return ly_string_array_to_scm (String_convert::split (s, ' ')); @@ -394,10 +394,10 @@ ly_truncate_list (int k, SCM lst) return lst; } -std::string +string print_scm_val (SCM val) { - std::string realval = ly_scm2string (ly_write2scm (val)); + string realval = ly_scm2string (ly_write2scm (val)); if (realval.length () > 200) realval = realval.substr (0, 100) + "\n :\n :\n" @@ -722,8 +722,8 @@ procedure_arity (SCM proc) return scm_to_int (fixed); } -std::string -mangle_cxx_identifier (std::string cxx_id) +string +mangle_cxx_identifier (string cxx_id) { if (cxx_id.substr (0, 3) == "ly_") cxx_id = cxx_id.replace (0, 3, "ly:"); diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index c4f2731cac..e677b9e5c5 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -170,7 +170,7 @@ Lily_lexer::set_current_scope () } int -Lily_lexer::lookup_keyword (std::string s) +Lily_lexer::lookup_keyword (string s) { return keytable_->lookup (s.c_str ()); } @@ -189,7 +189,7 @@ Lily_lexer::lookup_identifier_symbol (SCM sym) } SCM -Lily_lexer::lookup_identifier (std::string name) +Lily_lexer::lookup_identifier (string name) { return lookup_identifier_symbol (ly_symbol2scm (name.c_str ())); } @@ -219,7 +219,7 @@ Lily_lexer::set_identifier (SCM name, SCM s) { if (lookup_keyword (ly_symbol2string (sym)) >= 0) { - std::string symstr = ly_symbol2string (sym); + string symstr = ly_symbol2string (sym); warning (_f ("identifier name is a keyword: `%s'", symstr.c_str ())); } diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index 212ca92e68..7603487665 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -39,7 +39,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", char const *file = scm_i_string_chars (name); char const *extensions[] = {"ly", "", 0}; - std::string file_name = global_path.find (file, extensions); + string file_name = global_path.find (file, extensions); /* By default, use base name of input file for output file name, write output to cwd; do not use root and directory parts of input @@ -83,13 +83,13 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", out_file_name = File_name (output_name_global); } - std::string init; + string init; if (!init_name_global.empty ()) init = init_name_global; else init = "init.ly"; - std::string out_file = out_file_name.to_string (); + string out_file = out_file_name.to_string (); if (init.length () && global_path.find (init).empty ()) { @@ -110,7 +110,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", Sources sources; sources.set_path (&global_path); - std::string mapped_fn = map_file_name (file_name); + string mapped_fn = map_file_name (file_name); message (_f ("Processing `%s'", mapped_fn.c_str ())); progress_indication ("\n"); diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 256402a841..65160851e1 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -82,7 +82,7 @@ Lily_parser::print_smob (SCM s, SCM port, scm_print_state*) /* Process one .ly file, or book. */ void -Lily_parser::parse_file (std::string init, std::string name, std::string out_name) +Lily_parser::parse_file (string init, string name, string out_name) { if (output_backend_global == "tex") try_load_text_metrics (out_name); @@ -102,7 +102,7 @@ Lily_parser::parse_file (std::string init, std::string name, std::string out_nam lexer_->new_input (init, sources_); File_name f (name); - std::string s = global_path.find (f.base_ + ".twy"); + string s = global_path.find (f.base_ + ".twy"); s = gulp_file_to_string (s, false, -1); scm_eval_string (scm_makfrom0str (s.c_str ())); @@ -132,7 +132,7 @@ Lily_parser::parse_file (std::string init, std::string name, std::string out_nam } void -Lily_parser::parse_string (std::string ly_code) +Lily_parser::parse_string (string ly_code) { // TODO: use $parser lexer_->set_identifier (ly_symbol2scm ("parser"), @@ -165,14 +165,14 @@ Lily_parser::here_str0 () const } void -Lily_parser::parser_error (std::string s) +Lily_parser::parser_error (string s) { lexer_->here_input ().error (_ (s.c_str ())); error_level_ = 1; } void -Lily_parser::parser_error (Input const &i, std::string s) +Lily_parser::parser_error (Input const &i, string s) { i.error (s); error_level_ = 1; diff --git a/lily/lily-version.cc b/lily/lily-version.cc index 28f2fbaa1a..c15c76e628 100644 --- a/lily/lily-version.cc +++ b/lily/lily-version.cc @@ -11,27 +11,27 @@ #include "config.hh" #include "version.hh" -std::string +string version_string () { - std::string str = MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL; - std::string mpl ("." MY_PATCH_LEVEL); + string str = MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL; + string mpl ("." MY_PATCH_LEVEL); if (mpl != ".") str += mpl; return str; } -std::string +string gnu_lilypond_string () { - std::string str = "GNU LilyPond"; + string str = "GNU LilyPond"; return str; } -std::string +string gnu_lilypond_version_string () { - std::string str = gnu_lilypond_string () + " " + version_string (); + string str = gnu_lilypond_string () + " " + version_string (); return str; } diff --git a/lily/lilypond-key.cc b/lily/lilypond-key.cc index f43d247a00..99b190bcc4 100644 --- a/lily/lilypond-key.cc +++ b/lily/lilypond-key.cc @@ -10,7 +10,7 @@ Lilypond_grob_key::Lilypond_grob_key (Object_key const *context, Moment start, - std::string name, + string name, int disambiguation_count) { context_ = context; @@ -87,8 +87,8 @@ Lilypond_context_key::derived_mark () const Lilypond_context_key::Lilypond_context_key (Object_key const *parent, Moment start, - std::string type, - std::string id, + string type, + string id, int count) { disambiguation_count_ = count; @@ -177,7 +177,7 @@ Lilypond_general_key::derived_mark () const } Lilypond_general_key::Lilypond_general_key (Object_key const *parent, - std::string name, + string name, int count) { parent_ = parent; diff --git a/lily/lilypond-version.cc b/lily/lilypond-version.cc index e12dbcbea8..252366251d 100644 --- a/lily/lilypond-version.cc +++ b/lily/lilypond-version.cc @@ -19,13 +19,13 @@ Lilypond_version::Lilypond_version (int major, int minor, int patch) patch_ = patch; } -Lilypond_version::Lilypond_version (std::string str) +Lilypond_version::Lilypond_version (string str) { major_ = 0; minor_ = 0; patch_ = 0; - std::vector version; + vector version; version = String_convert::split (str, '.'); if (version.size () > 0 && isdigit (version[0][0])) @@ -42,10 +42,12 @@ Lilypond_version::Lilypond_version (std::string str) extra_patch_string_ = version[3]; } -std::string +string Lilypond_version::to_string () const { - return std::to_string (major_) + "." + std::to_string (minor_) + "." + std::to_string (patch_); + return ::to_string (major_) + + "." + ::to_string (minor_) + + "." + ::to_string (patch_); } Lilypond_version::operator int () const diff --git a/lily/line-interface.cc b/lily/line-interface.cc index a9ef0fe67a..6401b3896a 100644 --- a/lily/line-interface.cc +++ b/lily/line-interface.cc @@ -18,7 +18,7 @@ Line_interface::make_arrow (Offset begin, Offset end, Real length, Real width) { Real angle = (end - begin).arg (); - std::vector points; + vector points; points.push_back (Offset (0, 0)); points.push_back (Offset (-length, width)); diff --git a/lily/lookup.cc b/lily/lookup.cc index e5fda58595..fb64bc1604 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -227,7 +227,7 @@ Lookup::round_filled_box (Box b, Real blotdiameter) * shrinked polygon). --jr */ Stencil -Lookup::round_filled_polygon (std::vector const &points, +Lookup::round_filled_polygon (vector const &points, Real blotdiameter) { /* TODO: Maybe print a warning if one of the above limitations @@ -256,7 +256,7 @@ Lookup::round_filled_polygon (std::vector const &points, return Line_interface::make_line (blotdiameter, points[0], points[1]); /* shrink polygon in size by 0.5 * blotdiameter */ - std::vector shrunk_points; + vector shrunk_points; shrunk_points.resize (points.size ()); bool ccw = 1; // true, if three adjacent points are counterclockwise ordered for (vsize i = 0; i < points.size (); i++) @@ -451,8 +451,8 @@ Stencil Lookup::accordion (SCM s, Real staff_space, Font_metric *fm) { Stencil m; - std::string sym = ly_scm2string (scm_car (s)); - std::string reg = ly_scm2string (scm_car (scm_cdr (s))); + string sym = ly_scm2string (scm_car (s)); + string reg = ly_scm2string (scm_car (scm_cdr (s))); if (sym == "Discant") { @@ -649,7 +649,7 @@ Stencil Lookup::repeat_slash (Real w, Real s, Real t) { #if 0 /* TODO */ - std::vector points; + vector points; Real blotdiameter = 0.0; Offset p1 (0, 0); diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index 4048ed2f26..176c9b7166 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -83,7 +83,7 @@ get_voice_to_lyrics (Context *lyrics) return c; SCM voice_name = lyrics->get_property ("associatedVoice"); - std::string nm = lyrics->id_string (); + string nm = lyrics->id_string (); if (scm_is_string (voice_name)) nm = ly_scm2string (voice_name); diff --git a/lily/lyric-performer.cc b/lily/lyric-performer.cc index 35a17bc3e7..935f06c35e 100644 --- a/lily/lyric-performer.cc +++ b/lily/lyric-performer.cc @@ -21,7 +21,7 @@ protected: void process_music (); private: - Link_array__Music_ events_; + vector events_; Audio_text *audio_; }; diff --git a/lily/main.cc b/lily/main.cc index 71e6eb22c1..7e9927e34d 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -49,22 +49,22 @@ using namespace std; */ /* Names of header fields to be dumped to a separate file. */ -std::vector dump_header_fieldnames_global; +vector dump_header_fieldnames_global; /* Name of initialisation file. */ -std::string init_name_global; +string init_name_global; /* Selected output backend One of (gnome, ps [default], eps, scm, svg, tex, texstr)") */ -std::string output_backend_global = "ps"; +string output_backend_global = "ps"; /* Output formats to generate. */ -std::string output_format_global = ""; +string output_format_global = ""; bool is_pango_format_global; bool is_TeX_format_global; /* Current output name. */ -std::string output_name_global; +string output_name_global; /* Run in safe mode? */ bool be_safe_global = false; @@ -77,8 +77,8 @@ bool be_verbose_global = false; /* Scheme code to execute before parsing, after .scm init. This is where -e arguments are appended to. */ -std::string init_scheme_code_string; -std::string init_scheme_variables; +string init_scheme_code_string; +string init_scheme_variables; /* Generate preview of first system. */ bool make_preview = false; @@ -136,10 +136,10 @@ static char const *WARRANTY /* Where the init files live. Typically: LILYPOND_DATADIR = /usr/share/lilypond */ -std::string prefix_directory; +string prefix_directory; /* The jail specification: USER,GROUP,JAIL,DIR. */ -std::string jail_spec; +string jail_spec; /* The option parser */ static Getopt_long *option_parser = 0; @@ -276,9 +276,9 @@ warranty () } static void -prepend_load_path (std::string dir) +prepend_load_path (string dir) { - std::string s = "(set! %load-path (cons \"" + dir + "\" %load-path))"; + string s = "(set! %load-path (cons \"" + dir + "\" %load-path))"; scm_c_eval_string (s.c_str ()); } @@ -300,7 +300,7 @@ do_chroot_jail () USER_NAME, GROUP_NAME, JAIL, DIR, JAIL_MAX }; - std::vector components = String_convert::split (jail_spec, ','); + vector components = String_convert::split (jail_spec, ','); if (components.size () != JAIL_MAX) { error (_f ("expected %d arguments with jail, found: %d", JAIL_MAX, @@ -451,7 +451,7 @@ setup_localisation () Disable localisation of float values. This breaks TeX output. */ setlocale (LC_NUMERIC, "C"); - std::string localedir = LOCALEDIR; + string localedir = LOCALEDIR; if (char const *env = getenv ("LILYPOND_LOCALEDIR")) localedir = env; @@ -461,7 +461,7 @@ setup_localisation () } static void -add_output_format (std::string format) +add_output_format (string format) { if (output_format_global != "") output_format_global += ","; @@ -478,27 +478,27 @@ parse_argv (int argc, char **argv) switch (opt->shortname_char_) { case 0: - if (std::string (opt->longname_str0_) == "dvi" - || std::string (opt->longname_str0_) == "pdf" - || std::string (opt->longname_str0_) == "png" - || std::string (opt->longname_str0_) == "ps" - || std::string (opt->longname_str0_) == "tex") + if (string (opt->longname_str0_) == "dvi" + || string (opt->longname_str0_) == "pdf" + || string (opt->longname_str0_) == "png" + || string (opt->longname_str0_) == "ps" + || string (opt->longname_str0_) == "tex") add_output_format (opt->longname_str0_); - else if (std::string (opt->longname_str0_) == "preview") + else if (string (opt->longname_str0_) == "preview") make_preview = true; - else if (std::string (opt->longname_str0_) == "no-pages") + else if (string (opt->longname_str0_) == "no-pages") make_print = false; - else if (std::string (opt->longname_str0_) == "relocate") + else if (string (opt->longname_str0_) == "relocate") relocate_binary = true; break; case 'd': { - std::string arg (option_parser->optional_argument_str0_); + string arg (option_parser->optional_argument_str0_); ssize eq = arg.find ('='); - std::string key = arg; - std::string val = "#t"; + string key = arg; + string val = "#t"; if (eq != NPOS) { @@ -517,7 +517,7 @@ parse_argv (int argc, char **argv) break; case 'o': { - std::string s = option_parser->optional_argument_str0_; + string s = option_parser->optional_argument_str0_; File_name file_name (s); output_name_global = file_name.to_string (); } diff --git a/lily/melody-spanner.cc b/lily/melody-spanner.cc index 053c7c34cc..d0544ab2d2 100644 --- a/lily/melody-spanner.cc +++ b/lily/melody-spanner.cc @@ -31,7 +31,7 @@ Melody_spanner::calc_neutral_stem_direction (SCM smob) extract_grob_set (me, "stems", stems); - std::vector dirs; + vector dirs; for (vsize i = 0; i < stems.size (); i++) dirs.push_back (to_dir (stems[i]->get_property ("default-direction"))); diff --git a/lily/mensural-ligature-engraver.cc b/lily/mensural-ligature-engraver.cc index f6fafa1227..5adc44122c 100644 --- a/lily/mensural-ligature-engraver.cc +++ b/lily/mensural-ligature-engraver.cc @@ -46,15 +46,15 @@ class Mensural_ligature_engraver : public Coherent_ligature_engraver protected: virtual Spanner *create_ligature_spanner (); - virtual void build_ligature (Spanner *ligature, std::vector primitives); + virtual void build_ligature (Spanner *ligature, vector primitives); public: TRANSLATOR_DECLARATIONS (Mensural_ligature_engraver); private: - void transform_heads (std::vector primitives); - void propagate_properties (Spanner *ligature, std::vector primitives); - void fold_up_primitives (std::vector primitives); + void transform_heads (vector primitives); + void propagate_properties (Spanner *ligature, vector primitives); + void fold_up_primitives (vector primitives); }; Mensural_ligature_engraver::Mensural_ligature_engraver () @@ -70,7 +70,7 @@ Mensural_ligature_engraver::create_ligature_spanner () } void -Mensural_ligature_engraver::transform_heads (std::vector primitives) +Mensural_ligature_engraver::transform_heads (vector primitives) { if (primitives.size () < 2) { @@ -296,7 +296,7 @@ Mensural_ligature_engraver::transform_heads (std::vector primitives) */ void Mensural_ligature_engraver::propagate_properties (Spanner *ligature, - std::vector primitives) + vector primitives) { Real thickness = robust_scm2double (ligature->get_property ("thickness"), 1.4); @@ -352,7 +352,7 @@ Mensural_ligature_engraver::propagate_properties (Spanner *ligature, } void -Mensural_ligature_engraver::fold_up_primitives (std::vector primitives) +Mensural_ligature_engraver::fold_up_primitives (vector primitives) { Item *first = 0; Real distance = 0; @@ -375,7 +375,7 @@ Mensural_ligature_engraver::fold_up_primitives (std::vector primitive void Mensural_ligature_engraver::build_ligature (Spanner *ligature, - std::vector primitives) + vector primitives) { transform_heads (primitives); propagate_properties (ligature, primitives); diff --git a/lily/midi-item.cc b/lily/midi-item.cc index 23ab0b614f..46906cd7e9 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -52,25 +52,25 @@ Midi_item::get_midi (Audio_item *a) } void -Midi_chunk::set (std::string header_string, std::string data_string, std::string footer_string) +Midi_chunk::set (string header_string, string data_string, string footer_string) { data_string_ = data_string; footer_string_ = footer_string; header_string_ = header_string; } -std::string +string Midi_chunk::data_string () const { return data_string_; } -std::string +string Midi_chunk::to_string () const { - std::string str = header_string_; - std::string dat = data_string (); - std::string length_string = String_convert::int2hex (dat.length () + string str = header_string_; + string dat = data_string (); + string length_string = String_convert::int2hex (dat.length () + footer_string_.length (), 8, '0'); length_string = String_convert::hex2bin (length_string); @@ -86,10 +86,10 @@ Midi_duration::Midi_duration (Real seconds_f) seconds_ = seconds_f; } -std::string +string Midi_duration::to_string () const { - return std::string (""; + return string (""; } Midi_event::Midi_event (Moment delta_mom, Midi_item *midi) @@ -101,30 +101,30 @@ Midi_event::Midi_event (Moment delta_mom, Midi_item *midi) /* ugh. midi output badly broken since grace note hackage. */ -std::string +string Midi_event::to_string () const { Rational rat_dt = (delta_mom_.main_part_ * Rational (384) + delta_mom_.grace_part_ * Rational (100)) * Rational (4); int delta_i = rat_dt.to_int (); - std::string delta_string = Midi_item::i2varint_string (delta_i); - std::string midi_string = midi_->to_string (); + string delta_string = Midi_item::i2varint_string (delta_i); + string midi_string = midi_->to_string (); assert (midi_string.length ()); return delta_string + midi_string; } Midi_header::Midi_header (int format_i, int tracks_i, int clocks_per_4_i) { - std::string str; + string str; - std::string format_string = String_convert::int2hex (format_i, 4, '0'); + string format_string = String_convert::int2hex (format_i, 4, '0'); str += String_convert::hex2bin (format_string); - std::string tracks_string = String_convert::int2hex (tracks_i, 4, '0'); + string tracks_string = String_convert::int2hex (tracks_i, 4, '0'); str += String_convert::hex2bin (tracks_string); - std::string tempo_string = String_convert::int2hex (clocks_per_4_i, 4, '0'); + string tempo_string = String_convert::int2hex (clocks_per_4_i, 4, '0'); str += String_convert::hex2bin (tempo_string); set ("MThd", str, ""); @@ -136,7 +136,7 @@ Midi_instrument::Midi_instrument (Audio_instrument *a) audio_->str_ = String_convert::to_lower (audio_->str_); } -std::string +string Midi_instrument::to_string () const { Byte program_byte = 0; @@ -153,8 +153,8 @@ Midi_instrument::to_string () const else warning (_f ("no such MIDI instrument: `%s'", audio_->str_.c_str ())); - std::string str = std::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME : Should be track. -rz - str += std::to_string ((char)program_byte); + string str = ::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME : Should be track. -rz + str += ::to_string ((char)program_byte); return str; } @@ -167,7 +167,7 @@ Midi_item::~Midi_item () { } -std::string +string Midi_item::i2varint_string (int i) { int buffer_i = i & 0x7f; @@ -178,10 +178,10 @@ Midi_item::i2varint_string (int i) buffer_i += (i & 0x7f); } - std::string str; + string str; while (1) { - str += std::to_string ((char)buffer_i); + str += ::to_string ((char)buffer_i); if (buffer_i & 0x80) buffer_i >>= 8; else @@ -195,10 +195,10 @@ Midi_key::Midi_key (Audio_key *a) audio_ = a; } -std::string +string Midi_key::to_string () const { - std::string str = "ff5902"; + string str = "ff5902"; str += String_convert::int2hex (audio_->accidentals_, 2, '0'); if (audio_->major_) str += String_convert::int2hex (0, 2, '0'); @@ -213,7 +213,7 @@ Midi_time_signature::Midi_time_signature (Audio_time_signature *a) clocks_per_1_ = 18; } -std::string +string Midi_time_signature::to_string () const { int num = abs (audio_->beats_); @@ -227,7 +227,7 @@ Midi_time_signature::to_string () const - std::string str = "ff5804"; + string str = "ff5804"; str += String_convert::int2hex (num, 2, '0'); str += String_convert::int2hex (intlog2 (den), 2, '0'); str += String_convert::int2hex (clocks_per_1_, 2, '0'); @@ -269,11 +269,11 @@ Midi_note::get_pitch () const return p; } -std::string +string Midi_note::to_string () const { Byte status_byte = (char) (0x90 + channel_); - std::string str = ""; + string str = ""; int finetune; // print warning if fine tuning was needed, HJJ @@ -287,15 +287,15 @@ Midi_note::to_string () const // The pitch wheel range (of 4 semitones) is multiplied by the cents. finetune += (PITCH_WHEEL_RANGE *get_fine_tuning ()) / (4 * 100); - str += std::to_string ((char) (0xE0 + channel_)); - str += std::to_string ((char) (finetune & 0x7F)); - str += std::to_string ((char) (finetune >> 7)); - str += std::to_string ((char) (0x00)); + str += ::to_string ((char) (0xE0 + channel_)); + str += ::to_string ((char) (finetune & 0x7F)); + str += ::to_string ((char) (finetune >> 7)); + str += ::to_string ((char) (0x00)); } - str += std::to_string ((char)status_byte); - str += std::to_string ((char) (get_pitch () + c0_pitch_i_)); - str += std::to_string ((char)dynamic_byte_); + str += ::to_string ((char)status_byte); + str += ::to_string ((char) (get_pitch () + c0_pitch_i_)); + str += ::to_string ((char)dynamic_byte_); return str; } @@ -313,22 +313,22 @@ Midi_note_off::Midi_note_off (Midi_note *n) aftertouch_byte_ = 64; } -std::string +string Midi_note_off::to_string () const { Byte status_byte = (char) (0x80 + channel_); - std::string str = std::to_string ((char)status_byte); - str += std::to_string ((char) (get_pitch () + Midi_note::c0_pitch_i_)); - str += std::to_string ((char)aftertouch_byte_); + string str = ::to_string ((char)status_byte); + str += ::to_string ((char) (get_pitch () + Midi_note::c0_pitch_i_)); + str += ::to_string ((char)aftertouch_byte_); if (get_fine_tuning () != 0) { // Move pitch wheel back to the central position. - str += std::to_string ((char) 0x00); - str += std::to_string ((char) (0xE0 + channel_)); - str += std::to_string ((char) (PITCH_WHEEL_CENTER &0x7F)); - str += std::to_string ((char) (PITCH_WHEEL_CENTER >> 7)); + str += ::to_string ((char) 0x00); + str += ::to_string ((char) (0xE0 + channel_)); + str += ::to_string ((char) (PITCH_WHEEL_CENTER &0x7F)); + str += ::to_string ((char) (PITCH_WHEEL_CENTER >> 7)); } return str; @@ -339,11 +339,11 @@ Midi_dynamic::Midi_dynamic (Audio_dynamic *a) audio_ = a; } -std::string +string Midi_dynamic::to_string () const { Byte status_byte = (char) (0xB0 + channel_); - std::string str = std::to_string ((char)status_byte); + string str = ::to_string ((char)status_byte); /* Main volume controller (per channel): @@ -358,8 +358,8 @@ Midi_dynamic::to_string () const if (volume > full_scale) volume = (int)full_scale; - str += std::to_string ((char)0x07); - str += std::to_string ((char)volume); + str += ::to_string ((char)0x07); + str += ::to_string ((char)volume); return str; } @@ -368,21 +368,21 @@ Midi_piano_pedal::Midi_piano_pedal (Audio_piano_pedal *a) audio_ = a; } -std::string +string Midi_piano_pedal::to_string () const { Byte status_byte = (char) (0xB0 + channel_); - std::string str = std::to_string ((char)status_byte); + string str = ::to_string ((char)status_byte); if (audio_->type_string_ == "Sostenuto") - str += std::to_string ((char)0x42); + str += ::to_string ((char)0x42); else if (audio_->type_string_ == "Sustain") - str += std::to_string ((char)0x40); + str += ::to_string ((char)0x40); else if (audio_->type_string_ == "UnaCorda") - str += std::to_string ((char)0x43); + str += ::to_string ((char)0x43); int pedal = ((1 - audio_->dir_) / 2) * 0x7f; - str += std::to_string ((char)pedal); + str += ::to_string ((char)pedal); return str; } @@ -391,11 +391,11 @@ Midi_tempo::Midi_tempo (Audio_tempo *a) audio_ = a; } -std::string +string Midi_tempo::to_string () const { int useconds_per_4_i = 60 * (int)1e6 / audio_->per_minute_4_; - std::string str = "ff5103"; + string str = "ff5103"; str += String_convert::int2hex (useconds_per_4_i, 6, '0'); return String_convert::hex2bin (str); } @@ -405,10 +405,10 @@ Midi_text::Midi_text (Audio_text *a) audio_ = a; } -std::string +string Midi_text::to_string () const { - std::string str = "ff" + String_convert::int2hex (audio_->type_, 2, '0'); + string str = "ff" + String_convert::int2hex (audio_->type_, 2, '0'); str = String_convert::hex2bin (str); str += i2varint_string (audio_->text_string_.length ()); str += audio_->text_string_; @@ -444,12 +444,12 @@ Midi_track::Midi_track () // "00" "ff59" "02" "ff" "00" ; - std::string data_string; + string data_string; // only for format 0 (currently using format 1)? data_string += String_convert::hex2bin (data_str0); char const *footer_str0 = "00" "ff2f" "00"; - std::string footer_string = String_convert::hex2bin (footer_str0); + string footer_string = String_convert::hex2bin (footer_str0); set ("MTrk", data_string, footer_string); } @@ -463,10 +463,10 @@ Midi_track::add (Moment delta_time_mom, Midi_item *midi) event_p_list_.append (new Killing_cons (e, 0)); } -std::string +string Midi_track::data_string () const { - std::string str = Midi_chunk::data_string (); + string str = Midi_chunk::data_string (); if (do_midi_debugging_global) str += "\n"; for (Cons *i = event_p_list_.head_; i; i = i->next_) diff --git a/lily/midi-stream.cc b/lily/midi-stream.cc index b03d63b721..d5b62fee59 100644 --- a/lily/midi-stream.cc +++ b/lily/midi-stream.cc @@ -20,7 +20,7 @@ using namespace std; #include "string-convert.hh" #include "warn.hh" -Midi_stream::Midi_stream (std::string file_name) +Midi_stream::Midi_stream (string file_name) { file_name_string_ = file_name; out_file_ = fopen (file_name.c_str (), "wb"); @@ -34,7 +34,7 @@ Midi_stream::~Midi_stream () } Midi_stream & -Midi_stream::operator << (std::string str) +Midi_stream::operator << (string str) { size_t sz = sizeof (Byte); size_t n = str.length (); @@ -49,7 +49,7 @@ Midi_stream::operator << (std::string str) Midi_stream & Midi_stream::operator << (Midi_item const &midi_c_r) { - std::string str = midi_c_r.to_string (); + string str = midi_c_r.to_string (); // ugh, should have separate debugging output with Midi*::print routines if (do_midi_debugging_global) diff --git a/lily/misc.cc b/lily/misc.cc index 9eef5ecf3a..f8eda18b87 100644 --- a/lily/misc.cc +++ b/lily/misc.cc @@ -35,10 +35,10 @@ log_2 (double x) return log (x) / log (2.0); } -std::vector -split_string (std::string s, char c) +vector +split_string (string s, char c) { - std::vector rv; + vector rv; while (s.length ()) { ssize i = s.find (c); diff --git a/lily/modified-font-metric.cc b/lily/modified-font-metric.cc index 6d50d06d51..8e215863a6 100644 --- a/lily/modified-font-metric.cc +++ b/lily/modified-font-metric.cc @@ -66,7 +66,7 @@ Modified_font_metric::count () const } Offset -Modified_font_metric::attachment_point (std::string s) const +Modified_font_metric::attachment_point (string s) const { Offset o = orig_->attachment_point (s); return o * magnification_; @@ -80,7 +80,7 @@ Modified_font_metric::get_indexed_wxwy (vsize k) const } vsize -Modified_font_metric::name_to_index (std::string s) const +Modified_font_metric::name_to_index (string s) const { return orig_->name_to_index (s); } @@ -104,7 +104,7 @@ Modified_font_metric::derived_mark () const /* TODO: put this klutchness behind ly:option switch. */ Box -Modified_font_metric::tex_kludge (std::string text) const +Modified_font_metric::tex_kludge (string text) const { Interval ydims; Real w = 0; @@ -159,7 +159,7 @@ Modified_font_metric::tex_kludge (std::string text) const } Stencil -Modified_font_metric::text_stencil (std::string text) const +Modified_font_metric::text_stencil (string text) const { Box b; if (Pango_font *pf = dynamic_cast (orig_)) @@ -177,7 +177,7 @@ Modified_font_metric::text_stencil (std::string text) const } Box -Modified_font_metric::text_dimension (std::string text) const +Modified_font_metric::text_dimension (string text) const { SCM stext = scm_makfrom0str (text.c_str ()); Box b = lookup_tex_text_dimension (orig_, stext); @@ -223,7 +223,7 @@ Modified_font_metric::sub_fonts () const return orig_->sub_fonts (); } -std::string +string Modified_font_metric::font_name () const { return original_font ()->font_name (); diff --git a/lily/moment.cc b/lily/moment.cc index 1bab8f8fc5..1f32fb80eb 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -49,7 +49,7 @@ Moment::print_smob (SCM s, SCM port, scm_print_state *) Moment *r = (Moment *) SCM_CELL_WORD_1 (s); scm_puts ("#to_string (); + string str = r->to_string (); scm_puts ((char *)str.c_str (), port); scm_puts (">", port); @@ -153,10 +153,10 @@ Moment::set_infinite (int k) main_part_.set_infinite (k); } -std::string +string Moment::to_string () const { - std::string s = main_part_.to_string (); + string s = main_part_.to_string (); if (grace_part_) s += "G" + grace_part_.to_string (); return s; diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index 574ace67cb..3c7eed7524 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -29,7 +29,7 @@ protected: private: Music *rest_ev_; - Link_array__Music_ text_events_; + vector text_events_; int start_measure_; Rational last_main_moment_; Moment stop_moment_; @@ -39,8 +39,8 @@ private: Spanner *last_rest_; Spanner *mmrest_; - Link_array__Spanner_ numbers_; - Link_array__Spanner_ last_numbers_; + vector numbers_; + vector last_numbers_; }; Multi_measure_rest_engraver::Multi_measure_rest_engraver () diff --git a/lily/music-function.cc b/lily/music-function.cc index 984edc9c0f..8f0f7813d9 100644 --- a/lily/music-function.cc +++ b/lily/music-function.cc @@ -35,7 +35,7 @@ LY_DEFINE (ly_make_music_function, "ly:make-music-function", 2, 0, 0, { extern SCM ly_music_p_proc; - std::string str = ""; + string str = ""; for (SCM s = signature; scm_is_pair (s); s = scm_cdr (s)) { if (str != "") diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc index 496e19f93d..cb2a1bd202 100644 --- a/lily/new-fingering-engraver.cc +++ b/lily/new-fingering-engraver.cc @@ -43,11 +43,11 @@ struct Finger_tuple class New_fingering_engraver : public Engraver { - std::vector fingerings_; - std::vector articulations_; - std::vector string_numbers_; + vector fingerings_; + vector articulations_; + vector string_numbers_; - Link_array__Grob_ heads_; + vector heads_; Grob *stem_; public: @@ -59,7 +59,7 @@ protected: void add_fingering (Grob *, Music *, Music *); void add_script (Grob *, Music *, Music *); void add_string (Grob *, Music *, Music *); - void position_scripts (SCM orientations, std::vector *); + void position_scripts (SCM orientations, vector *); }; void @@ -187,7 +187,7 @@ New_fingering_engraver::add_string (Grob *head, void New_fingering_engraver::position_scripts (SCM orientations, - std::vector *scripts) + vector *scripts) { for (vsize i = 0; i < scripts->size (); i++) if (stem_ && to_boolean (scripts->at (i).script_->get_property ("add-stem-support"))) @@ -209,7 +209,7 @@ New_fingering_engraver::position_scripts (SCM orientations, for (vsize j = heads_.size (); j--;) Side_position_interface::add_support ((*scripts)[i].script_, heads_[j]); - std::vector up, down, horiz; + vector up, down, horiz; for (vsize i = scripts->size (); i--;) { SCM d = (*scripts)[i].finger_event_->get_property ("direction"); @@ -282,7 +282,7 @@ New_fingering_engraver::position_scripts (SCM orientations, int finger_prio = 200; Direction d = DOWN; - Drul_array< std::vector > vertical (down, up); + Drul_array< vector > vertical (down, up); do { for (vsize i = 0; i < vertical[d].size (); i++) diff --git a/lily/new-lyric-combine-music-iterator.cc b/lily/new-lyric-combine-music-iterator.cc index 0adccba96d..6e75f43d51 100644 --- a/lily/new-lyric-combine-music-iterator.cc +++ b/lily/new-lyric-combine-music-iterator.cc @@ -183,7 +183,7 @@ Lyric_combine_music_iterator::find_voice () while (t && t->get_parent_context ()) t = t->get_parent_context (); - std::string name = ly_scm2string (voice_name); + string name = ly_scm2string (voice_name); Context *voice = find_context_below (t, ly_symbol2scm ("Voice"), name); if (voice) @@ -237,7 +237,7 @@ Lyric_combine_music_iterator::do_quit () { SCM voice_name = get_music ()->get_property ("associated-context"); - std::string name; + string name; if (scm_is_string (voice_name)) name = ly_scm2string (voice_name); diff --git a/lily/note-collision.cc b/lily/note-collision.cc index db794d5092..a3f18ab002 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -23,9 +23,9 @@ void check_meshing_chords (Grob *me, - Drul_array > *offsets, - Drul_array > const &extents, - Drul_array const &clash_groups) + Drul_array > *offsets, + Drul_array > const &extents, + Drul_array > const &clash_groups) { if (!extents[UP].size () || ! extents[DOWN].size ()) @@ -41,8 +41,8 @@ check_meshing_chords (Grob *me, Grob *nu = Note_column::first_head (cu); Grob *nd = Note_column::first_head (cd); - std::vector ups = Stem::note_head_positions (Note_column::get_stem (cu)); - std::vector dps = Stem::note_head_positions (Note_column::get_stem (cd)); + vector ups = Stem::note_head_positions (Note_column::get_stem (cu)); + vector dps = Stem::note_head_positions (Note_column::get_stem (cd)); /* Too far apart to collide. */ if (ups[0] > dps.back () + 1) @@ -280,7 +280,7 @@ SCM Note_collision_interface::calc_positioning_done (SCM smob) { Grob *me = unsmob_grob (smob); - Drul_array cg = get_clash_groups (me); + Drul_array > cg = get_clash_groups (me); Direction d = UP; do @@ -309,10 +309,10 @@ Note_collision_interface::calc_positioning_done (SCM smob) } while (flip (&d) != UP); - Link_array__Grob_ done; + vector done; Real left_most = 1e6; - std::vector amounts; + vector amounts; for (; scm_is_pair (hand); hand = scm_cdr (hand)) { Grob *s = unsmob_grob (scm_caar (hand)); @@ -344,10 +344,10 @@ Note_collision_interface::calc_positioning_done (SCM smob) return SCM_BOOL_T; } -Drul_array < Link_array__Grob_ > +Drul_array < vector > Note_collision_interface::get_clash_groups (Grob *me) { - Drul_array clash_groups; + Drul_array > clash_groups; extract_grob_set (me, "elements", elements); for (vsize i = 0; i < elements.size (); i++) @@ -360,7 +360,7 @@ Note_collision_interface::get_clash_groups (Grob *me) Direction d = UP; do { - Link_array__Grob_ &clashes (clash_groups[d]); + vector &clashes (clash_groups[d]); vector_sort (clashes, Note_column::shift_compare); } while ((flip (&d)) != UP); @@ -375,17 +375,17 @@ Note_collision_interface::get_clash_groups (Grob *me) */ SCM Note_collision_interface::automatic_shift (Grob *me, - Drul_array < Link_array__Grob_ + Drul_array < vector > clash_groups) { - Drul_array < std::vector > shifts; + Drul_array < vector > shifts; SCM tups = SCM_EOL; Direction d = UP; do { - std::vector &shift (shifts[d]); - Link_array__Grob_ &clashes (clash_groups[d]); + vector &shift (shifts[d]); + vector &clashes (clash_groups[d]); for (vsize i = 0; i < clashes.size (); i++) { @@ -409,8 +409,8 @@ Note_collision_interface::automatic_shift (Grob *me, } while ((flip (&d)) != UP); - Drul_array > extents; - Drul_array > offsets; + Drul_array > extents; + Drul_array > offsets; d = UP; do { diff --git a/lily/note-head.cc b/lily/note-head.cc index 5a0c9abf84..b84e74690d 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -30,13 +30,13 @@ using namespace std; clean up the mess left by ledger line handling. */ static Stencil -internal_print (Grob *me, std::string *font_char) +internal_print (Grob *me, string *font_char) { SCM style = me->get_property ("style"); if (!scm_is_symbol (style)) style = ly_symbol2scm ("default"); - std::string suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2)); + string suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2)); if (style != ly_symbol2scm ("default")) { SCM gn = me->get_property ("glyph-name"); @@ -46,12 +46,12 @@ internal_print (Grob *me, std::string *font_char) Font_metric *fm = Font_interface::get_default_font (me); - std::string idx = "noteheads.s" + suffix; + string idx = "noteheads.s" + suffix; Stencil out = fm->find_by_name (idx); if (out.is_empty ()) { - std::string prefix = "noteheads."; + string prefix = "noteheads."; Grob *stem = unsmob_grob (me->get_object ("stem")); Direction stem_dir = stem ? get_grob_direction (stem) : CENTER; @@ -94,7 +94,7 @@ Note_head::print (SCM smob) { Grob *me = unsmob_grob (smob); - std::string idx; + string idx; return internal_print (me, &idx).smobbed_copy (); } @@ -113,7 +113,7 @@ Note_head::calc_stem_attachment (SCM smob) { Grob *me = unsmob_grob (smob); Font_metric *fm = Font_interface::get_default_font (me); - std::string key; + string key; internal_print (me, &key); Offset att; diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 109e4905c7..038a9d4a69 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -20,9 +20,9 @@ using namespace std; class Note_heads_engraver : public Engraver { - Link_array__Item_ notes_; - Link_array__Item_ dots_; - Link_array__Music_ note_evs_; + vector notes_; + vector dots_; + vector note_evs_; public: TRANSLATOR_DECLARATIONS (Note_heads_engraver); diff --git a/lily/note-name-engraver.cc b/lily/note-name-engraver.cc index c0ee4986f6..585eb1fae2 100644 --- a/lily/note-name-engraver.cc +++ b/lily/note-name-engraver.cc @@ -14,8 +14,8 @@ class Note_name_engraver : public Engraver public: TRANSLATOR_DECLARATIONS (Note_name_engraver); - Link_array__Music_ events_; - Link_array__Item_ texts_; + vector events_; + vector texts_; virtual bool try_music (Music *m); void process_music (); void stop_translation_timestep (); @@ -35,7 +35,7 @@ Note_name_engraver::try_music (Music *m) void Note_name_engraver::process_music () { - std::string s; + string s; for (vsize i = 0; i < events_.size (); i++) { if (i) diff --git a/lily/note-performer.cc b/lily/note-performer.cc index cfb8edaf51..331e7cc60f 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -28,8 +28,8 @@ protected: void process_music (); private: - Link_array__Music_ note_evs_; - Link_array__Audio_note_ notes_; + vector note_evs_; + vector notes_; }; void diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index 0ddf4bc540..fe56b32b45 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -39,7 +39,7 @@ Note_spacing::get_spacing (Grob *me, Item *right_col, Interval left_head_wid; do { - Link_array__Grob_ const &items (ly_scm2link_array (props [d])); + vector const &items (ly_scm2link_array (props [d])); for (vsize i = items.size (); i--;) { Item *it = dynamic_cast (items[i]); @@ -223,7 +223,7 @@ Note_spacing::right_column (Grob *me) if (prune && a) { - Link_array__Grob_ &right = a->array_reference (); + vector &right = a->array_reference (); for (vsize i = right.size (); i--;) { if (dynamic_cast (right[i])->get_column () != mincol) @@ -269,7 +269,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, do { - Link_array__Grob_ const &items (ly_scm2link_array (props [d])); + vector const &items (ly_scm2link_array (props [d])); for (vsize i = 0; i < items.size (); i++) { Item *it = dynamic_cast (items[i]); diff --git a/lily/open-type-font-scheme.cc b/lily/open-type-font-scheme.cc index b2692d994b..db4c89c177 100644 --- a/lily/open-type-font-scheme.cc +++ b/lily/open-type-font-scheme.cc @@ -51,10 +51,10 @@ LY_DEFINE (ly_otf_font_table_data, "ly:otf-font-table-data", 2, 0, 0, char ctag [5] = " "; - std::string tag_string = ly_scm2string (tag); + string tag_string = ly_scm2string (tag); strncpy (ctag, tag_string.c_str (), tag_string.length ()); - std::string tab = otf->get_otf_table (std::string (ctag)); + string tab = otf->get_otf_table (string (ctag)); return scm_from_locale_stringn ((char const *) tab.data (), tab.length ()); } diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index 6ad743b0a3..32bd597df2 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -44,8 +44,8 @@ load_table (char const *tag_str, FT_Face face, FT_ULong *length) return 0; } -std::string -Open_type_font::get_otf_table (std::string tag) const +string +Open_type_font::get_otf_table (string tag) const { return ::get_otf_table (face_, tag); } @@ -59,7 +59,7 @@ load_scheme_table (char const *tag_str, FT_Face face) SCM tab = SCM_EOL; if (buffer) { - std::string contents ((char const*)buffer, length); + string contents ((char const*)buffer, length); contents = "(quote (" + contents + "))"; tab = scm_c_eval_string (contents.c_str ()); @@ -89,17 +89,17 @@ Open_type_font::~Open_type_font () /* UGH fix naming */ -std::string -get_otf_table (FT_Face face, std::string tag) +string +get_otf_table (FT_Face face, string tag) { FT_ULong len; FT_Byte *tab = load_table (tag.c_str (), face, &len); - return std::string ((char const*) tab, len); + return string ((char const*) tab, len); } FT_Face -open_ft_face (std::string str) +open_ft_face (string str) { FT_Face face; int error_code = FT_New_Face (freetype2_library, str.c_str (), 0, &face); @@ -113,7 +113,7 @@ open_ft_face (std::string str) } SCM -Open_type_font::make_otf (std::string str) +Open_type_font::make_otf (string str) { FT_Face face = open_ft_face (str); Open_type_font *otf = new Open_type_font (face); @@ -147,7 +147,7 @@ Open_type_font::derived_mark () const } Offset -Open_type_font::attachment_point (std::string glyph_name) const +Open_type_font::attachment_point (string glyph_name) const { SCM sym = ly_symbol2scm (glyph_name.c_str ()); SCM entry = scm_hashq_ref (lily_character_table_, sym, SCM_BOOL_F); @@ -224,7 +224,7 @@ Open_type_font::get_indexed_char (vsize signed_idx) const } vsize -Open_type_font::name_to_index (std::string nm) const +Open_type_font::name_to_index (string nm) const { char *nm_str = (char *) nm.c_str (); if (vsize idx = FT_Get_Name_Index (face_, nm_str)) @@ -284,7 +284,7 @@ Open_type_font::get_global_table () const return lily_global_table_; } -std::string +string Open_type_font::font_name () const { return FT_Get_Postscript_Name (face_); diff --git a/lily/output-def.cc b/lily/output-def.cc index d93ee5db31..739b4b9e7b 100644 --- a/lily/output-def.cc +++ b/lily/output-def.cc @@ -127,7 +127,7 @@ Output_def::lookup_variable (SCM sym) const } SCM -Output_def::c_variable (std::string s) const +Output_def::c_variable (string s) const { return lookup_variable (ly_symbol2scm (s.c_str ())); } diff --git a/lily/output-property-engraver.cc b/lily/output-property-engraver.cc index c0750c06c8..74ee449411 100644 --- a/lily/output-property-engraver.cc +++ b/lily/output-property-engraver.cc @@ -18,7 +18,7 @@ class Output_property_engraver : public Engraver { TRANSLATOR_DECLARATIONS (Output_property_engraver); protected: - Link_array__Music_ props_; + vector props_; DECLARE_ACKNOWLEDGER (grob) void stop_translation_timestep (); diff --git a/lily/pango-font.cc b/lily/pango-font.cc index 674ed68724..86c4bf61f5 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -62,7 +62,7 @@ Pango_font::~Pango_font () } void -Pango_font::register_font_file (std::string filename, std::string ps_name) +Pango_font::register_font_file (string filename, string ps_name) { scm_hash_set_x (physical_font_tab_, scm_makfrom0str (ps_name.c_str ()), @@ -76,7 +76,7 @@ Pango_font::derived_mark () const } Stencil -Pango_font::pango_item_string_stencil (PangoItem const *item, std::string str) const +Pango_font::pango_item_string_stencil (PangoItem const *item, string str) const { const int GLYPH_NAME_LEN = 256; char glyph_name[GLYPH_NAME_LEN]; @@ -144,7 +144,7 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, std::string str) c char *file_name_as_ptr = 0; FcPatternGetString (fcpat, FC_FILE, 0, (FcChar8 **) & file_name_as_ptr); - std::string file_name; + string file_name; if (file_name_as_ptr) { /* Normalize file name. */ @@ -156,7 +156,7 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, std::string str) c if (!ps_name_str0) warning (_f ("no PostScript font name for font `%s'", file_name)); - std::string ps_name; + string ps_name; if (!ps_name_str0 && file_name != "" && (file_name.find (".otf") != NPOS @@ -164,7 +164,7 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, std::string str) c { /* UGH: kludge a PS name for OTF/CFF fonts. */ - std::string name = file_name; + string name = file_name; ssize idx = file_name.find (".otf"); if (idx == NPOS) idx = file_name.find (".cff"); @@ -179,7 +179,7 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, std::string str) c name.length () - slash_idx); } - std::string initial = name.substr (0, 1); + string initial = name.substr (0, 1); initial = String_convert::to_upper (initial); name = name.substr (1, name.length () - 1); name = String_convert::to_lower (name); @@ -213,7 +213,7 @@ Pango_font::physical_font_tab () const } Stencil -Pango_font::text_stencil (std::string str) const +Pango_font::text_stencil (string str) const { GList *items = pango_itemize (context_, diff --git a/lily/pango-select.cc b/lily/pango-select.cc index 5c93c1386c..bd684b92f8 100644 --- a/lily/pango-select.cc +++ b/lily/pango-select.cc @@ -19,7 +19,7 @@ properties_to_pango_description (SCM chain, Real text_size) PangoFontDescription *description = 0; if (scm_is_string (name)) { - std::string name_str = ly_scm2string (name); + string name_str = ly_scm2string (name); description = pango_font_description_from_string (name_str.c_str ()); } else @@ -132,7 +132,7 @@ symbols_to_pango_font_description (SCM family, { PangoFontDescription *description = pango_font_description_new (); - std::string family_str = "roman"; + string family_str = "roman"; if (scm_is_symbol (family)) family_str = ly_symbol2string (family); else if (scm_is_string (family)) diff --git a/lily/paper-book.cc b/lily/paper-book.cc index 0677be700c..a431fc4648 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -104,7 +104,7 @@ Paper_book::output (SCM output_channel) if (ly_is_module (header_)) scopes = scm_cons (header_, scopes); - std::string mod_nm = "scm framework-" + output_backend_global; + string mod_nm = "scm framework-" + output_backend_global; SCM mod = scm_c_resolve_module (mod_nm.c_str ()); if (make_print) @@ -144,8 +144,8 @@ Paper_book::classic_output (SCM output) if (ly_is_module (header_0_)) scopes = scm_cons (header_0_, scopes); - std::string format = output_backend_global; - std::string mod_nm = "scm framework-" + format; + string format = output_backend_global; + string mod_nm = "scm framework-" + format; SCM mod = scm_c_resolve_module (mod_nm.c_str ()); SCM func = scm_c_module_lookup (mod, "output-classic-framework"); diff --git a/lily/paper-column.cc b/lily/paper-column.cc index f7a1ae5e8b..6fa9ee6ab7 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -113,10 +113,10 @@ Paper_column::print (SCM p) { Grob *me = unsmob_grob (p); - std::string r = to_string (Paper_column::get_rank (me)); + string r = to_string (Paper_column::get_rank (me)); Moment *mom = unsmob_moment (me->get_property ("when")); - std::string when = mom ? mom->to_string () : "?/?"; + string when = mom ? mom->to_string () : "?/?"; SCM properties = Font_interface::text_font_alist_chain (me); @@ -157,7 +157,7 @@ Paper_column::before_line_breaking (SCM grob) if (!ga) return SCM_UNSPECIFIED; - Link_array__Grob_ &array (ga->array_reference ()); + vector &array (ga->array_reference ()); for (vsize i = array.size (); i--;) { diff --git a/lily/paper-outputter-scheme.cc b/lily/paper-outputter-scheme.cc index e05f6cc8ac..d7fe624952 100644 --- a/lily/paper-outputter-scheme.cc +++ b/lily/paper-outputter-scheme.cc @@ -22,9 +22,9 @@ LY_DEFINE (ly_make_paper_outputter, "ly:make-paper-outputter", SCM_ASSERT_TYPE (scm_is_string (format), format, SCM_ARG2, __FUNCTION__, "String"); - std::string f = ly_scm2string (format); + string f = ly_scm2string (format); - std::string output_name = ""; + string output_name = ""; SCM port_name = scm_port_filename (port); if (scm_is_string (port_name)) diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index aff76981f7..c321c6f8df 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -29,13 +29,13 @@ using namespace std; #include "ly-smobs.icc" -Paper_outputter::Paper_outputter (SCM port, std::string format) +Paper_outputter::Paper_outputter (SCM port, string format) { file_ = port; output_module_ = SCM_EOL; smobify_self (); - std::string module_name = "scm output-" + format; + string module_name = "scm output-" + format; output_module_ = scm_c_resolve_module (module_name.c_str ()); } diff --git a/lily/paper-score.cc b/lily/paper-score.cc index c983fe0289..a2af964b4b 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -58,11 +58,11 @@ Paper_score::typeset_system (System *system) system->unprotect (); } -std::vector +vector Paper_score::calc_breaking () { Break_algorithm *algorithm = 0; - std::vector sol; + vector sol; algorithm = new Gourlay_breaking; algorithm->set_pscore (this); @@ -86,13 +86,13 @@ Paper_score::process () down the road. doubly, also done in Score_engraver */ - Link_array__Grob_ pc (system_->columns ()); + vector pc (system_->columns ()); pc[0]->set_property ("breakable", SCM_BOOL_T); pc.back ()->set_property ("breakable", SCM_BOOL_T); system_->pre_processing (); - std::vector breaking = calc_breaking (); + vector breaking = calc_breaking (); system_->break_into_pieces (breaking); paper_systems_ = system_->get_paper_systems (); diff --git a/lily/parser.yy b/lily/parser.yy index 651ef44a52..a85870f179 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -2732,7 +2732,7 @@ run_music_function (Lily_parser *parser, SCM expr) bool is_regular_identifier (SCM id) { - std::string str = ly_scm2string (id); + string str = ly_scm2string (id); char const *s = str.c_str (); bool v = true; diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc index c2625f28c1..caa6c73aa8 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -410,8 +410,8 @@ Part_combine_iterator::process (Moment m) solo2 (); else if (scm_is_symbol (tag)) { - std::string s = "Unknown split directive: " - + (scm_is_symbol (tag) ? ly_symbol2string (tag) : std::string ("not a symbol")); + string s = "Unknown split directive: " + + (scm_is_symbol (tag) ? ly_symbol2string (tag) : string ("not a symbol")); programming_error (s); } } diff --git a/lily/performance.cc b/lily/performance.cc index 93899350e0..2430df6670 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -89,8 +89,8 @@ Performance::output_header_track (Midi_stream &midi_stream) midi_track.channel_ = 9; // perhaps multiple text events? - std::string id_string; - std::string str = std::string (_ ("Creator: ")); + string id_string; + string str = string (_ ("Creator: ")); id_string = String_convert::pad_to (gnu_lilypond_version_string (), 30); str += id_string; @@ -150,7 +150,7 @@ Performance::add_element (Audio_element *p) } void -Performance::write_output (std::string out) +Performance::write_output (string out) { if (out == "-") out = "lelie.midi"; diff --git a/lily/pfb.cc b/lily/pfb.cc index b27fe906c5..678e480b90 100644 --- a/lily/pfb.cc +++ b/lily/pfb.cc @@ -77,7 +77,7 @@ LY_DEFINE (ly_pfb_to_pfa, "ly:pfb->pfa", SCM_ASSERT_TYPE (scm_is_string (pfb_file_name), pfb_file_name, SCM_ARG1, __FUNCTION__, "string"); - std::string file_name = ly_scm2string (pfb_file_name); + string file_name = ly_scm2string (pfb_file_name); int len = -1; if (be_verbose_global) @@ -103,12 +103,12 @@ LY_DEFINE (ly_otf_to_cff, "ly:otf->cff", SCM_ASSERT_TYPE (scm_is_string (otf_file_name), otf_file_name, SCM_ARG1, __FUNCTION__, "string"); - std::string file_name = ly_scm2string (otf_file_name); + string file_name = ly_scm2string (otf_file_name); if (be_verbose_global) progress_indication ("[" + file_name); FT_Face face = open_ft_face (file_name); - std::string table = get_otf_table (face, "CFF "); + string table = get_otf_table (face, "CFF "); SCM asscm = scm_from_locale_stringn ((char *) table.data (), table.length ()); diff --git a/lily/phrasing-slur-engraver.cc b/lily/phrasing-slur-engraver.cc index 64f76ae3a0..c7571f118c 100644 --- a/lily/phrasing-slur-engraver.cc +++ b/lily/phrasing-slur-engraver.cc @@ -27,8 +27,8 @@ class Phrasing_slur_engraver : public Engraver { Drul_array events_; Music *running_slur_start_; - Link_array__Grob_ slurs_; - Link_array__Grob_ end_slurs_; + vector slurs_; + vector end_slurs_; protected: virtual bool try_music (Music *); diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index e15f8deb3d..86e0e032e9 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -79,7 +79,7 @@ private: occurs simultaneously then extra space can be added between them. */ - Link_array__Spanner_ previous_; + vector previous_; void del_linespanner (Spanner *); void create_text_grobs (Pedal_info *p, bool); @@ -152,7 +152,7 @@ Piano_pedal_engraver::try_music (Music *m) { for (Pedal_info *p = info_list_; p->name_; p++) { - std::string nm = p->name_ + std::string ("Event"); + string nm = p->name_ + string ("Event"); if (ly_is_equal (m->get_property ("name"), scm_str2symbol (nm.c_str ()))) { @@ -174,7 +174,7 @@ Piano_pedal_engraver::process_music () { if (!p->line_spanner_) { - std::string name = std::string (p->name_) + "PedalLineSpanner"; + string name = string (p->name_) + "PedalLineSpanner"; Music *rq = (p->event_drul_[START] ? p->event_drul_[START] : p->event_drul_[STOP]); p->line_spanner_ = make_spanner (name.c_str (), rq->self_scm ()); } @@ -192,7 +192,7 @@ Piano_pedal_engraver::process_music () mixed: Ped. _____/\____| */ - std::string prop = std::string ("pedal") + p->name_ + "Style"; + string prop = string ("pedal") + p->name_ + "Style"; SCM style = get_property (prop.c_str ()); bool mixed = style == ly_symbol2scm ("mixed"); @@ -213,14 +213,14 @@ void Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed) { SCM s = SCM_EOL; - SCM strings = get_property (("pedal" + std::string (p->name_) + "Strings").c_str ()); + SCM strings = get_property (("pedal" + string (p->name_) + "Strings").c_str ()); if (scm_ilength (strings) < 3) { Music *m = p->event_drul_[START]; if (!m) m = p->event_drul_ [STOP]; - std::string msg = _f ("expect 3 strings for piano pedals, found: %d", + string msg = _f ("expect 3 strings for piano pedals, found: %d", scm_ilength (strings)); if (m) m->origin ()->warning (msg); @@ -271,7 +271,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed) if (scm_is_string (s)) { - std::string propname = std::string (p->name_) + "Pedal"; + string propname = string (p->name_) + "Pedal"; p->item_ = make_item (propname.c_str (), (p->event_drul_[START] ? p->event_drul_[START] @@ -293,7 +293,7 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed) { if (!p->bracket_ && p->event_drul_[STOP]) { - std::string msg = _f ("can't find start of piano pedal bracket: `%s'", p->name_); + string msg = _f ("can't find start of piano pedal bracket: `%s'", p->name_); p->event_drul_[STOP]->origin ()->warning (msg); p->event_drul_[STOP] = 0; } diff --git a/lily/piano-pedal-performer.cc b/lily/piano-pedal-performer.cc index 4cf4415f03..4083c468f9 100644 --- a/lily/piano-pedal-performer.cc +++ b/lily/piano-pedal-performer.cc @@ -36,7 +36,7 @@ protected: void start_translation_timestep (); private: - Link_array__Audio_piano_pedal_ audios_; + vector audios_; Pedal_info *info_alist_; }; @@ -79,11 +79,11 @@ Piano_pedal_performer::process_music () if (p->event_drul_[STOP]) { if (!p->start_event_) - p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", std::string (p->name_))); + p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", string (p->name_))); else { Audio_piano_pedal *a = new Audio_piano_pedal; - a->type_string_ = std::string (p->name_); + a->type_string_ = string (p->name_); a->dir_ = STOP; audios_.push_back (a); Audio_element_info info(a, p->event_drul_[STOP]); @@ -96,7 +96,7 @@ Piano_pedal_performer::process_music () { p->start_event_ = p->event_drul_[START]; Audio_piano_pedal *a = new Audio_piano_pedal; - a->type_string_ = std::string (p->name_); + a->type_string_ = string (p->name_); a->dir_ = START; audios_.push_back (a); Audio_element_info info(a, p->event_drul_[START]); @@ -132,7 +132,7 @@ Piano_pedal_performer::try_music (Music *r) { for (Pedal_info *p = info_alist_; p->name_; p++) { - std::string nm = p->name_ + std::string ("Event"); + string nm = p->name_ + string ("Event"); if (ly_is_equal (r->get_property ("name"), scm_str2symbol (nm.c_str ()))) { diff --git a/lily/pitch.cc b/lily/pitch.cc index 076615391c..80b32e3c69 100644 --- a/lily/pitch.cc +++ b/lily/pitch.cc @@ -166,13 +166,13 @@ pitch_interval (Pitch const &from, Pitch const &to) char const *accname[] = {"eses", "eseh", "es", "eh", "", "ih", "is", "isih", "isis"}; -std::string +string Pitch::to_string () const { int n = (notename_ + 2) % 7; - std::string s = std::to_string (char (n + 'a')); + string s = ::to_string (char (n + 'a')); if (alteration_) - s += std::string (accname[alteration_ - DOUBLE_FLAT]); + s += string (accname[alteration_ - DOUBLE_FLAT]); if (octave_ >= 0) { @@ -184,7 +184,7 @@ Pitch::to_string () const { int o = (-octave_) - 1; while (o--) - s += std::to_string (','); + s += ::to_string (','); } return s; diff --git a/lily/pitched-trill-engraver.cc b/lily/pitched-trill-engraver.cc index 0cc9155e05..84e391e231 100644 --- a/lily/pitched-trill-engraver.cc +++ b/lily/pitched-trill-engraver.cc @@ -35,7 +35,7 @@ private: Item *trill_group_; Item *trill_accidental_; - Link_array__Grob_ heads_; + vector heads_; void make_trill (Music *); }; diff --git a/lily/pointer-group-interface.cc b/lily/pointer-group-interface.cc index 51354ffb50..6366fb1fa1 100644 --- a/lily/pointer-group-interface.cc +++ b/lily/pointer-group-interface.cc @@ -40,26 +40,26 @@ Pointer_group_interface::add_grob (Grob *me, SCM sym, Grob *p) arr->add (p); } -static Link_array__Grob_ empty_array; +static vector empty_array; -Link_array__Grob_ const & +vector const & ly_scm2link_array (SCM x) { Grob_array *arr = unsmob_grob_array (x); return arr ? arr->array () : empty_array; } -Link_array__Grob_ const & +vector const & internal_extract_grob_array (Grob const *elt, SCM symbol) { return ly_scm2link_array (elt->internal_get_object (symbol)); } -Link_array__Item_ +vector internal_extract_item_array (Grob const *elt, SCM symbol) { Grob_array *arr = unsmob_grob_array (elt->internal_get_object (symbol)); - Link_array__Item_ items; + vector items; for (vsize i = 0; arr && i < arr->size (); i++) items.push_back (arr->item (i)); diff --git a/lily/prob.cc b/lily/prob.cc index 6e6f9b98fc..5a1caca155 100644 --- a/lily/prob.cc +++ b/lily/prob.cc @@ -119,7 +119,7 @@ Prob::get_property_alist (bool m) const return (m) ? mutable_property_alist_ : immutable_property_alist_; } -std::string +string Prob::name () const { SCM nm = get_property ("name"); diff --git a/lily/program-option.cc b/lily/program-option.cc index 7174b82cb9..4ec7b2d3e4 100644 --- a/lily/program-option.cc +++ b/lily/program-option.cc @@ -87,19 +87,19 @@ ssize const SEPARATION = 5; /* Hmmm. should do in SCM / C++ ? */ -static std::string +static string get_help_string () { SCM alist = ly_hash2alist (option_hash); SCM convertor = ly_lily_module_constant ("scm->string"); - std::vector opts; + vector opts; for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s)) { SCM sym = scm_caar (s); SCM val = scm_cdar (s); - std::string opt_spec + string opt_spec = String_convert::char_string (' ', INDENT) + ly_symbol2string (sym) + " (" @@ -116,28 +116,28 @@ get_help_string () SCM opt_help_scm = scm_object_property (sym, ly_symbol2scm ("program-option-documentation")); - std::string opt_help = ly_scm2string (opt_help_scm); + string opt_help = ly_scm2string (opt_help_scm); replace_all (opt_help, - std::string ("\n"), - std::string ("\n") + string ("\n"), + string ("\n") + String_convert::char_string (' ', HELP_INDENT)); opts.push_back (opt_spec + opt_help + "\n"); } - std::string help ("Options supported by ly:set-option\n\n"); + string help ("Options supported by ly:set-option\n\n"); vector_sort (opts, string_compare); for (vsize i = 0; i < opts.size (); i++) help += opts[i]; - help += std::string ("\n"); + help += string ("\n"); return help; } LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (), "Print ly:set-option usage") { - std::string help = get_help_string (); + string help = get_help_string (); fputs (help.c_str (), stdout); exit (0); @@ -176,8 +176,8 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val), if (val == SCM_UNDEFINED) val = SCM_BOOL_T; - std::string varstr = ly_scm2string (scm_symbol_to_string (var)); - if (varstr.substr (0, 3) == std::string ("no-")) + string varstr = ly_scm2string (scm_symbol_to_string (var)); + if (varstr.substr (0, 3) == string ("no-")) { var = ly_symbol2scm (varstr.substr (3, varstr.length () -3).c_str ()); val = scm_from_bool (!to_boolean (val)); diff --git a/lily/relative-octave-check.cc b/lily/relative-octave-check.cc index 07d70acc45..651702ce99 100644 --- a/lily/relative-octave-check.cc +++ b/lily/relative-octave-check.cc @@ -36,7 +36,7 @@ Relative_octave_check::relative_callback (SCM music, SCM last_pitch) if (result != *check_p) { - std::string s = _ ("Failed octave check, got: "); + string s = _ ("Failed octave check, got: "); s += result.to_string (); m->origin ()->warning (s); diff --git a/lily/relocate.cc b/lily/relocate.cc index 9972db3fb9..ffb32d5415 100644 --- a/lily/relocate.cc +++ b/lily/relocate.cc @@ -29,11 +29,11 @@ int -sane_putenv (char const *key, std::string value, bool overwrite) +sane_putenv (char const *key, string value, bool overwrite) { if (overwrite || !getenv (key)) { - std::string combine = std::string (key) + "=" + value; + string combine = string (key) + "=" + value; char *s = strdup (combine.c_str ()); return putenv (s); } @@ -42,7 +42,7 @@ sane_putenv (char const *key, std::string value, bool overwrite) } static int -set_env_file (char const *key, std::string value, bool overwrite = false) +set_env_file (char const *key, string value, bool overwrite = false) { if (is_file (value)) return sane_putenv (key, value, overwrite); @@ -52,7 +52,7 @@ set_env_file (char const *key, std::string value, bool overwrite = false) } static int -set_env_dir (char const *key, std::string value) +set_env_dir (char const *key, string value) { if (is_dir (value)) return sane_putenv (key, value, false); @@ -62,7 +62,7 @@ set_env_dir (char const *key, std::string value) } static int -prepend_env_path (char const *key, std::string value) +prepend_env_path (char const *key, string value) { if (is_dir (value)) { @@ -79,10 +79,10 @@ prepend_env_path (char const *key, std::string value) return -1; } -std::string -dir_name (std::string const file_name) +string +dir_name (string const file_name) { - std::string s = file_name; + string s = file_name; replace_all (s, '\\', '/'); ssize n = s.length (); if (n && s[n - 1] == '/') @@ -96,17 +96,17 @@ dir_name (std::string const file_name) #endif void -prefix_relocation (std::string prefix) +prefix_relocation (string prefix) { if (be_verbose_global) warning (_f ("Relocation: compile prefix=%s, new prefix=%s", prefix_directory, prefix.c_str ())); - std::string bindir = prefix + "/bin"; - std::string datadir = prefix + "/share"; - std::string localedir = datadir + "/locale"; - std::string lilypond_datadir = datadir + "/lilypond/"; + string bindir = prefix + "/bin"; + string datadir = prefix + "/share"; + string localedir = datadir + "/locale"; + string lilypond_datadir = datadir + "/lilypond/"; if (is_dir (lilypond_datadir + "/" + TOPLEVEL_VERSION)) prefix_directory = lilypond_datadir + "/" + TOPLEVEL_VERSION; @@ -122,15 +122,15 @@ prefix_relocation (std::string prefix) } void -framework_relocation (std::string prefix) +framework_relocation (string prefix) { if (be_verbose_global) warning (_f ("Relocation: framework_prefix=%s", prefix)); - std::string bindir = prefix + "/bin"; - std::string datadir = prefix + "/share"; - std::string libdir = prefix + "/lib"; - std::string sysconfdir = prefix + "/etc"; + string bindir = prefix + "/bin"; + string datadir = prefix + "/share"; + string libdir = prefix + "/lib"; + string sysconfdir = prefix + "/etc"; /* need otherwise dynamic .so's aren't found. */ prepend_env_path ("DYLD_LIBRARY_PATH", libdir); @@ -163,13 +163,13 @@ framework_relocation (std::string prefix) prepend_env_path ("PATH", bindir); } -std::string +string get_working_directory () { char cwd[PATH_MAX]; getcwd (cwd, PATH_MAX); - return std::string (cwd); + return string (cwd); } void @@ -181,18 +181,18 @@ setup_paths (char const *argv0_ptr) if (relocate_binary && getenv ("LILYPOND_RELOCATE_PREFIX")) { - std::string prefix = getenv ("LILYPOND_RELOCATE_PREFIX"); + string prefix = getenv ("LILYPOND_RELOCATE_PREFIX"); #ifdef __MINGW32__ /* Normalize file name. */ prefix = File_name (prefix).to_string (); #endif /* __MINGW32__ */ prefix_relocation (prefix); - std::string bindir = prefix + "/bin"; + string bindir = prefix + "/bin"; framework_relocation (bindir + "/" FRAMEWORKDIR); } else if (relocate_binary) { - std::string argv0_abs; + string argv0_abs; if (argv0_filename.is_absolute ()) { argv0_abs = argv0_filename.to_string (); @@ -202,7 +202,7 @@ setup_paths (char const *argv0_ptr) else if (argv0_filename.dir_.length ()) { argv0_abs = get_working_directory () - + "/" + std::string (argv0_filename.to_string ()); + + "/" + string (argv0_filename.to_string ()); if (be_verbose_global) warning (_f ("Relocation: from cwd: argv0=%s", argv0_ptr)); } @@ -227,12 +227,12 @@ setup_paths (char const *argv0_ptr) programming_error ("can't find absolute argv0."); } - std::string bindir = dir_name (argv0_abs); - std::string argv0_prefix = dir_name (bindir); - std::string compile_prefix = dir_name (dir_name (dir_name (prefix_directory))); + string bindir = dir_name (argv0_abs); + string argv0_prefix = dir_name (bindir); + string compile_prefix = dir_name (dir_name (dir_name (prefix_directory))); if (argv0_prefix != compile_prefix) prefix_relocation (argv0_prefix); - if (argv0_prefix != compile_prefix || std::string (FRAMEWORKDIR) != "..") + if (argv0_prefix != compile_prefix || string (FRAMEWORKDIR) != "..") framework_relocation (bindir + "/" FRAMEWORKDIR); } @@ -263,8 +263,8 @@ setup_paths (char const *argv0_ptr) */ struct stat statbuf; - std::string build_prefix_current = prefix_directory + "/share/lilypond/" "current"; - std::string build_prefix_version = prefix_directory + "/share/lilypond/" TOPLEVEL_VERSION; + string build_prefix_current = prefix_directory + "/share/lilypond/" "current"; + string build_prefix_version = prefix_directory + "/share/lilypond/" TOPLEVEL_VERSION; if (stat (build_prefix_version.c_str (), &statbuf) == 0) prefix_directory = build_prefix_version; else if (stat (build_prefix_current.c_str (), &statbuf) == 0) @@ -276,10 +276,10 @@ setup_paths (char const *argv0_ptr) char *suffixes[] = {"ly", "ps", "scm", 0 }; - std::vector dirs; + vector dirs; for (char **s = suffixes; *s; s++) { - std::string path = prefix_directory + to_string ('/') + std::string (*s); + string path = prefix_directory + to_string ('/') + string (*s); dirs.push_back (path); } diff --git a/lily/repeat-acknowledge-engraver.cc b/lily/repeat-acknowledge-engraver.cc index f752d5447d..a0d94369d5 100644 --- a/lily/repeat-acknowledge-engraver.cc +++ b/lily/repeat-acknowledge-engraver.cc @@ -66,7 +66,7 @@ Repeat_acknowledge_engraver::process_music () SCM cs = get_property ("repeatCommands"); - std::string s = ""; + string s = ""; bool start = false; bool end = false; bool volta_found = false; diff --git a/lily/rest-collision-engraver.cc b/lily/rest-collision-engraver.cc index 2fa66dbe54..ef2ecfb420 100644 --- a/lily/rest-collision-engraver.cc +++ b/lily/rest-collision-engraver.cc @@ -15,7 +15,7 @@ class Rest_collision_engraver : public Engraver { Item *rest_collision_; vsize rest_count_; - Link_array__Grob_ note_columns_; + vector note_columns_; protected: DECLARE_ACKNOWLEDGER (note_column); void process_acknowledged (); diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index aebdf84cf8..589dd0dbec 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -92,8 +92,8 @@ Rest_collision::calc_positioning_done (SCM smob) Grob *me = unsmob_grob (smob); extract_grob_set (me, "elements", elts); - Link_array__Grob_ rests; - Link_array__Grob_ notes; + vector rests; + vector notes; for (vsize i = 0; i < elts.size (); i++) { @@ -137,7 +137,7 @@ Rest_collision::calc_positioning_done (SCM smob) This is incomplete: in case of an uneven number of rests, the center one should be centered on the staff. */ - Drul_array ordered_rests; + Drul_array > ordered_rests; for (vsize i = 0; i < rests.size (); i++) { Grob *r = Note_column::get_rest (rests[i]); diff --git a/lily/rest.cc b/lily/rest.cc index 181626ef3a..8d6cba5068 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -57,8 +57,8 @@ Rest::y_offset_callback (SCM smob) /* make this function easily usable in C++ */ -std::string -Rest::glyph_name (Grob *me, int balltype, std::string style, bool try_ledgers) +string +Rest::glyph_name (Grob *me, int balltype, string style, bool try_ledgers) { bool is_ledgered = false; if (try_ledgers && (balltype == 0 || balltype == 1)) @@ -75,7 +75,7 @@ Rest::glyph_name (Grob *me, int balltype, std::string style, bool try_ledgers) is_ledgered |= (balltype == 1) && (pos <= -rad - 2 || pos > +rad); } - std::string actual_style (style.c_str ()); + string actual_style (style.c_str ()); if ((style == "mensural") || (style == "neomensural")) { @@ -128,13 +128,13 @@ Rest::brew_internal_stencil (Grob *me, bool ledgered) int balltype = scm_to_int (balltype_scm); - std::string style; + string style; SCM style_scm = me->get_property ("style"); if (scm_is_symbol (style_scm)) style = ly_scm2string (scm_symbol_to_string (style_scm)); Font_metric *fm = Font_interface::get_default_font (me); - std::string font_char = glyph_name (me, balltype, style, ledgered); + string font_char = glyph_name (me, balltype, style, ledgered); Stencil out = fm->find_by_name (font_char); if (out.is_empty ()) me->warning (_f ("rest `%s' not found", font_char.c_str ())); diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index 2ca4cdca7c..3c250c92b2 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -41,7 +41,7 @@ class Rhythmic_column_engraver : public Engraver { - Link_array__Grob_ rheads_; + vector rheads_; Grob *stem_; Grob *note_column_; Grob *dotcol_; diff --git a/lily/script-column-engraver.cc b/lily/script-column-engraver.cc index ccbe0f6112..b445c6a682 100644 --- a/lily/script-column-engraver.cc +++ b/lily/script-column-engraver.cc @@ -18,7 +18,7 @@ class Script_column_engraver : public Engraver { Grob *scol_; - Link_array__Item_ scripts_; + vector scripts_; public: TRANSLATOR_DECLARATIONS (Script_column_engraver); diff --git a/lily/script-column.cc b/lily/script-column.cc index 0cc14ba48f..0676e20f02 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -42,7 +42,7 @@ Script_column::before_line_breaking (SCM smob) { Grob *me = unsmob_grob (smob); Drul_array scripts_drul (SCM_EOL, SCM_EOL); - Link_array__Grob_ staff_sided; + vector staff_sided; extract_grob_set (me, "scripts", scripts); for (vsize i = 0; i < scripts.size (); i++) diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index f0284d85a9..9a06474c6b 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -34,7 +34,7 @@ struct Script_tuple class Script_engraver : public Engraver { - std::vector scripts_; + vector scripts_; Spanner *slur_; protected: diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index a5b076bc86..944b08fdc0 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -16,7 +16,7 @@ void Separating_group_spanner::find_rods (Item *r, - Link_array__Grob_ const &separators, + vector const &separators, vsize idx, Real padding) { diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index b50acd3143..8a7821a102 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -24,7 +24,7 @@ struct Spacings { Item *staff_spacing_; - Link_array__Item_ note_spacings_; + vector note_spacings_; Spacings () { diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 65f2a694a8..52d0425fb2 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -106,7 +106,7 @@ Side_position_interface::general_side_position (Grob *me, Axis a, bool use_exten /* FIXME: 1000 should relate to paper size. */ if (fabs (total_off) > 1000) { - std::string msg + string msg = String_convert::form_string ("Improbable offset for grob %s: %f%s", me->name ().c_str (), total_off, INTERNAL_UNIT); diff --git a/lily/simple-spacer-scheme.cc b/lily/simple-spacer-scheme.cc index c47993fb6a..24ff02c680 100644 --- a/lily/simple-spacer-scheme.cc +++ b/lily/simple-spacer-scheme.cc @@ -60,7 +60,7 @@ LY_DEFINE (ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem", else spacer.my_solve_linelen (); - std::vector posns; + vector posns; posns.push_back (0.0); for (vsize i = 0; i < spacer.springs_.size (); i++) { diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index 900fd77988..bc0ee2c3f6 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -376,9 +376,9 @@ compare_paper_column_rank (Grob *const &a, } void -Simple_spacer_wrapper::add_columns (Link_array__Grob_ const &icols) +Simple_spacer_wrapper::add_columns (vector const &icols) { - Link_array__Grob_ cols (icols); + vector cols (icols); cols.clear (); for (vsize i = 0; i < icols.size (); i++) diff --git a/lily/skyline.cc b/lily/skyline.cc index 6c2007ed5b..f72ea5b2f6 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -42,7 +42,7 @@ const Real EPS = 1e-12; binsearch. */ void -insert_extent_into_skyline (std::vector *line, Box b, Axis line_axis, +insert_extent_into_skyline (vector *line, Box b, Axis line_axis, Direction d) { Interval extent = b[line_axis]; @@ -83,8 +83,8 @@ insert_extent_into_skyline (std::vector *line, Box b, Axis line_a } void -merge_skyline (std::vector *a1, - std::vector const &a2, +merge_skyline (vector *a1, + vector const &a2, Direction dir) { for (vsize i = 0; i < a2.size (); i++) @@ -98,10 +98,10 @@ merge_skyline (std::vector *a1, } } -std::vector +vector empty_skyline (Direction d) { - std::vector skyline; + vector skyline; Interval i; i.set_empty (); @@ -113,11 +113,11 @@ empty_skyline (Direction d) return skyline; } -std::vector -extents_to_skyline (std::vector const &extents, Axis a, Direction d) +vector +extents_to_skyline (vector const &extents, Axis a, Direction d) { - std::vector skyline = empty_skyline (d); + vector skyline = empty_skyline (d); /* This makes a cubic algorithm (array insertion is O (n), @@ -139,8 +139,8 @@ extents_to_skyline (std::vector const &extents, Axis a, Direction d) This is an O (n) algorithm. */ Real -skyline_meshing_distance (std::vector const &buildings, - std::vector const &clouds) +skyline_meshing_distance (vector const &buildings, + vector const &clouds) { int i = buildings.size () -1; int j = clouds.size () -1; @@ -176,14 +176,14 @@ Skyline_entry::Skyline_entry (Interval i, Real r) } void -heighten_skyline (std::vector *buildings, Real ground) +heighten_skyline (vector *buildings, Real ground) { for (vsize i = 0; i < buildings->size (); i++) buildings->at (i).height_ += ground; } Real -skyline_height (std::vector const &buildings, +skyline_height (vector const &buildings, Real airplane, Direction sky_dir) { diff --git a/lily/slur-configuration.cc b/lily/slur-configuration.cc index f67b00469a..29b9844863 100644 --- a/lily/slur-configuration.cc +++ b/lily/slur-configuration.cc @@ -25,7 +25,7 @@ avoid_staff_line (Slur_score_state const &state, Bezier bez) { Offset horiz (1, 0); - std::vector ts = bez.solve_derivative (horiz); + vector ts = bez.solve_derivative (horiz); /* TODO: handle case of broken slur. */ if (!ts.empty () @@ -64,7 +64,7 @@ avoid_staff_line (Slur_score_state const &state, Real fit_factor (Offset dz_unit, Offset dz_perp, - Bezier curve, Direction d, std::vector const &avoid) + Bezier curve, Direction d, vector const &avoid) { Real fit_factor = 0.0; Offset x0 = curve.control_[0]; @@ -98,7 +98,7 @@ fit_factor (Offset dz_unit, Offset dz_perp, void Slur_configuration::generate_curve (Slur_score_state const &state, Real r_0, Real h_inf, - std::vector const &avoid) + vector const &avoid) { Offset dz = attachment_[RIGHT]- attachment_[LEFT];; Offset dz_unit = dz; @@ -180,7 +180,7 @@ Slur_configuration::score_encompass (Slur_score_state const &state) Distances for heads that are between slur and line between attachment points. */ - std::vector convex_head_distances; + vector convex_head_distances; for (vsize j = 0; j < state.encompass_infos_.size (); j++) { Real x = state.encompass_infos_[j].x_; diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index a0deb271dc..a022660b64 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -26,8 +26,8 @@ class Slur_engraver : public Engraver { Drul_array events_; Music *running_slur_start_; - Link_array__Grob_ slurs_; - Link_array__Grob_ end_slurs_; + vector slurs_; + vector end_slurs_; void set_melisma (bool); diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 5f978cc483..4e96c9322d 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -631,11 +631,11 @@ Slur_score_state::move_away_from_staffline (Real y, return y; } -std::vector +vector Slur_score_state::generate_avoid_offsets () const { - std::vector avoid; - Link_array__Grob_ encompasses = columns_; + vector avoid; + vector encompasses = columns_; for (vsize i = 0; i < encompasses.size (); i++) { @@ -684,15 +684,15 @@ Slur_score_state::generate_curves () const Real r_0 = robust_scm2double (slur_->get_property ("ratio"), 0.33); Real h_inf = staff_space_ * scm_to_double (slur_->get_property ("height-limit")); - std::vector avoid = generate_avoid_offsets (); + vector avoid = generate_avoid_offsets (); for (vsize i = 0; i < configurations_.size (); i++) configurations_[i]->generate_curve (*this, r_0, h_inf, avoid); } -Link_array__Slur_configuration_ +vector Slur_score_state::enumerate_attachments (Drul_array end_ys) const { - Link_array__Slur_configuration_ scores; + vector scores; Drul_array os; os[LEFT] = base_attachments_[LEFT]; @@ -780,11 +780,11 @@ Slur_score_state::enumerate_attachments (Drul_array end_ys) const return scores; } -std::vector +vector Slur_score_state::get_extra_encompass_infos () const { extract_grob_set (slur_, "encompass-objects", encompasses); - std::vector collision_infos; + vector collision_infos; for (vsize i = encompasses.size (); i--;) { if (Slur::has_interface (encompasses[i])) diff --git a/lily/slur.cc b/lily/slur.cc index 8c1e7e090e..e3c4ca2521 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -112,7 +112,7 @@ Slur::print (SCM smob) ->lookup_variable (ly_symbol2scm ("debug-slur-scoring"))) && scm_is_string (quant_score)) { - std::string str; + string str; SCM properties = Font_interface::text_font_alist_chain (me); Stencil tm = *unsmob_stencil (Text_interface::interpret_markup diff --git a/lily/source-file.cc b/lily/source-file.cc index 9689b1a29e..902baa0e47 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -46,7 +46,7 @@ Source_file::load_stdin () } char * -gulp_file (std::string filename, int *filesize) +gulp_file (string filename, int *filesize) { /* "b" must ensure to open literally, avoiding text (CR/LF) conversions. */ @@ -78,7 +78,7 @@ gulp_file (std::string filename, int *filesize) return str; } -Source_file::Source_file (std::string filename, std::string data) +Source_file::Source_file (string filename, string data) { name_ = filename; istream_ = 0; @@ -92,7 +92,7 @@ Source_file::Source_file (std::string filename, std::string data) newline_locations_.push_back (contents_str0_ + i); } -Source_file::Source_file (std::string filename_string) +Source_file::Source_file (string filename_string) { name_ = filename_string; istream_ = 0; @@ -146,7 +146,7 @@ Source_file::get_istream () return istream_; } -std::string +string Source_file::file_line_column_string (char const *context_str0) const { if (!c_str ()) @@ -161,7 +161,7 @@ Source_file::file_line_column_string (char const *context_str0) const } } -std::string +string Source_file::quote_input (char const *pos_str0) const { if (!contains (pos_str0)) @@ -169,15 +169,15 @@ Source_file::quote_input (char const *pos_str0) const int l, ch, col; get_counts (pos_str0, &l, &ch, &col); - std::string line = line_string (pos_str0); - std::string context = line.substr (0, ch) + string line = line_string (pos_str0); + string context = line.substr (0, ch) + to_string ('\n') + to_string (' ', col) + line.substr (ch, line.length()-ch); return context; } -std::string +string Source_file::name_string () const { return map_file_name (name_); @@ -220,7 +220,7 @@ Source_file::line_slice (char const *pos_str0) const return Slice (begin_str0 - data_str0, end_str0 - data_str0); } -std::string +string Source_file::line_string (char const *pos_str0) const { if (!contains (pos_str0)) @@ -228,7 +228,7 @@ Source_file::line_string (char const *pos_str0) const Slice line = line_slice (pos_str0); char const *data_str0 = c_str (); - return std::string (data_str0 + line[LEFT], line.length ()); + return string (data_str0 + line[LEFT], line.length ()); } void @@ -251,7 +251,7 @@ Source_file::get_counts (char const *pos_str0, char const *line_start = (char const *)data + line[LEFT]; ssize left = (char const *) pos_str0 - line_start; - std::string line_begin (line_start, left); + string line_begin (line_start, left); char const *line_chars = line_begin.c_str (); *column = 0; @@ -380,10 +380,10 @@ Source_file::forward_str0 (int n) return old_pos; } -std::string +string Source_file::get_string (int n) { - std::string str = std::string ((char const *)forward_str0 (n), n); + string str = string ((char const *)forward_str0 (n), n); return str; } diff --git a/lily/source.cc b/lily/source.cc index 775668e08d..462bfcffa0 100644 --- a/lily/source.cc +++ b/lily/source.cc @@ -40,11 +40,11 @@ Sources::set_path (File_path *f) @return 0 if no file found */ Source_file * -Sources::get_file (std::string &file_string) //UGH +Sources::get_file (string &file_string) //UGH { if ((file_string != "-") && path_) { - std::string file_string_o = path_->find (file_string); + string file_string_o = path_->find (file_string); if ((file_string_o == "") && (file_string != "")) return 0; file_string = file_string_o; diff --git a/lily/spacing-determine-loose-columns.cc b/lily/spacing-determine-loose-columns.cc index e878d264a1..951cc8b12e 100644 --- a/lily/spacing-determine-loose-columns.cc +++ b/lily/spacing-determine-loose-columns.cc @@ -126,10 +126,10 @@ is_loose_column (Grob *l, Grob *c, Grob *r, Spacing_options const *options) between. */ void -Spacing_spanner::prune_loose_columns (Grob *me, Link_array__Grob_ *cols, +Spacing_spanner::prune_loose_columns (Grob *me, vector *cols, Spacing_options const *options) { - Link_array__Grob_ newcols; + vector newcols; for (vsize i = 0; i < cols->size (); i++) { @@ -228,7 +228,7 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array__Grob_ *cols, Set neighboring columns determined by the spacing-wishes grob property. */ void -Spacing_spanner::set_explicit_neighbor_columns (Link_array__Grob_ const &cols) +Spacing_spanner::set_explicit_neighbor_columns (vector const &cols) { for (vsize i = 0; i < cols.size (); i++) { @@ -300,7 +300,7 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array__Grob_ const &cols) yet. Only do breakable non-musical columns, and musical columns. */ void -Spacing_spanner::set_implicit_neighbor_columns (Link_array__Grob_ const &cols) +Spacing_spanner::set_implicit_neighbor_columns (vector const &cols) { for (vsize i = 0; i < cols.size (); i++) { diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index 4b09a917d3..d567cb6ebc 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -42,8 +42,8 @@ struct Rhythmic_tuple class Spacing_engraver : public Engraver { PQueue playing_durations_; - std::vector now_durations_; - std::vector stopped_durations_; + vector now_durations_; + vector stopped_durations_; Moment now_; Spanner *spacing_; diff --git a/lily/spacing-loose-columns.cc b/lily/spacing-loose-columns.cc index bc0594bed0..0570741117 100644 --- a/lily/spacing-loose-columns.cc +++ b/lily/spacing-loose-columns.cc @@ -38,7 +38,7 @@ set_loose_columns (System *which, Column_x_positions const *posns) Item *left = 0; Item *right = 0; - Link_array__Item_ clique; + vector clique; while (1) { SCM between = loose->get_object ("between-cols"); diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 39638ff007..73fb9880f4 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -35,7 +35,7 @@ using namespace std; */ Rational Spacing_spanner::effective_shortest_duration (Grob *me, - Link_array__Grob_ const &all) + vector const &all) { SCM preset_shortest = me->get_property ("common-shortest-duration"); Rational global_shortest; @@ -61,7 +61,7 @@ Spacing_spanner::set_springs (SCM smob) /* can't use get_system() ? --hwn. */ - Link_array__Grob_ all (get_root_system (me)->columns ()); + vector all (get_root_system (me)->columns ()); set_explicit_neighbor_columns (all); @@ -86,13 +86,13 @@ Spacing_spanner::set_springs (SCM smob) stuff, then. */ Rational -Spacing_spanner::find_shortest (Grob *me, Link_array__Grob_ const &cols) +Spacing_spanner::find_shortest (Grob *me, vector const &cols) { /* ascending in duration */ - std::vector durations; - std::vector counts; + vector durations; + vector counts; Rational shortest_in_measure; shortest_in_measure.set_infinite (1); @@ -225,7 +225,7 @@ Spacing_spanner::generate_pair_spacing (Grob *me, void Spacing_spanner::generate_springs (Grob *me, - Link_array__Grob_ const &cols, + vector const &cols, Spacing_options const *options) { Paper_column *next = 0; diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc index 1e992e16a3..e970129048 100644 --- a/lily/span-arpeggio-engraver.cc +++ b/lily/span-arpeggio-engraver.cc @@ -30,7 +30,7 @@ protected: private: Item *span_arpeggio_; - Link_array__Grob_ arpeggios_; + vector arpeggios_; }; Span_arpeggio_engraver::Span_arpeggio_engraver () diff --git a/lily/span-bar-engraver.cc b/lily/span-bar-engraver.cc index 8ddd16c08d..503bdf265b 100644 --- a/lily/span-bar-engraver.cc +++ b/lily/span-bar-engraver.cc @@ -22,7 +22,7 @@ dependencies to the spanbars. class Span_bar_engraver : public Engraver { Item *spanbar_; - Link_array__Item_ bars_; + vector bars_; public: TRANSLATOR_DECLARATIONS (Span_bar_engraver); diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 14debf7c98..84fe893a0c 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -53,10 +53,10 @@ Span_bar::print (SCM smobbed_me) if (!scm_is_string (glyph)) return SCM_EOL; - std::string glyph_string = ly_scm2string (glyph); + string glyph_string = ly_scm2string (glyph); /* compose span_bar_mol */ - std::vector extents; + vector extents; Grob *model_bar = 0; for (vsize i = elements.size (); i--;) { @@ -116,7 +116,7 @@ Span_bar::width (SCM smob) if (!me->is_live ()) return ly_interval2scm (Interval ()); - std::string gl = ly_scm2string (gn); + string gl = ly_scm2string (gn); /* urg. @@ -177,7 +177,7 @@ Span_bar::calc_glyph_name (SCM smob) return SCM_UNSPECIFIED; } - std::string type = ly_scm2string (gl); + string type = ly_scm2string (gl); if (type == "|:") type = ".|"; else if (type == ":|") diff --git a/lily/span-dynamic-performer.cc b/lily/span-dynamic-performer.cc index 111f9a9442..3d8d053be2 100644 --- a/lily/span-dynamic-performer.cc +++ b/lily/span-dynamic-performer.cc @@ -41,8 +41,8 @@ private: Real last_volume_; Music *span_start_event_; Drul_array span_events_; - std::vector dynamic_tuples_; - std::vector finished_dynamic_tuples_; + vector dynamic_tuples_; + vector finished_dynamic_tuples_; Direction dir_; Direction finished_dir_; }; diff --git a/lily/spanner.cc b/lily/spanner.cc index c7836160b0..bb6f743a24 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -81,7 +81,7 @@ Spanner::do_break_processing () else { System *root = get_root_system (this); - Link_array__Item_ break_points = root->broken_col_range (left, right); + vector break_points = root->broken_col_range (left, right); break_points.insert (break_points.begin () + 0, left); break_points.push_back (right); diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index 4d2d53beb0..b8facd2364 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -22,8 +22,8 @@ public: TRANSLATOR_DECLARATIONS (Staff_performer); ~Staff_performer (); - std::string new_instrument_string (); - std::string instrument_string_; + string new_instrument_string (); + string instrument_string_; protected: virtual void acknowledge_audio_element (Audio_element_info info); @@ -77,7 +77,7 @@ Staff_performer::initialize () void Staff_performer::process_music () { - std::string str = new_instrument_string (); + string str = new_instrument_string (); if (str.length ()) { instrument_name_ = new Audio_text (Audio_text::INSTRUMENT_NAME, str); @@ -124,7 +124,7 @@ Staff_performer::finalize () audio_staff_ = 0; } -std::string +string Staff_performer::new_instrument_string () { // mustn't ask Score for instrument: it will return piano! diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index 305d3a2468..1d9182c16c 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -102,7 +102,7 @@ Staff_spacing::bar_y_positions (Grob *bar_grob) SCM glyph = bar_grob->get_property ("glyph-name"); Grob *staff_sym = Staff_symbol_referencer::get_staff_symbol (bar_grob); - std::string glyph_string = scm_is_string (glyph) ? ly_scm2string (glyph) : ""; + string glyph_string = scm_is_string (glyph) ? ly_scm2string (glyph) : ""; if (glyph_string.substr (0, 1) == "|" || glyph_string.substr (0, 1) == ".") { diff --git a/lily/stanza-number-align-engraver.cc b/lily/stanza-number-align-engraver.cc index 3f80169b0c..bf4da5f840 100644 --- a/lily/stanza-number-align-engraver.cc +++ b/lily/stanza-number-align-engraver.cc @@ -21,8 +21,8 @@ public: TRANSLATOR_DECLARATIONS (Stanza_number_align_engraver); protected: - Link_array__Grob_ lyrics_; - Link_array__Grob_ stanza_numbers_; + vector lyrics_; + vector stanza_numbers_; DECLARE_ACKNOWLEDGER (lyric_syllable); DECLARE_ACKNOWLEDGER (stanza_number); diff --git a/lily/stem.cc b/lily/stem.cc index c50b976310..3c1bdc326c 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -181,10 +181,10 @@ integer_compare (int const &a, int const &b) } /* The positions, in ascending order. */ -std::vector +vector Stem::note_head_positions (Grob *me) { - std::vector ps; + vector ps; extract_grob_set (me, "note-heads", heads); for (vsize i = heads.size (); i--;) @@ -233,7 +233,7 @@ Stem::calc_stem_end_position (SCM smob) Real ss = Staff_symbol_referencer::staff_space (me); int durlog = duration_log (me); - std::vector a; + vector a; /* WARNING: IN HALF SPACES */ Real length = robust_scm2double (me->get_property ("length"), 7); @@ -367,7 +367,7 @@ Stem::calc_positioning_done (SCM smob) return SCM_BOOL_T; extract_grob_set (me, "note-heads", ro_heads); - Link_array__Grob_ heads (ro_heads); + vector heads (ro_heads); vector_sort (heads, compare_position); Direction dir = get_grob_direction (me); @@ -548,7 +548,7 @@ Stem::flag (Grob *me) TODO: maybe property stroke-style should take different values, e.g. "" (i.e. no stroke), "single" and "double" (currently, it's '() or "grace"). */ - std::string flag_style; + string flag_style; SCM flag_style_scm = me->get_property ("flag-style"); if (scm_is_symbol (flag_style_scm)) @@ -559,7 +559,7 @@ Stem::flag (Grob *me) bool adjust = true; - std::string staffline_offs; + string staffline_offs; if (flag_style == "mensural") /* Mensural notation: For notes on staff lines, use different flags than for notes between staff lines. The idea is that @@ -582,7 +582,7 @@ Stem::flag (Grob *me) staffline_offs = ""; char dir = (get_grob_direction (me) == UP) ? 'u' : 'd'; - std::string font_char = flag_style + string font_char = flag_style + to_string (dir) + staffline_offs + to_string (log); Font_metric *fm = Font_interface::get_default_font (me); Stencil flag = fm->find_by_name ("flags." + font_char); @@ -592,10 +592,10 @@ Stem::flag (Grob *me) SCM stroke_style_scm = me->get_property ("stroke-style"); if (scm_is_string (stroke_style_scm)) { - std::string stroke_style = ly_scm2string (stroke_style_scm); + string stroke_style = ly_scm2string (stroke_style_scm); if (!stroke_style.empty ()) { - std::string font_char = to_string (dir) + stroke_style; + string font_char = to_string (dir) + stroke_style; Stencil stroke = fm->find_by_name ("flags." + font_char); if (stroke.is_empty ()) me->warning (_f ("flag stroke `%s' not found", font_char)); diff --git a/lily/sustain-pedal.cc b/lily/sustain-pedal.cc index b1d87e79a3..2e6cd91bd9 100644 --- a/lily/sustain-pedal.cc +++ b/lily/sustain-pedal.cc @@ -44,18 +44,18 @@ Sustain_pedal::print (SCM smob) if (!scm_is_string (glyph)) return mol.smobbed_copy (); - std::string text = ly_scm2string (glyph); + string text = ly_scm2string (glyph); for (ssize i = 0; i < text.length (); i++) { - std::string idx ("pedal."); + string idx ("pedal."); if (text.substr (i, 3) == "Ped") { idx += "Ped"; i += 2; } else - idx += std::string (&text.c_str ()[i], 1); + idx += string (&text.c_str ()[i], 1); Stencil m = Font_interface::get_default_font (e)->find_by_name (idx); if (!m.is_empty ()) mol.add_at_edge (X_AXIS, RIGHT, m, 0, 0); diff --git a/lily/system-start-delimiter-engraver.cc b/lily/system-start-delimiter-engraver.cc index bbab59328d..b03c1d20a4 100644 --- a/lily/system-start-delimiter-engraver.cc +++ b/lily/system-start-delimiter-engraver.cc @@ -32,7 +32,7 @@ public: struct Bracket_nesting_group : public Bracket_nesting_node { Spanner *delimiter_; - Link_array__Bracket_nesting_node_ children_; + vector children_; SCM symbol_; void from_list (SCM ); diff --git a/lily/system.cc b/lily/system.cc index 6bcae7ffba..ddf5c613cd 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -106,7 +106,7 @@ System::derived_mark () const } static void -fixup_refpoints (Link_array__Grob_ const &grobs) +fixup_refpoints (vector const &grobs) { for (vsize i = grobs.size (); i--;) grobs[i]->fixup_refpoint (); @@ -200,14 +200,14 @@ System::get_paper_systems () } void -System::break_into_pieces (std::vector const &breaking) +System::break_into_pieces (vector const &breaking) { for (vsize i = 0; i < breaking.size (); i++) { System *system = dynamic_cast (clone (i)); system->rank_ = i; - Link_array__Grob_ c (breaking[i].cols_); + vector c (breaking[i].cols_); pscore_->typeset_system (system); system->set_bound (LEFT, c[0]); @@ -317,7 +317,7 @@ System::post_processing () This might seem inefficient, but Stencils are cached per grob anyway. */ - Link_array__Grob_ all_elts_sorted (all_elements_->array ()); + vector all_elts_sorted (all_elements_->array ()); vector_sort (all_elts_sorted, default_compare); uniq (all_elts_sorted); this->get_stencil (); @@ -399,10 +399,10 @@ System::get_paper_system () return pl->unprotect (); } -Link_array__Item_ +vector System::broken_col_range (Item const *left, Item const *right) const { - Link_array__Item_ ret; + vector ret; left = left->get_column (); right = right->get_column (); @@ -430,7 +430,7 @@ System::broken_col_range (Item const *left, Item const *right) const /** Return all columns, but filter out any unused columns , since they might disrupt the spacing problem. */ -Link_array__Grob_ +vector System::columns () const { extract_grob_set (this, "columns", ro_columns); @@ -443,7 +443,7 @@ System::columns () const break; } - Link_array__Grob_ columns; + vector columns; for (int i = 0; i <= last_breakable; i++) { if (Paper_column::is_used (ro_columns[i])) diff --git a/lily/tab-note-heads-engraver.cc b/lily/tab-note-heads-engraver.cc index 2a1c24b943..00b4ab156d 100644 --- a/lily/tab-note-heads-engraver.cc +++ b/lily/tab-note-heads-engraver.cc @@ -26,11 +26,11 @@ using namespace std; */ class Tab_note_heads_engraver : public Engraver { - Link_array__Item_ notes_; + vector notes_; - Link_array__Item_ dots_; - Link_array__Music_ note_events_; - Link_array__Music_ tabstring_events_; + vector dots_; + vector note_events_; + vector tabstring_events_; public: TRANSLATOR_DECLARATIONS (Tab_note_heads_engraver); diff --git a/lily/template5.cc b/lily/template5.cc index 6ecd872feb..fcc788fd14 100644 --- a/lily/template5.cc +++ b/lily/template5.cc @@ -20,7 +20,7 @@ Interval_t::infinity () } template<> -std::string +string Interval_t::T_to_string (Rational a) { return a.to_string (); diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index 7ada54bb7c..6a59be8664 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -18,8 +18,8 @@ */ class Text_engraver : public Engraver { - Link_array__Music_ evs_; - Link_array__Item_ texts_; + vector evs_; + vector texts_; public: TRANSLATOR_DECLARATIONS (Text_engraver); protected: diff --git a/lily/text-interface.cc b/lily/text-interface.cc index d95ed7a63a..62375fbb9c 100644 --- a/lily/text-interface.cc +++ b/lily/text-interface.cc @@ -32,7 +32,7 @@ Text_interface::interpret_string (SCM layout_smob, SCM_ASSERT_TYPE (scm_is_string (markup), markup, SCM_ARG3, __FUNCTION__, "string"); - std::string str = ly_scm2string (markup); + string str = ly_scm2string (markup); Font_metric *fm = select_encoded_font (layout, props); return fm->text_stencil (str).smobbed_copy (); diff --git a/lily/text-metrics.cc b/lily/text-metrics.cc index dbeafffef6..2b6d57e538 100644 --- a/lily/text-metrics.cc +++ b/lily/text-metrics.cc @@ -19,7 +19,7 @@ lookup_tex_text_dimension (Font_metric *font, SCM text) Box b; SCM limit = ly_lily_module_constant ("TEX_STRING_HASHLIMIT"); - std::string key_str = ly_scm2string (font->font_file_name ()); + string key_str = ly_scm2string (font->font_file_name ()); int hash_code = scm_to_int (scm_hash (text, limit)); key_str = to_string (hash_code) + key_str; @@ -70,12 +70,12 @@ LY_DEFINE (ly_load_text_dimensions, "ly:load-text-dimensions", } void -try_load_text_metrics (std::string basename) +try_load_text_metrics (string basename) { - std::string path = global_path.find (basename + ".textmetrics"); + string path = global_path.find (basename + ".textmetrics"); if (path != "") { - std::string contents (gulp_file_to_string (path, true, -1)); + string contents (gulp_file_to_string (path, true, -1)); contents = "(quote (" + contents + "))"; SCM lst = scm_c_eval_string (contents.c_str ()); diff --git a/lily/tfm-reader.cc b/lily/tfm-reader.cc index cdd55d5783..b416301134 100644 --- a/lily/tfm-reader.cc +++ b/lily/tfm-reader.cc @@ -20,7 +20,7 @@ (1 << 20) static const Real fix_to_real (Fix f); -Tex_font_metric_reader::Tex_font_metric_reader (std::string name) +Tex_font_metric_reader::Tex_font_metric_reader (string name) : input_ (name) { @@ -55,11 +55,11 @@ Tex_font_metric_reader::get_U32_fix_scaled () return get_U32_fix () * info_.design_size; } -std::string +string Tex_font_metric_reader::get_bcpl_string () { U8 length_u8 = input_.get_U8 (); - std::string str = input_.get_string (length_u8); + string str = input_.get_string (length_u8); return str; } @@ -255,7 +255,7 @@ Tex_font_metric_reader::read_char () #define KERN_FLAG 128 void -Tex_font_metric_reader::read_lig_kern_program (std::vector *ligatures, std::vector *kerns) +Tex_font_metric_reader::read_lig_kern_program (vector *ligatures, vector *kerns) { bool end_b; diff --git a/lily/tfm.cc b/lily/tfm.cc index fa9007a218..3f415802e4 100644 --- a/lily/tfm.cc +++ b/lily/tfm.cc @@ -91,7 +91,7 @@ Tex_font_metric::get_ascii_char (vsize a) const } SCM -Tex_font_metric::make_tfm (std::string file_name) +Tex_font_metric::make_tfm (string file_name) { Tex_font_metric *tfm = new Tex_font_metric; Tex_font_metric_reader reader (file_name); @@ -118,14 +118,14 @@ Tex_font_metric::design_size () const return info_.design_size * point_constant; } -std::string +string Tex_font_metric::font_name () const { return font_name_; } vsize -Tex_font_metric::name_to_index (std::string) const +Tex_font_metric::name_to_index (string) const { assert (false); return 0; diff --git a/lily/tie-column.cc b/lily/tie-column.cc index 6962ccf369..68639605d3 100644 --- a/lily/tie-column.cc +++ b/lily/tie-column.cc @@ -70,7 +70,7 @@ Tie_column::calc_positioning_done (SCM smob) { Grob *me = unsmob_grob (smob); extract_grob_set (me, "ties", ro_ties); - Link_array__Grob_ ties (ro_ties); + vector ties (ro_ties); if (!ties.size ()) return SCM_BOOL_T; diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index c78b99286c..39be6c057f 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -48,9 +48,9 @@ struct Head_event_tuple class Tie_engraver : public Engraver { Music *event_; - Link_array__Grob_ now_heads_; - std::vector heads_to_tie_; - Link_array__Grob_ ties_; + vector now_heads_; + vector heads_to_tie_; + vector ties_; Spanner *tie_column_; diff --git a/lily/tie-formatting-problem.cc b/lily/tie-formatting-problem.cc index 8309db2660..4e5a910b21 100644 --- a/lily/tie-formatting-problem.cc +++ b/lily/tie-formatting-problem.cc @@ -59,12 +59,12 @@ Tie_formatting_problem::~Tie_formatting_problem () } void -Tie_formatting_problem::set_chord_outline (Link_array__Item_ bounds, +Tie_formatting_problem::set_chord_outline (vector bounds, Direction d) { Real staff_space = Staff_symbol_referencer::staff_space (bounds[0]); - std::vector boxes; + vector boxes; Grob *stem = 0; for (vsize i = 0; i < bounds.size (); i++) @@ -163,7 +163,7 @@ Tie_formatting_problem::set_chord_outline (Link_array__Item_ bounds, void Tie_formatting_problem::from_tie (Grob *tie) { - Link_array__Grob_ ties; + vector ties; ties.push_back (tie); from_ties (ties); @@ -177,7 +177,7 @@ Tie_formatting_problem::common_x_refpoint () const } void -Tie_formatting_problem::from_ties (Link_array__Grob_ const &ties) +Tie_formatting_problem::from_ties (vector const &ties) { if (ties.empty ()) return; @@ -194,7 +194,7 @@ Tie_formatting_problem::from_ties (Link_array__Grob_ const &ties) Direction d = LEFT; do { - Link_array__Item_ bounds; + vector bounds; for (vsize i = 0; i < ties.size (); i++) { @@ -231,13 +231,13 @@ Tie_formatting_problem::from_ties (Link_array__Grob_ const &ties) } void -Tie_formatting_problem::from_lv_ties (Link_array__Grob_ const &lv_ties) +Tie_formatting_problem::from_lv_ties (vector const &lv_ties) { if (lv_ties.empty ()) return; details_.from_grob (lv_ties[0]); - Link_array__Item_ heads; + vector heads; for (vsize i = 0; i < lv_ties.size (); i++) { @@ -477,7 +477,7 @@ Tie_formatting_problem::score_configuration (Tie_configuration const &conf) cons Tie_configuration Tie_formatting_problem::find_optimal_tie_configuration (Tie_specification const &spec) const { - Link_array__Tie_configuration_ confs; + vector confs; int pos = spec.position_; Direction dir = spec.manual_dir_; @@ -488,7 +488,7 @@ Tie_formatting_problem::find_optimal_tie_configuration (Tie_specification const confs.push_back (generate_configuration (pos + i * dir, dir)); } - std::vector scores; + vector scores; int best_idx = -1; Real best_score = 1e6; @@ -663,7 +663,7 @@ Ties_configuration Tie_formatting_problem::generate_optimal_chord_configuration () { Ties_configuration base = generate_base_chord_configuration (); - std::vector vars = get_variations (base); + vector vars = get_variations (base); Ties_configuration best = base; Real best_score = score_ties (best); @@ -737,12 +737,12 @@ Tie_configuration_variation::Tie_configuration_variation () suggestion_ = 0; } -std::vector +vector Tie_formatting_problem::get_variations (Ties_configuration const &ties) { Real center_distance_tolerance = 0.25; - std::vector vars; + vector vars; Real last_center = 0.0; for (vsize i = 0; i < ties.size (); i++) { diff --git a/lily/tie-performer.cc b/lily/tie-performer.cc index f122bcc865..bf3c513bcb 100644 --- a/lily/tie-performer.cc +++ b/lily/tie-performer.cc @@ -17,8 +17,8 @@ class Tie_performer : public Performer { Music *event_; Music *last_event_; - std::vector now_heads_; - std::vector heads_to_tie_; + vector now_heads_; + vector heads_to_tie_; bool ties_created_; diff --git a/lily/time-signature.cc b/lily/time-signature.cc index 66b788a181..26860c688f 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -54,7 +54,7 @@ Time_signature::print (SCM smob) Stencil Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d) { - std::string style = ly_scm2string (scm_symbol_to_string (scm_style)); + string style = ly_scm2string (scm_symbol_to_string (scm_style)); if (style == "numbered") return numbered_time_signature (me, n, d); @@ -70,7 +70,7 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d) return numbered_time_signature (me, n, d); } - std::string char_name = style + to_string (n) + to_string (d); + string char_name = style + to_string (n) + to_string (d); me->set_property ("font-encoding", ly_symbol2scm ("fetaMusic")); Stencil out = Font_interface::get_default_font (me) ->find_by_name ("timesig." + char_name); diff --git a/lily/translator-group.cc b/lily/translator-group.cc index e63dfdc6eb..529d0f9979 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -186,7 +186,7 @@ Translator_group::precompute_method_bindings () void Translator_group::precomputed_translator_foreach (Translator_precompute_index idx) { - std::vector &bindings (precomputed_method_bindings_[idx]); + vector &bindings (precomputed_method_bindings_[idx]); for (vsize i = 0; i < bindings.size (); i++) bindings[i].invoke (); } diff --git a/lily/translator.cc b/lily/translator.cc index a0dd3d0c2c..391af52b4b 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -159,12 +159,12 @@ Translator::print_smob (SCM s, SCM port, scm_print_state *) void add_acknowledger (Engraver_void_function_engraver_grob_info ptr, char const *func_name, - std::vector *ack_array) + vector *ack_array) { Acknowledge_information inf; inf.function_ = ptr; - std::string interface_name (func_name); + string interface_name (func_name); interface_name = replace_all (interface_name, '_', '-'); interface_name += "-interface"; @@ -174,7 +174,7 @@ add_acknowledger (Engraver_void_function_engraver_grob_info ptr, } Engraver_void_function_engraver_grob_info -generic_get_acknowledger (SCM sym, std::vector const *ack_array) +generic_get_acknowledger (SCM sym, vector const *ack_array) { for (vsize i = 0; i < ack_array->size (); i++) { diff --git a/lily/ttf.cc b/lily/ttf.cc index a457ac4cc6..82bc78dce2 100644 --- a/lily/ttf.cc +++ b/lily/ttf.cc @@ -86,7 +86,7 @@ print_header (void *out, FT_Face face) #define CHUNKSIZE 65534 static void -print_body (void *out, std::string name) +print_body (void *out, string name) { FILE *fd = fopen (name.c_str (), "rb"); @@ -152,7 +152,7 @@ print_trailer (void *out, } static void -create_type42_font (void *out, std::string name) +create_type42_font (void *out, string name) { FT_Face face = open_ft_face (name); @@ -170,7 +170,7 @@ LY_DEFINE (ly_ttf_ps_name, "ly:ttf-ps-name", { SCM_ASSERT_TYPE (scm_is_string (ttf_file_name), ttf_file_name, SCM_ARG1, __FUNCTION__, "string"); - std::string file_name = ly_scm2string (ttf_file_name); + string file_name = ly_scm2string (ttf_file_name); if (be_verbose_global) progress_indication ("[" + file_name); @@ -196,7 +196,7 @@ LY_DEFINE (ly_ttf_to_pfa, "ly:ttf->pfa", SCM_ASSERT_TYPE (scm_is_string (ttf_file_name), ttf_file_name, SCM_ARG1, __FUNCTION__, "string"); - std::string file_name = ly_scm2string (ttf_file_name); + string file_name = ly_scm2string (ttf_file_name); if (be_verbose_global) progress_indication ("[" + file_name); diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 7d532f9291..97b1e7c3ec 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -72,7 +72,7 @@ flatten_number_pair_property (Grob *me, Grob * -Tuplet_bracket::parallel_beam (Grob *me_grob, Link_array__Grob_ const &cols, bool *equally_long) +Tuplet_bracket::parallel_beam (Grob *me_grob, vector const &cols, bool *equally_long) { Spanner *me = dynamic_cast (me_grob); @@ -521,7 +521,7 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy) Real x0 = robust_relative_extent (lgr, commonx, X_AXIS)[LEFT]; Real x1 = robust_relative_extent (rgr, commonx, X_AXIS)[RIGHT]; - std::vector points; + vector points; points.push_back (Offset (x0 - x0, staff[dir])); points.push_back (Offset (x1 - x0, staff[dir])); diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc index 2845d4c445..0d0966899c 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -40,8 +40,8 @@ public: TRANSLATOR_DECLARATIONS (Tuplet_engraver); protected: - std::vector tuplets_; - Link_array__Spanner_ last_tuplets_; + vector tuplets_; + vector last_tuplets_; DECLARE_ACKNOWLEDGER (note_column); virtual bool try_music (Music *r); virtual void finalize (); diff --git a/lily/vaticana-ligature-engraver.cc b/lily/vaticana-ligature-engraver.cc index 46078a6ad2..22c42c1cd2 100644 --- a/lily/vaticana-ligature-engraver.cc +++ b/lily/vaticana-ligature-engraver.cc @@ -34,7 +34,7 @@ private: int context_info, int delta_pitch); bool is_stacked_head (int prefix_set, int context_info); - Real align_heads (std::vector primitives, + Real align_heads (vector primitives, Real flexa_width, Real thickness); @@ -44,7 +44,7 @@ public: protected: virtual Spanner *create_ligature_spanner (); virtual void transform_heads (Spanner *ligature, - std::vector primitives); + vector primitives); }; Vaticana_ligature_engraver::Vaticana_ligature_engraver () @@ -145,7 +145,7 @@ Vaticana_ligature_engraver::need_extra_horizontal_space (int prev_prefix_set, in } Real -Vaticana_ligature_engraver::align_heads (std::vector primitives, +Vaticana_ligature_engraver::align_heads (vector primitives, Real flexa_width, Real thickness) { @@ -200,7 +200,7 @@ Vaticana_ligature_engraver::align_heads (std::vector primitives, "ignoring grob"); continue; } - std::string glyph_name = ly_scm2string (glyph_name_scm); + string glyph_name = ly_scm2string (glyph_name_scm); int delta_pitch = 0; if (prev_primitive) /* urgh, need prev_primitive only here */ @@ -343,7 +343,7 @@ check_for_prefix_loss (Item *primitive) = scm_to_int (primitive->get_property ("prefix-set")); if (prefix_set & ~PES_OR_FLEXA) { - std::string prefs = Gregorian_ligature::prefixes_to_str (primitive); + string prefs = Gregorian_ligature::prefixes_to_str (primitive); primitive->warning (_f ("ignored prefix (es) `%s' of this head according " "to restrictions of the selected ligature style", prefs.c_str ())); @@ -352,7 +352,7 @@ check_for_prefix_loss (Item *primitive) void Vaticana_ligature_engraver::transform_heads (Spanner *ligature, - std::vector primitives) + vector primitives) { Real flexa_width = robust_scm2double (ligature->get_property ("flexa-width"), 2); @@ -362,7 +362,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, int prev_prefix_set = 0; int prev_context_info = 0; int prev_delta_pitch = 0; - std::string prev_glyph_name = ""; + string prev_glyph_name = ""; for (vsize i = 0; i < primitives.size (); i++) { Item *primitive = dynamic_cast (primitives[i].grob ()); @@ -397,7 +397,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, * this decision must be made here in the engraver rather than in * the backend). */ - std::string glyph_name; + string glyph_name; if (prefix_set & VIRGA) { glyph_name = "vaticana.punctum"; diff --git a/lily/vaticana-ligature.cc b/lily/vaticana-ligature.cc index 76e3162e41..85e88b51ed 100644 --- a/lily/vaticana-ligature.cc +++ b/lily/vaticana-ligature.cc @@ -197,7 +197,7 @@ vaticana_brew_primitive (Grob *me) return Stencil (); } - std::string glyph_name = ly_scm2string (glyph_name_scm); + string glyph_name = ly_scm2string (glyph_name_scm); Stencil out; Real thickness = robust_scm2double (me->get_property ("thickness"), 1); diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index d6f9ef5486..8b8d04ea0c 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -98,7 +98,7 @@ Vertical_align_engraver::acknowledge_axis_group (Grob_info i) { if (qualifies (i)) { - std::string id = i.context ()->id_string (); + string id = i.context ()->id_string (); scm_hash_set_x (id_to_group_hashtab_, scm_makfrom0str (id.c_str ()), i.grob ()->self_scm ()); @@ -117,7 +117,7 @@ Vertical_align_engraver::acknowledge_axis_group (Grob_info i) if (before_grob || after_grob) { Grob_array *ga = unsmob_grob_array (valign_->get_object ("elements")); - Link_array__Grob_ &arr = ga->array_reference (); + vector &arr = ga->array_reference (); Grob *added = arr.back (); arr.pop_back (); diff --git a/lily/volta-bracket.cc b/lily/volta-bracket.cc index 561f0830f8..03137d1b12 100644 --- a/lily/volta-bracket.cc +++ b/lily/volta-bracket.cc @@ -119,7 +119,7 @@ Volta_bracket_interface::after_line_breaking (SCM smob) Grob *endbar = bars.size () ? bars.back () : 0; SCM glyph = endbar ? endbar->get_property ("glyph") : SCM_EOL; - std::string str; + string str; if (scm_is_string (glyph)) str = ly_scm2string (glyph); else diff --git a/lily/volta-repeat-iterator.cc b/lily/volta-repeat-iterator.cc index 8ff30631ea..31f6295410 100644 --- a/lily/volta-repeat-iterator.cc +++ b/lily/volta-repeat-iterator.cc @@ -84,7 +84,7 @@ Volta_repeat_iterator::next_element (bool side_effect) { if (alt_count_) { - std::string repstr = to_string (rep_count_ - alt_count_ + done_count_) + "."; + string repstr = to_string (rep_count_ - alt_count_ + done_count_) + "."; if (done_count_ > 1) { add_repeat_command (scm_list_n (ly_symbol2scm ("volta"), SCM_BOOL_F, SCM_UNDEFINED)); -- 2.39.2