From 7e40b159886bca5a2b4aea4b9b6449287f453748 Mon Sep 17 00:00:00 2001 From: "mccabe%netscape.com" Date: Sat, 26 Jun 1999 08:17:00 +0000 Subject: [PATCH] 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 for catching this. --- xpcom/typelib/xpt/src/xpt_xdr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xpcom/typelib/xpt/src/xpt_xdr.c b/xpcom/typelib/xpt/src/xpt_xdr.c index b231b6b906f2..64727503c585 100644 --- a/xpcom/typelib/xpt/src/xpt_xdr.c +++ b/xpcom/typelib/xpt/src/xpt_xdr.c @@ -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;