diff --git a/ChangeLog b/ChangeLog index 1998ecdc1..fb24ce47b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * Source/NSUserDefaults.m: ([setObject:forKey:]) when given a nil value to set, remove any existing object for the key. Fix for MacOS-X compatibility (bug #10743). + * Source/Additions/GSXML.m: Tweaks for 64-bit processors where + sizeof int is not sizeof void* + Minor optimisaion ... improve hash values. 2004-10-29 Matt Rice diff --git a/Source/Additions/GSXML.m b/Source/Additions/GSXML.m index 8205fa8f2..2d000f018 100644 --- a/Source/Additions/GSXML.m +++ b/Source/Additions/GSXML.m @@ -219,14 +219,14 @@ static NSMapTable *attrNames = 0; { NSMapEnumerator enumerator; NSString *val; - int key; + void *key; enumerator = NSEnumerateMapTable(attrNames); - while (NSNextMapEnumeratorPair(&enumerator, (void**)&key, (void**)&val)) + while (NSNextMapEnumeratorPair(&enumerator, &key, (void**)&val)) { if ([desc isEqual: val] == YES) { - return key; + return (int)key; } } return -1; @@ -391,7 +391,7 @@ static NSMapTable *attrNames = 0; - (unsigned) hash { - return (unsigned)lib; + return (((unsigned)lib) >> 3); } - (id) init @@ -568,14 +568,14 @@ static NSMapTable *nsNames = 0; { NSMapEnumerator enumerator; NSString *val; - int key; + void *key; enumerator = NSEnumerateMapTable(nsNames); - while (NSNextMapEnumeratorPair(&enumerator, (void**)&key, (void**)&val)) + while (NSNextMapEnumeratorPair(&enumerator, &key, (void**)&val)) { if ([desc isEqual: val] == YES) { - return key; + return (int)key; } } return -1; @@ -594,7 +594,7 @@ static NSMapTable *nsNames = 0; - (unsigned) hash { - return (unsigned)lib; + return (((unsigned)lib) >> 3); } /** @@ -795,14 +795,14 @@ static NSMapTable *nodeNames = 0; { NSMapEnumerator enumerator; NSString *val; - int key; + void *key; enumerator = NSEnumerateMapTable(nodeNames); - while (NSNextMapEnumeratorPair(&enumerator, (void**)&key, (void**)&val)) + while (NSNextMapEnumeratorPair(&enumerator, &key, (void**)&val)) { if ([desc isEqual: val] == YES) { - return key; + return (int)key; } } return -1; @@ -1053,7 +1053,7 @@ static NSMapTable *nodeNames = 0; - (unsigned) hash { - return (unsigned)lib; + return (((unsigned)lib) >> 3); } - (id) init