Browse Source

cl_{GV,SV}: use std::size_t for size of vectors (instead of obscure uintC).

master
Alexei Sheplyakov 16 years ago
parent
commit
e47b7b1880
  1. 27
      include/cln/GV.h
  2. 4
      include/cln/GV_complex.h
  3. 12
      include/cln/GV_integer.h
  4. 4
      include/cln/GV_modinteger.h
  5. 6
      include/cln/GV_number.h
  6. 4
      include/cln/GV_rational.h
  7. 4
      include/cln/GV_real.h
  8. 11
      include/cln/SV.h
  9. 2
      include/cln/SV_complex.h
  10. 2
      include/cln/SV_integer.h
  11. 8
      include/cln/SV_number.h
  12. 2
      include/cln/SV_rational.h
  13. 2
      include/cln/SV_real.h
  14. 8
      include/cln/SV_ringelt.h
  15. 118
      src/vector/cl_GV_I.cc
  16. 6
      src/vector/cl_GV_I_copy.cc
  17. 28
      src/vector/cl_GV_number.cc
  18. 6
      src/vector/cl_GV_number_copy.cc
  19. 6
      src/vector/cl_SV_copy.cc
  20. 12
      src/vector/cl_SV_number.cc
  21. 12
      src/vector/cl_SV_ringelt.cc
  22. 4
      src/vector/output/cl_GV_number_aprint.cc
  23. 6
      src/vector/output/cl_SV_aprint.cc
  24. 4
      src/vector/output/cl_SV_number_aprint.cc

27
include/cln/GV.h

@ -7,6 +7,7 @@
#include "cln/V.h"
#include "cln/exception.h"
#include <cstdlib>
#include <cstddef>
namespace cln {
@ -25,9 +26,9 @@ template <class T> struct cl_GV_vectorops;
template <class T>
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<T>* vectorops; // get/set element
const cl_GV_index<T> operator[] (unsigned long index);
const cl_GV_constindex<T> operator[] (unsigned long index) const;
@ -39,7 +40,7 @@ public:
const cl_GV_constindex<T> operator[] (int index) const;
public: /* ugh */
// Constructor.
cl_GV_inner (uintC l, cl_GV_vectorops<T>* ops) : len (l), vectorops (ops) {}
cl_GV_inner (std::size_t l, cl_GV_vectorops<T>* ops) : len (l), vectorops (ops) {}
public:
// Destructor.
~cl_GV_inner ();
@ -63,10 +64,10 @@ class cl_GV_index {
// through [].
public:
cl_GV_inner<T>* vec;
uintC index;
std::size_t index;
operator T () const;
// Constructor:
cl_GV_index (cl_GV_inner<T>* v, uintC i) : vec (v), index (i) {}
cl_GV_index (cl_GV_inner<T>* 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<T>* vec;
uintC index;
std::size_t index;
operator T () const;
// Constructor:
cl_GV_constindex (const cl_GV_inner<T>* v, uintC i) : vec (v), index (i) {}
cl_GV_constindex (const cl_GV_inner<T>* v, std::size_t i) : vec (v), index (i) {}
private:
// No default constructor, assignment operator.
cl_GV_constindex ();
@ -100,16 +101,16 @@ private:
template <class T>
struct cl_GV_vectorops {
const T (*element) (const cl_GV_inner<T>* vec, uintC index);
void (*set_element) (cl_GV_inner<T>* vec, uintC index, const T& x);
const T (*element) (const cl_GV_inner<T>* vec, std::size_t index);
void (*set_element) (cl_GV_inner<T>* vec, std::size_t index, const T& x);
void (*do_delete) (cl_GV_inner<T>* vec);
void (*copy_elements) (const cl_GV_inner<T>* srcvec, uintC srcindex, cl_GV_inner<T>* destvec, uintC destindex, uintC count);
void (*copy_elements) (const cl_GV_inner<T>* srcvec, std::size_t srcindex, cl_GV_inner<T>* destvec, std::size_t destindex, std::size_t count);
};
// All member functions are inline.
template <class T>
inline uintC cl_GV_inner<T>::size() const
inline std::size_t cl_GV_inner<T>::size() const
{
return len;
}
@ -219,7 +220,7 @@ template <class T, class BASE>
struct cl_GV : public BASE {
public:
// Length.
uintC size() const
std::size_t size() const
{
return ((const cl_heap_GV<T> *) 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<T> * hsrc = (const cl_heap_GV<T> *) src.pointer;
cl_heap_GV<T> * hdest = (cl_heap_GV<T> *) dest.pointer;

4
include/cln/GV_complex.h

@ -19,7 +19,7 @@ public:
// Constructors.
cl_GV_N ();
cl_GV_N (const cl_GV_N&);
explicit cl_GV_N (uintC len);
explicit cl_GV_N (std::size_t len);
// Assignment operators.
cl_GV_N& operator= (const cl_GV_N&);
// Private pointer manipulations.
@ -28,7 +28,7 @@ public:
};
inline cl_GV_N::cl_GV_N (const cl_GV_N& x) : cl_GV<cl_N,cl_GV_number> (as_cl_private_thing(x)) {}
CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_N,cl_GV_N)
inline cl_GV_N::cl_GV_N (uintC len)
inline cl_GV_N::cl_GV_N (std::size_t len)
: cl_GV<cl_N,cl_GV_number> ((cl_heap_GV_N*) cl_make_heap_GV_number(len)) {}
inline cl_GV_N::cl_GV_N ()
: cl_GV<cl_N,cl_GV_number> ((cl_heap_GV_N*) (cl_heap_GV_number*) cl_null_GV_number) {}

12
include/cln/GV_integer.h

@ -27,9 +27,9 @@ public:
cl_GV_I ();
cl_GV_I (const cl_GV_I&);
// Create a vector of unconstrained integers.
explicit cl_GV_I (uintC len);
explicit cl_GV_I (std::size_t len);
// Create a vector of m-bit integers (>=0, <2^m).
cl_GV_I (uintC len, sintC m);
cl_GV_I (std::size_t len, sintC m);
// Assignment operators.
cl_GV_I& operator= (const cl_GV_I&);
// Number m of bits allowed per element (-1 if unconstrained).
@ -43,11 +43,11 @@ public:
};
inline cl_GV_I::cl_GV_I (const cl_GV_I& x) : cl_GV<cl_I,cl_GV_RA> (as_cl_private_thing(x)) {}
CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_I,cl_GV_I)
extern cl_heap_GV_I* cl_make_heap_GV_I (uintC len);
inline cl_GV_I::cl_GV_I (uintC len)
extern cl_heap_GV_I* cl_make_heap_GV_I (std::size_t len);
inline cl_GV_I::cl_GV_I (std::size_t len)
: cl_GV<cl_I,cl_GV_RA> (cl_make_heap_GV_I(len)) {}
extern cl_heap_GV_I* cl_make_heap_GV_I (uintC len, sintC m);
inline cl_GV_I::cl_GV_I (uintC len, sintC m)
extern cl_heap_GV_I* cl_make_heap_GV_I (std::size_t len, sintC m);
inline cl_GV_I::cl_GV_I (std::size_t len, sintC m)
: cl_GV<cl_I,cl_GV_RA> (cl_make_heap_GV_I(len,m)) {}
// Private pointer manipulations. Never throw away a `struct cl_heap_GV_I *'!

4
include/cln/GV_modinteger.h

@ -24,7 +24,7 @@ public:
cl_GV_MI ();
cl_GV_MI (const cl_GV_MI&);
// Create a vector of modular integers.
cl_GV_MI (uintC len, cl_heap_modint_ring* R);
cl_GV_MI (std::size_t len, cl_heap_modint_ring* R);
// Assignment operators.
cl_GV_MI& operator= (const cl_GV_MI&);
// Number m of bits allowed per element (-1 if unconstrained).
@ -37,7 +37,7 @@ inline cl_GV_MI::cl_GV_MI (const cl_GV_MI& x) : cl_GV<_cl_MI,cl_GV_any> (as_cl_p
CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_MI,cl_GV_MI)
inline cl_GV_MI::cl_GV_MI ()
: cl_GV<_cl_MI,cl_GV_any> ((cl_heap_GV_MI*) (cl_heap_GV_I*) cl_null_GV_I) {}
inline cl_GV_MI::cl_GV_MI (uintC len, cl_heap_modint_ring* R)
inline cl_GV_MI::cl_GV_MI (std::size_t len, cl_heap_modint_ring* R)
: cl_GV<_cl_MI,cl_GV_any> ((cl_heap_GV_MI*) cl_make_heap_GV_I(len,R->bits)) {}
// Copy a vector.

6
include/cln/GV_number.h

@ -15,7 +15,7 @@ public:
// Constructors.
cl_GV_number ();
cl_GV_number (const cl_GV_number&);
explicit cl_GV_number (uintC len);
explicit cl_GV_number (std::size_t len);
// Assignment operators.
cl_GV_number& operator= (const cl_GV_number&);
// Private pointer manipulations.
@ -24,8 +24,8 @@ public:
};
inline cl_GV_number::cl_GV_number (const cl_GV_number& x) : cl_GV<cl_number,cl_GV_any> (as_cl_private_thing(x)) {}
CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_number,cl_GV_number)
extern cl_heap_GV_number* cl_make_heap_GV_number (uintC len);
inline cl_GV_number::cl_GV_number (uintC len)
extern cl_heap_GV_number* cl_make_heap_GV_number (std::size_t len);
inline cl_GV_number::cl_GV_number (std::size_t len)
: cl_GV<cl_number,cl_GV_any> (cl_make_heap_GV_number(len)) {}
// Private pointer manipulations. Never throw away a `struct cl_heap_GV_number *'!

4
include/cln/GV_rational.h

@ -19,7 +19,7 @@ public:
// Constructors.
cl_GV_RA ();
cl_GV_RA (const cl_GV_RA&);
explicit cl_GV_RA (uintC len);
explicit cl_GV_RA (std::size_t len);
// Assignment operators.
cl_GV_RA& operator= (const cl_GV_RA&);
// Private pointer manipulations.
@ -28,7 +28,7 @@ public:
};
inline cl_GV_RA::cl_GV_RA (const cl_GV_RA& x) : cl_GV<cl_RA,cl_GV_R> (as_cl_private_thing(x)) {}
CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_RA,cl_GV_RA)
inline cl_GV_RA::cl_GV_RA (uintC len)
inline cl_GV_RA::cl_GV_RA (std::size_t len)
: cl_GV<cl_RA,cl_GV_R> ((cl_heap_GV_RA*) cl_make_heap_GV_number(len)) {}
inline cl_GV_RA::cl_GV_RA ()
: cl_GV<cl_RA,cl_GV_R> ((cl_heap_GV_RA*) (cl_heap_GV_number*) cl_null_GV_number) {}

4
include/cln/GV_real.h

@ -19,7 +19,7 @@ public:
// Constructors.
cl_GV_R ();
cl_GV_R (const cl_GV_R&);
explicit cl_GV_R (uintC len);
explicit cl_GV_R (std::size_t len);
// Assignment operators.
cl_GV_R& operator= (const cl_GV_R&);
// Private pointer manipulations.
@ -28,7 +28,7 @@ public:
};
inline cl_GV_R::cl_GV_R (const cl_GV_R& x) : cl_GV<cl_R,cl_GV_N> (as_cl_private_thing(x)) {}
CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_R,cl_GV_R)
inline cl_GV_R::cl_GV_R (uintC len)
inline cl_GV_R::cl_GV_R (std::size_t len)
: cl_GV<cl_R,cl_GV_N> ((cl_heap_GV_R*) cl_make_heap_GV_number(len)) {}
inline cl_GV_R::cl_GV_R ()
: cl_GV<cl_R,cl_GV_N> ((cl_heap_GV_R*) (cl_heap_GV_number*) cl_null_GV_number) {}

11
include/cln/SV.h

@ -7,6 +7,7 @@
#include "cln/V.h"
#include "cln/exception.h"
#include <cstdlib>
#include <cstddef>
namespace cln {
@ -40,13 +41,13 @@ template <class T> class cl_SV_inner;
template <class T>
class cl_SV_inner {
protected:
uintC len; // number of elements
std::size_t len; // number of elements
private:
// T data[]; // the elements
T * data() { return (T *) (this+1); }
const T * data() const { return (const T *) (this+1); }
public:
uintC size() const { return len; } // number of elements
std::size_t size() const { return len; } // number of elements
const T & operator[] (unsigned long index) const
{
#ifndef CL_SV_NO_RANGECHECKS
@ -76,7 +77,7 @@ public:
{ return operator[]((unsigned long)index); }
public: /* ugh */
// Constructor.
cl_SV_inner (uintC l) : len (l) {}
cl_SV_inner (std::size_t l) : len (l) {}
public:
// Destructor.
~cl_SV_inner ();
@ -95,7 +96,7 @@ private:
template <class T>
inline cl_SV_inner<T>::~cl_SV_inner ()
{
uintC i = len;
std::size_t i = len;
while (i > 0) {
i--;
data()[i].~T();
@ -115,7 +116,7 @@ template <class T, class BASE>
struct cl_SV : public BASE {
public:
// Length.
uintC size() const
std::size_t size() const
{
return ((const cl_heap_SV<T> *) this->pointer)->v.size();
}

2
include/cln/SV_complex.h

@ -19,7 +19,7 @@ public:
// Constructors.
cl_SV_N () : cl_SV<cl_N,cl_SV_number> ((cl_heap_SV_N*) (cl_heap_SV_number*) cl_null_SV_number) {};
cl_SV_N (const cl_SV_N&);
explicit cl_SV_N (uintC len) : cl_SV<cl_N,cl_SV_number> ((cl_heap_SV_N*) cl_make_heap_SV_number(len)) {};
explicit cl_SV_N (std::size_t len) : cl_SV<cl_N,cl_SV_number> ((cl_heap_SV_N*) cl_make_heap_SV_number(len)) {};
// Assignment operators.
cl_SV_N& operator= (const cl_SV_N&);
// Private pointer manipulations.

2
include/cln/SV_integer.h

@ -19,7 +19,7 @@ public:
// Constructors.
cl_SV_I () : cl_SV<cl_I,cl_SV_RA> ((cl_heap_SV_I*) (cl_heap_SV_number*) cl_null_SV_number) {};
cl_SV_I (const cl_SV_I&);
explicit cl_SV_I (uintC len) : cl_SV<cl_I,cl_SV_RA> ((cl_heap_SV_I*) cl_make_heap_SV_number(len)) {};
explicit cl_SV_I (std::size_t len) : cl_SV<cl_I,cl_SV_RA> ((cl_heap_SV_I*) cl_make_heap_SV_number(len)) {};
// Assignment operators.
cl_SV_I& operator= (const cl_SV_I&);
};

8
include/cln/SV_number.h

@ -16,7 +16,7 @@ public:
// Constructors.
cl_SV_number ();
cl_SV_number (const cl_SV_number&);
explicit cl_SV_number (uintC len);
explicit cl_SV_number (std::size_t len);
// Assignment operators.
cl_SV_number& operator= (const cl_SV_number&);
// Private pointer manipulations.
@ -27,10 +27,10 @@ public:
inline cl_SV_number::cl_SV_number (const cl_SV_number& x) : cl_SV<cl_number,cl_SV_any> (as_cl_private_thing(x)) {}
CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SV_number,cl_SV_number)
// Returns a new simple vector with uninitialized contents.
extern cl_heap_SV_number* cl_make_heap_SV_number_uninit (uintC len);
extern cl_heap_SV_number* cl_make_heap_SV_number_uninit (std::size_t len);
// Returns a new simple vector with all elements initialized to 0.
extern cl_heap_SV_number* cl_make_heap_SV_number (uintC len);
inline cl_SV_number::cl_SV_number (uintC len)
extern cl_heap_SV_number* cl_make_heap_SV_number (std::size_t len);
inline cl_SV_number::cl_SV_number (std::size_t len)
: cl_SV<cl_number,cl_SV_any> (cl_make_heap_SV_number(len)) {}
// Private pointer manipulations. Never throw away a `struct cl_heap_SV_number *'!

2
include/cln/SV_rational.h

@ -19,7 +19,7 @@ public:
// Constructors.
cl_SV_RA () : cl_SV<cl_RA,cl_SV_R> ((cl_heap_SV_RA*) (cl_heap_SV_number*) cl_null_SV_number) {};
cl_SV_RA (const cl_SV_RA&);
explicit cl_SV_RA (uintC len) : cl_SV<cl_RA,cl_SV_R> ((cl_heap_SV_RA*) cl_make_heap_SV_number(len)) {};
explicit cl_SV_RA (std::size_t len) : cl_SV<cl_RA,cl_SV_R> ((cl_heap_SV_RA*) cl_make_heap_SV_number(len)) {};
// Assignment operators.
cl_SV_RA& operator= (const cl_SV_RA&);
// Private pointer manipulations.

2
include/cln/SV_real.h

@ -19,7 +19,7 @@ public:
// Constructors.
cl_SV_R () : cl_SV<cl_R,cl_SV_N> ((cl_heap_SV_R*) (cl_heap_SV_number*) cl_null_SV_number) {};
cl_SV_R (const cl_SV_R&);
explicit cl_SV_R (uintC len) : cl_SV<cl_R,cl_SV_N> ((cl_heap_SV_R*) cl_make_heap_SV_number(len)) {};
explicit cl_SV_R (std::size_t len) : cl_SV<cl_R,cl_SV_N> ((cl_heap_SV_R*) cl_make_heap_SV_number(len)) {};
// Assignment operators.
cl_SV_R& operator= (const cl_SV_R&);
// Private pointer manipulations.

8
include/cln/SV_ringelt.h

@ -16,7 +16,7 @@ public:
// Constructors.
cl_SV_ringelt ();
cl_SV_ringelt (const cl_SV_ringelt&);
explicit cl_SV_ringelt (uintC len);
explicit cl_SV_ringelt (std::size_t len);
// Assignment operators.
cl_SV_ringelt& operator= (const cl_SV_ringelt&);
// Private pointer manipulations.
@ -27,10 +27,10 @@ public:
inline cl_SV_ringelt::cl_SV_ringelt (const cl_SV_ringelt& x) : cl_SV<_cl_ring_element,cl_SV_any> (as_cl_private_thing(x)) {}
CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SV_ringelt,cl_SV_ringelt)
// Returns a new simple vector with uninitialized contents.
extern cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (uintC len);
extern cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (std::size_t len);
// Returns a new simple vector with all elements initialized to some value.
extern cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (uintC len);
inline cl_SV_ringelt::cl_SV_ringelt (uintC len)
extern cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (std::size_t len);
inline cl_SV_ringelt::cl_SV_ringelt (std::size_t len)
: cl_SV<_cl_ring_element,cl_SV_any> (cl_make_heap_SV_ringelt(len)) {}
// Private pointer manipulations.

118
src/vector/cl_GV_I.cc

@ -80,33 +80,33 @@ struct cl_heap_GV_I_general : public cl_heap_GV_I {
cl_heap_GV_I_general ();
};
static const cl_I general_element (const cl_GV_inner<cl_I>* vec, uintC index)
static const cl_I general_element (const cl_GV_inner<cl_I>* vec, std::size_t index)
{
return ((const cl_heap_GV_I_general *) outcast(vec))->data[index];
}
static void general_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
static void general_set_element (cl_GV_inner<cl_I>* vec, std::size_t index, const cl_I& x)
{
((cl_heap_GV_I_general *) outcast(vec))->data[index] = x;
}
static void general_do_delete (cl_GV_inner<cl_I>* vec)
{
var cl_heap_GV_I_general* hv = (cl_heap_GV_I_general *) outcast(vec);
var uintC len = hv->v.size();
for (var uintC i = 0; i < len; i++)
cl_heap_GV_I_general* hv = (cl_heap_GV_I_general *) outcast(vec);
std::size_t len = hv->v.size();
for (std::size_t i = 0; i < len; i++)
hv->data[i].~cl_I();
}
static void general_copy_elements (const cl_GV_inner<cl_I>* srcvec, uintC srcindex, cl_GV_inner<cl_I>* destvec, uintC destindex, uintC count)
static void general_copy_elements (const cl_GV_inner<cl_I>* srcvec, std::size_t srcindex, cl_GV_inner<cl_I>* destvec, std::size_t destindex, std::size_t count)
{
if (count > 0) {
var const cl_heap_GV_I_general* srcv =
const cl_heap_GV_I_general* srcv =
(const cl_heap_GV_I_general *) outcast(srcvec);
var cl_heap_GV_I_general* destv =
cl_heap_GV_I_general* destv =
(cl_heap_GV_I_general *) outcast(destvec);
var uintC srclen = srcv->v.size();
var uintC destlen = destv->v.size();
std::size_t srclen = srcv->v.size();
std::size_t destlen = destv->v.size();
if (!(srcindex <= srcindex+count && srcindex+count <= srclen))
throw runtime_exception();
if (!(destindex <= destindex+count && destindex+count <= destlen))
@ -125,13 +125,13 @@ static cl_GV_I_vectorops general_vectorops = {{
-1
};
cl_heap_GV_I* cl_make_heap_GV_I (uintC len)
cl_heap_GV_I* cl_make_heap_GV_I (std::size_t len)
{
var cl_heap_GV_I_general* hv = (cl_heap_GV_I_general*) malloc_hook(offsetofa(cl_heap_GV_I_general,data)+sizeof(cl_I)*len);
cl_heap_GV_I_general* hv = (cl_heap_GV_I_general*) malloc_hook(offsetofa(cl_heap_GV_I_general,data)+sizeof(cl_I)*len);
hv->refcount = 1;
hv->type = &cl_class_gvector_integer();
new (&hv->v) cl_GV_inner<cl_I> (len,&general_vectorops.ops);
for (var uintC i = 0; i < len; i++)
for (std::size_t i = 0; i < len; i++)
init1(cl_I, hv->data[i]) ();
return hv;
}
@ -149,24 +149,24 @@ struct cl_heap_GV_I_bits##m : public cl_heap_GV_I { \
/* No default constructor. */ \
cl_heap_GV_I_bits##m (); \
}; \
static const cl_I bits##m##_element (const cl_GV_inner<cl_I>* vec, uintC index); \
static void bits##m##_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x); \
static void bits##m##_copy_elements (const cl_GV_inner<cl_I>* srcvec, uintC srcindex, cl_GV_inner<cl_I>* destvec, uintC destindex, uintC count) \
static const cl_I bits##m##_element (const cl_GV_inner<cl_I>* vec, std::size_t index); \
static void bits##m##_set_element (cl_GV_inner<cl_I>* vec, std::size_t index, const cl_I& x); \
static void bits##m##_copy_elements (const cl_GV_inner<cl_I>* srcvec, std::size_t srcindex, cl_GV_inner<cl_I>* destvec, std::size_t destindex, std::size_t count) \
{ \
if (count > 0) { \
var const cl_heap_GV_I_bits##m * srcv = \
const cl_heap_GV_I_bits##m * srcv = \
(const cl_heap_GV_I_bits##m *) outcast(srcvec); \
var cl_heap_GV_I_bits##m * destv = \
cl_heap_GV_I_bits##m * destv = \
(cl_heap_GV_I_bits##m *) outcast(destvec); \
var uintC srclen = srcv->v.size(); \
var uintC destlen = destv->v.size(); \
std::size_t srclen = srcv->v.size(); \
std::size_t destlen = destv->v.size(); \
if (!(srcindex <= srcindex+count && srcindex+count <= srclen)) \
throw runtime_exception(); \
if (!(destindex <= destindex+count && destindex+count <= destlen)) \
throw runtime_exception(); \
if (m == intDsize) { \
var const uintD* srcptr = &srcv->data[srcindex]; \
var uintD* destptr = &destv->data[destindex]; \
const uintD* srcptr = &srcv->data[srcindex]; \
uintD* destptr = &destv->data[destindex]; \
do { \
*destptr++ = *srcptr++; \
} while (--count > 0); \
@ -189,7 +189,7 @@ static void bits_do_delete (cl_GV_inner<cl_I>* vec)
// Copy bits srcptr.bits[srcindex..srcindex+count-1] into destptr.bits[destindex..destindex+count-1].
// Assumes that all range checks have already been performed.
static void bits_copy (const uintD* srcptr, uintC srcindex, uintD* destptr, uintC destindex, uintC count)
static void bits_copy (const uintD* srcptr, std::size_t srcindex, uintD* destptr, std::size_t destindex, std::size_t count)
{
srcptr += floor(srcindex,intDsize);
destptr += floor(destindex,intDsize);
@ -209,7 +209,7 @@ static void bits_copy (const uintD* srcptr, uintC srcindex, uintD* destptr, uint
count -= intDsize-srcindex;
}
// Now srcindex and destindex can be assumed to be 0.
var uintC count1 = count%intDsize;
std::size_t count1 = count%intDsize;
count = floor(count,intDsize);
if (count > 0) {
do {
@ -220,8 +220,8 @@ static void bits_copy (const uintD* srcptr, uintC srcindex, uintD* destptr, uint
*destptr ^= (*destptr ^ *srcptr) & (uintD)(bit(count1)-1);
}
} else {
var uintC i = destindex - srcindex;
var uintD tmp;
std::size_t i = destindex - srcindex;
uintD tmp;
if (destindex >= srcindex) { // i > 0
if (count <= intDsize-destindex) {
*destptr ^= (*destptr ^ (*srcptr << i)) & ((uintD)(bit(count)-1) << destindex);
@ -242,9 +242,9 @@ static void bits_copy (const uintD* srcptr, uintC srcindex, uintD* destptr, uint
}
srcptr++;
// tmp now contains the low i bits to be put into *destptr.
var uintC count1 = count%intDsize;
std::size_t count1 = count%intDsize;
count = floor(count,intDsize);
var uintD lastdest;
uintD lastdest;
if (count == 0)
lastdest = tmp;
else {
@ -280,17 +280,17 @@ static void bits_copy (const uintD* srcptr, uintC srcindex, uintD* destptr, uint
DEFINE_cl_heap_GV_I_bits(1,uintD)
static const cl_I bits1_element (const cl_GV_inner<cl_I>* vec, uintC index)
static const cl_I bits1_element (const cl_GV_inner<cl_I>* vec, std::size_t index)
{
return (unsigned int)((((const cl_heap_GV_I_bits1 *) outcast(vec))->data[index/intDsize] >> (index%intDsize)) & 0x1);
}
static void bits1_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
static void bits1_set_element (cl_GV_inner<cl_I>* vec, std::size_t index, const cl_I& x)
{
var uintV xval;
uintV xval;
if (fixnump(x)) {
xval = FN_to_UV(x);
if (xval <= 0x1) {
var uintD* ptr = &((cl_heap_GV_I_bits1 *) outcast(vec))->data[index/intDsize];
uintD* ptr = &((cl_heap_GV_I_bits1 *) outcast(vec))->data[index/intDsize];
index = index%intDsize;
*ptr = *ptr ^ ((*ptr ^ ((uintD)xval << index)) & ((uintD)0x1 << index));
return;
@ -302,17 +302,17 @@ static void bits1_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I&
DEFINE_cl_heap_GV_I_bits(2,uintD)
static const cl_I bits2_element (const cl_GV_inner<cl_I>* vec, uintC index)
static const cl_I bits2_element (const cl_GV_inner<cl_I>* vec, std::size_t index)
{
return (unsigned int)((((const cl_heap_GV_I_bits2 *) outcast(vec))->data[index/(intDsize/2)] >> (2*(index%(intDsize/2)))) & 0x3);
}
static void bits2_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
static void bits2_set_element (cl_GV_inner<cl_I>* vec, std::size_t index, const cl_I& x)
{
var uintV xval;
uintV xval;
if (fixnump(x)) {
xval = FN_to_UV(x);
if (xval <= 0x3) {
var uintD* ptr = &((cl_heap_GV_I_bits2 *) outcast(vec))->data[index/(intDsize/2)];
uintD* ptr = &((cl_heap_GV_I_bits2 *) outcast(vec))->data[index/(intDsize/2)];
index = 2*(index%(intDsize/2));
*ptr = *ptr ^ ((*ptr ^ ((uintD)xval << index)) & ((uintD)0x3 << index));
return;
@ -324,17 +324,17 @@ static void bits2_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I&
DEFINE_cl_heap_GV_I_bits(4,uintD)
static const cl_I bits4_element (const cl_GV_inner<cl_I>* vec, uintC index)
static const cl_I bits4_element (const cl_GV_inner<cl_I>* vec, std::size_t index)
{
return (unsigned int)((((const cl_heap_GV_I_bits4 *) outcast(vec))->data[index/(intDsize/4)] >> (4*(index%(intDsize/4)))) & 0xF);
}
static void bits4_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
static void bits4_set_element (cl_GV_inner<cl_I>* vec, std::size_t index, const cl_I& x)
{
var uintV xval;
uintV xval;
if (fixnump(x)) {
xval = FN_to_UV(x);
if (xval <= 0xF) {
var uintD* ptr = &((cl_heap_GV_I_bits4 *) outcast(vec))->data[index/(intDsize/4)];
uintD* ptr = &((cl_heap_GV_I_bits4 *) outcast(vec))->data[index/(intDsize/4)];
index = 4*(index%(intDsize/4));
*ptr = *ptr ^ ((*ptr ^ ((uintD)xval << index)) & ((uintD)0xF << index));
return;
@ -346,7 +346,7 @@ static void bits4_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I&
DEFINE_cl_heap_GV_I_bits(8,uintD)
static const cl_I bits8_element (const cl_GV_inner<cl_I>* vec, uintC index)
static const cl_I bits8_element (const cl_GV_inner<cl_I>* vec, std::size_t index)
{
#if CL_CPU_BIG_ENDIAN_P
return (unsigned int)((((const cl_heap_GV_I_bits8 *) outcast(vec))->data[index/(intDsize/8)] >> (8*(index%(intDsize/8)))) & 0xFF);
@ -355,14 +355,14 @@ static const cl_I bits8_element (const cl_GV_inner<cl_I>* vec, uintC index)
return (unsigned int)(((uint8*)(((const cl_heap_GV_I_bits8 *) outcast(vec))->data))[index]);
#endif
}
static void bits8_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
static void bits8_set_element (cl_GV_inner<cl_I>* vec, std::size_t index, const cl_I& x)
{
var uintV xval;
uintV xval;
if (fixnump(x)) {
xval = FN_to_UV(x);
if (xval <= 0xFF) {
#if CL_CPU_BIG_ENDIAN_P
var uintD* ptr = &((cl_heap_GV_I_bits8 *) outcast(vec))->data[index/(intDsize/8)];
uintD* ptr = &((cl_heap_GV_I_bits8 *) outcast(vec))->data[index/(intDsize/8)];
index = 8*(index%(intDsize/8));
*ptr = *ptr ^ ((*ptr ^ ((uintD)xval << index)) & ((uintD)0xFF << index));
#else
@ -378,7 +378,7 @@ static void bits8_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I&
DEFINE_cl_heap_GV_I_bits(16,uintD)
static const cl_I bits16_element (const cl_GV_inner<cl_I>* vec, uintC index)
static const cl_I bits16_element (const cl_GV_inner<cl_I>* vec, std::size_t index)
{
#if CL_CPU_BIG_ENDIAN_P
return (unsigned int)((((const cl_heap_GV_I_bits16 *) outcast(vec))->data[index/(intDsize/16)] >> (16*(index%(intDsize/16)))) & 0xFFFF);
@ -387,14 +387,14 @@ static const cl_I bits16_element (const cl_GV_inner<cl_I>* vec, uintC index)
return (unsigned int)(((uint16*)(((const cl_heap_GV_I_bits16 *) outcast(vec))->data))[index]);
#endif
}
static void bits16_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
static void bits16_set_element (cl_GV_inner<cl_I>* vec, std::size_t index, const cl_I& x)
{
var uintV xval;
uintV xval;
if (fixnump(x)) {
xval = FN_to_UV(x);
if (xval <= 0xFFFF) {
#if CL_CPU_BIG_ENDIAN_P
var uintD* ptr = &((cl_heap_GV_I_bits16 *) outcast(vec))->data[index/(intDsize/16)];
uintD* ptr = &((cl_heap_GV_I_bits16 *) outcast(vec))->data[index/(intDsize/16)];
index = 16*(index%(intDsize/16));
*ptr = *ptr ^ ((*ptr ^ ((uintD)xval << index)) & ((uintD)0xFFFF << index));
#else
@ -410,7 +410,7 @@ static void bits16_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I&
DEFINE_cl_heap_GV_I_bits(32,uintD)
static const cl_I bits32_element (const cl_GV_inner<cl_I>* vec, uintC index)
static const cl_I bits32_element (const cl_GV_inner<cl_I>* vec, std::size_t index)
{
#if (intDsize==32)
return (unsigned long)(((const cl_heap_GV_I_bits32 *) outcast(vec))->data[index]);
@ -421,13 +421,13 @@ static const cl_I bits32_element (const cl_GV_inner<cl_I>* vec, uintC index)
return (unsigned long)(((uint32*)(((const cl_heap_GV_I_bits32 *) outcast(vec))->data))[index]);
#endif
}
static void bits32_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
static void bits32_set_element (cl_GV_inner<cl_I>* vec, std::size_t index, const cl_I& x)
{
var uint32 xval = cl_I_to_UL(x);
uint32 xval = cl_I_to_UL(x);
#if (intDsize==32)
((cl_heap_GV_I_bits32 *) outcast(vec))->data[index] = xval;
#elif CL_CPU_BIG_ENDIAN_P
var uintD* ptr = &((cl_heap_GV_I_bits32 *) outcast(vec))->data[index/(intDsize/32)];
uintD* ptr = &((cl_heap_GV_I_bits32 *) outcast(vec))->data[index/(intDsize/32)];
index = 32*(index%(intDsize/32));
*ptr = *ptr ^ ((*ptr ^ ((uintD)xval << index)) & ((uintD)0xFFFFFFFF << index));
#else
@ -446,10 +446,10 @@ static cl_GV_I_vectorops* bits_vectorops[6] = {
&bits32_vectorops
};
cl_heap_GV_I* cl_make_heap_GV_I (uintC len, sintC m)
cl_heap_GV_I* cl_make_heap_GV_I (std::size_t len, sintC m)
{
// Determine log2(bits).
var uintL log2_bits;
uintL log2_bits;
switch (m) {
case 0: case 1:
log2_bits = 0; break;
@ -471,14 +471,14 @@ cl_heap_GV_I* cl_make_heap_GV_I (uintC len, sintC m)
return cl_make_heap_GV_I(len);
}
// For room allocation purposes, be pessimistic: assume the uintD case (since intDsize>=32).
var uintC words = // ceiling(len*2^log2_bits,intDsize)
std::size_t words = // ceiling(len*2^log2_bits,intDsize)
(((sintC)len-1)>>(log2_intDsize-log2_bits))+1;
var cl_heap_GV_I_bits32* hv = (cl_heap_GV_I_bits32*) malloc_hook(offsetofa(cl_heap_GV_I_bits32,data)+sizeof(uintD)*words);
cl_heap_GV_I_bits32* hv = (cl_heap_GV_I_bits32*) malloc_hook(offsetofa(cl_heap_GV_I_bits32,data)+sizeof(uintD)*words);
hv->refcount = 1;
hv->type = &cl_class_gvector_integer();
new (&hv->v) cl_GV_inner<cl_I> (len,&bits_vectorops[log2_bits]->ops);
var uintD* ptr = (uintD*)(hv->data);
for (var uintC i = 0; i < words; i++)
uintD* ptr = (uintD*)(hv->data);
for (std::size_t i = 0; i < words; i++)
ptr[i] = 0;
return (cl_heap_GV_I*) hv;
}
@ -498,7 +498,7 @@ int cl_GV_I_init_helper::count = 0;
cl_GV_I_init_helper::cl_GV_I_init_helper()
{
if (count++ == 0)
new ((void *)&cl_null_GV_I) cl_GV_I((uintC)0);
new ((void *)&cl_null_GV_I) cl_GV_I((std::size_t)0);
}
cl_GV_I_init_helper::~cl_GV_I_init_helper()

6
src/vector/cl_GV_I_copy.cc

@ -14,9 +14,9 @@ namespace cln {
const cl_GV_I copy (const cl_GV_I& v)
{
var uintC len = v.size();
var cl_GV_I w = cl_GV_I(len,v.maxbits());
cl_GV_I::copy_elements(v,0,w,0,len);
std::size_t len = v.size();
cl_GV_I w = cl_GV_I(len, v.maxbits());
cl_GV_I::copy_elements(v, 0, w, 0, len);
return w;
}

28
src/vector/cl_GV_number.cc

@ -56,33 +56,33 @@ struct cl_heap_GV_number_general : public cl_heap_GV_number {
cl_heap_GV_number_general ();
};
static const cl_number general_element (const cl_GV_inner<cl_number>* vec, uintC index)
static const cl_number general_element (const cl_GV_inner<cl_number>* vec, std::size_t index)
{
return ((const cl_heap_GV_number_general *) outcast(vec))->data[index];
}
static void general_set_element (cl_GV_inner<cl_number>* vec, uintC index, const cl_number& x)
static void general_set_element (cl_GV_inner<cl_number>* vec, std::size_t index, const cl_number& x)
{
((cl_heap_GV_number_general *) outcast(vec))->data[index] = x;
}
static void general_do_delete (cl_GV_inner<cl_number>* vec)
{
var cl_heap_GV_number_general* hv = (cl_heap_GV_number_general *) outcast(vec);
var uintC len = hv->v.size();
for (var uintC i = 0; i < len; i++)
cl_heap_GV_number_general* hv = (cl_heap_GV_number_general *) outcast(vec);
std::size_t len = hv->v.size();
for (std::size_t i = 0; i < len; i++)
hv->data[i].~cl_number();
}
static void general_copy_elements (const cl_GV_inner<cl_number>* srcvec, uintC srcindex, cl_GV_inner<cl_number>* destvec, uintC destindex, uintC count)
static void general_copy_elements (const cl_GV_inner<cl_number>* srcvec, std::size_t srcindex, cl_GV_inner<cl_number>* destvec, std::size_t destindex, std::size_t count)
{
if (count > 0) {
var const cl_heap_GV_number_general* srcv =
const cl_heap_GV_number_general* srcv =
(const cl_heap_GV_number_general *) outcast(srcvec);
var cl_heap_GV_number_general* destv =
cl_heap_GV_number_general* destv =
(cl_heap_GV_number_general *) outcast(destvec);
var uintC srclen = srcv->v.size();
var uintC destlen = destv->v.size();
std::size_t srclen = srcv->v.size();
std::size_t destlen = destv->v.size();
if (!(srcindex <= srcindex+count && srcindex+count <= srclen))
throw runtime_exception();
if (!(destindex <= destindex+count && destindex+count <= destlen))
@ -94,7 +94,7 @@ static void general_copy_elements (const cl_GV_inner<cl_number>* srcvec, uintC s
}
cl_heap_GV_number* cl_make_heap_GV_number (uintC len)
cl_heap_GV_number* cl_make_heap_GV_number (std::size_t len)
{
static cl_GV_vectorops<cl_number> general_vectorops = {
general_element,
@ -103,11 +103,11 @@ cl_heap_GV_number* cl_make_heap_GV_number (uintC len)
general_copy_elements
};
var cl_heap_GV_number_general* hv = (cl_heap_GV_number_general*) malloc_hook(offsetofa(cl_heap_GV_number_general,data)+sizeof(cl_number)*len);
cl_heap_GV_number_general* hv = (cl_heap_GV_number_general*) malloc_hook(offsetofa(cl_heap_GV_number_general,data)+sizeof(cl_number)*len);
hv->refcount = 1;
hv->type = &cl_class_gvector_number();
new (&hv->v) cl_GV_inner<cl_number> (len,&general_vectorops);
for (var uintC i = 0; i < len; i++)
for (std::size_t i = 0; i < len; i++)
init1(cl_number, hv->data[i]) ();
return hv;
}
@ -120,7 +120,7 @@ int cl_GV_number_init_helper::count = 0;
cl_GV_number_init_helper::cl_GV_number_init_helper()
{
if (count++ == 0)
new ((void *)&cl_null_GV_number) cl_GV_number((uintC)0);
new ((void *)&cl_null_GV_number) cl_GV_number((std::size_t)0);
}
cl_GV_number_init_helper::~cl_GV_number_init_helper()

6
src/vector/cl_GV_number_copy.cc

@ -14,9 +14,9 @@ namespace cln {
const cl_GV_number copy (const cl_GV_number& v)
{
var uintC len = v.size();
var cl_GV_number w = cl_GV_number(len);
cl_GV_number::copy_elements(v,0,w,0,len);
std::size_t len = v.size();
cl_GV_number w = cl_GV_number(len);
cl_GV_number::copy_elements(v, 0, w, 0, len);
return w;
}

6
src/vector/cl_SV_copy.cc

@ -16,12 +16,12 @@ namespace cln {
const cl_SV_any copy (const cl_SV_any& src)
{
var uintC len = src.size();
var cl_heap_SV_any* hv = (cl_heap_SV_any*) malloc_hook(sizeof(cl_heap_SV_any)+sizeof(cl_gcobject)*len);
std::size_t len = src.size();
cl_heap_SV_any* hv = (cl_heap_SV_any*) malloc_hook(sizeof(cl_heap_SV_any)+sizeof(cl_gcobject)*len);
hv->refcount = 1;
hv->type = src.pointer_type();
new (&hv->v) cl_SV_inner<cl_gcobject> (len);
for (var uintC i = 0; i < len; i++)
for (std::size_t i = 0; i < len; i++)
init1(cl_gcobject, hv->v[i]) (src[i]);
return hv;
}

12
src/vector/cl_SV_number.cc

@ -30,9 +30,9 @@ cl_class& cl_class_svector_number()
return instance;
}
cl_heap_SV_number* cl_make_heap_SV_number_uninit (uintC len)
cl_heap_SV_number* cl_make_heap_SV_number_uninit (std::size_t len)
{
var cl_heap_SV_number* hv = (cl_heap_SV_number*) malloc_hook(sizeof(cl_heap_SV_number)+sizeof(cl_number)*len);
cl_heap_SV_number* hv = (cl_heap_SV_number*) malloc_hook(sizeof(cl_heap_SV_number)+sizeof(cl_number)*len);
hv->refcount = 1;
hv->type = &cl_class_svector_number();
new (&hv->v) cl_SV_inner<cl_number> (len);
@ -40,13 +40,13 @@ cl_heap_SV_number* cl_make_heap_SV_number_uninit (uintC len)
return hv;
}
cl_heap_SV_number* cl_make_heap_SV_number (uintC len)
cl_heap_SV_number* cl_make_heap_SV_number (std::size_t len)
{
var cl_heap_SV_number* hv = (cl_heap_SV_number*) malloc_hook(sizeof(cl_heap_SV_number)+sizeof(cl_number)*len);
cl_heap_SV_number* hv = (cl_heap_SV_number*) malloc_hook(sizeof(cl_heap_SV_number)+sizeof(cl_number)*len);
hv->refcount = 1;
hv->type = &cl_class_svector_number();
new (&hv->v) cl_SV_inner<cl_number> (len);
for (var uintC i = 0; i < len; i++)
for (std::size_t i = 0; i < len; i++)
init1(cl_number, hv->v[i]) (0);
return hv;
}
@ -59,7 +59,7 @@ int cl_SV_number_init_helper::count = 0;
cl_SV_number_init_helper::cl_SV_number_init_helper()
{
if (count++ == 0)
new ((void *)&cl_null_SV_number) cl_SV_number((uintC)0);
new ((void *)&cl_null_SV_number) cl_SV_number((std::size_t)0);
}
cl_SV_number_init_helper::~cl_SV_number_init_helper()

12
src/vector/cl_SV_ringelt.cc

@ -31,9 +31,9 @@ cl_class& cl_class_svector_ringelt()
return instance;
}
cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (uintC len)
cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (std::size_t len)
{
var cl_heap_SV_ringelt* hv = (cl_heap_SV_ringelt*) malloc_hook(sizeof(cl_heap_SV_ringelt)+sizeof(_cl_ring_element)*len);
cl_heap_SV_ringelt* hv = (cl_heap_SV_ringelt*) malloc_hook(sizeof(cl_heap_SV_ringelt)+sizeof(_cl_ring_element)*len);
hv->refcount = 1;
hv->type = &cl_class_svector_ringelt();
new (&hv->v) cl_SV_inner<_cl_ring_element> (len);
@ -41,13 +41,13 @@ cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (uintC len)
return hv;
}
cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (uintC len)
cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (std::size_t len)
{
var cl_heap_SV_ringelt* hv = (cl_heap_SV_ringelt*) malloc_hook(sizeof(cl_heap_SV_ringelt)+sizeof(_cl_ring_element)*len);
cl_heap_SV_ringelt* hv = (cl_heap_SV_ringelt*) malloc_hook(sizeof(cl_heap_SV_ringelt)+sizeof(_cl_ring_element)*len);
hv->refcount = 1;
hv->type = &cl_class_svector_ringelt();
new (&hv->v) cl_SV_inner<_cl_ring_element> (len);
for (var uintC i = 0; i < len; i++)
for (std::size_t i = 0; i < len; i++)
init1(_cl_ring_element, hv->v[i]) ();
return hv;
}
@ -60,7 +60,7 @@ int cl_SV_ringelt_init_helper::count = 0;
cl_SV_ringelt_init_helper::cl_SV_ringelt_init_helper()
{
if (count++ == 0)
new ((void *)&cl_null_SV_ringelt) cl_SV_ringelt((uintC)0);
new ((void *)&cl_null_SV_ringelt) cl_SV_ringelt((std::size_t)0);
}
cl_SV_ringelt_init_helper::~cl_SV_ringelt_init_helper()

4
src/vector/output/cl_GV_number_aprint.cc

@ -19,13 +19,13 @@ namespace cln {
void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* printfun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_GV_number& vector)
{
var uintC len = vector.size();
std::size_t len = vector.size();
if (flags.vector_syntax == vsyntax_commonlisp) {
fprintchar(stream,'#');
fprintchar(stream,'(');
} else
fprintchar(stream,'[');
for (var uintC i = 0; i < len; i++) {
for (std::size_t i = 0; i < len; i++) {
if (i > 0) {
if (flags.vector_syntax == vsyntax_algebraic)
fprintchar(stream,',');

6
src/vector/output/cl_SV_aprint.cc

@ -15,14 +15,14 @@ namespace cln {
void fprint (std::ostream& stream, const cl_ring& R, const cl_SV_ringelt& vector)
{
var const cl_print_flags& flags = default_print_flags;
var uintC len = vector.size();
const cl_print_flags& flags = default_print_flags;
std::size_t len = vector.size();
if (flags.vector_syntax == vsyntax_commonlisp) {
fprintchar(stream,'#');
fprintchar(stream,'(');
} else
fprintchar(stream,'[');
for (var uintC i = 0; i < len; i++) {
for (std::size_t i = 0; i < len; i++) {
if (i > 0) {
if (flags.vector_syntax == vsyntax_algebraic)
fprintchar(stream,',');

4
src/vector/output/cl_SV_number_aprint.cc

@ -19,13 +19,13 @@ namespace cln {
void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* printfun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_SV_number& vector)
{
var uintC len = vector.size();
std::size_t len = vector.size();
if (flags.vector_syntax == vsyntax_commonlisp) {
fprintchar(stream,'#');
fprintchar(stream,'(');
} else
fprintchar(stream,'[');
for (var uintC i = 0; i < len; i++) {
for (std::size_t i = 0; i < len; i++) {
if (i > 0) {
if (flags.vector_syntax == vsyntax_algebraic)
fprintchar(stream,',');

Loading…
Cancel
Save