Browse Source

Remove workarounds for obsolete compilers.

master
Richard Kreckel 10 years ago
parent
commit
94dc10d4d9
  1. 16
      include/cln/object.h
  2. 4
      include/cln/symbol.h
  3. 10
      src/base/cl_macros.h
  4. 4
      src/base/hash/cl_hash.h
  5. 15
      src/base/hash/cl_hash1.h
  6. 11
      src/base/hash/cl_hash2.h
  7. 8
      src/base/hash/cl_hashset.h
  8. 11
      src/base/hash/cl_hashuniq.h
  9. 4
      src/base/hash/cl_rcpointer2_hashweak_rcpointer.cc
  10. 4
      src/base/hash/cl_rcpointer_hashweak_rcpointer.cc
  11. 4
      src/base/symbol/cl_symbol.cc
  12. 6
      src/float/transcendental/cl_LF_pi.cc
  13. 4
      src/integer/hash/cl_I_hash_gcobject.cc
  14. 4
      src/integer/hash/cl_I_hash_gcpointer.cc
  15. 4
      src/integer/hash/cl_I_hash_pointer.cc
  16. 4
      src/integer/hash/cl_I_hash_rcobject.cc
  17. 4
      src/integer/hash/cl_I_hash_rcpointer.cc
  18. 4
      src/integer/hash/cl_I_hashweak_rcpointer.cc
  19. 3
      src/modinteger/cl_MI_int.h
  20. 4
      src/vector/cl_GV_I.cc
  21. 4
      src/vector/cl_GV_number.cc
  22. 4
      src/vector/cl_SV_number.cc
  23. 4
      src/vector/cl_SV_ringelt.cc

16
include/cln/object.h

@ -327,11 +327,7 @@ public:
cl_private_thing _as_cl_private_thing () const;
// Private constructor.
cl_gcobject (cl_private_thing p)
#if !(defined(__alpha__) && !defined(__GNUC__))
: pointer (p) {}
#else
{ pointer = p; }
#endif
// Debugging output.
void debug_print () const;
// Ability to place an object at a given address.
@ -377,11 +373,7 @@ public:
cl_private_thing _as_cl_private_thing () const;
// Private constructor.
cl_gcpointer (cl_private_thing p)
#if !(defined(__alpha__) && !defined(__GNUC__))
: pointer (p) {}
#else
{ pointer = p; }
#endif
// Debugging output.
void debug_print () const;
// Ability to place an object at a given address.
@ -427,11 +419,7 @@ public:
cl_private_thing _as_cl_private_thing () const;
// Private constructor.
cl_rcobject (cl_private_thing p)
#if !(defined(__alpha__) && !defined(__GNUC__))
: pointer (p) {}
#else
{ pointer = p; }
#endif
// Debugging output.
void debug_print () const;
// Ability to place an object at a given address.
@ -477,11 +465,7 @@ public:
cl_private_thing _as_cl_private_thing () const;
// Private constructor.
cl_rcpointer (cl_private_thing p)
#if !(defined(__alpha__) && !defined(__GNUC__))
: pointer (p) {}
#else
{ pointer = p; }
#endif
// Debugging output.
void debug_print () const;
// Ability to place an object at a given address.

4
include/cln/symbol.h

@ -9,10 +9,6 @@ namespace cln {
// Symbols are just strings, uniquified through a global hash table.
#if (defined(__alpha__) && !defined(__GNUC__))
struct hashuniq;
#endif
struct cl_symbol : public cl_rcpointer {
public:
// Conversion to string.

10
src/base/cl_macros.h

@ -242,22 +242,12 @@
// Inside a class definition:
// Overload `new' so that a class object can be allocated anywhere.
#if !((defined(__rs6000__) || defined(__alpha__)) && !defined(__GNUC__))
#define ALLOCATE_ANYWHERE(classname) \
/* Ability to place an object at a given address. */ \
public: \
void* operator new (size_t size) { return malloc_hook(size); } \
void* operator new (size_t size, classname* ptr) { unused size; return ptr; } \
void operator delete (void* ptr) { free_hook(ptr); }
#else
// For some compilers, work around template problem with "classname".
#define ALLOCATE_ANYWHERE(classname) \
/* Ability to place an object at a given address. */ \
public: \
void* operator new (size_t size) { return malloc_hook(size); } \
void* operator new (size_t size, void* ptr) { unused size; return ptr; } \
void operator delete (void* ptr) { free_hook(ptr); }
#endif
// init1(type, object) (value);
// initializes `object' with `value', by calling `type''s constructor.

4
src/base/hash/cl_hash.h

@ -131,9 +131,7 @@ protected:
_freelist = _entries[index].next;
return index;
}
#if !(defined(__hppa__) && !defined(__GNUC__)) // workaround HP CC problem
throw runtime_exception();
#endif
return -1; // dummy
}
// Put a free index into the free list.
@ -149,9 +147,7 @@ private:
template <class htentry>
struct _cl_hashtable_iterator
#if !(defined(__mips__) && !defined(__GNUC__)) // workaround SGI CC bug
: cl_abstract_iterator<htentry>
#endif
{
private:
typename cl_heap_hashtable<htentry>::htxentry * _entries;

15
src/base/hash/cl_hash1.h

@ -12,10 +12,6 @@ namespace cln {
// - function bool equal (key1_type,key1_type);
// - function unsigned long hashcode (key1_type);
#if (defined(__alpha__) && !defined(__GNUC__))
template <class key1_type, class value_type> struct cl_htentry1;
#endif
template <class key1_type, class value_type>
struct cl_htentry1 {
ALLOCATE_ANYWHERE(cl_htentry1)
@ -24,9 +20,6 @@ struct cl_htentry1 {
const value_type& htvalue () { return val; }
cl_htentry1 (const key1_type& k, const value_type& v)
: key (k), val (v) {}
#if (defined(__rs6000__) && !defined(__GNUC__))
cl_htentry1 () {}
#endif
};
template <class key1_type, class value_type>
@ -113,7 +106,6 @@ private:
// This may change the table's size!
void prepare_store ()
{
#if !(defined(__sparc__) && !defined(__GNUC__))
if (this->_freelist < -1)
return;
// Can we make room?
@ -122,13 +114,6 @@ private:
return;
// No! Have to grow the hash table.
grow();
#else
// workaround Sun C++ 4.1 inline function compiler bug
if (this->_freelist >= -1) {
if (!this->_garcol_fun(this) || (this->_freelist >= -1))
grow();
}
#endif
}
void grow ()
{

11
src/base/hash/cl_hash2.h

@ -22,9 +22,6 @@ struct cl_htentry2 {
const value_type& htvalue () { return val; }
cl_htentry2 (const key1_type& k1, const key2_type& k2, const value_type& v)
: key1 (k1), key2 (k2), val (v) {}
#if (defined(__rs6000__) && !defined(__GNUC__))
cl_htentry2 () {}
#endif
};
template <class key1_type, class key2_type, class value_type>
@ -114,7 +111,6 @@ private:
// This may change the table's size!
void prepare_store ()
{
#if !(defined(__sparc__) && !defined(__GNUC__))
if (this->_freelist < -1)
return;
// Can we make room?
@ -123,13 +119,6 @@ private:
return;
// No! Have to grow the hash table.
grow();
#else
// workaround Sun C++ 4.1 inline function compiler bug
if (this->_freelist >= -1) {
if (!this->_garcol_fun(this) || (this->_freelist >= -1))
grow();
}
#endif
}
void grow ()
{

8
src/base/hash/cl_hashset.h

@ -100,7 +100,6 @@ private:
// This may change the table's size!
void prepare_store ()
{
#if !(defined(__sparc__) && !defined(__GNUC__))
if (this->_freelist < -1)
return;
// Can we make room?
@ -109,13 +108,6 @@ private:
return;
// No! Have to grow the hash table.
grow();
#else
// workaround Sun C++ 4.1 inline function compiler bug
if (this->_freelist >= -1) {
if (!this->_garcol_fun(this) || (this->_freelist >= -1))
grow();
}
#endif
}
void grow ()
{

11
src/base/hash/cl_hashuniq.h

@ -24,9 +24,6 @@ struct cl_htuniqentry {
const value_type& htvalue () { return val; }
cl_htuniqentry (const value_type& v)
: val (v) {}
#if (defined(__rs6000__) && !defined(__GNUC__))
cl_htuniqentry () {}
#endif
};
template <class key1_type, class value_type>
@ -111,7 +108,6 @@ private:
// This may change the table's size!
void prepare_store ()
{
#if !(defined(__sparc__) && !defined(__GNUC__))
if (this->_freelist < -1)
return;
// Can we make room?
@ -120,13 +116,6 @@ private:
return;
// No! Have to grow the hash table.
grow();
#else
// workaround Sun C++ 4.1 inline function compiler bug
if (this->_freelist >= -1) {
if (!this->_garcol_fun(this) || (this->_freelist >= -1))
grow();
}
#endif
}
void grow ()
{

4
src/base/hash/cl_rcpointer2_hashweak_rcpointer.cc

@ -15,11 +15,7 @@ namespace cln {
static void cl_weak_hashtable_from_rcpointer2_to_rcpointer_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_weak_hashtable_from_rcpointer2_to_rcpointer*)pointer).~cl_heap_weak_hashtable_2();
#else
(*(cl_heap_weak_hashtable_from_rcpointer2_to_rcpointer*)pointer).~cl_heap_weak_hashtable_from_rcpointer2_to_rcpointer();
#endif
}
cl_class cl_class_weak_hashtable_from_rcpointer2_to_rcpointer = {

4
src/base/hash/cl_rcpointer_hashweak_rcpointer.cc

@ -15,11 +15,7 @@ namespace cln {
static void cl_weak_hashtable_from_rcpointer_to_rcpointer_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_weak_hashtable_from_rcpointer_to_rcpointer*)pointer).~cl_heap_weak_hashtable_1();
#else
(*(cl_heap_weak_hashtable_from_rcpointer_to_rcpointer*)pointer).~cl_heap_weak_hashtable_from_rcpointer_to_rcpointer();
#endif
}
cl_class cl_class_weak_hashtable_from_rcpointer_to_rcpointer = {

4
src/base/symbol/cl_symbol.cc

@ -31,11 +31,7 @@ typedef _cl_hashtable_iterator<cl_htentry_from_string_to_symbol> cl_hashtable_fr
static void cl_hashtable_from_string_to_symbol_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_hashtable_from_string_to_symbol*)pointer).~cl_heap_weak_hashtable_uniq();
#else
(*(cl_heap_hashtable_from_string_to_symbol*)pointer).~cl_heap_hashtable_from_string_to_symbol();
#endif
}

6
src/float/transcendental/cl_LF_pi.cc

@ -181,12 +181,6 @@ const cl_LF compute_pi_ramanujan_163 (uintC len)
}
// Bit complexity (N := len): O(N^2).
#if defined(__mips__) && !defined(__GNUC__) // workaround SGI CC bug
#define A A_fast
#define B B_fast
#define J3 J3_fast
#endif
const cl_LF compute_pi_ramanujan_163_fast (uintC len)
{
// Same formula as above, using a binary splitting evaluation.

4
src/integer/hash/cl_I_hash_gcobject.cc

@ -16,11 +16,7 @@ namespace cln {
static void cl_hashtable_from_integer_to_gcobject_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_hashtable_from_integer_to_gcobject*)pointer).~cl_heap_hashtable_1();
#else
(*(cl_heap_hashtable_from_integer_to_gcobject*)pointer).~cl_heap_hashtable_from_integer_to_gcobject();
#endif
}
cl_class cl_class_hashtable_from_integer_to_gcobject = {

4
src/integer/hash/cl_I_hash_gcpointer.cc

@ -16,11 +16,7 @@ namespace cln {
static void cl_hashtable_from_integer_to_gcpointer_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_hashtable_from_integer_to_gcpointer*)pointer).~cl_heap_hashtable_1();
#else
(*(cl_heap_hashtable_from_integer_to_gcpointer*)pointer).~cl_heap_hashtable_from_integer_to_gcpointer();
#endif
}
cl_class cl_class_hashtable_from_integer_to_gcpointer = {

4
src/integer/hash/cl_I_hash_pointer.cc

@ -16,11 +16,7 @@ namespace cln {
static void cl_hashtable_from_integer_to_pointer_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_hashtable_from_integer_to_pointer*)pointer).~cl_heap_hashtable_1();
#else
(*(cl_heap_hashtable_from_integer_to_pointer*)pointer).~cl_heap_hashtable_from_integer_to_pointer();
#endif
}
cl_class cl_class_hashtable_from_integer_to_pointer = {

4
src/integer/hash/cl_I_hash_rcobject.cc

@ -16,11 +16,7 @@ namespace cln {
static void cl_hashtable_from_integer_to_rcobject_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_hashtable_from_integer_to_rcobject*)pointer).~cl_heap_hashtable_1();
#else
(*(cl_heap_hashtable_from_integer_to_rcobject*)pointer).~cl_heap_hashtable_from_integer_to_rcobject();
#endif
}
cl_class cl_class_hashtable_from_integer_to_rcobject = {

4
src/integer/hash/cl_I_hash_rcpointer.cc

@ -16,11 +16,7 @@ namespace cln {
static void cl_hashtable_from_integer_to_rcpointer_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_hashtable_from_integer_to_rcpointer*)pointer).~cl_heap_hashtable_1();
#else
(*(cl_heap_hashtable_from_integer_to_rcpointer*)pointer).~cl_heap_hashtable_from_integer_to_rcpointer();
#endif
}
cl_class cl_class_hashtable_from_integer_to_rcpointer = {

4
src/integer/hash/cl_I_hashweak_rcpointer.cc

@ -16,11 +16,7 @@ namespace cln {
static void cl_weak_hashtable_from_integer_to_rcpointer_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_weak_hashtable_from_integer_to_rcpointer*)pointer).~cl_heap_weak_hashtable_1();
#else
(*(cl_heap_weak_hashtable_from_integer_to_rcpointer*)pointer).~cl_heap_weak_hashtable_from_integer_to_rcpointer();
#endif
}
cl_class cl_class_weak_hashtable_from_integer_to_rcpointer = {

3
src/modinteger/cl_MI_int.h

@ -32,9 +32,6 @@ static const _cl_MI int_random (cl_heap_modint_ring* R, random_state& randomstat
unused R;
unused randomstate;
throw runtime_exception("Z / 0 Z not a finite set - no equidistributed random function.");
#if ((defined(__sparc__) || defined(__sparc64__)) && !defined(__GNUC__)) // Sun CC wants a return value
return _cl_MI(R, 0);
#endif
}
static const _cl_MI int_zero (cl_heap_modint_ring* R)

4
src/vector/cl_GV_I.cc

@ -27,11 +27,7 @@ namespace cln {
static void cl_gvector_integer_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_GV_I*)pointer).~cl_heap_GV();
#else
(*(cl_heap_GV_I*)pointer).~cl_heap_GV_I();
#endif
}
// XXX: Ugh, this needs to be non-const (and non-static) for overriding

4
src/vector/cl_GV_number.cc

@ -16,11 +16,7 @@ namespace cln {
static void cl_gvector_number_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_GV_number*)pointer).~cl_heap_GV();
#else
(*(cl_heap_GV_number*)pointer).~cl_heap_GV_number();
#endif
}
// XXX: this ought to be const, but it would be impossible to register

4
src/vector/cl_SV_number.cc

@ -12,11 +12,7 @@ namespace cln {
static void cl_svector_number_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_SV_number*)pointer).~cl_heap_SV();
#else
(*(cl_heap_SV_number*)pointer).~cl_heap_SV_number();
#endif
}
// XXX: ugh, this needs to be non-static (and non-const) so redefining

4
src/vector/cl_SV_ringelt.cc

@ -13,11 +13,7 @@ namespace cln {
static void cl_svector_ringelt_destructor (cl_heap* pointer)
{
#if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
(*(cl_heap_SV_ringelt*)pointer).~cl_heap_SV();
#else
(*(cl_heap_SV_ringelt*)pointer).~cl_heap_SV_ringelt();
#endif
}
// XXX: this ought to be static const, but it would be impossible to

Loading…
Cancel
Save