diff --git a/public/amtl/am-hashtable.h b/public/amtl/am-hashtable.h index 3fbb0acd..18e743cb 100644 --- a/public/amtl/am-hashtable.h +++ b/public/amtl/am-hashtable.h @@ -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 diff --git a/public/amtl/am-utility.h b/public/amtl/am-utility.h index 83281cb9..3d2c6c4a 100644 --- a/public/amtl/am-utility.h +++ b/public/amtl/am-utility.h @@ -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 T ReturnAndVoid(T &t) { diff --git a/public/sm_namehashset.h b/public/sm_namehashset.h index 2ff1cb11..12cd7d6e 100644 --- a/public/sm_namehashset.h +++ b/public/sm_namehashset.h @@ -55,7 +55,7 @@ namespace SourceMod // default. It is okay to use |T *|, the functions will still be looked up // on |T|. template -class NameHashSet : public SystemAllocatorPolicy +class NameHashSet : public ke::SystemAllocatorPolicy { typedef detail::CharsAndLength CharsAndLength; @@ -94,7 +94,7 @@ class NameHashSet : public SystemAllocatorPolicy } }; - typedef HashTable, SystemAllocatorPolicy> Internal; + typedef ke::HashTable, ke::SystemAllocatorPolicy> Internal; public: NameHashSet() diff --git a/public/sm_stringhashmap.h b/public/sm_stringhashmap.h index 093bec0f..5d5b305d 100644 --- a/public/sm_stringhashmap.h +++ b/public/sm_stringhashmap.h @@ -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 class StringHashMap { typedef detail::CharsAndLength CharsAndLength; - typedef HashMap Internal; + typedef ke::HashMap Internal; public: StringHashMap() - : internal_(SystemAllocatorPolicy()), + : internal_(ke::SystemAllocatorPolicy()), memory_used_(0) { if (!internal_.init())