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
This commit is contained in:
Richard Frith-MacDonald 2008-06-16 15:34:50 +00:00
parent d47b05cec0
commit 2b65b50b9a
3 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2008-06-16 Richard Frith-Macdonald <rfm@gnu.org>
* 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 <rfm@gnu.org> 2008-06-15 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSMime.m: Be more tolerant of illegal data in * Source/Additions/GSMime.m: Be more tolerant of illegal data in

View file

@ -576,9 +576,9 @@ GSIMapNodeForSimpleKey(GSIMapTable map, GSIMapKey key)
{ {
return 0; return 0;
} }
bucket = map->buckets + key.uint % map->bucketCount; bucket = map->buckets + key.addr % map->bucketCount;
node = bucket->firstNode; node = bucket->firstNode;
while ((node != 0) && node->key.uint != key.uint) while ((node != 0) && node->key.addr != key.addr)
{ {
node = node->nextInBucket; node = node->nextInBucket;
} }

View file

@ -23,6 +23,10 @@
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02111 USA. */ * Boston, MA 02111 USA. */
/* Need Foundation/NSObjCRuntime.h for type declarations.
*/
#import <Foundation/NSObjCRuntime.h>
/* /*
* Definitions for bitmap mask of types of element in union. * Definitions for bitmap mask of types of element in union.
*/ */
@ -58,6 +62,7 @@
#if defined(GSUNION) && defined(GSUNION_TYPES) #if defined(GSUNION) && defined(GSUNION_TYPES)
typedef union { typedef union {
NSUInteger addr;
#if ((GSUNION_TYPES) & GSUNION_OBJ) #if ((GSUNION_TYPES) & GSUNION_OBJ)
id obj; id obj;
NSObject *nso; NSObject *nso;