Hacks by Greg to placate 4.1 compiler. Just in case we can't persuade them

to 'fix' cast to union with an 'id' member.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21783 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2005-10-07 09:57:51 +00:00
parent 5176256189
commit df079ffd3f
8 changed files with 25 additions and 25 deletions

View file

@ -127,7 +127,7 @@ cacheAttributes(NSDictionary *attrs)
GSIMapNode node;
ALOCK();
node = GSIMapNodeForKey(&attrMap, (GSIMapKey)attrs);
node = GSIMapNodeForKey(&attrMap, (GSIMapKey)((id)attrs));
if (node == 0)
{
/*
@ -135,7 +135,7 @@ cacheAttributes(NSDictionary *attrs)
* in an immutable dictionary that can safely be cached.
*/
attrs = [[NSDictionary alloc] initWithDictionary: attrs copyItems: NO];
GSIMapAddPair(&attrMap, (GSIMapKey)attrs, (GSIMapVal)(unsigned)1);
GSIMapAddPair(&attrMap, (GSIMapKey)((id)attrs), (GSIMapVal)(unsigned)1);
}
else
{
@ -152,12 +152,12 @@ unCacheAttributes(NSDictionary *attrs)
GSIMapBucket bucket;
ALOCK();
bucket = GSIMapBucketForKey(&attrMap, (GSIMapKey)attrs);
bucket = GSIMapBucketForKey(&attrMap, (GSIMapKey)((id)attrs));
if (bucket != 0)
{
GSIMapNode node;
node = GSIMapNodeForKeyInBucket(&attrMap, bucket, (GSIMapKey)attrs);
node = GSIMapNodeForKeyInBucket(&attrMap, bucket, (GSIMapKey)((id)attrs));
if (node != 0)
{
if (--node->value.uint == 0)

View file

@ -3077,8 +3077,8 @@ static void callEncoder (DOContext *ctxt)
NSAssert(node == 0, NSInternalInconsistencyException);
RETAIN(anObj);
GSIMapAddPair(_localObjects, (GSIMapKey)object, (GSIMapVal)anObj);
GSIMapAddPair(_localTargets, (GSIMapKey)target, (GSIMapVal)anObj);
GSIMapAddPair(_localObjects, (GSIMapKey)object, (GSIMapVal)((id)anObj));
GSIMapAddPair(_localTargets, (GSIMapKey)target, (GSIMapVal)((id)anObj));
if (debug_connection > 2)
NSLog(@"add local object (0x%x) target (0x%x) "
@ -3307,7 +3307,7 @@ static void callEncoder (DOContext *ctxt)
GSIMapRemoveKey(_localTargets, (GSIMapKey)nTarget);
((ProxyStruct*)proxy)->_handle = target;
GSIMapAddPair(_localTargets, (GSIMapKey)target,
(GSIMapVal)proxy);
(GSIMapVal)((id)proxy));
}
M_UNLOCK(c->_proxiesGate);
}
@ -3464,7 +3464,7 @@ static void callEncoder (DOContext *ctxt)
if (p == nil && aProxy != nil)
{
p = aProxy;
GSIMapAddPair(_remoteProxies, (GSIMapKey)aTarget, (GSIMapVal)p);
GSIMapAddPair(_remoteProxies, (GSIMapKey)aTarget, (GSIMapVal)((id)p));
}
/*
* Whether this is a new proxy or an existing proxy, this method is

View file

@ -765,7 +765,7 @@ static NSMapTable globalClassMap = 0;
count = [_objects count];
GSIArrayInitWithZoneAndCapacity(_objMap, _zone, count);
// Add marker for nil object
GSIArrayAddItem(_objMap, (GSIArrayItem)[NSNull null]);
GSIArrayAddItem(_objMap, (GSIArrayItem)((id)[NSNull null]));
// Add markers for unencoded objects.
for (i = 1; i < count; i++)
{

View file

@ -697,7 +697,7 @@ static NSNotificationCenter *default_center = nil;
/*
* Locate the map table for this name - create it if not present.
*/
n = GSIMapNodeForKey(NAMED, (GSIMapKey)name);
n = GSIMapNodeForKey(NAMED, (GSIMapKey)(id)name);
if (n == 0)
{
m = mapNew(TABLE);
@ -706,7 +706,7 @@ static NSNotificationCenter *default_center = nil;
* copy of the name so it cannot be mutated while in the map.
*/
name = [name copyWithZone: NSDefaultMallocZone()];
GSIMapAddPair(NAMED, (GSIMapKey)name, (GSIMapVal)(void*)m);
GSIMapAddPair(NAMED, (GSIMapKey)(id)name, (GSIMapVal)(void*)m);
}
else
{
@ -842,7 +842,7 @@ static NSNotificationCenter *default_center = nil;
if (m->nodeCount == 0)
{
mapFree(TABLE, m);
GSIMapRemoveKey(NAMED, (GSIMapKey)thisName);
GSIMapRemoveKey(NAMED, (GSIMapKey)(id)thisName);
}
}
@ -879,7 +879,7 @@ static NSNotificationCenter *default_center = nil;
/*
* Locate the map table for this name.
*/
n0 = GSIMapNodeForKey(NAMED, (GSIMapKey)name);
n0 = GSIMapNodeForKey(NAMED, (GSIMapKey)((id)name));
if (n0 == 0)
{
unlockNCTable(TABLE);
@ -911,7 +911,7 @@ static NSNotificationCenter *default_center = nil;
if (m->nodeCount == 0)
{
mapFree(TABLE, m);
GSIMapRemoveKey(NAMED, (GSIMapKey)name);
GSIMapRemoveKey(NAMED, (GSIMapKey)((id)name));
}
}
unlockNCTable(TABLE);
@ -1000,7 +1000,7 @@ static NSNotificationCenter *default_center = nil;
*/
if (name)
{
n = GSIMapNodeForKey(NAMED, (GSIMapKey)name);
n = GSIMapNodeForKey(NAMED, (GSIMapKey)((id)name));
if (n)
{
m = (GSIMapTable)n->value.ptr;

View file

@ -695,7 +695,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
GSNameFromClass([self class]), GSNameFromSelector(_cmd));
}
classInfo = [GSClassInfo newWithClass: c andVersion: cver];
GSIArrayAddItem(_clsAry, (GSIArrayItem)classInfo);
GSIArrayAddItem(_clsAry, (GSIArrayItem)((id)classInfo));
*(Class*)address = classInfo->class;
/*
* Point the address to a dummy location and read the

View file

@ -412,7 +412,7 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
{
item->_date = RETAIN(theFuture);
}
GSIArrayInsertSorted(watchers, (GSIArrayItem)item, aSort);
GSIArrayInsertSorted(watchers, (GSIArrayItem)((id)item), aSort);
}
- (void) _checkPerformers: (GSRunLoopCtxt*)context
@ -763,7 +763,7 @@ extern IMP wRetImp;
RELEASE(context);
}
timers = context->timers;
GSIArrayInsertSorted(timers, (GSIArrayItem)timer, aSort);
GSIArrayInsertSorted(timers, (GSIArrayItem)((id)timer), aSort);
}
@ -816,7 +816,7 @@ extern IMP wRetImp;
if (timerInvalidated(min_timer) == NO)
{
GSIArrayInsertSortedNoRetain(timers,
(GSIArrayItem)min_timer, aSort);
(GSIArrayItem)((id)min_timer), aSort);
}
else
{
@ -880,7 +880,7 @@ extern IMP wRetImp;
*/
ASSIGN(min_watcher->_date, nxt);
GSIArrayInsertSortedNoRetain(watchers,
(GSIArrayItem)min_watcher, aSort);
(GSIArrayItem)((id)min_watcher), aSort);
}
else
{
@ -1326,13 +1326,13 @@ extern IMP wRetImp;
p = GSIArrayItemAtIndex(performers, i).obj;
if (p->order > order)
{
GSIArrayInsertItem(performers, (GSIArrayItem)item, i);
GSIArrayInsertItem(performers, (GSIArrayItem)((id)item), i);
break;
}
}
if (i == end)
{
GSIArrayInsertItem(performers, (GSIArrayItem)item, i);
GSIArrayInsertItem(performers, (GSIArrayItem)((id)item), i);
}
}
RELEASE(item);

View file

@ -592,7 +592,7 @@ deserializeFromInfo(_NSDeserializerInfo* info)
*/
if (info->didUnique)
{
GSIArrayAddItem(&info->array, (GSIArrayItem)s);
GSIArrayAddItem(&info->array, (GSIArrayItem)((id)s));
}
return s;
}
@ -650,7 +650,7 @@ deserializeFromInfo(_NSDeserializerInfo* info)
*/
if (info->didUnique)
{
GSIArrayAddItem(&info->array, (GSIArrayItem)s);
GSIArrayAddItem(&info->array, (GSIArrayItem)((id)s));
}
return s;
}

View file

@ -757,7 +757,7 @@ static Class NSDataMallocClass;
}
RELEASE(className);
classInfo->version = cver;
GSIArrayAddItem(clsMap, (GSIArrayItem)classInfo);
GSIArrayAddItem(clsMap, (GSIArrayItem)((id)classInfo));
*(Class*)address = mapClassObject(classInfo);
/*
* Point the address to a dummy location and read the