summaryrefslogtreecommitdiff
path: root/src/LinearMath/btHashMap.h
diff options
context:
space:
mode:
authorerwin.coumans <erwin.coumans@08e121b0-ae19-0410-a57b-3be3395fd4fd>2010-02-03 02:20:09 +0000
committererwin.coumans <erwin.coumans@08e121b0-ae19-0410-a57b-3be3395fd4fd>2010-02-03 02:20:09 +0000
commitf34bb0176c1b86fbc22ae07a106722938fd3ae35 (patch)
treede31fda356e28fe2ec51008b2e085fe8779bd2cd /src/LinearMath/btHashMap.h
parent23c814f699e8a024fb28da4d8e63885a3acdf0fa (diff)
downloadbullet3-f34bb0176c1b86fbc22ae07a106722938fd3ae35.tar.gz
minor compile fixes for __CELLOS_LV2_
Diffstat (limited to 'src/LinearMath/btHashMap.h')
-rw-r--r--src/LinearMath/btHashMap.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/LinearMath/btHashMap.h b/src/LinearMath/btHashMap.h
index 68eab4112..add7a7b02 100644
--- a/src/LinearMath/btHashMap.h
+++ b/src/LinearMath/btHashMap.h
@@ -90,7 +90,13 @@ public:
class btHashPtr
{
- void* m_pointer;
+
+ union
+ {
+ void* m_pointer;
+ int m_hashValues[2];
+ };
+
public:
btHashPtr(void* ptr)
@@ -112,9 +118,8 @@ public:
SIMD_FORCE_INLINE unsigned int getHash()const
{
const bool VOID_IS_8 = ((sizeof(void*)==8));
- int* intPtr = (int*)&m_pointer;
-
- int key = VOID_IS_8? intPtr[0]+intPtr[1] : intPtr[0];
+
+ int key = VOID_IS_8? m_hashValues[0]+m_hashValues[1] : m_hashValues[0];
// Thomas Wang's hash
key += ~(key << 15); key ^= (key >> 10); key += (key << 3); key ^= (key >> 6); key += ~(key << 11); key ^= (key >> 16);