Hello,

On 05-Aug-25 11:46, Andrew Pollock wrote:
> [EMAIL PROTECTED]:~/debian/qa/robotour-3.1.1$ patch -p0 --dry-run < 
> /tmp/robotour.patch
> patching file ./libRT/rtcollect.special.h
> Hunk #1 succeeded at 100 (offset 15 lines).
> Hunk #2 succeeded at 127 (offset 15 lines).
> patching file ./libRT/rtcollect.templ.cpp
> Hunk #1 FAILED at 184.
> Hunk #2 FAILED at 265.
> Hunk #3 FAILED at 274.
> 3 out of 3 hunks FAILED -- saving rejects to file
> ./libRT/rtcollect.templ.cpp.rej
> patching file ./libRT/rtmap.h
> Hunk #1 FAILED at 145.
> 1 out of 1 hunk FAILED -- saving rejects to file ./libRT/rtmap.h.rej

I guess this is because the package uses some CRLFs as line separations
("DOS format").

> I'll defer making the upload at this time to give you some time to refine
> the patch.

The attached new patch should work.

Regards
Andreas Jochens
diff -urN ../tmp-orig/robotour-3.1.1/libRT/rtcollect.special.h 
./libRT/rtcollect.special.h
--- ../tmp-orig/robotour-3.1.1/libRT/rtcollect.special.h        2004-09-02 
17:11:36.000000000 +0000
+++ ./libRT/rtcollect.special.h 2005-08-25 07:45:46.000000000 +0000
@@ -99,8 +99,8 @@
    int indexOf(const T& elem, int pos = 0) const;
    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 sort() { Array<void*>::sort(this->p1, this->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:
@@ -127,8 +127,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.1/libRT/rtcollect.templ.cpp 
./libRT/rtcollect.templ.cpp
--- ../tmp-orig/robotour-3.1.1/libRT/rtcollect.templ.cpp        2004-09-02 
17:11:34.000000000 +0000
+++ ./libRT/rtcollect.templ.cpp 2005-08-25 07:44:29.000000000 +0000
@@ -199,70 +199,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)
@@ -280,7 +280,7 @@
           String err = "Vector Index out of bounds: ";
           err += i;
           err += " > ";
-          err += len;
+          err += this->len;
           System::exit(-1, err);
        }
 #endif
@@ -289,10 +289,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.1/libRT/rtmap.h ./libRT/rtmap.h
--- ../tmp-orig/robotour-3.1.1/libRT/rtmap.h    2004-09-02 17:11:36.000000000 
+0000
+++ ./libRT/rtmap.h     2005-08-25 07:46:13.000000000 +0000
@@ -159,7 +159,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) {}

Reply via email to