diff -r 0ebc3ea8884d -r 0352326a1f3f knight/shared/KeHashTable.cpp --- a/knight/shared/KeHashTable.cpp Wed Jan 28 02:14:41 2009 -0600 +++ b/knight/shared/KeHashTable.cpp Thu Jan 29 12:50:32 2009 -0500 @@ -1,3 +1,4 @@ +#include #include using namespace Knight; @@ -82,7 +83,7 @@ table->key_m = *key_marshal; table->val_m = *val_marshal; table->num_entries = 0; - table->shift = bits; + table->shift = 32 - bits; table->node_alloc = nodeAlloc == NULL ? &s_DefHashAllocator : nodeAlloc; table->num_buckets = (1 << bits); table->grow_limit = (uint32_t)(0.9f * table->num_buckets); @@ -145,7 +146,7 @@ /* Save new data */ table->num_buckets = (1 << new_shift); - table->shift = new_shift; + table->shift = 32 - new_shift; table->grow_limit = (uint32_t)(0.9f * table->num_buckets); table->buckets = (KeHashNode **)malloc(sizeof(KeHashNode *) * table->num_buckets); @@ -407,3 +408,9 @@ return h; } + +bool Knight::KE_AreStringsEqual(const void* str1, const void* str2) +{ + return (strcmp((const char*)str1, (const char*)str2) == 0) ? true : false; +} +