Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Hash_impl
changeset 32:bd376656f8ab MC_shared
assuming you were not having fun thinking up silly ways to write 0
| author | Nina Engelhardt <nengel@mailbox.tu-berlin.de> |
|---|---|
| date | Wed, 24 Apr 2013 16:35:19 +0200 |
| parents | 18a72865dd78 |
| children | |
| files | PrivateHash.c PrivateHash.h |
| diffstat | 2 files changed, 3 insertions(+), 2 deletions(-) [+] |
line diff
1.1 --- a/PrivateHash.c Wed Mar 06 14:35:01 2013 +0100 1.2 +++ b/PrivateHash.c Wed Apr 24 16:35:19 2013 +0200 1.3 @@ -329,7 +329,7 @@ 1.4 retTable = VMS_int__malloc( sizeof( HashTable ) ); 1.5 1.6 numHashSlots = 1 << powerOf2OfSz; 1.7 - retTable->hashMask = 0xffffffff >> 32 - powerOf2OfSz; 1.8 + retTable->hashMask = 0xffffffff >> (32 - powerOf2OfSz); 1.9 retTable->prevHash = (int32)rand(); 1.10 1.11 retTable->freeEntryContentFn = freeFn; 1.12 @@ -372,7 +372,7 @@ 1.13 1.14 testEntry = getEntryFromTable32( (uint32 *)entry->key, table ); 1.15 if( testEntry == NULL ) //no entry w/key, so add passed-in as list-head 1.16 - { hashIdx = hashThisKey32( entry->key, table->tableSz ); 1.17 + { hashIdx = hashThisKey32( (uint32 *)entry->key, table ); 1.18 entry->next = (table->entries)[hashIdx]; 1.19 (table->entries)[hashIdx] = entry; 1.20 table->numEntries += 1;
2.1 --- a/PrivateHash.h Wed Mar 06 14:35:01 2013 +0100 2.2 +++ b/PrivateHash.h Wed Apr 24 16:35:19 2013 +0200 2.3 @@ -80,6 +80,7 @@ 2.4 void *getValueFromTable32( uint32 key[], HashTable *table ); 2.5 2.6 bool32 deleteEntryFromTable32( uint32 key[], HashTable *table ); 2.7 +int32 hashThisKey32( uint32 *key, HashTable *hashTable ); 2.8 2.9 //=========================================================================== 2.10 // Internal functions
