]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/include/midi-item.hh (class Midi_track): idem.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 16 Feb 2006 11:54:21 +0000 (11:54 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 16 Feb 2006 11:54:21 +0000 (11:54 +0000)
* lily/include/source.hh (class Sources): idem.

* lily/include/performance.hh (class Performance): use vector
iso. Cons<>

* flower/include/cons.hh (class Cons): remove file.

* flower/include/flower-proto.hh: remove template cruft.

* lily/include/font-metric.hh: use size_t not vsize for indices.

* flower/include/flower-proto.hh (Module): remove std-vector.hh
from proto.

* lily/include/all-font-metrics.hh: use HAVE_PANGO_FT2

* flower/include/flower-proto.hh: remove outdated templates.

34 files changed:
ChangeLog
flower/include/cons.hh [deleted file]
flower/include/flower-proto.hh
flower/include/string-convert.hh
flower/string-convert.cc
lily/font-metric.cc
lily/include/accidental-interface.hh
lily/include/all-font-metrics.hh
lily/include/axis-group-interface.hh
lily/include/beam.hh
lily/include/context-def.hh
lily/include/context.hh
lily/include/font-metric.hh
lily/include/horizontal-bracket.hh
lily/include/lookup.hh
lily/include/midi-item.hh
lily/include/modified-font-metric.hh
lily/include/open-type-font.hh
lily/include/performance.hh
lily/include/pitch.hh
lily/include/source-file.hh
lily/include/source.hh
lily/include/spacing-spanner.hh
lily/include/stem.hh
lily/include/translator.hh
lily/include/tuplet-bracket.hh
lily/lily-guile.cc
lily/lilypond-version.cc
lily/main.cc
lily/midi-item.cc
lily/misc.cc
lily/open-type-font.cc
lily/performance.cc
lily/source.cc

index 1ce394b79982fd4f2dab6c3367118ee650f04c4a..27ccc1f260272b65ad16dbff1d39306a2467fc0e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
 2006-02-16  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/include/midi-item.hh (class Midi_track): idem.
+
+       * lily/include/source.hh (class Sources): idem.
+
+       * lily/include/performance.hh (class Performance): use vector
+       iso. Cons<>
+
+       * flower/include/cons.hh (class Cons): remove file.
+
+       * flower/include/flower-proto.hh: remove template cruft.
+
+       * lily/include/font-metric.hh: use size_t not vsize for indices.
+
+       * flower/include/flower-proto.hh (Module): remove std-vector.hh
+       from proto.
+
+       * lily/include/all-font-metrics.hh: use HAVE_PANGO_FT2
+
        * lily/include/paper-book.hh (class Paper_book):
        make get_system_specs() public.
 
diff --git a/flower/include/cons.hh b/flower/include/cons.hh
deleted file mode 100644 (file)
index e6be3c4..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
-  cons.hh -- declare LISP like datatypes
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
-*/
-
-#ifndef CONS_HH
-#define CONS_HH
-
-#include <cassert>
-using namespace std;
-
-template<class T>
-class Cons
-{
-public:
-  T *car_;
-  Cons *next_;
-  Cons ()
-  {
-    car_ = 0;
-    next_ = 0;
-  }
-  Cons (T *t, Cons<T> *c)
-  {
-    car_ = t;
-    next_ = c;
-  }
-  virtual ~Cons ()
-  {
-    delete next_;
-  }
-};
-
-template<class T>
-class Killing_cons : public Cons<T>
-{
-public:
-  Killing_cons (T *t, Cons<T> *p)
-    : Cons<T> (t, p)
-  {
-  }
-  virtual ~Killing_cons ();
-};
-
-/// remove the link pointed to by *p.
-template<class T>
-Cons<T> *remove_cons (Cons<T> **pp)
-{
-  Cons<T> *knip = *pp;
-  *pp = (*pp)->next_;
-  knip->next_ = 0;
-  return knip;
-}
-
-template<class T> int cons_list_size (Cons<T> *l)
-{
-  int i = 0;
-  while (l)
-    {
-      l = l->next_;
-      i++;
-    }
-  return i;
-}
-
-template<class T>
-Cons<T> *last_cons (Cons<T> *head)
-{
-  while (head && head->next_)
-    head = head->next_;
-  return head;
-}
-
-/**
-
-Invariants:
-
-(*tail_) is either the head_ pointer, or a next_ pointer from the list.
-
-**tail_ == NULL
-*/
-
-template<class T>
-class Cons_list
-{
-public:
-  Cons<T> *head_;
-  Cons<T> ** nil_pointer_address_;
-  Cons_list ()
-  {
-    init ();
-  }
-  void init ()
-  {
-    head_ = 0;
-    nil_pointer_address_ = &head_;
-  }
-  void append (T *c)
-  {
-    append (new Cons<T> (c, 0));
-  }
-  void append (Cons<T> *c)
-  {
-    assert (!c->next_);
-    *nil_pointer_address_ = c;
-    while (*nil_pointer_address_)
-      nil_pointer_address_ = &(*nil_pointer_address_)->next_;
-  }
-  /**
-     PRE: *pp should either be the head_ pointer, or the next_ pointer
-     from a list cell.
-  */
-  Cons<T> *remove_cons (Cons<T> **pp)
-  {
-    if (& (*pp)->next_ == nil_pointer_address_)
-      nil_pointer_address_ = pp;
-
-    return ::remove_cons (pp);
-  }
-
-  /// junk everything after the  first I elements.
-  void truncate (int i)
-  {
-    Cons<T> **p = &head_;
-    for (; *p && i; p = &((*p)->next_))
-      i--;
-
-    if (*p)
-      {
-       delete *p;
-       *p = 0;
-      }
-    nil_pointer_address_ = p;
-  }
-
-  void junk ()
-  {
-    delete head_;
-    head_ = 0;
-  }
-  ~Cons_list ()
-  {
-    junk ();
-  }
-  int size ()
-  {
-    return cons_list_size (head_);
-  }
-};
-
-template<class T>
-void copy_killing_cons_list (Cons_list<T> &, Cons<T> *src);
-template<class T>
-void
-clone_killing_cons_list (Cons_list<T> &, Cons<T> *src);
-
-#endif /* CONS_HH */
-
index cb8cb71bae8c61c01b25db395e91ba8ecf33a790..0d82d8bbc797cb8b8146fdf7dc98beb9b1dd226b 100644 (file)
@@ -13,7 +13,6 @@ typedef unsigned char Byte;
 struct String_convert;
 
 #include "std-string.hh"
-#include "std-vector.hh"
 using namespace std;
 
 #include "real.hh"
index 2cd863f49582724e7ea0cb6db29ef714ce74b857..4717bfc49bfd71998312e8c3cf9c809f507ac94d 100644 (file)
@@ -45,7 +45,7 @@ public:
   static string rational_string (Rational);
   static string pointer_string (void const *);
   static string precision_string (double x, int n);
-  static vector<string> split (string str, char c);
+  //  static vector<string> split (string str, char c);
   static string i64_string (I64, char const *fmt = 0);
   static string to_lower (string s);
   static string to_upper (string s);
index 2175dd8cd43d11e6aec729f72710f2d54b70a575..f9449363f04eacea19d94f88ddda8855af5d9400 100644 (file)
@@ -315,24 +315,6 @@ String_convert::precision_string (double x, int n)
   return (sign (x) > 0 ? str : "-" + str);
 }
 
-vector<string>
-String_convert::split (string str, char c)
-{
-  vector<string> a;
-  ssize i = str.find (c);
-  while (i != NPOS)
-    {
-      string s = str.substr (0, i);
-      a.push_back (s);
-      while (str[++i] == c)
-       ;
-      str = str.substr (i);
-      i = str.find (c);
-    }
-  if (str.length ())
-    a.push_back (str);
-  return a;
-}
 
 string
 String_convert::long_string (long l)
index eccc9d2441c02076e375a679e2983788f801a43f..70017df10c41ca2a20d7eeed092d5715e2a843bc 100644 (file)
@@ -64,32 +64,32 @@ Font_metric::~Font_metric ()
 {
 }
 
-vsize
+size_t
 Font_metric::count () const
 {
   return 0;
 }
 
 Box
-Font_metric::get_ascii_char (vsize) const
+Font_metric::get_ascii_char (size_t) const
 {
   return Box (Interval (0, 0), Interval (0, 0));
 }
 
 Box
-Font_metric::get_indexed_char (vsize k) const
+Font_metric::get_indexed_char (size_t k) const
 {
   return get_ascii_char (k);
 }
 
-vsize
+size_t
 Font_metric::name_to_index (string) const
 {
-  return VPOS;
+  return (size_t)-1;
 }
 
 Offset
-Font_metric::get_indexed_wxwy (vsize) const
+Font_metric::get_indexed_wxwy (size_t) const
 {
   return Offset (0, 0);
 }
@@ -136,20 +136,20 @@ Font_metric::font_name () const
   return s;
 }
 
-vsize
-Font_metric::index_to_ascii (vsize i) const
+size_t
+Font_metric::index_to_ascii (size_t i) const
 {
   return i;
 }
 
-vsize
-Font_metric::index_to_charcode (vsize i) const
+size_t
+Font_metric::index_to_charcode (size_t i) const
 {
   return index_to_ascii (i);
 }
 
 Stencil
-Font_metric::get_ascii_char_stencil (vsize code) const
+Font_metric::get_ascii_char_stencil (size_t code) const
 {
   SCM at = scm_list_3 (ly_symbol2scm ("char"), self_scm (),
                       scm_from_unsigned (code));
@@ -158,9 +158,9 @@ Font_metric::get_ascii_char_stencil (vsize code) const
 }
 
 Stencil
-Font_metric::get_indexed_char_stencil (vsize code) const
+Font_metric::get_indexed_char_stencil (size_t code) const
 {
-  vsize idx = index_to_ascii (code);
+  size_t idx = index_to_ascii (code);
   SCM at = scm_list_3 (ly_symbol2scm ("char"), self_scm (),
                       scm_from_unsigned (idx));
   Box b = get_indexed_char (code);
index 77cc815a6327d2b2e2c5f72dfecf3c05804029a3..b9f4e7c83dc5383b75da65d70f3bf37588f39473 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef ACCIDENTAL_INTERFACE_HH
 #define ACCIDENTAL_INTERFACE_HH
 
+#include "std-vector.hh"
+
 #include "box.hh"
 #include "lily-guile.hh"
 #include "lily-proto.hh"
index 8243ccbe34d27bb890afaf217f409ae66b709fc4..59cc9f86ea916583bf8a08531ec98725681a8e25 100644 (file)
@@ -13,7 +13,7 @@
 #include "font-metric.hh"
 #include "config.hh"
 
-#if HAVE_PANGO16
+#if HAVE_PANGO_FT2
 #include <pango/pango.h>
 #include <pango/pangoft2.h>
 #endif
index 11e95233a6ec78faccce1bce066bfe17e49dfbff..94e1a256d9dc0da75e9bb47e24bfb4372cbbce5b 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef AXIS_GROUP_INTERFACE_HH
 #define AXIS_GROUP_INTERFACE_HH
 
+#include "std-vector.hh"
 #include "lily-proto.hh"
 #include "lily-guile.hh"
 
index 15ddae2bf1951c8ca791cf63f22adc904b2f0470..44460905e8a140d53c9dd8cdad6b2928e95939c4 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef BEAM_HH
 #define BEAM_HH
 
+#include "std-vector.hh"
 #include "lily-proto.hh"
 #include "lily-guile.hh"
 #include "stem-info.hh"
index 48828927303e8bb13d7b80ed9dfdb0875277b190..8f5ba8686d02f8a56d98126a6c724c43cd39d397 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef CONTEXT_DEF_HH
 #define CONTEXT_DEF_HH
 
+#include "std-vector.hh"
 #include "lily-proto.hh"
 #include "smobs.hh"
 #include "input.hh"
index 6a2fcb0d22480d8b77e75d8dae64c65c51324cb3..d0b9ac724841f8961184a3070e4f8ad17a93bdf4 100644 (file)
@@ -10,6 +10,7 @@
 #define CONTEXT_HH
 
 
+#include "std-vector.hh"
 #include "moment.hh"
 #include "lily-proto.hh"
 #include "virtual-methods.hh"
index d4507a45aef0a785f817dd19f226293cd8fdbc1e..f5d036f972ea63fd6e01efa2bd053004ba40f231 100644 (file)
@@ -22,21 +22,28 @@ public:
   SCM description_;
   string file_name_;
 
+
   virtual Stencil text_stencil (string) const;
   virtual Box text_dimension (string) const;
   virtual string font_name () const;
-  virtual vsize count () const;
+  virtual size_t count () const;
   virtual Offset attachment_point (string) const;
-  virtual Offset get_indexed_wxwy (vsize) const;
-  virtual Box get_indexed_char (vsize index) const;
-  virtual Box get_ascii_char (vsize ascii) const;
-  virtual vsize name_to_index (string) const;
-  virtual vsize index_to_charcode (vsize) const;
-  virtual vsize index_to_ascii (vsize) const;
+  virtual Offset get_indexed_wxwy (size_t) const;
+  virtual Box get_indexed_char (size_t index) const;
+  virtual Box get_ascii_char (size_t ascii) const;
+
+  /*
+    WTF are these vsize ?
+
+    Font_metric is not related to vector<> 
+   */
+  virtual size_t name_to_index (string) const;
+  virtual size_t index_to_charcode (size_t) const;
+  virtual size_t index_to_ascii (size_t) const;
   virtual Real design_size () const;
   virtual Stencil find_by_name (string) const;
-  virtual Stencil get_indexed_char_stencil (vsize k) const;
-  virtual Stencil get_ascii_char_stencil (vsize k) const;
+  virtual Stencil get_indexed_char_stencil (size_t k) const;
+  virtual Stencil get_ascii_char_stencil (size_t k) const;
   virtual SCM sub_fonts () const;
   virtual SCM font_file_name () const;
   DECLARE_SMOBS (Font_metric,);
index 7cc2b21b094d8564aa7391284aa9d744e643c757..cb54b95a26988066dd57b7c3ee17c21d1f8d97c8 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "lily-guile.hh"
 #include "lily-proto.hh"
+#include "std-vector.hh"
 
 struct Horizontal_bracket
 {
index edde1945383edb68f5bab06603e5229087d15847..54ad282f9f23fb61782690f782d84969dc7a0113 100644 (file)
@@ -11,6 +11,7 @@
 #define LOOKUP_HH
 
 #include "stencil.hh"
+#include "std-vector.hh"
 
 struct Lookup
 {
index 178ddedbf5bc792f1592633f94c57660bdbdb605..ba3f2c0a9a61e0b76bc0dc438626ce0eae82b006 100644 (file)
@@ -7,8 +7,8 @@
 #ifndef MIDI_ITEM_HH
 #define MIDI_ITEM_HH
 
-#include "cons.hh"
 #include "audio-item.hh"
+#include "std-vector.hh"
 
 /**
    Any piece of midi information.
@@ -211,9 +211,10 @@ public:
   /*
     Compensate for starting grace notes.
   */
-  Cons_list<Midi_event> event_p_list_;
+  vector<Midi_event*> events_;
 
   Midi_track ();
+  ~Midi_track ();
 
   void add (Moment delta_time_mom, Midi_item *midi);
   virtual string data_string () const;
index c2f66f9292d65a1573c628007bd15f6ad1fa5b0b..c5e6d3c5bf4e51d9ddb588b394bd4963c74ce357 100644 (file)
@@ -19,11 +19,11 @@ public:
   Stencil text_stencil (string) const;
 
   static SCM make_scaled_font_metric (Font_metric *fm, Real magnification);
-  vsize count () const;
-  Offset get_indexed_wxwy (vsize) const;
+  size_t count () const;
+  Offset get_indexed_wxwy (size_t) const;
   Offset attachment_point (string) const;
-  vsize name_to_index (string) const;
-  vsize index_to_charcode (vsize) const;
+  size_t name_to_index (string) const;
+  size_t index_to_charcode (size_t) const;
   Font_metric *original_font () const;
 
 protected:
@@ -35,9 +35,9 @@ protected:
   string font_name () const;
   Real design_size () const;
   void derived_mark () const;
-  Box get_indexed_char (vsize) const;
-  vsize index_to_ascii (vsize) const;
-  Box get_ascii_char (vsize) const;
+  Box get_indexed_char (size_t) const;
+  size_t index_to_ascii (size_t) const;
+  Box get_ascii_char (size_t) const;
   Box tex_kludge (string) const;
 };
 
index e1d798611bb6d84c36ff48703074a782c28d9ea4..462837e5956d8e48ce670db9cc1cbb57d89fdd53 100644 (file)
@@ -43,11 +43,11 @@ public:
   string font_name () const;
   ~Open_type_font ();
   Offset attachment_point (string) const;
-  vsize count () const;
-  Box get_indexed_char (vsize) const;
-  vsize name_to_index (string) const;
-  //vsize glyph_name_to_charcode (string) const;
-  vsize index_to_charcode (vsize) const;
+  size_t count () const;
+  Box get_indexed_char (size_t) const;
+  size_t name_to_index (string) const;
+  //size_t glyph_name_to_charcode (string) const;
+  size_t index_to_charcode (size_t) const;
   void derived_mark () const;
   SCM sub_fonts () const;
   Real design_size () const;
index ff90bfd417161fa9a4f7bb677ceac799302db0cb..90a825bb1d3ce3cb165a8217eba6ac7e7c01f3b4 100644 (file)
@@ -8,7 +8,6 @@
 #define PERFORMANCE_HH
 
 #include "std-vector.hh"
-#include "cons.hh"
 #include "music-output.hh"
 
 /* MIDI output.  */
@@ -28,7 +27,7 @@ public:
   void write_output (string filename);
 
   vector<Audio_staff*> audio_staffs_;
-  Cons<Audio_element> *audio_element_list_;
+  vector<Audio_element*> audio_elements_;
   Output_def *midi_;
 };
 
index da61960ecb08ef60f9f0f5f1f7af45a3b3050a32..57cb076b526fdcfa4566a6408b71e3de30fda551 100644 (file)
@@ -82,7 +82,6 @@ DECLARE_UNSMOB (Pitch, pitch);
 
 INSTANTIATE_COMPARE (Pitch, Pitch::compare);
 
-int compare (vector<Pitch> *, vector<Pitch> *);
 extern SCM pitch_less_proc;
 Pitch pitch_interval (Pitch const &from, Pitch const &to);
 
index 546367244685b70f19a4d6942ada64c867346d99..dd88a2c65ae2255263dcf8c467bc7ec58120fed3 100644 (file)
@@ -9,15 +9,14 @@
 #ifndef SOURCE_FILE_HH
 #define SOURCE_FILE_HH
 
-#include "std-string.hh"
+#include "flower-proto.hh"
 #include "std-vector.hh"
 #include "lily-proto.hh"
+#include "protected-scm.hh"
 
 #include <iostream>
 using namespace std;
 
-#include "protected-scm.hh"
-
 /**
    class for reading and mapping a file.
 
index eaa0a3085099023dc31567036667224be75f8cfd..8b3a40fbec469cd4b371580078d68fa038579e53 100644 (file)
@@ -7,15 +7,14 @@
 #ifndef SOURCE_HH
 #define SOURCE_HH
 
-#include "cons.hh"
 #include "flower-proto.hh"
-#include "std-string.hh"
+#include "std-vector.hh"
 
 /*   A set of sourcefiles.  */
 class Sources
 {
   Sources (Sources const &) {}
-  Cons<Source_file> *sourcefile_list_;
+  vector<Source_file*> sourcefiles_;
   bool is_binary_;
 
 public:
index c713c8755aa680dc4724f6a2959563b8fafb45b9..7f560e288029383199d41c30c91db8465a4844a0 100644 (file)
@@ -12,6 +12,7 @@
 #include "lily-proto.hh"
 #include "lily-guile.hh"
 #include "rational.hh"
+#include "std-vector.hh"
 
 struct Spacing_options
 {
index 09daee1d16a06c856374ecfe392eb8c43bd6ab7c..da024edb351c87d0b0bdf75fc69c504637571c89 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef STEM_HH
 #define STEM_HH
 
+#include "std-vector.hh"
 #include "lily-proto.hh"
 #include "lily-guile.hh"
 #include "stem-info.hh"
index ab587cb5d28e644d454d9a77c48d4ba99299d7e8..8566f0e3a27fc141da2ca84f5969e38e5f6fadbf 100644 (file)
@@ -15,6 +15,7 @@
 #include "virtual-methods.hh"
 #include "input.hh"
 #include "smobs.hh"
+#include "std-vector.hh"
 
 struct Acknowledge_information
 {
index fc6830dd12b728c6cd2028cfb4deb258f238e6b2..1b9d9c03c0a88b4e4a215686a832fdef802e6372 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "lily-guile.hh"
 #include "lily-proto.hh"
+#include "std-vector.hh"
 
 class Tuplet_bracket
 {
index 935846a8eca8bbba0ab5a1a32ae94dcaf4c07416..19fe4b0132f9fa87f3837f822e05935b5d4cb6a9 100644 (file)
@@ -373,7 +373,7 @@ parse_symbol_list (char const *symbols)
   string s = symbols;
   replace_all (s, '\n', ' ');
   replace_all (s, '\t', ' ');
-  return ly_string_array_to_scm (String_convert::split (s, ' '));
+  return ly_string_array_to_scm (split_string (s, ' '));
 }
 
 SCM
index 252366251d365ffcf53fffcd8e50bedbfa388a42..6c453fab74df84a0140d65eec0836174f5ac9317 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "lilypond-input-version.hh"
 #include "string-convert.hh"
-#include "std-vector.hh"
+#include "misc.hh"
 
 Lilypond_version::Lilypond_version (int major, int minor, int patch)
 {
@@ -26,7 +26,7 @@ Lilypond_version::Lilypond_version (string str)
   patch_ = 0;
   
   vector<string> version;
-  version = String_convert::split (str, '.');
+  version = split_string (str, '.');
 
   if (version.size () > 0 && isdigit (version[0][0]))
     major_ = String_convert::dec2int (version[0]);
index 7e9927e34d2c64ea4c3ee63753f7666b4d47c239..8e73ac95f3f4ad036aee00ec86508a87da6d1e54 100644 (file)
@@ -300,7 +300,7 @@ do_chroot_jail ()
       USER_NAME, GROUP_NAME, JAIL, DIR, JAIL_MAX
     };
 
-  vector<string> components = String_convert::split (jail_spec, ',');
+  vector<string> components = split_string (jail_spec, ',');
   if (components.size () != JAIL_MAX)
     {
       error (_f ("expected %d arguments with jail, found: %d", JAIL_MAX,
index 46906cd7e99590d8949f54ef702e050df786be25..a7d3e629d8af69c04c1a548095e2594e5f76a82e 100644 (file)
@@ -460,7 +460,7 @@ Midi_track::add (Moment delta_time_mom, Midi_item *midi)
   assert (delta_time_mom >= Moment (0));
 
   Midi_event *e = new Midi_event (delta_time_mom, midi);
-  event_p_list_.append (new Killing_cons<Midi_event> (e, 0));
+  events_.push_back (e);
 }
 
 string
@@ -469,9 +469,11 @@ Midi_track::data_string () const
   string str = Midi_chunk::data_string ();
   if (do_midi_debugging_global)
     str += "\n";
-  for (Cons<Midi_event> *i = event_p_list_.head_; i; i = i->next_)
+
+  for (vector<Midi_event*>::const_iterator i (events_.begin());
+       i != events_.end(); i ++)
     {
-      str += i->car_->to_string ();
+      str += (*i)->to_string ();
       if (do_midi_debugging_global)
        str += "\n";
     }
@@ -484,3 +486,8 @@ Midi_item::name () const
 {
    return this->class_name ();
 }
+
+Midi_track::~Midi_track ()
+{
+  junk_pointers (events_);
+}
index f8eda18b87d8ad895e6d7a27e8da3fa188da880a..5c3293073c1950d4d33bd8c1683d655874acd9b0 100644 (file)
@@ -35,6 +35,26 @@ log_2 (double x)
   return log (x) / log (2.0);
 }
 
+vector<string>
+split_string (string str, char c)
+{
+  vector<string> a;
+  ssize i = str.find (c);
+  while (i != NPOS)
+    {
+      string s = str.substr (0, i);
+      a.push_back (s);
+      while (str[++i] == c)
+       ;
+      str = str.substr (i);
+      i = str.find (c);
+    }
+  if (str.length ())
+    a.push_back (str);
+  return a;
+}
+
+#if 0
 vector<string>
 split_string (string s, char c)
 {
@@ -58,6 +78,7 @@ split_string (string s, char c)
 
   return rv;
 }
+#endif
 
 
 Real
index 32bd597df273883916b4becbaa52cc887dec3a84..73395fb9cbeacf40addb2d5c31c1444523b0a065 100644 (file)
@@ -163,7 +163,7 @@ Open_type_font::attachment_point (string glyph_name) const
 }
 
 Box
-Open_type_font::get_indexed_char (vsize signed_idx) const
+Open_type_font::get_indexed_char (size_t signed_idx) const
 {
   if (SCM_HASHTABLE_P (lily_index_to_bbox_table_))
     {
@@ -176,9 +176,9 @@ Open_type_font::get_indexed_char (vsize signed_idx) const
 
   if (SCM_HASHTABLE_P (lily_character_table_))
     {
-      const vsize len = 256;
+      const size_t len = 256;
       char name[len];
-      vsize code = FT_Get_Glyph_Name (face_, signed_idx, name, len);
+      size_t code = FT_Get_Glyph_Name (face_, signed_idx, name, len);
       if (code)
        warning (_f ("FT_Get_Glyph_Name() returned error: %d", code));
 
@@ -223,22 +223,23 @@ Open_type_font::get_indexed_char (vsize signed_idx) const
   return b;
 }
 
-vsize
+size_t
 Open_type_font::name_to_index (string nm) const
 {
   char *nm_str = (char *) nm.c_str ();
-  if (vsize idx = FT_Get_Name_Index (face_, nm_str))
+  if (size_t idx = FT_Get_Name_Index (face_, nm_str))
     return idx;
-  return VPOS;
+  
+  return (size_t) -1;
 }
 
-vsize
-Open_type_font::index_to_charcode (vsize i) const
+size_t
+Open_type_font::index_to_charcode (size_t i) const
 {
   return ((Open_type_font *) this)->index_to_charcode_map_[i];
 }
 
-vsize
+size_t
 Open_type_font::count () const
 {
   return ((Open_type_font *) this)->index_to_charcode_map_.size ();
@@ -299,9 +300,9 @@ Open_type_font::glyph_list () const
   
   for (int i = 0; i < face_->num_glyphs; i++)
     {
-      const vsize len = 256;
+      const size_t len = 256;
       char name[len];
-      vsize code = FT_Get_Glyph_Name (face_, i, name, len);
+      size_t code = FT_Get_Glyph_Name (face_, i, name, len);
       if (code)
        warning (_f ("FT_Get_Glyph_Name() returned error: %d", code));
 
index 2430df6670959ef910c9a4ed64415aec400cf185..7fc440e6b8372673540e6cb5a5069f3bf46dda8d 100644 (file)
@@ -28,12 +28,11 @@ using namespace std;
 Performance::Performance ()
 {
   midi_ = 0;
-  audio_element_list_ = 0;
 }
 
 Performance::~Performance ()
 {
-  delete audio_element_list_;
+  junk_pointers (audio_elements_);
 }
 
 void
@@ -146,7 +145,8 @@ Performance::add_element (Audio_element *p)
 {
   if (Audio_staff *s = dynamic_cast<Audio_staff *> (p))
     audio_staffs_.push_back (s);
-  audio_element_list_ = new Killing_cons<Audio_element> (p, audio_element_list_);
+
+  audio_elements_.push_back (p);
 }
 
 void
index 462bfcffa090a9232138db397d594c6b5c38adb8..90e99d5ed3e878c24214e7011a29abb680dcb003 100644 (file)
@@ -14,7 +14,6 @@
 
 Sources::Sources ()
 {
-  sourcefile_list_ = 0;
   path_ = 0;
   is_binary_ = false;
 }
@@ -57,25 +56,24 @@ Sources::get_file (string &file_string) //UGH
 void
 Sources::add (Source_file *sourcefile)
 {
-  sourcefile_list_ = new Killing_cons<Source_file> (sourcefile, sourcefile_list_);
+  sourcefiles_.push_back (sourcefile);
 }
 
 Sources::~Sources ()
 {
-  delete sourcefile_list_;
+  junk_pointers (sourcefiles_);
 }
-/**
-   search the list for file whose map contains pointer #str0#
 
-   @return 0 if not found.
-*/
 Source_file *
 Sources::get_sourcefile (char const *str0)
 {
+  for (vector<Source_file*>::iterator i = sourcefiles_.begin();
+       i != sourcefiles_.end (); i++)
+    {
+      if ((*i)->contains (str0))
+       return *i;
+    }
 
-  for (Cons<Source_file> *i = sourcefile_list_; i; i = i->next_)
-    if (i->car_->contains (str0))
-      return i->car_;
   return 0;
 }