From 2b65b50b9ad2374a73fdb2fb2ce7cb20ce4fc2c9 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Mon, 16 Jun 2008 15:34:50 +0000 Subject: [PATCH] backport fix for some 64bit systems. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/stable@26671 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Headers/Additions/GNUstepBase/GSIMap.h | 4 ++-- Headers/Additions/GNUstepBase/GSUnion.h | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) 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;