зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
c5212ea3bd
Коммит
7e40b15988
|
@ -117,7 +117,8 @@ XPT_HashTableDestroy(XPTHashTable *table) {
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
XPT_HashTableAdd(XPTHashTable *table, void *key, void *value) {
|
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;
|
XPTHashRecord *bucket;
|
||||||
|
|
||||||
while (*bucketloc != NULL)
|
while (*bucketloc != NULL)
|
||||||
|
@ -133,7 +134,7 @@ XPT_HashTableAdd(XPTHashTable *table, void *key, void *value) {
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
XPT_HashTableLookup(XPTHashTable *table, void *key) {
|
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) {
|
while (bucket != NULL) {
|
||||||
if (bucket->key == key)
|
if (bucket->key == key)
|
||||||
return bucket->value;
|
return bucket->value;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче