diff options
author | Bastien Bouclet | 2017-09-24 19:09:40 +0200 |
---|---|---|
committer | Bastien Bouclet | 2017-09-30 21:35:16 +0200 |
commit | fd19e2fc15405935ff6e3ef56edc3aab92323529 (patch) | |
tree | dc5c07cda4e538954404481fbd624cc381212ece /engines/director | |
parent | 55f46d36671b1ceb23b06a7ce00627379352f9ca (diff) | |
download | scummvm-rg350-fd19e2fc15405935ff6e3ef56edc3aab92323529.tar.gz scummvm-rg350-fd19e2fc15405935ff6e3ef56edc3aab92323529.tar.bz2 scummvm-rg350-fd19e2fc15405935ff6e3ef56edc3aab92323529.zip |
COMMON: Introduce a shared hash function for pointer types
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/lingo/lingo.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 479f8855a9..10ac868592 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -24,6 +24,7 @@ #define DIRECTOR_LINGO_LINGO_H #include "audio/audiostream.h" +#include "common/hash-ptr.h" #include "common/hash-str.h" #include "director/director.h" @@ -86,18 +87,7 @@ struct FuncDesc { FuncDesc(Common::String n, const char *p) { name = n; proto = p; } }; -struct Pointer_EqualTo { - bool operator()(const void *x, const void *y) const { return x == y; } -}; - -struct Pointer_Hash { - uint operator()(const void *x) const { - uint x = static_cast<uint>(reinterpret_cast<uintptr>(v)); - return x + (x >> 3); - } -}; - -typedef Common::HashMap<void *, FuncDesc *, Pointer_Hash, Pointer_EqualTo> FuncHash; +typedef Common::HashMap<void *, FuncDesc *> FuncHash; struct Symbol { /* symbol table entry */ Common::String name; |