X-Git-Url: https://www.ginac.de/CLN/cln.git//cln.git?a=blobdiff_plain;f=include%2Fcln%2FGV.h;h=338edfa27300bc4900c1e606d0609f0baf111280;hb=e47b7b1880e8a0688cdad03ea5e449476bca38ca;hp=d1f537731e52f45a339745e735c1f7f6f1f8c5eb;hpb=2ed9ef84d30ffdf94987425843f1f47bbbe6f1fa;p=cln.git diff --git a/include/cln/GV.h b/include/cln/GV.h index d1f5377..338edfa 100644 --- a/include/cln/GV.h +++ b/include/cln/GV.h @@ -7,6 +7,7 @@ #include "cln/V.h" #include "cln/exception.h" #include +#include namespace cln { @@ -25,9 +26,9 @@ template struct cl_GV_vectorops; template class cl_GV_inner { protected: - uintC len; // number of elements + std::size_t len; // number of elements public: - uintC size() const; // number of elements + std::size_t size() 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,7 +40,7 @@ public: const cl_GV_constindex operator[] (int index) const; public: /* ugh */ // Constructor. - cl_GV_inner (uintC l, cl_GV_vectorops* ops) : len (l), vectorops (ops) {} + cl_GV_inner (std::size_t l, cl_GV_vectorops* ops) : len (l), vectorops (ops) {} public: // Destructor. ~cl_GV_inner (); @@ -63,10 +64,10 @@ class cl_GV_index { // through []. public: cl_GV_inner* vec; - uintC index; + std::size_t index; operator T () const; // Constructor: - cl_GV_index (cl_GV_inner* v, uintC i) : vec (v), index (i) {} + cl_GV_index (cl_GV_inner* v, std::size_t 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 +89,10 @@ class cl_GV_constindex { // through []. It lacks the assignment operator. public: const cl_GV_inner* vec; - uintC index; + std::size_t index; operator T () const; // Constructor: - cl_GV_constindex (const cl_GV_inner* v, uintC i) : vec (v), index (i) {} + cl_GV_constindex (const cl_GV_inner* v, std::size_t i) : vec (v), index (i) {} private: // No default constructor, assignment operator. cl_GV_constindex (); @@ -100,16 +101,16 @@ private: template struct cl_GV_vectorops { - const T (*element) (const cl_GV_inner* vec, uintC index); - void (*set_element) (cl_GV_inner* vec, uintC index, const T& x); + const T (*element) (const cl_GV_inner* vec, std::size_t index); + void (*set_element) (cl_GV_inner* vec, std::size_t index, const T& x); void (*do_delete) (cl_GV_inner* vec); - void (*copy_elements) (const cl_GV_inner* srcvec, uintC srcindex, cl_GV_inner* destvec, uintC destindex, uintC count); + void (*copy_elements) (const cl_GV_inner* srcvec, std::size_t srcindex, cl_GV_inner* destvec, std::size_t destindex, std::size_t count); }; // All member functions are inline. template -inline uintC cl_GV_inner::size() const +inline std::size_t cl_GV_inner::size() const { return len; } @@ -219,7 +220,7 @@ template struct cl_GV : public BASE { public: // Length. - uintC size() const + std::size_t size() const { return ((const cl_heap_GV *) this->pointer)->v.size(); } @@ -250,7 +251,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, uintC srcindex, cl_GV& dest, uintC destindex, uintC count) + static void copy_elements (const cl_GV& src, std::size_t srcindex, cl_GV& dest, std::size_t destindex, std::size_t count) { const cl_heap_GV * hsrc = (const cl_heap_GV *) src.pointer; cl_heap_GV * hdest = (cl_heap_GV *) dest.pointer;