]> www.ginac.de Git - cln.git/blobdiff - src/base/hash/cl_rcpointer2_hashweak_rcpointer.h
64-bit mingw port: In hash table routines, use 'intptr_t' instead of 'long'.
[cln.git] / src / base / hash / cl_rcpointer2_hashweak_rcpointer.h
index 434dae549aa6b548b9aecbf809ef7f6865e93f46..b51f4668ac13dfdb00289fb6da9d812aa549ba91 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "cln/object.h"
 
-#include "cl_hash2weak.h"
+#include "base/hash/cl_hash2weak.h"
 
 namespace cln {
 
@@ -14,10 +14,10 @@ static inline bool equal (const cl_rcpointer& x, const cl_rcpointer& y)
 { return (x.pointer == y.pointer); }
 
 // Hash code. Luckily objects don't move around in memory.
-inline unsigned long hashcode (const cl_rcpointer& x1, const cl_rcpointer& x2)
+inline uintptr_t hashcode (const cl_rcpointer& x1, const cl_rcpointer& x2)
 {
-       var unsigned long hashcode1 = (unsigned long)x1.pointer;
-       var unsigned long hashcode2 = (unsigned long)x2.pointer;
+       var uintptr_t hashcode1 = (uintptr_t)x1.pointer;
+       var uintptr_t hashcode2 = (uintptr_t)x2.pointer;
        hashcode2 = (hashcode2 << 5) | (hashcode2 >> (long_bitsize-5)); // rotate
        return hashcode1 ^ hashcode2;
 }
@@ -30,7 +30,7 @@ typedef _cl_hashtable_iterator<cl_htentry_from_rcpointer2_to_rcpointer> cl_hasht
 
 struct cl_wht_from_rcpointer2_to_rcpointer : public cl_rcpointer {
        // Constructors.
-       cl_wht_from_rcpointer2_to_rcpointer (cl_boolean (*maygc_htentry) (const cl_htentry_from_rcpointer2_to_rcpointer&));
+       cl_wht_from_rcpointer2_to_rcpointer (bool (*maygc_htentry) (const cl_htentry_from_rcpointer2_to_rcpointer&));
        cl_wht_from_rcpointer2_to_rcpointer (const cl_wht_from_rcpointer2_to_rcpointer&);
        // Assignment operators.
        cl_wht_from_rcpointer2_to_rcpointer& operator= (const cl_wht_from_rcpointer2_to_rcpointer&);