X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Finclude%2Farray.hh;h=209feaa95a4e079d36b4e44c3b2332bd698b4eef;hb=a6ee9dcd388111e842064a8d46ab06c4897a00d2;hp=4e9710c1e2228195f442cf2502d483d0deaf512e;hpb=2fcbbf8c29d097f1feb6a8c7622b242a52e0d40b;p=lilypond.git diff --git a/flower/include/array.hh b/flower/include/array.hh index 4e9710c1e2..209feaa95a 100644 --- a/flower/include/array.hh +++ b/flower/include/array.hh @@ -39,17 +39,17 @@ protected: int max_; /// the data itself - T *array_p_; + T *array_; /// stretch or shrink array. void remax (int newmax) { T* newarr = new T[newmax]; size_ = (newmax < size_) ? newmax : size_; - arrcpy (newarr, array_p_, size_); + arrcpy (newarr, array_, size_); - delete[] array_p_; - array_p_ = newarr; + delete[] array_; + array_ = newarr; max_ = newmax; } int size_; @@ -75,19 +75,19 @@ public: Array (T *tp, int n) { - array_p_ = new T[n]; + array_ = new T[n]; max_ =size_ = n; - arrcpy (array_p_, tp, n); + arrcpy (array_, tp, n); } Array () - { array_p_ = 0; max_ =0; size_ =0; } + { array_ = 0; max_ =0; size_ =0; } // ugh, get around gcc 2.8.1 ice; see bezier.cc Array (int i) { max_ = size_ = i; - array_p_ = new T[i]; + array_ = new T[i]; } @@ -101,28 +101,28 @@ public: } ~Array () - { delete[] array_p_; } + { delete[] array_; } /// return a "new"ed copy of array - T* copy_array () const + T* copys () const { T* Tarray = new T[size_]; - arrcpy (Tarray, array_p_, size_); + arrcpy (Tarray, array_, size_); return Tarray; } - T const *access_array () const + T const *accesses () const { - return array_p_; + return array_; } void operator= (Array const & src) { set_size (src.size_); - arrcpy (array_p_,src.array_p_, size_); + arrcpy (array_,src.array_, size_); } Array (Array const & src) { - array_p_ = src.copy_array (); + array_ = src.copys (); max_ = size_ = src.size_; } @@ -131,7 +131,7 @@ public: remax (size_); } - T * remove_array_p (); + T * remove_array (); /// access element T &operator[] (int i) @@ -147,7 +147,7 @@ public: T &elem_ref (int i) const { assert (i >=0&&i=0&& i < size_); - arrcpy (array_p_+i, array_p_+i+1, size_-i-1); + arrcpy (array_+i, array_+i+1, size_-i-1); size_--; } // quicksort. @@ -239,7 +239,7 @@ public: { int s = size_; set_size (size_ + src.size_); - arrcpy (array_p_+s,src.array_p_, src.size_); + arrcpy (array_+s,src.array_, src.size_); } Array slice (int lower, int upper) const; void reverse ();