git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3031 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1998-10-03 22:38:23 +00:00
parent dc8f8736e6
commit 26e47289b1
2 changed files with 19 additions and 19 deletions

View file

@ -82,7 +82,7 @@
#define FAST_MAP_HASH(X) [(X).o hash] #define FAST_MAP_HASH(X) [(X).o hash]
#endif #endif
#ifndef FAST_MAP_EQUAL(X,Y) #ifndef FAST_MAP_EQUAL
#define FAST_MAP_EQUAL(X,Y) [(X).o isEqual: (Y).o] #define FAST_MAP_EQUAL(X,Y) [(X).o isEqual: (Y).o]
#endif #endif
@ -108,9 +108,9 @@ typedef FastMapEnumerator_t *FastMapEnumerator;
struct _FastMapNode { struct _FastMapNode {
FastMapNode nextInBucket; /* Linked list of bucket. */ FastMapNode nextInBucket; /* Linked list of bucket. */
FastMapNode nextInMap; /* For enumerating. */ FastMapNode nextInMap; /* For enumerating. */
FastmapItem key; FastMapItem key;
#if FAST_MAP_HAS_VALUE #if FAST_MAP_HAS_VALUE
FastmapItem value; FastMapItem value;
#endif #endif
}; };

View file

@ -94,9 +94,9 @@
withName: @"Dictionary content count"]; withName: @"Dictionary content count"];
while (node != 0) { while (node != 0) {
[(id<Encoding>)aCoder encodeObject: node->key [(id<Encoding>)aCoder encodeObject: node->key.o
withName: @"Dictionary key"]; withName: @"Dictionary key"];
[(id<Encoding>)aCoder encodeObject: node->value [(id<Encoding>)aCoder encodeObject: node->value.o
withName: @"Dictionary content"]; withName: @"Dictionary content"];
node = node->nextInMap; node = node->nextInMap;
} }
@ -116,7 +116,7 @@
while (count-- > 0) { while (count-- > 0) {
[(id<Decoding>)aCoder decodeObjectAt: &key withName: NULL]; [(id<Decoding>)aCoder decodeObjectAt: &key withName: NULL];
[(id<Decoding>)aCoder decodeObjectAt: &value withName: NULL]; [(id<Decoding>)aCoder decodeObjectAt: &value withName: NULL];
FastMapAddPairNoRetain(&map, key, value); FastMapAddPairNoRetain(&map, (FastMapItem)key, (FastMapItem)value);
} }
return self; return self;
@ -127,15 +127,15 @@
int i; int i;
FastMapInitWithZoneAndCapacity(&map, [self zone], c); FastMapInitWithZoneAndCapacity(&map, [self zone], c);
for (i = 0; i < c; i++) { for (i = 0; i < c; i++) {
FastMapNode node = FastMapNodeForKey(&map, keys[i]); FastMapNode node = FastMapNodeForKey(&map, (FastMapItem)keys[i]);
if (node) { if (node) {
[objs[i] retain]; [objs[i] retain];
[node->value release]; [node->value.o release];
node->value = objs[i]; node->value.o = objs[i];
} }
else { else {
FastMapAddPair(&map, keys[i], objs[i]); FastMapAddPair(&map, (FastMapItem)keys[i], (FastMapItem)objs[i]);
} }
} }
return self; return self;
@ -155,10 +155,10 @@
- (id) objectForKey: aKey - (id) objectForKey: aKey
{ {
FastMapNode node = FastMapNodeForKey(&map, aKey); FastMapNode node = FastMapNodeForKey(&map, (FastMapItem)aKey);
if (node) if (node)
return node->value; return node->value.o;
return nil; return nil;
} }
@ -183,21 +183,21 @@
- (void) setObject:anObject forKey:(NSObject *)aKey - (void) setObject:anObject forKey:(NSObject *)aKey
{ {
FastMapNode node = FastMapNodeForKey(&map, aKey); FastMapNode node = FastMapNodeForKey(&map, (FastMapItem)aKey);
if (node) { if (node) {
[anObject retain]; [anObject retain];
[node->value release]; [node->value.o release];
node->value = anObject; node->value.o = anObject;
} }
else { else {
FastMapAddPair(&map, aKey, anObject); FastMapAddPair(&map, (FastMapItem)aKey, (FastMapItem)anObject);
} }
} }
- (void) removeObjectForKey:(NSObject *)aKey - (void) removeObjectForKey:(NSObject *)aKey
{ {
FastMapRemoveKey(&map, aKey); FastMapRemoveKey(&map, (FastMapItem)aKey);
} }
@end @end
@ -220,7 +220,7 @@
return nil; return nil;
} }
node = node->nextInMap; node = node->nextInMap;
return old->key; return old->key.o;
} }
- (void) dealloc - (void) dealloc
@ -241,7 +241,7 @@
return nil; return nil;
} }
node = node->nextInMap; node = node->nextInMap;
return old->value; return old->value.o;
} }
@end @end