mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
fixups for libobjc2
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29753 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f366d9d303
commit
7ff4d4c9c7
67 changed files with 328 additions and 253 deletions
|
@ -157,7 +157,7 @@ static Class gcClass = 0;
|
|||
_contents[_count] = RETAIN(objects[_count]);
|
||||
if (_contents[_count] == nil)
|
||||
{
|
||||
[self release];
|
||||
DESTROY(self);
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Nil object to be added in array"];
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ static Class gcClass = 0;
|
|||
_contents[_count] = RETAIN(objects[_count]);
|
||||
if (_contents[_count] == nil)
|
||||
{
|
||||
[self release];
|
||||
DESTROY(self);
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Nil object to be added in array"];
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ static Class gcClass = 0;
|
|||
|
||||
if (!keys[count] || !objects[count])
|
||||
{
|
||||
[self release];
|
||||
DESTROY(self);
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Nil object added in dictionary"];
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ static SEL objSel;
|
|||
return RETAIN(self);
|
||||
}
|
||||
|
||||
- (unsigned) count
|
||||
- (NSUInteger) count
|
||||
{
|
||||
return map.nodeCount;
|
||||
}
|
||||
|
@ -111,13 +111,13 @@ static SEL objSel;
|
|||
}
|
||||
else
|
||||
{
|
||||
unsigned count = map.nodeCount;
|
||||
NSUInteger count = map.nodeCount;
|
||||
SEL sel = @selector(encodeObject:);
|
||||
IMP imp = [aCoder methodForSelector: sel];
|
||||
GSIMapEnumerator_t enumerator = GSIMapEnumeratorForMap(&map);
|
||||
GSIMapNode node = GSIMapEnumeratorNextNode(&enumerator);
|
||||
|
||||
[aCoder encodeValueOfObjCType: @encode(unsigned) at: &count];
|
||||
[aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &count];
|
||||
while (node != 0)
|
||||
{
|
||||
(*imp)(aCoder, sel, node->key.obj);
|
||||
|
@ -128,7 +128,7 @@ static SEL objSel;
|
|||
}
|
||||
}
|
||||
|
||||
- (unsigned) hash
|
||||
- (NSUInteger) hash
|
||||
{
|
||||
return map.nodeCount;
|
||||
}
|
||||
|
@ -146,14 +146,14 @@ static SEL objSel;
|
|||
}
|
||||
else
|
||||
{
|
||||
unsigned count;
|
||||
NSUInteger count;
|
||||
id key;
|
||||
id value;
|
||||
SEL sel = @selector(decodeValueOfObjCType:at:);
|
||||
IMP imp = [aCoder methodForSelector: sel];
|
||||
const char *type = @encode(id);
|
||||
|
||||
[aCoder decodeValueOfObjCType: @encode(unsigned)
|
||||
[aCoder decodeValueOfObjCType: @encode(NSUInteger)
|
||||
at: &count];
|
||||
|
||||
GSIMapInitWithZoneAndCapacity(&map, GSObjCZone(self), count);
|
||||
|
@ -168,9 +168,9 @@ static SEL objSel;
|
|||
}
|
||||
|
||||
/* Designated initialiser */
|
||||
- (id) initWithObjects: (id*)objs forKeys: (id*)keys count: (unsigned)c
|
||||
- (id) initWithObjects: (id*)objs forKeys: (id*)keys count: (NSUInteger)c
|
||||
{
|
||||
unsigned int i;
|
||||
NSUInteger i;
|
||||
|
||||
GSIMapInitWithZoneAndCapacity(&map, GSObjCZone(self), c);
|
||||
for (i = 0; i < c; i++)
|
||||
|
@ -179,13 +179,13 @@ static SEL objSel;
|
|||
|
||||
if (keys[i] == nil)
|
||||
{
|
||||
IF_NO_GC(AUTORELEASE(self));
|
||||
DESTROY(self);
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Tried to init dictionary with nil key"];
|
||||
}
|
||||
if (objs[i] == nil)
|
||||
{
|
||||
IF_NO_GC(AUTORELEASE(self));
|
||||
DESTROY(self);
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Tried to init dictionary with nil value"];
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ static SEL objSel;
|
|||
copyItems: (BOOL)shouldCopy
|
||||
{
|
||||
NSZone *z = GSObjCZone(self);
|
||||
unsigned c = [other count];
|
||||
NSUInteger c = [other count];
|
||||
|
||||
GSIMapInitWithZoneAndCapacity(&map, z, c);
|
||||
if (c > 0)
|
||||
|
@ -221,7 +221,7 @@ static SEL objSel;
|
|||
IMP nxtObj = [e methodForSelector: nxtSel];
|
||||
IMP otherObj = [other methodForSelector: objSel];
|
||||
BOOL isProxy = [other isProxy];
|
||||
unsigned i;
|
||||
NSUInteger i;
|
||||
|
||||
for (i = 0; i < c; i++)
|
||||
{
|
||||
|
@ -242,7 +242,7 @@ static SEL objSel;
|
|||
k = [k copyWithZone: z];
|
||||
if (k == nil)
|
||||
{
|
||||
IF_NO_GC(AUTORELEASE(self));
|
||||
DESTROY(self);
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Tried to init dictionary with nil key"];
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ static SEL objSel;
|
|||
}
|
||||
if (o == nil)
|
||||
{
|
||||
IF_NO_GC(AUTORELEASE(self));
|
||||
DESTROY(self);
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Tried to init dictionary with nil value"];
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ static SEL objSel;
|
|||
|
||||
- (BOOL) isEqualToDictionary: (NSDictionary*)other
|
||||
{
|
||||
unsigned count;
|
||||
NSUInteger count;
|
||||
|
||||
if (other == self)
|
||||
{
|
||||
|
@ -363,7 +363,7 @@ static SEL objSel;
|
|||
}
|
||||
|
||||
/* Designated initialiser */
|
||||
- (id) initWithCapacity: (unsigned)cap
|
||||
- (id) initWithCapacity: (NSUInteger)cap
|
||||
{
|
||||
GSIMapInitWithZoneAndCapacity(&map, GSObjCZone(self), cap);
|
||||
return self;
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
|
||||
if ([NSThread isMultiThreaded] == YES)
|
||||
{
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
self = [NSLock new];
|
||||
}
|
||||
else
|
||||
|
@ -229,7 +229,7 @@
|
|||
|
||||
if ([NSThread isMultiThreaded] == YES)
|
||||
{
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
self = [NSRecursiveLock new];
|
||||
}
|
||||
else
|
||||
|
|
|
@ -423,7 +423,7 @@ static NSMapTable *attrNames = 0;
|
|||
- (id) init
|
||||
{
|
||||
NSLog(@"GSXMLDocument: calling -init is not legal");
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -641,7 +641,7 @@ static NSMapTable *nsNames = 0;
|
|||
- (id) init
|
||||
{
|
||||
NSLog(@"GSXMLNamespace: calling -init is not legal");
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -1093,7 +1093,7 @@ static NSMapTable *nodeNames = 0;
|
|||
- (id) init
|
||||
{
|
||||
NSLog(@"GSXMLNode: calling -init is not legal");
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -1980,13 +1980,13 @@ static NSString *endMarker = @"At end of incremental parse";
|
|||
else
|
||||
{
|
||||
NSLog(@"Bad GSSAXHandler object passed to GSXMLParser initialiser");
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
[saxHandler _setParser: self];
|
||||
if ([self _initLibXML] == NO)
|
||||
{
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
return self;
|
||||
|
@ -2009,7 +2009,7 @@ static NSString *endMarker = @"At end of incremental parse";
|
|||
if (path == nil || [path isKindOfClass: NSString_class] == NO)
|
||||
{
|
||||
NSLog(@"Bad file path passed to initialize GSXMLParser");
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
src = [path copy];
|
||||
|
@ -2034,7 +2034,7 @@ static NSString *endMarker = @"At end of incremental parse";
|
|||
if (url == nil || [url isKindOfClass: [NSURL class]] == NO)
|
||||
{
|
||||
NSLog(@"Bad NSURL passed to initialize GSXMLParser");
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
src = [url copy];
|
||||
|
@ -2059,7 +2059,7 @@ static NSString *endMarker = @"At end of incremental parse";
|
|||
if (data == nil || [data isKindOfClass: [NSData class]] == NO)
|
||||
{
|
||||
NSLog(@"Bad NSData passed to initialize GSXMLParser");
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
src = [data copy];
|
||||
|
@ -3014,7 +3014,7 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
|
|||
if ([self _initLibXML] == NO)
|
||||
{
|
||||
NSLog(@"GSSAXHandler: out of memory\n");
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
@ -3594,7 +3594,7 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
|
|||
@implementation GSXPathObject
|
||||
- (id) init
|
||||
{
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -4163,14 +4163,14 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
{
|
||||
NSLog(@"Not built with libxml ... %@ unusable in %@",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd));
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
- (id) initWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
NSLog(@"Not built with libxml ... %@ unusable in %@",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd));
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -130,7 +130,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
|
||||
if (getAddr(a, s, p, &sin) == NO)
|
||||
{
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
NSLog(@"bad address-service-protocol combination");
|
||||
return nil;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
if ((net = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) < 0)
|
||||
{
|
||||
NSLog(@"unable to create socket - %@", [NSError _last]);
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
NSLog(@"unable to bind to port %s:%d - %@", inet_ntoa(sin.sin_addr),
|
||||
NSSwapBigShortToHost(sin.sin_port), [NSError _last]);
|
||||
(void) close(net);
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
{
|
||||
NSLog(@"unable to listen on port - %@", [NSError _last]);
|
||||
(void) close(net);
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
{
|
||||
NSLog(@"unable to get socket name - %@", [NSError _last]);
|
||||
(void) close(net);
|
||||
RELEASE(self);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue