]> 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 5514efafb9ef4f3ad4065cb55f33106368083647..b51f4668ac13dfdb00289fb6da9d812aa549ba91 100644 (file)
@@ -3,19 +3,21 @@
 #ifndef _CL_RCPOINTER2_HASHWEAK_RCPOINTER_H
 #define _CL_RCPOINTER2_HASHWEAK_RCPOINTER_H
 
-#include "cl_object.h"
+#include "cln/object.h"
 
-#include "cl_hash2weak.h"
+#include "base/hash/cl_hash2weak.h"
+
+namespace cln {
 
 // Equality.
 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;
 }
@@ -28,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&);
@@ -41,4 +43,6 @@ struct cl_wht_from_rcpointer2_to_rcpointer : public cl_rcpointer {
        void put (const cl_rcpointer& x, const cl_rcpointer& y, const cl_rcpointer& z) const;
 };
 
+}  // namespace cln
+
 #endif /* _CL_RCPOINTER2_HASHWEAK_RCPOINTER_H */