mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Tidy up use of white space so we have it after if/for/while and not after (
or before ) or padding at end of line. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20773 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
99ef2bbdf7
commit
db7b22a4fb
180 changed files with 2181 additions and 2156 deletions
|
@ -11,7 +11,7 @@
|
|||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -75,7 +75,7 @@ static Class gcClass = 0;
|
|||
}
|
||||
result = [[GCArray allocWithZone: zone] initWithObjects: objects count: c];
|
||||
NSZoneFree(zone, objects);
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ static Class gcClass = 0;
|
|||
GCArray *result;
|
||||
id *objects;
|
||||
unsigned i, c = [self count];
|
||||
|
||||
|
||||
objects = NSZoneMalloc(zone, c * sizeof(id));
|
||||
/* FIXME: Check if malloc return 0 */
|
||||
[self getObjects: objects];
|
||||
|
@ -260,7 +260,7 @@ static Class gcClass = 0;
|
|||
}
|
||||
result = [[GCArray allocWithZone: zone] initWithObjects: objects count: c];
|
||||
NSZoneFree(zone, objects);
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ static Class gcClass = 0;
|
|||
_isGCObject = (BOOL*)&_contents[_maxCount];
|
||||
memmove(_isGCObject, optr, sizeof(BOOL)*old);
|
||||
}
|
||||
for(i = _count; i > index; i--)
|
||||
for (i = _count; i > index; i--)
|
||||
{
|
||||
_contents[i] = _contents[i - 1];
|
||||
_isGCObject[i] = _isGCObject[i - 1];
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -69,7 +69,7 @@ typedef struct {
|
|||
GCInfo *keyStruct;
|
||||
GCInfo *valueStruct;
|
||||
|
||||
return NSNextMapEnumeratorPair(&enumerator,
|
||||
return NSNextMapEnumeratorPair(&enumerator,
|
||||
(void**)&keyStruct, (void**)&valueStruct) ? keyStruct->object : nil;
|
||||
}
|
||||
@end
|
||||
|
@ -80,7 +80,7 @@ typedef struct {
|
|||
GCInfo *keyStruct;
|
||||
GCInfo *valueStruct;
|
||||
|
||||
return NSNextMapEnumeratorPair(&enumerator,
|
||||
return NSNextMapEnumeratorPair(&enumerator,
|
||||
(void**)&keyStruct, (void**)&valueStruct) ? valueStruct->object : nil;
|
||||
}
|
||||
@end
|
||||
|
@ -139,13 +139,13 @@ static const NSMapTableKeyCallBacks GCInfoMapKeyCallBacks = {
|
|||
(void (*)(NSMapTable *, void *))_GCReleaseObjects,
|
||||
(NSString *(*)(NSMapTable *, const void *))_GCDescribeObjects,
|
||||
(const void *)NULL
|
||||
};
|
||||
};
|
||||
|
||||
static const NSMapTableValueCallBacks GCInfoValueCallBacks = {
|
||||
(void (*)(NSMapTable *, const void *))_GCRetainObjects,
|
||||
(void (*)(NSMapTable *, void *))_GCReleaseObjects,
|
||||
(NSString *(*)(NSMapTable *, const void *))_GCDescribeObjects
|
||||
};
|
||||
};
|
||||
|
||||
static Class gcClass = 0;
|
||||
|
||||
|
@ -257,12 +257,12 @@ static Class gcClass = 0;
|
|||
valueStruct->isGCObject = [value isKindOfClass: gcClass];
|
||||
NSMapInsert(_map, keyStruct, valueStruct);
|
||||
}
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithObjects: (id*)objects
|
||||
forKeys: (id*)keys
|
||||
forKeys: (id*)keys
|
||||
count: (unsigned int)count
|
||||
{
|
||||
unsigned int size = (count * 4) / 3;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -381,7 +381,7 @@ static objc_mutex_t allocationLock = NULL;
|
|||
* </p>
|
||||
* <p>All container subclasses should override this method to call the super
|
||||
* implementation then, if the method returns YES, increment the reference
|
||||
* count of any contained objects and send the
|
||||
* count of any contained objects and send the
|
||||
* -gcIncrementRefCountOfContainedObjects
|
||||
* to each of the contained objects too.
|
||||
* </p>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -82,7 +82,7 @@
|
|||
{
|
||||
dayOfYear = [self dayOfYear];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Round up to a week boundary, so that when we divide by seven we
|
||||
* get a result in the range 1 to 53 as mandated by the ISO standard.
|
||||
|
@ -149,7 +149,7 @@
|
|||
* lower case hexadecimal digits (the -hexadecimalRepresentation method
|
||||
* produces a string using only uppercase digits with no white spaqce).<br />
|
||||
* If the string does not contain one or more pairs of hexadecimal digits
|
||||
* then an exception is raised.
|
||||
* then an exception is raised.
|
||||
*/
|
||||
- (id) initWithHexadecimalRepresentation: (NSString*)string
|
||||
{
|
||||
|
@ -336,7 +336,7 @@ static void MD5Update (struct MD5Context *ctx, unsigned char const *buf,
|
|||
}
|
||||
|
||||
/*
|
||||
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
||||
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
||||
* 1 0* (64-bit count of bits processed, MSB-first)
|
||||
*/
|
||||
static void MD5Final (unsigned char digest[16], struct MD5Context *ctx)
|
||||
|
@ -393,7 +393,7 @@ static void MD5Final (unsigned char digest[16], struct MD5Context *ctx)
|
|||
|
||||
/* This is the central step in the MD5 algorithm. */
|
||||
#define MD5STEP(f, w, x, y, z, data, s) \
|
||||
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
|
||||
(w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x)
|
||||
|
||||
/*
|
||||
* The core of the MD5 algorithm, this alters an existing MD5 hash to
|
||||
|
@ -619,7 +619,7 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
|
|||
if (end > off && bytes[end-1] == '\r')
|
||||
{
|
||||
end--;
|
||||
}
|
||||
}
|
||||
while (off < end && bytes[off] >= '0' && bytes[off] <= '7')
|
||||
{
|
||||
mode *= 8;
|
||||
|
@ -769,7 +769,7 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
|
|||
const char *str;
|
||||
|
||||
str = [string cString];
|
||||
if (strchr(str, '.') >= 0 || strchr(str, 'e') >= 0
|
||||
if (strchr(str, '.') >= 0 || strchr(str, 'e') >= 0
|
||||
|| strchr(str, 'E') >= 0)
|
||||
return [NSNumber numberWithDouble: atof(str)];
|
||||
else if (strchr(str, '-') >= 0)
|
||||
|
@ -783,7 +783,7 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
|
|||
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Extension methods for the NSObject class
|
||||
*/
|
||||
@implementation NSObject (GSCategories)
|
||||
|
@ -793,7 +793,7 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
|
|||
[NSException
|
||||
raise: NSGenericException
|
||||
format: @"method %s not implemented in %s(%s)",
|
||||
aSel ? GSNameFromSelector(aSel) : "(null)",
|
||||
aSel ? GSNameFromSelector(aSel) : "(null)",
|
||||
GSClassNameFromObject(self),
|
||||
GSObjCIsInstance(self) ? "instance" : "class"];
|
||||
return nil;
|
||||
|
@ -803,8 +803,8 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
|
|||
{
|
||||
[NSException
|
||||
raise: NSGenericException
|
||||
format: @"%s(%s) should not implement %s",
|
||||
GSClassNameFromObject(self),
|
||||
format: @"%s(%s) should not implement %s",
|
||||
GSClassNameFromObject(self),
|
||||
GSObjCIsInstance(self) ? "instance" : "class",
|
||||
aSel ? GSNameFromSelector(aSel) : "(null)"];
|
||||
return nil;
|
||||
|
@ -813,7 +813,7 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
|
|||
- (id) subclassResponsibility: (SEL)aSel
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"subclass %s(%s) should override %s",
|
||||
format: @"subclass %s(%s) should override %s",
|
||||
GSClassNameFromObject(self),
|
||||
GSObjCIsInstance(self) ? "instance" : "class",
|
||||
aSel ? GSNameFromSelector(aSel) : "(null)"];
|
||||
|
@ -1180,8 +1180,8 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
|
|||
|
||||
static GSLazyRecursiveLock *local_lock = nil;
|
||||
|
||||
/*
|
||||
This class only exists to provide
|
||||
/*
|
||||
This class only exists to provide
|
||||
a thread safe mechanism to initialize local_lock
|
||||
as +initialize is called under a lock in ObjC runtimes.
|
||||
User code should resort to GS_INITIALIZED_LOCK(),
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -59,7 +59,7 @@ void NSDecimalFromComponents(NSDecimal *result,
|
|||
unsigned long long mantissa,
|
||||
short exponent, BOOL negative)
|
||||
{
|
||||
*result = [[NSDecimalNumber decimalNumberWithMantissa:mantissa
|
||||
*result = [[NSDecimalNumber decimalNumberWithMantissa:mantissa
|
||||
exponent:exponent
|
||||
isNegative:negative] decimalValue];
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ GSDebugFunctionMsg(const char *func, const char *file, int line, NSString *fmt)
|
|||
|
||||
+ (void) setDebug: (int)val
|
||||
{
|
||||
if([self respondsToSelector:@selector(_enableLogging:)])
|
||||
if ([self respondsToSelector:@selector(_enableLogging:)])
|
||||
[self _enableLogging:!!val];
|
||||
}
|
||||
@end
|
||||
|
@ -250,21 +250,21 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
int net;
|
||||
struct sockaddr_in sin;
|
||||
int size = sizeof(sin);
|
||||
|
||||
|
||||
if (getAddr(a, s, p, &sin) == NO)
|
||||
{
|
||||
RELEASE(self);
|
||||
NSLog(@"bad address-service-protocol combination");
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
if ((net = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) < 0)
|
||||
{
|
||||
NSLog(@"unable to create socket - %s", GSLastErrorStr(errno));
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
#ifndef BROKEN_SO_REUSEADDR
|
||||
/*
|
||||
* Under decent systems, SO_REUSEADDR means that the port can be reused
|
||||
|
@ -274,7 +274,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
*/
|
||||
setsockopt(net, SOL_SOCKET, SO_REUSEADDR, (char *)&status, sizeof(status));
|
||||
#endif
|
||||
|
||||
|
||||
if (bind(net, (struct sockaddr *)&sin, sizeof(sin)) < 0)
|
||||
{
|
||||
NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(sin.sin_addr),
|
||||
|
@ -283,7 +283,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
if (listen(net, 5) < 0)
|
||||
{
|
||||
NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno));
|
||||
|
@ -291,7 +291,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
if (getsockname(net, (struct sockaddr*)&sin, &size) < 0)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
|
||||
|
@ -299,9 +299,9 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
self = [self initWithFileDescriptor: net closeOnDealloc: YES];
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -310,7 +310,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
protocol: (NSString*)protocol
|
||||
{
|
||||
id o = [self allocWithZone: NSDefaultMallocZone()];
|
||||
|
||||
|
||||
return AUTORELEASE([o initAsServerAtAddress: address
|
||||
service: service
|
||||
protocol: protocol]);
|
||||
|
@ -320,14 +320,14 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
{
|
||||
struct sockaddr_in sin;
|
||||
int size = sizeof(sin);
|
||||
|
||||
|
||||
if (getsockname([self fileDescriptor], (struct sockaddr*)&sin, &size) < 0)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
|
||||
return nil;
|
||||
}
|
||||
|
||||
return [[[NSString alloc] initWithCString: (char*)inet_ntoa(sin.sin_addr)]
|
||||
|
||||
return [[[NSString alloc] initWithCString: (char*)inet_ntoa(sin.sin_addr)]
|
||||
autorelease];
|
||||
}
|
||||
|
||||
|
@ -363,7 +363,7 @@ BOOL GSDebugSet(NSString *level)
|
|||
- (NSMutableSet *) debugSet
|
||||
// Derived from GNUStep's
|
||||
{
|
||||
if(_debug_set == nil){
|
||||
if (_debug_set == nil){
|
||||
int argc = [[self arguments] count];
|
||||
NSMutableSet *mySet;
|
||||
int i;
|
||||
|
@ -409,7 +409,7 @@ BOOL GSDebugSet(NSString *level)
|
|||
{
|
||||
return [self substringWithRange:range];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSInvocation(GSCompatibility)
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
Written by: Richard Frith-Macdonald <rfm@gnu.org>
|
||||
Date: October 2003
|
||||
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
Written by: Richard frith-Macdonald <rfm@gnu.org>
|
||||
Date: October 2000
|
||||
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -1173,7 +1173,7 @@ wordData(NSString *word)
|
|||
* NSString.<br />
|
||||
* If a document has no content type specified, it will be treated as
|
||||
* <em>text</em>, unless it is identifiable as a <em>file</em>
|
||||
* (eg. t has a content-disposition header containing a filename parameter).
|
||||
* (eg. t has a content-disposition header containing a filename parameter).
|
||||
* </p>
|
||||
*/
|
||||
- (BOOL) parse: (NSData*)d
|
||||
|
@ -1392,7 +1392,7 @@ wordData(NSString *word)
|
|||
*/
|
||||
[info setName: name];
|
||||
name = [info name];
|
||||
|
||||
|
||||
/*
|
||||
* Break header fields out into info dictionary.
|
||||
*/
|
||||
|
@ -1715,7 +1715,7 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
|
|||
{
|
||||
[info setValue: value];
|
||||
}
|
||||
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
@ -2045,7 +2045,7 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
|
|||
|
||||
src += 2;
|
||||
tmp = src;
|
||||
src = (unsigned char*)strchr((char*)src, '?');
|
||||
src = (unsigned char*)strchr((char*)src, '?');
|
||||
if (src == 0)
|
||||
{
|
||||
NSLog(@"Bad encoded word - character set terminator missing");
|
||||
|
@ -2361,11 +2361,11 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
|
|||
if (found == NO)
|
||||
{
|
||||
done = YES; /* Needs more data. */
|
||||
}
|
||||
}
|
||||
else if (child == nil)
|
||||
{
|
||||
NSString *cset;
|
||||
|
||||
|
||||
/*
|
||||
* Found boundary at the start of the first section.
|
||||
* Set sectionStart to point immediately after boundary.
|
||||
|
@ -3565,7 +3565,7 @@ static NSCharacterSet *tokenSet = nil;
|
|||
* matches the specified key. Recursively descend into other documents.<br />
|
||||
* Wraps the supplied key in angle brackets if they are not present.<br />
|
||||
* Return nil if no match is found, the matching GSMimeDocument otherwise.
|
||||
*/
|
||||
*/
|
||||
- (id) contentByID: (NSString*)key
|
||||
{
|
||||
if ([key hasPrefix: @"<"] == NO)
|
||||
|
@ -3598,7 +3598,7 @@ static NSCharacterSet *tokenSet = nil;
|
|||
* matches the specified key. Recursively descend into other documents.<br />
|
||||
* Wraps the supplied key in angle brackets if they are not present.<br />
|
||||
* Return nil if no match is found, the matching GSMimeDocument otherwise.
|
||||
*/
|
||||
*/
|
||||
- (id) contentByLocation: (NSString*)key
|
||||
{
|
||||
if ([content isKindOfClass: NSArrayClass] == YES)
|
||||
|
@ -3627,7 +3627,7 @@ static NSCharacterSet *tokenSet = nil;
|
|||
* name or content-disposition name matches the specified key.
|
||||
* Recursively descend into other documents.<br />
|
||||
* Return nil if no match is found, the matching GSMimeDocument otherwise.
|
||||
*/
|
||||
*/
|
||||
- (id) contentByName: (NSString*)key
|
||||
{
|
||||
|
||||
|
@ -3779,7 +3779,7 @@ static NSCharacterSet *tokenSet = nil;
|
|||
* Do <em>NOT</em> recurse into other documents.<br />
|
||||
* Return nil if no match is found, an array of matching GSMimeDocument
|
||||
* instances otherwise.
|
||||
*/
|
||||
*/
|
||||
- (NSArray*) contentsByName: (NSString*)key
|
||||
{
|
||||
NSMutableArray *a = nil;
|
||||
|
@ -4015,7 +4015,7 @@ static NSCharacterSet *tokenSet = nil;
|
|||
{
|
||||
[array addObject: info];
|
||||
}
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
|
@ -4199,7 +4199,7 @@ static NSCharacterSet *tokenSet = nil;
|
|||
{
|
||||
GSMimeDocument *part = [content objectAtIndex: i];
|
||||
|
||||
[partData addObject: [part rawMimeData: NO]];
|
||||
[partData addObject: [part rawMimeData: NO]];
|
||||
|
||||
/*
|
||||
* If any part of a multipart document is not 7bit then
|
||||
|
@ -4207,7 +4207,7 @@ static NSCharacterSet *tokenSet = nil;
|
|||
* It is important to check this *after* the part has been
|
||||
* processed by -rawMimeData:, so we know that the encoding
|
||||
* set for the part is valid.
|
||||
*/
|
||||
*/
|
||||
if (contentIs7bit == YES)
|
||||
{
|
||||
NSString *v;
|
||||
|
@ -4846,7 +4846,7 @@ static NSCharacterSet *tokenSet = nil;
|
|||
{
|
||||
return index;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NSNotFound;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -20,7 +20,7 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
|
@ -32,7 +32,7 @@
|
|||
#endif
|
||||
|
||||
/*
|
||||
return the size of an object specified by type
|
||||
return the size of an object specified by type
|
||||
*/
|
||||
|
||||
int
|
||||
|
@ -54,7 +54,7 @@ objc_sizeof_type(const char* type)
|
|||
case _C_CHR:
|
||||
return sizeof(char);
|
||||
break;
|
||||
|
||||
|
||||
case _C_UCHR:
|
||||
return sizeof(unsigned char);
|
||||
break;
|
||||
|
@ -103,7 +103,7 @@ objc_sizeof_type(const char* type)
|
|||
while (isdigit(*++type));
|
||||
return len*objc_aligned_size (type);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case _C_STRUCT_B:
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ objc_sizeof_type(const char* type)
|
|||
}
|
||||
return max_size;
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ objc_sizeof_type(const char* type)
|
|||
|
||||
|
||||
/*
|
||||
Return the alignment of an object specified by type
|
||||
Return the alignment of an object specified by type
|
||||
*/
|
||||
|
||||
int
|
||||
|
@ -163,7 +163,7 @@ objc_alignof_type(const char* type)
|
|||
case _C_CLASS:
|
||||
return __alignof__(Class);
|
||||
break;
|
||||
|
||||
|
||||
case _C_SEL:
|
||||
return __alignof__(SEL);
|
||||
break;
|
||||
|
@ -171,7 +171,7 @@ objc_alignof_type(const char* type)
|
|||
case _C_CHR:
|
||||
return __alignof__(char);
|
||||
break;
|
||||
|
||||
|
||||
case _C_UCHR:
|
||||
return __alignof__(unsigned char);
|
||||
break;
|
||||
|
@ -216,11 +216,11 @@ objc_alignof_type(const char* type)
|
|||
case _C_ARY_B:
|
||||
while (isdigit(*++type)) /* do nothing */;
|
||||
return objc_alignof_type (type);
|
||||
|
||||
|
||||
case _C_STRUCT_B:
|
||||
{
|
||||
struct { int x; double y; } fooalign;
|
||||
while(*type != _C_STRUCT_E && *type++ != '=') /* do nothing */;
|
||||
while (*type != _C_STRUCT_E && *type++ != '=') /* do nothing */;
|
||||
if (*type != _C_STRUCT_E)
|
||||
return MAX (objc_alignof_type (type), __alignof__ (fooalign));
|
||||
else
|
||||
|
@ -238,7 +238,7 @@ objc_alignof_type(const char* type)
|
|||
}
|
||||
return maxalign;
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ objc_aligned_size (const char* type)
|
|||
to be the size of a void*.
|
||||
*/
|
||||
|
||||
int
|
||||
int
|
||||
objc_promoted_size (const char* type)
|
||||
{
|
||||
int size = objc_sizeof_type (type);
|
||||
|
@ -295,9 +295,9 @@ const char*
|
|||
objc_skip_type_qualifiers (const char* type)
|
||||
{
|
||||
while (*type == _C_CONST
|
||||
|| *type == _C_IN
|
||||
|| *type == _C_IN
|
||||
|| *type == _C_INOUT
|
||||
|| *type == _C_OUT
|
||||
|| *type == _C_OUT
|
||||
|| *type == _C_BYCOPY
|
||||
#ifdef _C_BYREF
|
||||
|| *type == _C_BYREF
|
||||
|
@ -312,17 +312,17 @@ objc_skip_type_qualifiers (const char* type)
|
|||
return type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Skip one typespec element. If the typespec is prepended by type
|
||||
qualifiers, these are skipped as well.
|
||||
*/
|
||||
|
||||
const char*
|
||||
const char*
|
||||
objc_skip_typespec (const char* type)
|
||||
{
|
||||
type = objc_skip_type_qualifiers (type);
|
||||
|
||||
|
||||
switch (*type) {
|
||||
|
||||
case _C_ID:
|
||||
|
@ -358,8 +358,8 @@ objc_skip_typespec (const char* type)
|
|||
|
||||
case _C_ARY_B:
|
||||
/* skip digits, typespec and closing ']' */
|
||||
|
||||
while(isdigit(*++type));
|
||||
|
||||
while (isdigit(*++type));
|
||||
type = objc_skip_typespec(type);
|
||||
if (*type == _C_ARY_E)
|
||||
return ++type;
|
||||
|
@ -368,23 +368,23 @@ objc_skip_typespec (const char* type)
|
|||
|
||||
case _C_STRUCT_B:
|
||||
/* skip name, and elements until closing '}' */
|
||||
|
||||
|
||||
while (*type != _C_STRUCT_E && *type++ != '=');
|
||||
while (*type != _C_STRUCT_E) { type = objc_skip_typespec (type); }
|
||||
return ++type;
|
||||
|
||||
case _C_UNION_B:
|
||||
/* skip name, and elements until closing ')' */
|
||||
|
||||
|
||||
while (*type != _C_UNION_E && *type++ != '=');
|
||||
while (*type != _C_UNION_E) { type = objc_skip_typespec (type); }
|
||||
return ++type;
|
||||
|
||||
case _C_PTR:
|
||||
/* Just skip the following typespec */
|
||||
|
||||
|
||||
return objc_skip_typespec (++type);
|
||||
|
||||
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
|
@ -394,12 +394,12 @@ objc_skip_typespec (const char* type)
|
|||
Skip an offset as part of a method encoding. This is prepended by a
|
||||
'+' if the argument is passed in registers.
|
||||
*/
|
||||
inline const char*
|
||||
inline const char*
|
||||
objc_skip_offset (const char* type)
|
||||
{
|
||||
if (*type == '+') type++;
|
||||
if (*type == '-') type++;
|
||||
while(isdigit(*++type));
|
||||
while (isdigit(*++type));
|
||||
return type;
|
||||
}
|
||||
|
||||
|
@ -499,7 +499,7 @@ void *
|
|||
objc_malloc(size_t size)
|
||||
{
|
||||
void* res = (void*) (*_objc_malloc)(size);
|
||||
if(!res)
|
||||
if (!res)
|
||||
objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
|
||||
return res;
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ void *
|
|||
objc_atomic_malloc(size_t size)
|
||||
{
|
||||
void* res = (void*) (*_objc_atomic_malloc)(size);
|
||||
if(!res)
|
||||
if (!res)
|
||||
objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
|
||||
return res;
|
||||
}
|
||||
|
@ -517,7 +517,7 @@ void *
|
|||
objc_valloc(size_t size)
|
||||
{
|
||||
void* res = (void*) (*_objc_valloc)(size);
|
||||
if(!res)
|
||||
if (!res)
|
||||
objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
|
||||
return res;
|
||||
}
|
||||
|
@ -526,7 +526,7 @@ void *
|
|||
objc_realloc(void *mem, size_t size)
|
||||
{
|
||||
void* res = (void*) (*_objc_realloc)(mem, size);
|
||||
if(!res)
|
||||
if (!res)
|
||||
objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
|
||||
return res;
|
||||
}
|
||||
|
@ -535,7 +535,7 @@ void *
|
|||
objc_calloc(size_t nelem, size_t size)
|
||||
{
|
||||
void* res = (void*) (*_objc_calloc)(nelem, size);
|
||||
if(!res)
|
||||
if (!res)
|
||||
objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
|
||||
return res;
|
||||
}
|
||||
|
@ -632,20 +632,20 @@ int
|
|||
objc_mutex_lock(objc_mutex_t mutex)
|
||||
{
|
||||
pthread_mutex_t *p = (pthread_mutex_t *)mutex;
|
||||
return pthread_mutex_lock(p);
|
||||
return pthread_mutex_lock(p);
|
||||
}
|
||||
|
||||
int
|
||||
objc_mutex_unlock (objc_mutex_t mutex)
|
||||
{
|
||||
pthread_mutex_t *p = (pthread_mutex_t *)mutex;
|
||||
return pthread_mutex_unlock(p);
|
||||
return pthread_mutex_unlock(p);
|
||||
}
|
||||
|
||||
int
|
||||
objc_mutex_trylock (objc_mutex_t mutex)
|
||||
{
|
||||
pthread_mutex_t *p = (pthread_mutex_t *)mutex;
|
||||
return pthread_mutex_trylock(p);
|
||||
return pthread_mutex_trylock(p);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,26 +7,26 @@
|
|||
Date: Nov 2002
|
||||
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
Date: Nov 2002
|
||||
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
|
||||
<title>GSObjCRuntime function and macro reference</title>
|
||||
$Date$ $Revision$
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "GNUstepBase/preface.h"
|
||||
|
@ -96,10 +96,10 @@ GSAllocateMutexAt(objc_mutex_t *request)
|
|||
{
|
||||
if (request == NULL)
|
||||
{
|
||||
/* This could be called very early in process
|
||||
initialization so many things may not have
|
||||
/* This could be called very early in process
|
||||
initialization so many things may not have
|
||||
been setup correctly yet. */
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"Error: GSAllocateMutexAt() called with NULL pointer.\n");
|
||||
abort();
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ GSObjCFindVariable(id obj, const char *name,
|
|||
}
|
||||
|
||||
/**
|
||||
* This method returns an array listing the names of all the
|
||||
* This method returns an array listing the names of all the
|
||||
* instance methods available to obj, whether they
|
||||
* belong to the class of obj or one of its superclasses.<br />
|
||||
* If obj is a class, this returns the class methods.<br />
|
||||
|
@ -206,7 +206,7 @@ GSObjCMethodNames(id obj)
|
|||
{
|
||||
void *iterator = 0;
|
||||
|
||||
while ((methods = class_nextMethodList(class, &iterator)) )
|
||||
while ((methods = class_nextMethodList(class, &iterator)))
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -235,7 +235,7 @@ GSObjCMethodNames(id obj)
|
|||
}
|
||||
|
||||
/**
|
||||
* This method returns an array listing the names of all the
|
||||
* This method returns an array listing the names of all the
|
||||
* instance variables present in the instance obj, whether they
|
||||
* belong to the class of obj or one of its superclasses.<br />
|
||||
* Returns nil if obj is nil.
|
||||
|
@ -361,8 +361,8 @@ GSClassList(Class *buffer, unsigned int max, BOOL clearCache)
|
|||
}
|
||||
cache = objc_malloc(sizeof(Class) * (cacheClassCount + 1));
|
||||
/* Be extra careful as another thread may be loading classes. */
|
||||
for (i = 0, iterator = 0, cls = objc_next_class(&iterator);
|
||||
i < cacheClassCount && cls != NULL;
|
||||
for (i = 0, iterator = 0, cls = objc_next_class(&iterator);
|
||||
i < cacheClassCount && cls != NULL;
|
||||
i++, cls = objc_next_class(&iterator))
|
||||
{
|
||||
cache[i] = cls;
|
||||
|
@ -412,7 +412,7 @@ ObjcRuntimeUtilities.m by Nicola Pero
|
|||
NSValue *
|
||||
GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars)
|
||||
{
|
||||
Class newClass;
|
||||
Class newClass;
|
||||
Class classSuperClass;
|
||||
const char *classNameCString;
|
||||
const char *superClassNameCString;
|
||||
|
@ -448,10 +448,10 @@ GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars)
|
|||
/*
|
||||
* Create new class and meta class structure storage
|
||||
*
|
||||
* From Nicola: NB: There is a trick here.
|
||||
* From Nicola: NB: There is a trick here.
|
||||
* The runtime system will look up the name in the following string,
|
||||
* and replace it with a pointer to the actual superclass structure.
|
||||
* This also means the type of pointer will change, that's why we
|
||||
* This also means the type of pointer will change, that's why we
|
||||
* need to cast it.
|
||||
*/
|
||||
newMetaClass = objc_malloc(sizeof(struct objc_class));
|
||||
|
@ -462,7 +462,7 @@ GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars)
|
|||
newMetaClass->version = 0;
|
||||
newMetaClass->info = _CLS_META; // this is a Meta Class
|
||||
|
||||
|
||||
|
||||
newClass = objc_malloc(sizeof(struct objc_class));
|
||||
memset(newClass, 0, sizeof(struct objc_class));
|
||||
newClass->class_pointer = newMetaClass; // Points to the class's meta class.
|
||||
|
@ -470,7 +470,7 @@ GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars)
|
|||
newClass->name = classNameCString;
|
||||
newClass->version = 0;
|
||||
newClass->info = _CLS_CLASS; // this is a Class
|
||||
|
||||
|
||||
// work on instances variables
|
||||
iVarSize = classSuperClass->instance_size; // super class ivar size
|
||||
if ([iVars count] > 0)
|
||||
|
@ -480,15 +480,15 @@ GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars)
|
|||
unsigned int iVarsCount = [iVars count];
|
||||
NSEnumerator *enumerator = [iVars keyEnumerator];
|
||||
NSString *key;
|
||||
|
||||
|
||||
// ivars list is 1 objc_ivar_list followed by (iVarsCount-1) ivar_list
|
||||
iVarsStructsSize = sizeof(struct objc_ivar_list)
|
||||
+ (iVarsCount-1)*sizeof(struct objc_ivar);
|
||||
|
||||
|
||||
// Allocate for all ivars
|
||||
newClass->ivars = (struct objc_ivar_list*)objc_malloc(iVarsStructsSize);
|
||||
newClass->ivars = (struct objc_ivar_list*)objc_malloc(iVarsStructsSize);
|
||||
memset(newClass->ivars, 0, iVarsStructsSize);
|
||||
|
||||
|
||||
// Set ivars count
|
||||
newClass->ivars->ivar_count = iVarsCount;
|
||||
|
||||
|
@ -519,7 +519,7 @@ GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars)
|
|||
* and all super class definitions.
|
||||
*/
|
||||
newClass->instance_size = iVarSize;
|
||||
|
||||
|
||||
// Meta Class instance size is superclass instance size.
|
||||
newMetaClass->instance_size = classSuperClass->class_pointer->instance_size;
|
||||
|
||||
|
@ -572,13 +572,13 @@ GSObjCAddClasses(NSArray *classes)
|
|||
strcpy ((char*)module->name, "GNUstep-Proxy-");
|
||||
strcat ((char*)module->name, c->name);
|
||||
module->symtab = objc_malloc(sizeof(Symtab) + numClasses * sizeof(void *));
|
||||
|
||||
|
||||
symtab = module->symtab;
|
||||
symtab->sel_ref_cnt = 0;
|
||||
symtab->refs = 0;
|
||||
symtab->cls_def_cnt = numClasses; // We are defining numClasses classes.
|
||||
symtab->cat_def_cnt = 0; // But no categories
|
||||
|
||||
symtab->cat_def_cnt = 0; // But no categories
|
||||
|
||||
for (i = 0; i < numClasses; i++)
|
||||
{
|
||||
symtab->defs[i] = (Class)[[classes objectAtIndex: i] pointerValue];
|
||||
|
@ -604,7 +604,7 @@ GSObjCBehaviorDebug(int i)
|
|||
|
||||
static GSMethod search_for_method_in_class (Class cls, SEL op);
|
||||
|
||||
void
|
||||
void
|
||||
GSObjCAddMethods (Class cls, GSMethodList methods)
|
||||
{
|
||||
static SEL initialize_sel = 0;
|
||||
|
@ -621,7 +621,7 @@ GSObjCAddMethods (Class cls, GSMethodList methods)
|
|||
|
||||
counter = mlist->method_count ? mlist->method_count - 1 : 1;
|
||||
|
||||
/* This is a little wasteful of memory, since not necessarily
|
||||
/* This is a little wasteful of memory, since not necessarily
|
||||
all methods will go in here. */
|
||||
new_list = (GSMethodList)
|
||||
objc_malloc (sizeof(struct objc_method_list) +
|
||||
|
@ -632,7 +632,7 @@ GSObjCAddMethods (Class cls, GSMethodList methods)
|
|||
{
|
||||
GSMethod method = &(mlist->method_list[counter]);
|
||||
|
||||
BDBGPrintf(" processing method [%s] ... ",
|
||||
BDBGPrintf(" processing method [%s] ... ",
|
||||
GSNameFromSelector(method->method_name));
|
||||
|
||||
if (!search_for_method_in_class(cls, method->method_name)
|
||||
|
@ -644,11 +644,11 @@ GSObjCAddMethods (Class cls, GSMethodList methods)
|
|||
new_list->method_list[new_list->method_count] = *method;
|
||||
(new_list->method_count)++;
|
||||
|
||||
BDBGPrintf("added.\n");
|
||||
BDBGPrintf("added.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
BDBGPrintf("ignored.\n");
|
||||
BDBGPrintf("ignored.\n");
|
||||
}
|
||||
counter -= 1;
|
||||
}
|
||||
|
@ -675,7 +675,7 @@ search_for_method_in_class (Class cls, SEL op)
|
|||
return NULL;
|
||||
|
||||
/* If not found then we'll search the list. */
|
||||
while ( (method_list = class_nextMethodList(cls, &iterator)) )
|
||||
while ((method_list = class_nextMethodList(cls, &iterator)))
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -724,7 +724,7 @@ GSObjCAddMethods (Class cls, GSMethodList methods)
|
|||
|
||||
counter = mlist->method_count ? mlist->method_count - 1 : 1;
|
||||
|
||||
/* This is a little wasteful of memory, since not necessarily
|
||||
/* This is a little wasteful of memory, since not necessarily
|
||||
all methods will go in here. */
|
||||
new_list = (GSMethodList)
|
||||
objc_malloc (sizeof(struct objc_method_list) +
|
||||
|
@ -756,11 +756,11 @@ GSObjCAddMethods (Class cls, GSMethodList methods)
|
|||
= (SEL)name;
|
||||
(new_list->method_count)++;
|
||||
|
||||
BDBGPrintf("added.\n");
|
||||
BDBGPrintf("added.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
BDBGPrintf("ignored.\n");
|
||||
BDBGPrintf("ignored.\n");
|
||||
}
|
||||
counter -= 1;
|
||||
}
|
||||
|
@ -810,7 +810,7 @@ GSGetMethod(Class cls, SEL sel,
|
|||
{
|
||||
/*
|
||||
We do not rely on the mapping supplied in objc_gnu2next.h
|
||||
because we want to be explicit about the fact
|
||||
because we want to be explicit about the fact
|
||||
that the expected parameters are different.
|
||||
Therefor we refrain from simply using class_getClassMethod().
|
||||
*/
|
||||
|
@ -856,9 +856,9 @@ GSAppendMethodToList (GSMethodList list,
|
|||
num = (list->method_count)++;
|
||||
|
||||
#ifdef GNU_RUNTIME
|
||||
/*
|
||||
/*
|
||||
Deal with typed selectors: No matter what kind of selector we get
|
||||
convert it into a c-string. Cache that c-string incase the
|
||||
convert it into a c-string. Cache that c-string incase the
|
||||
selector isn't found, then search for cooresponding typed selector.
|
||||
If none is found use the cached name to register an new selector
|
||||
with the cooresponding types.
|
||||
|
@ -953,13 +953,13 @@ GSMethodListForSelector(Class cls,
|
|||
cls = cls->class_pointer;
|
||||
}
|
||||
|
||||
if(sel_is_mapped(selector))
|
||||
if (sel_is_mapped(selector))
|
||||
{
|
||||
void **iterator_pointer;
|
||||
GSMethodList method_list;
|
||||
|
||||
iterator_pointer = (iterator == 0 ? &local_iterator : iterator);
|
||||
while((method_list = class_nextMethodList(cls, iterator_pointer)))
|
||||
while ((method_list = class_nextMethodList(cls, iterator_pointer)))
|
||||
{
|
||||
/* Search the method in the current list. */
|
||||
if (GSMethodFromList(method_list, selector, NO) != 0)
|
||||
|
@ -975,7 +975,7 @@ GSMethodListForSelector(Class cls,
|
|||
/* See header for documentation. */
|
||||
GSMethod
|
||||
GSMethodFromList(GSMethodList list,
|
||||
SEL sel,
|
||||
SEL sel,
|
||||
BOOL isFree)
|
||||
{
|
||||
unsigned i;
|
||||
|
@ -989,7 +989,7 @@ GSMethodFromList(GSMethodList list,
|
|||
isFree = NO;
|
||||
#endif
|
||||
|
||||
for(i = 0; i < list->method_count; ++i)
|
||||
for (i = 0; i < list->method_count; ++i)
|
||||
{
|
||||
GSMethod method = &list->method_list[i];
|
||||
SEL method_name = method->method_name;
|
||||
|
@ -1204,7 +1204,7 @@ gs_string_hash(const char *s)
|
|||
}
|
||||
|
||||
GS_STATIC_INLINE pcl
|
||||
gs_find_protocol_named_in_protocol_list(const char *name,
|
||||
gs_find_protocol_named_in_protocol_list(const char *name,
|
||||
struct objc_protocol_list *pcllist)
|
||||
{
|
||||
pcl p = NULL;
|
||||
|
@ -1241,7 +1241,7 @@ gs_find_protocol_named(const char *name)
|
|||
|
||||
clsListStart = clsList;
|
||||
|
||||
while(p == NULL && (cls = *clsList++))
|
||||
while (p == NULL && (cls = *clsList++))
|
||||
{
|
||||
p = gs_find_protocol_named_in_protocol_list(name, cls->protocols);
|
||||
}
|
||||
|
@ -1251,7 +1251,7 @@ gs_find_protocol_named(const char *name)
|
|||
#else
|
||||
void *iterator = NULL;
|
||||
|
||||
while(p == NULL && (cls = objc_next_class(&iterator)))
|
||||
while (p == NULL && (cls = objc_next_class(&iterator)))
|
||||
{
|
||||
p = gs_find_protocol_named_in_protocol_list(name, cls->protocols);
|
||||
}
|
||||
|
@ -1305,7 +1305,7 @@ GSRegisterProtocol(Protocol *proto)
|
|||
{
|
||||
gs_init_protocol_lock();
|
||||
}
|
||||
|
||||
|
||||
if (proto != nil)
|
||||
{
|
||||
GSIMapNode node;
|
||||
|
@ -1317,7 +1317,7 @@ GSRegisterProtocol(Protocol *proto)
|
|||
(GSIMapKey) p->protocol_name);
|
||||
if (node == 0)
|
||||
{
|
||||
GSIMapAddPairNoRetain(&protocol_by_name,
|
||||
GSIMapAddPairNoRetain(&protocol_by_name,
|
||||
(GSIMapKey) (void *) p->protocol_name,
|
||||
(GSIMapVal) (void *) p);
|
||||
}
|
||||
|
@ -1355,9 +1355,9 @@ GSProtocolFromName(const char *name)
|
|||
p = gs_find_protocol_named(name);
|
||||
if (p)
|
||||
{
|
||||
/* Use the protocol's name to save us from allocating
|
||||
/* Use the protocol's name to save us from allocating
|
||||
a copy of the parameter 'name'. */
|
||||
GSIMapAddPairNoRetain(&protocol_by_name,
|
||||
GSIMapAddPairNoRetain(&protocol_by_name,
|
||||
(GSIMapKey) (void *) p->protocol_name,
|
||||
(GSIMapVal) (void *) p);
|
||||
}
|
||||
|
@ -1390,7 +1390,7 @@ GSProtocolFromName(const char *name)
|
|||
* </p>
|
||||
* <p>This function should be called in the +initialize method of the receiver.
|
||||
* </p>
|
||||
* <p>If you add several behaviors to a class, be aware that the order of
|
||||
* <p>If you add several behaviors to a class, be aware that the order of
|
||||
* the additions is significant.
|
||||
* </p>
|
||||
*/
|
||||
|
@ -1780,7 +1780,7 @@ GSObjCGetValue(NSObject *self, NSString *key, SEL sel,
|
|||
{
|
||||
void (*imp)(id, SEL) =
|
||||
(void (*)(id, SEL))[self methodForSelector: sel];
|
||||
|
||||
|
||||
(*imp)(self, sel);
|
||||
}
|
||||
val = nil;
|
||||
|
@ -2124,7 +2124,7 @@ GSObjCSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
|||
}
|
||||
|
||||
|
||||
/** Returns an autoreleased array of subclasses of Class cls, including
|
||||
/** Returns an autoreleased array of subclasses of Class cls, including
|
||||
* subclasses of subclasses. */
|
||||
NSArray *GSObjCAllSubclassesOfClass(Class cls)
|
||||
{
|
||||
|
@ -2164,7 +2164,7 @@ NSArray *GSObjCDirectSubclassesOfClass(Class cls)
|
|||
{
|
||||
NSMutableArray *result=[[NSMutableArray alloc] init];
|
||||
Class aClass;
|
||||
|
||||
|
||||
#ifdef GNU_RUNTIME
|
||||
for (aClass = cls->subclass_list;aClass;aClass=aClass->sibling_class)
|
||||
{
|
||||
|
|
|
@ -1548,7 +1548,7 @@ static NSMapTable *nodeNames = 0;
|
|||
*/
|
||||
- (void) setNamespace: (GSXMLNamespace *)space
|
||||
{
|
||||
xmlSetNs (lib, [space lib]);
|
||||
xmlSetNs (lib, [space lib]);
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -2389,7 +2389,7 @@ static NSString *endMarker = @"At end of incremental parse";
|
|||
* </p>
|
||||
* <p>
|
||||
* If you create a GSXMLParser passing nil as the GSSAXHandler,
|
||||
* the parser will parse data to create a [GSXMLDocument] instance
|
||||
* the parser will parse data to create a [GSXMLDocument] instance
|
||||
* which you can then examine as a whole ... this is generally the
|
||||
* preferred mechanism for parsing as it permits the parser to
|
||||
* validate the parsed document againts a DTD, and your software
|
||||
|
@ -3384,10 +3384,10 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
|
|||
xmlSAXVersion(LIB, 2); // Set SAX2
|
||||
SETCB(startElementNs, startElement:prefix:href:attributes:);
|
||||
SETCB(endElementNs, endElement:prefix:href:);
|
||||
#else
|
||||
#else
|
||||
SETCB(startElement, startElement:attributes:);
|
||||
SETCB(endElement, endElement:);
|
||||
#endif
|
||||
#endif
|
||||
SETCB(internalSubset, internalSubset:externalID:systemID:);
|
||||
SETCB(externalSubset, externalSubset:externalID:systemID:);
|
||||
SETCB(isStandalone, isStandalone);
|
||||
|
@ -3400,7 +3400,7 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
|
|||
SETCB(elementDecl, elementDecl:type:);
|
||||
SETCB(unparsedEntityDecl, unparsedEntityDecl:public:system:notationName:);
|
||||
SETCB(startDocument, startDocument);
|
||||
SETCB(endDocument, endDocument);
|
||||
SETCB(endDocument, endDocument);
|
||||
SETCB(reference, reference:);
|
||||
SETCB(characters, characters:);
|
||||
SETCB(ignorableWhitespace, ignoreWhitespace:);
|
||||
|
@ -3526,7 +3526,7 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
|
|||
context: context];
|
||||
break;
|
||||
default:
|
||||
/* This includes:
|
||||
/* This includes:
|
||||
case XPATH_UNDEFINED:
|
||||
case XPATH_POINT:
|
||||
case XPATH_RANGE:
|
||||
|
@ -3681,7 +3681,7 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
|
|||
ASSIGN (_document, d);
|
||||
_lib = xmlXPathNewContext ([_document lib]);
|
||||
((xmlXPathContext*)_lib)->node = xmlDocGetRootElement ([_document lib]);
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -3694,9 +3694,9 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
|
|||
xmlXPathCompExpr *comp;
|
||||
xmlXPathObject *res;
|
||||
GSXPathObject *result;
|
||||
|
||||
|
||||
comp = xmlXPathCompile ([XPathExpression UTF8String]);
|
||||
if (comp == NULL)
|
||||
if (comp == NULL)
|
||||
{
|
||||
/* Maybe an exception would be better ? */
|
||||
return nil;
|
||||
|
@ -3719,7 +3719,7 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
xmlXPathFreeContext (_lib);
|
||||
xmlXPathFreeContext (_lib);
|
||||
RELEASE (_document);
|
||||
[super dealloc];
|
||||
}
|
||||
|
@ -3784,7 +3784,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
params: (NSDictionary*)params
|
||||
{
|
||||
GSXMLDocument *newdoc;
|
||||
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
NSData *xml;
|
||||
|
@ -3798,7 +3798,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
}
|
||||
else
|
||||
{
|
||||
newdoc = [GSXMLDocument xsltTransformXml: xml
|
||||
newdoc = [GSXMLDocument xsltTransformXml: xml
|
||||
stylesheet: ss
|
||||
params: params];
|
||||
}
|
||||
|
@ -3808,7 +3808,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
newdoc = nil;
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
|
||||
|
||||
return newdoc;
|
||||
}
|
||||
/**
|
||||
|
@ -3825,7 +3825,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
stylesheet: xsltStylesheet
|
||||
params: nil];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Performs an XSLT transformation on the specified file using the
|
||||
* stylesheet and parameters provided.See the libxslt documentation
|
||||
|
@ -3839,7 +3839,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
params: (NSDictionary*)params
|
||||
{
|
||||
GSXMLDocument *newdoc;
|
||||
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
GSXMLParser *xmlParser;
|
||||
|
@ -3860,7 +3860,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
newdoc = nil;
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
|
||||
|
||||
return newdoc;
|
||||
}
|
||||
|
||||
|
@ -3887,7 +3887,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
- (GSXMLDocument*) xsltTransform: (GSXMLDocument*)xsltStylesheet
|
||||
params: (NSDictionary*)params
|
||||
{
|
||||
GSXMLDocument *newdoc = nil;
|
||||
GSXMLDocument *newdoc = nil;
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
|
@ -3913,7 +3913,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
}
|
||||
}
|
||||
parameters[pNum] = NULL;
|
||||
|
||||
|
||||
ss = xsltParseStylesheetDoc(ssXml);
|
||||
if (xsltStylesheet != NULL)
|
||||
{
|
||||
|
@ -3924,14 +3924,14 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
{
|
||||
newdoc = [GSXMLDocument alloc];
|
||||
newdoc = [newdoc _initFrom: res
|
||||
parent: self
|
||||
parent: self
|
||||
ownsLib: YES];
|
||||
AUTORELEASE(newdoc);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* N.B. We don't want to call xsltFreeStylesheet() to free the
|
||||
* stylesheet xmlDocPtr because that will destroy the lib which
|
||||
* N.B. We don't want to call xsltFreeStylesheet() to free the
|
||||
* stylesheet xmlDocPtr because that will destroy the lib which
|
||||
* is owned by the xsltStylesheet object.
|
||||
*/
|
||||
xsltCleanupGlobals();
|
||||
|
@ -3951,14 +3951,14 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
NSLog(@"libxslt is not available");
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
+ (GSXMLDocument*) xsltTransformFile: (NSString*)xmlFile
|
||||
stylesheet: (NSString*)xsltStylesheet
|
||||
{
|
||||
NSLog(@"libxslt is not available");
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
+ (GSXMLDocument*) xsltTransformXml: (NSData*)xmlData
|
||||
stylesheet: (NSData*)xsltStylesheet
|
||||
params: (NSDictionary*)params
|
||||
|
@ -3973,7 +3973,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
NSLog(@"libxslt is not available");
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
- (GSXMLDocument*) xsltTransform: (GSXMLDocument*)xsltStylesheet
|
||||
params: (NSDictionary*)params
|
||||
{
|
||||
|
@ -4027,7 +4027,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
+ (void) forwardInvocation: (NSInvocation*)anInvocation
|
||||
{
|
||||
NSLog(@"Not built with libxml ... %@ unusable in %@",
|
||||
NSStringFromClass([self class]),
|
||||
NSStringFromClass([self class]),
|
||||
NSStringFromSelector([anInvocation selector]));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -25,7 +25,7 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
|
@ -124,7 +124,7 @@ internal_unicode_enc(void)
|
|||
return unicode_enc;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static GSLazyLock *local_lock = nil;
|
||||
|
||||
|
@ -241,7 +241,7 @@ static void GSSetupEncodingTable(void)
|
|||
{
|
||||
fprintf(stderr, "ERROR ... illegal NSStringEncoding "
|
||||
"value in str_encoding_table. Ignored\n");
|
||||
}
|
||||
}
|
||||
else if (tmp > encTableSize)
|
||||
{
|
||||
encTableSize = tmp;
|
||||
|
@ -457,7 +457,7 @@ GSEncodingForRegistry (NSString *registry, NSString *encoding)
|
|||
return NSKoreanEUCStringEncoding;
|
||||
}
|
||||
else if ([registry isEqualToString:@"utf8"]
|
||||
|| [registry isEqualToString:@"utf-8"] )
|
||||
|| [registry isEqualToString:@"utf-8"])
|
||||
{
|
||||
return NSUTF8StringEncoding;
|
||||
}
|
||||
|
@ -482,8 +482,8 @@ GSEncodingFromLocale(const char *clocale)
|
|||
NSStringEncoding encoding = GSUndefinedEncoding;
|
||||
NSString *encodstr;
|
||||
|
||||
if (clocale == NULL || strcmp(clocale, "C") == 0
|
||||
|| strcmp(clocale, "POSIX") == 0)
|
||||
if (clocale == NULL || strcmp(clocale, "C") == 0
|
||||
|| strcmp(clocale, "POSIX") == 0)
|
||||
{
|
||||
/* Don't make any assumptions. Let caller handle that */
|
||||
return encoding;
|
||||
|
@ -509,7 +509,7 @@ GSEncodingFromLocale(const char *clocale)
|
|||
{
|
||||
encodstr = @"0";
|
||||
}
|
||||
|
||||
|
||||
encoding = GSEncodingForRegistry(registry, encodstr);
|
||||
}
|
||||
else
|
||||
|
@ -521,14 +521,14 @@ GSEncodingFromLocale(const char *clocale)
|
|||
gbundle = [NSBundle bundleForLibrary: @"gnustep-base"];
|
||||
table = [gbundle pathForResource: @"Locale"
|
||||
ofType: @"encodings"
|
||||
inDirectory: @"Languages"];
|
||||
inDirectory: @"Languages"];
|
||||
if (table != nil)
|
||||
{
|
||||
unsigned count;
|
||||
NSDictionary *dict;
|
||||
|
||||
|
||||
dict = [NSDictionary dictionaryWithContentsOfFile: table];
|
||||
encodstr = [dict objectForKey:
|
||||
encodstr = [dict objectForKey:
|
||||
[NSString stringWithCString: clocale]];
|
||||
if (encodstr == nil)
|
||||
return GSUndefinedEncoding;
|
||||
|
@ -551,7 +551,7 @@ GSEncodingFromLocale(const char *clocale)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return encoding;
|
||||
}
|
||||
|
||||
|
@ -593,7 +593,7 @@ GetDefEncoding(void)
|
|||
{
|
||||
fprintf(stderr,
|
||||
"WARNING: %s - encoding not supported.\n", encoding);
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
" NSISOLatin1StringEncoding set as default.\n");
|
||||
defEnc = NSISOLatin1StringEncoding;
|
||||
}
|
||||
|
@ -873,7 +873,7 @@ uni_tolower(unichar ch)
|
|||
|
||||
return result ? result : ch;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Uses direct access into a two-level table to map cases.<br />
|
||||
* The two-level table method is less space efficient (but still not bad) than
|
||||
|
@ -1001,7 +1001,7 @@ uni_is_decomp(unichar u)
|
|||
* <strong>deprecated</strong>
|
||||
* See GSToUnicode() and GSFromUnicode()
|
||||
*/
|
||||
int encode_ustrtocstr(char *dst, int dl, const unichar *src, int sl,
|
||||
int encode_ustrtocstr(char *dst, int dl, const unichar *src, int sl,
|
||||
NSStringEncoding enc, BOOL strict)
|
||||
{
|
||||
BOOL result;
|
||||
|
@ -1021,7 +1021,7 @@ int encode_ustrtocstr(char *dst, int dl, const unichar *src, int sl,
|
|||
* <strong>deprecated</strong>
|
||||
* See GSToUnicode() and GSFromUnicode()
|
||||
*/
|
||||
int encode_cstrtoustr(unichar *dst, int dl, const char *src, int sl,
|
||||
int encode_cstrtoustr(unichar *dst, int dl, const char *src, int sl,
|
||||
NSStringEncoding enc)
|
||||
{
|
||||
BOOL result;
|
||||
|
@ -1341,12 +1341,12 @@ GSToUnicode(unichar **dst, unsigned int *size, const unsigned char *src,
|
|||
base = Thai_conv_base;
|
||||
table = Thai_char_to_uni_table;
|
||||
goto tables;
|
||||
|
||||
|
||||
#if 0
|
||||
case NSSymbolStringEncoding:
|
||||
base = Symbol_conv_base;
|
||||
table = Symbol_char_to_uni_table;
|
||||
goto tables;
|
||||
goto tables;
|
||||
#endif
|
||||
|
||||
tables:
|
||||
|
@ -1430,7 +1430,7 @@ tables:
|
|||
cd = iconv_open(UNICODE_ENC, estr);
|
||||
if (cd == (iconv_t)-1)
|
||||
{
|
||||
NSLog(@"No iconv for encoding %@ tried to use %s",
|
||||
NSLog(@"No iconv for encoding %@ tried to use %s",
|
||||
GetEncodingName(enc), estr);
|
||||
result = NO;
|
||||
break;
|
||||
|
@ -1473,9 +1473,9 @@ tables:
|
|||
// close the converter
|
||||
iconv_close(cd);
|
||||
}
|
||||
#else
|
||||
#else
|
||||
result = NO;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2081,7 +2081,7 @@ tables:
|
|||
cd = iconv_open(estr, UNICODE_ENC);
|
||||
if (cd == (iconv_t)-1)
|
||||
{
|
||||
NSLog(@"No iconv for encoding %@ tried to use %s",
|
||||
NSLog(@"No iconv for encoding %@ tried to use %s",
|
||||
GetEncodingName(enc), estr);
|
||||
result = NO;
|
||||
break;
|
||||
|
@ -2159,7 +2159,7 @@ tables:
|
|||
#else
|
||||
result = NO;
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -19,7 +19,7 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
/* A Behavior can be seen as a "Protocol with an implementation" or a
|
||||
"Class without any instance variables". A key feature of behaviors
|
||||
|
@ -28,7 +28,7 @@
|
|||
Behavior methods, when added to a class, override the class's
|
||||
superclass methods, but not the class's methods.
|
||||
|
||||
xxx not necessarily on the "no instance vars". The behavior just has
|
||||
xxx not necessarily on the "no instance vars". The behavior just has
|
||||
to have the same layout as the class.
|
||||
|
||||
The following function is a sneaky hack way that provides Behaviors
|
||||
|
@ -38,7 +38,7 @@
|
|||
|
||||
This function should be called in CLASS's +initialize method.
|
||||
|
||||
If you add several behaviors to a class, be aware that the order of
|
||||
If you add several behaviors to a class, be aware that the order of
|
||||
the additions is significant.
|
||||
|
||||
McCallum talking to himself:
|
||||
|
@ -113,7 +113,7 @@ behavior_class_add_class (Class class, Class behavior)
|
|||
void *iterator = 0;
|
||||
struct objc_method_list *method_list;
|
||||
|
||||
while ( (method_list = class_nextMethodList(behavior, &iterator)) )
|
||||
while ((method_list = class_nextMethodList(behavior, &iterator)))
|
||||
behavior_class_add_methods (class, method_list);
|
||||
}
|
||||
#else
|
||||
|
@ -131,12 +131,12 @@ behavior_class_add_class (Class class, Class behavior)
|
|||
void *iterator = 0;
|
||||
struct objc_method_list *method_list;
|
||||
|
||||
while ( (method_list =
|
||||
class_nextMethodList(behavior->class_pointer, &iterator)) )
|
||||
while ((method_list =
|
||||
class_nextMethodList(behavior->class_pointer, &iterator)))
|
||||
behavior_class_add_methods (class->class_pointer, method_list);
|
||||
}
|
||||
#else
|
||||
behavior_class_add_methods (class->class_pointer,
|
||||
behavior_class_add_methods (class->class_pointer,
|
||||
behavior->class_pointer->methods);
|
||||
#endif
|
||||
|
||||
|
@ -152,9 +152,9 @@ behavior_class_add_class (Class class, Class behavior)
|
|||
void
|
||||
behavior_class_add_category (Class class, struct objc_category *category)
|
||||
{
|
||||
behavior_class_add_methods (class,
|
||||
behavior_class_add_methods (class,
|
||||
category->instance_methods);
|
||||
behavior_class_add_methods (class->class_pointer,
|
||||
behavior_class_add_methods (class->class_pointer,
|
||||
category->class_methods);
|
||||
/* xxx Add the protocols (category->protocols) too. */
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ behavior_class_add_category (Class class, struct objc_category *category)
|
|||
|
||||
static struct objc_method *search_for_method_in_list (Class class, SEL op);
|
||||
|
||||
void
|
||||
void
|
||||
behavior_class_add_methods (Class class, struct objc_method_list *methods)
|
||||
{
|
||||
static SEL initialize_sel = 0;
|
||||
|
@ -180,7 +180,7 @@ behavior_class_add_methods (Class class, struct objc_method_list *methods)
|
|||
|
||||
counter = mlist->method_count ? mlist->method_count - 1 : 1;
|
||||
|
||||
/* This is a little wasteful of memory, since not necessarily
|
||||
/* This is a little wasteful of memory, since not necessarily
|
||||
all methods will go in here. */
|
||||
new_list = (struct objc_method_list *)
|
||||
objc_malloc (sizeof(struct objc_method_list) +
|
||||
|
@ -193,7 +193,7 @@ behavior_class_add_methods (Class class, struct objc_method_list *methods)
|
|||
|
||||
if (behavior_debug)
|
||||
{
|
||||
fprintf(stderr, " processing method [%s] ... ",
|
||||
fprintf(stderr, " processing method [%s] ... ",
|
||||
sel_get_name(method->method_name));
|
||||
}
|
||||
|
||||
|
@ -207,12 +207,12 @@ behavior_class_add_methods (Class class, struct objc_method_list *methods)
|
|||
(new_list->method_count)++;
|
||||
if (behavior_debug)
|
||||
{
|
||||
fprintf(stderr, "added.\n");
|
||||
fprintf(stderr, "added.\n");
|
||||
}
|
||||
}
|
||||
else if (behavior_debug)
|
||||
{
|
||||
fprintf(stderr, "ignored.\n");
|
||||
fprintf(stderr, "ignored.\n");
|
||||
}
|
||||
counter -= 1;
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ search_for_method_in_list (Class class, SEL op)
|
|||
return NULL;
|
||||
|
||||
/* If not found then we'll search the list. */
|
||||
while ( (method_list = class_nextMethodList(class, &iterator)) )
|
||||
while ((method_list = class_nextMethodList(class, &iterator)))
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -269,7 +269,7 @@ extern Method_t search_for_method_in_list(MethodList_t list, SEL op);
|
|||
extern void class_add_method_list(Class, MethodList_t);
|
||||
|
||||
void
|
||||
behavior_class_add_methods (Class class,
|
||||
behavior_class_add_methods (Class class,
|
||||
struct objc_method_list *methods)
|
||||
{
|
||||
static SEL initialize_sel = 0;
|
||||
|
@ -286,7 +286,7 @@ behavior_class_add_methods (Class class,
|
|||
|
||||
counter = mlist->method_count ? mlist->method_count - 1 : 1;
|
||||
|
||||
/* This is a little wasteful of memory, since not necessarily
|
||||
/* This is a little wasteful of memory, since not necessarily
|
||||
all methods will go in here. */
|
||||
new_list = (struct objc_method_list *)
|
||||
objc_malloc (sizeof(struct objc_method_list) +
|
||||
|
@ -321,12 +321,12 @@ behavior_class_add_methods (Class class,
|
|||
(new_list->method_count)++;
|
||||
if (behavior_debug)
|
||||
{
|
||||
fprintf(stderr, "added.\n");
|
||||
fprintf(stderr, "added.\n");
|
||||
}
|
||||
}
|
||||
else if (behavior_debug)
|
||||
{
|
||||
fprintf(stderr, "ignored.\n");
|
||||
fprintf(stderr, "ignored.\n");
|
||||
}
|
||||
counter -= 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue