diff --git a/ChangeLog b/ChangeLog index ba5f0f595..63052ba81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-16 Richard Frith-Macdonald + + * Headers/Additions/GNUstepBase/GSUnion.h: add NSUInteger type as addr + * Headers/Additions/GNUstepBase/GSIMap.h: use addr for + GSIMapNodeForSimpleKey() so that it works for pointers + on machines where sizeof(int) != sizeof(void*) + 2008-06-15 Richard Frith-Macdonald * Source/Additions/GSMime.m: Be more tolerant of illegal data in diff --git a/Headers/Additions/GNUstepBase/GSIMap.h b/Headers/Additions/GNUstepBase/GSIMap.h index 841422b71..1a59f5081 100644 --- a/Headers/Additions/GNUstepBase/GSIMap.h +++ b/Headers/Additions/GNUstepBase/GSIMap.h @@ -576,9 +576,9 @@ GSIMapNodeForSimpleKey(GSIMapTable map, GSIMapKey key) { return 0; } - bucket = map->buckets + key.uint % map->bucketCount; + bucket = map->buckets + key.addr % map->bucketCount; node = bucket->firstNode; - while ((node != 0) && node->key.uint != key.uint) + while ((node != 0) && node->key.addr != key.addr) { node = node->nextInBucket; } diff --git a/Headers/Additions/GNUstepBase/GSUnion.h b/Headers/Additions/GNUstepBase/GSUnion.h index c3703cd31..c166922ef 100644 --- a/Headers/Additions/GNUstepBase/GSUnion.h +++ b/Headers/Additions/GNUstepBase/GSUnion.h @@ -23,6 +23,10 @@ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02111 USA. */ +/* Need Foundation/NSObjCRuntime.h for type declarations. + */ +#import + /* * Definitions for bitmap mask of types of element in union. */ @@ -58,6 +62,7 @@ #if defined(GSUNION) && defined(GSUNION_TYPES) typedef union { + NSUInteger addr; #if ((GSUNION_TYPES) & GSUNION_OBJ) id obj; NSObject *nso;