Fix build.
This commit is contained in:
parent
0f52f6931b
commit
2c1a398292
@ -568,12 +568,12 @@ static inline uint32_t
|
||||
HashInt64(int64_t key)
|
||||
{
|
||||
key = (~key) + (key << 18); // key = (key << 18) - key - 1;
|
||||
key = key ^ (uint64(key) >> 31);
|
||||
key = key ^ (uint64_t(key) >> 31);
|
||||
key = key * 21; // key = (key + (key << 2)) + (key << 4);
|
||||
key = key ^ (uint64(key) >> 11);
|
||||
key = key ^ (uint64_t(key) >> 11);
|
||||
key = key + (key << 6);
|
||||
key = key ^ (uint64(key) >> 22);
|
||||
return uint32(key);
|
||||
key = key ^ (uint64_t(key) >> 22);
|
||||
return uint32_t(key);
|
||||
}
|
||||
|
||||
template <size_t Size>
|
||||
|
@ -48,18 +48,12 @@ namespace ke {
|
||||
|
||||
static const size_t kMallocAlignment = sizeof(void *) * 2;
|
||||
|
||||
typedef uint8_t uint8;
|
||||
typedef int32_t int32;
|
||||
typedef uint32_t uint32;
|
||||
typedef int64_t int64;
|
||||
typedef uint64_t uint64;
|
||||
|
||||
typedef uint8 * Address;
|
||||
|
||||
static const size_t kKB = 1024;
|
||||
static const size_t kMB = 1024 * kKB;
|
||||
static const size_t kGB = 1024 * kMB;
|
||||
|
||||
typedef uint8_t * Address;
|
||||
|
||||
template <typename T> T
|
||||
ReturnAndVoid(T &t)
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ namespace SourceMod
|
||||
// default. It is okay to use |T *|, the functions will still be looked up
|
||||
// on |T|.
|
||||
template <typename T, typename KeyPolicy = T>
|
||||
class NameHashSet : public SystemAllocatorPolicy
|
||||
class NameHashSet : public ke::SystemAllocatorPolicy
|
||||
{
|
||||
typedef detail::CharsAndLength CharsAndLength;
|
||||
|
||||
@ -94,7 +94,7 @@ class NameHashSet : public SystemAllocatorPolicy
|
||||
}
|
||||
};
|
||||
|
||||
typedef HashTable<Policy<T, KeyPolicy>, SystemAllocatorPolicy> Internal;
|
||||
typedef ke::HashTable<Policy<T, KeyPolicy>, ke::SystemAllocatorPolicy> Internal;
|
||||
|
||||
public:
|
||||
NameHashSet()
|
||||
|
@ -52,8 +52,6 @@
|
||||
namespace SourceMod
|
||||
{
|
||||
|
||||
using namespace ke;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
class CharsAndLength
|
||||
@ -89,7 +87,7 @@ namespace detail
|
||||
|
||||
struct StringHashMapPolicy
|
||||
{
|
||||
static inline bool matches(const CharsAndLength &lookup, const AString &key) {
|
||||
static inline bool matches(const CharsAndLength &lookup, const ke::AString &key) {
|
||||
return lookup.length() == key.length() &&
|
||||
memcmp(lookup.chars(), key.chars(), key.length()) == 0;
|
||||
}
|
||||
@ -103,11 +101,11 @@ template <typename T>
|
||||
class StringHashMap
|
||||
{
|
||||
typedef detail::CharsAndLength CharsAndLength;
|
||||
typedef HashMap<AString, T, detail::StringHashMapPolicy> Internal;
|
||||
typedef ke::HashMap<ke::AString, T, detail::StringHashMapPolicy> Internal;
|
||||
|
||||
public:
|
||||
StringHashMap()
|
||||
: internal_(SystemAllocatorPolicy()),
|
||||
: internal_(ke::SystemAllocatorPolicy()),
|
||||
memory_used_(0)
|
||||
{
|
||||
if (!internal_.init())
|
||||
|
Loading…
Reference in New Issue
Block a user