]> git.donarmstrong.com Git - lilypond.git/commitdiff
* configure.in (--enable-std-vector): New option.
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 31 Jan 2006 00:30:44 +0000 (00:30 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 31 Jan 2006 00:30:44 +0000 (00:30 +0000)
(--enable-std-string): On by default.

* flower/include/std-vector.hh: New file.  Enable switch to
std::vector, update client code.

217 files changed:
ChangeLog
configure.in
flower/file-path.cc
flower/include/array.hh
flower/include/array.icc
flower/include/file-name.hh
flower/include/file-path.hh
flower/include/flower-proto.hh
flower/include/guile-compatibility.hh
flower/include/interval-set.hh
flower/include/parray.hh
flower/include/polynomial.hh
flower/include/pqueue.hh
flower/include/std-string.hh
flower/include/std-vector.hh [new file with mode: 0644]
flower/include/string-convert.hh
flower/interval-set.cc
flower/polynomial.cc
flower/std-string.cc
flower/string-convert.cc
lily/accidental-engraver.cc
lily/accidental-placement.cc
lily/accidental.cc
lily/align-interface.cc
lily/arpeggio.cc
lily/audio-column.cc
lily/audio-element-info.cc
lily/audio-staff.cc
lily/auto-beam-engraver.cc
lily/auto-change-iterator.cc
lily/axis-group-engraver.cc
lily/axis-group-interface-scheme.cc
lily/axis-group-interface.cc
lily/beam-concave.cc
lily/beam-quanting.cc
lily/beam.cc
lily/beaming-info.cc
lily/bezier.cc
lily/box.cc
lily/break-algorithm.cc
lily/break-align-interface.cc
lily/break-substitution.cc
lily/chord-name-engraver.cc
lily/cluster-engraver.cc
lily/cluster.cc
lily/coherent-ligature-engraver.cc
lily/collision-engraver.cc
lily/completion-note-heads-engraver.cc
lily/context-def.cc
lily/context.cc
lily/custos-engraver.cc
lily/dot-column.cc
lily/drum-note-engraver.cc
lily/drum-note-performer.cc
lily/enclosing-bracket.cc
lily/engraver-group.cc
lily/extender-engraver.cc
lily/figured-bass-continuation.cc
lily/figured-bass-engraver.cc
lily/fingering-engraver.cc
lily/font-config.cc
lily/general-scheme.cc
lily/global-context.cc
lily/global-ctor.cc
lily/gourlay-breaking.cc
lily/gregorian-ligature-engraver.cc
lily/grid-line-interface.cc
lily/grid-line-span-engraver.cc
lily/grob-array-scheme.cc
lily/grob-array.cc
lily/grob-info.cc
lily/grob-pq-engraver.cc
lily/grob-scheme.cc
lily/grob.cc
lily/hairpin.cc
lily/hara-kiri-group-spanner.cc
lily/horizontal-bracket-engraver.cc
lily/hyphen-engraver.cc
lily/includable-lexer.cc
lily/include/accidental-interface.hh
lily/include/beam.hh
lily/include/beaming.hh
lily/include/bezier.hh
lily/include/break-algorithm.hh
lily/include/coherent-ligature-engraver.hh
lily/include/column-x-positions.hh
lily/include/engraver-group.hh
lily/include/gourlay-breaking.hh
lily/include/gregorian-ligature-engraver.hh
lily/include/grob-array.hh
lily/include/includable-lexer.hh
lily/include/keyword.hh
lily/include/least-squares.hh
lily/include/ligature-engraver.hh
lily/include/lily-parser.hh
lily/include/lookup.hh
lily/include/main.hh
lily/include/misc.hh
lily/include/music-iterator.hh
lily/include/paper-outputter.hh
lily/include/paper-score.hh
lily/include/performer-group.hh
lily/include/pitch.hh
lily/include/simple-spacer.hh
lily/include/skyline.hh
lily/include/slur-configuration.hh
lily/include/slur-scoring.hh
lily/include/stem.hh
lily/include/system.hh
lily/include/tfm-reader.hh
lily/include/tfm.hh
lily/include/tie-column-format.hh
lily/include/tie-configuration.hh
lily/include/tie-formatting-problem.hh
lily/include/translator-dispatch-list.hh
lily/include/translator-group.hh
lily/include/translator.hh
lily/include/translator.icc
lily/keyword.cc
lily/laissez-vibrer-engraver.cc
lily/laissez-vibrer-tie-column.cc
lily/least-squares.cc
lily/ledger-line-spanner.cc
lily/lexer.ll
lily/ligature-bracket-engraver.cc
lily/ligature-engraver.cc
lily/lily-guile.cc
lily/lily-lexer.cc
lily/lily-parser.cc
lily/lilypond-version.cc
lily/line-interface.cc
lily/lookup.cc
lily/lyric-extender.cc
lily/lyric-performer.cc
lily/main.cc
lily/melody-spanner.cc
lily/mensural-ligature-engraver.cc
lily/midi-walker.cc
lily/misc.cc
lily/multi-measure-rest-engraver.cc
lily/new-fingering-engraver.cc
lily/note-collision.cc
lily/note-column.cc
lily/note-heads-engraver.cc
lily/note-name-engraver.cc
lily/note-performer.cc
lily/note-spacing.cc
lily/ottava-bracket.cc
lily/output-property-engraver.cc
lily/pango-select.cc
lily/paper-book.cc
lily/paper-column-engraver.cc
lily/paper-column.cc
lily/paper-score.cc
lily/performance.cc
lily/performer-group.cc
lily/phrasing-slur-engraver.cc
lily/piano-pedal-bracket.cc
lily/piano-pedal-engraver.cc
lily/piano-pedal-performer.cc
lily/pitched-trill-engraver.cc
lily/pointer-group-interface.cc
lily/program-option.cc
lily/relocate.cc
lily/rest-collision-engraver.cc
lily/rest-collision.cc
lily/rhythmic-column-engraver.cc
lily/score-engraver.cc
lily/score-performer.cc
lily/score-scheme.cc
lily/score.cc
lily/script-column-engraver.cc
lily/script-column.cc
lily/script-engraver.cc
lily/separating-group-spanner.cc
lily/separating-line-group-engraver.cc
lily/separation-item.cc
lily/side-position-interface.cc
lily/simple-spacer-scheme.cc
lily/simple-spacer.cc
lily/skyline.cc
lily/slur-configuration.cc
lily/slur-engraver.cc
lily/slur-scoring.cc
lily/slur.cc
lily/source-file.cc
lily/spacing-determine-loose-columns.cc
lily/spacing-engraver.cc
lily/spacing-loose-columns.cc
lily/spacing-spanner.cc
lily/span-arpeggio-engraver.cc
lily/span-bar-engraver.cc
lily/span-bar.cc
lily/span-dynamic-performer.cc
lily/spanner.cc
lily/staff-spacing.cc
lily/stanza-number-align-engraver.cc
lily/stem.cc
lily/system-start-delimiter-engraver.cc
lily/system-start-delimiter.cc
lily/system.cc
lily/tab-note-heads-engraver.cc
lily/text-engraver.cc
lily/tfm-reader.cc
lily/tfm.cc
lily/tie-column.cc
lily/tie-engraver.cc
lily/tie-formatting-problem.cc
lily/tie-performer.cc
lily/translator-dispatch-list.cc
lily/translator-group.cc
lily/translator.cc
lily/tuplet-bracket.cc
lily/tuplet-engraver.cc
lily/vaticana-ligature-engraver.cc
lily/vertical-align-engraver.cc
lily/volta-bracket.cc

index 5dfd79407ed51fb026a9451b3faf7f00c87c5213..c3e75d3c2c48d4ebae3d11763bff4baf5e95c249 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-01-31  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * configure.in (--enable-std-vector): New option.
+       (--enable-std-string): On by default.
+
+       * flower/include/std-vector.hh: New file.  Enable switch to
+       std::vector, update client code.
+
 2006-01-30  Graham Percival  <gpermus@gmail.com>
 
        * scm/document-translation.scm: clarify "this context is also
index d2818093a7df0f23d94542c1e5335acf6012ed37..e9047ff59c52b96d96baf79231a2baef2df0b7f1 100644 (file)
@@ -33,9 +33,9 @@ AC_ARG_ENABLE(gui,
     [  --enable-gui            compile with experimental GNOME output.  Default: off],
     [gui_b=$enableval])
 
-std_string=no
+std_string=yes
 AC_ARG_ENABLE(std-string,
-    [  --enable-std-string     compile with experimental std::string.  Default: off],
+    [  --enable-std-string     compile with std::string.  Default: on],
     [std_string=$enableval])
 if test "$std_string" = "yes"; then
     # Store in config.make rather than in config.hh and have every
@@ -43,6 +43,16 @@ if test "$std_string" = "yes"; then
     DEFINES="$DEFINES -DSTD_STRING=1"
 fi
 
+std_vector=no
+AC_ARG_ENABLE(std-string,
+    [  --enable-std-vector     compile with experimental std::vector.  Default: off],
+    [std_vector=$enableval])
+if test "$std_vector" = "yes"; then
+    # Store in config.make rather than in config.hh and have every
+    # source file depend on that.
+    DEFINES="$DEFINES -DSTD_VECTOR=1"
+fi
+
 NCSB_DIR=unknown
 AC_ARG_WITH(ncsb-dir,
 [  --with-ncsb-dir=DIR     location of Century Schoolbook fonts
index ff35abfaec25c0a7fb0334ada336ff69e6954fc0..a25128213d7a47af3ed52e101abb379a821a82ff 100644 (file)
@@ -31,7 +31,7 @@ using namespace std;
 #define PATHSEP ':'
 #endif
 
-Array<std::string>
+std::vector<std::string>
 File_path::directories () const
 {
   return dirs_;
@@ -130,7 +130,7 @@ File_path::find (std::string name) const
   if (file_name.dir_[0] == DIRSEP && is_file (file_name.to_string ()))
     return file_name.to_string ();
 
-  for (int i = 0; i < dirs_.size (); i++)
+  for (vsize i = 0; i < dirs_.size (); i++)
     {
       File_name file_name (name);
       File_name dir = (std::string) dirs_[i];
@@ -194,7 +194,7 @@ std::string
 File_path::to_string () const
 {
   std::string s;
-  for (int i = 0; i < dirs_.size (); i++)
+  for (vsize i = 0; i < dirs_.size (); i++)
     {
       s = s + dirs_[i];
       if (i < dirs_.size () - 1)
@@ -206,7 +206,7 @@ File_path::to_string () const
 void
 File_path::append (std::string str)
 {
-  dirs_.push (str);
+  dirs_.push_back (str);
 }
 
 void
index 5b398f28e3ea00ba13c0c9551f79a98cc99689bc..400aeea233122c4f9592348b582983bd6c65c98c 100644 (file)
@@ -6,6 +6,10 @@
 #ifndef ARRAY_H
 #define ARRAY_H
 
+#ifndef STD_VECTOR_HH
+#error array.hh is obsolete, use std-vector.hh
+#endif
+
 #include <cassert>
 using namespace std;
 
@@ -13,6 +17,7 @@ using namespace std;
 #define INLINE inline
 #endif
 
+namespace std {
 /// copy a bare (C-)array from #src# to #dest# sized  #count#
 template<class T> void arrcpy (T *dest, T const *src, int count);
 
@@ -35,13 +40,13 @@ class Array
 {
 protected:
   /// maximum length of array.
-  int max_;
+  vsize max_;
 
   /// the data itself
   T *array_;
 
   /// stretch or shrink  array.
-  void remax (int newmax)
+  void remax (vsize newmax)
   {
     T *newarr = new T[newmax];
     size_ = (newmax < size_) ? newmax : size_;
@@ -51,9 +56,61 @@ protected:
     array_ = newarr;
     max_ = newmax;
   }
-  int size_;
+  vsize size_;
 
 public:
+  /* std::vector interface */
+  Array ()
+  {
+    array_ = 0;
+    max_ = 0;
+    size_ = 0;
+  }
+
+  Array (Array const &src)
+  {
+    array_ = src.copys ();
+    max_ = size_ = src.size_;
+  }
+
+  T const &back () const
+  {
+    return (*this)[size_ - 1];
+  }
+
+  T &back ()
+  {
+    return (*this)[size_ - 1];
+  }
+
+  bool empty () const
+  {
+    return !size_;
+  }
+
+  void pop_back ()
+  {
+    assert (!empty ());
+    resize (size () - 1);
+  }
+
+  vsize size () const
+  {
+    return size_;
+  }
+
+  /** set the size_ to #s#.
+      POST: size () == s.
+      Warning: contents are unspecified */
+  void resize (vsize s)
+  {
+    if (s > max_)
+      remax (s);
+    size_ = s;
+  }
+
+
+
   /// check invariants
   void OK () const;
   /** report the size_.
@@ -61,45 +118,36 @@ public:
       {setsize_}
   */
 
-  int size () const
-  {
-    return size_;
-  }
-
   /// POST: size () == 0
   void clear ()
   {
     size_ = 0;
   }
 
-  Array (T *tp, int n)
+  Array (T *tp, vsize n)
   {
     array_ = new T[n];
     max_ = size_ = n;
     arrcpy (array_, tp, n);
   }
 
-  Array ()
-  { array_ = 0; max_ = 0; size_ = 0; }
-
   // ugh, get around gcc 2.8.1 ice; see bezier.cc
-  Array (int i)
+  Array (vsize i)
   {
     max_ = size_ = i;
     array_ = new T[i];
   }
 
-  /** set the size_ to #s#.
-      POST: size () == s.
-      Warning: contents are unspecified */
-  void set_size (int s)
+  /// tighten array size_.
+  void tighten_maxsize ()
   {
-    if (s > max_) remax (s);
-    size_ = s;
+    remax (size_);
   }
 
   ~Array ()
-  { delete[] array_; }
+  {
+    delete[] array_;
+  }
 
   /// return a  "new"ed copy of array 
   T *copys () const
@@ -115,47 +163,40 @@ public:
   }
   void operator = (Array const &src)
   {
-    set_size (src.size_);
+    resize (src.size_);
     arrcpy (array_, src.array_, size_);
   }
-  Array (Array const &src)
-  {
-    array_ = src.copys ();
-    max_ = size_ = src.size_;
-  }
-
-  /// tighten array size_.
-  void tighten_maxsize ()
-  {
-    remax (size_);
-  }
 
   T *remove_array ();
 
   /// access element
-  T &operator [] (int i)
+  T &operator [] (vsize i)
   {
     return elem_ref (i);
   }
   /// access element
-  T const &operator [] (int i) const
+  T const &operator [] (vsize i) const
   {
     return elem_ref (i);
   }
   /// access element
-  T &elem_ref (int i) const
+  T &elem_ref (vsize i) const
   {
+#if !STD_VECTOR
     assert (i >= 0 && i < size_);
+#else
+    assert (i < size_);
+#endif
     return ((T *)array_)[i];
   }
   /// access element
-  T elem (int i) const
+  T elem (vsize i) const
   {
     return elem_ref (i);
   }
 
   /// add to the end of array
-  void push (T x)
+  void push_back (T x)
   {
     if (size_ == max_)
       remax (2 * max_ + 1);
@@ -164,26 +205,29 @@ public:
     // vars
     array_[size_++] = x;
   }
+#if 0
   /// remove and return last entry 
   T pop ()
   {
-    assert (!is_empty ());
+    assert (!empty ());
     T l = top (0);
-    set_size (size () - 1);
+    resize (size () - 1);
     return l;
   }
+#endif
+
   /// access last entry
-  T &top (int j = 0)
+  T &top (vsize j)
   {
     return (*this)[size_ - j - 1];
   }
   /// return last entry
-  T top (int j = 0) const
+  T top (vsize j) const
   {
     return (*this)[size_ - j - 1];
   }
 
-  T &boundary (int dir, int idx)
+  T &boundary (int dir, vsize idx)
   {
     assert (dir);
     if (dir == 1)
@@ -191,7 +235,7 @@ public:
     else
       return elem_ref (idx);
   }
-  T boundary (int dir, int idx) const
+  T boundary (int dir, vsize idx) const
   {
     assert (dir);
     if (dir == 1)
@@ -199,46 +243,48 @@ public:
     else
       return elem (idx);
   }
-  void swap (int i, int j)
+  void swap (vsize i, vsize j)
   {
     T t ((*this)[i]);
     (*this)[i] = (*this)[j];
     (*this)[j] = t;
   }
-  bool is_empty () const
-  { return !size_; }
 
-  void insert (T k, int j);
+  void insert (T k, vsize j);
   /**
      remove  i-th element, and return it.
   */
-  T get (int i)
+  T get (vsize i)
   {
     T t = elem (i);
     del (i);
     return t;
   }
-  void unordered_del (int i)
+  void unordered_del (vsize i)
   {
-    elem_ref (i) = top ();
-    set_size (size () -1);
+    elem_ref (i) = back ();
+    resize (size () -1);
   }
-  void del (int i)
+  void del (vsize i)
   {
-    assert (i >= 0&& i < size_);
+#if !STD_VECTOR
+    assert (i >= 0 && i < size_);
+#else
+    assert (i < size_);
+#endif
     arrcpy (array_ + i, array_ + i + 1, size_ - i - 1);
     size_--;
   }
   // quicksort.
   void sort (int (*compare) (T const &, T const &),
-            int lower = -1, int upper = -1);
+            vsize lower=VPOS, vsize upper=VPOS);
   void concat (Array<T> const &src)
   {
-    int s = size_;
-    set_size (size_ + src.size_);
+    vsize s = size_;
+    resize (size_ + src.size_);
     arrcpy (array_ + s, src.array_, src.size_);
   }
-  Array<T> slice (int lower, int upper) const;
+  Array<T> slice (vsize lower, vsize upper) const;
   void reverse ();
 };
 
@@ -255,4 +301,6 @@ int default_compare (T const &a, T const &b)
 
 #include "array.icc"
 
+}
+
 #endif
index e8c201466f1283a199c1feeac68cb78e4c8c31b5..3b6c27945c1ae65fef1abe3f2ae321e7c4471a71 100644 (file)
@@ -5,7 +5,7 @@
 */
 
 #if 0
-#include "array.hh"
+#include "std-vector.hh"
 #ifdef INLINE
 #undef INLINE
 #endif
@@ -18,9 +18,9 @@
 */
 
 template<class T> INLINE void
-arrcpy (T *dest, T const *src, int count)
+arrcpy (T *dest, T const *src, vsize count)
 {
-  for (int i_shadows_local = 0; i_shadows_local < count; i_shadows_local++)
+  for (vsize i_shadows_local = 0; i_shadows_local < count; i_shadows_local++)
 #ifdef __powerpc__
     {
       /*
@@ -38,17 +38,21 @@ arrcpy (T *dest, T const *src, int count)
 }
 
 template<class T> INLINE void
-Array<T>::insert (T k, int j)
+Array<T>::insert (T k, vsize j)
 {
-  assert (j >= 0 && j <= size_);
-  set_size (size_ + 1);
-  for (int i = size_ - 1; i > j; i--)
+#if !STD_VECTOR
+    assert (j >= 0 && j <= size_);
+#else
+    assert (j <= size_);
+#endif
+  resize (size_ + 1);
+  for (vsize i = size_ - 1; i > j; i--)
     array_[i] = array_[i - 1];
   array_[j] = k;
 }
 
 template<class T> INLINE void
-Array<T>::sort (int (*compare) (T const &, T const &), int lower, int upper)
+Array<T>::sort (int (*compare) (T const &, T const &), vsize lower, vsize upper)
 {
   if (lower < 0)
     {
@@ -58,8 +62,8 @@ Array<T>::sort (int (*compare) (T const &, T const &), int lower, int upper)
   if (lower >= upper)
     return;
   swap (lower, (lower + upper) / 2);
-  int last = lower;
-  for (int i = lower +1; i <= upper; i++)
+  vsize last = lower;
+  for (vsize i = lower +1; i <= upper; i++)
     if (compare (array_[i], array_[lower]) < 0)
       swap (++last, i);
   swap (lower, last);
@@ -70,8 +74,8 @@ Array<T>::sort (int (*compare) (T const &, T const &), int lower, int upper)
 template<class T> INLINE void
 Array<T>::reverse ()
 {
-  int h = size_ / 2;
-  for (int i = 0, j = size_ - 1; i < h; i++, j--)
+  vsize h = size_ / 2;
+  for (vsize i = 0, j = size_ - 1; i < h; i++, j--)
     swap (i, j);
 }
 
@@ -79,7 +83,11 @@ template<class T> INLINE
 void
 Array<T>::OK () const
 {
+#if !STD_VECTOR
   assert (max_ >= size_ && size_ >= 0);
+#else
+  assert (max_ >= size_);
+#endif
   if (max_)
     assert (array_);
 }
@@ -97,12 +105,16 @@ Array<T>::remove_array ()
 
 template<class T> INLINE
 Array<T>
-Array<T>::slice (int lower, int upper) const
+Array<T>::slice (vsize lower, vsize upper) const
 {
+#if !STD_VECTOR
   assert (lower >= 0 && lower <= upper && upper <= size_);
+#else
+  assert (lower <= upper && upper <= size_);
+#endif
   Array<T> r;
-  int s = upper - lower;
-  r.set_size (s);
+  vsize s = upper - lower;
+  r.resize (s);
   arrcpy (r.array_, array_ + lower, s);
   return r;
 }
@@ -111,8 +123,8 @@ template<class T>
 void
 binary_search_bounds (Array<T> const &table,
                      T const &key, int (*compare) (T const &, T const &),
-                     int *lo,
-                     int *hi)
+                     vsize *lo,
+                     vsize *hi)
 {
   int cmp;
   int result;
@@ -136,19 +148,20 @@ binary_search_bounds (Array<T> const &table,
   lookup with binsearch, return array index.
 */
 template<class T>
-int
+vsize
 binary_search (Array<T> const &table,
               T const &key, int (*compare) (T const &, T const &),
-              int lo = 0,
-              int hi = -1)
+              vsize lo=0,
+              vsize hi=VPOS)
 {
-  if (hi < 0)
+  if (hi == VPOS)
     hi = table.size ();
 
   binary_search_bounds (table, key, compare, &lo, &hi);
 
   if (! (*compare) (key, table[lo]))
     return lo;
-  else
-    return -1;              /* not found */
+
+  /* not found */
+  return VPOS;
 }
index 329a972c9f69b8d5043d740db6359c9a5f09061c..3d3a442f541c3c1bd08e0625466aa47d654b5c52 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef FILE_NAME_HH
 #define FILE_NAME_HH
 
-#include "array.hh"
+#include "std-vector.hh"
 #include "std-string.hh"
 
 class File_name
index 22b943e9c89ac85576f1f91240f020cb1739cf14..9379eda5ad816e4b4658e0b306f0568a4eaad6c2 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef FILE_PATH_HH
 #define FILE_PATH_HH
 
-#include "array.hh"
+#include "std-vector.hh"
 #include "std-string.hh"
 
 /**
 
 class File_path
 {
-  Array<std::string> dirs_;
+  std::vector<std::string> dirs_;
+
 public:
-  Array<std::string> directories () const;
+  std::vector<std::string> directories () const;
   std::string find (std::string name) const;
   std::string find (std::string name, char const *extensions[]);
   std::string to_string () const;
index f175eebb1ae9ba753b36c84120416ad8b973696a..66bd2648c17f85e8a4f1c5e63cb6ce0a8b3e7484 100644 (file)
 
 char const *flower_version_str0 ();
 
-template<class T> struct Link_array;
-template<class T> struct Array;
 template<class T, class K> struct Assoc;
 template<class K, class V> struct Hash_table;
 template<class K, class V> struct Hash_table_iter;
-template<class T> struct Link_list;
-template<class T> struct Interval_t;
-template<class T> struct PQueue;
 
 typedef unsigned char Byte;
 namespace std {
   struct String_data;
   struct String_handle;
-  //struct String;
 }
 struct String_convert;
 
 #include "std-string.hh"
+#include "std-vector.hh"
 #include "real.hh"
 
+//template<class T> struct Array;
+template<class T> struct Link_array;
+template<class T> struct Link_list;
+template<class T> struct Interval_t;
+template<class T> struct PQueue;
+
+
 typedef Interval_t<Real> Interval;
 
 struct Offset;
index c256ddfc31ecf94910ff759fdcd081a34dfcfd60..3b27b579ec49d95a533594da9369f9c0e805e880 100644 (file)
@@ -52,6 +52,8 @@ inline int ly_c_number_p (SCM x) { return SCM_NUMBERP (x); }
 #define scm_is_number(x) (scm_number_p (x) == SCM_BOOL_T)
 inline int ly_scm2int (SCM x) { return scm_num2int (x, 0, "ly_scm2int"); }
 #define scm_to_int(x) (ly_scm2int (x))
+inline int ly_scm2unsigned (SCM x) { return scm_num2uint (x, 0, "ly_scm2unsigned"); }
+#define scm_to_unsigned(x) (ly_scm2unsigned (x))
 inline int ly_c_symbol_p (SCM x) { return SCM_SYMBOLP (x); }
 #define scm_is_symbol(x) ly_c_symbol_p (x)
 inline int ly_c_boolean_p (SCM x) { return SCM_BOOLP (x); }
@@ -69,6 +71,11 @@ inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); }
 #define scm_to_double(x) (ly_scm2double (x))
 #define scm_from_double(x) (scm_make_real (x))
 
-#endif /* SCM_MINOR_VERSION < 7 */
+#else /* !SCM_MINOR_VERSION < 7 */
+
+#define scm_to_unsigned(x) scm_to_uint32 (x)
+#define scm_from_unsigned(x) scm_from_unsigned_integer (x)
+
+#endif /* !SCM_MINOR_VERSION < 7 */
 
 #endif /* GUILE_COMPATIBILITY_HH */
index 4c0ba0ac6a39d949d0da35d38a20a2c8bfb64e75..6a6ad9e3cb62e4fdba11331443e4b78d81e7fc5e 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef INTERVAL_SET_HH
 #define INTERVAL_SET_HH
 
-#include "array.hh"
+#include "std-vector.hh"
 #include "interval.hh"
 
 /*
@@ -21,7 +21,7 @@
 */
 struct Interval_set
 {
-  Array<Interval> allowed_regions_;
+  std::vector<Interval> allowed_regions_;
 
   Interval_set ();
   void set_full ();
index d7a4afba00005cecbe63a41bc8b563e0dad52b7f..4378dda8b8e39295b3c0134899f4e1a0663e6859 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef PARRAY_HH
 #define PARRAY_HH
 
-#include "array.hh"
+#include "std-vector.hh"
 
 /**
    an array of pointers.
@@ -25,9 +25,32 @@ class Link_array : private Array<void *>
     :Array<void *> (v)
   {
   }
+
 public:
   Link_array ()
-  {}
+  {
+  }
+
+  T *const &back() const
+  {
+    return (T * const &) Array<void *>::back();
+  }
+
+  T *&back ()
+  {
+    return (T *&) Array<void *>::back ();
+  }
+
+  /* Flower compat */
+  Array<void *>::del;
+  Array<void *>::unordered_del;
+  Array<void *>::size;
+  Array<void *>::clear;
+  Array<void *>::resize;
+  Array<void *>::empty;
+  Array<void *>::reverse;
+  Array<void *>::pop_back;
+  Array<void *>::tighten_maxsize;
 
   static int default_compare (T *const &p1, T *const &p2)
   {
@@ -69,25 +92,29 @@ public:
   }
   T *pop ()
   {
-    return (T *) Array<void *>::pop ();
+    T* t = (T *) Array<void *>::back ();
+    pop_back ();
+    return t;
   }
-  void insert (T *t, int i)
+  void insert (T *t, vsize i)
   {
     Array<void *>::insert (t, i);
   }
-  void push (T *t)
+  void push_back (T *t)
   {
-    Array<void *>::push (t);
+    Array<void *>::push_back (t);
   }
+
   /// return last entry
-  T *top (int j = 0) const
+  T *top (int j) const
   {
     return (T *) Array<void *>::top (j);
   }
-  T *& top (int i = 0)
+  T *& top (int i)
   {
     return (T *&) Array<void *>::top (i);
   }
+
   void substitute (T *old, T *new_p)
   {
     int i;
@@ -117,19 +144,11 @@ public:
   void uniq ()
   {
     Link_array<T> ls;
-    for (int i = 0; i < size (); i++)
+    for (vsize i = 0; i < size (); i++)
       if (!i || elem (i - 1) != elem (i))
-       ls.push (elem (i));
+       ls.push_back (elem (i));
     *this = ls;
   }
-  Array<void *>::del;
-  Array<void *>::unordered_del;
-  Array<void *>::size;
-  Array<void *>::clear;
-  Array<void *>::set_size;
-  Array<void *>::is_empty;
-  Array<void *>::reverse;
-  Array<void *>::tighten_maxsize;
 
   T *& boundary (int d, int i)
   {
@@ -167,7 +186,7 @@ public:
   }
   int find_index (T const *t) const
   {
-    for (int i = 0; i < size (); i++)
+    for (vsize i = 0; i < size (); i++)
       if (elem (i) == t)
        return i;
     return -1;
@@ -187,8 +206,8 @@ Link_array<T>
 typecasts (Link_array<V> const &a, T * /* dummy */)
 {
   Link_array<T> ret;
-  for (int i = a.size (); i--;)
-    ret.push (dynamic_cast<T *> (a[i]));       // ugh?
+  for (vsize i = a.size (); i--;)
+    ret.push_back (dynamic_cast<T *> (a[i]));  // ugh?
   return ret;
 }
 
@@ -216,7 +235,7 @@ template<class T>
 void
 junk_pointers (Link_array<T> &a)
 {
-  for (int i = 0; i < a.size (); i++)
+  for (vsize i = 0; i < a.size (); i++)
     delete a[i];
   a.clear ();
 }
index 6c509fa53a09ad251d1099f0db5e36b9f98345f0..c3bbc17d6c24cfd8b48707f4e871c6bea9111d2a 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef POLY_H
 #define POLY_H
 
-#include "array.hh"
+#include "std-vector.hh"
 #include "arithmetic-operator.hh"
 #include "real.hh"
 
@@ -19,7 +19,7 @@ struct Polynomial
   int degree ()const;
 
   /// coefficients 
-  Array<Real> coefs_;
+  std::vector<Real> coefs_;
 
   // leading coef
   Real &lc ();
@@ -28,8 +28,8 @@ struct Polynomial
   Real lc () const;
   void print () const;
   Real eval (Real) const;
-  void print_sols (Array<Real>) const;
-  void check_sols (Array<Real>) const;
+  void print_sols (std::vector<Real>) const;
+  void check_sols (std::vector<Real>) 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 ();
 
-  Array<Real> solve_quadric ()const;
-  Array<Real> solve_cubic ()const;
-  Array<Real> solve_linear ()const;
+  std::vector<Real> solve_quadric ()const;
+  std::vector<Real> solve_cubic ()const;
+  std::vector<Real> solve_linear ()const;
 
-  Array<Real> solve () const;
+  std::vector<Real> solve () const;
 };
 
 IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, -);
index a50caefaaf65b7a1e370ddd4a4042216987c04bb..2f1896f42a38bb8582d5387301287a8db3a64c6c 100644 (file)
@@ -8,7 +8,7 @@
 
 #ifndef PQUEUE_HH
 #define PQUEUE_HH
-#include "array.hh"
+#include "std-vector.hh"
 
 template<class K, class T>
 struct PQueue_ent
@@ -35,11 +35,11 @@ template<class T>
 class PQueue
 {
   Array<T> heap_array_;
-  T &elt (int i)
+  T &elt (vsize i)
   {
     return heap_array_[i - 1];
   }
-  T const &elt (int i) const
+  T const &elt (vsize i) const
   {
     return heap_array_[i - 1];
   }
@@ -48,22 +48,34 @@ public:
       priority might fuck up the invariants
 
       @param 1 <= i < size () */
-  T &operator [] (int i) { return heap_array_[i]; }
-  T operator [] (int i) const { return heap_array_[i]; }
+  T &operator [] (vsize i)
+  {
+    return heap_array_[i];
+  }
+  T operator [] (vsize i) const
+  {
+    return heap_array_[i];
+  }
   void OK () const
   {
 #ifndef NDEBUG
-    for (int i = 2; i <= size (); i++)
+    for (vsize i = 2; i <= size (); i++)
       assert (compare (elt (i / 2), elt (i)) <= 0);
 #endif
   }
-  T front () const { return elt (1); }
-  int size () const { return heap_array_.size (); }
+  T front () const
+  {
+    return elt (1);
+  }
+  vsize size () const
+  {
+    return heap_array_.size ();
+  }
   void insert (T v)
   {
-    heap_array_.push (v);
-    int i = heap_array_.size ();
-    int j = i / 2;
+    heap_array_.push_back (v);
+    vsize i = heap_array_.size ();
+    vsize j = i / 2;
     while (j)
       {
        if (compare (elt (j), v) > 0)
@@ -87,10 +99,10 @@ public:
   void delmin ()
   {
     assert (size ());
-    T last = heap_array_.top ();
+    T last = heap_array_.back ();
 
-    int mini = 2;
-    int lasti = 1;
+    vsize mini = 2;
+    vsize lasti = 1;
 
     while (mini < size ())
       {
@@ -103,7 +115,7 @@ public:
        mini *= 2;
       }
     elt (lasti) = last;
-    heap_array_.pop ();
+    heap_array_.pop_back ();
     OK ();
   }
   T get ()
index c07ffdfac181c69552f27a32d542924e6d7fa898..53b02c2cca5cfce6ea9c30b9aab11ce143b612ae 100644 (file)
@@ -56,7 +56,8 @@ namespace std {
   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 b);
+  string to_string (long);
+  string to_string (unsigned);
   string to_string (bool b);
   string to_string (char const *format, ...);
   
diff --git a/flower/include/std-vector.hh b/flower/include/std-vector.hh
new file mode 100644 (file)
index 0000000..8fda47c
--- /dev/null
@@ -0,0 +1,293 @@
+/*
+  std-vector.hh -- declare std::vector
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2006 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#ifndef STD_VECTOR_HH
+#define STD_VECTOR_HH
+
+#include <algorithm> // reverse, sort
+
+#if !STD_VECTOR
+/* Also declare vector, in the wrong way.  */
+#include <algorithm>
+#include <iostream>
+#include <sstream>
+#endif
+
+
+#include "compare.hh"
+
+#if STD_VECTOR
+
+#define vector __vector
+#include <vector>
+#undef vector
+
+namespace std {
+
+  #ifndef VSIZE
+  #define VSIZE
+  typedef size_t vsize;
+  #define VPOS UINT_MAX
+  #endif
+
+  /* Interface without pointer arithmetic (iterator) semantics.  */
+  template<typename T>
+  class vector : public __vector<T>
+  {
+  public:
+    typedef typename __vector<T>::iterator iterator;
+    //typedef int (*compare) (T *const&, T *const&);
+
+    vector<T> () : __vector<T> ()
+    {
+    }
+
+    vector<T> (iterator const b, iterator const e) : __vector<T> (b, e)
+    {
+    }
+
+    vector<T> (vsize b, vsize e) : __vector<T> (iter (b), iter (e))
+    {
+    }
+
+    iterator iter (vsize n)
+    {
+      if (n == VPOS)
+       return this->end ();
+      return __vector<T>::begin () + n;
+    }
+
+    iterator const iter (vsize n) const
+    {
+      if (n == VPOS)
+       return this->end ();
+      return __vector<T>::begin () + n;
+    }
+
+    void
+    insert (T k, vsize i)
+    {
+      __vector<T>::insert (this->iter (i), k);
+    }
+
+    void
+    insert (vector<T> &v, vsize i)
+    {
+      __vector<T>::insert (iter (i), v.begin (), v.end ());
+    }
+
+    void
+    concat (vector<T> const &v)
+    {
+      __vector<T>::insert (this->end (), v.begin (), v.end ());
+    }
+
+    /* Flower-Array compatibility.  */
+    T const &
+    boundary (int dir, vsize i) const
+    {
+      assert (dir);
+      if (dir == 1)
+       return this->top (i);
+      else
+       return this->at (i);
+    }
+
+    T &
+    boundary (int dir, vsize i)
+    {
+      assert (dir);
+      if (dir == 1)
+       return this->top (i);
+      else
+       return this->at (i);
+    }
+
+    T
+    del (vsize i)
+    {
+      return *__vector<T>::erase (iter (i));
+    }
+
+    T const &
+    elem (vsize i) const
+    {
+      return this->at (i);
+    }
+
+    T &
+    elem (vsize i)
+    {
+      return this->at (i);
+    }
+
+#if 1 // FIXME, silly, but keep for s/r
+    T const &
+    elem_ref (vsize i) const
+    {
+      return elem (i);
+    }
+
+    T &
+    elem_ref (vsize i)
+    {
+      return elem (i);
+    }
+#endif
+
+#if 0
+    T *
+    remove_array ()
+    {
+      // FIXME, no algorithm for this?
+      T *p = new T[this->size ()];
+      for (vsize i = 0; i < this->size (); i++)
+       p[i] = (*this)[i];
+      this->clear ();
+      return p;
+    }
+#else
+    T *
+    remove_array ()
+    {
+      T *p = &(*this)[0];
+      // forget array?
+      //this->resize (0);
+      return p;
+    }
+#endif
+
+    void
+    reverse ()
+    {
+      // CHECKME: for a simple vector, like vector<int>, this should
+      // expand to memrev.
+      ::std::reverse (this->begin (), this->end ());
+    }
+
+    vector<T>
+    slice (vsize b, vsize e) const
+    {
+      return vector<T> (b, e);
+    }
+
+    void
+    sort (int vsize=VPOS, vsize b=VPOS, vsize e=VPOS)
+    {
+      ::std::sort (iter (b), iter(e));
+    }
+
+    void
+    sort (int (*compare) (T const &, T const &), int b=-1, int e=-1)
+    {
+      ::std::sort (iter (b), iter(e), compare);
+    }
+
+    void swap (vsize i, vsize j)
+    {
+      T t ((*this)[i]);
+      (*this)[i] = (*this)[j];
+      (*this)[j] = t;
+    }
+
+    T const &
+    top (vsize i) const
+    {
+      return (*this)[this->size () - i - 1];
+    }
+
+    T&
+    top (vsize i)
+    {
+      return (*this)[this->size () - i - 1];
+    }
+  };
+  
+#if 0
+  template<typename T>
+  vsize
+  //  binary_search (std::vector<T> const &v,
+  binary_search (vector<T> const &v,
+                T const &key, int (*compare) (T const &, T const &),
+                vsize b=0, vsize e=VPOS)
+  {
+    //(void) compare;
+    vector<T>::iterator const i = find (v.iter (b), v.iter (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<class T>
+  void
+  binary_search_bounds (vector<T> const &table,
+                       T const &key, int (*compare) (T const &, T const &),
+                       vsize *lo,
+                       vsize *hi)
+  {
+    int cmp;
+    int result;
+
+    /* binary search */
+    do
+      {
+       cmp = (*lo + *hi) / 2;
+
+       result = (*compare) (key, table[cmp]);
+
+       if (result < 0)
+         *hi = cmp;
+       else
+         *lo = cmp;
+      }
+    while (*hi - *lo > 1);
+  }
+
+  template<class T>
+  vsize
+  binary_search (vector<T> const &table,
+                T const &key, int (*compare) (T const &, T const &),
+                vsize lo=0,
+                vsize hi=VPOS)
+  {
+    if (hi == VPOS)
+      hi = table.size ();
+
+    binary_search_bounds (table, key, compare, &lo, &hi);
+
+    if (! (*compare) (key, table[lo]))
+      return lo;
+
+    /* not found */
+    return VPOS;
+  }
+#endif
+}
+
+
+
+#else /* ! STD_VECTOR */
+
+namespace std {
+
+#define vector Array
+  using namespace std;
+
+  #ifndef VSIZE
+  #define VSIZE
+  typedef int vsize;
+  #define VPOS -1
+  #endif
+}
+
+
+#endif /* STD_VECTOR */
+
+#include "array.hh"
+
+#endif /* STD_VECTOR_HH */
index 198e365b964c950df4daf815f5229cd4a27964d0..c7ba97026651ad0e2d890a58fd262cdc1c84e199 100644 (file)
@@ -37,6 +37,7 @@ public:
   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);
@@ -44,7 +45,7 @@ public:
   static std::string rational_string (Rational);
   static std::string pointer_string (void const *);
   static std::string precision_string (double x, int n);
-  static Array<std::string> split (std::string str, char c);
+  static std::vector<std::string> 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);
index 89e518883085e1bf7051cba084a0f654f8035e00..7c8bd0e6a1ac8df18747358c87b15423bb4830b3 100644 (file)
@@ -27,13 +27,13 @@ Interval_set::set_full ()
   allowed_regions_.clear ();
   Interval s;
   s.set_full ();
-  allowed_regions_.push (s);
+  allowed_regions_.push_back (s);
 }
 
 void
 Interval_set::remove_interval (Interval rm)
 {
-  for (int i = 0; i < allowed_regions_.size ();)
+  for (vsize i = 0; i < allowed_regions_.size ();)
     {
       Interval s = rm;
 
index d9b4cf16908332b7e120fc4539a0cad8bf6c93fe..4d9687de38a3acdfe359f569b4a34a3cfeb5c7c4 100644 (file)
@@ -22,7 +22,7 @@ Polynomial::eval (Real x) const
   Real p = 0.0;
 
   // horner's scheme
-  for (int i = coefs_.size (); i--;)
+  for (vsize i = coefs_.size (); i--;)
     p = x * p + coefs_[i];
 
   return p;
@@ -36,10 +36,10 @@ Polynomial::multiply (const Polynomial &p1, const Polynomial &p2)
   int deg = p1.degree () + p2.degree ();
   for (int i = 0; i <= deg; i++)
     {
-      dest.coefs_.push (0);
+      dest.coefs_.push_back (0);
       for (int j = 0; j <= i; j++)
        if (i - j <= p2.degree () && j <= p1.degree ())
-         dest.coefs_.top () += p1.coefs_[j] * p2.coefs_[i - j];
+         dest.coefs_.back () += p1.coefs_[j] * p2.coefs_[i - j];
     }
 
   return dest;
@@ -50,7 +50,7 @@ Polynomial::differentiate ()
 {
   for (int i = 1; i <= degree (); i++)
     coefs_[i - 1] = coefs_[i] * i;
-  coefs_.pop ();
+  coefs_.pop_back ();
 }
 
 Polynomial
@@ -88,16 +88,16 @@ Polynomial::clean ()
     We only do relative comparisons. Absolute comparisons break down in
     degenerate cases.  */
   while (degree () > 0
-        && (fabs (coefs_.top ()) < FUDGE * fabs (coefs_.top (1))
-            || !coefs_.top ()))
-    coefs_.pop ();
+        && (fabs (coefs_.back ()) < FUDGE * fabs (coefs_.top (1))
+            || !coefs_.back ()))
+    coefs_.pop_back ();
 }
 
 void
 Polynomial::operator += (Polynomial const &p)
 {
   while (degree () < p.degree ())
-    coefs_.push (0.0);
+    coefs_.push_back (0.0);
 
   for (int i = 0; i <= p.degree (); i++)
     coefs_[i] += p.coefs_[i];
@@ -107,7 +107,7 @@ void
 Polynomial::operator -= (Polynomial const &p)
 {
   while (degree () < p.degree ())
-    coefs_.push (0.0);
+    coefs_.push_back (0.0);
 
   for (int i = 0; i <= p.degree (); i++)
     coefs_[i] -= p.coefs_[i];
@@ -154,7 +154,7 @@ Polynomial::set_mod (const Polynomial &u, const Polynomial &v)
   while (k >= 0 && coefs_[k] == 0.0)
     k--;
 
-  coefs_.set_size (1+ ((k < 0) ? 0 : k));
+  coefs_.resize (1+ ((k < 0) ? 0 : k));
   return degree ();
 }
 
@@ -174,17 +174,17 @@ Polynomial::check_sol (Real x) const
 }
 
 void
-Polynomial::check_sols (Array<Real> roots) const
+Polynomial::check_sols (std::vector<Real> roots) const
 {
-  for (int i = 0; i < roots.size (); i++)
+  for (vsize i = 0; i < roots.size (); i++)
     check_sol (roots[i]);
 }
 
 Polynomial::Polynomial (Real a, Real b)
 {
-  coefs_.push (a);
+  coefs_.push_back (a);
   if (b)
-    coefs_.push (b);
+    coefs_.push_back (b);
 }
 
 /* cubic root. */
@@ -203,10 +203,10 @@ iszero (Real r)
   return !r;
 }
 
-Array<Real>
+std::vector<Real>
 Polynomial::solve_cubic ()const
 {
-  Array<Real> sol;
+  std::vector<Real> sol;
 
   /* normal form: x^3 + Ax^2 + Bx + C = 0 */
   Real A = coefs_[2] / coefs_[3];
@@ -229,15 +229,15 @@ Polynomial::solve_cubic ()const
   if (iszero (D))
     {
       if (iszero (q)) {        /* one triple solution */
-       sol.push (0);
-       sol.push (0);
-       sol.push (0);
+       sol.push_back (0);
+       sol.push_back (0);
+       sol.push_back (0);
       }
       else {           /* one single and one double solution */
        Real u = cubic_root (-q);
 
-       sol.push (2 * u);
-       sol.push (-u);
+       sol.push_back (2 * u);
+       sol.push_back (-u);
       }
     }
   else if (D < 0)
@@ -246,9 +246,9 @@ Polynomial::solve_cubic ()const
       Real phi = 1.0 / 3 * acos (-q / sqrt (-cb));
       Real t = 2 * sqrt (-p);
 
-      sol.push (t * cos (phi));
-      sol.push (-t * cos (phi + M_PI / 3));
-      sol.push (-t * cos (phi - M_PI / 3));
+      sol.push_back (t * cos (phi));
+      sol.push_back (-t * cos (phi + M_PI / 3));
+      sol.push_back (-t * cos (phi - M_PI / 3));
     }
   else
     {
@@ -257,13 +257,13 @@ Polynomial::solve_cubic ()const
       Real u = cubic_root (sqrt_D - q);
       Real v = -cubic_root (sqrt_D + q);
 
-      sol.push (u + v);
+      sol.push_back (u + v);
     }
 
   /* resubstitute */
   Real sub = 1.0 / 3 * A;
 
-  for (int i = sol.size (); i--;)
+  for (vsize i = sol.size (); i--;)
     {
       sol[i] -= sub;
 
@@ -278,13 +278,13 @@ Polynomial::solve_cubic ()const
 Real
 Polynomial::lc () const
 {
-  return coefs_.top ();
+  return coefs_.back ();
 }
 
 Real &
 Polynomial::lc ()
 {
-  return coefs_.top ();
+  return coefs_.back ();
 }
 
 int
@@ -295,10 +295,10 @@ Polynomial::degree ()const
 /*
   all roots of quadratic eqn.
 */
-Array<Real>
+std::vector<Real>
 Polynomial::solve_quadric ()const
 {
-  Array<Real> sol;
+  std::vector<Real> sol;
   /* normal form: x^2 + px + q = 0 */
   Real p = coefs_[1] / (2 * coefs_[2]);
   Real q = coefs_[0] / coefs_[2];
@@ -309,23 +309,23 @@ Polynomial::solve_quadric ()const
     {
       D = sqrt (D);
 
-      sol.push (D - p);
-      sol.push (-D - p);
+      sol.push_back (D - p);
+      sol.push_back (-D - p);
     }
   return sol;
 }
 
 /* solve linear equation */
-Array<Real>
+std::vector<Real>
 Polynomial::solve_linear ()const
 {
-  Array<Real> s;
+  std::vector<Real> s;
   if (coefs_[1])
-    s.push (-coefs_[0] / coefs_[1]);
+    s.push_back (-coefs_[0] / coefs_[1]);
   return s;
 }
 
-Array<Real>
+std::vector<Real>
 Polynomial::solve () const
 {
   Polynomial *me = (Polynomial *) this;
@@ -340,7 +340,7 @@ Polynomial::solve () const
     case 3:
       return solve_cubic ();
     }
-  Array<Real> s;
+  std::vector<Real> s;
   return s;
 }
 
index 4644ae3e9267de08f7cfcf12533d27c1a8831957..9eea7ca9411f570d66de50ce9ebb84b6869bdb09 100644 (file)
@@ -47,6 +47,12 @@ namespace std {
     return String_convert::long_string (b);
   }
 
+  std::string
+  to_string (unsigned u)
+  {
+    return String_convert::unsigned_string (u);
+  }
+
   std::string
   to_string (char const *format, ...)
   {
index 140c77632deb526a681c3e22556e7977cbfbfa79..07aef9f3f41d1c9cdc37678117a42c2902e2dfdd 100644 (file)
@@ -12,7 +12,7 @@ using namespace std;
 
 #include "libc-extension.hh"
 #include "rational.hh"
-#include "array.hh"
+#include "std-vector.hh"
 
 /**
    A safe length for stringconversion buffers.
@@ -318,22 +318,22 @@ String_convert::precision_string (double x, int n)
   return (sign (x) > 0 ? str : "-" + str);
 }
 
-Array<std::string>
+std::vector<std::string>
 String_convert::split (std::string str, char c)
 {
-  Array<std::string> a;
+  std::vector<std::string> a;
   ssize i = str.find (c);
   while (i != NPOS)
     {
       std::string s = str.substr (0, i);
-      a.push (s);
+      a.push_back (s);
       while (str[++i] == c)
        ;
       str = str.substr (i);
       i = str.find (c);
     }
   if (str.length ())
-    a.push (str);
+    a.push_back (str);
   return a;
 }
 
@@ -345,6 +345,14 @@ String_convert::long_string (long l)
   return s;
 }
 
+std::string
+String_convert::unsigned_string (unsigned u)
+{
+  char s[STRING_BUFFER_LEN];
+  sprintf (s, "%ud", u);
+  return s;
+}
+
 std::string
 String_convert::pad_to (std::string s, int n)
 {
index 7d97b65d269598fb29b51e91616ef9472516c4ef..2a3af602c12273c2b2dca0d93ad4070fb5d31970 100644 (file)
@@ -82,7 +82,7 @@ public:
 
   Grob *accidental_placement_;
 
-  Array<Accidental_entry> accidentals_;
+  std::vector<Accidental_entry> accidentals_;
   Link_array<Spanner> ties_;
 };
 
@@ -304,13 +304,13 @@ Accidental_engraver::get_bar_number ()
 void
 Accidental_engraver::process_acknowledged ()
 {
-  if (accidentals_.size () && !accidentals_.top ().done_)
+  if (accidentals_.size () && !accidentals_.back ().done_)
     {
       SCM accidentals = get_property ("autoAccidentals");
       SCM cautionaries = get_property ("autoCautionaries");
       int barnum = get_bar_number ();
 
-      for (int i = 0; i < accidentals_.size (); i++)
+      for (vsize i = 0; i < accidentals_.size (); i++)
        {
          if (accidentals_[i].done_)
            continue;
@@ -406,9 +406,9 @@ Accidental_engraver::make_standard_accidental (Music *note,
     We add the accidentals to the support of the arpeggio,
     so it is put left of the accidentals.
   */
-  for (int i = 0; i < left_objects_.size (); i++)
+  for (vsize i = 0; i < left_objects_.size (); i++)
     Side_position_interface::add_support (left_objects_[i], a);
-  for (int i = 0; i < right_objects_.size (); i++)
+  for (vsize i = 0; i < right_objects_.size (); i++)
     Side_position_interface::add_support (a, right_objects_[i]);
 
   a->set_parent (support, Y_AXIS);
@@ -451,10 +451,10 @@ Accidental_engraver::finalize ()
 void
 Accidental_engraver::stop_translation_timestep ()
 {
-  for (int j = ties_.size (); j--;)
+  for (vsize j = ties_.size (); j--;)
     {
       Grob *r = Tie::head (ties_[j], RIGHT);
-      for (int i = accidentals_.size (); i--;)
+      for (vsize i = accidentals_.size (); i--;)
        if (accidentals_[i].head_ == r)
          {
            if (Grob *g = accidentals_[i].accidental_)
@@ -467,7 +467,7 @@ Accidental_engraver::stop_translation_timestep ()
          }
     }
 
-  for (int i = accidentals_.size (); i--;)
+  for (vsize i = accidentals_.size (); i--;)
     {
       int barnum = get_bar_number ();
 
@@ -544,7 +544,7 @@ Accidental_engraver::acknowledge_rhythmic_head (Grob_info info)
          entry.origin_ = entry.origin_engraver_->context ();
          entry.melodic_ = note;
 
-         accidentals_.push (entry);
+         accidentals_.push_back (entry);
        }
     }
 }
@@ -552,19 +552,19 @@ Accidental_engraver::acknowledge_rhythmic_head (Grob_info info)
 void
 Accidental_engraver::acknowledge_tie (Grob_info info)
 {
-  ties_.push (dynamic_cast<Spanner *> (info.grob ()));
+  ties_.push_back (dynamic_cast<Spanner *> (info.grob ()));
 }
 
 void
 Accidental_engraver::acknowledge_arpeggio (Grob_info info)
 {
-  left_objects_.push (info.grob ());
+  left_objects_.push_back (info.grob ());
 }
 
 void
 Accidental_engraver::acknowledge_finger (Grob_info info)
 {
-  left_objects_.push (info.grob ());
+  left_objects_.push_back (info.grob ());
 }
 
 void
index b2ab0ef92cca30424347c4b36bcc5aa0a926edc0..d6db6f24ef4e659ade9acb859b324cc7de8931fe 100644 (file)
@@ -67,9 +67,9 @@ Accidental_placement::split_accidentals (Grob *accs,
        Grob *a = unsmob_grob (scm_car (s));
 
        if (unsmob_grob (a->get_object ("tie")))
-         break_reminder->push (a);
+         break_reminder->push_back (a);
        else
-         real_acc->push (a);
+         real_acc->push_back (a);
       }
 }
 
@@ -94,7 +94,7 @@ Accidental_placement::get_relevant_accidental_extent (Grob *me,
     which = &ra;
 
   Interval extent;
-  for (int i = 0; i < which->size (); i++)
+  for (vsize i = 0; i < which->size (); i++)
     extent.unite (which->elem (i)->extent (item_col, X_AXIS));
 
   if (!extent.is_empty ())
@@ -108,10 +108,10 @@ Accidental_placement::get_relevant_accidental_extent (Grob *me,
 
 struct Accidental_placement_entry
 {
-  Array<Skyline_entry> left_skyline_;
-  Array<Skyline_entry> right_skyline_;
+  std::vector<Skyline_entry> left_skyline_;
+  std::vector<Skyline_entry> right_skyline_;
   Interval vertical_extent_;
-  Array<Box> extents_;
+  std::vector<Box> extents_;
   Link_array<Grob> grobs_;
   Real offset_;
   int notename_;
@@ -157,9 +157,8 @@ stagger_apes (Link_array<Accidental_placement_entry> *apes)
 
   apes->clear ();
 
-  int i = 0;
   int parity = 1;
-  while (i < asc.size ())
+  for (vsize i = 0; i < asc.size ();)
     {
       Accidental_placement_entry *a = 0;
       if (parity)
@@ -167,7 +166,7 @@ stagger_apes (Link_array<Accidental_placement_entry> *apes)
       else
        a = asc[i++];
 
-      apes->push (a);
+      apes->push_back (a);
       parity = !parity;
     }
 
@@ -238,9 +237,9 @@ Accidental_placement::calc_positioning_done (SCM smob)
       ape->notename_ = scm_to_int (scm_caar (s));
 
       for (SCM t = scm_cdar (s); scm_is_pair (t); t = scm_cdr (t))
-       ape->grobs_.push (unsmob_grob (scm_car (t)));
+       ape->grobs_.push_back (unsmob_grob (scm_car (t)));
 
-      apes.push (ape);
+      apes.push_back (ape);
     }
 
   Grob *common[] = {me, 0};
@@ -250,10 +249,10 @@ Accidental_placement::calc_positioning_done (SCM smob)
     extents if we're sure that we've found the right common refpoint
   */
   Link_array<Grob> note_cols, heads;
-  for (int i = apes.size (); i--;)
+  for (vsize i = apes.size (); i--;)
     {
       Accidental_placement_entry *ape = apes[i];
-      for (int j = ape->grobs_.size (); j--;)
+      for (vsize j = ape->grobs_.size (); j--;)
        {
          Grob *a = ape->grobs_[j];
 
@@ -266,9 +265,9 @@ Accidental_placement::calc_positioning_done (SCM smob)
 
          Grob *col = head->get_parent (X_AXIS);
          if (Note_column::has_interface (col))
-           note_cols.push (col);
+           note_cols.push_back (col);
          else
-           heads.push (head);
+           heads.push_back (head);
        }
     }
 
@@ -276,7 +275,7 @@ Accidental_placement::calc_positioning_done (SCM smob)
     This is a little kludgy: to get all notes, we look if there are
     collisions as well.
   */
-  for (int i = note_cols.size (); i--;)
+  for (vsize i = note_cols.size (); i--;)
     {
       Grob *c = note_cols[i]->get_parent (X_AXIS);
       if (Note_collision_interface::has_interface (c))
@@ -287,27 +286,27 @@ Accidental_placement::calc_positioning_done (SCM smob)
        }
     }
 
-  for (int i = note_cols.size (); i--;)
+  for (vsize i = note_cols.size (); i--;)
     heads.concat (extract_grob_array (note_cols[i], "note-heads"));
 
   heads.default_sort ();
   heads.uniq ();
   common[Y_AXIS] = common_refpoint_of_array (heads, common[Y_AXIS], Y_AXIS);
 
-  for (int i = apes.size (); i--;)
+  for (vsize i = apes.size (); i--;)
     {
       Accidental_placement_entry *ape = apes[i];
       ape->left_skyline_ = empty_skyline (LEFT);
       ape->right_skyline_ = empty_skyline (RIGHT);
 
-      for (int j = apes[i]->grobs_.size (); j--;)
+      for (vsize j = apes[i]->grobs_.size (); j--;)
        {
          Grob *a = apes[i]->grobs_[j];
 
-         Array<Box> boxes = Accidental_interface::accurate_boxes (a, common);
+         std::vector<Box> boxes = Accidental_interface::accurate_boxes (a, common);
 
          ape->extents_.concat (boxes);
-         for (int j = boxes.size (); j--;)
+         for (vsize j = boxes.size (); j--;)
            {
              insert_extent_into_skyline (&ape->left_skyline_, boxes[j], Y_AXIS, LEFT);
              insert_extent_into_skyline (&ape->right_skyline_, boxes[j], Y_AXIS, RIGHT);
@@ -316,11 +315,11 @@ Accidental_placement::calc_positioning_done (SCM smob)
     }
 
   Interval total;
-  for (int i = apes.size (); i--;)
+  for (vsize i = apes.size (); i--;)
     {
       Interval y;
 
-      for (int j = apes[i]->extents_.size (); j--;)
+      for (vsize j = apes[i]->extents_.size (); j--;)
        y.unite (apes[i]->extents_[j][Y_AXIS]);
       apes[i]->vertical_extent_ = y;
       total.unite (y);
@@ -330,9 +329,9 @@ 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);
-  Array<Skyline_entry> head_skyline (empty_skyline (LEFT));
-  Array<Box> head_extents;
-  for (int i = heads.size (); i--;)
+  std::vector<Skyline_entry> head_skyline (empty_skyline (LEFT));
+  std::vector<Box> head_extents;
+  for (vsize i = heads.size (); i--;)
     {
       Box b (heads[i]->extent (common[X_AXIS], X_AXIS),
             heads[i]->extent (common[Y_AXIS], Y_AXIS));
@@ -345,13 +344,13 @@ Accidental_placement::calc_positioning_done (SCM smob)
 
   Real padding = robust_scm2double (me->get_property ("padding"), 0.2);
 
-  Array<Skyline_entry> left_skyline = head_ape->left_skyline_;
+  std::vector<Skyline_entry> left_skyline = head_ape->left_skyline_;
   heighten_skyline (&left_skyline,
                    -robust_scm2double (me->get_property ("right-padding"), 0));
   /*
     Add accs entries right-to-left.
   */
-  for (int i = apes.size (); i-- > 0;)
+  for (vsize i = apes.size (); i-- > 0;)
     {
       Real offset
        = -skyline_meshing_distance (apes[i]->right_skyline_, left_skyline);
@@ -362,27 +361,27 @@ Accidental_placement::calc_positioning_done (SCM smob)
 
       apes[i]->offset_ = offset;
 
-      Array<Skyline_entry> new_left_skyline = apes[i]->left_skyline_;
+      std::vector<Skyline_entry> 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;
     }
 
-  for (int i = apes.size (); i--;)
+  for (vsize i = apes.size (); i--;)
     {
       Accidental_placement_entry *ape = apes[i];
-      for (int j = ape->grobs_.size (); j--;)
+      for (vsize j = ape->grobs_.size (); j--;)
        ape->grobs_[j]->translate_axis (ape->offset_, X_AXIS);
     }
 
   Interval left_extent, right_extent;
   Accidental_placement_entry *ape = apes[0];
 
-  for (int i = ape->extents_.size (); i--;)
+  for (vsize i = ape->extents_.size (); i--;)
     left_extent.unite (ape->offset_ + ape->extents_[i][X_AXIS]);
 
-  ape = apes.top ();
-  for (int i = ape->extents_.size (); i--;)
+  ape = apes.back ();
+  for (vsize i = ape->extents_.size (); i--;)
     right_extent.unite (ape->offset_ + ape->extents_[i][X_AXIS]);
 
   left_extent[LEFT] -= robust_scm2double (me->get_property ("left-padding"), 0);
@@ -392,7 +391,7 @@ Accidental_placement::calc_positioning_done (SCM smob)
   me->flush_extent_cache (X_AXIS);
   me->set_property ("X-extent", scm_width);
 
-  for (int i = apes.size (); i--;)
+  for (vsize i = apes.size (); i--;)
     delete apes[i];
 
   return SCM_BOOL_T;
index 94f92f3a72fe55860a37224e500b7ac0fae4557c..29965135437d00182691bd1b84bd84ba3053b6db 100644 (file)
@@ -52,14 +52,14 @@ Accidental_interface::after_line_breaking (SCM smob)
   return SCM_UNSPECIFIED;
 }
 
-Array<Box>
+std::vector<Box>
 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);
 
-  Array<Box> boxes;
+  std::vector<Box> boxes;
 
   bool parens = false;
   if (to_boolean (a->get_property ("cautionary")))
@@ -93,8 +93,8 @@ Accidental_interface::accurate_boxes (Grob *a, Grob **common)
            stem[Y_AXIS] *= 1.1;
            bulb[Y_AXIS][UP] *= .35;
 
-           boxes.push (bulb);
-           boxes.push (stem);
+           boxes.push_back (bulb);
+           boxes.push_back (stem);
          }
          break;
        case NATURAL:
@@ -111,9 +111,9 @@ Accidental_interface::accurate_boxes (Grob *a, Grob **common)
            rstem[X_AXIS][LEFT] = rstem[X_AXIS].linear_combination (1.0 / 3.0);
            lstem[Y_AXIS][DOWN] = belly[Y_AXIS][DOWN];
            rstem[Y_AXIS][UP] = belly[Y_AXIS][UP];
-           boxes.push (belly);
-           boxes.push (lstem);
-           boxes.push (rstem);
+           boxes.push_back (belly);
+           boxes.push_back (lstem);
+           boxes.push_back (rstem);
          }
          break;
          /*
@@ -123,11 +123,11 @@ Accidental_interface::accurate_boxes (Grob *a, Grob **common)
     }
 
   if (!boxes.size ())
-    boxes.push (b);
+    boxes.push_back (b);
 
   Offset o (a->relative_coordinate (common[X_AXIS], X_AXIS),
            a->relative_coordinate (common[Y_AXIS], Y_AXIS));
-  for (int i = boxes.size (); i--;)
+  for (vsize i = boxes.size (); i--;)
     boxes[i].translate (o);
 
   return boxes;
index b9335706d0fdc7ec9e05b0e7b282fed10925c905..85074a4cf3e044cb01eabeca2f0ba06d351e29d9 100644 (file)
@@ -54,7 +54,7 @@ Align_interface::stretch_after_break (SCM grob)
       Grob *common = common_refpoint_of_array (elems, me, Y_AXIS);
 
       /* force position callbacks */
-      for (int i = 0; i < elems.size (); i++)
+      for (vsize i = 0; i < elems.size (); i++)
        elems[i]->relative_coordinate (common, Y_AXIS);
 
       SCM details =  me_spanner->get_bound (LEFT)->get_property ("line-break-system-details");
@@ -68,7 +68,7 @@ Align_interface::stretch_after_break (SCM grob)
       Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
                                               DOWN);
       Real delta  = extra_space / elems.size() * stacking_dir;
-      for (int i = 0; i < elems.size (); i++)
+      for (vsize i = 0; i < elems.size (); i++)
        elems[i]->translate_axis (i * delta, Y_AXIS);
     }
   
@@ -94,9 +94,9 @@ Align_interface::align_to_fixed_distance (Grob *me, Axis a)
 
   Interval v;
   v.set_empty ();
-  Array<Real> translates;
+  std::vector<Real> translates;
 
-  for (int j = elems.size (); j--;)
+  for (vsize j = elems.size (); j--;)
     {
       /*
        This is not very elegant, in that we need special support for
@@ -113,17 +113,17 @@ Align_interface::align_to_fixed_distance (Grob *me, Axis a)
        elems.del (j);
     }
 
-  for (int j = 0; j < elems.size (); j++)
+  for (vsize j = 0; j < elems.size (); j++)
     {
       where_f += stacking_dir * dy;
-      translates.push (where_f);
+      translates.push_back (where_f);
       v.unite (Interval (where_f, where_f));
     }
 
   /*
     TODO: support self-alignment-{Y, X}
   */
-  for (int i = 0; i < translates.size (); i++)
+  for (vsize i = 0; i < translates.size (); i++)
     elems[i]->translate_axis (translates[i] - v.center (), a);
 }
 
@@ -159,19 +159,19 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a)
   Interval threshold = robust_scm2interval (me->get_property ("threshold"),
                                            Interval (0, Interval::infinity ()));
 
-  Array<Interval> dims;
+  std::vector<Interval> dims;
   Link_array<Grob> elems;
 
   extract_grob_set (me, "elements", all_grobs);
-  for (int i = 0; i < all_grobs.size (); i++)
+  for (vsize i = 0; i < all_grobs.size (); i++)
     {
       Interval y = all_grobs[i]->extent (me, a);
       if (!y.is_empty ())
        {
          Grob *e = dynamic_cast<Grob *> (all_grobs[i]);
 
-         elems.push (e);
-         dims.push (y);
+         elems.push_back (e);
+         dims.push_back (y);
        }
     }
 
@@ -195,8 +195,8 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a)
                                   : SCM_EOL,
                                   extra_space);
   
-  Array<Real> translates;
-  for (int j = 0; j < elems.size (); j++)
+  std::vector<Real> translates;
+  for (vsize j = 0; j < elems.size (); j++)
     {
       Real dy = -dims[j][-stacking_dir];
       if (j)
@@ -211,13 +211,13 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a)
 
       where += stacking_dir * (dy + extra_space / elems.size ());
       total.unite (dims[j] + where);
-      translates.push (where);
+      translates.push_back (where);
     }
 
   SCM offsets_handle = scm_assq (ly_symbol2scm ("alignment-offsets"), line_break_details);
   if (scm_is_pair (offsets_handle))
     {
-      int i = 0;
+      vsize i = 0;
  
       for (SCM s = scm_cdr (offsets_handle); scm_is_pair (s) && i < translates.size (); s = scm_cdr (s), i++)
        {
@@ -232,18 +232,15 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a)
   /*
     also move the grobs that were empty, to maintain spatial order.
   */
-  Array<Real> all_translates;
+  std::vector<Real> all_translates;
   if (translates.size ())
     {
-      int i = 0;
-      int j = 0;
       Real w = translates[0];
-      while (j < all_grobs.size ())
+      for  (vsize i = 0, j = 0; j < all_grobs.size (); j++)
        {
          if (i < elems.size () && all_grobs[j] == elems[i])
            w = translates[i++];
-         all_translates.push (w);
-         j++;
+         all_translates.push_back (w);
        }
 
       /*
@@ -253,7 +250,7 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a)
       if (scm_is_number (align))
        center_offset = total.linear_combination (scm_to_double (align));
 
-      for (int j = 0; j < all_grobs.size (); j++)
+      for (vsize j = 0; j < all_grobs.size (); j++)
        all_grobs[j]->translate_axis (all_translates[j] - center_offset, a);
     }
 }
index 173181254bafa568619c897cf624317e9e9ab034..d4d95a3e8de80a8bb067f8b535b876089b8979c0 100644 (file)
@@ -26,7 +26,7 @@ Arpeggio::print (SCM smob)
   Grob *common = me;
 
   extract_grob_set (me, "stems", stems);
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *stem = stems[i];
       common = common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem),
@@ -44,7 +44,7 @@ Arpeggio::print (SCM smob)
   Interval heads;
   Real my_y = me->relative_coordinate (common, Y_AXIS);
 
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *stem = stems[i];
       Grob *ss = Staff_symbol_referencer::get_staff_symbol (stem);
@@ -100,7 +100,7 @@ Arpeggio::brew_chord_bracket (SCM smob)
   Grob *common = me;
 
   extract_grob_set (me, "stems", stems);
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *stem = stems[i];
       common = common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem),
@@ -110,7 +110,7 @@ Arpeggio::brew_chord_bracket (SCM smob)
   Interval heads;
   Real my_y = me->relative_coordinate (common, Y_AXIS);
 
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *stem = stems[i];
       Grob *ss = Staff_symbol_referencer::get_staff_symbol (stem);
index 8957c8a96863e4c136e0d183a70d4077a75eb913..c9c880ec0755d5cb8a98feb099c78a9aea026498 100644 (file)
@@ -19,7 +19,7 @@ Audio_column::Audio_column (Moment at_mom)
 void
 Audio_column::add_audio_item (Audio_item *l)
 {
-  audio_items_.push (l);
+  audio_items_.push_back (l);
   l->audio_column_ = this;
 }
 
index 344194d8669a4076e7124995d7c7088ce5486214..75c24d96f343a2c2ac68a90afe908658b2fef4c8 100644 (file)
@@ -32,7 +32,7 @@ Audio_element_info::origin_contexts (Translator *end) const
   Link_array<Context> r;
   do
     {
-      r.push (t);
+      r.push_back (t);
       t = t->get_parent_context ();
     }
   while (t && t != end->context ());
index 18df5c9cb697b9eb90a415465e056c62e04bd0fc..a715cbc1de0ae906711deb7ce5ae1092c2b79860 100644 (file)
@@ -15,7 +15,7 @@
 void
 Audio_staff::add_audio_item (Audio_item *l)
 {
-  audio_items_.push (l);
+  audio_items_.push_back (l);
 }
 
 void
index 54949f63b7d66a7b9d4177a7e4a637bc88331541..f6ed06283b84742c1db869855c36392f5b5bd8e2 100644 (file)
@@ -182,7 +182,7 @@ Auto_beam_engraver::create_beam ()
   if (to_boolean (get_property ("skipTypesetting")))
     return 0;
 
-  for (int i = 0; i < stems_->size (); i++)
+  for (vsize i = 0; i < stems_->size (); i++)
     if (Stem::get_beam ((*stems_)[i]))
       return 0;
 
@@ -193,7 +193,7 @@ Auto_beam_engraver::create_beam ()
   Spanner *beam = new Spanner (beam_settings_,
                               context ()->get_grob_key ("Beam"));
 
-  for (int i = 0; i < stems_->size (); i++)
+  for (vsize i = 0; i < stems_->size (); i++)
     Beam::add_stem (beam, (*stems_)[i]);
 
   announce_grob (beam, (*stems_)[0]->self_scm ());
@@ -387,7 +387,7 @@ Auto_beam_engraver::acknowledge_stem (Grob_info info)
 
   grouping_->add_stem (now - beam_start_moment_ + beam_start_location_,
                       durlog - 2);
-  stems_->push (stem);
+  stems_->push_back (stem);
   last_add_mom_ = now;
   extend_mom_ = max (extend_mom_, now) + m->get_length ();
 }
index 31d75f0f1c4262b8c650589737a5088378c20a5a..bc589b25bb1dc8e0f80386209a5b7c88f9ed2d5d 100644 (file)
@@ -22,7 +22,7 @@ protected:
   virtual void do_quit ();
   virtual void construct_children ();
   virtual void process (Moment);
-  Array<Pitch> pending_pitch (Moment) const;
+  std::vector<Pitch> pending_pitch (Moment) const;
 private:
   SCM split_list_;
   Direction where_dir_;
index b20abef88f15c6c513b3f898023330a167346db8..b582fa417f43f1de177018ca17a463a67c4c6a53 100644 (file)
@@ -56,7 +56,7 @@ Axis_group_engraver::finalize ()
 void
 Axis_group_engraver::acknowledge_grob (Grob_info i)
 {
-  elts_.push (i.grob ());
+  elts_.push_back (i.grob ());
 }
 
 /*
@@ -69,7 +69,7 @@ Axis_group_engraver::process_acknowledged ()
   if (!staffline_)
     return;
 
-  for (int i = 0; i < elts_.size (); i++)
+  for (vsize i = 0; i < elts_.size (); i++)
     {
       if (!unsmob_grob (elts_[i]->get_object ("axis-group-parent-Y")))
        {
index 154521ca4f66f974cee1ca225f5275943dadf524..f5c7fb152949d5920bd90f62175067c049cb6892 100644 (file)
@@ -26,7 +26,7 @@ LY_DEFINE (ly_relative_group_extent, "ly:relative-group-extent",
   if (!ga)
     {
       for (SCM s = elements; scm_is_pair (s); s = scm_cdr (s))
-       elts.push (unsmob_grob (scm_car (s)));
+       elts.push_back (unsmob_grob (scm_car (s)));
     }
 
   Interval ext = Axis_group_interface::relative_group_extent (ga ? ga->array () : elts,
index 11d3a566dc9b2390ba1a1be3667bb5e159f3be1a..112dc3d767178092b8dcfe3bc4a1115dba530520 100644 (file)
@@ -49,7 +49,7 @@ Axis_group_interface::relative_group_extent (Link_array<Grob> const &elts,
                                             Grob *common, Axis a)
 {
   Interval r;
-  for (int i = 0; i < elts.size (); i++)
+  for (vsize i = 0; i < elts.size (); i++)
     {
       Grob *se = elts[i];
       Interval dims = se->extent (common, a);
@@ -90,13 +90,13 @@ Axis_group_interface::generic_group_extent (Grob *me, Axis a)
 void
 Axis_group_interface::get_children (Grob *me, Link_array<Grob> *found)
 {
-  found->push (me);
+  found->push_back (me);
 
   if (!has_interface (me))
     return;
 
   extract_grob_set (me, "elements", elements);
-  for (int i = 0; i < elements.size (); i++)
+  for (vsize i = 0; i < elements.size (); i++)
     {
       Grob *e = elements[i];
       Axis_group_interface::get_children (e, found);
index 4eb2bab8fd3b56f3286fedee71f404253e4536d5..00ceb61dcd8479e0bdf0354775278c34e9c52edf 100644 (file)
@@ -3,18 +3,18 @@
 */
 
 #include "pointer-group-interface.hh"
-#include "array.hh"
+#include "std-vector.hh"
 #include "stem.hh"
 #include "beam.hh"
 #include "staff-symbol-referencer.hh"
 #include "directional-element-interface.hh"
 
 bool
-is_concave_single_notes (Array<int> const &positions, Direction beam_dir)
+is_concave_single_notes (std::vector<int> const &positions, Direction beam_dir)
 {
   Interval covering;
   covering.add_point (positions[0]);
-  covering.add_point (positions.top ());
+  covering.add_point (positions.back ());
 
   bool above = false;
   bool below = false;
@@ -23,7 +23,7 @@ is_concave_single_notes (Array<int> const &positions, Direction beam_dir)
   /*
     notes above and below the interval covered by 1st and last note.
   */
-  for (int i = 1; i < positions.size () - 1; i++)
+  for (vsize i = 1; i < positions.size () - 1; i++)
     {
       above = above || (positions[i] > covering[UP]);
       below = below || (positions[i] < covering[DOWN]);
@@ -34,9 +34,9 @@ is_concave_single_notes (Array<int> const &positions, Direction beam_dir)
     A note as close or closer to the beam than begin and end, but the
     note is reached in the opposite direction as the last-first dy
   */
-  int dy = positions.top () - positions[0];
-  int closest = max (beam_dir * positions.top (), beam_dir * positions[0]);
-  for (int i = 2; !concave && i < positions.size () - 1; i++)
+  int dy = positions.back () - positions[0];
+  int closest = max (beam_dir * positions.back (), beam_dir * positions[0]);
+  for (vsize i = 2; !concave && i < positions.size () - 1; i++)
     {
       int inner_dy = positions[i] - positions[i - 1];
       if (sign (inner_dy) != sign (dy)
@@ -46,7 +46,7 @@ is_concave_single_notes (Array<int> const &positions, Direction beam_dir)
     }
 
   bool all_closer = true;
-  for (int i = 1; all_closer && i < positions.size () - 1; i++)
+  for (vsize i = 1; all_closer && i < positions.size () - 1; i++)
     {
       all_closer = all_closer
        && (beam_dir * positions[i] > closest);
@@ -57,12 +57,12 @@ is_concave_single_notes (Array<int> const &positions, Direction beam_dir)
 }
 
 Real
-calc_positions_concaveness (Array<int> const &positions, Direction beam_dir)
+calc_positions_concaveness (std::vector<int> const &positions, Direction beam_dir)
 {
-  Real dy = positions.top () - positions[0];
+  Real dy = positions.back () - positions[0];
   Real slope = dy / Real (positions.size () - 1);
   Real concaveness = 0.0;
-  for (int i = 1; i < positions.size () - 1; i++)
+  for (vsize i = 1; i < positions.size () - 1; i++)
     {
       Real line_y = slope * i + positions[0];
 
@@ -94,7 +94,7 @@ Beam::calc_concaveness (SCM smob)
     return scm_from_double (0.0);
 
   Direction beam_dir = CENTER;
-  for (int i = stems.size (); i--;)
+  for (vsize i = stems.size (); i--;)
     {
       if (Stem::is_invisible (stems[i]))
        stems.del (i);
@@ -108,9 +108,9 @@ Beam::calc_concaveness (SCM smob)
   if (stems.size () <= 2)
     return SCM_UNSPECIFIED;
 
-  Array<int> close_positions;
-  Array<int> far_positions;
-  for (int i = 0; i < stems.size (); i++)
+  std::vector<int> close_positions;
+  std::vector<int> far_positions;
+  for (vsize i = 0; i < stems.size (); i++)
     {
       /*
        For chords, we take the note head that is closest to the beam.
@@ -122,8 +122,8 @@ Beam::calc_concaveness (SCM smob)
       */
       Interval posns = Stem::head_positions (stems[i]);
 
-      close_positions.push ((int) rint (posns[beam_dir]));
-      far_positions.push ((int) rint (posns[-beam_dir]));
+      close_positions.push_back ((int) rint (posns[beam_dir]));
+      far_positions.push_back ((int) rint (posns[-beam_dir]));
     }
 
   Real concaveness = 0.0;
index c982c6d812f65dd9a881caa67dd0218172c893d6..5b9b2dbaed808658d9a714472cf634161d2f3152 100644 (file)
@@ -78,11 +78,11 @@ struct Quant_score
 */
 
 int
-best_quant_score_idx (Array<Quant_score> const &qscores)
+best_quant_score_idx (std::vector<Quant_score> const &qscores)
 {
   Real best = 1e6;
   int best_idx = -1;
-  for (int i = qscores.size (); i--;)
+  for (vsize i = qscores.size (); i--;)
     {
       if (qscores[i].demerits < best)
        {
@@ -123,8 +123,8 @@ Beam::quanting (SCM smob, SCM posns)
   Real quants [] = {straddle, sit, inter, hang };
 
   int num_quants = int (sizeof (quants) / sizeof (Real));
-  Array<Real> quantsl;
-  Array<Real> quantsr;
+  std::vector<Real> quantsl;
+  std::vector<Real> quantsr;
 
   /*
     going to REGION_SIZE == 2, yields another 0.6 second with
@@ -141,9 +141,9 @@ Beam::quanting (SCM smob, SCM posns)
   */
   Link_array<Grob> stems
     = extract_grob_array (me, "stems");
-  Array<Stem_info> stem_infos;
-  Array<Real> base_lengths;
-  Array<Real> stem_xposns;
+  std::vector<Stem_info> stem_infos;
+  std::vector<Real> base_lengths;
+  std::vector<Real> stem_xposns;
 
   Drul_array<bool> dirs_found (0, 0);
   Grob *common[2];
@@ -163,21 +163,21 @@ Beam::quanting (SCM smob, SCM posns)
     stem_y != 0.0, when we're cross staff.
 
   */
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
 
       Stem_info si (Stem::get_stem_info (s));
       si.scale (1 / ss);
-      stem_infos.push (si);
-      dirs_found[stem_infos.top ().dir_] = true;
+      stem_infos.push_back (si);
+      dirs_found[stem_infos.back ().dir_] = true;
 
       bool f = to_boolean (s->get_property ("french-beaming"))
        && s != lvs && s != fvs;
 
-      base_lengths.push (calc_stem_y (me, s, common, xl, xr,
+      base_lengths.push_back (calc_stem_y (me, s, common, xl, xr,
                                      Interval (0, 0), f) / ss);
-      stem_xposns.push (s->relative_coordinate (common[X_AXIS], X_AXIS));
+      stem_xposns.push_back (s->relative_coordinate (common[X_AXIS], X_AXIS));
     }
 
   bool xstaff = false;
@@ -188,7 +188,7 @@ Beam::quanting (SCM smob, SCM posns)
     }
 
   Direction ldir = Direction (stem_infos[0].dir_);
-  Direction rdir = Direction (stem_infos.top ().dir_);
+  Direction rdir = Direction (stem_infos.back ().dir_);
   bool is_knee = dirs_found[LEFT] && dirs_found[RIGHT];
 
   int region_size = (int) parameters.REGION_SIZE;
@@ -205,28 +205,28 @@ Beam::quanting (SCM smob, SCM posns)
   for (int i = -region_size; i < region_size; i++)
     for (int j = 0; j < num_quants; j++)
       {
-       quantsl.push (i + quants[j] + int (yl));
-       quantsr.push (i + quants[j] + int (yr));
+       quantsl.push_back (i + quants[j] + int (yl));
+       quantsr.push_back (i + quants[j] + int (yr));
       }
 
-  Array<Quant_score> qscores;
+  std::vector<Quant_score> qscores;
 
-  for (int l = 0; l < quantsl.size (); l++)
-    for (int r = 0; r < quantsr.size (); r++)
+  for (vsize l = 0; l < quantsl.size (); l++)
+    for (vsize r = 0; r < quantsr.size (); r++)
       {
        Quant_score qs;
        qs.yl = quantsl[l];
        qs.yr = quantsr[r];
        qs.demerits = 0.0;
 
-       qscores.push (qs);
+       qscores.push_back (qs);
       }
 
   /* This is a longish function, but we don't separate this out into
      neat modular separate subfunctions, as the subfunctions would be
      called for many values of YL, YR. By precomputing various
      parameters outside of the loop, we can save a lot of time. */
-  for (int i = qscores.size (); i--;)
+  for (vsize i = qscores.size (); i--;)
     {
       Real d = score_slopes_dy (qscores[i].yl, qscores[i].yr,
                                dy_mus, yr- yl,
@@ -242,12 +242,12 @@ Beam::quanting (SCM smob, SCM posns)
   Real rad = Staff_symbol_referencer::staff_radius (me);
   Drul_array<int> edge_beam_counts
     (Stem::beam_multiplicity (stems[0]).length () + 1,
-     Stem::beam_multiplicity (stems.top ()).length () + 1);
+     Stem::beam_multiplicity (stems.back ()).length () + 1);
 
   Real beam_translation = get_beam_translation (me) / ss;
 
   Real reasonable_score = (is_knee) ? 200000 : 100;
-  for (int i = qscores.size (); i--;)
+  for (vsize i = qscores.size (); i--;)
     if (qscores[i].demerits < reasonable_score)
       {
        Real d = score_forbidden_quants (qscores[i].yl, qscores[i].yr,
@@ -260,7 +260,7 @@ Beam::quanting (SCM smob, SCM posns)
 #endif
       }
 
-  for (int i = qscores.size (); i--;)
+  for (vsize i = qscores.size (); i--;)
     if (qscores[i].demerits < reasonable_score)
       {
        Real d = score_stem_lengths (stems, stem_infos,
@@ -284,10 +284,8 @@ Beam::quanting (SCM smob, SCM posns)
     {
       Drul_array<Real> ins = ly_scm2interval (inspect_quants);
 
-      int i = 0;
-
       Real mindist = 1e6;
-      for (; i < qscores.size (); i++)
+      for (vsize i = 0; i < qscores.size (); i++)
        {
          Real d = fabs (qscores[i].yl- ins[LEFT]) + fabs (qscores[i].yr - ins[RIGHT]);
          if (d < mindist)
@@ -330,9 +328,9 @@ Beam::quanting (SCM smob, SCM posns)
 
 Real
 Beam::score_stem_lengths (Link_array<Grob> const &stems,
-                         Array<Stem_info> const &stem_infos,
-                         Array<Real> const &base_stem_ys,
-                         Array<Real> const &stem_xs,
+                         std::vector<Stem_info> const &stem_infos,
+                         std::vector<Real> const &base_stem_ys,
+                         std::vector<Real> const &stem_xs,
                          Real xl, Real xr,
                          bool knee,
                          Real yl, Real yr,
@@ -343,7 +341,7 @@ Beam::score_stem_lengths (Link_array<Grob> const &stems,
   Drul_array<Real> score (0, 0);
   Drul_array<int> count (0, 0);
 
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
       if (Stem::is_invisible (s))
index 5861dba32115cb4fa7aa7a3cd581a67ec15acd45..712c4d5c04f87fbd29e62f043d58df22031a2ea6 100644 (file)
@@ -91,7 +91,7 @@ Beam::get_beam_count (Grob *me)
   int m = 0;
 
   extract_grob_set (me, "stems", stems);
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *stem = stems[i];
       m = max (m, (Stem::beam_multiplicity (stem).length () + 1));
@@ -218,7 +218,7 @@ Beam::calc_beaming (SCM smob)
   
   SCM last_beaming = scm_cons (SCM_EOL, scm_list_1 (scm_from_int (0)));
   Direction last_dir = CENTER;
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *this_stem = stems[i];
       SCM this_beaming = this_stem->get_property ("beaming");
@@ -300,7 +300,7 @@ Beam::print (SCM grob)
   else
     {
       x0 = stems[0]->relative_coordinate (xcommon, X_AXIS);
-      dx = stems.top ()->relative_coordinate (xcommon, X_AXIS) - x0;
+      dx = stems.back ()->relative_coordinate (xcommon, X_AXIS) - x0;
     }
 
   SCM posns = me->get_property ("quantized-positions");
@@ -330,7 +330,7 @@ Beam::print (SCM grob)
   Stencil the_beam;
   Real lt = me->layout ()->get_dimension (ly_symbol2scm ("linethickness"));
 
-  for (int i = 0; i <= stems.size (); i++)
+  for (vsize i = 0; i <= stems.size (); i++)
     {
       Grob *stem = (i < stems.size ()) ? stems[i] : 0;
 
@@ -346,25 +346,25 @@ Beam::print (SCM grob)
       SCM left = (i > 0) ? scm_cdr (last_beaming) : SCM_EOL;
       SCM right = stem ? scm_car (this_beaming) : SCM_EOL;
 
-      Array<int> full_beams;
-      Array<int> lfliebertjes;
-      Array<int> rfliebertjes;
+      std::vector<int> full_beams;
+      std::vector<int> lfliebertjes;
+      std::vector<int> rfliebertjes;
 
       for (SCM s = left;
           scm_is_pair (s); s = scm_cdr (s))
        {
          int b = scm_to_int (scm_car (s));
          if (scm_c_memq (scm_car (s), right) != SCM_BOOL_F)
-           full_beams.push (b);
+           full_beams.push_back (b);
          else
-           lfliebertjes.push (b);
+           lfliebertjes.push_back (b);
        }
       for (SCM s = right;
           scm_is_pair (s); s = scm_cdr (s))
        {
          int b = scm_to_int (scm_car (s));
          if (scm_c_memq (scm_car (s), left) == SCM_BOOL_F)
-           rfliebertjes.push (b);
+           rfliebertjes.push_back (b);
        }
 
       Drul_array<Real> break_overshoot
@@ -401,7 +401,7 @@ Beam::print (SCM grob)
        }
 
       int k = 0;
-      for (int j = full_beams.size (); j--;)
+      for (vsize j = full_beams.size (); j--;)
        {
          Stencil b (whole);
 
@@ -460,7 +460,7 @@ Beam::print (SCM grob)
 
          Stencil rhalf = Lookup::beam (slope, rw, thick, blot);
          Stencil lhalf = Lookup::beam (slope, lw, thick, blot);
-         for (int j = lfliebertjes.size (); j--;)
+         for (vsize j = lfliebertjes.size (); j--;)
            {
              Stencil b (lhalf);
              b.translate_axis (last_xposn - x0 - last_stem_width /2,
@@ -470,7 +470,7 @@ Beam::print (SCM grob)
                                Y_AXIS);
              the_beam.add_stencil (b);
            }
-         for (int j = rfliebertjes.size (); j--;)
+         for (vsize j = rfliebertjes.size (); j--;)
            {
              Stencil b (rhalf);
              b.translate_axis (xposn - x0 - rw + stem_width / 2, X_AXIS);
@@ -526,7 +526,7 @@ Beam::get_default_dir (Grob *me)
 
   extract_grob_set (me, "stems", stems);
 
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
       Direction stem_dir = CENTER;
@@ -570,7 +570,7 @@ Beam::set_stem_directions (Grob *me, Direction d)
 {
   extract_grob_set (me, "stems", stems);
 
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
 
@@ -608,8 +608,8 @@ 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);
 
-  Array<Interval> head_extents_array;
-  for (int i = 0; i < stems.size (); i++)
+  std::vector<Interval> head_extents_array;
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *stem = stems[i];
       if (Stem::is_invisible (stem))
@@ -635,7 +635,7 @@ Beam::consider_auto_knees (Grob *me)
              head_extents[-stemdir] = -stemdir * infinity_f;
            }
        }
-      head_extents_array.push (head_extents);
+      head_extents_array.push_back (head_extents);
 
       gaps.remove_interval (head_extents);
     }
@@ -643,7 +643,7 @@ Beam::consider_auto_knees (Grob *me)
   Interval max_gap;
   Real max_gap_len = 0.0;
 
-  for (int i = gaps.allowed_regions_.size () -1; i >= 0; i--)
+  for (vsize i = gaps.allowed_regions_.size () -1; i != VPOS ;i--)
     {
       Interval gap = gaps.allowed_regions_[i];
 
@@ -670,7 +670,7 @@ Beam::consider_auto_knees (Grob *me)
   if (max_gap_len > threshold)
     {
       int j = 0;
-      for (int i = 0; i < stems.size (); i++)
+      for (vsize i = 0; i < stems.size (); i++)
        {
          Grob *stem = stems[i];
          if (Stem::is_invisible (stem))
@@ -779,7 +779,7 @@ Beam::calc_least_squares_positions (SCM smob, SCM posns)
   if (count < 1)
     return ly_interval2scm (pos);
   
-  Array<Real> x_posns;
+  std::vector<Real> 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);
@@ -795,12 +795,12 @@ Beam::calc_least_squares_positions (SCM smob, SCM posns)
                  + lvs->relative_coordinate (commony, Y_AXIS) - my_y);
 
   Real x0 = first_visible_stem (me)->relative_coordinate (commonx, X_AXIS);
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
 
       Real x = s->relative_coordinate (commonx, X_AXIS) - x0;
-      x_posns.push (x);
+      x_posns.push_back (x);
     }
   Real dx = last_visible_stem (me)->relative_coordinate (commonx, X_AXIS) - x0;
 
@@ -839,13 +839,13 @@ Beam::calc_least_squares_positions (SCM smob, SCM posns)
     }
   else
     {
-      Array<Offset> ideals;
-      for (int i = 0; i < stems.size (); i++)
+      std::vector<Offset> ideals;
+      for (vsize i = 0; i < stems.size (); i++)
        {
          Grob *s = stems[i];
          if (Stem::is_invisible (s))
            continue;
-         ideals.push (Offset (x_posns[i],
+         ideals.push_back (Offset (x_posns[i],
                               Stem::get_stem_info (s).ideal_y_
                               + s->relative_coordinate (commony, Y_AXIS)
                               - my_y));
@@ -885,7 +885,7 @@ Beam::shift_region_to_valid (SCM grob, SCM posns)
   /*
     Code dup.
   */
-  Array<Real> x_posns;
+  std::vector<Real> 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);
@@ -896,12 +896,12 @@ Beam::shift_region_to_valid (SCM grob, SCM posns)
     return posns;
 
   Real x0 = fvs->relative_coordinate (commonx, X_AXIS);
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
 
       Real x = s->relative_coordinate (commonx, X_AXIS) - x0;
-      x_posns.push (x);
+      x_posns.push_back (x);
     }
 
   Grob *lvs = last_visible_stem (me);
@@ -925,7 +925,7 @@ Beam::shift_region_to_valid (SCM grob, SCM posns)
   */
   Interval feasible_left_point;
   feasible_left_point.set_full ();
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
       if (Stem::is_invisible (s))
@@ -1127,7 +1127,7 @@ Beam::set_stem_lengths (SCM smob)
   Real xl = fvs ? fvs->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0;
   Real xr = lvs ? lvs->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0;
 
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
       if (Stem::is_invisible (s))
@@ -1157,7 +1157,7 @@ Beam::set_beaming (Grob *me, Beaming_info_list const *beaming)
   extract_grob_set (me, "stems", stems);
 
   Direction d = LEFT;
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       /*
        Don't overwrite user settings.
@@ -1188,7 +1188,7 @@ Beam::forced_stem_count (Grob *me)
   extract_grob_set (me, "stems", stems);
 
   int f = 0;
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
 
@@ -1212,7 +1212,7 @@ Beam::visible_stem_count (Grob *me)
 {
   extract_grob_set (me, "stems", stems);
   int c = 0;
-  for (int i = stems.size (); i--;)
+  for (vsize i = stems.size (); i--;)
     {
       if (!Stem::is_invisible (stems[i]))
        c++;
@@ -1225,7 +1225,7 @@ Beam::first_visible_stem (Grob *me)
 {
   extract_grob_set (me, "stems", stems);
 
-  for (int i = 0; i < stems.size (); i++)
+  for (vsize i = 0; i < stems.size (); i++)
     {
       if (!Stem::is_invisible (stems[i]))
        return stems[i];
@@ -1238,7 +1238,7 @@ Beam::last_visible_stem (Grob *me)
 {
   extract_grob_set (me, "stems", stems);
 
-  for (int i = stems.size (); i--;)
+  for (vsize i = stems.size (); i--;)
     {
       if (!Stem::is_invisible (stems[i]))
        return stems[i];
@@ -1353,7 +1353,7 @@ Beam::is_knee (Grob *me)
   bool knee = false;
   int d = 0;
   extract_grob_set (me, "stems", stems);
-  for (int i = stems.size (); i--;)
+  for (vsize i = stems.size (); i--;)
     {
       Direction dir = get_grob_direction (stems[i]);
       if (d && d != dir)
@@ -1375,7 +1375,7 @@ Beam::get_direction_beam_count (Grob *me, Direction d)
   extract_grob_set (me, "stems", stems);
   int bc = 0;
 
-  for (int i = stems.size (); i--;)
+  for (vsize i = stems.size (); i--;)
     {
       /*
        Should we take invisible stems into account?
index 10f3681a5658a63196e4c7f92e00fe467782e864..7a5428c1ba2a741d2c573f23e7840fdd159b14d2 100644 (file)
@@ -31,7 +31,7 @@ Beaming_info_list::best_splitpoint_index (Moment &beat_length, bool subdivide) c
   int minidx = -1;
   Moment beat_pos;
 
-  for (int i = 1; i < infos_.size (); i++)
+  for (vsize i = 1; i < infos_.size (); i++)
     {
       beat_pos = infos_[i].start_mom_ / beat_length;
       int den = beat_pos.den ();
@@ -98,7 +98,7 @@ Beaming_info_list::beamify (Moment &beat_length, bool subdivide)
 void
 Beaming_info_list::add_stem (Moment m, int b)
 {
-  infos_.push (Beaming_info (m, b));
+  infos_.push_back (Beaming_info (m, b));
 }
 
 void
@@ -107,6 +107,6 @@ Beaming_info_list::clip_edges ()
   if (infos_.size ())
     {
       infos_[0].beams_i_drul_[LEFT] = 0;
-      infos_.top().beams_i_drul_[RIGHT] = 0;
+      infos_.back ().beams_i_drul_[RIGHT] = 0;
     }
 }
index 4752bc67f91d5850fbbe45d04e055513853d275f..193018f21098373aa4b69fe55792080f56eb0e9e 100644 (file)
@@ -30,9 +30,9 @@ binomial_coefficient (Real over, int under)
 }
 
 void
-scale (Array<Offset> *array, Real x, Real y)
+scale (std::vector<Offset> *array, Real x, Real y)
 {
-  for (int i = 0; i < array->size (); i++)
+  for (vsize i = 0; i < array->size (); i++)
     {
       (*array)[i][X_AXIS] = x * (*array)[i][X_AXIS];
       (*array)[i][Y_AXIS] = y * (*array)[i][Y_AXIS];
@@ -40,17 +40,17 @@ scale (Array<Offset> *array, Real x, Real y)
 }
 
 void
-rotate (Array<Offset> *array, Real phi)
+rotate (std::vector<Offset> *array, Real phi)
 {
   Offset rot (complex_exp (Offset (0, phi)));
-  for (int i = 0; i < array->size (); i++)
+  for (vsize i = 0; i < array->size (); i++)
     (*array)[i] = complex_multiply (rot, (*array)[i]);
 }
 
 void
-translate (Array<Offset> *array, Offset o)
+translate (std::vector<Offset> *array, Offset o)
 {
-  for (int i = 0; i < array->size (); i++)
+  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);
-  Array<Real> ts = solve_point (a, x);
+  std::vector<Real> ts = solve_point (a, x);
 
   if (ts.size () == 0)
     {
@@ -169,10 +169,10 @@ Bezier::polynomial (Axis a) const
 /**
    Remove all numbers outside [0, 1] from SOL
 */
-Array<Real>
-filter_solutions (Array<Real> sol)
+std::vector<Real>
+filter_solutions (std::vector<Real> sol)
 {
-  for (int i = sol.size (); i--;)
+  for (vsize i = sol.size (); i--;)
     if (sol[i] < 0 || sol[i] > 1)
       sol.del (i);
   return sol;
@@ -181,7 +181,7 @@ filter_solutions (Array<Real> sol)
 /**
    find t such that derivative is proportional to DERIV
 */
-Array<Real>
+std::vector<Real>
 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
 */
-Array<Real>
+std::vector<Real>
 Bezier::solve_point (Axis ax, Real coordinate) const
 {
   Polynomial p (polynomial (ax));
   p.coefs_[0] -= coordinate;
 
-  Array<Real> sol (p.solve ());
+  std::vector<Real> sol (p.solve ());
   return filter_solutions (sol);
 }
 
@@ -217,10 +217,10 @@ Bezier::extent (Axis a) const
   Offset d;
   d[Axis (o)] = 1.0;
   Interval iv;
-  Array<Real> sols (solve_derivative (d));
-  sols.push (1.0);
-  sols.push (0.0);
-  for (int i = sols.size (); i--;)
+  std::vector<Real> sols (solve_derivative (d));
+  sols.push_back (1.0);
+  sols.push_back (0.0);
+  for (vsize i = sols.size (); i--;)
     {
       Offset o (curve_point (sols[i]));
       iv.unite (Interval (o[a], o[a]));
index c2db1f2ac6d1a31da4a41db6e37384c745a07393..5201ca125c922f72f9fea94f9cb712eba896f3db 100644 (file)
@@ -9,7 +9,7 @@
 #include "ly-smobs.icc"
 
 #include "box.hh"
-#include "array.hh"
+#include "std-vector.hh"
 
 void
 Box::translate (Offset o)
index 083aca8cbe03d187d8fc58da0351a16eaabe7a13..abe15eea2f785c84d76b5a7bfaf3554c1d6b434d 100644 (file)
 #include "cpu-timer.hh"
 #include "simple-spacer.hh"
 
-Array<int>
+std::vector<int>
 Break_algorithm::find_break_indices () const
 {
   Link_array<Grob> all = pscore_->root_system ()->columns ();
-  Array<int> retval;
+  std::vector<int> retval;
 
-  for (int i = 0; i < all.size (); i++)
+  for (vsize i = 0; i < all.size (); i++)
     if (Item::is_breakable (all[i]))
-      retval.push (i);
+      retval.push_back (i);
 
   if (linewidth_ <= 0)
     while (retval.size () > 2)
@@ -38,9 +38,9 @@ Break_algorithm::find_breaks () const
   Link_array<Grob> all = pscore_->root_system ()->columns ();
   Link_array<Grob> retval;
 
-  for (int i = 0; i < all.size (); i++)
+  for (vsize i = 0; i < all.size (); i++)
     if (Item::is_breakable (all[i]))
-      retval.push (all[i]);
+      retval.push_back (all[i]);
 
   if (linewidth_ <= 0)
     while (retval.size () > 2)
@@ -88,10 +88,10 @@ Break_algorithm::set_pscore (Paper_score *s)
   linewidth_ = s->layout ()->get_dimension (ly_symbol2scm ("linewidth"));
 }
 
-Array<Column_x_positions>
+std::vector<Column_x_positions>
 Break_algorithm::solve () const
 {
-  Array<Column_x_positions> h= do_solve ();
+  std::vector<Column_x_positions> h= do_solve ();
 
   return h;
 }
index 233bb33e45ecb1951a184d0a1906a15a6230a1bf..3aff11a20e7edcd19f9e48f429e10f45d46dea6a 100644 (file)
@@ -68,12 +68,12 @@ Break_align_interface::ordered_elements (Grob *grob)
     {
       SCM sym = scm_car (order);
 
-      for (int i = writable_elts.size (); i--;)
+      for (vsize i = writable_elts.size (); i--;)
        {
          Grob *g = writable_elts[i];
          if (g && sym == g->get_property ("break-align-symbol"))
            {
-             new_elts.push (g);
+             new_elts.push_back (g);
              writable_elts.del (i);
            }
        }
@@ -96,31 +96,31 @@ Break_align_interface::calc_positioning_done (SCM smob)
   Item *me = dynamic_cast<Item *> (grob);
 
   Link_array<Grob> elems = ordered_elements (me);
-  Array<Interval> extents;
+  std::vector<Interval> extents;
 
   int last_nonempty = -1;
-  for (int i = 0; i < elems.size (); i++)
+  for (vsize i = 0; i < elems.size (); i++)
     {
       Interval y = elems[i]->extent (elems[i], X_AXIS);
-      extents.push (y);
+      extents.push_back (y);
       if (!y.is_empty ())
        last_nonempty = i;
     }
 
-  int idx = 0;
+  vsize idx = 0;
   while (idx < extents.size () && extents[idx].is_empty ())
     idx++;
 
-  Array<Real> offsets;
-  offsets.set_size (elems.size ());
-  for (int i = 0; i < offsets.size ();i++)
+  std::vector<Real> offsets;
+  offsets.resize (elems.size ());
+  for (vsize i = 0; i < offsets.size ();i++)
     offsets[i] = 0.0;
 
   Real extra_right_space = 0.0;
-  int edge_idx = -1;
+  vsize edge_idx = VPOS;
   while (idx < elems.size ())
     {
-      int next_idx = idx + 1;
+      vsize next_idx = idx + 1;
       while (next_idx < elems.size ()
             && extents[next_idx].is_empty ())
        next_idx++;
@@ -138,11 +138,11 @@ Break_align_interface::calc_positioning_done (SCM smob)
       */
       extract_grob_set (l, "elements", elts);
 
-      for (int i = elts.size (); i--;)
+      for (vsize i = elts.size (); i--;)
        {
          Grob *elt = elts[i];
 
-         if (edge_idx < 0
+         if (edge_idx == VPOS
              && elt->get_property ("break-align-symbol")
              == ly_symbol2scm ("left-edge"))
            edge_idx = idx;
@@ -165,7 +165,7 @@ Break_align_interface::calc_positioning_done (SCM smob)
       if (r)
        {
          extract_grob_set (r, "elements", elts);
-         for (int i = elts.size ();
+         for (vsize i = elts.size ();
               !scm_is_symbol (rsym) && i--;)
            {
              Grob *elt = elts[i];
@@ -226,7 +226,7 @@ Break_align_interface::calc_positioning_done (SCM smob)
   Interval total_extent;
 
   Real alignment_off = 0.0;
-  for (int i = 0; i < offsets.size (); i++)
+  for (vsize i = 0; i < offsets.size (); i++)
     {
       here += offsets[i];
       if (i == edge_idx)
@@ -239,11 +239,11 @@ Break_align_interface::calc_positioning_done (SCM smob)
 
   if (me->break_status_dir () == LEFT)
     alignment_off = -total_extent[RIGHT] - extra_right_space;
-  else if (edge_idx < 0)
+  else if (edge_idx == VPOS)
     alignment_off = -total_extent[LEFT];
 
   here = alignment_off;
-  for (int i = 0; i < offsets.size (); i++)
+  for (vsize i = 0; i < offsets.size (); i++)
     {
       here += offsets[i];
       elems[i]->translate_axis (here, X_AXIS);
index 764186ee3f07e003ff0e78a2ad249fd13842c8d9..d14092876f7a401f2584af4a50a2e21cf7c0d1ed 100644 (file)
@@ -148,10 +148,10 @@ substitute_grob_array (Grob_array *grob_arr, Grob_array *new_arr)
                               ? & temporary_substition_array
                               : &new_arr->array_reference ());
 
-  new_grobs->set_size (old_grobs.size ());
+  new_grobs->resize (old_grobs.size ());
   Grob **array = (Grob **) new_grobs->accesses ();
   Grob **ptr = array;
-  for (int i = 0; i < old_grobs.size (); i++)
+  for (vsize i = 0; i < old_grobs.size (); i++)
     {
       Grob *orig = old_grobs[i];
       Grob *new_grob = substitute_grob (orig);
@@ -159,7 +159,7 @@ substitute_grob_array (Grob_array *grob_arr, Grob_array *new_arr)
        *ptr++ = new_grob;
     }
 
-  new_grobs->set_size (ptr - array);
+  new_grobs->resize (ptr - array);
   if (new_arr == grob_arr)
     new_arr->set_array (*new_grobs);
 }
@@ -225,7 +225,7 @@ spanner_system_range (Spanner *sp)
     {
       if (sp->broken_intos_.size ())
        rv = Slice (sp->broken_intos_[0]->get_system ()->get_rank (),
-                   sp->broken_intos_.top ()->get_system ()->get_rank ());
+                   sp->broken_intos_.back ()->get_system ()->get_rank ());
     }
   return rv;
 }
@@ -337,7 +337,7 @@ Spanner::fast_substitute_grob_array (SCM sym,
   int spanner_index = len;
   int item_index = 0;
 
-  for (int i = 0; i < grob_array->size (); i++)
+  for (vsize i = 0; i < grob_array->size (); i++)
     {
       Grob *g = grob_array->grob (i);
 
@@ -356,15 +356,15 @@ Spanner::fast_substitute_grob_array (SCM sym,
   qsort (vec, item_index,
         sizeof (Substitution_entry), &Substitution_entry::item_compare);
 
-  Array<Slice> item_indices;
-  Array<Slice> spanner_indices;
+  std::vector<Slice> item_indices;
+  std::vector<Slice> spanner_indices;
   for (int i = 0; i <= system_range.length (); i++)
     {
-      item_indices.push (Slice (len, 0));
-      spanner_indices.push (Slice (len, 0));
+      item_indices.push_back (Slice (len, 0));
+      spanner_indices.push_back (Slice (len, 0));
     }
 
-  Array<Slice> *arrs[]
+  std::vector<Slice> *arrs[]
     = {
     &item_indices, &spanner_indices
   };
@@ -380,14 +380,14 @@ Spanner::fast_substitute_grob_array (SCM sym,
     is a waste of time -- the staff-spanners screw up the
     ordering, since they go across the entire score.
   */
-  for (int i = spanner_indices.size (); i--;)
+  for (vsize i = spanner_indices.size (); i--;)
     spanner_indices[i] = Slice (spanner_index, len - 1);
 
   assert (item_index <= spanner_index);
 
-  assert ((broken_intos_.size () == system_range.length () + 1)
-         || (broken_intos_.is_empty () && system_range.length () == 0));
-  for (int i = 0; i < broken_intos_.size (); i++)
+  assert ((broken_intos_.size () == (vsize)system_range.length () + 1)
+         || (broken_intos_.empty () && system_range.length () == 0));
+  for (vsize i = 0; i < broken_intos_.size (); i++)
     {
       Grob *sc = broken_intos_[i];
       System *l = sc->get_system ();
@@ -488,7 +488,7 @@ Spanner::substitute_one_mutable_property (SCM sym,
     fast_done = s->fast_substitute_grob_array (sym, grob_array);
 
   if (!fast_done)
-    for (int i = 0; i < s->broken_intos_.size (); i++)
+    for (vsize i = 0; i < s->broken_intos_.size (); i++)
       {
        Grob *sc = s->broken_intos_[i];
        System *l = sc->get_system ();
index b20985f95e9a432689e349bbd168f20838b38504..e079e982c0aa1845698dbe54c5746e0452425ebd 100644 (file)
@@ -56,7 +56,7 @@ Chord_name_engraver::Chord_name_engraver ()
 void
 Chord_name_engraver::add_note (Music *n)
 {
-  notes_.push (n);
+  notes_.push_back (n);
 }
 
 void
@@ -70,7 +70,7 @@ Chord_name_engraver::process_music ()
   SCM pitches = SCM_EOL;
 
   Music *inversion_event = 0;
-  for (int i = 0; i < notes_.size (); i++)
+  for (vsize i = 0; i < notes_.size (); i++)
     {
       Music *n = notes_[i];
       SCM p = n->get_property ("pitch");
index c5eecd6b9ca03279621596d5323e65c44db5add6..82917369445924595a86fb616df592eaeca9f54e 100644 (file)
@@ -60,7 +60,7 @@ Cluster_spanner_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("cluster-note-event"))
     {
-      cluster_notes_.push (m);
+      cluster_notes_.push_back (m);
       return true;
     }
   else if (m->is_mus_type ("busy-playing-event"))
@@ -80,7 +80,7 @@ Cluster_spanner_engraver::process_music ()
       int pmax = INT_MIN;
       int pmin = INT_MAX;
 
-      for (int i = 0; i < cluster_notes_.size (); i++)
+      for (vsize i = 0; i < cluster_notes_.size (); i++)
        {
          Pitch *pit = unsmob_pitch (cluster_notes_[i]->get_property ("pitch"));
 
index a81df96cc4d1dad9d861b75ba89cafcb0e13a5ff..02fd9e3b40e2de9f611e1084d07b6e54d85e7739 100644 (file)
@@ -27,7 +27,7 @@ using namespace std;
   TODO: Add support for cubic spline segments.
 */
 Stencil
-brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_points)
+brew_cluster_piece (Grob *me, std::vector<Offset> bottom_points, std::vector<Offset> top_points)
 {
   Real blotdiameter = Staff_symbol_referencer::staff_space (me) / 2;
 
@@ -50,7 +50,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
     }
 
   Stencil out;
-  Array<Offset> points;
+  std::vector<Offset> points;
   points.clear ();
   int size = bottom_points.size ();
   if (shape == "leftsided-stairs")
@@ -100,14 +100,14 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
     }
   else if (shape == "ramp")
     {
-      points.push (bottom_points[0] - vpadding + hpadding);
+      points.push_back (bottom_points[0] - vpadding + hpadding);
       for (int i = 1; i < size - 1; i++)
-       points.push (bottom_points[i] - vpadding);
-      points.push (bottom_points[size - 1] - vpadding - hpadding);
-      points.push (top_points[size - 1] + vpadding - hpadding);
+       points.push_back (bottom_points[i] - vpadding);
+      points.push_back (bottom_points[size - 1] - vpadding - hpadding);
+      points.push_back (top_points[size - 1] + vpadding - hpadding);
       for (int i = size - 2; i > 0; i--)
-       points.push (top_points[i] + vpadding);
-      points.push (top_points[0] + vpadding + hpadding);
+       points.push_back (top_points[i] + vpadding);
+      points.push_back (top_points[0] + vpadding + hpadding);
       out.add_stencil (Lookup::round_filled_polygon (points, blotdiameter));
     }
   else
@@ -134,7 +134,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");
-  if (cols.is_empty ())
+  if (cols.empty ())
     {
       me->warning (_ ("junking empty cluster"));
       me->suicide ();
@@ -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);
-  Array<Offset> bottom_points;
-  Array<Offset> top_points;
+  std::vector<Offset> bottom_points;
+  std::vector<Offset> top_points;
 
   Real left_coord = left_bound->relative_coordinate (commonx, X_AXIS);
 
@@ -154,15 +154,15 @@ Cluster::print (SCM smob)
     line with the center of the note heads?
 
   */
-  for (int i = 0; i < cols.size (); i++)
+  for (vsize i = 0; i < cols.size (); i++)
     {
       Grob *col = cols[i];
 
       Interval yext = col->extent (commony, Y_AXIS);
 
       Real x = col->relative_coordinate (commonx, X_AXIS) - left_coord;
-      bottom_points.push (Offset (x, yext[DOWN]));
-      top_points.push (Offset (x, yext[UP]));
+      bottom_points.push_back (Offset (x, yext[DOWN]));
+      top_points.push_back (Offset (x, yext[UP]));
     }
 
   /*
index 8ab2e16f2d15a37b3eb9b88a0a8714edd1af524f..113c3b26660afab110e73bd5c30bfd7e42a238f3 100644 (file)
@@ -35,7 +35,7 @@
  * - collapse superflous space after each ligature (TODO).
  *
  * Concrete subclasses must implement function build_ligature (Spanner
- * *, Array<Grob_info>).  This function is responsible for actually
+ * *, std::vector<Grob_info>).  This function is responsible for actually
  * building the ligature by transforming the array of noteheads.
  *
  * Currently, there are two subclasses: Gregorian_ligature_engraver
@@ -125,7 +125,7 @@ Coherent_ligature_engraver::get_set_column (Item *item, Paper_column *column)
 
       extract_item_set (parent, "elements", elements);
 
-      for (int i = elements.size (); i--;)
+      for (vsize i = elements.size (); i--;)
        {
          Item *sibling = elements[i];
          if ((sibling)
@@ -159,18 +159,18 @@ 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 *, Array<Grob_info>)
+Coherent_ligature_engraver::collect_accidentals (Spanner *, std::vector<Grob_info>)
 {
   /* TODO */
 }
 
 void
-compute_delta_pitches (Array<Grob_info> primitives)
+compute_delta_pitches (std::vector<Grob_info> primitives)
 {
   int prev_pitch = 0;
   int delta_pitch = 0;
   Item *prev_primitive = 0, *primitive = 0;
-  for (int i = 0; i < primitives.size (); i++)
+  for (vsize i = 0; i < primitives.size (); i++)
     {
       primitive = dynamic_cast<Item *> (primitives[i].grob ());
       Music *music_cause = primitives[i].music_cause ();
@@ -190,7 +190,7 @@ compute_delta_pitches (Array<Grob_info> primitives)
 
 void
 Coherent_ligature_engraver::typeset_ligature (Spanner *ligature,
-                                             Array<Grob_info> primitives)
+                                             std::vector<Grob_info> primitives)
 {
   // compute some commonly needed context info stored as grob
   // properties
index 637d6d964311ef86ba06a27f0c78953458ec68c4..285dd9082081f64e65c49470048475495ee28fcf 100644 (file)
@@ -32,7 +32,7 @@ Collision_engraver::process_acknowledged ()
   if (!col_)
     col_ = make_item ("NoteCollision", SCM_EOL);
 
-  for (int i = 0; i < note_columns_.size (); i++)
+  for (vsize i = 0; i < note_columns_.size (); i++)
     Note_collision_interface::add_column (col_, note_columns_[i]);
 }
 
@@ -45,7 +45,7 @@ Collision_engraver::acknowledge_note_column (Grob_info i)
       if (Note_column::has_rests (i.grob ()) || i.grob ()->get_parent (X_AXIS))
        return;
 
-      note_columns_.push (i.grob ());
+      note_columns_.push_back (i.grob ());
     }
 }
 
index 3ab3a3f6e2865c43695e76c060ec104638b2438a..7bdf2e3ba5d1f685f39c252ae387fcd650cb7510 100644 (file)
@@ -81,7 +81,7 @@ Completion_heads_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("note-event"))
     {
-      note_events_.push (m);
+      note_events_.push_back (m);
 
       is_first_ = true;
       Moment musiclen = m->get_length ();
@@ -192,15 +192,14 @@ Completion_heads_engraver::process_music ()
   if (orig && note_dur.get_length () != orig->get_length ())
     {
       if (!scratch_note_events_.size ())
-       for (int i = 0; i < note_events_.size (); i++)
+       for (vsize i = 0; i < note_events_.size (); i++)
          {
            Music *m = note_events_[i]->clone ();
-           scratch_note_events_.push (m);
+           scratch_note_events_.push_back (m);
          }
     }
 
-  for (int i = 0;
-       left_to_do_ && i < note_events_.size (); i++)
+  for (vsize i = 0; left_to_do_ && i < note_events_.size (); i++)
     {
       Music *event = note_events_[i];
       if (scratch_note_events_.size ())
@@ -229,7 +228,7 @@ Completion_heads_engraver::process_music ()
            d->set_property ("dot-count", scm_from_int (dots));
 
          d->set_parent (note, Y_AXIS);
-         dots_.push (d);
+         dots_.push_back (d);
        }
 
       Pitch *pit = unsmob_pitch (event->get_property ("pitch"));
@@ -240,18 +239,18 @@ Completion_heads_engraver::process_music ()
        pos += scm_to_int (c0);
 
       note->set_property ("staff-position", scm_from_int (pos));
-      notes_.push (note);
+      notes_.push_back (note);
     }
 
   if (prev_notes_.size () == notes_.size ())
     {
-      for (int i = 0; i < notes_.size (); i++)
+      for (vsize i = 0; i < notes_.size (); i++)
        {
          Grob *p = make_spanner ("Tie", SCM_EOL);
          Tie::set_head (p, LEFT, prev_notes_[i]);
          Tie::set_head (p, RIGHT, notes_[i]);
 
-         ties_.push (p);
+         ties_.push_back (p);
        }
     }
 
@@ -276,7 +275,7 @@ Completion_heads_engraver::stop_translation_timestep ()
 
   dots_.clear ();
 
-  for (int i = scratch_note_events_.size (); i--;)
+  for (vsize i = scratch_note_events_.size (); i--;)
     scratch_note_events_[i]->unprotect ();
 
   scratch_note_events_.clear ();
index ee4220469aa7f42369a7b1ec957a48d2e8a1c69d..545afabb1a7ffc626c22ace0659665f1aadf39d3 100644 (file)
@@ -203,22 +203,22 @@ Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const
   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 (t);
+      accepteds.push_back (t);
 
   Link_array<Context_def> best_result;
-  for (int i = 0; i < accepteds.size (); i++)
+  for (vsize i = 0; i < accepteds.size (); i++)
     {
       /* do not check aliases, because \context Staff should not
         create RhythmicStaff. */
       if (ly_is_equal (accepteds[i]->get_context_name (), type_sym))
        {
-         best_result.push (accepteds[i]);
+         best_result.push_back (accepteds[i]);
          return best_result;
        }
     }
 
-  int best_depth = INT_MAX;
-  for (int i = 0; i < accepteds.size (); i++)
+  vsize best_depth = UINT_MAX;
+  for (vsize i = 0; i < accepteds.size (); i++)
     {
       Context_def *g = accepteds[i];
 
index cc4536279e1c25557ea44d85adfe2644c4b1d5db..405dc4b5d4ef64e08716ad47a8cefce5701fbc15 100644 (file)
@@ -132,7 +132,7 @@ Context::create_unique_context (SCM n, SCM operations)
       Context *current = this;
 
       // start at 1.  The first one (index 0) will be us.
-      for (int i = 0; i < path.size (); i++)
+      for (vsize i = 0; i < path.size (); i++)
        {
          SCM ops = (i == path.size () -1) ? operations : SCM_EOL;
 
@@ -190,7 +190,7 @@ Context::find_create_context (SCM n, std::string id, SCM operations)
       Context *current = this;
 
       // start at 1.  The first one (index 0) will be us.
-      for (int i = 0; i < path.size (); i++)
+      for (vsize i = 0; i < path.size (); i++)
        {
          SCM ops = (i == path.size () -1) ? operations : SCM_EOL;
 
index eb292f86e5aa2a1c910bacda7f6ac863bba299c7..53f24a6f7ce18be68cdacc41ce05e99fd9881a25 100644 (file)
@@ -38,7 +38,7 @@ private:
   Item *create_custos ();
   bool custos_permitted_;
   Link_array<Grob> custodes_;
-  Array<Pitch> pitches_;
+  std::vector<Pitch> pitches_;
 };
 
 Custos_engraver::Custos_engraver ()
@@ -85,7 +85,7 @@ Custos_engraver::acknowledge_note_head (Grob_info info)
        don't look at the staff-position, since we can't be sure
        whether Clef_engraver already applied a vertical shift.
       */
-      pitches_.push (*unsmob_pitch (m->get_property ("pitch")));
+      pitches_.push_back (*unsmob_pitch (m->get_property ("pitch")));
     }
 }
 
@@ -97,7 +97,7 @@ Custos_engraver::process_acknowledged ()
 
   if (custos_permitted_)
     {
-      for (int i = pitches_.size (); i--;)
+      for (vsize i = pitches_.size (); i--;)
        {
          Item *c = create_custos ();
 
@@ -119,7 +119,7 @@ Custos_engraver::create_custos ()
 {
   Item *custos = make_item ("Custos", SCM_EOL);
 
-  custodes_.push (custos);
+  custodes_.push_back (custos);
 
   return custos;
 }
@@ -127,7 +127,7 @@ Custos_engraver::create_custos ()
 void
 Custos_engraver::finalize ()
 {
-  for (int i = custodes_.size (); i--;)
+  for (vsize i = custodes_.size (); i--;)
     custodes_[i]->suicide ();
   custodes_.clear ();
 }
index 630e154d9578545bfd2c78a3d8ea2ca4c11918b2..78dbcabb4ca40fd8bc86289aa885847110b6944e 100644 (file)
@@ -212,7 +212,7 @@ Dot_column::calc_positioning_done (SCM smob)
       dots when merging.
     */
     Grob *c = 0;
-    for (int i = dots.size (); i--;)
+    for (vsize i = dots.size (); i--;)
       {
        Grob *n = dots[i]->get_parent (Y_AXIS);
        if (c)
@@ -220,7 +220,7 @@ Dot_column::calc_positioning_done (SCM smob)
        else
          c = n;
       }
-    for (int i = dots.size (); i--;)
+    for (vsize i = dots.size (); i--;)
       {
        Grob *n = dots[i]->get_parent (Y_AXIS);
        n->relative_coordinate (c, X_AXIS);
@@ -228,12 +228,12 @@ Dot_column::calc_positioning_done (SCM smob)
   }
 
   dots.sort (compare_position);
-  for (int i = dots.size (); i--;)
+  for (vsize i = dots.size (); i--;)
     if (!dots[i]->is_live ())
       dots.del (i);
 
   Dot_configuration cfg;
-  for (int i = 0;i < dots.size (); i++)
+  for (vsize i = 0;i < dots.size (); i++)
     {
       Dot_position dp;
       dp.dot_ = dots[i];
index 1b95c519ad29b2e8d5c7d99e6799d251e617b468..4494e2c72990bf691405f4168434741ba1be8c35 100644 (file)
@@ -43,7 +43,7 @@ Drum_notes_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("note-event"))
     {
-      events_.push (m);
+      events_.push_back (m);
       return true;
     }
   else if (m->is_mus_type ("busy-playing-event"))
@@ -56,7 +56,7 @@ void
 Drum_notes_engraver::process_music ()
 {
   SCM tab = 0;
-  for (int i = 0; i < events_.size (); i++)
+  for (vsize i = 0; i < events_.size (); i++)
     {
       if (!tab)
        tab = get_property ("drumStyleTable");
@@ -79,7 +79,7 @@ Drum_notes_engraver::process_music ()
 
          d->set_parent (note, Y_AXIS);
 
-         dots_.push (d);
+         dots_.push_back (d);
        }
 
       SCM drum_type = ev->get_property ("drum-type");
@@ -108,18 +108,18 @@ Drum_notes_engraver::process_music ()
 
              p->set_parent (note, Y_AXIS);
              Side_position_interface::add_support (p, note);
-             scripts_.push (p);
+             scripts_.push_back (p);
            }
        }
 
-      notes_.push (note);
+      notes_.push_back (note);
     }
 }
 
 void
 Drum_notes_engraver::acknowledge_stem (Grob_info inf)
 {
-  for (int i = 0; i < scripts_.size (); i++)
+  for (vsize i = 0; i < scripts_.size (); i++)
     {
       Grob *e = scripts_[i];
 
@@ -133,7 +133,7 @@ Drum_notes_engraver::acknowledge_stem (Grob_info inf)
 void
 Drum_notes_engraver::acknowledge_note_column (Grob_info inf)
 {
-  for (int i = 0; i < scripts_.size (); i++)
+  for (vsize i = 0; i < scripts_.size (); i++)
     {
       Grob *e = scripts_[i];
 
index e0a0606df3ef53ceab91b40c157dcb39eb80d884..dd83e6699f2b2b9a37812952ab22506f6e3c8cb2 100644 (file)
@@ -53,7 +53,7 @@ Drum_note_performer::process_music ()
          Audio_note *p = new Audio_note (*pit, n->get_length (), 0);
          Audio_element_info info (p, n);
          announce_element (info);
-         notes_.push (p);
+         notes_.push_back (p);
        }
     }
 
@@ -66,7 +66,7 @@ Drum_note_performer::stop_translation_timestep ()
   // why don't grace notes show up here?
   // --> grace notes effectively do not get delayed
   Moment now = now_mom ();
-  for (int i = 0; i < notes_.size (); i++)
+  for (vsize i = 0; i < notes_.size (); i++)
     play_element (notes_[i]);
   notes_.clear ();
   note_evs_.clear ();
@@ -77,7 +77,7 @@ Drum_note_performer::try_music (Music *ev)
 {
   if (ev->is_mus_type ("note-event"))
     {
-      note_evs_.push (ev);
+      note_evs_.push_back (ev);
       return true;
     }
   else if (ev->is_mus_type ("busy-playing-event"))
index 2e10d71fdf60ea1bb42c3483c53dc76e4ac6df87..c1e6f57cf55075e18aa5040a1028af05af1846bc 100644 (file)
@@ -44,7 +44,7 @@ Enclosing_bracket::print (SCM grob)
 {
   Grob *me = unsmob_grob (grob);
   extract_grob_set (me, "elements", elements);
-  if (elements.is_empty ())
+  if (elements.empty ())
     {
       me->suicide ();
       return SCM_EOL;
index 36b283810365ed9a5eed87c58dd364d731d4f6c3..5742288d69cc46b8d3407da3fb991ec7e4efb384 100644 (file)
@@ -17,7 +17,7 @@
 void
 Engraver_group::announce_grob (Grob_info info)
 {
-  announce_infos_.push (info);
+  announce_infos_.push_back (info);
 
   Engraver_group *dad_eng
     = context_->get_parent_context ()
@@ -36,7 +36,7 @@ Engraver_group::acknowledge_grobs ()
   SCM name_sym = ly_symbol2scm ("name");
   SCM meta_sym = ly_symbol2scm ("meta");
 
-  for (int j = 0; j < announce_infos_.size (); j++)
+  for (vsize j = 0; j < announce_infos_.size (); j++)
     {
       Grob_info info = announce_infos_[j];
 
index a0799a7ff0d2f60eeb99780bdf17a644577258b1..d3b2e90972facbdee6b1579468aedafb9900d345 100644 (file)
@@ -116,7 +116,7 @@ completize_extender (Spanner *sp)
     {
       extract_item_set (sp, "heads", heads);
       if (heads.size ())
-       sp->set_bound (RIGHT, heads.top ());
+       sp->set_bound (RIGHT, heads.back ());
     }
 }
 
index ad94209b65b216a2db416c716967fe942cf33a97..45cb543821d5bc99153f1a6e17969be7c5f9b4b2 100644 (file)
@@ -34,7 +34,7 @@ Figured_bass_continuation::center_on_figures (SCM grob)
 {
   Spanner *me = dynamic_cast<Spanner*> (unsmob_grob (grob));
   extract_grob_set (me, "figures", figures);
-  if (figures.is_empty ())
+  if (figures.empty ())
     return scm_from_double (0.0);
   Grob *common = common_refpoint_of_array (figures, me, Y_AXIS);
 
index c67cb60881c431a83e1df475b0c001d1807011d4..ee5517e94bcec9fca3a5f05b1477d3122d68fc33 100644 (file)
@@ -66,7 +66,7 @@ struct Figured_bass_engraver : public Engraver
   void center_continuations (Link_array<Spanner> const &consecutive_lines);
   void center_repeated_continuations ();
 protected:
-  Array<Figure_group> groups_;
+  std::vector<Figure_group> groups_;
   Spanner *alignment_;
   Link_array<Music> new_musics_;
   bool continuation_;
@@ -86,7 +86,7 @@ protected:
 void
 Figured_bass_engraver::derived_mark () const
 {
-  for (int i = 0; i < groups_.size (); i++)
+  for (vsize i = 0; i < groups_.size (); i++)
     {
       scm_gc_mark (groups_[i].number_);
       scm_gc_mark (groups_[i].alteration_);
@@ -96,13 +96,13 @@ Figured_bass_engraver::derived_mark () const
 void
 Figured_bass_engraver::stop_translation_timestep ()
 {
-  if (groups_.is_empty ()
+  if (groups_.empty ()
       || now_mom ().main_part_ < stop_moment_.main_part_
       || now_mom ().grace_part_ < Rational (0))
     return ;
   
   bool found = false;
-  for (int i = 0; !found && i < groups_.size (); i++)
+  for (vsize i = 0; !found && i < groups_.size (); i++)
     found  = found  || groups_[i].current_music_;
 
   if (!found)
@@ -126,10 +126,8 @@ Figured_bass_engraver::start_translation_timestep ()
   
   rest_event_ = 0;
   new_musics_.clear ();
-  for (int i = 0; i < groups_.size (); i++)
-    {
-      groups_[i].current_music_ = 0;
-    }
+  for (vsize i = 0; i < groups_.size (); i++)
+    groups_[i].current_music_ = 0;
   continuation_ = false;
 }
 
@@ -147,7 +145,7 @@ Figured_bass_engraver::try_music (Music *m)
       stop_moment_ = now_mom () + m->get_length ();
      
       SCM fig = m->get_property ("figure");
-      for (int i = 0; i < groups_.size (); i++)
+      for (vsize i = 0; i < groups_.size (); i++)
        {
          if (!groups_[i].current_music_
              && ly_is_equal (groups_[i].number_, fig))
@@ -160,7 +158,7 @@ Figured_bass_engraver::try_music (Music *m)
            }
        }
 
-      new_musics_.push (m);
+      new_musics_.push_back (m);
 
       return true;
     }
@@ -172,13 +170,13 @@ Figured_bass_engraver::center_continuations (Link_array<Spanner> const &consecut
   if (consecutive_lines.size () == 2)
     {
       Link_array<Grob> left_figs;
-      for (int j = consecutive_lines.size(); j--;)
-       left_figs.push (consecutive_lines[j]->get_bound (LEFT));
+      for (vsize j = consecutive_lines.size(); j--;)
+       left_figs.push_back (consecutive_lines[j]->get_bound (LEFT));
 
       SCM  ga = Grob_array::make_array ();
       unsmob_grob_array (ga)->set_array (left_figs);
 
-      for (int j = consecutive_lines.size(); j--;)
+      for (vsize j = consecutive_lines.size(); j--;)
        consecutive_lines[j]->set_object ("figures",
                                          unsmob_grob_array (ga)->smobbed_copy ());
     }
@@ -188,18 +186,16 @@ void
 Figured_bass_engraver::center_repeated_continuations ()
 {  
   Link_array<Spanner> consecutive_lines;
-  for (int i = 0; i <= groups_.size(); i++)
+  for (vsize i = 0; i <= groups_.size(); i++)
     {
       if (i < groups_.size ()
          && groups_[i].continuation_line_
-         && (consecutive_lines.is_empty ()
+         && (consecutive_lines.empty ()
              || (consecutive_lines[0]->get_bound(LEFT)->get_column ()
                  == groups_[i].continuation_line_->get_bound (LEFT)->get_column ()
                  && consecutive_lines[0]->get_bound(RIGHT)->get_column ()
                  == groups_[i].continuation_line_->get_bound (RIGHT)->get_column ())))
-       {
-         consecutive_lines.push (groups_[i].continuation_line_);         
-       }
+       consecutive_lines.push_back (groups_[i].continuation_line_);      
       else 
        {
          center_continuations (consecutive_lines);
@@ -226,25 +222,23 @@ Figured_bass_engraver::add_brackets ()
 {
   Link_array<Grob> encompass;
   bool inside = false;
-  for (int i = 0; i < groups_.size (); i ++)
+  for (vsize i = 0; i < groups_.size (); i ++)
     {
       if (!groups_[i].current_music_)
        continue;
       
       if (to_boolean (groups_[i].current_music_->get_property ("bracket-start")))      
-       {
-         inside = true;
-       }
+       inside = true;
 
       if (inside && groups_[i].figure_item_)
-       encompass.push (groups_[i].figure_item_);
+       encompass.push_back (groups_[i].figure_item_);
 
        if (to_boolean (groups_[i].current_music_->get_property ("bracket-stop")))
        {
          inside = false;
 
          Item * brack = make_item ("BassFigureBracket", groups_[i].current_music_->self_scm ());
-         for (int j = 0; j < encompass.size (); j++)
+         for (vsize j = 0; j < encompass.size (); j++)
            {
              Pointer_group_interface::add_grob (brack,
                                                 ly_symbol2scm ("elements"),
@@ -265,14 +259,14 @@ Figured_bass_engraver::process_music ()
     }
   
   if (!continuation_
-      && new_musics_.is_empty ())
+      && new_musics_.empty ())
     {
       clear_spanners ();
       return;
     }
 
   if (!new_music_found_)
-    return ;
+    return;
   
   new_music_found_ = false;
 
@@ -285,7 +279,7 @@ Figured_bass_engraver::process_music ()
       if (to_boolean (get_property ("figuredBassCenterContinuations")))
        center_repeated_continuations ();
       alignment_ = 0;
-      for (int i = 0; i < groups_.size (); i++)
+      for (vsize i = 0; i < groups_.size (); i++)
        {
          groups_[i].group_ = 0;
          groups_[i].continuation_line_ = 0;
@@ -293,21 +287,19 @@ Figured_bass_engraver::process_music ()
     }
   
   if (!continuation_)
-    {
-      clear_spanners ();
-    }
+    clear_spanners ();
   
-  int k = 0;
-  for (int i = 0; i < new_musics_.size (); i++)
+  vsize k = 0;
+  for (vsize i = 0; i < new_musics_.size (); i++)
     {
-      while (k < groups_.size() &&
-            groups_[k].current_music_)
+      while (k < groups_.size ()
+            && groups_[k].current_music_)
        k++;
       
       if (k >= groups_.size ())
        {
          Figure_group group;
-         groups_.push (group);
+         groups_.push_back (group);
        }
       
       groups_[k].current_music_ = new_musics_[i];
@@ -315,7 +307,7 @@ Figured_bass_engraver::process_music ()
       k++;
     }
 
-  for (int i = 0; i < groups_.size (); i++)
+  for (vsize i = 0; i < groups_.size (); i++)
     {
       if (!groups_[i].is_continuation ())
        {
@@ -326,8 +318,8 @@ Figured_bass_engraver::process_music ()
 
   if (use_extenders)
     {
-      Array<int> junk_continuations;
-      for (int i = 0; i < groups_.size(); i++)
+      std::vector<int> junk_continuations;
+      for (vsize i = 0; i < groups_.size(); i++)
        {
                Figure_group &group = groups_[i];
 
@@ -351,7 +343,7 @@ Figured_bass_engraver::process_music ()
                }
            }
          else if (group.continuation_line_) 
-           junk_continuations.push (i); 
+           junk_continuations.push_back (i); 
        }
 
       /*
@@ -360,21 +352,21 @@ Figured_bass_engraver::process_music ()
       Link_array<Spanner> consecutive;
       if (to_boolean (get_property ("figuredBassCenterContinuations")))
        {
-         for (int i = 0; i <= junk_continuations.size (); i++)
+         for (vsize i = 0; i <= junk_continuations.size (); i++)
            {
              if (i < junk_continuations.size()
                  && (i == 0 || junk_continuations[i-1] == junk_continuations[i] - 1))
-               consecutive.push (groups_[junk_continuations[i]].continuation_line_);
+               consecutive.push_back (groups_[junk_continuations[i]].continuation_line_);
              else 
                {
                  center_continuations (consecutive);
                  consecutive.clear ();
                  if (i < junk_continuations.size ())
-                   consecutive.push (groups_[junk_continuations[i]].continuation_line_);
+                   consecutive.push_back (groups_[junk_continuations[i]].continuation_line_);
                }
            }
        }
-      for (int i = 0; i < junk_continuations.size (); i++)
+      for (vsize i = 0; i < junk_continuations.size (); i++)
        groups_[junk_continuations[i]].continuation_line_ = 0;
     }
   
@@ -394,7 +386,7 @@ Figured_bass_engraver::create_grobs ()
   alignment_->set_bound (RIGHT, muscol);
 
   SCM proc = get_property ("figuredBassFormatter");
-  for (int i = 0; i < groups_.size(); i++)
+  for (vsize i = 0; i < groups_.size(); i++)
     {
       Figure_group &group = groups_[i];
       
@@ -460,19 +452,20 @@ ADD_TRANSLATOR (Figured_bass_engraver,
                /* create */
                "BassFigure "
                "BassFigureAlignment "
-               "BassFigureBracket",
+               "BassFigureBracket "
                "BassFigureContinuation "
                "BassFigureLine "
-
+               ,
                /* accept */
                "bass-figure-event rest-event",
 
                /* read */
+               "figuredBassAlterationDirection "
                "figuredBassCenterContinuations "
-               "implicitBassFigures "
                "figuredBassFormatter "
-               "figuredBassAlterationDirection "
-               "useBassFigureExtenders",
+               "implicitBassFigures "
+               "useBassFigureExtenders "
+               ,
 
                /* write */
                "");
index 117ead2c81e3dca90ccb8d026993af90d4bbe059..e45de84b14fabad1fede39303d67c3a91eee0bac 100644 (file)
@@ -36,7 +36,7 @@ Fingering_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("fingering-event"))
     {
-      events_.push (m);
+      events_.push_back (m);
       return true;
     }
   return false;
@@ -45,14 +45,14 @@ Fingering_engraver::try_music (Music *m)
 void
 Fingering_engraver::acknowledge_stem (Grob_info inf)
 {
-  for (int i = 0; i < fingerings_.size (); i++)
+  for (vsize i = 0; i < fingerings_.size (); i++)
     Side_position_interface::add_support (fingerings_[i], inf.grob ());
 }
 
 void
 Fingering_engraver::acknowledge_rhythmic_head (Grob_info inf)
 {
-  for (int i = 0; i < fingerings_.size (); i++)
+  for (vsize i = 0; i < fingerings_.size (); i++)
     {
       Grob *t = fingerings_[i];
       Side_position_interface::add_support (t, inf.grob ());
@@ -64,7 +64,7 @@ Fingering_engraver::acknowledge_rhythmic_head (Grob_info inf)
 void
 Fingering_engraver::process_music ()
 {
-  for (int i = events_.size (); i--;)
+  for (vsize i = events_.size (); i--;)
     {
       SCM dir = events_[i]->get_property ("direction");
       make_script (to_dir (dir), events_[i], i);
@@ -115,7 +115,7 @@ Fingering_engraver::make_script (Direction d, Music *r, int i)
   SCM dig = r->get_property ("digit");
   fingering->set_property ("text", scm_number_to_string (dig, scm_from_int (10)));
 
-  fingerings_.push (fingering);
+  fingerings_.push_back (fingering);
 }
 
 void
index 66aba66409ce42da83fa4f17ce577dcf8b269214..c90598b72a2b44e9474058f8080baefc15721317 100644 (file)
@@ -37,12 +37,12 @@ init_fontconfig ()
   if (!is_file ((char*)cache_file))
     message (_f ("Rebuilding FontConfig cache %s. this may take a while...", cache_file));
                        
-  Array<std::string> dirs;
+  std::vector<std::string> dirs;
 
-  dirs.push (prefix_directory + "/fonts/otf/");
-  dirs.push (prefix_directory + "/fonts/type1/");
+  dirs.push_back (prefix_directory + "/fonts/otf/");
+  dirs.push_back (prefix_directory + "/fonts/type1/");
   
-  for (int i = 0; i < dirs.size (); i++)
+  for (vsize i = 0; i < dirs.size (); i++)
     {
       std::string dir = dirs[i];
       if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.c_str ()))
index 933a34b991f46835b32cfc6fcf871a4608c76d42..3e1d23cf11ef79b224f1d28a5db1d2d87bf78ff2 100644 (file)
@@ -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.")
 {
-  Array<std::string> output_formats = split_string (output_format_global, ',');
+  std::vector<std::string> output_formats = split_string (output_format_global, ',');
 
   SCM lst = SCM_EOL;
   int output_formats_count = output_formats.size ();
index 6c8b4e62f001fc65cacf47443797ed8605ed3a48..df2f1f516096b91532a2dedb59e4e2adb45562d3 100644 (file)
@@ -52,7 +52,7 @@ Global_context::add_moment_to_process (Moment m)
   if (m < now_mom_)
     programming_error ("trying to freeze in time");
 
-  for (int i = 0; i < extra_mom_pq_.size (); i++)
+  for (vsize i = 0; i < extra_mom_pq_.size (); i++)
     if (extra_mom_pq_[i] == m)
       return;
   extra_mom_pq_.insert (m);
index c5845be33ec009e8d84640c5c00002832aca9053..e0bd7492966b4049c4eb0c1527a38769bd4ea474 100644 (file)
@@ -8,21 +8,21 @@
 
 #include "global-ctor.hh"
 
-#include "array.hh"
+#include "std-vector.hh"
 
-static Array<Global_ctor> *ctor_global_statics_;
+static std::vector<Global_ctor> *ctor_global_statics_;
 
 void
 add_constructor (Global_ctor c)
 {
   if (!ctor_global_statics_)
-    ctor_global_statics_ = new Array<Global_ctor>;
-  ctor_global_statics_->push (c);
+    ctor_global_statics_ = new std::vector<Global_ctor>;
+  ctor_global_statics_->push_back (c);
 }
 
 void
 call_constructors ()
 {
-  for (int i = 0; i < ctor_global_statics_->size (); i++)
+  for (vsize i = 0; i < ctor_global_statics_->size (); i++)
     (ctor_global_statics_->elem (i)) ();
 }
index 4438abd491b8901279ec76ba92e877d2558a5afc..f9ff08b6af31337e61dca877fe825c9e5c4808ad 100644 (file)
@@ -57,9 +57,9 @@ struct Break_node
 };
 
 void
-print_break_nodes (Array<Break_node> const &arr)
+print_break_nodes (std::vector<Break_node> const &arr)
 {
-  for (int i = 0; i < arr.size (); i++)
+  for (vsize i = 0; i < arr.size (); i++)
     {
       printf ("node %d: ", i);
       arr[i].print ();
@@ -74,23 +74,23 @@ print_break_nodes (Array<Break_node> const &arr)
    TODO: should rewrite. See the function in scm/page-layout.scm for
    inspiration.
 */
-Array<Column_x_positions>
+std::vector<Column_x_positions>
 Gourlay_breaking::do_solve () const
 {
-  Array<Break_node> optimal_paths;
+  std::vector<Break_node> optimal_paths;
   Link_array<Grob> all
     = pscore_->root_system ()->columns ();
 
-  Array<int> breaks = find_break_indices ();
+  std::vector<int> breaks = find_break_indices ();
 
   Break_node first_node;
-  optimal_paths.push (first_node);
+  optimal_paths.push_back (first_node);
 
   bool ragged_right = to_boolean (pscore_->layout ()->c_variable ("raggedright"));
   bool ragged_last = to_boolean (pscore_->layout ()->c_variable ("raggedlast"));
 
   Real worst_force = 0.0;
-  for (int break_idx = 1; break_idx < breaks.size (); break_idx++)
+  for (vsize break_idx = 1; break_idx < breaks.size (); break_idx++)
     {
       /*
        start with a short line, add measures. At some point
@@ -102,12 +102,13 @@ Gourlay_breaking::do_solve () const
 
       Real minimal_demerits = infinity_f;
 
-      for (int start_idx = break_idx; start_idx--;)
+      for (vsize start_idx = break_idx; start_idx--;)
        {
-         Link_array<Grob> line = all.slice (breaks[start_idx], breaks[break_idx] + 1);
+         Link_array<Grob> line = all.slice (breaks[start_idx],
+                                            breaks[break_idx] + 1);
 
          line[0] = dynamic_cast<Item *> (line[0])->find_prebroken_piece (RIGHT);
-         line.top () = dynamic_cast<Item *> (line.top ())->find_prebroken_piece (LEFT);
+         line.back () = dynamic_cast<Item *> (line.back ())->find_prebroken_piece (LEFT);
 
          Column_x_positions cp;
          cp.cols_ = line;
@@ -172,7 +173,7 @@ Gourlay_breaking::do_solve () const
          bnod.line_config_ = minimal_sol;
        }
       bnod.line_ = optimal_paths[bnod.prev_break_].line_ + 1;
-      optimal_paths.push (bnod);
+      optimal_paths.push_back (bnod);
 
       if (! (break_idx % HAPPY_DOTS))
        progress_indication (std::string ("[") + to_string (break_idx) + "]");
@@ -184,14 +185,14 @@ Gourlay_breaking::do_solve () const
 
   progress_indication ("\n");
 
-  Array<int> final_breaks;
-  Array<Column_x_positions> lines;
+  std::vector<int> final_breaks;
+  std::vector<Column_x_positions> lines;
 
   /* skip 0-th element, since it is a "dummy" elt*/
-  for (int i = optimal_paths.size () - 1; i > 0;)
+  for (vsize i = optimal_paths.size () - 1; i > 0;)
     {
-      final_breaks.push (i);
-      int prev = optimal_paths[i].prev_break_;
+      final_breaks.push_back (i);
+      vsize prev = optimal_paths[i].prev_break_;
       assert (i > prev);
       i = prev;
     }
@@ -199,17 +200,17 @@ Gourlay_breaking::do_solve () const
   if (be_verbose_global)
     {
       message (_f ("Optimal demerits: %f",
-                  optimal_paths.top ().demerits_) + "\n");
+                  optimal_paths.back ().demerits_) + "\n");
     }
 
-  if (optimal_paths.top ().demerits_ >= infinity_f)
+  if (optimal_paths.back ().demerits_ >= infinity_f)
     warning (_ ("no feasible line breaking found"));
 
-  for (int i = final_breaks.size (); i--;)
+  for (vsize i = final_breaks.size (); i--;)
     {
       Column_x_positions cp (optimal_paths[final_breaks[i]].line_config_);
 
-      lines.push (cp);
+      lines.push_back (cp);
       if (!cp.satisfies_constraints_)
        warning (_ ("can't find line breaking that satisfies constraints"));
     }
@@ -232,7 +233,7 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev,
                                    Column_x_positions const &this_one) const
 {
   Real break_penalties = 0.0;
-  Grob *pc = this_one.cols_.top ();
+  Grob *pc = this_one.cols_.back ();
   if (pc->original ())
     {
       SCM pen = pc->get_property ("penalty");
index 230a0e5425dc81de0ef9e562a441fde5818927df..82c84ffc4c634403265c7c965264d9d3bf22bd75 100644 (file)
@@ -84,10 +84,10 @@ 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 (Array<Grob_info> primitives)
+void check_and_fix_all_prefixes (std::vector<Grob_info> primitives)
 {
   /* Check for illegal head modifier combinations */
-  for (int i = 0; i < primitives.size (); i++)
+  for (vsize i = 0; i < primitives.size (); i++)
     {
       Grob *primitive = primitives[i].grob ();
 
@@ -195,13 +195,13 @@ void check_and_fix_all_prefixes (Array<Grob_info> primitives)
  * Marks those heads that participate in a pes or flexa.
  */
 void
-provide_context_info (Array<Grob_info> primitives)
+provide_context_info (std::vector<Grob_info> primitives)
 {
   Grob *prev_primitive = 0;
   int prev_prefix_set = 0;
   int prev_context_info = 0;
   int prev_pitch = 0;
-  for (int i = 0; i < primitives.size (); i++)
+  for (vsize i = 0; i < primitives.size (); i++)
     {
       Grob *primitive = primitives[i].grob ();
       Music *music_cause = primitives[i].music_cause ();
@@ -242,7 +242,7 @@ provide_context_info (Array<Grob_info> primitives)
 
 void
 Gregorian_ligature_engraver::build_ligature (Spanner *ligature,
-                                            Array<Grob_info> primitives)
+                                            std::vector<Grob_info> primitives)
 {
   // apply style-independent checking and transformation
   check_and_fix_all_prefixes (primitives);
index 29ae8c4595d29752b937e065038675e568f957b5..36dd333124575815ee3374ab0eb4a2538b60784a 100644 (file)
@@ -25,7 +25,7 @@ Grid_line_interface::print (SCM smobbed_me)
   Grob *refp = common_refpoint_of_array (elts, me, Y_AXIS);
   Interval iv;
 
-  for (int i = 0; i < elts.size (); i++)
+  for (vsize i = 0; i < elts.size (); i++)
     {
       Grob *point = elts[i];
 
index dc45a3a01c2d7197761f3e9d8dccb2489b717487..b7daf45eac4187a897975a70cc0e5efcc70b4878 100644 (file)
@@ -34,7 +34,7 @@ Grid_line_span_engraver::acknowledge_grid_point (Grob_info i)
   if (depth)
     {
       Item *it = dynamic_cast<Item *> (i.grob ());
-      lines_.push (it);
+      lines_.push_back (it);
 
       if (lines_.size () >= 2 && !spanline_)
        {
@@ -49,12 +49,12 @@ Grid_line_span_engraver::stop_translation_timestep ()
 {
   if (spanline_)
     {
-      for (int i = 0; i < lines_.size (); i++)
+      for (vsize i = 0; i < lines_.size (); i++)
        Grid_line_interface::add_grid_point (spanline_, lines_[i]);
 
       spanline_ = 0;
     }
-  lines_.set_size (0);
+  lines_.resize (0);
 }
 
 #include "translator.icc"
index 5788ef9dda243c696a2574933fd1a4684df54a44..d9f7d20e98145ff20d1466c467b9323e741b3c1e 100644 (file)
@@ -30,11 +30,9 @@ LY_DEFINE (ly_grob_array_ref, "ly:grob-array-ref",
   SCM_ASSERT_TYPE (me, grob_arr, SCM_ARG1, __FUNCTION__, "Grob_array");
   SCM_ASSERT_TYPE (scm_is_integer (index), index, SCM_ARG2, __FUNCTION__, "integer");
 
-  int i = scm_to_int (index);
-  if (i < 0 || i >= me->size ())
-    {
-      scm_out_of_range (NULL, scm_from_int (i)); 
-    }
+  vsize i = scm_to_unsigned (index);
+  if (i == VPOS || i >= me->size ())
+    scm_out_of_range (NULL, scm_from_unsigned (i)); 
   
   return me->grob (i)->self_scm ();
 }
index 9f8227ad26a84df16a97943261d7926679ae5247..fba025349d41dba02af11d97485bf9aa83c556cd 100644 (file)
 #include "ly-smobs.icc"
 
 Item *
-Grob_array::item (int i)
+Grob_array::item (vsize i)
 {
   return dynamic_cast<Item *> (grobs_.elem (i));
 }
 
 Spanner *
-Grob_array::spanner (int i)
+Grob_array::spanner (vsize i)
 {
   return dynamic_cast<Spanner *> (grobs_.elem (i));
 }
@@ -48,7 +48,7 @@ Grob_array::mark_smob (SCM s)
 
 #if 0  /* see System::derived_mark () const */
   Grob_array *ga = unsmob_grob_array (s);
-  for (int i = 0; i < ga->grobs_.size (); i++)
+  for (vsize i = 0; i < ga->grobs_.size (); i++)
     scm_gc_mark (ga->grobs_[i]->self_scm ());
 #endif
   return SCM_UNDEFINED;
@@ -60,7 +60,7 @@ Grob_array::print_smob (SCM arr, SCM port, scm_print_state*)
   scm_puts ("#<Grob_array", port);
 
   Grob_array *grob_arr = unsmob (arr);
-  for (int i = 0; i < grob_arr->size (); i++)
+  for (vsize i = 0; i < grob_arr->size (); i++)
     {
       scm_display (grob_arr->grob (i)->self_scm (), port);
       scm_puts (" ", port);
@@ -83,9 +83,9 @@ Grob_array::clear ()
 }
 
 bool
-Grob_array::is_empty () const
+Grob_array::empty () const
 {
-  return grobs_.is_empty ();
+  return grobs_.empty ();
 }
 
 void
index e0d79af430cc0a9108833879034202e88227369c..d8471d43f76d3caa3e1ca35cc3995116294b8f48 100644 (file)
@@ -40,7 +40,7 @@ Grob_info::origin_contexts (Translator *end) const
   Link_array<Context> r;
   do
     {
-      r.push (t);
+      r.push_back (t);
       t = t->get_parent_context ();
     }
   while (t && t != end->context ());
index dc61fb93e624bee3de785fd0d424e9f3170ac2ad..1e55f60bde8f55f19787b8184811aad066e73426 100644 (file)
@@ -32,7 +32,7 @@ protected:
   void start_translation_timestep ();
   void stop_translation_timestep ();
 
-  Array<Grob_pq_entry> started_now_;
+  std::vector<Grob_pq_entry> started_now_;
 };
 
 Grob_pq_engraver::Grob_pq_engraver ()
@@ -82,7 +82,7 @@ Grob_pq_engraver::acknowledge_grob (Grob_info gi)
       e.grob_ = gi.grob ();
       e.end_ = end;
 
-      started_now_.push (e);
+      started_now_.push_back (e);
     }
 }
 
@@ -98,7 +98,7 @@ Grob_pq_engraver::stop_translation_timestep ()
   started_now_.sort (Grob_pq_entry::compare);
   SCM lst = SCM_EOL;
   SCM *tail = &lst;
-  for (int i = 0; i < started_now_.size (); i++)
+  for (vsize i = 0; i < started_now_.size (); i++)
     {
       *tail = scm_acons (started_now_[i].end_.smobbed_copy (),
                         started_now_[i].grob_->self_scm (),
index ee88f2ac48e52571b7c62b4a6d306c0a9c12ac88..1cfe52094bce606161fcd81c5003e0235d63c52f 100644 (file)
@@ -208,7 +208,7 @@ LY_DEFINE (ly_spanner_broken_into, "ly:spanner-broken-into",
   SCM_ASSERT_TYPE (me, spanner, SCM_ARG1, __FUNCTION__, "spanner");
 
   SCM s = SCM_EOL;
-  for (int i = me->broken_intos_.size (); i--;)
+  for (vsize i = me->broken_intos_.size (); i--;)
     s = scm_cons (me->broken_intos_[i]->self_scm (), s);
   return s;
 }
index 0ad308bdb154c1cdf7064c2dd31d7c3611053ede..c3905c487613c6e24c43ecfdb2cc0b207e43182b 100644 (file)
@@ -610,7 +610,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)
 {
-  for (int i = arr.size (); i--;)
+  for (vsize i = arr.size (); i--;)
     if (Grob *s = arr[i])
       {
        if (common)
index 199b69e719beca5dc709510d2a77c3e95a615383..f3911339af2cd3f4d2ae514fef47550ebff2f473 100644 (file)
@@ -95,7 +95,7 @@ Hairpin::print (SCM smob)
            {
              bool neighbor_found = false;
              extract_grob_set (me, "adjacent-hairpins", pins);
-             for (int i = 0; i < pins.size (); i++)
+             for (vsize i = 0; i < pins.size (); i++)
                {
                  /*
                    FIXME: this will fuck up in case of polyphonic
index f8420239eef6eb7d9c59565b3cecee3d82547956..f00434346dbac33c5147c9d7b1933eba374e0134 100644 (file)
@@ -45,7 +45,7 @@ Hara_kiri_group_spanner::consider_suicide (Grob *me)
 
   Link_array<Grob> childs;
   Axis_group_interface::get_children (me, &childs);
-  for (int i = 0; i < childs.size (); i++)
+  for (vsize i = 0; i < childs.size (); i++)
     childs[i]->suicide ();
 
   /*
index 176b5d56efd179068a2e8fa2323a486afad31836..2babc2b03311b8638bdc9191e6094a73950eade2 100644 (file)
@@ -60,7 +60,7 @@ Horizontal_bracket_engraver::try_music (Music *m)
       else
        {
          push_count_++;
-         events_.push (m);
+         events_.push_back (m);
        }
 
       if (pop_count_ && push_count_)
@@ -74,7 +74,7 @@ Horizontal_bracket_engraver::try_music (Music *m)
 void
 Horizontal_bracket_engraver::acknowledge_note_column (Grob_info gi)
 {
-  for (int i = 0; i < bracket_stack_.size (); i++)
+  for (vsize i = 0; i < bracket_stack_.size (); i++)
     {
       Side_position_interface::add_support (bracket_stack_[i], gi.grob ());
       Pointer_group_interface::add_grob (bracket_stack_[i],
@@ -91,14 +91,14 @@ Horizontal_bracket_engraver::process_music ()
     {
       Spanner *sp = make_spanner ("HorizontalBracket", events_[k]->self_scm ());
 
-      for (int i = 0; i < bracket_stack_.size (); i++)
+      for (vsize i = 0; i < bracket_stack_.size (); i++)
        {
          /*
            sp is the smallest, it should be added to the bigger brackets.
          */
          Side_position_interface::add_support (bracket_stack_[i], sp);
        }
-      bracket_stack_.push (sp);
+      bracket_stack_.push_back (sp);
     }
 }
 
index de6fa24b1e4b2ea47e4d3c8d309d1ce18a8a54a7..e4f4f3a9918656e9923eabfcb711f44a0e45eecb 100644 (file)
@@ -77,7 +77,7 @@ completize_hyphen (Spanner *sp)
     {
       extract_item_set (sp, "heads", heads);
       if (heads.size ())
-       sp->set_bound (RIGHT, heads.top ());
+       sp->set_bound (RIGHT, heads.back ());
     }
 }
 
index fcf1ff19095eb5cac334ff7180382a64291329ef..f43feee573a8a7c0aa62a9da5f2e7ca63b759381 100644 (file)
@@ -64,16 +64,16 @@ Includable_lexer::new_input (std::string name, Sources *sources)
       LexerError (msg.c_str ());
       return;
     }
-  file_name_strings_.push (file->name_string ());
+  file_name_strings_.push_back (file->name_string ());
 
-  char_count_stack_.push (0);
+  char_count_stack_.push_back (0);
   if (yy_current_buffer)
-    state_stack_.push (yy_current_buffer);
+    state_stack_.push_back (yy_current_buffer);
 
   if (be_verbose_global)
     progress_indication (std::string ("[") + name);
 
-  include_stack_.push (file);
+  include_stack_.push_back (file);
 
   /* Ugh. We'd want to create a buffer from the bytes directly.
 
@@ -87,15 +87,15 @@ Includable_lexer::new_input (std::string name, std::string data, Sources *source
 {
   Source_file *file = new Source_file (name, data);
   sources->add (file);
-  file_name_strings_.push (name);
+  file_name_strings_.push_back (name);
 
-  char_count_stack_.push (0);
+  char_count_stack_.push_back (0);
   if (yy_current_buffer)
-    state_stack_.push (yy_current_buffer);
+    state_stack_.push_back (yy_current_buffer);
 
   if (be_verbose_global)
     progress_indication (std::string ("[") + name);
-  include_stack_.push (file);
+  include_stack_.push_back (file);
 
   yy_switch_to_buffer (yy_create_buffer (file->get_istream (), YY_BUF_SIZE));
 }
@@ -106,43 +106,44 @@ Includable_lexer::new_input (std::string name, std::string data, Sources *source
 bool
 Includable_lexer::close_input ()
 {
-  include_stack_.pop ();
-  char_count_stack_.pop ();
+  include_stack_.pop_back ();
+  char_count_stack_.pop_back ();
   if (be_verbose_global)
     progress_indication ("]");
   yy_delete_buffer (yy_current_buffer);
 #if HAVE_FLEXLEXER_YY_CURRENT_BUFFER
   yy_current_buffer = 0;
 #endif
-  if (state_stack_.is_empty ())
+  if (state_stack_.empty ())
     {
 #if HAVE_FLEXLEXER_YY_CURRENT_BUFFER
       yy_current_buffer = 0;
 #endif
       return false;
     }
-  yy_switch_to_buffer (state_stack_.pop ());
+  yy_switch_to_buffer (state_stack_.back ());
+  state_stack_.pop_back ();
   return true;
 }
 
 char const *
 Includable_lexer::here_str0 () const
 {
-  if (include_stack_.is_empty ())
+  if (include_stack_.empty ())
     return 0;
-  return include_stack_.top ()->c_str () + char_count_stack_.top ();
+  return include_stack_.back ()->c_str () + char_count_stack_.back ();
 }
 
 Includable_lexer::~Includable_lexer ()
 {
-  while (!include_stack_.is_empty ())
+  while (!include_stack_.empty ())
     close_input ();
 }
 
 Source_file *
 Includable_lexer::get_source_file () const
 {
-  if (include_stack_.is_empty ())
+  if (include_stack_.empty ())
     return 0;
-  return include_stack_.top ();
+  return include_stack_.back ();
 }
index 12c77eace24ff94327baeb778ca41890e2761a0d..b7154d59b5dafc96b7ec069afde14b2f388578bd 100644 (file)
@@ -21,7 +21,7 @@ public:
   
   static bool has_interface (Grob *);
   static std::string get_fontcharname (std::string style, int alteration);
-  static Array<Box> accurate_boxes (Grob *me,
+  static std::vector<Box> accurate_boxes (Grob *me,
                                                          Grob **common);
 };
 
index d7bccaead9e5195ebcfecaadcec2981814c5d7ee..c828ae46f393cdcb77602641d64b97eca9b15401 100644 (file)
@@ -73,9 +73,9 @@ 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,
-                                 Array<Stem_info> const &stem_infos,
-                                 Array<Real> const &base_stem_ys,
-                                 Array<Real> const &stem_xs,
+                                 std::vector<Stem_info> const &stem_infos,
+                                 std::vector<Real> const &base_stem_ys,
+                                 std::vector<Real> const &stem_xs,
                                  Real xl, Real xr,
                                  bool knee,
                                  Real yl, Real yr, Beam_quant_parameters const *);
index 183cf337c487e58823f032670af7b07562a9c72b..19ff113571c124c5b5f237ac03ce08d3a417caec 100644 (file)
@@ -28,7 +28,7 @@ struct Beaming_info
 */
 struct Beaming_info_list
 {
-  Array<Beaming_info> infos_;
+  std::vector<Beaming_info> infos_;
 
   int beam_extend_count (Direction) const;
   int best_splitpoint_index (Moment &beat_length, bool subdivide) const;
index 06bdd29989c7c049690c3d254ea88b6d19056ca9..2dc8ef22d680f215e7631ab5bd89116ccb1e37f2 100644 (file)
@@ -24,8 +24,8 @@ public:
   void translate (Offset);
 
   Real get_other_coordinate (Axis a, Real x) const;
-  Array<Real> solve_point (Axis, Real coordinate) const;
-  Array<Real> solve_derivative (Offset) const;
+  std::vector<Real> solve_point (Axis, Real coordinate) const;
+  std::vector<Real> 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
-    Array<> gives unnecessary overhead, and makes debugging a royal
+    std::vector<> gives unnecessary overhead, and makes debugging a royal
     pain.  */
 
   Offset control_[4];
 };
 
-void scale (Array<Offset> *array, Real xscale, Real yscale);
-void rotate (Array<Offset> *array, Real phi);
-void translate (Array<Offset> *array, Offset o);
+void scale (std::vector<Offset> *array, Real xscale, Real yscale);
+void rotate (std::vector<Offset> *array, Real phi);
+void translate (std::vector<Offset> *array, Offset o);
 
 Bezier slur_shape (Real width, Real height_limit,
                   Real height_proportion);
index 829c1fc91bef4f6895970e62f6f6bc6677474bc0..9226aa621fb601d5086b618f908bf7a366ce125c 100644 (file)
@@ -24,20 +24,20 @@ protected:
   Real linewidth_;
 
   Link_array<Grob> find_breaks () const;
-  Array<int> find_break_indices () const;
+  std::vector<int> find_break_indices () const;
   void solve_line (Column_x_positions *) const;
   bool feasible (Link_array<Grob> const &) const;
 
   Simple_spacer_wrapper *generate_spacing_problem (Link_array<Grob> const &,
                                                   Interval) const;
-  virtual Array<Column_x_positions> do_solve () const = 0;
+  virtual std::vector<Column_x_positions> do_solve () const = 0;
 
 public:
   virtual ~Break_algorithm ();
   Simple_spacer *(*get_line_spacer) ();
   Break_algorithm ();
   void set_pscore (Paper_score *);
-  Array<Column_x_positions> solve () const;
+  std::vector<Column_x_positions> solve () const;
 };
 
 #endif // BREAK_HH
index c5588c2db5672be7f1c3d812af777c41a6e09e58..ede15b3e34c7cc7b7a02df4a682a72d3565db980 100644 (file)
@@ -18,12 +18,12 @@ public:
 
 protected:
   virtual void build_ligature (Spanner *ligature,
-                              Array<Grob_info> primitives) = 0;
+                              std::vector<Grob_info> primitives) = 0;
   virtual void typeset_ligature (Spanner *ligature,
-                                Array<Grob_info> primitives);
+                                std::vector<Grob_info> primitives);
   virtual void get_set_column (Item *, Paper_column *);
 private:
-  void collect_accidentals (Spanner *, Array<Grob_info>);
+  void collect_accidentals (Spanner *, std::vector<Grob_info>);
 };
 
 #endif // COHERENT_LIGATURE_ENGRAVER_HH
index 152b20c627191a0fb79299ff8f69bf987564fac6..bc49b37c912f716ae2652fadb3fb12f9e98471d5 100644 (file)
@@ -15,7 +15,7 @@ struct Column_x_positions
   Link_array<Grob> cols_;
   Link_array<Grob> loose_cols_;
 
-  Array<Real> config_;
+  std::vector<Real> config_;
   Real force_;
   bool satisfies_constraints_;
 
index 1ca9787d239e164e0f962d04a2fe9ac06718a7ef..d894c9ada6cad02783598a2eb171870ee70ba8ca 100644 (file)
@@ -15,7 +15,7 @@
 class Engraver_group : public virtual Translator_group
 {
 protected:
-  Array<Grob_info> announce_infos_;
+  std::vector<Grob_info> announce_infos_;
   SCM acknowledge_hash_table_;
 public:
   VIRTUAL_COPY_CONSTRUCTOR (Translator_group, Engraver_group);
index 9921f76db3be28d4acced3b5f94aaa456ee8c422..9d0e841824bdaa58dc2277c3bb8c1e18e1378e26 100644 (file)
@@ -16,7 +16,7 @@
 */
 struct Gourlay_breaking : public Break_algorithm
 {
-  Array<Column_x_positions> do_solve () const;
+  std::vector<Column_x_positions> do_solve () const;
   Gourlay_breaking ();
   Real combine_demerits (Column_x_positions const &, Column_x_positions const &) const;
 };
index 144dfc327412ffd18108703f50fb4a00e354fec4..2524d0669efc52e627ba2dd3f9687a6e882f75a8 100644 (file)
@@ -21,9 +21,9 @@ public:
 protected:
   Gregorian_ligature_engraver ();
   virtual bool try_music (Music *);
-  virtual void build_ligature (Spanner *ligature, Array<Grob_info> primitives);
+  virtual void build_ligature (Spanner *ligature, std::vector<Grob_info> primitives);
   virtual void transform_heads (Spanner *ligature,
-                               Array<Grob_info> primitives) = 0;
+                               std::vector<Grob_info> primitives) = 0;
   void stop_translation_timestep ();
 };
 
index 3886fd6b02735a878f09fb432a802b0d6554c67b..975301f7232b5f3e4f11d87be7727b4f1e4545e0 100644 (file)
@@ -24,13 +24,13 @@ class Grob_array
 public:
   bool ordered () const { return ordered_; }
   void set_ordered (bool b) { ordered_ = b; }
-  Item *item (int i);
-  Spanner *spanner (int i);
-  Grob *grob (int i) { return grobs_.elem (i); }
-  int size () const { return grobs_.size (); }
-  bool is_empty () const;
+  Item *item (vsize i);
+  Spanner *spanner (vsize i);
+  Grob *grob (vsize i) { return grobs_.elem (i); }
+  vsize size () const { return grobs_.size (); }
+  bool empty () const;
   void clear ();
-  void add (Grob *x) { grobs_.push (x); }
+  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;
index 66c07ef78dfbc88d04fa8d3e6eb39177441bd514..68fed68ebf823a9e8f4d69ac8724cc156974a62a 100644 (file)
@@ -25,12 +25,12 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 */
 class Includable_lexer : public yyFlexLexer
 {
-  Array<YY_BUFFER_STATE> state_stack_;
+  std::vector<YY_BUFFER_STATE> state_stack_;
 
 protected:
   bool close_input ();
   Link_array<Source_file> include_stack_;
-  Array<int> char_count_stack_;
+  std::vector<int> char_count_stack_;
 
 public:
   bool allow_includes_b_;
@@ -39,7 +39,7 @@ public:
   ~Includable_lexer ();
 
   /// store dependencies for Makefile stuff.
-  Array<std::string> file_name_strings_;
+  std::vector<std::string> file_name_strings_;
 
   Source_file *get_source_file () const;
   void new_input (std::string s, Sources *);
index cd4fa00f9a7003a432f12e320a84ea180244a680..dfd355e1afed3ead4352908bf0945ad068b76abc 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef KEYWORD_HH
 #define KEYWORD_HH
 
-#include "array.hh"
+#include "std-vector.hh"
 
 /* for the keyword table */
 struct Keyword_ent
@@ -21,10 +21,10 @@ struct Keyword_ent
 */
 struct Keyword_table
 {
-  Array<Keyword_ent> table_;
+  std::vector<Keyword_ent> table_;
 
   Keyword_table (Keyword_ent *);
-  int lookup (char const *s) const;
+  vsize lookup (char const *s) const;
 };
 
 #endif // KEYWORD_HH
index 296175150c3d3e460c04bf728db8214414117c76..8dcb2470b6e40a051e45ef59649698ca196e88dc 100644 (file)
@@ -6,13 +6,13 @@
 
 #ifndef LEASTSQUARE_HH
 #define LEASTSQUARE_HH
-#include "array.hh"
+#include "std-vector.hh"
 #include "offset.hh"
 
 /**
    Least squares minimisation in 2 variables.
 */
-void minimise_least_squares (Real *coef, Real *offset, Array<Offset> const &);
+void minimise_least_squares (Real *coef, Real *offset, std::vector<Offset> const &);
 
 #endif // LEASTSQUARE_HH
 
index 1514b9351047611cd8c3d2ba5e6bd7d7f98b05a5..16ce68f92b5e07115d86b258a4757b90c23eceeb 100644 (file)
@@ -25,7 +25,7 @@ protected:
   void process_music ();
   virtual Spanner *create_ligature_spanner () = 0;
   virtual void typeset_ligature (Spanner *ligature,
-                                Array<Grob_info> primitives) = 0;
+                                std::vector<Grob_info> primitives) = 0;
   virtual Spanner *current_ligature ();
   SCM brew_ligature_primitive_proc;
 
@@ -37,10 +37,10 @@ private:
   Drul_array<Music *> events_drul_;
 
   Spanner *ligature_;
-  Array<Grob_info> primitives_;
+  std::vector<Grob_info> primitives_;
 
   Spanner *finished_ligature_;
-  Array<Grob_info> finished_primitives_;
+  std::vector<Grob_info> finished_primitives_;
 
   Music *prev_start_event_;
 
index cfb3cd149d62c503ad6e05c4bc0c43e4d625d99d..55ee32a171931d02eefb001485b8ad135cc23ba2 100644 (file)
@@ -25,11 +25,11 @@ class Lily_parser
   DECLARE_SMOBS (Lily_parser,);
   friend int yyparse (void *);
 
-  Array<Input> define_spots_;
+  std::vector<Input> define_spots_;
 
   char const *here_str0 () const;
   Simultaneous_music *get_chord (Pitch tonic,
-                                Array<Pitch> *adds, Array<Pitch> *subs,
+                                std::vector<Pitch> *adds, std::vector<Pitch> *subs,
                                 Pitch *inversion, Pitch *bass, Duration d);
   void set_chord_tremolo (int type_i);
   void set_last_duration (Duration const *);
index 013763485f984dfba03f652b23c768cba6b076d1..bb3f030b71104747bfedafa0e8c039662c90cad2 100644 (file)
@@ -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 (Array<Offset> const &points, Real blotdiameter);
+  static Stencil round_filled_polygon (std::vector<Offset> 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);
index d79b608c3e93c6111fb2c267b3c5f1f2cfdc7d17..a64b82a958dfa7c9d884648f4c73baea1a6fa3c2 100644 (file)
@@ -9,7 +9,7 @@
 #define MAIN_HH
 
 #include "lily-proto.hh"
-#include "array.hh"
+#include "std-vector.hh"
 #include "std-string.hh"
 
 void debug_init ();
@@ -20,13 +20,13 @@ void add_score (Score *s);
 void set_default_output (std::string s);
 std::string find_file (std::string);
 void call_constructors ();
-Array<std::string> get_inclusion_names ();
-void set_inclusion_names (Array<std::string>);
+std::vector<std::string> get_inclusion_names ();
+void set_inclusion_names (std::vector<std::string>);
 
 extern std::string init_name_global;
 
 /* options */
-extern Array<std::string> dump_header_fieldnames_global;
+extern std::vector<std::string> dump_header_fieldnames_global;
 extern std::string output_backend_global;
 extern std::string output_name_global;
 extern bool be_safe_global;
@@ -47,7 +47,7 @@ extern bool make_preview;
 extern bool make_print;
 
 /* misc */
-extern Array<std::string> failed_files;
+extern std::vector<std::string> failed_files;
 extern int exit_status_global;
 extern File_path global_path;
 extern const char *LILYPOND_DATADIR;
index 34b28a118f90394002e01fb492a85c3dbeb94796..4799900b6c42c0e765e635ddb7c08679338e72e7 100644 (file)
@@ -12,7 +12,7 @@
 #include <cstdlib>
 using namespace std;
 
-#include "array.hh"
+#include "std-vector.hh"
 #include "interval.hh"
 
 double log_2 (double x);
@@ -28,7 +28,7 @@ sign (int i)
   else return 0;
 }
 
-Array<std::string> split_string (std::string s, char c);
+std::vector<std::string> split_string (std::string s, char c);
 
 inline Real
 linear_interpolate (Real x, Real x1, Real x2, Real y1, Real y2)
index 601e5404b83d68e97d7fd4decc65089929487ef2..2440ae8d996d37d9d0364db7d9181620af8a4c98 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef MUSIC_ITERATOR_HH
 #define MUSIC_ITERATOR_HH
 
-#include "array.hh"
+#include "std-vector.hh"
 #include "moment.hh"
 #include "virtual-methods.hh"
 #include "context-handle.hh"
index a45d3313e8cb8c62733ff965e56a23d61360f69f..106b6645f5eac889e9186dc0bfda2826ed772d9f 100644 (file)
@@ -10,7 +10,7 @@
 #define PAPER_OUTPUTTER_HH
 
 #include "lily-proto.hh"
-#include "array.hh"
+#include "std-vector.hh"
 #include "std-string.hh"
 #include "protected-scm.hh"
 #include "smobs.hh"
index f12d214de25b07d146d0df22f67cf7e39bc7faf3..3056b478aaa2ed952ca80bad1627fec2825d57d5 100644 (file)
@@ -28,7 +28,7 @@ public:
   System *root_system () const;
 
   void typeset_system (System *);
-  Array<Column_x_positions> calc_breaking ();
+  std::vector<Column_x_positions> calc_breaking ();
 
   SCM get_paper_systems () const;
 protected:
index 0fb6d62108282c4f06ec0a4ab5d40c73c78b8220..2b83f61496c2c367239d46dc1e90db707fbea1bd 100644 (file)
@@ -24,7 +24,7 @@ public:
   virtual int get_tempo () const;
 
 protected:
-  Array<Audio_element_info> announce_infos_;
+  std::vector<Audio_element_info> announce_infos_;
 
 private:
   void acknowledge_audio_elements ();
index 1b6742afee39bc4c25d71cb5a7c3ec8f4ce5c80f..cce03371f110ce9da9b956988648e1d522c1c661 100644 (file)
@@ -82,7 +82,7 @@ DECLARE_UNSMOB (Pitch, pitch);
 
 INSTANTIATE_COMPARE (Pitch, Pitch::compare);
 
-int compare (Array<Pitch> *, Array<Pitch> *);
+int compare (std::vector<Pitch> *, std::vector<Pitch> *);
 extern SCM pitch_less_proc;
 Pitch pitch_interval (Pitch const &from, Pitch const &to);
 
index 1ee059b637181b726cedeb989d7f7d19280bba7b..05d33130946e2e1b0a70c5f8b06b04b606a63379 100644 (file)
@@ -29,7 +29,7 @@ struct Spring_description
 class Simple_spacer
 {
 public:
-  Array<Spring_description> springs_;
+  std::vector<Spring_description> springs_;
   Real force_;
   Real indent_;
   Real line_len_;
index 3ca05e0ff2cc4866c536648b2c2fe6d347c573ac..f24781a7505289782746e069ed7a5bacb501f501 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef SKYLINE_HH
 #define SKYLINE_HH
 
-#include "array.hh"
+#include "std-vector.hh"
 #include "box.hh"
 
 struct Skyline_entry
@@ -21,20 +21,20 @@ struct Skyline_entry
 };
 
 void
-merge_skyline (Array<Skyline_entry> *a1, Array<Skyline_entry> const &a2,
+merge_skyline (std::vector<Skyline_entry> *a1, std::vector<Skyline_entry> const &a2,
               Direction);
-void insert_extent_into_skyline (Array<Skyline_entry> *line, Box b, Axis line_axis,
+void insert_extent_into_skyline (std::vector<Skyline_entry> *line, Box b, Axis line_axis,
                                 Direction d);
-Array<Skyline_entry>
-extents_to_skyline (Array<Box> const &extents, Axis a, Direction d);
-Array<Skyline_entry> empty_skyline (Direction d);
-void heighten_skyline (Array<Skyline_entry> *buildings, Real ground);
+std::vector<Skyline_entry>
+extents_to_skyline (std::vector<Box> const &extents, Axis a, Direction d);
+std::vector<Skyline_entry> empty_skyline (Direction d);
+void heighten_skyline (std::vector<Skyline_entry> *buildings, Real ground);
 Real
-skyline_meshing_distance (Array<Skyline_entry> const &buildings,
-                         Array<Skyline_entry> const &clouds);
+skyline_meshing_distance (std::vector<Skyline_entry> const &buildings,
+                         std::vector<Skyline_entry> const &clouds);
 
 Real
-skyline_height (Array<Skyline_entry> const &buildings,
+skyline_height (std::vector<Skyline_entry> const &buildings,
                Real airplane, Direction sky_dir);
 
 #endif /* SKYLINE_HH */
index 3039bd960cebf7f5fa015f6cc0dbfc3a6272071e..59cc3a5368d3d57f24a67161704458aab5fdc05c 100644 (file)
@@ -30,7 +30,7 @@ public:
   Slur_configuration ();
 
   void generate_curve (Slur_score_state const &state, Real r0, Real h_inf,
-                      Array<Offset> const &);
+                      std::vector<Offset> const &);
   void score (Slur_score_state const &);
 protected:
   void score_extra_encompass (Slur_score_state const &);
index b72f186a0f56789e59ad5523fcfcd8e351072eb3..0bb54bf7c08a68b73a9b8c61a875909f69fc2447 100644 (file)
@@ -105,8 +105,8 @@ struct Slur_score_state
 
   Real musical_dy_;
   Link_array<Grob> columns_;
-  Array<Encompass_info> encompass_infos_;
-  Array<Extra_collision_info> extra_encompass_infos_;
+  std::vector<Encompass_info> encompass_infos_;
+  std::vector<Extra_collision_info> extra_encompass_infos_;
 
   Direction dir_;
   Slur_score_parameters parameters_;
@@ -123,14 +123,14 @@ struct Slur_score_state
   void fill (Grob *);
   void set_next_direction ();
 
-  Array<Offset> generate_avoid_offsets () const;
+  std::vector<Offset> generate_avoid_offsets () const;
   Drul_array<Bound_info> get_bound_info () const;
   void generate_curves () const;
   Link_array<Slur_configuration> enumerate_attachments (Drul_array<Real> end_ys) const;
   Drul_array<Offset> get_base_attachments () const;
   Drul_array<Real> get_y_attachment_range () const;
   Encompass_info get_encompass_info (Grob *col) const;
-  Array<Extra_collision_info> get_extra_encompass_infos () const;
+  std::vector<Extra_collision_info> get_extra_encompass_infos () const;
   Real move_away_from_staffline (Real y, Grob *on_staff) const;
   int get_closest_index (SCM inspect_quants) const;
 };
index bd6b297191930400bb47db1fe2add3687213a2ca..b9d69c7ba5052cbc27d4bded0b8906b8704bd3a7 100644 (file)
@@ -14,7 +14,7 @@
 class Stem
 {
 public:
-  static Array<int> note_head_positions (Grob *);
+  static std::vector<int> note_head_positions (Grob *);
   static int duration_log (Grob *);
   static void set_beaming (Grob *, int, Direction d);
   static int get_beaming (Grob *, Direction d);
index 35a0ca27132c50e2a7e17093a4c2bc6563ec9378..a13f9c7da305e286d7314d886ff1af0a069889b9 100644 (file)
@@ -38,7 +38,7 @@ public:
   int element_count () const;
   int spanner_count () const;
 
-  void break_into_pieces (Array<Column_x_positions> const &);
+  void break_into_pieces (std::vector<Column_x_positions> const &);
   static bool has_interface (Grob *);
 
   Link_array<Item> broken_col_range (Item const *, Item const *) const;
index 9b2c8e22d1021975ef79dcd1136ef4608626fc12..d2ed00726862d08f61e58993e6543e863e179cb2 100644 (file)
@@ -26,8 +26,8 @@ private:
   void read_char_metrics ();
   Tex_font_char_metric read_char_metric (Char_code code);
   Tex_font_char_metric read_char ();
-  void read_lig_kern_program (Array<Tfm_ligature> *ligatures,
-                             Array<Tfm_kern> *kerns);
+  void read_lig_kern_program (std::vector<Tfm_ligature> *ligatures,
+                             std::vector<Tfm_kern> *kerns);
 
   Binary_source_file input_;
 
@@ -36,8 +36,8 @@ public:
 
   Tfm_info info_;
   Tfm_header header_;
-  Array<Tex_font_char_metric> char_metrics_;
-  Array<int> ascii_to_metric_idx_;
+  std::vector<Tex_font_char_metric> char_metrics_;
+  std::vector<int> ascii_to_metric_idx_;
 };
 
 #endif /* TFM_READER_HH */
index 85e2002029c88fa9c32facda0399167e6d634c09..a512080c1bcbc97b0f10594884406fd37c9b8fee 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef TFM_HH
 #define TFM_HH
 
-#include "array.hh"
+#include "std-vector.hh"
 #include "font-metric.hh"
 
 /* The type.  */
@@ -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_;
-  Array<Tfm_kern> kerns_;
-  Array<Tfm_ligature> ligatures_;
+  std::vector<Tfm_kern> kerns_;
+  std::vector<Tfm_ligature> ligatures_;
 
   Tex_font_char_metric ();
 
@@ -158,8 +158,8 @@ public:
 protected:
   Tfm_info info_;
   Tfm_header header_;
-  Array<Tex_font_char_metric> char_metrics_;
-  Array<int> ascii_to_metric_idx_;
+  std::vector<Tex_font_char_metric> char_metrics_;
+  std::vector<int> ascii_to_metric_idx_;
   SCM encoding_table_;
   std::string font_name_;
 private:
index 4f47d69434228a0aafbd5f06e1417329c01ac2da..a6cb8df5eb8b50bea2b649045cdc426f9bd6690b 100644 (file)
@@ -13,7 +13,7 @@
 #include "lily-proto.hh"
 #include "tie-configuration.hh"
 
-void set_chord_outline (Array<Skyline_entry> *skyline,
+void set_chord_outline (std::vector<Skyline_entry> *skyline,
                        Link_array<Item> bounds,
                        Grob *common,
                        Direction d);
@@ -25,7 +25,7 @@ void final_shape_adjustment (Tie_configuration &conf,
                             Tie_formatting_problem const&,
                             Grob *staff_referencer);
 void
-set_chord_outlines (Drul_array< Array<Skyline_entry> > *skyline_drul,
+set_chord_outlines (Drul_array< std::vector<Skyline_entry> > *skyline_drul,
                    Link_array<Grob> ties,
                    Grob *common);
 
index e88dcabc1e386043fbd1e4d5eb8c38177db67819..3608a94bc6ce00193f026d1c3997dc15fb611ebd 100644 (file)
@@ -14,7 +14,7 @@
 #include "direction.hh"
 #include "interval.hh"
 #include "compare.hh"
-#include "array.hh"
+#include "std-vector.hh"
 
 class Tie_configuration
 {
@@ -40,7 +40,7 @@ public:
 
 INSTANTIATE_COMPARE (Tie_configuration, Tie_configuration::compare);
 
-typedef Array<Tie_configuration> Ties_configuration;
+typedef std::vector<Tie_configuration> Ties_configuration;
 
 #endif /* TIE_CONFIGURATION_HH */
 
index 01b44cbef494532a9ba2d44cb0b8eaaca5a5af6f..2563e206d6d6fd06e774f403613a83ad0173e12e 100644 (file)
@@ -76,11 +76,11 @@ struct Tie_configuration_variation
 
 class Tie_formatting_problem
 {
-  Drul_array< Array<Skyline_entry> > chord_outlines_;
+  Drul_array< std::vector<Skyline_entry> > chord_outlines_;
   Drul_array< Box > stem_extents_;
   set<int> dot_positions_;
   Interval dot_x_;
-  Array<Tie_specification> specifications_;
+  std::vector<Tie_specification> 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;
-  Array<Tie_configuration_variation> get_variations (Ties_configuration const &ties);
+  std::vector<Tie_configuration_variation> get_variations (Ties_configuration const &ties);
 
   Real score_configuration (Tie_configuration const &) const;
   Real score_aptitude (Tie_configuration const &, Tie_specification const &) const;
index 28549fb7914f58e0ff6ea8f80f59c1dcaf5fee1f..dd17643d2d68785b64e0e2ade4a830539337ba5a 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "lily-proto.hh"
 #include "lily-guile.hh"
-#include "array.hh"
+#include "std-vector.hh"
 #include "smobs.hh"
 
 struct Engraver_dispatch_entry
@@ -22,7 +22,7 @@ struct Engraver_dispatch_entry
 
 class Engraver_dispatch_list
 {
-  Array<Engraver_dispatch_entry> dispatch_entries_;
+  std::vector<Engraver_dispatch_entry> dispatch_entries_;
 public:
   void apply (Grob_info);
   SCM static create (SCM trans_list,
index 32c080041bda6578522182909fe7480646605b41..3abbee33d7d90be36eb009244be8c284c58284ea 100644 (file)
@@ -40,7 +40,7 @@ class Translator_group
 {
 private:
   void precompute_method_bindings ();
-  Array<Translator_method_binding>
+  std::vector<Translator_method_binding>
   precomputed_method_bindings_[TRANSLATOR_METHOD_PRECOMPUTE_COUNT];
 
   Translator_group_void_method
index 2b2cb9698c6a909c360558456fd60a1b5dbd74e7..2121da90efd108b3314c4a9baeb53bb43083a92f 100644 (file)
@@ -27,7 +27,7 @@ struct Acknowledge_information
   NAME ();                                                             \
   VIRTUAL_COPY_CONSTRUCTOR (Translator, NAME);                         \
   static SCM static_description_;                                      \
-  static Array<Acknowledge_information> acknowledge_static_array_;     \
+  static std::vector<Acknowledge_information> acknowledge_static_array_;       \
   virtual void fetch_precomputable_methods (Translator_void_method_ptr methods[]); \
   virtual SCM static_translator_description () const;                  \
   virtual SCM translator_description () const;                         \
index 94f30f7a641f12dc60d25c2a6f01f86299b22ee5..68f44c816dd3d13d186f7818de1a2aa65f3c5df6 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef TRANSLATOR_ICC
 #define TRANSLATOR_ICC
 
-#include "array.hh"
+#include "std-vector.hh"
 #include "translator.hh"
 
 /**
@@ -31,7 +31,7 @@
   ADD_GLOBAL_CTOR (_ ## T ## _adder);
 
 #define ADD_TRANSLATOR(classname, desc, grobs, accepted, read, write)  \
-  Array<Acknowledge_information> classname::acknowledge_static_array_; \
+  std::vector<Acknowledge_information> classname::acknowledge_static_array_;   \
   IMPLEMENT_FETCH_PRECOMPUTABLE_METHODS (classname);                   \
   ADD_THIS_TRANSLATOR (classname);                                     \
   Engraver_void_function_engraver_grob_info                            \
 
 void add_acknowledger (Engraver_void_function_engraver_grob_info ptr,
                       char const *func_name,
-                      Array<Acknowledge_information> *ack_array);
+                      std::vector<Acknowledge_information> *ack_array);
 
 Engraver_void_function_engraver_grob_info
 generic_get_acknowledger (SCM sym,
-                         Array<Acknowledge_information> const *ack_array);
+                         std::vector<Acknowledge_information> const *ack_array);
 
 #define ADD_ACKNOWLEDGER(CLASS, NAME)                                  \
   void CLASS ## NAME ## _ack_adder ()                                  \
index 684bc189e36a4f08768321b8549a763e3d56fafe..d854fbeecd324327f0e9d0dc8fb9df25a5e498d3 100644 (file)
@@ -17,19 +17,19 @@ int tabcmp (Keyword_ent const &p1, Keyword_ent const &p2)
 Keyword_table::Keyword_table (Keyword_ent *tab)
 {
   while (tab->name_)
-    table_.push (*tab++);
+    table_.push_back (*tab++);
 
   table_.sort (tabcmp);
 }
 
-int
+vsize
 Keyword_table::lookup (char const *s) const
 {
   Keyword_ent e;
   e.name_ = s;
-  int idx = binary_search (table_, e, tabcmp);
-  if (idx >= 0)
+  vsize idx = binary_search (table_, e, tabcmp);
+  if (idx != VPOS)
     return table_[idx].tokcode_;
   else
-    return -1;
+    return VPOS;
 }
index ba6c837a2b388282adff6f793172fd42c9208424..d361298c56da773dd52cad01c7c32b6559a1698d 100644 (file)
@@ -68,7 +68,7 @@ Laissez_vibrer_engraver::acknowledge_note_head (Grob_info inf)
                                     lv_tie);
   lv_tie->set_parent (lv_column_, Y_AXIS);
 
-  lv_ties_.push (lv_tie);
+  lv_ties_.push_back (lv_tie);
 }
 
 
index 32d8a23d9e24e91b42f59ea50609806040fdea4b..449181e61d613f1b8be9f06c7a11a8da43f26263 100644 (file)
@@ -57,7 +57,7 @@ Laissez_vibrer_tie_column::calc_positioning_done (SCM smob)
   problem.set_manual_tie_configuration (manual_configs);
 
   Ties_configuration base = problem.generate_optimal_chord_configuration ();
-  for (int i = 0; i < lv_ties.size(); i++)
+  for (vsize i = 0; i < lv_ties.size(); i++)
     {
       Tie::set_control_points (lv_ties[i], problem.common_x_refpoint (), base[i],
                               problem.details_);
index 79d463d184802722a5f8693636d3d358796872df..cba93dd6052ba9a400d4e45c50b55abd9133dd53 100644 (file)
 
 void
 minimise_least_squares (Real *coef, Real *offset,
-                       Array<Offset> const &input)
+                       std::vector<Offset> const &input)
 {
   Real sx = 0.0;
   Real sy = 0.0;
   Real sqx = 0.0;
   Real sxy = 0.0;
 
-  for (int i = 0; i < input.size ();i++)
+  for (vsize i = 0; i < input.size ();i++)
     {
       Real x = input[i][X_AXIS];
       Real y = input[i][Y_AXIS];
index 43bc35b69596a01107fbb5a11b86ab1683466913..31fc8d0b26b814a5b3cdc9eda6c8d0d55175abab 100644 (file)
@@ -139,7 +139,7 @@ Ledger_line_spanner::set_spacing_rods (SCM smob)
     contain a lot of noteheads, superlinear performance is too slow.
   */
   extract_item_set (me, "note-heads", heads);
-  for (int i = heads.size (); i--;)
+  for (vsize i = heads.size (); i--;)
     {
       Item *h = heads[i];
 
@@ -206,7 +206,7 @@ Ledger_line_spanner::print (SCM smob)
 
   extract_grob_set (me, "note-heads", heads);
 
-  if (heads.is_empty ())
+  if (heads.empty ())
     return SCM_EOL;
 
   // find size of note heads.
@@ -231,13 +231,13 @@ Ledger_line_spanner::print (SCM smob)
     {
       Axis a = Axis (i);
       common[a] = common_refpoint_of_array (heads, me, a);
-      for (int i = heads.size (); i--;)
+      for (vsize i = heads.size (); i--;)
        if (Grob *g = unsmob_grob (me->get_object ("accidental-grob")))
          common[a] = common[a]->common_refpoint (g, a);
     }
 
   Ledger_requests reqs;
-  for (int i = heads.size (); i--;)
+  for (vsize i = heads.size (); i--;)
     {
       Item *h = dynamic_cast<Item *> (heads[i]);
 
@@ -302,7 +302,7 @@ Ledger_line_spanner::print (SCM smob)
   // create ledgers for note heads
   Real ledgerlinethickness
     = Staff_symbol::get_ledger_line_thickness (staff);
-  for (int i = heads.size (); i--;)
+  for (vsize i = heads.size (); i--;)
     {
       Item *h = dynamic_cast<Item *> (heads[i]);
 
index 11ed6df0c6aaa94f1d3bd2b6aaca3c5d0eee60b9..6b418db07c96d5aed2b3887f25003381acc232b8 100644 (file)
@@ -302,7 +302,7 @@ BOM_UTF8    \357\273\277
        {
                yyinput ();
        }
-       char_count_stack_.top () += n;
+       char_count_stack_.back () += n;
 
        if (unpack_identifier (sval) != SCM_UNDEFINED)
        {
index 5fb96670151c6b8337e03cd533346348e4fe2671..3382193a6722063dc8972f2b24410c8f246bf6c2 100644 (file)
@@ -22,7 +22,7 @@ class Ligature_bracket_engraver : public Ligature_engraver
 protected:
   virtual Spanner *create_ligature_spanner ();
   virtual void typeset_ligature (Spanner *ligature,
-                                Array<Grob_info> primitives);
+                                std::vector<Grob_info> 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 *, Array<Grob_info>)
+Ligature_bracket_engraver::typeset_ligature (Spanner *, std::vector<Grob_info>)
 {
   // no real ligature to typeset; the LigatureBracket just does it
 }
index 8c77ceb45694d8cb66079d5bae2d8afea8623a3d..e120095cb0a7abc29a1897cb33175b46775f0d14 100644 (file)
@@ -27,7 +27,7 @@
  *
  * A concrete ligature engraver must subclass this class and provide
  * functions create_ligature_spanner () and typeset_ligature
- * (Spanner *, Array<Grob_info>).  Subclasses of this class basically
+ * (Spanner *, std::vector<Grob_info>).  Subclasses of this class basically
  * fall into two categories.
  *
  * The first category consists of engravers that engrave ligatures in
@@ -193,7 +193,7 @@ Ligature_engraver::acknowledge_note_head (Grob_info info)
 {
   if (ligature_)
     {
-      primitives_.push (info);
+      primitives_.push_back (info);
       if (info.grob () && (brew_ligature_primitive_proc != SCM_EOL))
        {
          info.grob ()->set_property ("stencil", brew_ligature_primitive_proc);
index 3ab11f3ccc89f17676cc722ab39cc2cdb9f72305..6f70bae5f5406825a65fe54b115fe507ccb46e05 100644 (file)
@@ -179,20 +179,20 @@ is_number_pair (SCM p)
 }
 
 typedef void (*Void_fptr) ();
-Array<Void_fptr> *scm_init_funcs_;
+std::vector<Void_fptr> *scm_init_funcs_;
 
 void add_scm_init_func (void (*f) ())
 {
   if (!scm_init_funcs_)
-    scm_init_funcs_ = new Array<Void_fptr>;
+    scm_init_funcs_ = new std::vector<Void_fptr>;
 
-  scm_init_funcs_->push (f);
+  scm_init_funcs_->push_back (f);
 }
 
 void
 ly_init_ly_module (void *)
 {
-  for (int i = scm_init_funcs_->size (); i--;)
+  for (vsize i = scm_init_funcs_->size (); i--;)
     (scm_init_funcs_->elem (i)) ();
 
   if (be_verbose_global)
@@ -356,11 +356,11 @@ ly_assoc_cdr (SCM key, SCM alist)
 }
 
 SCM
-ly_string_array_to_scm (Array<std::string> a)
+ly_string_array_to_scm (std::vector<std::string> a)
 {
   SCM s = SCM_EOL;
-  for (int i = a.size () - 1; i >= 0; i--)
-    s = scm_cons (ly_symbol2scm (a[i].c_str ()), s);
+  for (vsize i = a.size (); i ; i--)
+    s = scm_cons (ly_symbol2scm (a[i - 1].c_str ()), s);
   return s;
 }
 
index a5c03cf7364474c2a19bce95ef1424f7b660766c..ddf8510e9dc99bc2c892383d8e04f61eb6f8cc8c 100644 (file)
@@ -236,7 +236,7 @@ Lily_lexer::set_identifier (SCM name, SCM s)
 void
 Lily_lexer::LexerError (char const *s)
 {
-  if (include_stack_.is_empty ())
+  if (include_stack_.empty ())
     message (_f ("error at EOF: %s", s) + "\n");
   else
     {
@@ -285,7 +285,7 @@ Lily_lexer::add_lexed_char (int count)
   char const *start = here_str0 ();
   lexloc->set (get_source_file (),
               start, start + count);
-  char_count_stack_.top () += count;
+  char_count_stack_.back () += count;
 }
 
 #include "ly-smobs.icc"
index 39e5c197a633ec08c07d4c3bc17a7ef34adc7362..256402a841a7ddadfa2ab66d53bbda267fb98305 100644 (file)
@@ -121,9 +121,9 @@ Lily_parser::parse_file (std::string init, std::string name, std::string out_nam
 
   scm_set_current_module (mod);
 
-  if (!define_spots_.is_empty ())
+  if (!define_spots_.empty ())
     {
-      define_spots_.top ().warning (_ ("braces don't match"));
+      define_spots_.back ().warning (_ ("braces don't match"));
       error_level_ = 1;
     }
 
@@ -148,9 +148,9 @@ Lily_parser::parse_string (std::string ly_code)
   do_yyparse ();
   scm_set_current_module (mod);
 
-  if (!define_spots_.is_empty ())
+  if (!define_spots_.empty ())
     {
-      if (define_spots_.is_empty ()
+      if (define_spots_.empty ()
          && !error_level_)
        programming_error ("define_spots_ don't match, but error_level_ not set.");
     }
index 984c4e7c80db96f69086598bf631bae3ced3e860..e12dbcbea865d94aa526fd19e79c70c21f1f22b4 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "lilypond-input-version.hh"
 #include "string-convert.hh"
-#include "array.hh"
+#include "std-vector.hh"
 
 Lilypond_version::Lilypond_version (int major, int minor, int patch)
 {
@@ -25,7 +25,7 @@ Lilypond_version::Lilypond_version (std::string str)
   minor_ = 0;
   patch_ = 0;
   
-  Array<std::string> version;
+  std::vector<std::string> version;
   version = String_convert::split (str, '.');
 
   if (version.size () > 0 && isdigit (version[0][0]))
index 420966eb8eb6509136729c2cd988cb0b3801aa09..a9ef0fe67a2a28740b80c1a0ba0c84f85ef931ff 100644 (file)
@@ -18,13 +18,13 @@ Line_interface::make_arrow (Offset begin, Offset end,
                            Real length, Real width)
 {
   Real angle = (end - begin).arg ();
-  Array<Offset> points;
+  std::vector<Offset> points;
 
-  points.push (Offset (0, 0));
-  points.push (Offset (-length, width));
-  points.push (Offset (-length, -width));
+  points.push_back (Offset (0, 0));
+  points.push_back (Offset (-length, width));
+  points.push_back (Offset (-length, -width));
 
-  for (int i = 0; i < points.size (); i++)
+  for (vsize i = 0; i < points.size (); i++)
     points[i] = points[i] * complex_exp (Offset (0, angle)) + end;
 
   return Lookup::round_filled_polygon (points, thick);
index 4ed1226b4ce3938fc95fd38685c933c6e48ebab2..e5fda585958fc02ec82b6b0a08606bb04bc8f259 100644 (file)
@@ -227,7 +227,7 @@ Lookup::round_filled_box (Box b, Real blotdiameter)
  * shrinked polygon). --jr
  */
 Stencil
-Lookup::round_filled_polygon (Array<Offset> const &points,
+Lookup::round_filled_polygon (std::vector<Offset> const &points,
                              Real blotdiameter)
 {
   /* TODO: Maybe print a warning if one of the above limitations
@@ -238,7 +238,7 @@ Lookup::round_filled_polygon (Array<Offset> const &points,
 
 #ifndef NDEBUG
   /* remove consecutive duplicate points */
-  for (int i = 0; i < points.size (); i++)
+  for (vsize i = 0; i < points.size (); i++)
     {
       int next_i = (i + 1) % points.size ();
       Real d = (points[i] - points[next_i]).length ();
@@ -256,10 +256,10 @@ Lookup::round_filled_polygon (Array<Offset> const &points,
     return Line_interface::make_line (blotdiameter, points[0], points[1]);
 
   /* shrink polygon in size by 0.5 * blotdiameter */
-  Array<Offset> shrunk_points;
-  shrunk_points.set_size (points.size ());
+  std::vector<Offset> shrunk_points;
+  shrunk_points.resize (points.size ());
   bool ccw = 1; // true, if three adjacent points are counterclockwise ordered
-  for (int i = 0; i < points.size (); i++)
+  for (vsize i = 0; i < points.size (); i++)
     {
       int i0 = i;
       int i1 = (i + 1) % points.size ();
@@ -304,7 +304,7 @@ Lookup::round_filled_polygon (Array<Offset> const &points,
   /* build scm expression and bounding box */
   SCM shrunk_points_scm = SCM_EOL;
   Box box;
-  for (int i = 0; i < shrunk_points.size (); i++)
+  for (vsize i = 0; i < shrunk_points.size (); i++)
     {
       SCM x = scm_from_double (shrunk_points[i][X_AXIS]);
       SCM y = scm_from_double (shrunk_points[i][Y_AXIS]);
@@ -649,7 +649,7 @@ Stencil
 Lookup::repeat_slash (Real w, Real s, Real t)
 {
 #if 0 /*  TODO */
-  Array<Offset> points;
+  std::vector<Offset> points;
   Real blotdiameter = 0.0;
 
   Offset p1 (0, 0);
index c1aa2095637d1825eea28d62b71d93b98585755e..051e1231cbdfd9905961081c2880bbcca3a023fa 100644 (file)
@@ -57,7 +57,7 @@ Lyric_extender::print (SCM smob)
     = left_point + (robust_scm2double (minlen, 0));
 
   if (heads.size ())
-    right_point = max (right_point, heads.top ()->extent (common, X_AXIS)[RIGHT]);
+    right_point = max (right_point, heads.back ()->extent (common, X_AXIS)[RIGHT]);
 
   Real h = sl * robust_scm2double (me->get_property ("thickness"), 0);
   Real pad = 2* h;
index 983a254f6ddcff74aa472a7be79630d22e41a9a4..6d2ff577ec9fd9d954c3ca967bbfb47042a7ac6f 100644 (file)
@@ -62,7 +62,7 @@ Lyric_performer::try_music (Music *event)
 {
   if (event->is_mus_type ("lyric-event"))
     {
-      events_.push (event);
+      events_.push_back (event);
       return true;
     }
   return false;
index a99bd7908bdce91b9b4ed9b8972101ebc36f6477..71e6eb22c165ae135013c76c774a11e5b29038ed 100644 (file)
@@ -49,7 +49,7 @@ using namespace std;
  */
 
 /* Names of header fields to be dumped to a separate file. */
-Array<std::string> dump_header_fieldnames_global;
+std::vector<std::string> dump_header_fieldnames_global;
 
 /* Name of initialisation file. */
 std::string init_name_global;
@@ -300,7 +300,7 @@ do_chroot_jail ()
       USER_NAME, GROUP_NAME, JAIL, DIR, JAIL_MAX
     };
 
-  Array<std::string> components = String_convert::split (jail_spec, ',');
+  std::vector<std::string> components = String_convert::split (jail_spec, ',');
   if (components.size () != JAIL_MAX)
     {
       error (_f ("expected %d arguments with jail, found: %d", JAIL_MAX,
@@ -543,7 +543,7 @@ parse_argv (int argc, char **argv)
 
        case 'H':
          dump_header_fieldnames_global
-           .push (option_parser->optional_argument_str0_);
+           .push_back (option_parser->optional_argument_str0_);
          break;
        case 'I':
          global_path.append (option_parser->optional_argument_str0_);
index 03cf1370952e8abde3fdf1d96c168d35960374b8..75a0720fc2e669951e44402952bd9fabd1c45ff9 100644 (file)
@@ -31,10 +31,10 @@ Melody_spanner::calc_neutral_stem_direction (SCM smob)
   
   extract_grob_set (me, "stems", stems);
 
-  Array<Direction> dirs;
-  for (int i = 0; i < stems.size (); i++)
+  std::vector<Direction> dirs;
+  for (vsize i = 0; i < stems.size (); i++)
     {
-      dirs.push (to_dir (stems[i]->get_property ("default-direction")));
+      dirs.push_back (to_dir (stems[i]->get_property ("default-direction")));
     }
 
   int last_nonneutral = -1;
index 92bcf5840588012b29fc87580af0bb815fadc9e9..377c4aebfc290dcf224325a5a48df621f894e418 100644 (file)
@@ -46,15 +46,15 @@ class Mensural_ligature_engraver : public Coherent_ligature_engraver
 
 protected:
   virtual Spanner *create_ligature_spanner ();
-  virtual void build_ligature (Spanner *ligature, Array<Grob_info> primitives);
+  virtual void build_ligature (Spanner *ligature, std::vector<Grob_info> primitives);
 
 public:
   TRANSLATOR_DECLARATIONS (Mensural_ligature_engraver);
 
 private:
-  void transform_heads (Array<Grob_info> primitives);
-  void propagate_properties (Spanner *ligature, Array<Grob_info> primitives);
-  void fold_up_primitives (Array<Grob_info> primitives);
+  void transform_heads (std::vector<Grob_info> primitives);
+  void propagate_properties (Spanner *ligature, std::vector<Grob_info> primitives);
+  void fold_up_primitives (std::vector<Grob_info> primitives);
 };
 
 Mensural_ligature_engraver::Mensural_ligature_engraver ()
@@ -70,7 +70,7 @@ Mensural_ligature_engraver::create_ligature_spanner ()
 }
 
 void
-Mensural_ligature_engraver::transform_heads (Array<Grob_info> primitives)
+Mensural_ligature_engraver::transform_heads (std::vector<Grob_info> primitives)
 {
   if (primitives.size () < 2)
     {
@@ -87,7 +87,7 @@ Mensural_ligature_engraver::transform_heads (Array<Grob_info> primitives)
   bool prev_semibrevis = false;
   Item *prev_primitive = NULL;
 
-  for (int i = 0, s = primitives.size (); i < s; i++)
+  for (vsize i = 0, s = primitives.size (); i < s; i++)
     {
       Grob_info info = primitives[i];
       Item *primitive = dynamic_cast<Item *> (info.grob ());
@@ -296,7 +296,7 @@ Mensural_ligature_engraver::transform_heads (Array<Grob_info> primitives)
  */
 void
 Mensural_ligature_engraver::propagate_properties (Spanner *ligature,
-                                                 Array<Grob_info> primitives)
+                                                 std::vector<Grob_info> primitives)
 {
   Real thickness
     = robust_scm2double (ligature->get_property ("thickness"), 1.4);
@@ -316,7 +316,7 @@ Mensural_ligature_engraver::propagate_properties (Spanner *ligature,
 
   Real half_flexa_width = 0.5 * (flexa_width + thickness);
 
-  for (int i = 0; i < primitives.size (); i++)
+  for (vsize i = 0; i < primitives.size (); i++)
     {
       Item *primitive = dynamic_cast<Item *> (primitives[i].grob ());
       int output = scm_to_int (primitive->get_property ("primitive"));
@@ -352,11 +352,11 @@ Mensural_ligature_engraver::propagate_properties (Spanner *ligature,
 }
 
 void
-Mensural_ligature_engraver::fold_up_primitives (Array<Grob_info> primitives)
+Mensural_ligature_engraver::fold_up_primitives (std::vector<Grob_info> primitives)
 {
   Item *first = 0;
   Real distance = 0;
-  for (int i = 0; i < primitives.size (); i++)
+  for (vsize i = 0; i < primitives.size (); i++)
     {
       Item *current = dynamic_cast<Item *> (primitives[i].grob ());
       if (i == 0)
@@ -375,7 +375,7 @@ Mensural_ligature_engraver::fold_up_primitives (Array<Grob_info> primitives)
 
 void
 Mensural_ligature_engraver::build_ligature (Spanner *ligature,
-                                           Array<Grob_info> primitives)
+                                           std::vector<Grob_info> primitives)
 {
   transform_heads (primitives);
   propagate_properties (ligature, primitives);
index a5fc048aa4341cc521aaa3385999e8b2c99be011..13bf59db8c2e4be028491e5966c1bf0b1b1e490b 100644 (file)
@@ -58,7 +58,7 @@ Midi_walker::do_start_note (Midi_note *note)
   Moment stop_mom = note->get_length () + ptr->audio_column_->at_mom ();
 
   bool play_start = true;
-  for (int i = 0; i < stop_note_queue.size (); i++)
+  for (vsize i = 0; i < stop_note_queue.size (); i++)
     {
       /* if this pith already in queue */
       if (stop_note_queue[i].val->get_pitch () == note->get_pitch ())
index ee5dd51fda048d1b96167d4a4167d7035b506a27..9eef5ecf3a43d11efbef58dcea06dcc749433665 100644 (file)
@@ -35,10 +35,10 @@ log_2 (double x)
   return log (x) / log (2.0);
 }
 
-Array<std::string>
+std::vector<std::string>
 split_string (std::string s, char c)
 {
-  Array<std::string> rv;
+  std::vector<std::string> rv;
   while (s.length ())
     {
       ssize i = s.find (c);
@@ -52,7 +52,7 @@ split_string (std::string s, char c)
       if (i == NPOS)
        i = s.length ();
 
-      rv.push (s.substr (0, i));
+      rv.push_back (s.substr (0, i));
       s = s.substr (i, s.length () - i);
     }
 
index d0f625b1c9e8ad08f249c05248d612d670d5a31c..c429b67b489f30ab9abab9f4897c178fd70c2445 100644 (file)
@@ -69,7 +69,7 @@ Multi_measure_rest_engraver::try_music (Music *event)
     }
   else if (event->is_mus_type ("multi-measure-text-event"))
     {
-      text_events_.push (event);
+      text_events_.push_back (event);
       return true;
     }
   return false;
@@ -85,11 +85,11 @@ Multi_measure_rest_engraver::process_music ()
 
       Spanner *sp
        = make_spanner ("MultiMeasureRestNumber", rest_ev_->self_scm ());
-      numbers_.push (sp);
+      numbers_.push_back (sp);
 
       if (text_events_.size ())
        {
-         for (int i = 0; i < text_events_.size (); i++)
+         for (vsize i = 0; i < text_events_.size (); i++)
            {
 
              Music *e = text_events_[i];
@@ -101,7 +101,7 @@ Multi_measure_rest_engraver::process_music ()
              if (is_direction (dir))
                sp->set_property ("direction", dir);
 
-             numbers_.push (sp);
+             numbers_.push_back (sp);
            }
 
          /*
@@ -111,7 +111,7 @@ Multi_measure_rest_engraver::process_music ()
          do
            {
              Grob *last = 0;
-             for (int i = 0; i < numbers_.size (); i++)
+             for (vsize i = 0; i < numbers_.size (); i++)
                {
                  if (scm_from_int (d) == numbers_[i]->get_property ("direction"))
                    {
@@ -124,7 +124,7 @@ Multi_measure_rest_engraver::process_music ()
          while (flip (&d) != DOWN);
        }
 
-      for (int i = 0; i < numbers_.size (); i++)
+      for (vsize i = 0; i < numbers_.size (); i++)
        {
          Side_position_interface::add_support (numbers_[i], mmrest_);
          numbers_[i]->set_parent (mmrest_, Y_AXIS);
@@ -157,14 +157,14 @@ Multi_measure_rest_engraver::stop_translation_timestep ()
       if (last_rest_)
        {
          add_bound_item (last_rest_, last_command_item_);
-         for (int i = 0; i < last_numbers_.size (); i++)
+         for (vsize i = 0; i < last_numbers_.size (); i++)
            add_bound_item (last_numbers_[i], last_command_item_);
        }
 
       if (mmrest_)
        {
          add_bound_item (mmrest_, last_command_item_);
-         for (int i = 0; i < numbers_.size (); i++)
+         for (vsize i = 0; i < numbers_.size (); i++)
            add_bound_item (numbers_[i], last_command_item_);
 
          last_command_item_ = 0;
index 0b796673e8932604bad82c27800acd0efd672370..9c1bb10d7d8d452388c5116830c02a9b8ecb1278 100644 (file)
@@ -43,9 +43,9 @@ struct Finger_tuple
 
 class New_fingering_engraver : public Engraver
 {
-  Array<Finger_tuple> fingerings_;
-  Array<Finger_tuple> articulations_;
-  Array<Finger_tuple> string_numbers_;
+  std::vector<Finger_tuple> fingerings_;
+  std::vector<Finger_tuple> articulations_;
+  std::vector<Finger_tuple> string_numbers_;
 
   Link_array<Grob> heads_;
   Grob *stem_;
@@ -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, Array<Finger_tuple> *);
+  void position_scripts (SCM orientations, std::vector<Finger_tuple> *);
 };
 
 void
@@ -95,7 +95,7 @@ New_fingering_engraver::acknowledge_rhythmic_head (Grob_info inf)
        }
     }
 
-  heads_.push (inf.grob ());
+  heads_.push_back (inf.grob ());
 }
 
 void
@@ -119,7 +119,7 @@ New_fingering_engraver::add_script (Grob *head,
     {
       ft.script_ = g;
 
-      articulations_.push (ft);
+      articulations_.push_back (ft);
 
       ft.script_->set_parent (head, X_AXIS);
     }
@@ -159,7 +159,7 @@ New_fingering_engraver::add_fingering (Grob *head,
   ft.note_event_ = hevent;
   ft.head_ = head;
 
-  fingerings_.push (ft);
+  fingerings_.push_back (ft);
 }
 
 void
@@ -182,14 +182,14 @@ New_fingering_engraver::add_string (Grob *head,
   ft.note_event_ = hevent;
   ft.head_ = head;
 
-  string_numbers_.push (ft);
+  string_numbers_.push_back (ft);
 }
 
 void
 New_fingering_engraver::position_scripts (SCM orientations,
-                                         Array<Finger_tuple> *scripts)
+                                         std::vector<Finger_tuple> *scripts)
 {
-  for (int i = 0; i < scripts->size (); i++)
+  for (vsize i = 0; i < scripts->size (); i++)
     if (stem_ && to_boolean (scripts->elem (i).script_->get_property ("add-stem-support")))
       Side_position_interface::add_support (scripts->elem (i).script_, stem_);
 
@@ -202,20 +202,20 @@ New_fingering_engraver::position_scripts (SCM orientations,
     to the note head, and write a more flexible function for
     positioning the fingerings, setting both X and Y coordinates.
   */
-  for (int i = 0; i < scripts->size (); i++)
+  for (vsize i = 0; i < scripts->size (); i++)
     (*scripts)[i].position_ = scm_to_int ((*scripts)[i].head_->get_property ("staff-position"));
 
-  for (int i = scripts->size (); i--;)
-    for (int j = heads_.size (); j--;)
+  for (vsize i = scripts->size (); i--;)
+    for (vsize j = heads_.size (); j--;)
       Side_position_interface::add_support ((*scripts)[i].script_, heads_[j]);
 
-  Array<Finger_tuple> up, down, horiz;
-  for (int i = scripts->size (); i--;)
+  std::vector<Finger_tuple> up, down, horiz;
+  for (vsize i = scripts->size (); i--;)
     {
       SCM d = (*scripts)[i].finger_event_->get_property ("direction");
       if (to_dir (d))
        {
-         ((to_dir (d) == UP) ? up : down).push ((*scripts)[i]);
+         ((to_dir (d) == UP) ? up : down).push_back ((*scripts)[i]);
          scripts->del (i);
        }
     }
@@ -230,11 +230,14 @@ New_fingering_engraver::position_scripts (SCM orientations,
   if (left_p || right_p)
     {
       if (up_p && !up.size () && scripts->size ())
-       up.push (scripts->pop ());
+       {
+         up.push_back (scripts->back ());
+         scripts->pop_back ();
+       }
 
       if (down_p && !down.size () && scripts->size ())
        {
-         down.push ((*scripts)[0]);
+         down.push_back ((*scripts)[0]);
          scripts->del (0);
        }
 
@@ -262,7 +265,7 @@ New_fingering_engraver::position_scripts (SCM orientations,
       scripts->clear ();
     }
 
-  for (int i = 0; i < horiz.size (); i++)
+  for (vsize i = 0; i < horiz.size (); i++)
     {
       Finger_tuple ft = horiz[i];
       Grob *f = ft.script_;
@@ -279,10 +282,10 @@ New_fingering_engraver::position_scripts (SCM orientations,
   int finger_prio = 200;
 
   Direction d = DOWN;
-  Drul_array< Array<Finger_tuple> > vertical (down, up);
+  Drul_array< std::vector<Finger_tuple> > vertical (down, up);
   do
     {
-      for (int i = 0; i < vertical[d].size (); i++)
+      for (vsize i = 0; i < vertical[d].size (); i++)
        {
          Finger_tuple ft = vertical[d][i];
          Grob *f = ft.script_;
@@ -317,11 +320,11 @@ New_fingering_engraver::stop_translation_timestep ()
       string_numbers_.clear ();
     }
 
-  for (int i = articulations_.size (); i--;)
+  for (vsize i = articulations_.size (); i--;)
     {
       Grob *script = articulations_[i].script_;
 
-      for (int j = heads_.size (); j--;)
+      for (vsize j = heads_.size (); j--;)
        Side_position_interface::add_support (script, heads_[j]);
 
       if (stem_ && to_dir (script->get_property ("side-relative-direction")))
index 284810d6eca4365189f81b33b4fb910b37a859d4..e7a6c621c87eeec82303e3435085b52e195e9177 100644 (file)
@@ -23,8 +23,8 @@
 
 void
 check_meshing_chords (Grob *me,
-                     Drul_array<Array<Real> > *offsets,
-                     Drul_array<Array<Slice> > const &extents,
+                     Drul_array<std::vector<Real> > *offsets,
+                     Drul_array<std::vector<Slice> > const &extents,
                      Drul_array<Link_array<Grob> > const &clash_groups)
 
 {
@@ -41,15 +41,15 @@ check_meshing_chords (Grob *me,
   Grob *nu = Note_column::first_head (cu);
   Grob *nd = Note_column::first_head (cd);
 
-  Array<int> ups = Stem::note_head_positions (Note_column::get_stem (cu));
-  Array<int> dps = Stem::note_head_positions (Note_column::get_stem (cd));
+  std::vector<int> ups = Stem::note_head_positions (Note_column::get_stem (cu));
+  std::vector<int> dps = Stem::note_head_positions (Note_column::get_stem (cd));
 
   /* Too far apart to collide.  */
-  if (ups[0] > dps.top () + 1)
+  if (ups[0] > dps.back () + 1)
     return;
 
   // FIXME: what's this?
-  bool merge_possible = (ups[0] >= dps[0]) && (ups.top () >= dps.top ());
+  bool merge_possible = (ups[0] >= dps[0]) && (ups.back () >= dps.back ());
 
   /* Do not merge notes typeset in different style. */
   if (!ly_is_equal (nu->get_property ("style"),
@@ -127,8 +127,7 @@ check_meshing_chords (Grob *me,
   bool distant_half_collide = false;
   bool full_collide = false;
 
-  int i = 0, j = 0;
-  while (i < ups.size () && j < dps.size ())
+  for (vsize i = 0, j = 0; i < ups.size () && j < dps.size (); )
     {
       if (abs (ups[i] - dps[j]) == 1)
        {
@@ -140,9 +139,9 @@ check_meshing_chords (Grob *me,
        }
       else if (ups[i] == dps[j])
        full_collide = true;
-      else if (ups[i] > dps[0] && ups[i] < dps.top ())
+      else if (ups[i] > dps[0] && ups[i] < dps.back ())
        merge_possible = false;
-      else if (dps[j] > ups[0] && dps[j] < ups.top ())
+      else if (dps[j] > ups[0] && dps[j] < ups.back ())
        merge_possible = false;
 
       if (ups[i] < dps[j])
@@ -165,7 +164,7 @@ check_meshing_chords (Grob *me,
 
   Real shift_amount = 1;
 
-  bool touch = (ups[0] >= dps.top ());
+  bool touch = (ups[0] >= dps.back ());
   if (touch)
     shift_amount *= -1;
 
@@ -269,7 +268,7 @@ check_meshing_chords (Grob *me,
   Direction d = UP;
   do
     {
-      for (int i = 0; i < clash_groups[d].size (); i++)
+      for (vsize i = 0; i < clash_groups[d].size (); i++)
        (*offsets)[d][i] += d * shift_amount;
     }
   while ((flip (&d)) != UP);
@@ -286,7 +285,7 @@ Note_collision_interface::calc_positioning_done (SCM smob)
   Direction d = UP;
   do
     {
-      for (int i = cg[d].size(); i--; )
+      for (vsize i = cg[d].size(); i--; )
        {
          /*
            Trigger positioning
@@ -313,14 +312,14 @@ Note_collision_interface::calc_positioning_done (SCM smob)
   Link_array<Grob> done;
   Real left_most = 1e6;
 
-  Array<Real> amounts;
+  std::vector<Real> amounts;
   for (; scm_is_pair (hand); hand = scm_cdr (hand))
     {
       Grob *s = unsmob_grob (scm_caar (hand));
       Real amount = scm_to_double (scm_cdar (hand)) * wid;
 
-      done.push (s);
-      amounts.push (amount);
+      done.push_back (s);
+      amounts.push_back (amount);
       if (amount < left_most)
        left_most = amount;
     }
@@ -331,14 +330,14 @@ Note_collision_interface::calc_positioning_done (SCM smob)
 
       if (!done.find (s))
        {
-         done.push (s);
-         amounts.push (amount);
+         done.push_back (s);
+         amounts.push_back (amount);
          if (amount < left_most)
            left_most = amount;
        }
     }
 
-  for (int i = 0; i < amounts.size (); i++)
+  for (vsize i = 0; i < amounts.size (); i++)
     done[i]->translate_axis (amounts[i] - left_most, X_AXIS);
 
   return SCM_BOOL_T;
@@ -350,11 +349,11 @@ Note_collision_interface::get_clash_groups (Grob *me)
   Drul_array<Link_array<Grob> > clash_groups;
 
   extract_grob_set (me, "elements", elements);
-  for (int i = 0; i < elements.size (); i++)
+  for (vsize i = 0; i < elements.size (); i++)
     {
       Grob *se = elements[i];
       if (Note_column::has_interface (se))
-       clash_groups[Note_column::dir (se)].push (se);
+       clash_groups[Note_column::dir (se)].push_back (se);
     }
 
   Direction d = UP;
@@ -378,27 +377,27 @@ Note_collision_interface::automatic_shift (Grob *me,
                                           Drul_array < Link_array<Grob>
                                           > clash_groups)
 {
-  Drul_array < Array<int> > shifts;
+  Drul_array < std::vector<int> > shifts;
   SCM tups = SCM_EOL;
 
   Direction d = UP;
   do
     {
-      Array<int> &shift (shifts[d]);
+      std::vector<int> &shift (shifts[d]);
       Link_array<Grob> &clashes (clash_groups[d]);
 
-      for (int i = 0; i < clashes.size (); i++)
+      for (vsize i = 0; i < clashes.size (); i++)
        {
          SCM sh
            = clashes[i]->get_property ("horizontal-shift");
 
          if (scm_is_number (sh))
-           shift.push (scm_to_int (sh));
+           shift.push_back (scm_to_int (sh));
          else
-           shift.push (0);
+           shift.push_back (0);
        }
 
-      for (int i = 1; i < shift.size (); i++)
+      for (vsize i = 1; i < shift.size (); i++)
        {
          if (shift[i - 1] == shift[i])
            {
@@ -409,18 +408,18 @@ Note_collision_interface::automatic_shift (Grob *me,
     }
   while ((flip (&d)) != UP);
 
-  Drul_array<Array<Slice> > extents;
-  Drul_array<Array<Real> > offsets;
+  Drul_array<std::vector<Slice> > extents;
+  Drul_array<std::vector<Real> > offsets;
   d = UP;
   do
     {
-      for (int i = 0; i < clash_groups[d].size (); i++)
+      for (vsize i = 0; i < clash_groups[d].size (); i++)
        {
          Slice s (Note_column::head_positions_interval (clash_groups[d][i]));
          s[LEFT]--;
          s[RIGHT]++;
-         extents[d].push (s);
-         offsets[d].push (d * 0.5 * i);
+         extents[d].push_back (s);
+         offsets[d].push_back (d * 0.5 * i);
        }
     }
   while ((flip (&d)) != UP);
@@ -436,13 +435,13 @@ Note_collision_interface::automatic_shift (Grob *me,
 
   do
     {
-      for (int i = 1; i < clash_groups[d].size (); i++)
+      for (vsize i = 1; i < clash_groups[d].size (); i++)
        {
          Slice prev = extents[d][i - 1];
          prev.intersect (extents[d][i]);
          if (prev.length () > 0
              || (extents[-d].size () && d * (extents[d][i][-d] - extents[-d][0][d]) < 0))
-           for (int j = i; j < clash_groups[d].size (); j++)
+           for (vsize j = i; j < clash_groups[d].size (); j++)
              offsets[d][j] += d * 0.5;
        }
     }
@@ -456,7 +455,7 @@ Note_collision_interface::automatic_shift (Grob *me,
 
   do
     {
-      for (int i = 0; i < clash_groups[d].size (); i++)
+      for (vsize i = 0; i < clash_groups[d].size (); i++)
        tups = scm_cons (scm_cons (clash_groups[d][i]->self_scm (),
                                   scm_from_double (offsets[d][i])),
                         tups);
@@ -472,7 +471,7 @@ Note_collision_interface::forced_shift (Grob *me)
   SCM tups = SCM_EOL;
 
   extract_grob_set (me, "elements", elements);
-  for (int i = 0; i < elements.size (); i++)
+  for (vsize i = 0; i < elements.size (); i++)
     {
       Grob *se = elements[i];
 
index 8d4204b674a7a941e2b64df18b797207a7ef8237..ba8ebd6fd8c700fbe4d1fd28160631ac478068c6 100644 (file)
@@ -60,7 +60,7 @@ Note_column::head_positions_interval (Grob *me)
   iv.set_empty ();
 
   extract_grob_set (me, "note-heads", heads);
-  for (int i = 0; i < heads.size (); i++)
+  for (vsize i = 0; i < heads.size (); i++)
     {
       Grob *se = heads[i];
 
@@ -162,7 +162,7 @@ Note_column::accidentals (Grob *me)
 {
   extract_grob_set (me, "note-heads", heads);
   Grob *acc = 0;
-  for (int i = 0; i < heads.size (); i++)
+  for (vsize i = 0; i < heads.size (); i++)
     {
       Grob *h = heads[i];
       acc = h ? unsmob_grob (h->get_object ("accidental-grob")) : 0;
index 2aa23935b71a7be680a1b04cea41b3c38c56e8b1..3a8705168c95e9e73d83f0092b7fbb337c71322e 100644 (file)
@@ -42,7 +42,7 @@ Note_heads_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("note-event"))
     {
-      note_evs_.push (m);
+      note_evs_.push_back (m);
       return true;
     }
   else if (m->is_mus_type ("busy-playing-event"))
@@ -54,7 +54,7 @@ Note_heads_engraver::try_music (Music *m)
 void
 Note_heads_engraver::process_music ()
 {
-  for (int i = 0; i < note_evs_.size (); i++)
+  for (vsize i = 0; i < note_evs_.size (); i++)
     {
       Music *ev = note_evs_[i];
       Item *note = make_item ("NoteHead", ev->self_scm ());
@@ -73,7 +73,7 @@ Note_heads_engraver::process_music ()
 
          d->set_parent (note, Y_AXIS);
 
-         dots_.push (d);
+         dots_.push_back (d);
        }
 
       Pitch *pit = unsmob_pitch (ev->get_property ("pitch"));
@@ -112,7 +112,7 @@ Note_heads_engraver::process_music ()
            note->set_property ("style", style);
        }
 
-      notes_.push (note);
+      notes_.push_back (note);
     }
 }
 
index b464eeefcf7bba9fb5aa853d3da96e58a9b72f29..1fc63b024266c9d0ecab1009208904bf3fe1b005 100644 (file)
@@ -26,7 +26,7 @@ Note_name_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("note-event"))
     {
-      events_.push (m);
+      events_.push_back (m);
       return true;
     }
   return false;
@@ -36,7 +36,7 @@ void
 Note_name_engraver::process_music ()
 {
   std::string s;
-  for (int i = 0; i < events_.size (); i++)
+  for (vsize i = 0; i < events_.size (); i++)
     {
       if (i)
        s += " ";
@@ -51,7 +51,7 @@ Note_name_engraver::process_music ()
     {
       Item *t = make_item ("NoteName", events_[0]->self_scm ());
       t->set_property ("text", scm_makfrom0str (s.c_str ()));
-      texts_.push (t);
+      texts_.push_back (t);
     }
 }
 
index 28ff54d2b554257955712bea2782843eba89e3a5..77c0a21bf8d4800557b55de3156131890ed191a5 100644 (file)
@@ -53,7 +53,7 @@ Note_performer::process_music ()
              Audio_note *p = new Audio_note (*pitp, n->get_length (), - transposing);
              Audio_element_info info (p, n);
              announce_element (info);
-             notes_.push (p);
+             notes_.push_back (p);
            }
        }
       note_evs_.clear ();
@@ -66,7 +66,7 @@ Note_performer::stop_translation_timestep ()
   // why don't grace notes show up here?
   // --> grace notes effectively do not get delayed
   Moment now = now_mom ();
-  for (int i = 0; i < notes_.size (); i++)
+  for (vsize i = 0; i < notes_.size (); i++)
     play_element (notes_[i]);
   notes_.clear ();
   note_evs_.clear ();
@@ -77,7 +77,7 @@ Note_performer::try_music (Music *ev)
 {
   if (ev->is_mus_type ("note-event"))
     {
-      note_evs_.push (ev);
+      note_evs_.push_back (ev);
       return true;
     }
   else if (ev->is_mus_type ("busy-playing-event"))
index d42d7ced160a9a348addacd109ed61009aa9f7f0..8206b3b4e92ce77f96ca5e5c3a5c11b4671c321d 100644 (file)
@@ -40,7 +40,7 @@ Note_spacing::get_spacing (Grob *me, Item *right_col,
   do
     {
       Link_array<Grob> const &items (ly_scm2link_array (props [d]));
-      for (int i = items.size (); i--;)
+      for (vsize i = items.size (); i--;)
        {
          Item *it = dynamic_cast<Item *> (items[i]);
 
@@ -204,7 +204,7 @@ Note_spacing::right_column (Grob *me)
   Item *mincol = 0;
   int min_rank = INT_MAX;
   bool prune = false;
-  for (int i = 0; a && i < a->size (); i++)
+  for (vsize i = 0; a && i < a->size (); i++)
     {
       Item *ri = a->item (i);
       Item *col = ri->get_column ();
@@ -224,7 +224,7 @@ Note_spacing::right_column (Grob *me)
   if (prune && a)
     {
       Link_array<Grob> &right = a->array_reference ();
-      for (int i = right.size (); i--;)
+      for (vsize i = right.size (); i--;)
        {
          if (dynamic_cast<Item *> (right[i])->get_column () != mincol)
            right.del (i);
@@ -270,7 +270,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn,
   do
     {
       Link_array<Grob> const &items (ly_scm2link_array (props [d]));
-      for (int i = 0; i < items.size (); i++)
+      for (vsize i = 0; i < items.size (); i++)
        {
          Item *it = dynamic_cast<Item *> (items[i]);
 
index 3c0cfc2c7c4fa17d5783209ca7d0bc8123e495a4..f3b90b124cebbe971131e90fbacef8598bbd6640 100644 (file)
@@ -55,7 +55,7 @@ Ottava_bracket::print (SCM smob)
        {
          extract_grob_set (b, "note-heads", heads);
          common = common_refpoint_of_array (heads, common, X_AXIS);
-         for (int i = 0; i < heads.size (); i++)
+         for (vsize i = 0; i < heads.size (); i++)
            {
              Grob *h = heads[i];
              Grob *dots = Rhythmic_head::get_dots (h);
@@ -87,7 +87,7 @@ Ottava_bracket::print (SCM smob)
       if (Note_column::has_interface (b))
        {
          extract_grob_set (b, "note-heads", heads);
-         for (int i = 0; i < heads.size (); i++)
+         for (vsize i = 0; i < heads.size (); i++)
            {
              Grob *h = heads[i];
              ext.unite (h->extent (common, X_AXIS));
index 8e57ddf1d25e6b4b35de8aba0be60eb10f65608f..d3eeccedfccc5578563cad8cfcc5e0d918f10967 100644 (file)
@@ -31,7 +31,7 @@ Output_property_engraver::try_music (Music* m)
 {
   if (m->is_mus_type ("layout-instruction"))
     {
-      props_.push (m);
+      props_.push_back (m);
       return true;
     }
   return false;
@@ -40,7 +40,7 @@ Output_property_engraver::try_music (Music* m)
 void
 Output_property_engraver::acknowledge_grob (Grob_info inf)
 {
-  for (int i = props_.size (); i--;)
+  for (vsize i = props_.size (); i--;)
     {
       Music *o = props_[i];
       Context *d = inf.context ();
index 6f832e7621fb8511d51c1a1d440d3c4483eef3b6..5c93c1386cbf7642d7837486654f2f7e4096438d 100644 (file)
@@ -43,8 +43,7 @@ properties_to_pango_description (SCM chain, Real text_size)
                                 0.0);
   Real size = text_size * pow (2.0, step / 6.0);
 
-  pango_font_description_set_size (description,
-                                  gint (size * PANGO_SCALE));
+  pango_font_description_set_size (description, gint (size * PANGO_SCALE));
   return description;
 }
 
index bf125664606629b861c51ff7348a6a8c59fcc722..0677be700c55eaf4fa2bd886856cd7f42ddb472d 100644 (file)
@@ -65,7 +65,7 @@ SCM
 dump_fields ()
 {
   SCM fields = SCM_EOL;
-  for (int i = dump_header_fieldnames_global.size (); i--;)
+  for (vsize i = dump_header_fieldnames_global.size (); i--;)
     fields
       = scm_cons (ly_symbol2scm (dump_header_fieldnames_global[i].c_str ()),
                  fields);
index 9076080653bad537af73f8f5fdf6c48c3ea2daa3..13cc58fedd3045ad1a79d6cdfd7184963fbc7b10 100644 (file)
@@ -71,7 +71,7 @@ Paper_column_engraver::initialize ()
 void
 Paper_column_engraver::acknowledge_item (Grob_info gi)
 {
-  items_.push (gi.item ());
+  items_.push_back (gi.item ());
 }
 
 void
@@ -168,7 +168,7 @@ Paper_column_engraver::process_music ()
 void
 Paper_column_engraver::stop_translation_timestep ()
 {
-  for (int i = 0; i < items_.size (); i++)
+  for (vsize i = 0; i < items_.size (); i++)
     {
       Item *elem = items_[i];
       if (!elem->get_parent (X_AXIS)
index 9993b029ed94b3e782c365733cb1732dba1ab240..3094f817593dfb1f13d3cc4ab786f8026c74fe93 100644 (file)
@@ -159,7 +159,7 @@ Paper_column::before_line_breaking (SCM grob)
 
   Link_array<Grob> &array (ga->array_reference ());
 
-  for (int i = array.size (); i--;)
+  for (vsize i = array.size (); i--;)
     {
       Grob *g = array[i];
 
index 424773227333a4fab965dffe59047a3dd0e15638..6bc05c4e13807c2e3bd3ebdebd1a6cc771e9d161 100644 (file)
@@ -58,11 +58,11 @@ Paper_score::typeset_system (System *system)
   system->unprotect ();
 }
 
-Array<Column_x_positions>
+std::vector<Column_x_positions>
 Paper_score::calc_breaking ()
 {
   Break_algorithm *algorithm = 0;
-  Array<Column_x_positions> sol;
+  std::vector<Column_x_positions> sol;
 
   algorithm = new Gourlay_breaking;
   algorithm->set_pscore (this);
@@ -88,11 +88,11 @@ Paper_score::process ()
      doubly, also done in Score_engraver */
   Link_array<Grob> pc (system_->columns ());
   pc[0]->set_property ("breakable", SCM_BOOL_T);
-  pc.top ()->set_property ("breakable", SCM_BOOL_T);
+  pc.back ()->set_property ("breakable", SCM_BOOL_T);
 
   system_->pre_processing ();
 
-  Array<Column_x_positions> breaking = calc_breaking ();
+  std::vector<Column_x_positions> breaking = calc_breaking ();
   system_->break_into_pieces (breaking);
 
   paper_systems_ = system_->get_paper_systems ();
index 695bb399f7a00cc15be7a9e6831e877521016a46..93899350e0ca8d8bc76e009e3a05eb07acf13a06 100644 (file)
@@ -48,7 +48,7 @@ Performance::output (Midi_stream &midi_stream)
   output_header_track (midi_stream);
   message (_ ("Track...") + " ");
   int channel = 0;
-  for (int i = 0; i < audio_staffs_.size (); i++)
+  for (vsize i = 0; i < audio_staffs_.size (); i++)
     {
       Audio_staff *s = audio_staffs_[i];
       if (be_verbose_global)
@@ -145,7 +145,7 @@ void
 Performance::add_element (Audio_element *p)
 {
   if (Audio_staff *s = dynamic_cast<Audio_staff *> (p))
-    audio_staffs_.push (s);
+    audio_staffs_.push_back (s);
   audio_element_list_ = new Killing_cons<Audio_element> (p, audio_element_list_);
 }
 
index 0e1949657f8ea443f98f1fc088c8ec9d6f0a2c7f..9e71c6e7629c4ec817db3ca75bbea04fa337832c 100644 (file)
@@ -23,7 +23,7 @@ ADD_TRANSLATOR_GROUP (Performer_group,
 void
 Performer_group::announce_element (Audio_element_info info)
 {
-  announce_infos_.push (info);
+  announce_infos_.push_back (info);
   Translator_group *t
     = context ()->get_parent_context ()->implementation ();
 
@@ -34,7 +34,7 @@ Performer_group::announce_element (Audio_element_info info)
 void
 Performer_group::acknowledge_audio_elements ()
 {
-  for (int j = 0; j < announce_infos_.size (); j++)
+  for (vsize j = 0; j < announce_infos_.size (); j++)
     {
       Audio_element_info info = announce_infos_[j];
 
index 4194be280fb008741a4d48385dfeb2e0ddbe9f66..b8eed4092d72692b705b112f543d50ef45a1e23c 100644 (file)
@@ -72,7 +72,7 @@ Phrasing_slur_engraver::try_music (Music *m)
        }
       else if (d == STOP)
        {
-         if (slurs_.is_empty ())
+         if (slurs_.empty ())
            return false;
 
          events_[STOP] = m;
@@ -86,9 +86,9 @@ void
 Phrasing_slur_engraver::acknowledge_note_column (Grob_info info)
 {
   Grob *e = info.grob ();
-  for (int i = slurs_.size (); i--;)
+  for (vsize i = slurs_.size (); i--;)
     Slur::add_column (slurs_[i], e);
-  for (int i = end_slurs_.size (); i--;)
+  for (vsize i = end_slurs_.size (); i--;)
     Slur::add_column (end_slurs_[i], e);
 }
 
@@ -101,9 +101,9 @@ Phrasing_slur_engraver::acknowledge_extra_object (Grob_info info)
   if (Tie::has_interface (e)
       || avoid == ly_symbol2scm ("inside"))
     {
-      for (int i = slurs_.size (); i--;)
+      for (vsize i = slurs_.size (); i--;)
        Slur::add_extra_encompass (slurs_[i], e);
-      for (int i = end_slurs_.size (); i--;)
+      for (vsize i = end_slurs_.size (); i--;)
        Slur::add_extra_encompass (end_slurs_[i], e);
     }
   else if (avoid == ly_symbol2scm ("outside")
@@ -179,7 +179,7 @@ Phrasing_slur_engraver::process_music ()
       slurs_.clear ();
     }
 
-  if (events_[START] && slurs_.is_empty ())
+  if (events_[START] && slurs_.empty ())
     {
       Music *ev = events_[START];
 
@@ -188,7 +188,7 @@ Phrasing_slur_engraver::process_music ()
       if (updown)
        set_grob_direction (slur, updown);
 
-      slurs_.push (slur);
+      slurs_.push_back (slur);
     }
 }
 
index 01b51357ff722770258e3bcac86510357e0ee697..b0caa70f123bef7096fa74472ab017d7ab88f8c5 100644 (file)
@@ -48,7 +48,8 @@ Piano_pedal_bracket::print (SCM smob)
       if (broken[d])
        {
          if (orig
-             && ((d == RIGHT && me->get_break_index () != orig->broken_intos_.size () - 1)
+             && ((d == RIGHT
+                  && me->get_break_index () != orig->broken_intos_.size () - 1)
                  || (d == LEFT && me->get_break_index ())))
            height[d] = 0.0;
          else
index 716f5a474213573af5596c7db3f0c9cc6101dfaf..646c7e79d4d8ef530ad130ac7b9c13193ac93656 100644 (file)
@@ -264,8 +264,8 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
          if (previous_.size ())
            // add extra space below the previous already-occuring pedal
            Side_position_interface::add_support (p->line_spanner_,
-                                                 previous_.top ());
-         previous_.push (p->line_spanner_);
+                                                 previous_.back ());
+         previous_.push_back (p->line_spanner_);
        }
     }
 
@@ -386,9 +386,9 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
            // position new pedal spanner below the current one
            */
          if (previous_.size ())
-           Side_position_interface::add_support (p->line_spanner_, previous_.top ());
+           Side_position_interface::add_support (p->line_spanner_, previous_.back ());
 
-         previous_.push (p->line_spanner_);
+         previous_.push_back (p->line_spanner_);
        }
     }
 
index 0edfcfb997d89e2d762b26463a5da7d05f9a258b..f4ac60018a651b1a13d9d13c587c6e65bb76db03 100644 (file)
@@ -85,7 +85,7 @@ Piano_pedal_performer::process_music ()
              Audio_piano_pedal *a = new Audio_piano_pedal;
              a->type_string_ = std::string (p->name_);
              a->dir_ = STOP;
-             audios_.push (a);
+             audios_.push_back (a);
               Audio_element_info info(a, p->event_drul_[STOP]);
               announce_element (info);
            }
@@ -98,7 +98,7 @@ Piano_pedal_performer::process_music ()
          Audio_piano_pedal *a = new Audio_piano_pedal;
          a->type_string_ = std::string (p->name_);
          a->dir_ = START;
-         audios_.push (a);
+         audios_.push_back (a);
           Audio_element_info info(a, p->event_drul_[START]);
           announce_element (info);
        }
@@ -110,7 +110,7 @@ Piano_pedal_performer::process_music ()
 void
 Piano_pedal_performer::stop_translation_timestep ()
 {
-  for (int i = 0; i < audios_.size (); i++)
+  for (vsize i = 0; i < audios_.size (); i++)
     play_element (audios_[i]);
   audios_.clear ();
 }
index 302c90b9f0d2c5424869d2167e08393135f14748..ec983e5d0c3e75b32877c828764f65b597d40bf1 100644 (file)
@@ -50,12 +50,12 @@ Pitched_trill_engraver::Pitched_trill_engraver ()
 void
 Pitched_trill_engraver::acknowledge_dots (Grob_info info)
 {
-  heads_.push (info.grob ());
+  heads_.push_back (info.grob ());
 }
 void
 Pitched_trill_engraver::acknowledge_note_head (Grob_info info)
 {
-  heads_.push (info.grob ());
+  heads_.push_back (info.grob ());
 }
 
 void
@@ -122,7 +122,7 @@ void
 Pitched_trill_engraver::stop_translation_timestep ()
 {
   if (trill_group_)
-    for (int i = 0; i < heads_.size (); i++)
+    for (vsize i = 0; i < heads_.size (); i++)
       Side_position_interface::add_support (trill_group_, heads_[i]);
 
   heads_.clear ();
index 4daaff0595c30b2ee92c2bfd5c7bd8931c25ed3a..967c4ccec692b121f547d515557275bdeb7523fb 100644 (file)
@@ -60,8 +60,8 @@ internal_extract_item_array (Grob const *elt, SCM symbol)
 {
   Grob_array *arr = unsmob_grob_array (elt->internal_get_object (symbol));
   Link_array<Item> items;
-  for (int i = 0; arr && i < arr->size (); i++)
-    items.push (arr->item (i));
+  for (vsize i = 0; arr && i < arr->size (); i++)
+    items.push_back (arr->item (i));
 
   return items;
 }
index dc53b307adb84b864ed229f854563f426cc40d71..9a756af0edd994b28abd98f4f923d1f24855041d 100644 (file)
@@ -93,7 +93,7 @@ get_help_string ()
   SCM alist = ly_hash2alist (option_hash);
   SCM convertor = ly_lily_module_constant ("scm->string");
 
-  Array<std::string> opts;
+  std::vector<std::string> opts;
 
   for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s))
     {
@@ -122,12 +122,12 @@ get_help_string ()
                   std::string ("\n")
                   + String_convert::char_string (' ', HELP_INDENT));
 
-      opts.push (opt_spec + opt_help + "\n");
+      opts.push_back (opt_spec + opt_help + "\n");
     }
 
   std::string help ("Options supported by ly:set-option\n\n");
   opts.sort (string_compare);
-  for (int i = 0; i < opts.size (); i++)
+  for (vsize i = 0; i < opts.size (); i++)
     help += opts[i];
 
   help += std::string ("\n");
index 1565eb4971307fc909f6dd83f8efb7035e1aef75..4e5669c7aa9a13814620bc91a9e2ca5d81438e1e 100644 (file)
@@ -271,18 +271,18 @@ setup_paths (char const *argv0_ptr)
   char *suffixes[] = {"ly", "ps", "scm", 0 };
 
   
-  Array<std::string> dirs;
+  std::vector<std::string> dirs;
   for (char **s = suffixes; *s; s++)
     {
       std::string path = prefix_directory + to_string ('/') + std::string (*s);
-      dirs.push (path);
+      dirs.push_back (path);
     }
 
 
-  dirs.push (prefix_directory + "/fonts/otf/");
-  dirs.push (prefix_directory + "/fonts/type1/");
-  dirs.push (prefix_directory + "/fonts/svg/");
+  dirs.push_back (prefix_directory + "/fonts/otf/");
+  dirs.push_back (prefix_directory + "/fonts/type1/");
+  dirs.push_back (prefix_directory + "/fonts/svg/");
   
-  for (int i = 0; i < dirs.size (); i++)
+  for (vsize i = 0; i < dirs.size (); i++)
     global_path.prepend (dirs[i]);
 }
index 5a6aa6cfbf62947d35e7a081752cc884df54fa69..2d2b6df053b7119301b9b7a2b8bf744ae4f9d2f5 100644 (file)
@@ -34,7 +34,7 @@ void
 Rest_collision_engraver::process_acknowledged ()
 {
   if (rest_collision_
-      || note_columns_.is_empty ()
+      || note_columns_.empty ()
       || !rest_count_
       || (note_columns_.size () == rest_count_
          && rest_count_ < 2))
@@ -42,14 +42,14 @@ Rest_collision_engraver::process_acknowledged ()
 
   rest_collision_ = make_item ("RestCollision", SCM_EOL);
 
-  for (int i = 0; i < note_columns_.size (); i++)
+  for (vsize i = 0; i < note_columns_.size (); i++)
     Rest_collision::add_column (rest_collision_, note_columns_[i]);
 }
 
 void
 Rest_collision_engraver::acknowledge_note_column (Grob_info i)
 {
-  note_columns_.push (i.grob ());
+  note_columns_.push_back (i.grob ());
   if (Note_column::has_rests (i.grob ()))
     rest_count_++;
 }
index 1bd6f7924e5d1c34713d3ce519d8e31d7dc360e6..1921aa5a177a72a7ea50eff6e2a53218370ee451 100644 (file)
@@ -95,7 +95,7 @@ Rest_collision::calc_positioning_done (SCM smob)
   Link_array<Grob> rests;
   Link_array<Grob> notes;
 
-  for (int i = 0; i < elts.size (); i++)
+  for (vsize i = 0; i < elts.size (); i++)
     {
       Grob *e = elts[i];
       if (unsmob_grob (e->get_object ("rest")))
@@ -107,10 +107,10 @@ Rest_collision::calc_positioning_done (SCM smob)
          if (st && unsmob_grob (st->get_object ("beam")))
            continue;
 
-         rests.push (e);
+         rests.push_back (e);
        }
       else
-       notes.push (e);
+       notes.push_back (e);
     }
 
   /*
@@ -138,13 +138,13 @@ Rest_collision::calc_positioning_done (SCM smob)
        center one should be centered on the staff.
       */
       Drul_array<Link_array<Grob> > ordered_rests;
-      for (int i = 0; i < rests.size (); i++)
+      for (vsize i = 0; i < rests.size (); i++)
        {
          Grob *r = Note_column::get_rest (rests[i]);
 
          Direction d = get_grob_direction (r);
          if (d)
-           ordered_rests[d].push (rests[i]);
+           ordered_rests[d].push_back (rests[i]);
          else
            rests[d]->warning (_ ("can't resolve rest collision: rest direction not set"));
        }
@@ -171,23 +171,23 @@ Rest_collision::calc_positioning_done (SCM smob)
       common = common_refpoint_of_array (ordered_rests[UP], common, Y_AXIS);
 
       Real diff
-       = (ordered_rests[DOWN].top ()->extent (common, Y_AXIS)[UP]
-          - ordered_rests[UP].top ()->extent (common, Y_AXIS)[DOWN]) / staff_space;
+       = (ordered_rests[DOWN].back ()->extent (common, Y_AXIS)[UP]
+          - ordered_rests[UP].back ()->extent (common, Y_AXIS)[DOWN]) / staff_space;
 
       if (diff > 0)
        {
          int amount_down = (int) ceil (diff / 2);
          diff -= amount_down;
-         Note_column::translate_rests (ordered_rests[DOWN].top (),
+         Note_column::translate_rests (ordered_rests[DOWN].back (),
                                        -2 * amount_down);
          if (diff > 0)
-           Note_column::translate_rests (ordered_rests[UP].top (),
+           Note_column::translate_rests (ordered_rests[UP].back (),
                                          2 * int (ceil (diff)));
        }
 
       do
        {
-         for (int i = ordered_rests[d].size () -1; i-- > 0;)
+         for (vsize i = ordered_rests[d].size () -1; i-- > 0;)
            {
              Real last_y = ordered_rests[d][i + 1]->extent (common, Y_AXIS)[d];
              Real y = ordered_rests[d][i]->extent (common, Y_AXIS)[-d];
@@ -209,7 +209,7 @@ Rest_collision::calc_positioning_done (SCM smob)
       Grob *rcol = 0;
       Direction dir = CENTER;
 
-      for (int i = rests.size (); !rcol && i--;)
+      for (vsize i = rests.size (); !rcol && i--;)
        if (Note_column::dir (rests[i]))
          {
            dir = Note_column::dir (rests[i]);
@@ -229,7 +229,7 @@ Rest_collision::calc_positioning_done (SCM smob)
       Real minimum_dist = robust_scm2double (me->get_property ("minimum-distance"), 1.0) * staff_space;
 
       Interval notedim;
-      for (int i = 0; i < notes.size (); i++)
+      for (vsize i = 0; i < notes.size (); i++)
        notedim.unite (notes[i]->extent (common, Y_AXIS));
 
       Real dist
index d40de198def195a9a92113146d8e30f3557444e1..ebc156fc953de1ab7d041fd8b357d745c494a75e 100644 (file)
@@ -101,12 +101,12 @@ Rhythmic_column_engraver::process_acknowledged ()
          add_spacing_item (note_column_);
        }
 
-      for (int i = 0; i < rheads_.size (); i++)
+      for (vsize i = 0; i < rheads_.size (); i++)
        {
          if (!rheads_[i]->get_parent (X_AXIS))
            Note_column::add_head (note_column_, rheads_[i]);
        }
-      rheads_.set_size (0);
+      rheads_.resize (0);
     }
 
   if (note_column_)
@@ -133,7 +133,7 @@ Rhythmic_column_engraver::acknowledge_stem (Grob_info i)
 void
 Rhythmic_column_engraver::acknowledge_rhythmic_head (Grob_info i)
 {
-  rheads_.push (i.grob ());
+  rheads_.push_back (i.grob ());
 }
 
 void
index b5823267869f2376b1b08f85005e59ef2818ed95..7b9c5ef282e546148d9adc078dc4d1ba474006fa 100644 (file)
@@ -111,15 +111,15 @@ Score_engraver::one_time_step ()
 void
 Score_engraver::announce_grob (Grob_info info)
 {
-  announce_infos_.push (info);
+  announce_infos_.push_back (info);
   pscore_->root_system ()->typeset_grob (info.grob ());
-  elems_.push (info.grob ());
+  elems_.push_back (info.grob ());
 }
 
 void
 Score_engraver::typeset_all ()
 {
-  for (int i = 0; i < elems_.size (); i++)
+  for (vsize i = 0; i < elems_.size (); i++)
     {
       Grob *elem = elems_[i];
 
index 85e37a8ac2a17d16def923e433beb5411a8fe3e5..ed9e4077755fa465dcb2630ef648878f5f68782d 100644 (file)
@@ -45,7 +45,7 @@ Score_performer::play_element (Audio_element *p)
 void
 Score_performer::announce_element (Audio_element_info info)
 {
-  announce_infos_.push (info);
+  announce_infos_.push_back (info);
 }
 
 void
index dc33d44e649a18e7196aacab5caf0600e419c695..3cefb8f772d03da847f001e56fd46eac6ae05cf5 100644 (file)
@@ -47,7 +47,7 @@ LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
 
   /* UGR, FIXME, these are default \layout blocks once again.  They
      suck. */
-  for (int i = 0; !score_def && i < sc->defs_.size (); i++)
+  for (vsize i = 0; !score_def && i < sc->defs_.size (); i++)
     if (sc->defs_[i]->c_variable ("is-layout") == SCM_BOOL_T)
       score_def = sc->defs_[i];
 
@@ -97,11 +97,11 @@ LY_DEFINE (ly_score_process, "ly:score-process",
     ? score->header_
     : default_header;
 
-  for (int i = 0; i < score->defs_.size (); i++)
+  for (vsize i = 0; i < score->defs_.size (); i++)
     default_rendering (score->get_music (), score->defs_[i]->self_scm (),
                       default_paper, header, basename, key->self_scm ());
 
-  if (score->defs_.is_empty ())
+  if (score->defs_.empty ())
     {
       default_rendering (score->get_music (),
                         default_layout,
index 1545debcfb449018f47ca6048f08c6321d32f1da..9b525ddd2312b05491bfd21e65514fd0cf5f28ad 100644 (file)
@@ -51,7 +51,7 @@ Score::mark_smob (SCM s)
   Score *sc = (Score *) SCM_CELL_WORD_1 (s);
 
   scm_gc_mark (sc->header_);
-  for (int i = sc->defs_.size (); i--;)
+  for (vsize i = sc->defs_.size (); i--;)
     scm_gc_mark (sc->defs_[i]->self_scm ());
   return sc->music_;
 }
@@ -81,10 +81,10 @@ Score::Score (Score const &s)
   else
     music_ = SCM_EOL;
 
-  for (int i = 0, n = s.defs_.size (); i < n; i++)
+  for (vsize i = 0, n = s.defs_.size (); i < n; i++)
     {
       Output_def *copy = s.defs_[i]->clone ();
-      defs_.push (copy);
+      defs_.push_back (copy);
       copy->unprotect ();
     }
   header_ = ly_make_anonymous_module (false);
@@ -237,5 +237,5 @@ Score::get_music () const
 void
 Score::add_output_def (Output_def *def)
 {
-  defs_.push (def);
+  defs_.push_back (def);
 }
index 53b50336a5d6316f994702454e7eb18f84c1e240..41555cdbff34399b886639299789b54ff370cd88 100644 (file)
@@ -38,7 +38,7 @@ Script_column_engraver::stop_translation_timestep ()
 {
   if (scol_)
     {
-      for (int i = 0; i < scripts_.size (); i++)
+      for (vsize i = 0; i < scripts_.size (); i++)
        if (Side_position_interface::get_axis (scripts_[i]) == Y_AXIS)
          Script_column::add_staff_sided (scol_, scripts_[i]);
     }
@@ -54,7 +54,7 @@ Script_column_engraver::acknowledge_side_position (Grob_info inf)
   if (thing)
     {
       if (!Item::is_breakable (thing))
-       scripts_.push (thing);
+       scripts_.push_back (thing);
     }
 }
 
index 29cf1a53c7beb6d135aa7f473d6c622acdc70dff..bfd95f999ba81872d116050a289582431372bec2 100644 (file)
@@ -45,7 +45,7 @@ Script_column::before_line_breaking (SCM smob)
   Link_array<Grob> staff_sided;
 
   extract_grob_set (me, "scripts", scripts);
-  for (int i = 0; i < scripts.size (); i++)
+  for (vsize i = 0; i < scripts.size (); i++)
     {
       Grob *sc = scripts[i];
 
@@ -54,10 +54,10 @@ Script_column::before_line_breaking (SCM smob)
       */
       if (sc->get_property_data (ly_symbol2scm ("X-offset")) !=
          Side_position_interface::x_aligned_side_proc)
-       staff_sided.push (sc);
+       staff_sided.push_back (sc);
     }
 
-  for (int i = 0; i < staff_sided.size (); i++)
+  for (vsize i = 0; i < staff_sided.size (); i++)
     {
       Grob *g = staff_sided[i];
       Direction d = get_grob_direction (g);
index 44d9de4cacb16937633260b9edb5782a06c18478..f0284d85a9b58542633db7249a7d93f80be5fe07 100644 (file)
@@ -34,7 +34,7 @@ struct Script_tuple
 
 class Script_engraver : public Engraver
 {
-  Array<Script_tuple> scripts_;
+  std::vector<Script_tuple> scripts_;
   Spanner *slur_;
 
 protected:
@@ -72,7 +72,7 @@ Script_engraver::try_music (Music *m)
 
       Script_tuple t;
       t.event_ = m;
-      scripts_.push (t);
+      scripts_.push_back (t);
       return true;
     }
   return false;
@@ -151,7 +151,7 @@ void make_script_from_event (Grob *p,  Context *tg,
 void
 Script_engraver::process_music ()
 {
-  for (int i = 0; i < scripts_.size (); i++)
+  for (vsize i = 0; i < scripts_.size (); i++)
     {
       Music *music = scripts_[i].event_;
 
@@ -201,7 +201,7 @@ Script_engraver::acknowledge_rhythmic_head (Grob_info info)
 {
   if (info.music_cause ())
     {
-      for (int i = 0; i < scripts_.size (); i++)
+      for (vsize i = 0; i < scripts_.size (); i++)
        {
          Grob *e = scripts_[i].script_;
 
@@ -224,7 +224,7 @@ Script_engraver::acknowledge_note_column (Grob_info info)
 
      As the note head to put it on is not known now, postpone this
      decision to Script_interface::calc_direction ().  */
-  for (int i = 0; i < scripts_.size (); i++)
+  for (vsize i = 0; i < scripts_.size (); i++)
     {
       Grob *e = scripts_[i].script_;
 
index cdf126d3dcffb9901555a1b65345a760d5c0c11d..c019fc04306c8d36d2b7f0b6f90cbe8124a3d1f2 100644 (file)
@@ -83,7 +83,7 @@ Separating_group_spanner::set_spacing_rods (SCM smob)
   Real padding = robust_scm2double (me->get_property ("padding"), 0.1);
 
   extract_grob_set (me, "elements", elts);
-  for (int i = elts.size ();
+  for (vsize i = elts.size ();
        i-- > 1;)
     {
       Item *r = dynamic_cast<Item *> (elts[i]);
index 6ac3af3fc1e72e343cd8d2111457de8b3bc02367..1db11947a38f1178335e160a88e282bc957c3a17 100644 (file)
@@ -92,7 +92,7 @@ Separating_line_group_engraver::finalize ()
   sep_span_->set_bound (RIGHT, unsmob_grob (ccol));
   sep_span_ = 0;
 
-  for (int i = 0; i < last_spacings_.note_spacings_.size (); i++)
+  for (vsize i = 0; i < last_spacings_.note_spacings_.size (); i++)
     {
       Pointer_group_interface::add_grob (last_spacings_.note_spacings_[i],
                                         ly_symbol2scm ("right-items"),
@@ -119,7 +119,7 @@ Separating_line_group_engraver::acknowledge_item (Grob_info i)
 
   if (Note_spacing::has_interface (it))
     {
-      current_spacings_.note_spacings_.push (it);
+      current_spacings_.note_spacings_.push_back (it);
       return;
     }
 
index 37e4ef2ef0d7c04d90645ef6946c1aadada366e5..6406a3e0fcc12f9f94cba9a760358e90265d5427 100644 (file)
@@ -39,7 +39,7 @@ Separation_item::conditional_width (Grob *me, Grob *left)
   Paper_column *pc = item->get_column ();
 
   extract_grob_set (me, "conditional-elements", elts);
-  for (int i = 0; i < elts.size (); i++)
+  for (vsize i = 0; i < elts.size (); i++)
     {
       Item *il = dynamic_cast<Item *> (elts[i]);
       if (pc != il->get_column ())
@@ -74,7 +74,7 @@ Separation_item::width (Grob *me)
   Interval w;
 
   extract_grob_set (me, "elements", elts);
-  for (int i = 0; i < elts.size (); i++)
+  for (vsize i = 0; i < elts.size (); i++)
     {
       Item *il = dynamic_cast<Item *> (elts[i]);
       if (pc != il->get_column ())
@@ -123,7 +123,7 @@ Separation_item::extremal_break_aligned_grob (Grob *me,
   Grob *last_grob = 0;
 
   extract_grob_set (me, "elements", elts);
-  for (int i = elts.size (); i--;)
+  for (vsize i = elts.size (); i--;)
     {
       Grob *break_item = elts[i];
       if (!scm_is_symbol (break_item->get_property ("break-align-symbol")))
index a035ca45a039c4efb075b7f62b867afcbccedb23..65f2a694a882a7e17b5b54fc802fd68df96ff8bc 100644 (file)
@@ -74,7 +74,7 @@ Side_position_interface::general_side_position (Grob *me, Axis a, bool use_exten
        dim.unite (staff_extents);
     }
 
-  for (int i = 0; i < support.size (); i++)
+  for (vsize i = 0; i < support.size (); i++)
     {
       Grob *e = support[i];
       if (e)
index b8a8246ab95c5ffcb2331262f299fc689092b421..c47993fb6a29c78e7b5f1cb7f2d6dbff801c920b 100644 (file)
@@ -60,12 +60,12 @@ LY_DEFINE (ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem",
   else
     spacer.my_solve_linelen ();
 
-  Array<Real> posns;
-  posns.push (0.0);
-  for (int i = 0; i < spacer.springs_.size (); i++)
+  std::vector<Real> posns;
+  posns.push_back (0.0);
+  for (vsize i = 0; i < spacer.springs_.size (); i++)
     {
       Real l = spacer.springs_[i].length ((is_ragged) ? 0.0 : spacer.force_);
-      posns.push (posns.top () + l);
+      posns.push_back (posns.back () + l);
     }
 
   SCM force_return = SCM_BOOL_F;
@@ -74,11 +74,11 @@ LY_DEFINE (ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem",
     force_return = scm_from_double (spacer.force_);
 
   if (is_ragged
-      && posns.top () > spacer.line_len_)
+      && posns.back () > spacer.line_len_)
     force_return = SCM_BOOL_F;
 
   SCM retval = SCM_EOL;
-  for (int i = posns.size (); i--;)
+  for (vsize i = posns.size (); i--;)
     retval = scm_cons (scm_from_double (posns[i]), retval);
 
   retval = scm_cons (force_return, retval);
index 6b359f38c0ff4924a79ce6c82ae2a8921e14f078..be700c693c0de2dded888fe080c93af8702bc7cf 100644 (file)
@@ -132,7 +132,7 @@ Real
 Simple_spacer::active_blocking_force () const
 {
   Real bf = -infinity_f;
-  for (int i = 0; i < springs_.size (); i++)
+  for (vsize i = 0; i < springs_.size (); i++)
     if (springs_[i].is_active_)
       bf = max (bf, springs_[i].block_force_);
   return bf;
@@ -151,7 +151,7 @@ Simple_spacer::active_springs_stiffness () const
 
       Real max_block_force = -infinity_f;
       int max_i = -1;
-      for (int i = 0; i < springs_.size (); i++)
+      for (vsize i = 0; i < springs_.size (); i++)
        {
          if (springs_[i].block_force_ > max_block_force)
            {
@@ -169,7 +169,7 @@ void
 Simple_spacer::set_active_states ()
 {
   /* float comparison is safe, since force is only copied.  */
-  for (int i = 0; i < springs_.size (); i++)
+  for (vsize i = 0; i < springs_.size (); i++)
     if (springs_[i].is_active_
        && springs_[i].block_force_ >= force_)
       {
@@ -182,7 +182,7 @@ Real
 Simple_spacer::configuration_length () const
 {
   Real l = 0.;
-  for (int i = 0; i < springs_.size (); i++)
+  for (vsize i = 0; i < springs_.size (); i++)
     l += springs_[i].length (force_);
 
   return l;
@@ -292,11 +292,11 @@ Simple_spacer_wrapper::solve (Column_x_positions *positions, bool ragged)
     We used to have a penalty for compression, no matter what, but that
     fucked up wtk1-fugue2 (taking 3 full pages.)
   */
-  positions->config_.push (spacer_->indent_);
-  for (int i = 0; i < spacer_->springs_.size (); i++)
+  positions->config_.push_back (spacer_->indent_);
+  for (vsize i = 0; i < spacer_->springs_.size (); i++)
     {
       Real l = spacer_->springs_[i].length ((ragged) ? 0.0 : spacer_->force_);
-      positions->config_.push (positions->config_.top () + l);
+      positions->config_.push_back (positions->config_.back () + l);
       /*
        we have l>= 0 here, up to rounding errors
       */
@@ -309,7 +309,7 @@ Simple_spacer_wrapper::solve (Column_x_positions *positions, bool ragged)
   if (ragged)
     {
       positions->satisfies_constraints_
-       = positions->config_.top () < spacer_->line_len_;
+       = positions->config_.back () < spacer_->line_len_;
     }
   else
     positions->satisfies_constraints_ = spacer_->is_active ();
@@ -365,7 +365,7 @@ Simple_spacer::add_spring (Real ideal, Real inverse_hooke)
 
       active_count_++;
     }
-  springs_.push (desc);
+  springs_.push_back (desc);
 }
 
 static int
@@ -381,14 +381,14 @@ Simple_spacer_wrapper::add_columns (Link_array<Grob> const &icols)
   Link_array<Grob> cols (icols);
   cols.clear ();
 
-  for (int i = 0; i < icols.size (); i++)
+  for (vsize i = 0; i < icols.size (); i++)
     if (scm_is_pair (icols[i]->get_object ("between-cols")))
-      loose_cols_.push (icols[i]);
+      loose_cols_.push_back (icols[i]);
     else
-      cols.push (icols[i]);
+      cols.push_back (icols[i]);
 
   spaced_cols_ = cols;
-  for (int i = 0; i < cols.size () - 1; i++)
+  for (vsize i = 0; i < cols.size () - 1; i++)
     {
       Spring_smob *spring = 0;
 
@@ -412,7 +412,7 @@ Simple_spacer_wrapper::add_columns (Link_array<Grob> const &icols)
       spacer_->add_spring (ideal, inverse_hooke);
     }
 
-  for (int i = 0; i < cols.size () - 1; i++)
+  for (vsize i = 0; i < cols.size () - 1; i++)
     {
       for (SCM s = Spaceable_grob::get_minimum_distances (cols[i]);
           scm_is_pair (s); s = scm_cdr (s))
index 2ed56cd7e92dd2058875f76d3ca9c518497b0b67..09ff410cda734189ad1c07f2536a8a7f475bb4e1 100644 (file)
@@ -29,7 +29,7 @@
   skyline[...].width_ forms a partition of the real interval, where
   the segments are adjacent, and ascending. Hence we have
 
-  skyline.top ().width_[RIGHT] = inf
+  skyline.back ().width_[RIGHT] = inf
   skyline[0].width_[LEFT] = -inf
 */
 
@@ -42,7 +42,7 @@ const Real EPS = 1e-12;
   binsearch.
 */
 void
-insert_extent_into_skyline (Array<Skyline_entry> *line, Box b, Axis line_axis,
+insert_extent_into_skyline (std::vector<Skyline_entry> *line, Box b, Axis line_axis,
                            Direction d)
 {
   Interval extent = b[line_axis];
@@ -54,7 +54,7 @@ insert_extent_into_skyline (Array<Skyline_entry> *line, Box b, Axis line_axis,
   /*
     Intersect each segment of LINE with EXTENT, and if non-empty, insert relevant segments.
   */
-  for (int i = line->size (); i--;)
+  for (vsize i = line->size (); i--;)
     {
       Interval w = line->elem (i).width_;
       w.intersect (extent);
@@ -83,11 +83,11 @@ insert_extent_into_skyline (Array<Skyline_entry> *line, Box b, Axis line_axis,
 }
 
 void
-merge_skyline (Array<Skyline_entry> *a1,
-              Array<Skyline_entry> const &a2,
+merge_skyline (std::vector<Skyline_entry> *a1,
+              std::vector<Skyline_entry> const &a2,
               Direction dir)
 {
-  for (int i = 0; i < a2.size (); i++)
+  for (vsize i = 0; i < a2.size (); i++)
     {
       Box b;
       b[X_AXIS] = a2[i].width_;
@@ -98,10 +98,10 @@ merge_skyline (Array<Skyline_entry> *a1,
     }
 }
 
-Array<Skyline_entry>
+std::vector<Skyline_entry>
 empty_skyline (Direction d)
 {
-  Array<Skyline_entry> skyline;
+  std::vector<Skyline_entry> skyline;
 
   Interval i;
   i.set_empty ();
@@ -109,15 +109,15 @@ empty_skyline (Direction d)
   Skyline_entry e;
   e.width_ = i;
   e.height_ = -d * infinity_f;
-  skyline.push (e);
+  skyline.push_back (e);
   return skyline;
 }
 
-Array<Skyline_entry>
-extents_to_skyline (Array<Box> const &extents, Axis a, Direction d)
+std::vector<Skyline_entry>
+extents_to_skyline (std::vector<Box> const &extents, Axis a, Direction d)
 {
 
-  Array<Skyline_entry> skyline = empty_skyline (d);
+  std::vector<Skyline_entry> skyline = empty_skyline (d);
 
   /*
     This makes a cubic algorithm (array  insertion is O (n),
@@ -126,7 +126,7 @@ extents_to_skyline (Array<Box> const &extents, Axis a, Direction d)
     We could do a lot better (n log (n), using a balanced tree) but
     that seems overkill for now.
   */
-  for (int j = extents.size (); j--;)
+  for (vsize j = extents.size (); j--;)
     insert_extent_into_skyline (&skyline, extents[j], a, d);
 
   return skyline;
@@ -139,8 +139,8 @@ extents_to_skyline (Array<Box> const &extents, Axis a, Direction d)
   This is an O (n) algorithm.
 */
 Real
-skyline_meshing_distance (Array<Skyline_entry> const &buildings,
-                         Array<Skyline_entry> const &clouds)
+skyline_meshing_distance (std::vector<Skyline_entry> const &buildings,
+                         std::vector<Skyline_entry> 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 (Array<Skyline_entry> *buildings, Real ground)
+heighten_skyline (std::vector<Skyline_entry> *buildings, Real ground)
 {
-  for (int i = 0; i < buildings->size (); i++)
+  for (vsize i = 0; i < buildings->size (); i++)
     buildings->elem_ref (i).height_ += ground;
 }
 
 Real
-skyline_height (Array<Skyline_entry> const &buildings,
+skyline_height (std::vector<Skyline_entry> const &buildings,
                Real airplane,
                Direction sky_dir)
 {
@@ -192,7 +192,7 @@ skyline_height (Array<Skyline_entry> const &buildings,
   /*
     Ugh! linear, should be O(log n).
    */
-  for (int i = 0; i < buildings.size (); i++)
+  for (vsize i = 0; i < buildings.size (); i++)
     if (buildings[i].width_.contains (airplane))
       h = sky_dir * max (sky_dir * h,
                         sky_dir * buildings[i].height_);
index 1fc83bb8b78294d83eda4dff21499b61bdb66347..f67b00469a5b6ba4b5ae0816e09494a1d7ca54b6 100644 (file)
@@ -25,10 +25,10 @@ avoid_staff_line (Slur_score_state const &state,
                  Bezier bez)
 {
   Offset horiz (1, 0);
-  Array<Real> ts = bez.solve_derivative (horiz);
+  std::vector<Real> ts = bez.solve_derivative (horiz);
 
   /* TODO: handle case of broken slur.  */
-  if (!ts.is_empty ()
+  if (!ts.empty ()
       && (state.extremes_[LEFT].staff_ == state.extremes_[RIGHT].staff_)
       && state.extremes_[LEFT].staff_ && state.extremes_[RIGHT].staff_)
     {
@@ -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, Array<Offset> const &avoid)
+           Bezier curve, Direction d, std::vector<Offset> const &avoid)
 {
   Real fit_factor = 0.0;
   Offset x0 = curve.control_[0];
@@ -76,7 +76,7 @@ fit_factor (Offset dz_unit, Offset dz_perp,
   curve_xext.add_point (curve.control_[0][X_AXIS]);
   curve_xext.add_point (curve.control_[3][X_AXIS]);
 
-  for (int i = 0; i < avoid.size (); i++)
+  for (vsize i = 0; i < avoid.size (); i++)
     {
       Offset z = (avoid[i] - x0);
       Offset p (dot_product (z, dz_unit),
@@ -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,
-                                   Array<Offset> const &avoid)
+                                   std::vector<Offset> const &avoid)
 {
   Offset dz = attachment_[RIGHT]- attachment_[LEFT];;
   Offset dz_unit = dz;
@@ -180,8 +180,8 @@ Slur_configuration::score_encompass (Slur_score_state const &state)
     Distances for heads that are between slur and line between
     attachment points.
   */
-  Array<Real> convex_head_distances;
-  for (int j = 0; j < state.encompass_infos_.size (); j++)
+  std::vector<Real> convex_head_distances;
+  for (vsize j = 0; j < state.encompass_infos_.size (); j++)
     {
       Real x = state.encompass_infos_[j].x_;
 
@@ -200,7 +200,7 @@ Slur_configuration::score_encompass (Slur_score_state const &state)
          if (state.dir_ * head_dy < 0)
            {
              demerit += state.parameters_.head_encompass_penalty_;
-             convex_head_distances.push (0.0);
+             convex_head_distances.push_back (0.0);
            }
          else
            {
@@ -225,7 +225,7 @@ Slur_configuration::score_encompass (Slur_score_state const &state)
                = state.dir_ * max (state.dir_ * state.encompass_infos_[j].get_point (state.dir_), state.dir_ * line_y);
              Real d = fabs (closest - y);
 
-             convex_head_distances.push (d);
+             convex_head_distances.push_back (d);
            }
        }
 
@@ -258,7 +258,7 @@ Slur_configuration::score_encompass (Slur_score_state const &state)
     {
       Real avg_distance = 0.0;
       Real min_dist = infinity_f;
-      for (int j = 0; j < convex_head_distances.size (); j++)
+      for (vsize j = 0; j < convex_head_distances.size (); j++)
        {
          min_dist = min (min_dist, convex_head_distances[j]);
          avg_distance += convex_head_distances[j];
@@ -302,7 +302,7 @@ void
 Slur_configuration::score_extra_encompass (Slur_score_state const &state)
 {
   Real demerit = 0.0;
-  for (int j = 0; j < state.extra_encompass_infos_.size (); j++)
+  for (vsize j = 0; j < state.extra_encompass_infos_.size (); j++)
     {
       Drul_array<Offset> attachment = attachment_;
       Extra_collision_info const &info (state.extra_encompass_infos_[j]);
index 1b8f6d153b9507209e8a29db3fbff2f623de5d05..9fee28767ae34de3edf5e36708313be8c7ea48af 100644 (file)
@@ -86,17 +86,16 @@ void
 Slur_engraver::acknowledge_note_column (Grob_info info)
 {
   Grob *e = info.grob ();
-  for (int i = slurs_.size (); i--;)
+  for (vsize i = slurs_.size (); i--;)
     Slur::add_column (slurs_[i], e);
-  for (int i = end_slurs_.size (); i--;)
+  for (vsize i = end_slurs_.size (); i--;)
     Slur::add_column (end_slurs_[i], e);
 }
 
 void
 Slur_engraver::acknowledge_extra_object (Grob_info info)
 {
-  if (slurs_.is_empty ()
-      && end_slurs_.is_empty ())
+  if (slurs_.empty () && end_slurs_.empty ())
     return ;
   
   Grob *e = info.grob ();
@@ -104,9 +103,9 @@ Slur_engraver::acknowledge_extra_object (Grob_info info)
   if (Tie::has_interface (e)
       || avoid == ly_symbol2scm ("inside"))
     {
-      for (int i = slurs_.size (); i--;)
+      for (vsize i = slurs_.size (); i--;)
        Slur::add_extra_encompass (slurs_[i], e);
-      for (int i = end_slurs_.size (); i--;)
+      for (vsize i = end_slurs_.size (); i--;)
        Slur::add_extra_encompass (end_slurs_[i], e);
     }
   else if (avoid == ly_symbol2scm ("outside")
@@ -189,7 +188,7 @@ Slur_engraver::process_music ()
       slurs_.clear ();
     }
 
-  if (events_[START] && slurs_.is_empty ())
+  if (events_[START] && slurs_.empty ())
     {
       Music *ev = events_[START];
 
@@ -200,14 +199,14 @@ Slur_engraver::process_music ()
       if (updown && !double_slurs)
        set_grob_direction (slur, updown);
 
-      slurs_.push (slur);
+      slurs_.push_back (slur);
 
       if (double_slurs)
        {
          set_grob_direction (slur, DOWN);
          slur = make_spanner ("Slur", events_[START]->self_scm ());
          set_grob_direction (slur, UP);
-         slurs_.push (slur);
+         slurs_.push_back (slur);
        }
     }
   set_melisma (slurs_.size ());
index 88d528e34f10bc25242dbd96a88c818b54d70d0a..19ce9ee47c6c15dc11f514aecf1275c9c58961e5 100644 (file)
@@ -285,7 +285,7 @@ Slur_score_state::fill (Grob *me)
   columns_
     = internal_extract_grob_array (me, ly_symbol2scm ("note-columns"));
 
-  if (columns_.is_empty ())
+  if (columns_.empty ())
     {
       me->suicide ();
       return;
@@ -336,8 +336,8 @@ Slur_score_state::fill (Grob *me)
     = get_y_attachment_range ();
 
   configurations_ = enumerate_attachments (end_ys);
-  for (int i = 0; i < columns_.size (); i++)
-    encompass_infos_.push (get_encompass_info (columns_[i]));
+  for (vsize i = 0; i < columns_.size (); i++)
+    encompass_infos_.push_back (get_encompass_info (columns_[i]));
 
   extra_encompass_infos_ = get_extra_encompass_infos ();
   valid_ = true;
@@ -417,9 +417,9 @@ Slur_score_state::get_best_curve ()
   else
 #endif
     {
-      for (int i = 0; i < configurations_.size (); i++)
+      for (vsize i = 0; i < configurations_.size (); i++)
        configurations_[i]->score (*this);
-      for (int i = 0; i < configurations_.size (); i++)
+      for (vsize i = 0; i < configurations_.size (); i++)
        {
          if (configurations_[i]->score_ < opt)
            {
@@ -457,7 +457,7 @@ Slur_score_state::get_closest_index (SCM inspect_quants) const
 
   int opt_idx = -1;
   Real mindist = 1e6;
-  for (int i = 0; i < configurations_.size (); i++)
+  for (vsize i = 0; i < configurations_.size (); i++)
     {
       Real d = fabs (configurations_[i]->attachment_[LEFT][Y_AXIS] - ins[LEFT])
        + fabs (configurations_[i]->attachment_[RIGHT][Y_AXIS] - ins[RIGHT]);
@@ -567,7 +567,7 @@ Slur_score_state::get_base_attachments () const
            x = extremes_[d].bound_->extent (common_[X_AXIS], X_AXIS)[d];
          else
            x = slur_->get_broken_left_end_align ();
-         Grob *col = (d == LEFT) ? columns_[0] : columns_.top ();
+         Grob *col = (d == LEFT) ? columns_[0] : columns_.back ();
 
          if (extremes_[-d].bound_ != col)
            {
@@ -631,13 +631,13 @@ Slur_score_state::move_away_from_staffline (Real y,
   return y;
 }
 
-Array<Offset>
+std::vector<Offset>
 Slur_score_state::generate_avoid_offsets () const
 {
-  Array<Offset> avoid;
+  std::vector<Offset> avoid;
   Link_array<Grob> encompasses = columns_;
 
-  for (int i = 0; i < encompasses.size (); i++)
+  for (vsize i = 0; i < encompasses.size (); i++)
     {
       if (extremes_[LEFT].note_column_ == encompasses[i]
          || extremes_[RIGHT].note_column_ == encompasses[i])
@@ -646,11 +646,11 @@ Slur_score_state::generate_avoid_offsets () const
       Encompass_info inf (get_encompass_info (encompasses[i]));
       Real y = dir_ * (max (dir_ * inf.head_, dir_ * inf.stem_));
 
-      avoid.push (Offset (inf.x_, y + dir_ * parameters_.free_head_distance_));
+      avoid.push_back (Offset (inf.x_, y + dir_ * parameters_.free_head_distance_));
     }
 
   extract_grob_set (slur_, "encompass-objects", extra_encompasses);
-  for (int i = 0; i < extra_encompasses.size (); i++)
+  for (vsize i = 0; i < extra_encompasses.size (); i++)
     {
       if (Slur::has_interface (extra_encompasses[i]))
        {
@@ -662,7 +662,7 @@ Slur_score_state::generate_avoid_offsets () const
                       small_slur->relative_coordinate (common_[Y_AXIS], Y_AXIS));
 
          z[Y_AXIS] += dir_ * parameters_.free_slur_distance_;
-         avoid.push (z);
+         avoid.push_back (z);
        }
       else if (extra_encompasses[i]->get_property ("avoid-slur") == ly_symbol2scm ("inside"))
        {
@@ -672,7 +672,7 @@ Slur_score_state::generate_avoid_offsets () const
 
          if (!xe.is_empty ()
              && !ye.is_empty ())
-           avoid.push (Offset (xe.center(), ye[dir_]));
+           avoid.push_back (Offset (xe.center(), ye[dir_]));
        }
     }  
   return avoid;
@@ -684,8 +684,8 @@ 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"));
 
-  Array<Offset> avoid = generate_avoid_offsets ();
-  for (int i = 0; i < configurations_.size (); i++)
+  std::vector<Offset> avoid = generate_avoid_offsets ();
+  for (vsize i = 0; i < configurations_.size (); i++)
     configurations_[i]->generate_curve (*this, r_0, h_inf, avoid);
 }
 
@@ -768,7 +768,7 @@ Slur_score_state::enumerate_attachments (Drul_array<Real> end_ys) const
          s.attachment_ = os;
          s.index_ = scores.size ();
 
-         scores.push (new Slur_configuration (s));
+         scores.push_back (new Slur_configuration (s));
 
          os[RIGHT][Y_AXIS] += dir_ * staff_space_ / 2;
        }
@@ -780,12 +780,12 @@ Slur_score_state::enumerate_attachments (Drul_array<Real> end_ys) const
   return scores;
 }
 
-Array<Extra_collision_info>
+std::vector<Extra_collision_info>
 Slur_score_state::get_extra_encompass_infos () const
 {
   extract_grob_set (slur_, "encompass-objects", encompasses);
-  Array<Extra_collision_info> collision_infos;
-  for (int i = encompasses.size (); i--;)
+  std::vector<Extra_collision_info> collision_infos;
+  for (vsize i = encompasses.size (); i--;)
     {
       if (Slur::has_interface (encompasses[i]))
        {
@@ -820,7 +820,7 @@ Slur_score_state::get_extra_encompass_infos () const
                                         xext,
                                         yext,
                                         parameters_.extra_object_collision_penalty_);
-             collision_infos.push (info);
+             collision_infos.push_back (info);
            }
        }
       else
@@ -868,7 +868,7 @@ Slur_score_state::get_extra_encompass_infos () const
          ye.widen (thickness_ * 0.5);
          xe.widen (thickness_ * 1.0);
          Extra_collision_info info (g, xp, xe, ye, penalty);
-         collision_infos.push (info);
+         collision_infos.push_back (info);
        }
     }
 
index d40104b1adb33cfcf8bf6c774ded38a4eaf1f51c..7c015019ffd3fb1d1dd2ca842023896c61a42728 100644 (file)
@@ -38,14 +38,14 @@ Slur::calc_direction (SCM smob)
   Grob *me = unsmob_grob (smob);
   extract_grob_set (me, "note-columns", encompasses);
 
-  if (encompasses.is_empty ())
+  if (encompasses.empty ())
     {
       me->suicide ();
       return SCM_BOOL_F;
     }
 
   Direction d = DOWN;
-  for (int i = 0; i < encompasses.size (); i++)
+  for (vsize i = 0; i < encompasses.size (); i++)
     {
       if (Note_column::dir (encompasses[i]) < 0)
        {
@@ -64,7 +64,8 @@ Slur::height (SCM smob)
 
   // FIXME uncached
   Stencil *m = me->get_stencil ();
-  return m ? ly_interval2scm (m->extent (Y_AXIS)) : ly_interval2scm (Interval ());
+  return m ? ly_interval2scm (m->extent (Y_AXIS))
+    : ly_interval2scm (Interval ());
 }
 
 /*
@@ -76,7 +77,7 @@ Slur::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
   extract_grob_set (me, "note-columns", encompasses);
-  if (encompasses.is_empty ())
+  if (encompasses.empty ())
     {
       me->suicide ();
       return SCM_EOL;
index 9d4a3db37a10ca98c34d39273a9f49fdb1ac1e64..d4a3681da26a71dce624865e1da2658c17d594b0 100644 (file)
@@ -37,11 +37,16 @@ Source_file::load_stdin ()
   length_ = 0;
 
   int c;
-  Array<char> chs;             // ugh.
+#if STD_VECTOR
+  std::vector<char> &chs = *new std::vector<char>; // ugh. ugh.
+#else
+  std::vector<char> chs;               // ugh.
+#endif
+  
   while ((c = fgetc (stdin)) != EOF)
-    chs.push (c);
+    chs.push_back (c);
 
-  chs.push (0);
+  chs.push_back (0);
   length_ = chs.size ();
   contents_str0_ = chs.remove_array ();
 }
@@ -90,7 +95,7 @@ Source_file::Source_file (std::string filename, std::string data)
 
   for (int i = 0; i < length_; i++)
     if (contents_str0_[i] == '\n')
-      newline_locations_.push (contents_str0_ + i);
+      newline_locations_.push_back (contents_str0_ + i);
 }
 
 Source_file::Source_file (std::string filename_string)
@@ -113,7 +118,7 @@ Source_file::Source_file (std::string filename_string)
 
   for (int i = 0; i < length_; i++)
     if (contents_str0_[i] == '\n')
-      newline_locations_.push (contents_str0_ + i);
+      newline_locations_.push_back (contents_str0_ + i);
 }
 
 void
index 616cabe7d07dd92873d7d428918ea67f6c16e31c..8b54857b1dedceb7b254277d787e388b83b2bffe 100644 (file)
@@ -64,7 +64,7 @@ is_loose_column (Grob *l, Grob *c, Grob *r, Spacing_options const *options)
     such a borderline case.)
 
   */
-  if (lns.is_empty () || rns.is_empty ())
+  if (lns.empty () || rns.empty ())
     return false;
 
   Item *l_neighbor = dynamic_cast<Item *> (lns[0]);
@@ -98,13 +98,13 @@ is_loose_column (Grob *l, Grob *c, Grob *r, Spacing_options const *options)
     in any case, we don't want to move bar lines.
   */
   extract_grob_set (c, "elements", elts);
-  for (int i = elts.size (); i--;)
+  for (vsize i = elts.size (); i--;)
     {
       Grob *g = elts[i];
       if (g && Break_align_interface::has_interface (g))
        {
          extract_grob_set (g, "elements", gelts);
-         for (int j = gelts.size (); j--;)
+         for (vsize j = gelts.size (); j--;)
            {
              Grob *h = gelts[j];
 
@@ -131,7 +131,7 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols,
 {
   Link_array<Grob> newcols;
 
-  for (int i = 0; i < cols->size (); i++)
+  for (vsize i = 0; i < cols->size (); i++)
     {
       Grob *c = cols->elem (i);
 
@@ -143,8 +143,8 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols,
          extract_grob_set (c, "right-neighbors", rns_arr);
          extract_grob_set (c, "left-neighbors", lns_arr);
 
-         SCM lns = lns_arr.size () ? lns_arr.top ()->self_scm () : SCM_BOOL_F;
-         SCM rns = rns_arr.size () ? rns_arr.top ()->self_scm () : SCM_BOOL_F;
+         SCM lns = lns_arr.size () ? lns_arr.back ()->self_scm () : SCM_BOOL_F;
+         SCM rns = rns_arr.size () ? rns_arr.back ()->self_scm () : SCM_BOOL_F;
 
          /*
            Either object can be non existent, if the score ends
@@ -171,7 +171,7 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols,
              Item *rc = dynamic_cast<Item *> (d == LEFT ? c : next_door[RIGHT]);
 
              extract_grob_set (lc, "spacing-wishes", wishes);
-             for (int k = wishes.size (); k--;)
+             for (vsize k = wishes.size (); k--;)
                {
                  Grob *sp = wishes[k];
                  if (Note_spacing::left_column (sp) != lc
@@ -218,7 +218,7 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols,
          r.add_to_cols ();
        }
       else
-       newcols.push (c);
+       newcols.push_back (c);
     }
 
   *cols = newcols;
@@ -230,14 +230,14 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols,
 void
 Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> const &cols)
 {
-  for (int i = 0; i < cols.size (); i++)
+  for (vsize i = 0; i < cols.size (); i++)
     {
       SCM right_neighbors = Grob_array::make_array ();
       Grob_array *rn_arr = unsmob_grob_array (right_neighbors);
       int min_rank = 100000;   // inf.
 
       extract_grob_set (cols[i], "spacing-wishes", wishes);
-      for (int k = wishes.size (); k--;)
+      for (vsize k = wishes.size (); k--;)
        {
          Item *wish = dynamic_cast<Item *> (wishes[k]);
 
@@ -272,7 +272,7 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> const &cols)
          extract_grob_set (rc, "left-neighbors", lns_arr);
          if (lns_arr.size ())
            {
-             Item *it = dynamic_cast<Item *> (lns_arr.top ());
+             Item *it = dynamic_cast<Item *> (lns_arr.back ());
              maxrank = Paper_column::get_rank (it->get_column ());
            }
 
@@ -302,7 +302,7 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> const &cols)
 void
 Spacing_spanner::set_implicit_neighbor_columns (Link_array<Grob> const &cols)
 {
-  for (int i = 0; i < cols.size (); i++)
+  for (vsize i = 0; i < cols.size (); i++)
     {
       Item *it = dynamic_cast<Item *> (cols[i]);
       if (!Item::is_breakable (it) && !Paper_column::is_musical (it))
@@ -314,7 +314,7 @@ Spacing_spanner::set_implicit_neighbor_columns (Link_array<Grob> const &cols)
        sloppy with typing left/right-neighbors should take list, but paper-column found instead.
       */
       extract_grob_set (cols[i], "left-neighbors", lns);
-      if (lns.is_empty () && i)
+      if (lns.empty () && i)
        {
          SCM ga_scm = Grob_array::make_array ();
          Grob_array *ga = unsmob_grob_array (ga_scm);
@@ -322,7 +322,7 @@ Spacing_spanner::set_implicit_neighbor_columns (Link_array<Grob> const &cols)
          cols[i]->set_object ("left-neighbors", ga_scm);
        }
       extract_grob_set (cols[i], "right-neighbors", rns);
-      if (rns.is_empty () && i < cols.size () - 1)
+      if (rns.empty () && i < cols.size () - 1)
        {
          SCM ga_scm = Grob_array::make_array ();
          Grob_array *ga = unsmob_grob_array (ga_scm);
index 4e9b9c0675dd452621f95208b32fd6c85563e97a..4b09a917d333bfe21b60877e4403f1384755bf38 100644 (file)
@@ -42,8 +42,8 @@ struct Rhythmic_tuple
 class Spacing_engraver : public Engraver
 {
   PQueue<Rhythmic_tuple> playing_durations_;
-  Array<Rhythmic_tuple> now_durations_;
-  Array<Rhythmic_tuple> stopped_durations_;
+  std::vector<Rhythmic_tuple> now_durations_;
+  std::vector<Rhythmic_tuple> stopped_durations_;
   Moment now_;
   Spanner *spacing_;
 
@@ -129,7 +129,7 @@ Spacing_engraver::acknowledge_rhythmic_head (Grob_info i)
        {
          Moment len = r->get_length ();
          Rhythmic_tuple t (i, now_mom () + len);
-         now_durations_.push (t);
+         now_durations_.push_back (t);
        }
     }
 }
@@ -150,7 +150,7 @@ Spacing_engraver::stop_translation_timestep ()
 
   Moment shortest_playing;
   shortest_playing.set_infinite (1);
-  for (int i = 0; i < playing_durations_.size (); i++)
+  for (vsize i = 0; i < playing_durations_.size (); i++)
     {
       Music *mus = playing_durations_[i].info_.music_cause ();
       if (mus)
@@ -162,7 +162,7 @@ Spacing_engraver::stop_translation_timestep ()
   Moment starter;
   starter.set_infinite (1);
 
-  for (int i = 0; i < now_durations_.size (); i++)
+  for (vsize i = 0; i < now_durations_.size (); i++)
     {
       Moment m = now_durations_[i].info_.music_cause ()->get_length ();
       if (m.to_bool ())
@@ -191,7 +191,7 @@ Spacing_engraver::start_translation_timestep ()
   while (playing_durations_.size () && playing_durations_.front ().end_ < now_)
     playing_durations_.delmin ();
   while (playing_durations_.size () && playing_durations_.front ().end_ == now_)
-    stopped_durations_.push (playing_durations_.get ());
+    stopped_durations_.push_back (playing_durations_.get ());
 }
 
 ADD_ACKNOWLEDGER (Spacing_engraver, staff_spacing);
index 2cfb4dc79e711ea05c208f836709b401dca60558..9caba57552f9dde6a2469993c2d83314ad0ad56e 100644 (file)
@@ -57,10 +57,10 @@ set_loose_columns (System *which, Column_x_positions const *posns)
              if (!left->get_system ())
                left = left->find_prebroken_piece (RIGHT);
 
-             clique.push (left);
+             clique.push_back (left);
            }
 
-         clique.push (loose);
+         clique.push_back (loose);
 
          divide_over++;
          loose = right = re->get_column ();
@@ -69,19 +69,19 @@ set_loose_columns (System *which, Column_x_positions const *posns)
       if (!right->get_system ())
        right = right->find_prebroken_piece (LEFT);
 
-      clique.push (right);
+      clique.push_back (right);
 
       Grob *common = right->common_refpoint (left, X_AXIS);
-      Item *finished_right_column = clique.top ();
+      Item *finished_right_column = clique.back ();
 
-      for (int j = clique.size () - 2; j > 0; j--)
+      for (vsize j = clique.size () - 2; j > 0; j--)
        {
          int count = 0;
          Real total_space = 0.0;
          Real total_fixed = 0.0;
 
          extract_grob_set (col, "spacing-wishes", wishes);
-         for (int i = 0; i < wishes.size (); i++)
+         for (vsize i = 0; i < wishes.size (); i++)
            {
              Grob *spacing = wishes[i];
              Real space = 0.0;
index ec4907be63f4cbc1e255056dd71bd99749b424c1..2ac4caf13e18339fff0d3b27f4559e0ce7a3140f 100644 (file)
@@ -91,13 +91,13 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
   /*
     ascending in duration
   */
-  Array<Rational> durations;
-  Array<int> counts;
+  std::vector<Rational> durations;
+  std::vector<int> counts;
 
   Rational shortest_in_measure;
   shortest_in_measure.set_infinite (1);
 
-  for (int i = 0; i < cols.size (); i++)
+  for (vsize i = 0; i < cols.size (); i++)
     {
       if (Paper_column::is_musical (cols[i]))
        {
@@ -117,7 +117,7 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
       else if (!shortest_in_measure.is_infinity ()
               && Item::is_breakable (cols[i]))
        {
-         int j = 0;
+         vsize j = 0;
          for (; j < durations.size (); j++)
            {
              if (durations[j] > shortest_in_measure)
@@ -135,8 +135,8 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
 
          if (durations.size () == j)
            {
-             durations.push (shortest_in_measure);
-             counts.push (1);
+             durations.push_back (shortest_in_measure);
+             counts.push_back (1);
            }
 
          shortest_in_measure.set_infinite (1);
@@ -145,7 +145,7 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
 
   int max_idx = -1;
   int max_count = 0;
-  for (int i = durations.size (); i--;)
+  for (vsize i = durations.size (); i--;)
     {
       if (counts[i] >= max_count)
        {
@@ -230,7 +230,7 @@ Spacing_spanner::generate_springs (Grob *me,
 {
   Paper_column *next = 0;
   Paper_column *next_next = 0;
-  for (int i = cols.size (); i--;)
+  for (vsize i = cols.size (); i--;)
     {
       Paper_column *col = dynamic_cast<Paper_column *> (cols[i]);
       if (next)
@@ -272,7 +272,7 @@ Spacing_spanner::musical_column_spacing (Grob *me,
        happens after the current note (this is set in the grob
        property SPACING-SEQUENCE.
       */
-      for (int i = 0; i < neighbors.size (); i++)
+      for (vsize i = 0; i < neighbors.size (); i++)
        {
          Grob *wish = neighbors[i];
 
@@ -386,7 +386,7 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r,
     {
       extract_grob_set (l, "spacing-wishes", wishes);
 
-      for (int i = 0; i < wishes.size (); i++)
+      for (vsize i = 0; i < wishes.size (); i++)
        {
          Item *spacing_grob = dynamic_cast<Item *> (wishes[i]);
 
index 969885a738edde0bdd6437b3d185d9900b3f22c5..998d2693a27367066aa49d6d2a2ace357ff0d288 100644 (file)
@@ -42,7 +42,7 @@ void
 Span_arpeggio_engraver::acknowledge_arpeggio (Grob_info info)
 {
   if (info.origin_contexts (this).size ()) // huh? what's this test for? 
-    arpeggios_.push (info.grob ());
+    arpeggios_.push_back (info.grob ());
 }
 
 void
@@ -69,15 +69,15 @@ Span_arpeggio_engraver::stop_translation_timestep ()
        we do this very late, to make sure we also catch `extra'
        side-pos support like accidentals.
       */
-      for (int j = 0; j < arpeggios_.size (); j++)
+      for (vsize j = 0; j < arpeggios_.size (); j++)
        {
          extract_grob_set (arpeggios_[j], "stems", stems);
-         for (int i = stems.size (); i--;)
+         for (vsize i = stems.size (); i--;)
            Pointer_group_interface::add_grob (span_arpeggio_, ly_symbol2scm ("stems"),
                                               stems[i]);
 
          extract_grob_set (arpeggios_[j], "side-support-elements", sses);
-         for (int i = sses.size (); i--;)
+         for (vsize i = sses.size (); i--;)
            Pointer_group_interface::add_grob (span_arpeggio_, ly_symbol2scm ("side-support-elements"),
                                               sses[i]);
 
index 7ec59d3895f4d50e4c3d607bf433e8ba8d452b68..158663a979895cad077f35d433871e6eb6171c02 100644 (file)
@@ -43,7 +43,7 @@ Span_bar_engraver::acknowledge_bar_line (Grob_info i)
   if (depth && Bar_line::has_interface (i.grob ()))
     {
       Item *it = dynamic_cast<Item *> (i.grob ());
-      bars_.push (it);
+      bars_.push_back (it);
 
       if (bars_.size () >= 2 && !spanbar_)
        {
@@ -59,7 +59,7 @@ Span_bar_engraver::stop_translation_timestep ()
 {
   if (spanbar_)
     {
-      for (int i = 0; i < bars_.size (); i++)
+      for (vsize i = 0; i < bars_.size (); i++)
        Span_bar::add_bar (spanbar_, bars_[i]);
 
       SCM vissym = ly_symbol2scm ("break-visibility");
@@ -69,7 +69,7 @@ Span_bar_engraver::stop_translation_timestep ()
 
       spanbar_ = 0;
     }
-  bars_.set_size (0);
+  bars_.resize (0);
 }
 
 #include "translator.icc"
index 2149f2ddfc4e26043ceafbc3ef936e854a21d63f..6290277358bcf80e7c5cb6902445b74aaed3e558 100644 (file)
@@ -56,16 +56,16 @@ Span_bar::print (SCM smobbed_me)
   std::string glyph_string = ly_scm2string (glyph);
 
   /* compose span_bar_mol */
-  Array<Interval> extents;
+  std::vector<Interval> extents;
   Grob *model_bar = 0;
-  for (int i = elements.size (); i--;)
+  for (vsize i = elements.size (); i--;)
     {
       Grob *bar = elements[i];
       Interval ext = bar->extent (refp, Y_AXIS);
       if (ext.is_empty ())
        continue;
 
-      extents.push (ext);
+      extents.push_back (ext);
       model_bar = bar;
     }
 
@@ -75,7 +75,7 @@ Span_bar::print (SCM smobbed_me)
   extents.sort (&Interval::left_comparison);
 
   Stencil span_bar;
-  for (int i = 1; i < extents.size (); i++)
+  for (vsize i = 1; i < extents.size (); i++)
     {
       Interval prev_extent = extents[i - 1];
       Interval ext = extents[i];
@@ -132,7 +132,7 @@ Span_bar::before_line_breaking (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
   extract_grob_set (me, "elements", elements);
-  if (elements.is_empty ())
+  if (elements.empty ())
     me->suicide ();
 
   return SCM_UNSPECIFIED;
@@ -167,7 +167,7 @@ Span_bar::calc_glyph_name (SCM smob)
   Grob *me = unsmob_grob (smob);
   extract_grob_set (me, "elements", elements);
   SCM gl = SCM_EOL;
-  for (int i = elements.size ();
+  for (vsize i = elements.size ();
        i-- && !scm_is_string (gl);)
     gl = elements[i]->get_property ("glyph-name");
 
index 03ed5f1f4021bc5d0c24620e0380be620bfb48aa..111f9a9442a66cd9fea0509c884fdeb3f20e013c 100644 (file)
@@ -41,8 +41,8 @@ private:
   Real last_volume_;
   Music *span_start_event_;
   Drul_array<Music *> span_events_;
-  Array<Audio_dynamic_tuple> dynamic_tuples_;
-  Array<Audio_dynamic_tuple> finished_dynamic_tuples_;
+  std::vector<Audio_dynamic_tuple> dynamic_tuples_;
+  std::vector<Audio_dynamic_tuple> finished_dynamic_tuples_;
   Direction dir_;
   Direction finished_dir_;
 };
@@ -74,7 +74,7 @@ Span_dynamic_performer::process_music ()
                               : span_events_[STOP]);
       announce_element (info);
       Audio_dynamic_tuple a = { audio_, now_mom () };
-      dynamic_tuples_.push (a);
+      dynamic_tuples_.push_back (a);
     }
 
   if (span_events_[STOP])
@@ -101,11 +101,11 @@ Span_dynamic_performer::process_music ()
 
       dynamic_tuples_.clear ();
       Audio_dynamic_tuple a = { audio_, now_mom () };
-      dynamic_tuples_.push (a);
+      dynamic_tuples_.push_back (a);
     }
 
   if (span_events_[STOP])
-    finished_dynamic_tuples_.top ().audio_->volume_ = last_volume_;
+    finished_dynamic_tuples_.back ().audio_->volume_ = last_volume_;
 
   if (span_events_[START])
     dynamic_tuples_[0].audio_->volume_ = last_volume_;
@@ -120,7 +120,7 @@ Span_dynamic_performer::stop_translation_timestep ()
   if (finished_dynamic_tuples_.size () > 1)
     {
       Real start_volume = finished_dynamic_tuples_[0].audio_->volume_;
-      Real dv = finished_dynamic_tuples_.top ().audio_->volume_
+      Real dv = finished_dynamic_tuples_.back ().audio_->volume_
        - start_volume;
       /*
        urg.
@@ -138,12 +138,12 @@ Span_dynamic_performer::stop_translation_timestep ()
          // urg.  20%: about two volume steps
          dv = (Real)finished_dir_ * 0.2;
          if (!start_volume)
-           start_volume = finished_dynamic_tuples_.top
-             ().audio_->volume_ - dv;
+           start_volume = finished_dynamic_tuples_.back ().audio_->volume_
+             - dv;
        }
       Moment start_mom = finished_dynamic_tuples_[0].mom_;
-      Moment dt = finished_dynamic_tuples_.top ().mom_ - start_mom;
-      for (int i = 0; i < finished_dynamic_tuples_.size (); i++)
+      Moment dt = finished_dynamic_tuples_.back ().mom_ - start_mom;
+      for (vsize i = 0; i < finished_dynamic_tuples_.size (); i++)
        {
          Audio_dynamic_tuple *a = &finished_dynamic_tuples_[i];
          Real volume = start_volume + dv * (Real) (a->mom_ - start_mom).main_part_
index 0e3d0fc559d98f5d4597d80c33cf885a7a1a4542..8a7a1fdc4fda14b677938cd51af7daf8fe3f7a01 100644 (file)
@@ -73,7 +73,7 @@ Spanner::do_break_processing ()
 
              assert (span->get_system ());
              span->get_system ()->typeset_grob (span);
-             broken_intos_.push (span);
+             broken_intos_.push_back (span);
            }
        }
       while ((flip (&d)) != LEFT);
@@ -84,9 +84,9 @@ Spanner::do_break_processing ()
       Link_array<Item> break_points = root->broken_col_range (left, right);
 
       break_points.insert (left, 0);
-      break_points.push (right);
+      break_points.push_back (right);
 
-      for (int i = 1; i < break_points.size (); i++)
+      for (vsize i = 1; i < break_points.size (); i++)
        {
          Drul_array<Item *> bounds;
          bounds[LEFT] = break_points[i - 1];
@@ -120,12 +120,12 @@ Spanner::do_break_processing ()
          else
            {
              bounds[LEFT]->get_system ()->typeset_grob (span);
-             broken_intos_.push (span);
+             broken_intos_.push_back (span);
            }
        }
     }
   broken_intos_.sort (Spanner::compare);
-  for (int i = broken_intos_.size ();i--;)
+  for (vsize i = broken_intos_.size ();i--;)
     broken_intos_[i]->break_index_ = i;
 }
 
@@ -294,7 +294,7 @@ Spanner::derived_mark () const
   while (flip (&d) != LEFT)
     ;
 
-  for (int i = broken_intos_.size (); i--;)
+  for (vsize i = broken_intos_.size (); i--;)
     scm_gc_mark (broken_intos_[i]->self_scm ());
 }
 
index 994d642c0ae0352baa371dcb0d03b240733f0cda..305d3a2468902d439ed477c665e16f817350560a 100644 (file)
@@ -134,7 +134,7 @@ Staff_spacing::next_notes_correction (Grob *me, Grob *last_grob,
   *compound_space = 0.0;
   int wish_count = 0;
   
-  for (int i = right_items.size (); i--;)
+  for (vsize i = right_items.size (); i--;)
     {
       Grob *g = right_items[i];
 
@@ -148,7 +148,7 @@ Staff_spacing::next_notes_correction (Grob *me, Grob *last_grob,
       wish_count ++;
       
       extract_grob_set (g, "elements", elts);
-      for (int j = elts.size (); j--;)
+      for (vsize j = elts.size (); j--;)
        {
          Real space = 0.0;
          Real fixed = 0.0;
@@ -176,7 +176,7 @@ Staff_spacing::get_spacing_params (Grob *me, Real *space, Real *fixed)
   Item *me_item = dynamic_cast<Item *> (me);
 
   extract_grob_set (me, "left-items", items);
-  for (int i = items.size (); i--;)
+  for (vsize i = items.size (); i--;)
     {
       Grob *cand = items[i];
       if (cand && Separation_item::has_interface (cand))
index 2b98915a21579831046c748f2768f3d1a997595a..0a40dcac36446f998539c03e5184146d8ff6aee2 100644 (file)
@@ -37,21 +37,21 @@ void
 Stanza_number_align_engraver::acknowledge_lyric_syllable (Grob_info gi)
 {
   Grob *h = gi.grob ();
-  lyrics_.push (h);
+  lyrics_.push_back (h);
 }
 
 void
 Stanza_number_align_engraver::acknowledge_stanza_number (Grob_info gi)
 {
   Grob *h = gi.grob ();
-  stanza_numbers_.push (h);
+  stanza_numbers_.push_back (h);
 }
 
 void
 Stanza_number_align_engraver::stop_translation_timestep ()
 {
-  for (int i = lyrics_.size (); i--;)
-    for (int j = stanza_numbers_.size (); j--;)
+  for (vsize i = lyrics_.size (); i--;)
+    for (vsize j = stanza_numbers_.size (); j--;)
       Side_position_interface::add_support (stanza_numbers_[j], lyrics_[i]);
 
   stanza_numbers_.clear ();
index e572acb652f1bd6a04dd75b309cbd94850ac4959..41f039f623469c47e0062fdd04c8389a91148137 100644 (file)
@@ -155,7 +155,7 @@ Stem::extremal_heads (Grob *me)
   Drul_array<Grob *> exthead (0, 0);
   extract_grob_set (me, "note-heads", heads);
 
-  for (int i = heads.size (); i--;)
+  for (vsize i = heads.size (); i--;)
     {
       Grob *n = heads[i];
       int p = Staff_symbol_referencer::get_rounded_position (n);
@@ -181,18 +181,18 @@ integer_compare (int const &a, int const &b)
 }
 
 /* The positions, in ascending order.  */
-Array<int>
+std::vector<int>
 Stem::note_head_positions (Grob *me)
 {
-  Array<int> ps;
+  std::vector<int> ps;
   extract_grob_set (me, "note-heads", heads);
 
-  for (int i = heads.size (); i--;)
+  for (vsize i = heads.size (); i--;)
     {
       Grob *n = heads[i];
       int p = Staff_symbol_referencer::get_rounded_position (n);
 
-      ps.push (p);
+      ps.push_back (p);
     }
 
   ps.sort (integer_compare);
@@ -233,7 +233,7 @@ Stem::calc_stem_end_position (SCM smob)
   
   Real ss = Staff_symbol_referencer::staff_space (me);
   int durlog = duration_log (me);
-  Array<Real> a;
+  std::vector<Real> a;
 
   /* WARNING: IN HALF SPACES */
   Real length = robust_scm2double (me->get_property ("length"), 7);
@@ -385,13 +385,13 @@ Stem::calc_positioning_done (SCM smob)
     }
   
   Real w = hed->extent (hed, X_AXIS)[dir];
-  for (int i = 0; i < heads.size (); i++)
+  for (vsize i = 0; i < heads.size (); i++)
     heads[i]->translate_axis (w - heads[i]->extent (heads[i], X_AXIS)[dir],
                              X_AXIS);
 
   bool parity = true;
   Real lastpos = Real (Staff_symbol_referencer::get_position (heads[0]));
-  for (int i = 1; i < heads.size (); i++)
+  for (vsize i = 1; i < heads.size (); i++)
     {
       Real p = Staff_symbol_referencer::get_position (heads[i]);
       Real dy = fabs (lastpos- p);
@@ -770,7 +770,7 @@ Stem::offset_callback (SCM smob)
       extract_grob_set (me, "rests", rests);
       if (rests.size ())
        {
-         Grob *rest = rests.top ();
+         Grob *rest = rests.back ();
          r = rest->extent (rest, X_AXIS).center ();
        }
     }
index a8dde07527369ab098c064433c25a0758ca54e8d..6bcdea73b04687236e8e3af81c5858d56abf868a 100644 (file)
@@ -79,7 +79,7 @@ Bracket_nesting_group::create_grobs (Engraver *engraver, SCM default_type)
   delimiter_ = make_spanner_from_properties (engraver, type,
                                             SCM_EOL, ly_symbol2string (type).c_str ());
 
-  for (int i = 0 ; i < children_.size (); i++)
+  for (vsize i = 0 ; i < children_.size (); i++)
     {
       children_[i]->create_grobs (engraver, default_type);
     }
@@ -89,7 +89,7 @@ void
 Bracket_nesting_group::add_support (Grob *g)
 {
   Side_position_interface::add_support (g, delimiter_);
-  for (int i = 0 ; i < children_.size (); i++)
+  for (vsize i = 0 ; i < children_.size (); i++)
     {
       children_[i]->add_support (g);
     }
@@ -97,7 +97,7 @@ Bracket_nesting_group::add_support (Grob *g)
 
 Bracket_nesting_group::~Bracket_nesting_group ()
 {
-  for (int i = 0 ; i < children_.size (); i++)
+  for (vsize i = 0 ; i < children_.size (); i++)
     delete children_[i];
 }
 
@@ -105,7 +105,7 @@ void
 Bracket_nesting_group::set_bound (Direction d, Grob *g)
 {
   delimiter_->set_bound (d, g);
-  for (int i = 0 ; i < children_.size (); i++)
+  for (vsize i = 0 ; i < children_.size (); i++)
     {
       children_[i]->set_bound (d, g);
     }
@@ -117,7 +117,7 @@ Bracket_nesting_group::set_nesting_support (Grob *parent)
   if (parent)
     Side_position_interface::add_support (delimiter_, parent);
   
-  for (int i = 0 ; i < children_.size (); i++)
+  for (vsize i = 0 ; i < children_.size (); i++)
     {
       children_[i]->set_nesting_support (delimiter_);
     }
@@ -134,7 +134,7 @@ Bracket_nesting_group::from_list (SCM x)
        {
          Bracket_nesting_group *node = new Bracket_nesting_group;
          node->from_list (entry);
-         children_.push (node);
+         children_.push_back (node);
        }
       else if (entry == ly_symbol2scm ("SystemStartBrace")
               || entry == ly_symbol2scm ("SystemStartBracket")
@@ -144,7 +144,7 @@ Bracket_nesting_group::from_list (SCM x)
        symbol_ = entry;
       else
        {
-         children_.push (new Bracket_nesting_staff (0));
+         children_.push_back (new Bracket_nesting_staff (0));
        }
     }
 }
@@ -152,7 +152,7 @@ Bracket_nesting_group::from_list (SCM x)
 bool
 Bracket_nesting_group::add_staff (Grob *grob)
 {
-  for (int i = 0; i < children_.size (); i++)
+  for (vsize i = 0; i < children_.size (); i++)
     {
       if (children_[i]->add_staff (grob))
        {
@@ -225,7 +225,7 @@ System_start_delimiter_engraver::acknowledge_staff_symbol (Grob_info inf)
 
   if (!succ)
     {
-      nesting_->children_.push  (new Bracket_nesting_staff (0));
+      nesting_->children_.push_back (new Bracket_nesting_staff (0));
       nesting_->add_staff (staff);
     }
 }
index d0b93a372d28b48420978f14c1cdce439acd348d..9ad67605801f53527ec113cb723bffeb8637a088 100644 (file)
@@ -96,7 +96,7 @@ System_start_delimiter::print (SCM smob)
 
   Interval ext;
   int non_empty_count = 0;
-  for (int i = elts.size (); i--;)
+  for (vsize i = elts.size (); i--;)
     {
       Spanner *sp = dynamic_cast<Spanner *> (elts[i]);
 
index 4da50a8292757b730cd8844fb81db5f1fe3e8d03..8bd370579ff7be84cab5b631b3be687eb5642fe4 100644 (file)
@@ -66,7 +66,7 @@ int
 System::spanner_count () const
 {
   int k = 0;
-  for (int i = all_elements_->size (); i--;)
+  for (vsize i = all_elements_->size (); i--;)
     if (dynamic_cast<Spanner *> (all_elements_->grob (i)))
       k++;
   return k;
@@ -88,7 +88,7 @@ System::typeset_grob (Grob *elem)
 void
 System::derived_mark () const
 {
-  if (!all_elements_->is_empty ())
+  if (!all_elements_->empty ())
     {
       Grob **ptr = &all_elements_->array_reference ().elem_ref (0);
       Grob **end = ptr + all_elements_->size ();
@@ -108,14 +108,14 @@ System::derived_mark () const
 static void
 fixup_refpoints (Link_array<Grob> const &grobs)
 {
-  for (int i = grobs.size (); i--;)
+  for (vsize i = grobs.size (); i--;)
     grobs[i]->fixup_refpoint ();
 }
 
 SCM
 System::get_paper_systems ()
 {
-  for (int i = 0; i < all_elements_->size (); i++)
+  for (vsize i = 0; i < all_elements_->size (); i++)
     {
       Grob *g = all_elements_->grob (i);
       if (g->internal_has_interface (ly_symbol2scm ("only-prebreak-interface")))
@@ -139,12 +139,12 @@ System::get_paper_systems ()
     fixups must be done in broken line_of_scores, because new elements
     are put over there.  */
   int count = 0;
-  for (int i = 0; i < broken_intos_.size (); i++)
+  for (vsize i = 0; i < broken_intos_.size (); i++)
     {
       Grob *se = broken_intos_[i];
 
       extract_grob_set (se, "all-elements", all_elts);
-      for (int j = 0; j < all_elts.size (); j++)
+      for (vsize j = 0; j < all_elts.size (); j++)
        {
          Grob *g = all_elts[j];
          g->fixup_refpoint ();
@@ -158,7 +158,7 @@ System::get_paper_systems ()
   */
   fixup_refpoints (all_elements_->array ());
 
-  for (int i = 0; i < all_elements_->size (); i++)
+  for (vsize i = 0; i < all_elements_->size (); i++)
     all_elements_->grob (i)->handle_broken_dependencies ();
 
   handle_broken_dependencies ();
@@ -200,9 +200,9 @@ System::get_paper_systems ()
 }
 
 void
-System::break_into_pieces (Array<Column_x_positions> const &breaking)
+System::break_into_pieces (std::vector<Column_x_positions> const &breaking)
 {
-  for (int i = 0; i < breaking.size (); i++)
+  for (vsize i = 0; i < breaking.size (); i++)
     {
       System *system = dynamic_cast<System *> (clone (i));
       system->rank_ = i;
@@ -211,14 +211,14 @@ System::break_into_pieces (Array<Column_x_positions> const &breaking)
       pscore_->typeset_system (system);
 
       system->set_bound (LEFT, c[0]);
-      system->set_bound (RIGHT, c.top ());
-      for (int j = 0; j < c.size (); j++)
+      system->set_bound (RIGHT, c.back ());
+      for (vsize j = 0; j < c.size (); j++)
        {
          c[j]->translate_axis (breaking[i].config_[j], X_AXIS);
          dynamic_cast<Paper_column *> (c[j])->system_ = system;
        }
       set_loose_columns (system, &breaking[i]);
-      broken_intos_.push (system);
+      broken_intos_.push_back (system);
     }
 }
 
@@ -236,7 +236,7 @@ System::add_column (Paper_column *p)
 
   p->rank_
     = ga->size ()
-    ? Paper_column::get_rank (ga->array ().top ()) + 1
+    ? Paper_column::get_rank (ga->array ().back ()) + 1
     : 0;
 
   ga->add (p);
@@ -261,7 +261,7 @@ apply_tweaks (Grob *g, bool broken)
 void
 System::pre_processing ()
 {
-  for (int i = 0; i < all_elements_->size (); i++)
+  for (vsize i = 0; i < all_elements_->size (); i++)
     all_elements_->grob (i)->discretionary_processing ();
 
   if (be_verbose_global)
@@ -272,15 +272,15 @@ System::pre_processing ()
     array, and should be processed before the original is potentially
     killed.
   */
-  for (int i = all_elements_->size (); i--;)
+  for (vsize i = all_elements_->size (); i--;)
     all_elements_->grob (i)->handle_prebroken_dependencies ();
 
   fixup_refpoints (all_elements_->array ());
 
-  for (int i = 0; i < all_elements_->size (); i++)
+  for (vsize i = 0; i < all_elements_->size (); i++)
     apply_tweaks (all_elements_->grob (i), false);
 
-  for (int i = 0; i < all_elements_->size (); i++)
+  for (vsize i = 0; i < all_elements_->size (); i++)
     {
       Grob *g = all_elements_->grob (i);
       (void) g->get_property ("before-line-breaking");
@@ -289,7 +289,7 @@ System::pre_processing ()
   message (_ ("Calculating line breaks..."));
   progress_indication (" ");
 
-  for (int i = 0; i < all_elements_->size (); i++)
+  for (vsize i = 0; i < all_elements_->size (); i++)
     {
       Grob *e = all_elements_->grob (i);
       (void) e->get_property ("springs-and-rods");
@@ -299,7 +299,7 @@ System::pre_processing ()
 void
 System::post_processing ()
 {
-  for (int i = 0; i < all_elements_->size (); i++)
+  for (vsize i = 0; i < all_elements_->size (); i++)
     {
       Grob *g = all_elements_->grob (i);
 
@@ -321,7 +321,7 @@ System::post_processing ()
   all_elts_sorted.default_sort ();
   all_elts_sorted.uniq ();
   this->get_stencil ();
-  for (int i = all_elts_sorted.size (); i--;)
+  for (vsize i = all_elts_sorted.size (); i--;)
     {
       Grob *g = all_elts_sorted[i];
       g->get_stencil ();
@@ -338,7 +338,7 @@ System::get_paper_system ()
 
   /* Output stencils in three layers: 0, 1, 2.  Default layer: 1. */
   for (int i = 0; i < LAYER_COUNT; i++)
-    for (int j = all_elements_->size (); j--;)
+    for (vsize j = all_elements_->size (); j--;)
       {
        Grob *g = all_elements_->grob (j);
        Stencil st = g->get_print_stencil ();
@@ -386,7 +386,7 @@ System::get_paper_system ()
       Interval staff_refpoints;
       staff_refpoints.set_empty ();
       extract_grob_set (this, "spaceable-staves", staves);
-      for (int i = staves.size (); i--;)
+      for (vsize i = staves.size (); i--;)
        {
          Grob *g = staves[i];
          staff_refpoints.add_point (g->relative_coordinate (this, Y_AXIS));
@@ -408,7 +408,7 @@ System::broken_col_range (Item const *left, Item const *right) const
   right = right->get_column ();
 
   extract_grob_set (this, "columns", cols);
-  int i = 0;
+  vsize i = 0;
   while (i < cols.size ()
         && cols[i] != left)
     i++;
@@ -421,7 +421,7 @@ System::broken_col_range (Item const *left, Item const *right) const
     {
       Paper_column *c = dynamic_cast<Paper_column *> (cols[i]);
       if (Item::is_breakable (c) && !c->system_)
-       ret.push (c);
+       ret.push_back (c);
       i++;
     }
 
@@ -447,7 +447,7 @@ System::columns () const
   for (int i = 0; i <= last_breakable; i++)
     {
       if (Paper_column::is_used (ro_columns[i]))
-       columns.push (ro_columns[i]);
+       columns.push_back (ro_columns[i]);
     }
 
   return columns;
index 3ea9ea5c4efb465b050db6154e5d81647474ee21..6da82d3fdd10776f14eb18d383913fb584329d2a 100644 (file)
@@ -50,12 +50,12 @@ Tab_note_heads_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("note-event"))
     {
-      note_events_.push (m);
+      note_events_.push_back (m);
       return true;
     }
   else if (m->is_mus_type ("string-number-event"))
     {
-      tabstring_events_.push (m);
+      tabstring_events_.push_back (m);
       return true;
     }
   else if (m->is_mus_type ("busy-playing-event"))
@@ -68,7 +68,7 @@ void
 Tab_note_heads_engraver::process_music ()
 {
   int j = 0;
-  for (int i = 0; i < note_events_.size (); i++)
+  for (vsize i = 0; i < note_events_.size (); i++)
     {
       SCM stringTunings = get_property ("stringTunings");
       int number_of_strings = ((int) ly_length (stringTunings));
@@ -123,7 +123,7 @@ Tab_note_heads_engraver::process_music ()
 
          d->set_parent (note, Y_AXIS);
 
-         dots_.push (d);
+         dots_.push_back (d);
        }
 
       SCM scm_pitch = event->get_property ("pitch");
@@ -150,7 +150,7 @@ Tab_note_heads_engraver::process_music ()
       note->set_property ("text", text);
 
       note->set_property ("staff-position", scm_from_int (pos));
-      notes_.push (note);
+      notes_.push_back (note);
     }
 }
 
index 4052bb9bebe6e2f9c0af763d7935d24263114c95..d2eb4055f4115ac668c165f824f8cb898c2f6d34 100644 (file)
@@ -37,7 +37,7 @@ Text_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("text-script-event"))
     {
-      evs_.push (m);
+      evs_.push_back (m);
       return true;
     }
   return false;
@@ -46,7 +46,7 @@ Text_engraver::try_music (Music *m)
 void
 Text_engraver::acknowledge_rhythmic_head (Grob_info inf)
 {
-  for (int i = 0; i < texts_.size (); i++)
+  for (vsize i = 0; i < texts_.size (); i++)
     {
       Grob *t = texts_[i];
       Side_position_interface::add_support (t, inf.grob ());
@@ -66,14 +66,14 @@ Text_engraver::acknowledge_rhythmic_head (Grob_info inf)
 void
 Text_engraver::acknowledge_stem (Grob_info inf)
 {
-  for (int i = 0; i < texts_.size (); i++)
+  for (vsize i = 0; i < texts_.size (); i++)
     Side_position_interface::add_support (texts_[i], inf.grob ());
 }
 
 void
 Text_engraver::acknowledge_stem_tremolo (Grob_info info)
 {
-  for (int i = 0; i < texts_.size (); i++)
+  for (vsize i = 0; i < texts_.size (); i++)
     Side_position_interface::add_support (texts_[i], info.grob ());
 }
 
@@ -82,7 +82,7 @@ Text_engraver::process_acknowledged ()
 {
   if (texts_.size ())
     return;
-  for (int i = 0; i < evs_.size (); i++)
+  for (vsize i = 0; i < evs_.size (); i++)
     {
       Music *r = evs_[i];
 
@@ -110,7 +110,7 @@ Text_engraver::process_acknowledged ()
       SCM mark = r->get_property ("text");
 
       text->set_property ("text", mark);
-      texts_.push (text);
+      texts_.push_back (text);
     }
 }
 
index a14a929d3c059f397bfceb21e382a713db62f741..10f88a13aed41f4eab407267d012e5b35cbd8172 100644 (file)
@@ -25,7 +25,7 @@ Tex_font_metric_reader::Tex_font_metric_reader (std::string name)
 {
 
   for (int i = 0; i < TFM_SIZE; i++)
-    ascii_to_metric_idx_.push (-1);
+    ascii_to_metric_idx_.push_back (-1);
 
   read_header ();
   read_params ();
@@ -163,7 +163,7 @@ Tex_font_metric_reader::read_char_metrics ()
       Tex_font_char_metric tfm_char = read_char_metric (i);
       if (tfm_char.exists_)
        ascii_to_metric_idx_[tfm_char.code_] = char_metrics_.size ();
-      char_metrics_.push (tfm_char);
+      char_metrics_.push_back (tfm_char);
     }
 }
 
@@ -255,7 +255,7 @@ Tex_font_metric_reader::read_char ()
 #define KERN_FLAG 128
 
 void
-Tex_font_metric_reader::read_lig_kern_program (Array<Tfm_ligature> *ligatures, Array<Tfm_kern> *kerns)
+Tex_font_metric_reader::read_lig_kern_program (std::vector<Tfm_ligature> *ligatures, std::vector<Tfm_kern> *kerns)
 {
   bool end_b;
 
@@ -277,14 +277,14 @@ Tex_font_metric_reader::read_lig_kern_program (Array<Tfm_ligature> *ligatures, A
          kern_element.kern = get_U32_fix_scaled ();
          input_.set_pos (old_pos);
 
-         kerns->push (kern_element);
+         kerns->push_back (kern_element);
        }
       else
        {
          Tfm_ligature ligature_element;
          ligature_element.character = next_char;
          ligature_element.ligature = remainder;
-         ligatures->push (ligature_element);
+         ligatures->push_back (ligature_element);
        }
     }
   while (!end_b);
index 82a4fee1eea68c37c38fa83ba8b790c49bb3ba91..136a59aa7391d18fcfc8e2cf5a05fa97075d2dbe 100644 (file)
@@ -77,7 +77,7 @@ Tex_font_metric::find_ascii (int ascii, bool warn) const
 int
 Tex_font_metric::count () const
 {
-  for (int i = ascii_to_metric_idx_.size (); i--;)
+  for (vsize i = ascii_to_metric_idx_.size (); i--;)
     if (ascii_to_metric_idx_[i] != -1)
       return i + 1;
   return 0;
index 1ee3d0c03f331512fb5dd99738b7cb6ce79dd8b4..a6633aca6e4c5cf9c58291adad77b2222741c7d4 100644 (file)
@@ -93,7 +93,7 @@ Tie_column::calc_positioning_done (SCM smob)
 
   Ties_configuration base = problem.generate_optimal_chord_configuration ();
 
-  for (int i = 0; i < base.size(); i++)
+  for (vsize i = 0; i < base.size(); i++)
     {
       Tie::set_control_points (ties[i], problem.common_x_refpoint (),
                               base[i],
index 63822226763a792f416e96e5e19c1fbd85e4b8ab..a52a2c73b30b4595b2f511d9ccc6c641c0c84788 100644 (file)
@@ -49,7 +49,7 @@ class Tie_engraver : public Engraver
 {
   Music *event_;
   Link_array<Grob> now_heads_;
-  Array<Head_event_tuple> heads_to_tie_;
+  std::vector<Head_event_tuple> heads_to_tie_;
   Link_array<Grob> ties_;
 
   Spanner *tie_column_;
@@ -70,7 +70,7 @@ void
 Tie_engraver::derived_mark () const
 {
   Engraver::derived_mark ();
-  for (int i = 0; i < heads_to_tie_.size (); i++)
+  for (vsize i = 0; i < heads_to_tie_.size (); i++)
     scm_gc_mark (heads_to_tie_[i].tie_definition_);
 }
 
@@ -100,8 +100,8 @@ void
 Tie_engraver::acknowledge_note_head (Grob_info i)
 {
   Grob *h = i.grob ();
-  now_heads_.push (h);
-  for (int i = heads_to_tie_.size (); i--;)
+  now_heads_.push_back (h);
+  for (vsize i = heads_to_tie_.size (); i--;)
     {
       Grob *th = heads_to_tie_[i].head_;
       Music *right_mus = unsmob_music (h->get_property ("cause"));
@@ -120,7 +120,7 @@ Tie_engraver::acknowledge_note_head (Grob_info i)
          Tie::set_head (p, LEFT, th);
          Tie::set_head (p, RIGHT, h);
 
-         ties_.push (p);
+         ties_.push_back (p);
          heads_to_tie_.del (i);
        }
     }
@@ -129,7 +129,7 @@ Tie_engraver::acknowledge_note_head (Grob_info i)
     tie_column_ = make_spanner ("TieColumn", ties_[0]->self_scm ());
 
   if (tie_column_)
-    for (int i = ties_.size (); i--;)
+    for (vsize i = ties_.size (); i--;)
       Tie_column::add_tie (tie_column_, ties_[i]);
 }
 
@@ -148,7 +148,7 @@ Tie_engraver::stop_translation_timestep ()
       if (!to_boolean (get_property ("tieWaitForNote")))
        heads_to_tie_.clear ();
 
-      for (int i = 0; i < ties_.size (); i++)
+      for (vsize i = 0; i < ties_.size (); i++)
        typeset_tie (ties_[i]);
 
       ties_.clear ();
@@ -163,9 +163,9 @@ Tie_engraver::stop_translation_timestep ()
       if (!to_boolean (get_property ("tieWaitForNote")))
        heads_to_tie_.clear ();
 
-      for (int i = 0; i < now_heads_.size (); i++)
+      for (vsize i = 0; i < now_heads_.size (); i++)
        {
-         heads_to_tie_.push (Head_event_tuple (now_heads_[i], event_,
+         heads_to_tie_.push_back (Head_event_tuple (now_heads_[i], event_,
                                                start_definition));
        }
     }
index 87ea44b36bf0695a0e13dd0050d62a8024fa153b..b2560394988b4a226da78743c06cb446a53cab18 100644 (file)
@@ -64,10 +64,10 @@ Tie_formatting_problem::set_chord_outline (Link_array<Item> bounds,
 {
   Real staff_space = Staff_symbol_referencer::staff_space (bounds[0]);
 
-  Array<Box> boxes;
+  std::vector<Box> boxes;
 
   Grob *stem = 0;
-  for (int i = 0; i < bounds.size (); i++)
+  for (vsize i = 0; i < bounds.size (); i++)
     {
       Grob *head = bounds[i];
       if (!Note_head::has_interface (head))
@@ -81,7 +81,7 @@ Tie_formatting_problem::set_chord_outline (Link_array<Item> bounds,
                  (p+1) * 0.5 * staff_space);
 
       Interval x = head->extent (x_refpoint_, X_AXIS);
-      boxes.push (Box (x, y));
+      boxes.push_back (Box (x, y));
 
       Grob *dots = Rhythmic_head::get_dots (head);
       if (d == LEFT && dots)
@@ -95,7 +95,7 @@ Tie_formatting_problem::set_chord_outline (Link_array<Item> bounds,
          dot_x_.unite (x);
          
          y *= staff_space * 0.5;
-         // boxes.push (Box (x, y));
+         // boxes.push_back (Box (x, y));
        }
     }
 
@@ -107,7 +107,7 @@ Tie_formatting_problem::set_chord_outline (Link_array<Item> bounds,
       chord_outlines_[d].elem_ref (0).height_ = x; 
     }
          
-  for (int i = 0; i < boxes.size (); i++)
+  for (vsize i = 0; i < boxes.size (); i++)
     insert_extent_into_skyline (&chord_outlines_[d]  ,
                                boxes[i], Y_AXIS, -d);
 
@@ -164,7 +164,7 @@ void
 Tie_formatting_problem::from_tie (Grob *tie)
 {
   Link_array<Grob> ties;
-  ties.push (tie);
+  ties.push_back (tie);
   from_ties (ties);
 
   details_.from_grob (tie);
@@ -179,11 +179,11 @@ Tie_formatting_problem::common_x_refpoint () const
 void
 Tie_formatting_problem::from_ties (Link_array<Grob> const &ties)
 {
-  if (ties.is_empty ())
+  if (ties.empty ())
     return;
   
   x_refpoint_ = ties[0];
-  for (int i = 0; i < ties.size (); i++)
+  for (vsize i = 0; i < ties.size (); i++)
     {
       x_refpoint_ = dynamic_cast<Spanner*> (ties[i])->get_bound (LEFT)->common_refpoint (x_refpoint_, X_AXIS); 
       x_refpoint_ = dynamic_cast<Spanner*> (ties[i])->get_bound (RIGHT)->common_refpoint (x_refpoint_, X_AXIS); 
@@ -196,11 +196,11 @@ Tie_formatting_problem::from_ties (Link_array<Grob> const &ties)
     {
       Link_array<Item> bounds;
       
-      for (int i = 0; i < ties.size (); i++)
+      for (vsize i = 0; i < ties.size (); i++)
        {
          Item *it = dynamic_cast<Spanner*> (ties[i])->get_bound (d);
                                             
-         bounds.push (it);
+         bounds.push_back (it);
        }
       
       set_chord_outline (bounds, d);
@@ -208,7 +208,7 @@ Tie_formatting_problem::from_ties (Link_array<Grob> const &ties)
   while (flip (&d) != LEFT);
 
 
-  for (int i = 0; i < ties.size (); i++)
+  for (vsize i = 0; i < ties.size (); i++)
     {
       Tie_specification spec;
       
@@ -226,20 +226,20 @@ Tie_formatting_problem::from_ties (Link_array<Grob> const &ties)
        }
       while (flip (&d) != LEFT);
       
-      specifications_.push (spec);
+      specifications_.push_back (spec);
     }
 }
 
 void
 Tie_formatting_problem::from_lv_ties (Link_array<Grob> const &lv_ties)
 {
-  if (lv_ties.is_empty ())
-    return ;
+  if (lv_ties.empty ())
+    return;
   
   details_.from_grob (lv_ties[0]);
   Link_array<Item> heads;
   
-  for (int i = 0; i < lv_ties.size (); i++)
+  for (vsize i = 0; i < lv_ties.size (); i++)
     {
       Tie_specification spec;
       Item *head = unsmob_item (lv_ties[i]->get_object ("note-head"));
@@ -253,12 +253,12 @@ Tie_formatting_problem::from_lv_ties (Link_array<Grob> const &lv_ties)
        }
 
       spec.note_head_drul_[LEFT] = head;
-      heads.push (head);
-      specifications_.push (spec);
+      heads.push_back (head);
+      specifications_.push_back (spec);
     }
 
   x_refpoint_ = lv_ties [0];
-  for (int i = 0; i < lv_ties.size (); i++)
+  for (vsize i = 0; i < lv_ties.size (); i++)
     {
       x_refpoint_ = lv_ties[i]->common_refpoint (x_refpoint_, X_AXIS); 
     }
@@ -267,7 +267,7 @@ Tie_formatting_problem::from_lv_ties (Link_array<Grob> const &lv_ties)
 
   Real right_most = - infinity_f;   
 
-  for (int i = 0; i < chord_outlines_[LEFT].size (); i++)
+  for (vsize i = 0; i < chord_outlines_[LEFT].size (); i++)
     {
       right_most = max (right_most, chord_outlines_[LEFT][i].height_);
     }
@@ -276,7 +276,7 @@ Tie_formatting_problem::from_lv_ties (Link_array<Grob> const &lv_ties)
   right_entry.width_.set_full ();
   right_entry.height_ = right_most + 1.5;
   
-  chord_outlines_[RIGHT].push (right_entry);
+  chord_outlines_[RIGHT].push_back (right_entry);
 }
 
 
@@ -485,14 +485,14 @@ Tie_formatting_problem::find_optimal_tie_configuration (Tie_specification const
   int region_size = 3;
   for (int i = 0; i < region_size; i ++)
     {
-      confs.push (generate_configuration (pos + i * dir, dir));
+      confs.push_back (generate_configuration (pos + i * dir, dir));
     }
 
-  Array<Real> scores;
+  std::vector<Real> scores;
 
   int best_idx = -1;
   Real best_score = 1e6;
-  for (int i = 0; i < confs.size (); i ++)
+  for (vsize i = 0; i < confs.size (); i ++)
     {
       Real score = 0.0;
       score += score_configuration (*confs[i]);
@@ -506,7 +506,7 @@ Tie_formatting_problem::find_optimal_tie_configuration (Tie_specification const
     }
 
   Tie_configuration best = *confs[best_idx];
-  for (int i = 0; i < confs.size (); i++)
+  for (vsize i = 0; i < confs.size (); i++)
     delete confs[i];
 
   return best;
@@ -534,7 +534,7 @@ Tie_formatting_problem::score_ties_aptitude (Ties_configuration const &ties) con
       return infinity_f;
     }
 
-  for (int i = 0; i < ties.size (); i++)
+  for (vsize i = 0; i < ties.size (); i++)
     score += score_aptitude (ties[i], specifications_[i]);
 
   return score;
@@ -551,14 +551,14 @@ Real
 Tie_formatting_problem::score_ties_configuration (Ties_configuration const &ties) const
 {
   Real score = 0.0;
-  for (int i = 0; i < ties.size (); i++)
+  for (vsize i = 0; i < ties.size (); i++)
     {
       score += score_configuration (ties[i]);
     }
 
   Real last_edge = 0.0;
   Real last_center = 0.0;
-  for (int i = 0; i < ties.size (); i++)
+  for (vsize i = 0; i < ties.size (); i++)
     {
       Bezier b (ties[i].get_transformed_bezier (details_));
        
@@ -591,15 +591,15 @@ Tie_formatting_problem::score_ties_configuration (Ties_configuration const &ties
 
   score +=
     details_.outer_tie_length_symmetry_penalty_factor_
-    * fabs (ties[0].attachment_x_.length () - ties.top().attachment_x_.length ());
+    * fabs (ties[0].attachment_x_.length () - ties.back ().attachment_x_.length ());
   
   score +=
     details_.outer_tie_vertical_distance_symmetry_penalty_factor_
     * (fabs (specifications_[0].position_
             - (ties[0].position_ * 0.5 * details_.staff_space_ + ties[0].delta_y_))
        -
-       fabs (specifications_.top ().position_
-            - (ties.top().position_ * 0.5 * details_.staff_space_ + ties.top().delta_y_)));
+       fabs (specifications_.back ().position_
+            - (ties.back ().position_ * 0.5 * details_.staff_space_ + ties.back ().delta_y_)));
   
   return score;
 }
@@ -612,7 +612,7 @@ Ties_configuration
 Tie_formatting_problem::generate_ties_configuration (Ties_configuration const &ties_config)
 {
   Ties_configuration copy;
-  for (int i = 0; i < ties_config.size (); i++)
+  for (vsize i = 0; i < ties_config.size (); i++)
     {
       Tie_configuration * ptr = get_configuration (ties_config[i].position_, ties_config[i].dir_);
       if (specifications_[i].has_manual_position_)
@@ -621,7 +621,7 @@ Tie_formatting_problem::generate_ties_configuration (Ties_configuration const &t
            = (specifications_[i].manual_position_ - ties_config[i].position_)
            * 0.5 * details_.staff_space_;
        }
-      copy.push (*ptr);
+      copy.push_back (*ptr);
     }
   
   return copy;
@@ -631,7 +631,7 @@ Ties_configuration
 Tie_formatting_problem::generate_base_chord_configuration () 
 {
   Ties_configuration ties_config;
-  for (int i = 0;  i < specifications_.size (); i ++)
+  for (vsize i = 0;  i < specifications_.size (); i ++)
     {
       Tie_configuration conf;
       if (specifications_[i].has_manual_dir_)
@@ -646,11 +646,11 @@ Tie_formatting_problem::generate_base_chord_configuration ()
        {
          conf.position_ = specifications_[i].position_;
        }
-      ties_config.push (conf);
+      ties_config.push_back (conf);
     }
 
   set_ties_config_standard_directions (&ties_config);
-  for (int i = 0; i < ties_config.size (); i++)
+  for (vsize i = 0; i < ties_config.size (); i++)
     if (!specifications_[i].manual_position_)
       ties_config[i].position_ += ties_config[i].dir_;
 
@@ -663,7 +663,7 @@ Ties_configuration
 Tie_formatting_problem::generate_optimal_chord_configuration ()
 {
   Ties_configuration base = generate_base_chord_configuration ();
-  Array<Tie_configuration_variation> vars = get_variations (base);
+  std::vector<Tie_configuration_variation> vars = get_variations (base);
 
   Ties_configuration best = base;
   Real best_score = score_ties (best);
@@ -672,7 +672,7 @@ Tie_formatting_problem::generate_optimal_chord_configuration ()
     This simply is 1-opt: we have K substitions, and we try applying
     exactly every one for each.
   */
-  for (int i = 0; i < vars.size (); i++)
+  for (vsize i = 0; i < vars.size (); i++)
     {
       Ties_configuration variant = base;
       variant[vars[i].index_] = *vars[i].suggestion_;
@@ -691,18 +691,18 @@ Tie_formatting_problem::generate_optimal_chord_configuration ()
 void
 Tie_formatting_problem::set_ties_config_standard_directions (Ties_configuration *tie_configs)
 {
-  if (tie_configs->is_empty ())
+  if (tie_configs->empty ())
     return ;
   
   if (!tie_configs->elem (0).dir_)
     tie_configs->elem_ref (0).dir_ = DOWN;
-  if (!tie_configs->top().dir_)
-    tie_configs->top().dir_ = UP;
+  if (!tie_configs->back ().dir_)
+    tie_configs->back ().dir_ = UP;
 
   /*
     Seconds
    */
-  for (int i = 1; i < tie_configs->size (); i++)
+  for (vsize i = 1; i < tie_configs->size (); i++)
     {
       Real diff = (tie_configs->elem (i-1).position_
                   - tie_configs->elem (i).position_);
@@ -716,7 +716,7 @@ Tie_formatting_problem::set_ties_config_standard_directions (Ties_configuration
        }
     }
 
-  for (int i = 1; i < tie_configs->size() - 1; i++)
+  for (vsize i = 1; i < tie_configs->size() - 1; i++)
     {
       Tie_configuration &conf = tie_configs->elem_ref (i);
       if (conf.dir_)
@@ -737,14 +737,14 @@ Tie_configuration_variation::Tie_configuration_variation ()
   suggestion_ = 0;
 }
 
-Array<Tie_configuration_variation>
+std::vector<Tie_configuration_variation>
 Tie_formatting_problem::get_variations (Ties_configuration const &ties) 
 {
   Real center_distance_tolerance = 0.25;
   
-  Array<Tie_configuration_variation> vars;
+  std::vector<Tie_configuration_variation> vars;
   Real last_center = 0.0;
-  for (int i = 0; i < ties.size (); i++)
+  for (vsize i = 0; i < ties.size (); i++)
     {
       Bezier b (ties[i].get_transformed_bezier (details_));
        
@@ -762,7 +762,7 @@ Tie_formatting_problem::get_variations (Ties_configuration const &ties)
                                                       - ties[i].dir_,
                                                       -ties[i].dir_);
 
-                 vars.push (var);
+                 vars.push_back (var);
                }
 
              if (!specifications_[i-1].has_manual_dir_)
@@ -773,7 +773,7 @@ Tie_formatting_problem::get_variations (Ties_configuration const &ties)
                                                       - ties[i-1].dir_,
                                                       - ties[i-1].dir_);
 
-                 vars.push (var);
+                 vars.push_back (var);
                }
            }
        }
@@ -791,7 +791,7 @@ Tie_formatting_problem::get_variations (Ties_configuration const &ties)
          var.index_ = (d == DOWN) ? 0 : ties.size () - 1;
          var.suggestion_ = get_configuration (ties.boundary (d, 0).position_ + d,
                                               d);
-         vars.push (var);
+         vars.push_back (var);
        }
     }
   while (flip (&d) !=  DOWN);
@@ -802,9 +802,9 @@ Tie_formatting_problem::get_variations (Ties_configuration const &ties)
 void
 Tie_formatting_problem::set_manual_tie_configuration (SCM manual_configs)
 {
-  int k = 0;
+  vsize k = 0;
   for (SCM s = manual_configs;
-       scm_is_pair (s) && k < specifications_.size(); s = scm_cdr (s))
+       scm_is_pair (s) && k < specifications_.size (); s = scm_cdr (s))
     {
       SCM entry = scm_car (s);
       if (scm_is_pair (entry))
index 24bc927a1409892ba6915d2c4aa6d554b618c809..f122bcc86546c2c6fa1dd82207ffd12ae2eaa171 100644 (file)
@@ -17,8 +17,8 @@ class Tie_performer : public Performer
 {
   Music *event_;
   Music *last_event_;
-  Array<Audio_element_info> now_heads_;
-  Array<Audio_element_info> heads_to_tie_;
+  std::vector<Audio_element_info> now_heads_;
+  std::vector<Audio_element_info> heads_to_tie_;
 
   bool ties_created_;
 
@@ -60,8 +60,8 @@ Tie_performer::acknowledge_audio_element (Audio_element_info inf)
 {
   if (Audio_note *an = dynamic_cast<Audio_note *> (inf.elem_))
     {
-      now_heads_.push (inf);
-      for (int i = heads_to_tie_.size (); i--;)
+      now_heads_.push_back (inf);
+      for (vsize i = heads_to_tie_.size (); i--;)
        {
          Music *right_mus = inf.event_;
 
index 319a976cbdf92e7219c4c14d97775dc7a33346ae..91978565972d57f843fbec9685b86537e46ed59f 100644 (file)
@@ -17,7 +17,7 @@ void
 Engraver_dispatch_list::apply (Grob_info gi)
 {
   Translator *origin = gi.origin_translator ();
-  for (int i = 0; i < dispatch_entries_.size (); i++)
+  for (vsize i = 0; i < dispatch_entries_.size (); i++)
     {
       Engraver_dispatch_entry const &e (dispatch_entries_[i]);
       if (e.engraver_ == origin)
@@ -52,7 +52,7 @@ Engraver_dispatch_list::create (SCM trans_list,
          if (ptr)
            {
              entry.function_ = ptr;
-             list->dispatch_entries_.push (entry);
+             list->dispatch_entries_.push_back (entry);
              found = true;
            }
        }
index e821e784ca93875fcb0a8a35f3c999e4bf920678..e63dfdc6eb40179951ac48c61074b7f43ec85494 100644 (file)
@@ -176,7 +176,7 @@ Translator_group::precompute_method_bindings ()
       for (int i = 0; i < TRANSLATOR_METHOD_PRECOMPUTE_COUNT; i++)
        {
          if (ptrs[i])
-           precomputed_method_bindings_[i].push (Translator_method_binding (tr, ptrs[i]));
+           precomputed_method_bindings_[i].push_back (Translator_method_binding (tr, ptrs[i]));
        }
     }
 
@@ -186,8 +186,8 @@ Translator_group::precompute_method_bindings ()
 void
 Translator_group::precomputed_translator_foreach (Translator_precompute_index idx)
 {
-  Array<Translator_method_binding> &bindings (precomputed_method_bindings_[idx]);
-  for (int i = 0; i < bindings.size (); i++)
+  std::vector<Translator_method_binding> &bindings (precomputed_method_bindings_[idx]);
+  for (vsize i = 0; i < bindings.size (); i++)
     bindings[i].invoke ();
 }
 
index d55fe15729b9677b7f07d138b26c8d66fe836c25..a11a33e82266c886cae09943a1b918d5b9d50017 100644 (file)
@@ -159,7 +159,7 @@ Translator::print_smob (SCM s, SCM port, scm_print_state *)
 void
 add_acknowledger (Engraver_void_function_engraver_grob_info ptr,
                  char const *func_name,
-                 Array<Acknowledge_information> *ack_array)
+                 std::vector<Acknowledge_information> *ack_array)
 {
   Acknowledge_information inf;
   inf.function_ = ptr;
@@ -170,13 +170,13 @@ add_acknowledger (Engraver_void_function_engraver_grob_info ptr,
   interface_name += "-interface";
 
   inf.symbol_ = scm_gc_protect_object (ly_symbol2scm (interface_name.c_str ()));
-  ack_array->push (inf);
+  ack_array->push_back (inf);
 }
 
 Engraver_void_function_engraver_grob_info
-generic_get_acknowledger (SCM sym, Array<Acknowledge_information> const *ack_array)
+generic_get_acknowledger (SCM sym, std::vector<Acknowledge_information> const *ack_array)
 {
-  for (int i = 0; i < ack_array->size (); i++)
+  for (vsize i = 0; i < ack_array->size (); i++)
     {
       if (ack_array->elem (i).symbol_ == sym)
        return ack_array->elem (i).function_;
index e8b006f990676fd8dac5b075256c5b79349ee802..146499dbaa1f0e6b761dc4033b25897f29df659d 100644 (file)
@@ -81,7 +81,7 @@ Tuplet_bracket::parallel_beam (Grob *me_grob, Link_array<Grob> const &cols, bool
     return 0;
 
   Drul_array<Grob*> stems (Note_column::get_stem (cols[0]),
-                          Note_column::get_stem (cols.top ()));
+                          Note_column::get_stem (cols.back ()));
 
   if (dynamic_cast<Item*> (stems[RIGHT])->get_column ()
       != me->get_bound (RIGHT)->get_column())
@@ -105,7 +105,7 @@ Tuplet_bracket::parallel_beam (Grob *me_grob, Link_array<Grob> const &cols, bool
       return 0;
     }
 
-  *equally_long = (beam_stems[0] == stems[LEFT] && beam_stems.top () == stems[RIGHT]);
+  *equally_long = (beam_stems[0] == stems[LEFT] && beam_stems.back () == stems[RIGHT]);
   return beams[LEFT];
 }
 
@@ -128,7 +128,7 @@ Tuplet_bracket::calc_connect_to_neighbors (SCM smob)
       
       Spanner *orig_spanner = dynamic_cast<Spanner*> (me->original ());
 
-      int neighbor_idx = me->get_break_index () - break_dir;
+      vsize neighbor_idx = me->get_break_index () - break_dir;
       if (break_dir
          && d == RIGHT
          && neighbor_idx < orig_spanner->broken_intos_.size ())
@@ -208,9 +208,9 @@ Tuplet_bracket::calc_control_points (SCM smob)
              - overshoot[LEFT];
        }
       else if (d == RIGHT
-              && (columns.is_empty ()
+              && (columns.empty ()
                   || (bounds[d]->get_column ()
-                      != dynamic_cast<Item *> (columns.top ())->get_column ())))
+                      != dynamic_cast<Item *> (columns.back ())->get_column ())))
        {
          /*
            TODO: make padding tunable?
@@ -435,7 +435,7 @@ void
 Tuplet_bracket::get_bounds (Grob *me, Grob **left, Grob **right)
 {
   extract_grob_set (me, "note-columns", columns);
-  int l = 0;
+  vsize l = 0;
   while (l < columns.size () && Note_column::has_rests (columns[l]))
     l++;
 
@@ -521,17 +521,17 @@ 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];
 
-  Array<Offset> points;
-  points.push (Offset (x0 - x0, staff[dir]));
-  points.push (Offset (x1 - x0, staff[dir]));
+  std::vector<Offset> points;
+  points.push_back (Offset (x0 - x0, staff[dir]));
+  points.push_back (Offset (x1 - x0, staff[dir]));
 
-  for (int i = 0; i < columns.size (); i++)
+  for (vsize i = 0; i < columns.size (); i++)
     {
       Interval note_ext = columns[i]->extent (commony, Y_AXIS);
       Real notey = note_ext[dir] - me->relative_coordinate (commony, Y_AXIS);
 
       Real x = columns[i]->relative_coordinate (commonx, X_AXIS) - x0;
-      points.push (Offset (x, notey));
+      points.push_back (Offset (x, notey));
     }
 
   /*
@@ -541,7 +541,7 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
     We assume that the smaller bracket is 1.0 space high.
   */
   Real ss = Staff_symbol_referencer::staff_space (me);
-  for (int i = 0; i < tuplets.size (); i++)
+  for (vsize i = 0; i < tuplets.size (); i++)
     {
       Interval tuplet_x (tuplets[i]->extent (commonx, X_AXIS));
       Interval tuplet_y (tuplets[i]->extent (commony, Y_AXIS));
@@ -571,13 +571,13 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
            y += dir * my_height[d];
 #endif
 
-         points.push (Offset (tuplet_x[d] - x0, y));
+         points.push_back (Offset (tuplet_x[d] - x0, y));
        }
       while (flip (&d) != LEFT);
     }
 
   Real factor = (columns.size () > 1) ? 1 / (x1 - x0) : 1.0;
-  for (int i = 0; i < points.size (); i++)
+  for (vsize i = 0; i < points.size (); i++)
     {
       Real x = points[i][X_AXIS];
       Real tuplety = (*dy) * x * factor;
@@ -667,7 +667,7 @@ Tuplet_bracket::get_default_dir (Grob *me)
 {
   Drul_array<int> dirs (0, 0);
   extract_grob_set (me, "note-columns", columns);
-  for (int i = 0; i < columns.size (); i++)
+  for (vsize i = 0; i < columns.size (); i++)
     {
       Grob *nc = columns[i];
       Direction d = Note_column::dir (nc);
index 1bdda38c69a21c7a7a08a2ab21953f2cca0735f3..3d24023e41badd58d754d35a1ab81843dd5be52a 100644 (file)
@@ -40,7 +40,7 @@ public:
   TRANSLATOR_DECLARATIONS (Tuplet_engraver);
 
 protected:
-  Array<Tuplet_description> tuplets_;
+  std::vector<Tuplet_description> tuplets_;
   Link_array<Spanner> last_tuplets_;
   DECLARE_ACKNOWLEDGER (note_column);
   virtual bool try_music (Music *r);
@@ -67,7 +67,7 @@ Tuplet_engraver::try_music (Music *music)
          if (unsmob_moment (s))
            d.span_stop_ = min (d.span_stop_, (now_mom () + *unsmob_moment (s)).main_part_);
 
-         tuplets_.push (d);
+         tuplets_.push_back (d);
        }
       return true;
     }
@@ -81,7 +81,7 @@ Tuplet_engraver::process_music ()
     return;
 
   tuplets_.sort (&Tuplet_description::compare);
-  for (int i = 0; i < tuplets_.size (); i++)
+  for (vsize i = 0; i < tuplets_.size (); i++)
     {
       if (tuplets_[i].bracket_)
        continue;
@@ -111,7 +111,7 @@ Tuplet_engraver::process_music ()
 void
 Tuplet_engraver::acknowledge_note_column (Grob_info inf)
 {
-  for (int j = 0; j < tuplets_.size (); j++)
+  for (vsize j = 0; j < tuplets_.size (); j++)
     if (tuplets_[j].bracket_)
       {
        Item *i = dynamic_cast<Item *> (inf.grob ());
@@ -126,13 +126,13 @@ Tuplet_engraver::start_translation_timestep ()
   Moment now = now_mom ();
 
   last_tuplets_.clear ();
-  if (tuplets_.is_empty ())
+  if (tuplets_.empty ())
     return;
 
   Moment tsdmom = robust_scm2moment (get_property ("tupletSpannerDuration"), Moment (0));
   bool full_length = to_boolean (get_property ("tupletFullLength"));
 
-  for (int i = tuplets_.size (); i--;)
+  for (vsize i = tuplets_.size (); i--;)
     {
       Rational tsd = tsdmom.main_part_;
 
@@ -154,8 +154,8 @@ Tuplet_engraver::start_translation_timestep ()
                  tuplets_[i].number_->set_bound (RIGHT,
                                                  tuplets_[i].bracket_->get_bound (LEFT));
                }
-             last_tuplets_.push (tuplets_[i].bracket_);
-             last_tuplets_.push (tuplets_[i].number_);
+             last_tuplets_.push_back (tuplets_[i].bracket_);
+             last_tuplets_.push_back (tuplets_[i].number_);
              
              tuplets_[i].bracket_ = 0;
              tuplets_[i].number_ = 0;
@@ -175,7 +175,7 @@ Tuplet_engraver::finalize ()
 {
   if (to_boolean (get_property ("tupletFullLength")))
     {
-      for (int i = 0; i < last_tuplets_.size (); i++)
+      for (vsize i = 0; i < last_tuplets_.size (); i++)
        {
          Item *col = unsmob_item (get_property ("currentCommandColumn"));
          last_tuplets_[i]->set_bound (RIGHT, col);
index bb535d3442ddb1e1ebec42bd4fc4537b310fe77c..1c8abf7150b639cba5d9746bf83e26549a91b9c9 100644 (file)
@@ -34,7 +34,7 @@ private:
                               int context_info, int delta_pitch);
   bool is_stacked_head (int prefix_set,
                        int context_info);
-  Real align_heads (Array<Grob_info> primitives,
+  Real align_heads (std::vector<Grob_info> primitives,
                    Real flexa_width,
                    Real thickness);
 
@@ -44,7 +44,7 @@ public:
 protected:
   virtual Spanner *create_ligature_spanner ();
   virtual void transform_heads (Spanner *ligature,
-                               Array<Grob_info> primitives);
+                               std::vector<Grob_info> 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 (Array<Grob_info> primitives,
+Vaticana_ligature_engraver::align_heads (std::vector<Grob_info> primitives,
                                         Real flexa_width,
                                         Real thickness)
 {
@@ -180,7 +180,7 @@ Vaticana_ligature_engraver::align_heads (Array<Grob_info> primitives,
 
   Item *prev_primitive = 0;
   int prev_prefix_set = 0;
-  for (int i = 0; i < primitives.size (); i++)
+  for (vsize i = 0; i < primitives.size (); i++)
     {
       Item *primitive = dynamic_cast<Item *> (primitives[i].grob ());
       int prefix_set
@@ -352,7 +352,7 @@ check_for_prefix_loss (Item *primitive)
 
 void
 Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
-                                            Array<Grob_info> primitives)
+                                            std::vector<Grob_info> primitives)
 {
   Real flexa_width = robust_scm2double (ligature->get_property ("flexa-width"), 2);
 
@@ -363,7 +363,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
   int prev_context_info = 0;
   int prev_delta_pitch = 0;
   std::string prev_glyph_name = "";
-  for (int i = 0; i < primitives.size (); i++)
+  for (vsize i = 0; i < primitives.size (); i++)
     {
       Item *primitive = dynamic_cast<Item *> (primitives[i].grob ());
 
index 890490069c89df1af85aef63253aeeb5de9a7168..27f00f231b54cf64c82b1ffb5a8e630688a1ad2f 100644 (file)
@@ -120,7 +120,7 @@ Vertical_align_engraver::acknowledge_axis_group (Grob_info i)
          Link_array<Grob> &arr = ga->array_reference ();
 
          Grob *added = arr.pop ();
-         for (int i = 0; i < arr.size (); i++)
+         for (vsize i = 0; i < arr.size (); i++)
            {
              if (arr[i] == before_grob)
                {
index 595ed9b192cdc3732b4090d538de67373042e9ff..561f0830f8ac02dc505725d000eb45e48630de9f 100644 (file)
@@ -110,13 +110,13 @@ Volta_bracket_interface::after_line_breaking (SCM smob)
  
   bool broken_first_bracket = orig_span && (orig_span->broken_intos_[0] == (Spanner *)me);
 
-  bool broken_last_bracket = orig_span && (orig_span->broken_intos_.top () == (Spanner *)me);
+  bool broken_last_bracket = orig_span && (orig_span->broken_intos_.back () == (Spanner *)me);
 
   bool no_vertical_start = orig_span && !broken_first_bracket;
   bool no_vertical_end = orig_span && !broken_last_bracket;
 
   extract_grob_set (me, "bars", bars);
-  Grob *endbar = bars.size () ? bars.top () : 0;
+  Grob *endbar = bars.size () ? bars.back () : 0;
   SCM glyph = endbar ? endbar->get_property ("glyph") : SCM_EOL;
 
   std::string str;