X-Git-Url: https://ginac.de/CLN/cln.git//cln.git?a=blobdiff_plain;ds=sidebyside;f=include%2Fcln%2FGV.h;h=e0d6d98e8ea9b4261c2e40055178680289adf00c;hb=c84c6db5d56829d69083c819688a973867694a2a;hp=6616c52e4317c4778f38586f205eb7199f852538;hpb=850abfde7f0d985ba01526c346bcd0d733562943;p=cln.git diff --git a/include/cln/GV.h b/include/cln/GV.h index 6616c52..e0d6d98 100644 --- a/include/cln/GV.h +++ b/include/cln/GV.h @@ -6,7 +6,7 @@ #include "cln/object.h" #include "cln/V.h" #include "cln/abort.h" -#include +#include namespace cln { @@ -25,9 +25,9 @@ template struct cl_GV_vectorops; template class cl_GV_inner { protected: - uintL len; // number of elements + uintC len; // number of elements public: - uintL length () const; // number of elements + uintC length () const; // number of elements cl_GV_vectorops* vectorops; // get/set element const cl_GV_index operator[] (unsigned long index); const cl_GV_constindex operator[] (unsigned long index) const; @@ -39,12 +39,12 @@ public: const cl_GV_constindex operator[] (int index) const; public: /* ugh */ // Constructor. - cl_GV_inner (uintL l, cl_GV_vectorops* ops) : len (l), vectorops (ops) {} + cl_GV_inner (uintC l, cl_GV_vectorops* ops) : len (l), vectorops (ops) {} public: // Destructor. ~cl_GV_inner (); // Ability to place an object at a given address. - void* operator new (size_t size, cl_GV_inner* ptr) { (void)size; return ptr; } + void* operator new (size_t size, void* ptr) { (void)size; return ptr; } private: // No default constructor, copy constructor, assignment operator, new. cl_GV_inner (); @@ -63,10 +63,10 @@ class cl_GV_index { // through []. public: cl_GV_inner* vec; - uintL index; + uintC index; operator T () const; // Constructor: - cl_GV_index (cl_GV_inner* v, uintL i) : vec (v), index (i) {} + cl_GV_index (cl_GV_inner* v, uintC i) : vec (v), index (i) {} // Assignment operator. void operator= (const T& x) const; #if (defined(__sparc__) || defined(__sparc64__) || defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // maybe an SGI CC and Sun CC bug? @@ -88,10 +88,10 @@ class cl_GV_constindex { // through []. It lacks the assignment operator. public: const cl_GV_inner* vec; - uintL index; + uintC index; operator T () const; // Constructor: - cl_GV_constindex (const cl_GV_inner* v, uintL i) : vec (v), index (i) {} + cl_GV_constindex (const cl_GV_inner* v, uintC i) : vec (v), index (i) {} private: // No default constructor, assignment operator. cl_GV_constindex (); @@ -100,16 +100,16 @@ private: template struct cl_GV_vectorops { - const T (*element) (const cl_GV_inner* vec, uintL index); - void (*set_element) (cl_GV_inner* vec, uintL index, const T& x); + const T (*element) (const cl_GV_inner* vec, uintC index); + void (*set_element) (cl_GV_inner* vec, uintC index, const T& x); void (*do_delete) (cl_GV_inner* vec); - void (*copy_elements) (const cl_GV_inner* srcvec, uintL srcindex, cl_GV_inner* destvec, uintL destindex, uintL count); + void (*copy_elements) (const cl_GV_inner* srcvec, uintC srcindex, cl_GV_inner* destvec, uintC destindex, uintC count); }; // All member functions are inline. template -inline uintL cl_GV_inner::length () const +inline uintC cl_GV_inner::length () const { return len; } @@ -219,18 +219,18 @@ template struct cl_GV : public BASE { public: // Length. - uintL length () const + uintC length () const { - return ((const cl_heap_GV *) pointer)->v.length(); + return ((const cl_heap_GV *) this->pointer)->v.length(); } // Reference. Forbid modification of `const cl_GV&' arguments. const cl_GV_constindex operator[] (unsigned long index) const { - return ((const cl_heap_GV *) pointer)->v[index]; + return ((const cl_heap_GV *) this->pointer)->v[index]; } const cl_GV_index operator[] (unsigned long index) { - return ((cl_heap_GV *) pointer)->v[index]; + return ((cl_heap_GV *) this->pointer)->v[index]; } const cl_GV_constindex operator[] (long index) const { return operator[]((unsigned long)index); } @@ -250,7 +250,7 @@ public: cl_GV& operator= (const cl_GV&); // Copy a piece of a vector into another vector. // (Both vectors must be of the same type. Overlapping not allowed.) - static void copy_elements (const cl_GV& src, uintL srcindex, cl_GV& dest, uintL destindex, uintL count) + static void copy_elements (const cl_GV& src, uintC srcindex, cl_GV& dest, uintC destindex, uintC count) { const cl_heap_GV * hsrc = (const cl_heap_GV *) src.pointer; cl_heap_GV * hdest = (cl_heap_GV *) dest.pointer; @@ -277,7 +277,7 @@ template template inline CL_GV(T,BASE)::operator cl_heap_GV* () const { - cl_heap_GV* hpointer = (cl_heap_GV*)pointer; + cl_heap_GV* hpointer = (cl_heap_GV*)this->pointer; cl_inc_refcount(*this); return hpointer; }