]> www.ginac.de Git - cln.git/commitdiff
Dependent base resolution needed for GCC-3.4
authorRichard Kreckel <kreckel@ginac.de>
Sun, 29 Jun 2003 12:32:51 +0000 (12:32 +0000)
committerRichard Kreckel <kreckel@ginac.de>
Sun, 29 Jun 2003 12:32:51 +0000 (12:32 +0000)
* include/cln/GV.h: Preceed inherited members with this->.
* include/cln/SV.h: Likewise.
* include/cln/object.h: Likewise.
* src/base/hash/cl_hash1.h: Likewise.
* src/base/hash/cl_hash1weak.h: Likewise.
* src/base/hash/cl_hash2.h: Likewise.
* src/base/hash/cl_hashuniq.h: Likewise.
* src/base/hash/cl_hash.h: Make lookup of static member function
explicit.
* src/base/hash/cl_hash2weak.h: Likewise.
* src/base/hash/cl_hashuniqweak.h: Likewise.
* src/modinteger/cl_MI.cc: Make shell-comment a C-comment. Geez.

12 files changed:
ChangeLog
include/cln/GV.h
include/cln/SV.h
include/cln/object.h
src/base/hash/cl_hash.h
src/base/hash/cl_hash1.h
src/base/hash/cl_hash1weak.h
src/base/hash/cl_hash2.h
src/base/hash/cl_hash2weak.h
src/base/hash/cl_hashuniq.h
src/base/hash/cl_hashuniqweak.h
src/modinteger/cl_MI.cc

index 904cb20d1f115ca1d05e3faeb91fa3b10f8acaa5..49c054fe82555703bb0edf28f7dc20627265ae91 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2003-06-29  Richard Kreckel  <kreckel@ginac.de>
+
+       Dependent base resolution needed for GCC-3.4
+       * include/cln/GV.h: Preceed inherited members with this->.
+       * include/cln/SV.h: Likewise.
+       * include/cln/object.h: Likewise.
+       * src/base/hash/cl_hash1.h: Likewise.
+       * src/base/hash/cl_hash1weak.h: Likewise.
+       * src/base/hash/cl_hash2.h: Likewise.
+       * src/base/hash/cl_hashuniq.h: Likewise.
+       * src/base/hash/cl_hash.h: Make lookup of static member function 
+       explicit.
+       * src/base/hash/cl_hash2weak.h: Likewise.
+       * src/base/hash/cl_hashuniqweak.h: Likewise.
+       * src/modinteger/cl_MI.cc: Make shell-comment a C-comment. Geez.
+
 2003-02-24  Bruno Haible  <bruno@clisp.org>
 
        * src/base/random/cl_random_from.cc (random_state::random_state): Add
index cd31e6de237104e3f40eeb750fdc24eacb6db2c7..113766b9099d41ac9fe826a1ca1eeb6b25611f82 100644 (file)
@@ -221,16 +221,16 @@ public:
        // Length.
        uintL length () const
        {
-               return ((const cl_heap_GV<T> *) pointer)->v.length();
+               return ((const cl_heap_GV<T> *) this->pointer)->v.length();
        }
        // Reference. Forbid modification of `const cl_GV&' arguments.
        const cl_GV_constindex<T> operator[] (unsigned long index) const
        {
-               return ((const cl_heap_GV<T> *) pointer)->v[index];
+               return ((const cl_heap_GV<T> *) this->pointer)->v[index];
        }
        const cl_GV_index<T> operator[] (unsigned long index)
        {
-               return ((cl_heap_GV<T> *) pointer)->v[index];
+               return ((cl_heap_GV<T> *) this->pointer)->v[index];
        }
        const cl_GV_constindex<T> operator[] (long index) const
        { return operator[]((unsigned long)index); }
@@ -277,7 +277,7 @@ template <class T, class BASE>
 template <class T, class BASE>
 inline CL_GV(T,BASE)::operator cl_heap_GV<T>* () const
 {
-       cl_heap_GV<T>* hpointer = (cl_heap_GV<T>*)pointer;
+       cl_heap_GV<T>* hpointer = (cl_heap_GV<T>*)this->pointer;
        cl_inc_refcount(*this);
        return hpointer;
 }
index ad0bf199e8e3656946cefd2f2b5ec568a48d0ec0..87845f18b0a8164fc938529c122782602f4cc466 100644 (file)
@@ -117,16 +117,16 @@ public:
        // Length.
        uintL length () const
        {
-               return ((const cl_heap_SV<T> *) pointer)->v.length();
+               return ((const cl_heap_SV<T> *) this->pointer)->v.length();
        }
        // Reference. Forbid modification of `const cl_SV&' arguments.
        const T & operator[] (unsigned long index) const
        {
-               return ((const cl_heap_SV<T> *) pointer)->v[index];
+               return ((const cl_heap_SV<T> *) this->pointer)->v[index];
        }
        T & operator[] (unsigned long index)
        {
-               return ((cl_heap_SV<T> *) pointer)->v[index];
+               return ((cl_heap_SV<T> *) this->pointer)->v[index];
        }
        // New ANSI C++ compilers also want the following.
        const T & operator[] (unsigned int index) const
index ccfde56148fb2605fba2dbc704fd5738880eb5ab..5e9e51604213b8f8b3f8a232ab1ad9d2ab9a8e32 100644 (file)
@@ -243,7 +243,7 @@ inline _class_::_classname_ (const _class_& x)                      \
 {                                                              \
        cl_uint x_word = x.word;                                \
        cl_inc_refcount(x);                                     \
-       word = x_word;                                          \
+       this->word = x_word;                                    \
 }
 
 // The declaration of a copy constructor.
@@ -263,7 +263,7 @@ inline dest_class& dest_class::operator= (const src_class& x)       \
        cl_uint x_word = x.word;                                \
        cl_inc_refcount(x);                                     \
        cl_dec_refcount(*this);                                 \
-       word = x_word;                                          \
+       this->word = x_word;                                    \
        return *this;                                           \
 }
 
index 4b34589141d138e6dd2cd2e5ea51aace23e4e3bb..7dc44350e000a782d6180c6fd5e8e41a80e2e365 100644 (file)
@@ -17,7 +17,7 @@ template <class htentry> struct _cl_hashtable_iterator;
 
 template <class htentry>
 struct cl_heap_hashtable : public cl_heap {
-       friend struct _cl_hashtable_iterator<htentry>;
+    friend struct _cl_hashtable_iterator<htentry>;
 protected:
     typedef struct htxentry {
         long next;     // > 0: pseudo-list continues at next-1
@@ -43,7 +43,7 @@ public:
     void operator delete (void* ptr) { free_hook(ptr); }
     // Constructor: build a new, empty table.
     cl_heap_hashtable (long initial_size = 5) : cl_heap (),
-        _size (initial_size), _count (0), _garcol_fun (no_garcol)
+        _size (initial_size), _count (0), _garcol_fun (cl_heap_hashtable<htentry>::no_garcol)
     {
         _modulus = compute_modulus(_size);
         _total_vector = malloc_hook(_modulus*sizeof(long) + _size*sizeof(htxentry));
index 1cdf88b9ace9569cf45965f56a9194426c021d02..7fe8330bf778b0cb47406ab3e7e8288f4e6b363c 100644 (file)
@@ -45,13 +45,13 @@ public:
     // if it is not NULL.
     value_type* get (const key1_type& key)
     {
-        var long index = _slots[hashcode(key) % _modulus] - 1;
+        var long index = this->_slots[hashcode(key) % this->_modulus] - 1;
         while (index >= 0) {
-            if (!(index < _size))
+            if (!(index < this->_size))
                 cl_abort();
-            if (equal(key,_entries[index].entry.key))
-                return &_entries[index].entry.val;
-            index = _entries[index].next - 1;
+            if (equal(key,this->_entries[index].entry.key))
+                return &this->_entries[index].entry.val;
+            index = this->_entries[index].next - 1;
         }
         return NULL;
     }
@@ -61,45 +61,45 @@ public:
         var unsigned long hcode = hashcode(key);
         // Search whether it is already there.
         {
-            var long index = _slots[hcode % _modulus] - 1;
+            var long index = this->_slots[hcode % this->_modulus] - 1;
             while (index >= 0) {
-                if (!(index < _size))
+                if (!(index < this->_size))
                     cl_abort();
-                if (equal(key,_entries[index].entry.key)) {
-                    _entries[index].entry.val = val;
+                if (equal(key,this->_entries[index].entry.key)) {
+                    this->_entries[index].entry.val = val;
                     return;
                 }
-                index = _entries[index].next - 1;
+                index = this->_entries[index].next - 1;
             }
         }
         // Put it into the table.
         prepare_store();
-        var long hindex = hcode % _modulus; // _modulus may have changed!
+        var long hindex = hcode % this->_modulus; // _modulus may have changed!
         var long index = get_free_index();
-        new (&_entries[index].entry) cl_htentry1<key1_type,value_type> (key,val);
-        _entries[index].next = _slots[hindex];
-        _slots[hindex] = 1+index;
-        _count++;
+        new (&this->_entries[index].entry) cl_htentry1<key1_type,value_type> (key,val);
+        this->_entries[index].next = this->_slots[hindex];
+        this->_slots[hindex] = 1+index;
+        this->_count++;
     }
     // Remove (htrem alias remhash).
     void remove (const key1_type& key)
     {
-        var long* _index = &_slots[hashcode(key) % _modulus];
+        var long* _index = &this->_slots[hashcode(key) % this->_modulus];
         while (*_index > 0) {
             var long index = *_index - 1;
-            if (!(index < _size))
+            if (!(index < this->_size))
                 cl_abort();
-            if (equal(key,_entries[index].entry.key)) {
+            if (equal(key,this->_entries[index].entry.key)) {
                 // Remove _entries[index].entry
-                *_index = _entries[index].next;
-                _entries[index].~htxentry();
+                *_index = this->_entries[index].next;
+                this->_entries[index].~htxentry();
                 // The entry is now free.
                 put_free_index(index);
                 // That's it.
-                _count--;
+                this->_count--;
                 return;
             }
-            _index = &_entries[index].next;
+            _index = &this->_entries[index].next;
         }
     }
     // Iterate through the table.
@@ -113,25 +113,25 @@ private:
     void prepare_store ()
     {
       #if !(defined(__sparc__) && !defined(__GNUC__))
-        if (_freelist < -1)
+        if (this->_freelist < -1)
             return;
         // Can we make room?
-        if (_garcol_fun(this))
-            if (_freelist < -1)
+        if (this->_garcol_fun(this))
+            if (this->_freelist < -1)
                 return;
         // No! Have to grow the hash table.
         grow();
       #else
         // workaround Sun C++ 4.1 inline function compiler bug
-        if (_freelist >= -1) {
-            if (!_garcol_fun(this) || (_freelist >= -1))
+        if (this->_freelist >= -1) {
+            if (!this->_garcol_fun(this) || (this->_freelist >= -1))
                 grow();
         }
       #endif
     }
     void grow ()
     {
-        var long new_size = _size + (_size >> 1) + 1; // _size*1.5
+        var long new_size = this->_size + (this->_size >> 1) + 1; // _size*1.5
         var long new_modulus = compute_modulus(new_size);
         var void* new_total_vector = malloc_hook(new_modulus*sizeof(long) + new_size*sizeof(htxentry));
         var long* new_slots = (long*) ((char*)new_total_vector + 0);
@@ -143,8 +143,8 @@ private:
             new_entries[i].next = free_list_head;
             free_list_head = -2-i;
         }
-        var htxentry* old_entries = _entries;
-        for (var long old_index = 0; old_index < _size; old_index++)
+        var htxentry* old_entries = this->_entries;
+        for (var long old_index = 0; old_index < this->_size; old_index++)
             if (old_entries[old_index].next >= 0) {
                 var key1_type& key = old_entries[old_index].entry.key;
                 var value_type& val = old_entries[old_index].entry.val;
@@ -156,13 +156,13 @@ private:
                 new_slots[hindex] = 1+index;
                 old_entries[old_index].~htxentry();
             }
-        free_hook(_total_vector);
-        _modulus = new_modulus;
-        _size = new_size;
-        _freelist = free_list_head;
-        _slots = new_slots;
-        _entries = new_entries;
-        _total_vector = new_total_vector;
+        free_hook(this->_total_vector);
+        this->_modulus = new_modulus;
+        this->_size = new_size;
+        this->_freelist = free_list_head;
+        this->_slots = new_slots;
+        this->_entries = new_entries;
+        this->_total_vector = new_total_vector;
     }
 };
 
index a3568190ab76200a32cc622f98e6e98ee418ba81..e351332a75f3b317b8d5658fdc65688e92596046 100644 (file)
@@ -33,7 +33,7 @@ public:
                : cl_heap_hashtable_1 <key1_type,value_type> (),
                  _maygc_htentry (maygc_htentry)
        {
-               _garcol_fun = garcol;
+               this->_garcol_fun = cl_heap_weak_hashtable_1<key1_type,value_type>::garcol;
        }
 private:
        // Garbage collection.
@@ -75,7 +75,7 @@ private:
                else if (2*removed < ht->_count) {
                        // Table shrank by less than a factor of 1/1.5.
                        // Don't expand the table now, but expand it next time.
-                       ht->_garcol_fun = garcol_nexttime;
+                       ht->_garcol_fun = cl_heap_weak_hashtable_1<key1_type,value_type>::garcol_nexttime;
                        return cl_true;
                } else {
                        // Table shrank much. Don't expand the table now,
@@ -87,7 +87,7 @@ private:
        {
                var cl_heap_weak_hashtable_1* ht = (cl_heap_weak_hashtable_1*)_ht;
                // Now ht->_garcol_fun = garcol_nexttime.
-               ht->_garcol_fun = garcol;
+               ht->_garcol_fun = cl_heap_weak_hashtable_1<key1_type,value_type>::garcol;
                return cl_false;
        }
 };
index 73a9adce8f2040a975d9d0abfd03c445f9511015..407a414505694350b33bdb7de1e21cac46c81614 100644 (file)
@@ -43,14 +43,14 @@ public:
     // if it is not NULL.
     value_type* get (const key1_type& key1, const key2_type& key2)
     {
-        var long index = _slots[hashcode(key1,key2) % _modulus] - 1;
+        var long index = this->_slots[hashcode(key1,key2) % this->_modulus] - 1;
         while (index >= 0) {
-            if (!(index < _size))
+            if (!(index < this->_size))
                 cl_abort();
-            if (equal(key1,_entries[index].entry.key1)
-                && equal(key2,_entries[index].entry.key2))
-                return &_entries[index].entry.val;
-            index = _entries[index].next - 1;
+            if (equal(key1,this->_entries[index].entry.key1)
+                && equal(key2,this->_entries[index].entry.key2))
+                return &this->_entries[index].entry.val;
+            index = this->_entries[index].next - 1;
         }
         return NULL;
     }
@@ -60,47 +60,47 @@ public:
         var unsigned long hcode = hashcode(key1,key2);
         // Search whether it is already there.
         {
-            var long index = _slots[hcode % _modulus] - 1;
+            var long index = this->_slots[hcode % this->_modulus] - 1;
             while (index >= 0) {
-                if (!(index < _size))
+                if (!(index < this->_size))
                     cl_abort();
-                if (equal(key1,_entries[index].entry.key1)
-                    && equal(key2,_entries[index].entry.key2)) {
-                    _entries[index].entry.val = val;
+                if (equal(key1,this->_entries[index].entry.key1)
+                    && equal(key2,this->_entries[index].entry.key2)) {
+                    this->_entries[index].entry.val = val;
                     return;
                 }
-                index = _entries[index].next - 1;
+                index = this->_entries[index].next - 1;
             }
         }
         // Put it into the table.
         prepare_store();
-        var long hindex = hcode % _modulus; // _modulus may have changed!
+        var long hindex = hcode % this->_modulus; // _modulus may have changed!
         var long index = get_free_index();
-        new (&_entries[index].entry) cl_htentry2<key1_type,key2_type,value_type> (key1,key2,val);
-        _entries[index].next = _slots[hindex];
-        _slots[hindex] = 1+index;
-        _count++;
+        new (&this->_entries[index].entry) cl_htentry2<key1_type,key2_type,value_type> (key1,key2,val);
+        this->_entries[index].next = this->_slots[hindex];
+        this->_slots[hindex] = 1+index;
+        this->_count++;
     }
     // Remove (htrem alias remhash).
     void remove (const key1_type& key1, const key2_type& key2)
     {
-        var long* _index = &_slots[hashcode(key1,key2) % _modulus];
+        var long* _index = &this->_slots[hashcode(key1,key2) % this->_modulus];
         while (*_index > 0) {
             var long index = *_index - 1;
-            if (!(index < _size))
+            if (!(index < this->_size))
                 cl_abort();
-            if (equal(key1,_entries[index].entry.key1)
-                && equal(key2,_entries[index].entry.key2)) {
+            if (equal(key1,this->_entries[index].entry.key1)
+                && equal(key2,this->_entries[index].entry.key2)) {
                 // Remove _entries[index].entry
-                *_index = _entries[index].next;
-                _entries[index].~htxentry();
+                *_index = this->_entries[index].next;
+                this->_entries[index].~htxentry();
                 // The entry is now free.
                 put_free_index(index);
                 // That's it.
-                _count--;
+                this->_count--;
                 return;
             }
-            _index = &_entries[index].next;
+            _index = &this->_entries[index].next;
         }
     }
     // Iterate through the table.
@@ -114,25 +114,25 @@ private:
     void prepare_store ()
     {
       #if !(defined(__sparc__) && !defined(__GNUC__))
-        if (_freelist < -1)
+        if (this->_freelist < -1)
             return;
         // Can we make room?
         if (_garcol_fun(this))
-            if (_freelist < -1)
+            if (this->_freelist < -1)
                 return;
         // No! Have to grow the hash table.
         grow();
       #else
         // workaround Sun C++ 4.1 inline function compiler bug
-        if (_freelist >= -1) {
-            if (!_garcol_fun(this) || (_freelist >= -1))
+        if (this->_freelist >= -1) {
+            if (!_garcol_fun(this) || (this->_freelist >= -1))
                 grow();
         }
       #endif
     }
     void grow ()
     {
-        var long new_size = _size + (_size >> 1) + 1; // _size*1.5
+        var long new_size = this->_size + (this->_size >> 1) + 1; // _size*1.5
         var long new_modulus = compute_modulus(new_size);
         var void* new_total_vector = malloc_hook(new_modulus*sizeof(long) + new_size*sizeof(htxentry));
         var long* new_slots = (long*) ((char*)new_total_vector + 0);
@@ -144,8 +144,8 @@ private:
             new_entries[i].next = free_list_head;
             free_list_head = -2-i;
         }
-        var htxentry* old_entries = _entries;
-        for (var long old_index = 0; old_index < _size; old_index++)
+        var htxentry* old_entries = this->_entries;
+        for (var long old_index = 0; old_index < this->_size; old_index++)
             if (old_entries[old_index].next >= 0) {
                 var key1_type& key1 = old_entries[old_index].entry.key1;
                 var key2_type& key2 = old_entries[old_index].entry.key2;
@@ -158,13 +158,13 @@ private:
                 new_slots[hindex] = 1+index;
                 old_entries[old_index].~htxentry();
             }
-        free_hook(_total_vector);
-        _modulus = new_modulus;
-        _size = new_size;
-        _freelist = free_list_head;
-        _slots = new_slots;
-        _entries = new_entries;
-        _total_vector = new_total_vector;
+        free_hook(this->_total_vector);
+        this->_modulus = new_modulus;
+        this->_size = new_size;
+        this->_freelist = free_list_head;
+        this->_slots = new_slots;
+        this->_entries = new_entries;
+        this->_total_vector = new_total_vector;
     }
 };
 
index 6103690eef1a2b2e6c9fc5f92324e4f3f74dba5e..0e3e51408c4378e54819d11bb1bc49edeb6c6193 100644 (file)
@@ -33,7 +33,7 @@ public:
                : cl_heap_hashtable_2 <key1_type,key2_type,value_type> (),
                  _maygc_htentry (maygc_htentry)
        {
-               _garcol_fun = garcol;
+               this->_garcol_fun = cl_heap_weak_hashtable_2<key1_type,key2_type,value_type>::garcol;
        }
 private:
        // Garbage collection.
@@ -75,7 +75,7 @@ private:
                else if (2*removed < ht->_count) {
                        // Table shrank by less than a factor of 1/1.5.
                        // Don't expand the table now, but expand it next time.
-                       ht->_garcol_fun = garcol_nexttime;
+                       ht->_garcol_fun = cl_heap_weak_hashtable_2<key1_type,key2_type,value_type>::garcol_nexttime;
                        return cl_true;
                } else {
                        // Table shrank much. Don't expand the table now,
@@ -87,7 +87,7 @@ private:
        {
                var cl_heap_weak_hashtable_2* ht = (cl_heap_weak_hashtable_2*)_ht;
                // Now ht->_garcol_fun = garcol_nexttime.
-               ht->_garcol_fun = garcol;
+               ht->_garcol_fun = cl_heap_weak_hashtable_2<key1_type,key2_type,value_type>::garcol;
                return cl_false;
        }
 };
index b07b38f434de4b06479de3bc09acb6fd89802427..c7a86961b9bc69d2d57854218f99435c0709afd2 100644 (file)
@@ -45,13 +45,13 @@ public:
     // if it is not NULL.
     value_type * get (const key1_type& key)
     {
-        var long index = _slots[hashcode(key) % _modulus] - 1;
+        var long index = this->_slots[hashcode(key) % this->_modulus] - 1;
         while (index >= 0) {
-            if (!(index < _size))
+            if (!(index < this->_size))
                 cl_abort();
-            if (equal(key,hashkey(_entries[index].entry.val)))
-                return &_entries[index].entry.val;
-            index = _entries[index].next - 1;
+            if (equal(key,hashkey(this->_entries[index].entry.val)))
+                return &this->_entries[index].entry.val;
+            index = this->_entries[index].next - 1;
         }
         return NULL;
     }
@@ -61,43 +61,43 @@ public:
         var unsigned long hcode = hashcode(key);
         // Search whether it is already there.
         {
-            var long index = _slots[hcode % _modulus] - 1;
+            var long index = this->_slots[hcode % this->_modulus] - 1;
             while (index >= 0) {
-                if (!(index < _size))
+                if (!(index < this->_size))
                     cl_abort();
-                if (equal(key,hashkey(_entries[index].entry.val)))
+                if (equal(key,hashkey(this->_entries[index].entry.val)))
                     return;
-                index = _entries[index].next - 1;
+                index = this->_entries[index].next - 1;
             }
         }
         // Put it into the table.
         prepare_store();
-        var long hindex = hcode % _modulus; // _modulus may have changed!
+        var long hindex = hcode % this->_modulus; // _modulus may have changed!
         var long index = get_free_index();
-        new (&_entries[index].entry) cl_htuniqentry<key1_type,value_type> (value_type((struct hashuniq *)0, key));
-        _entries[index].next = _slots[hindex];
-        _slots[hindex] = 1+index;
-        _count++;
+        new (&this->_entries[index].entry) cl_htuniqentry<key1_type,value_type> (value_type((struct hashuniq *)0, key));
+        this->_entries[index].next = this->_slots[hindex];
+        this->_slots[hindex] = 1+index;
+        this->_count++;
     }
     // Remove (htrem alias remhash).
     void remove (const key1_type& key)
     {
-        var long* _index = &_slots[hashcode(key) % _modulus];
+        var long* _index = &this->_slots[hashcode(key) % this->_modulus];
         while (*_index > 0) {
             var long index = *_index - 1;
-            if (!(index < _size))
+            if (!(index < this->_size))
                 cl_abort();
-            if (equal(key,hashkey(_entries[index].entry.val))) {
+            if (equal(key,hashkey(this->_entries[index].entry.val))) {
                 // Remove _entries[index].entry
-                *_index = _entries[index].next;
-                _entries[index].~htxentry();
+                *_index = this->_entries[index].next;
+                this->_entries[index].~htxentry();
                 // The entry is now free.
                 put_free_index(index);
                 // That's it.
-                _count--;
+                this->_count--;
                 return;
             }
-            _index = &_entries[index].next;
+            _index = &this->_entries[index].next;
         }
     }
     // Iterate through the table.
@@ -111,25 +111,25 @@ private:
     void prepare_store ()
     {
       #if !(defined(__sparc__) && !defined(__GNUC__))
-        if (_freelist < -1)
+        if (this->_freelist < -1)
             return;
         // Can we make room?
         if (_garcol_fun(this))
-            if (_freelist < -1)
+            if (this->_freelist < -1)
                 return;
         // No! Have to grow the hash table.
         grow();
       #else
         // workaround Sun C++ 4.1 inline function compiler bug
-        if (_freelist >= -1) {
-            if (!_garcol_fun(this) || (_freelist >= -1))
+        if (this->_freelist >= -1) {
+            if (!_garcol_fun(this) || (this->_freelist >= -1))
                 grow();
         }
       #endif
     }
     void grow ()
     {
-        var long new_size = _size + (_size >> 1) + 1; // _size*1.5
+        var long new_size = this->_size + (this->_size >> 1) + 1; // _size*1.5
         var long new_modulus = compute_modulus(new_size);
         var void* new_total_vector = malloc_hook(new_modulus*sizeof(long) + new_size*sizeof(htxentry));
         var long* new_slots = (long*) ((char*)new_total_vector + 0);
@@ -141,8 +141,8 @@ private:
             new_entries[i].next = free_list_head;
             free_list_head = -2-i;
         }
-        var htxentry* old_entries = _entries;
-        for (var long old_index = 0; old_index < _size; old_index++)
+        var htxentry* old_entries = this->_entries;
+        for (var long old_index = 0; old_index < this->_size; old_index++)
             if (old_entries[old_index].next >= 0) {
                 var value_type& val = old_entries[old_index].entry.val;
                 var long hindex = hashcode(hashkey(val)) % new_modulus;
@@ -153,13 +153,13 @@ private:
                 new_slots[hindex] = 1+index;
                 old_entries[old_index].~htxentry();
             }
-        free_hook(_total_vector);
-        _modulus = new_modulus;
-        _size = new_size;
-        _freelist = free_list_head;
-        _slots = new_slots;
-        _entries = new_entries;
-        _total_vector = new_total_vector;
+        free_hook(this->_total_vector);
+        this->_modulus = new_modulus;
+        this->_size = new_size;
+        this->_freelist = free_list_head;
+        this->_slots = new_slots;
+        this->_entries = new_entries;
+        this->_total_vector = new_total_vector;
     }
 };
 
index a022e4b366ca24aef80fde7d9929103031ca2a38..77246d6af064f97c438e9d00e0258e4cf55d3f7b 100644 (file)
@@ -32,7 +32,7 @@ public:
        cl_heap_weak_hashtable_uniq ()
                : cl_heap_hashtable_uniq <key1_type,value_type> ()
        {
-               _garcol_fun = garcol;
+               this->_garcol_fun = cl_heap_weak_hashtable_uniq<key1_type,value_type>::garcol;
        }
 private:
        // Garbage collection.
@@ -75,7 +75,7 @@ private:
                else if (2*removed < ht->_count) {
                        // Table shrank by less than a factor of 1/1.5.
                        // Don't expand the table now, but expand it next time.
-                       ht->_garcol_fun = garcol_nexttime;
+                       ht->_garcol_fun = cl_heap_weak_hashtable_uniq<key1_type,value_type>::garcol_nexttime;
                        return cl_true;
                } else {
                        // Table shrank much. Don't expand the table now,
@@ -87,7 +87,7 @@ private:
        {
                var cl_heap_weak_hashtable_uniq* ht = (cl_heap_weak_hashtable_uniq*)_ht;
                // Now ht->_garcol_fun = garcol_nexttime.
-               ht->_garcol_fun = garcol;
+               ht->_garcol_fun = cl_heap_weak_hashtable_uniq<key1_type,value_type>::garcol;
                return cl_false;
        }
 };
index 6be4179fc5db286d94467f3555c5ac939a7d7ccd..d1cc62344dc5929337c293e50bc60b51854caa07 100644 (file)
@@ -21,8 +21,8 @@ CL_PROVIDE(cl_MI)
 #include "cln/abort.h"
 #include "cl_alloca.h"
 
-# MacOS X does "#define _R 0x00040000L"
-# Grr...
+// MacOS X does "#define _R 0x00040000L"
+// Grr...
 #undef _R
 
 namespace cln {