From bc1edc19c78d80de0e88cd360cfa4327676d76e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Fri, 9 Feb 2001 17:17:08 +0000 Subject: [PATCH] mathed7.diff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1473 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 6 +++-- src/mathed/array.h | 57 +++++------------------------------------ src/mathed/math_write.C | 5 ++-- 3 files changed, 14 insertions(+), 54 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 6f0382b2b9..da0505e9c4 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,5 +1,7 @@ -2001-02-09 Andre Poenitz +2001-02-09 André Pönitz + * array.h: replace array buffer 'byte bf[]' by 'std::vector bf' + * several files: subsequent changes * math_iter.h: remove unused prototype * array.h: ditto. @@ -9,7 +11,7 @@ compiling with lyxstring, but STL sstream). (Metrics): ditto. -2001-02-08 Andre Poenitz +2001-02-08 André Pönitz * several files: get rid of reinterpret_cast. diff --git a/src/mathed/array.h b/src/mathed/array.h index 4be93b9bfc..9f9bdd36f0 100644 --- a/src/mathed/array.h +++ b/src/mathed/array.h @@ -14,7 +14,7 @@ * the GNU General Public Licence version 2 or later. */ -#include +#include #ifndef byte #define byte unsigned char @@ -27,6 +27,8 @@ */ class LyxArrayBase { public: + /// + typedef std::vector buffer_type; /// enum { /// @@ -40,13 +42,6 @@ public: /// explicit LyxArrayBase(int size = ARRAY_STEP); - /// - LyxArrayBase(LyxArrayBase const &); - /// - ~LyxArrayBase(); - - /// Constructs a new array with dx elements starting at pos - LyxArrayBase & operator=(LyxArrayBase const &); /// int empty() const { return (last == 0); } @@ -54,9 +49,6 @@ public: /// int Last() { return last; } - /// Fills with 0 the entire array and set last to 0 - void Init(); - /// Make the allocated memory fit the needed size void Fit(); @@ -88,7 +80,7 @@ protected: bool Move(int p, int shift); /// Buffer - byte * bf; + buffer_type bf; /// Last position inserted. int last; /// Max size of the array. @@ -102,25 +94,15 @@ private: /************************ Inline functions *****************************/ -inline -void LyxArrayBase::Init() -{ - memset(bf, 0, maxsize); - last = 0; -} - inline // Hmmm, Hp-UX's CC can't handle this inline. Asger. void LyxArrayBase::Resize(int newsize) { if (newsize= newsize) last = newsize-1; maxsize = newsize; - memcpy(nwbf, bf, last); - delete[] bf; - bf = nwbf; bf[last] = 0; } @@ -128,33 +110,8 @@ inline LyxArrayBase::LyxArrayBase(int size) { maxsize = (sizename << ' '; } else { - lyxerr << "Illegal symbol code[" << c - << " " << str.end() - s << " " << data.FCode() << "]"; +#warning this does not compile on gcc 2.97 + //lyxerr << "Illegal symbol code[" << c + // << " " << str.end() - s << " " << data.FCode() << "]"; } } else { // Is there a standard logical XOR? -- 2.39.2