diff options
author | Eugene Sandulenko | 2010-08-06 13:07:07 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 22:31:38 +0000 |
commit | ca17def625154e5f758b797e4fc48c76b0566320 (patch) | |
tree | 417077f9b13a74675e341567343076072e1ca84f /engines/sword25/kernel/callbackregistry.h | |
parent | a5819c1e0ac59e7e6f1dec7d2657e06292c546da (diff) | |
download | scummvm-rg350-ca17def625154e5f758b797e4fc48c76b0566320.tar.gz scummvm-rg350-ca17def625154e5f758b797e4fc48c76b0566320.tar.bz2 scummvm-rg350-ca17def625154e5f758b797e4fc48c76b0566320.zip |
SWORD25: Fix callbackregistry.h compilation
svn-id: r53221
Diffstat (limited to 'engines/sword25/kernel/callbackregistry.h')
-rw-r--r-- | engines/sword25/kernel/callbackregistry.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/engines/sword25/kernel/callbackregistry.h b/engines/sword25/kernel/callbackregistry.h index 38e917cf15..72b8135e47 100644 --- a/engines/sword25/kernel/callbackregistry.h +++ b/engines/sword25/kernel/callbackregistry.h @@ -43,6 +43,7 @@ #include "common/str.h" #include "common/hash-str.h" #include "common/hashmap.h" +#include "sword25/kernel/bs_stdint.h" #include "sword25/kernel/common.h" namespace Sword25 { @@ -67,7 +68,17 @@ public: private: typedef Common::HashMap<Common::String, CallbackPtr, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> NameToPtrMap; NameToPtrMap m_NameToPtrMap; - typedef Common::HashMap<CallbackPtr, Common::String, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> PtrToNameMap; + + struct CallbackPtr_EqualTo { + bool operator()(CallbackPtr x, CallbackPtr y) const { return x == y; } + }; + struct CallbackPtr_Hash { + uint operator()(CallbackPtr x) const { + return static_cast<uint>((int64)x % ((int64)1 << sizeof(uint))); + } + }; + + typedef Common::HashMap<CallbackPtr, Common::String, CallbackPtr_Hash, CallbackPtr_EqualTo> PtrToNameMap; PtrToNameMap m_PtrToNameMap; CallbackPtr FindPtrByName(const Common::String &Name) const; |