Backout bug 666612 (rev 897ee1cf8514) due to build bustage.

This commit is contained in:
Ryan VanderMeulen 2012-03-01 17:26:58 -05:00
parent 72e8d1d540
commit b510ff7205

View File

@ -39,7 +39,6 @@
#include "xpt_xdr.h"
#include "nspr.h"
#include "nscore.h"
#include <string.h> /* strchr */
static PRBool
@ -144,7 +143,7 @@ XPT_HashTableDestroy(XPTHashTable *table) {
static void *
XPT_HashTableAdd(XPTHashTable *table, void *key, void *value) {
XPTHashRecord **bucketloc = table->buckets +
(NS_PTR_TO_UINT32(key) % XPT_HASHSIZE);
(((PRUint32)key) % XPT_HASHSIZE);
XPTHashRecord *bucket;
while (*bucketloc != NULL)
@ -160,7 +159,7 @@ XPT_HashTableAdd(XPTHashTable *table, void *key, void *value) {
static void *
XPT_HashTableLookup(XPTHashTable *table, void *key) {
XPTHashRecord *bucket = table->buckets[NS_PTR_TO_UINT32(key) % XPT_HASHSIZE];
XPTHashRecord *bucket = table->buckets[(PRUint32)key % XPT_HASHSIZE];
while (bucket != NULL) {
if (bucket->key == key)
return bucket->value;
@ -484,29 +483,27 @@ XPT_DoCString(XPTArena *arena, XPTCursor *cursor, char **identp)
XPT_PUBLIC_API(PRUint32)
XPT_GetOffsetForAddr(XPTCursor *cursor, void *addr)
{
XPTHashTable *table = cursor->state->pool->offset_map;
return NS_PTR_TO_UINT32(XPT_HashTableLookup(table, addr));
return (PRUint32)XPT_HashTableLookup(cursor->state->pool->offset_map, addr);
}
XPT_PUBLIC_API(PRBool)
XPT_SetOffsetForAddr(XPTCursor *cursor, void *addr, PRUint32 offset)
{
return XPT_HashTableAdd(cursor->state->pool->offset_map,
addr, NS_INT32_TO_PTR(offset)) != NULL;
addr, (void *)offset) != NULL;
}
XPT_PUBLIC_API(PRBool)
XPT_SetAddrForOffset(XPTCursor *cursor, PRUint32 offset, void *addr)
{
return XPT_HashTableAdd(cursor->state->pool->offset_map,
NS_INT32_TO_PTR(offset), addr) != NULL;
(void *)offset, addr) != NULL;
}
XPT_PUBLIC_API(void *)
XPT_GetAddrForOffset(XPTCursor *cursor, PRUint32 offset)
{
return XPT_HashTableLookup(cursor->state->pool->offset_map,
NS_INT32_TO_PTR(offset));
return XPT_HashTableLookup(cursor->state->pool->offset_map, (void *)offset);
}
/* Used by XPT_PREAMBLE_NO_ALLOC. */