]> www.ginac.de Git - cln.git/blobdiff - include/cln/SV_ringelt.h
cl_{GV,SV}: use std::size_t for size of vectors (instead of obscure uintC).
[cln.git] / include / cln / SV_ringelt.h
index 9d3a5015153b98973cdb43f1bf7288e35ba301a1..2087e4c6b04089b48ade103e2df05d700cdf3dca 100644 (file)
@@ -16,7 +16,7 @@ public:
        // Constructors.
        cl_SV_ringelt ();
        cl_SV_ringelt (const cl_SV_ringelt&);
-       explicit cl_SV_ringelt (uintL 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 (uintL 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 (uintL len);
-inline cl_SV_ringelt::cl_SV_ringelt (uintL 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.
@@ -44,7 +44,15 @@ inline cl_SV_ringelt::operator cl_heap_SV_ringelt* () const
 extern const cl_SV_ringelt cl_null_SV_ringelt;
 inline cl_SV_ringelt::cl_SV_ringelt ()
        : cl_SV<_cl_ring_element,cl_SV_any> ((cl_heap_SV_ringelt*) cl_null_SV_ringelt) {}
-CL_REQUIRE(cl_SV_ringelt)
+
+class cl_SV_ringelt_init_helper
+{
+       static int count;
+public:
+       cl_SV_ringelt_init_helper();
+       ~cl_SV_ringelt_init_helper();
+};
+static cl_SV_ringelt_init_helper cl_SV_ringelt_init_helper_instance;
 
 // Copy a simple vector.
 inline const cl_SV_ringelt copy (const cl_SV_ringelt& vector)
@@ -56,9 +64,7 @@ extern void fprint (std::ostream& stream, const cl_ring& R, const cl_SV_ringelt&
 // Debugging support.
 #ifdef CL_DEBUG
 extern int cl_SV_ringelt_debug_module;
-static void* const cl_SV_ringelt_debug_dummy[] = { &cl_SV_ringelt_debug_dummy,
-       &cl_SV_ringelt_debug_module
-};
+CL_FORCE_LINK(cl_SV_ringelt_debug_dummy, cl_SV_ringelt_debug_module)
 #endif
 
 }  // namespace cln