Package: robotour Severity: normal Tags: patch When building 'robotour' on amd64 with gcc-4.0, I get the following error:
rtcollect.templ.cpp: In member function 'void lrt::Vector<T>::insert(T, int)': rtcollect.templ.cpp:232: error: 'len' was not declared in this scope rtcollect.templ.cpp: In member function 'void lrt::Vector<T>::remove(int)': rtcollect.templ.cpp:238: error: 'len' was not declared in this scope rtcollect.templ.cpp: In member function 'void lrt::Vector<T>::remove(int, int)': rtcollect.templ.cpp:244: error: 'len' was not declared in this scope rtcollect.templ.cpp: In member function 'void lrt::Vector<T>::clear()': rtcollect.templ.cpp:250: error: 'len' was not declared in this scope rtcollect.templ.cpp: In member function 'int lrt::Vector<T>::check(int)': rtcollect.templ.cpp:268: error: 'len' was not declared in this scope rtcollect.templ.cpp:277: error: 'len' was not declared in this scope rtcollect.templ.cpp:278: error: 'data' was not declared in this scope rtcollect.templ.cpp:279: error: 'data' was not declared in this scope make[3]: *** [rtsystem.o] Error 1 make[3]: Leaving directory `/robotour-3.1.0/libRT' With the attached patch 'robotour' can be compiled on amd64 using gcc-4.0. Regards Andreas Jochens diff -urN ../tmp-orig/robotour-3.1.0/libRT/rtcollect.special.h ./libRT/rtcollect.special.h --- ../tmp-orig/robotour-3.1.0/libRT/rtcollect.special.h 2004-02-19 19:13:02.000000000 +0000 +++ ./libRT/rtcollect.special.h 2005-02-26 14:18:35.000000000 +0000 @@ -85,7 +85,7 @@ inline T** const getData() const { return (T**) Array<void*>::getData(); } inline void exchange(int p1, int p2) { Array<void*>::exchange(p1, p2); } // inline void sort() { Array<void*>::sort(p1, p2); } - inline void reverse() { Array<void*>::reverse(p1, p2); } + inline void reverse() { Array<void*>::reverse(this->p1, this->p2); } // inline void sort(int (*compareFun)(const T&, const T&), int l = 0, int r = Math::MAX_INT) { Array<void*>::sort((voidPtrCompareFunction)compareFun, l, r); } protected: @@ -112,8 +112,8 @@ inline const T** getData() const { return (T**) Vector<void*>::getData(); } inline void exchange(int p1, int p2) { Vector<void*>::exchange(p1, p2); } -// inline void sort() { Vector<void*>::sort(p1, p2); } - inline void reverse() { Vector<void*>::reverse(p1, p2); } +// inline void sort() { Vector<void*>::sort(this->p1, this->p2); } + inline void reverse() { Vector<void*>::reverse(this->p1, this->p2); } // inline void sort(int (*compareFun)(const T&, const T&), int l = 0, int r = Math::MAX_INT) { Vector<void*>::sort((voidPtrCompareFunction)compareFun, l, r); } inline void insert(T* elem, int before) { Vector<void*>::insert((void*) elem, before); } diff -urN ../tmp-orig/robotour-3.1.0/libRT/rtcollect.templ.cpp ./libRT/rtcollect.templ.cpp --- ../tmp-orig/robotour-3.1.0/libRT/rtcollect.templ.cpp 2003-12-05 17:10:38.000000000 +0000 +++ ./libRT/rtcollect.templ.cpp 2005-02-26 14:32:03.252736311 +0000 @@ -184,70 +184,70 @@ template<class T> Vector<T>::Vector(int length) : Array<T>(up2pow(length)) { - capacity = len; - len = length; + capacity = this->len; + this->len = length; } template<class T> Vector<T>::Vector(const Vector<T>& vect) : Array<T>(vect.capacity) { - capacity = len; - len = vect.len; + capacity = this->len; + this->len = vect.len; copy(&vect, 0, this, 0, vect.len); } template<class T> const T& Vector<T>::operator[](int i) const { - return data[checkConst(i)]; + return this->data[this->checkConst(i)]; } template<class T> T& Vector<T>::operator[](int i) { - T& ret = data[check(i)]; - if(len <= i) - len = i+1; + T& ret = this->data[check(i)]; + if(this->len <= i) + this->len = i+1; return ret; } template<class T> Vector<T>& Vector<T>::operator= (const Vector<T>& arr) { copy(&arr, 0, this, 0, arr.len); - len = arr.len; + this->len = arr.len; return *this; } template<class T> Vector<T>& Vector<T>::operator +=(const T &elem) { - (*this)[len] = elem; + (*this)[this->len] = elem; return *this; } template<class T> Vector<T>& Vector<T>::operator += (const Array<T> &arr) { - copy(&arr, 0, this, len, arr.length()); + copy(&arr, 0, this, this->len, arr.length()); return *this; } template<class T> void Vector<T>::insert(T elem, int before) { - copy(this, before, this, before + 1, len - before); + copy(this, before, this, before + 1, this->len - before); (*this)[before] = elem; } template<class T> void Vector<T>::remove(int pos) { - copy(this, pos + 1, this, pos, len - (pos + 1)); - len--; + copy(this, pos + 1, this, pos, this->len - (pos + 1)); + this->len--; } template<class T> void Vector<T>::remove(int start, int length) { - copy(this, start + length, this, start, len - (start + length)); - len -= length; + copy(this, start + length, this, start, this->len - (start + length)); + this->len -= length; } template<class T> void Vector<T>::clear() { - len = 0; + this->len = 0; } template<class T> inline int Vector<T>::up2pow(int val) @@ -265,7 +265,7 @@ String err = "Vector Index out of bounds: "; err += i; err += " > "; - err += len; + err += this->len; System::exit(-1, err); } #endif @@ -274,10 +274,10 @@ // need growing int newcap = up2pow(i+1); T* newdata = new T[newcap]; - for(int j = 0; j < len; j++) - newdata[j] = data[j]; - delete [] data; - data = newdata; + for(int j = 0; j < this->len; j++) + newdata[j] = this->data[j]; + delete [] this->data; + this->data = newdata; capacity = newcap; return i; } diff -urN ../tmp-orig/robotour-3.1.0/libRT/rtmap.h ./libRT/rtmap.h --- ../tmp-orig/robotour-3.1.0/libRT/rtmap.h 2003-05-31 16:09:56.000000000 +0000 +++ ./libRT/rtmap.h 2005-02-26 14:31:34.354314240 +0000 @@ -145,7 +145,7 @@ StringMap(bool caseSensitive) : Map<String,V>(&String::compare) { - if(!caseSensitive) compareFun = &String::compareIgnoreCase; + if(!caseSensitive) this->compareFun = &String::compareIgnoreCase; } /** Creates a new StringMap, copying all the contents over from the given map. */ StringMap(const StringMap& sm) : Map<String,V>(sm) {} -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]