Fix warning fix by casting void * (to go into a hashtable) as an unsigned int rather than as an int, which busts on platforms that have the high bit set for pointers.

Thanks to Duncan Wilcox <duncan@be.com> for catching this.
This commit is contained in:
mccabe%netscape.com 1999-06-26 08:17:00 +00:00
Родитель c5212ea3bd
Коммит 7e40b15988
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -117,7 +117,8 @@ XPT_HashTableDestroy(XPTHashTable *table) {
static void *
XPT_HashTableAdd(XPTHashTable *table, void *key, void *value) {
XPTHashRecord **bucketloc = table->buckets + (((PRInt32)key) % XPT_HASHSIZE);
XPTHashRecord **bucketloc = table->buckets +
(((PRUint32)key) % XPT_HASHSIZE);
XPTHashRecord *bucket;
while (*bucketloc != NULL)
@ -133,7 +134,7 @@ XPT_HashTableAdd(XPTHashTable *table, void *key, void *value) {
static void *
XPT_HashTableLookup(XPTHashTable *table, void *key) {
XPTHashRecord *bucket = table->buckets[(PRInt32)key % XPT_HASHSIZE];
XPTHashRecord *bucket = table->buckets[(PRUint32)key % XPT_HASHSIZE];
while (bucket != NULL) {
if (bucket->key == key)
return bucket->value;