summaryrefslogtreecommitdiffstats
path: root/src/objcache.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2006-10-17 18:03:21 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2006-10-17 18:03:21 (GMT)
commit65f47e04daaf7f06da11c64af364e65e60e66387 (patch)
tree54faf2b759aca5cdc6184168aa676ed669435766 /src/objcache.cpp
parent3c8148441a129febc5c2b9e4b2b2cbd018ad3b6e (diff)
downloadDoxygen-65f47e04daaf7f06da11c64af364e65e60e66387.zip
Doxygen-65f47e04daaf7f06da11c64af364e65e60e66387.tar.gz
Doxygen-65f47e04daaf7f06da11c64af364e65e60e66387.tar.bz2
Release-1.5.0
Diffstat (limited to 'src/objcache.cpp')
-rw-r--r--src/objcache.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/objcache.cpp b/src/objcache.cpp
index 63e7eb7..f45a0e7 100644
--- a/src/objcache.cpp
+++ b/src/objcache.cpp
@@ -17,6 +17,7 @@
#include <stdio.h>
#include <assert.h>
+#include <qglobal.h>
#include "objcache.h"
//----------------------------------------------------------------------
@@ -176,11 +177,10 @@ void ObjCache::moveToFront(int index)
unsigned int ObjCache::hash(void *addr)
{
- static bool isPtr64 = sizeof(addr)==8 && sizeof(long)==8;
-
- unsigned long key = (unsigned long)addr;
+ static bool isPtr64 = sizeof(addr)==8;
if (isPtr64)
{
+ uint64 key = (uint64)addr;
// Thomas Wang's 64 bit Mix Function
key += ~(key << 32);
key ^= (key >> 22);
@@ -190,18 +190,20 @@ unsigned int ObjCache::hash(void *addr)
key ^= (key >> 15);
key += ~(key << 27);
key ^= (key >> 31);
+ return key & (m_size-1);
}
else
{
// Thomas Wang's 32 bit Mix Function
+ unsigned long key = (unsigned long)addr;
key += ~(key << 15);
key ^= (key >> 10);
key += (key << 3);
key ^= (key >> 6);
key += ~(key << 11);
key ^= (key >> 16);
+ return key & (m_size-1);
}
- return key & (m_size-1);
}
ObjCache::HashNode *ObjCache::hashFind(void *obj)