mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
avoid compiler warnings
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32417 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
23fd98d4e0
commit
d18e29dde8
31 changed files with 201 additions and 163 deletions
34
ChangeLog
34
ChangeLog
|
@ -1,3 +1,37 @@
|
|||
2011-02-28 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSTimeZone.m:
|
||||
* Source/NSPortCoder.m:
|
||||
* Source/NSBundle.m:
|
||||
* Source/NSPropertyList.m:
|
||||
* Source/NSDistributedNotificationCenter.m:
|
||||
* Source/NSProcessInfo.m:
|
||||
* Source/NSRunLoop.m:
|
||||
* Source/NSOperation.m:
|
||||
* Source/NSUserDefaults.m:
|
||||
* Source/GSArray.m:
|
||||
* Source/NSMessagePortNameServer.m:
|
||||
* Source/NSKeyedArchiver.m:
|
||||
* Source/NSDebug.m:
|
||||
* Source/NSPort.m:
|
||||
* Source/NSMessagePort.m:
|
||||
* Source/win32/NSMessagePortNameServer.m:
|
||||
* Source/NSFileManager.m:
|
||||
* Source/NSException.m:
|
||||
* Source/NSString.m:
|
||||
* Source/Additions/NSData+GNUstepBase.m:
|
||||
* Source/Additions/GSMime.m:
|
||||
* Source/Additions/NSCalendarDate+GNUstepBase.m:
|
||||
* Source/Additions/GSXML.m:
|
||||
* Source/Additions/GSObjCRuntime.m:
|
||||
* Source/GSSet.m:
|
||||
* Source/NSConnection.m:
|
||||
* Source/NSThread.m:
|
||||
* Source/GSeq.h:
|
||||
* Source/NSLog.m:
|
||||
* Source/NSTask.m:
|
||||
Tweaks to avoid compiler warnings in garbage collecting environment.
|
||||
|
||||
2011-02-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Tests/GNUmakefile: Use gnustep-make to supply targets.
|
||||
|
|
|
@ -5418,17 +5418,17 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
{
|
||||
NSMutableArray *partData = nil;
|
||||
NSMutableData *md = [NSMutableData dataWithCapacity: 1024];
|
||||
NSData *d = nil;
|
||||
NSEnumerator *enumerator;
|
||||
GSMimeHeader *type;
|
||||
GSMimeHeader *enc;
|
||||
GSMimeHeader *hdr;
|
||||
NSData *boundary = 0;
|
||||
BOOL contentIsBinary = NO;
|
||||
BOOL contentIs7bit = YES;
|
||||
NSUInteger count;
|
||||
NSUInteger i;
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSData *d = nil;
|
||||
NSEnumerator *enumerator;
|
||||
GSMimeHeader *type;
|
||||
GSMimeHeader *enc;
|
||||
GSMimeHeader *hdr;
|
||||
NSData *boundary = 0;
|
||||
BOOL contentIsBinary = NO;
|
||||
BOOL contentIs7bit = YES;
|
||||
NSUInteger count;
|
||||
NSUInteger i;
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
if (isOuter == YES)
|
||||
{
|
||||
|
@ -5865,7 +5865,7 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
[md appendData: d];
|
||||
}
|
||||
}
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
return md;
|
||||
}
|
||||
|
||||
|
@ -5960,9 +5960,9 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
type: (NSString*)type
|
||||
name: (NSString*)name
|
||||
{
|
||||
NSString *subtype = nil;
|
||||
GSMimeHeader *hdr = nil;
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSString *subtype = nil;
|
||||
GSMimeHeader *hdr = nil;
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
if (type == nil)
|
||||
{
|
||||
|
@ -6028,7 +6028,7 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
|
||||
[self setContent: newContent];
|
||||
[self setHeader: hdr];
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -6040,10 +6040,10 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
*/
|
||||
- (void) setContentType: (NSString *)newType
|
||||
{
|
||||
GSMimeHeader *hdr = nil;
|
||||
GSMimeParser *p;
|
||||
NSScanner *scanner;
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
GSMimeHeader *hdr = nil;
|
||||
GSMimeParser *p;
|
||||
NSScanner *scanner;
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
p = AUTORELEASE([GSMimeParser new]);
|
||||
scanner = [NSScanner scannerWithString: newType];
|
||||
|
@ -6055,7 +6055,7 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
format: @"Unable to parse type information"];
|
||||
}
|
||||
[self setHeader: hdr];
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -6704,7 +6704,7 @@ GS_PRIVATE_INTERNAL(GSMimeSMTPClient)
|
|||
{
|
||||
NS_DURING
|
||||
{
|
||||
RETAIN(self); // Make sure we don't get released until done.
|
||||
[self retain]; // Make sure we don't get released until done.
|
||||
|
||||
/* First perform all reads ... so we process incoming data,
|
||||
*/
|
||||
|
@ -6830,7 +6830,7 @@ GS_PRIVATE_INTERNAL(GSMimeSMTPClient)
|
|||
}
|
||||
}
|
||||
|
||||
RELEASE(self);
|
||||
[self release];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
|
@ -7206,8 +7206,8 @@ GS_PRIVATE_INTERNAL(GSMimeSMTPClient)
|
|||
port: pnum
|
||||
inputStream: &internal->istream
|
||||
outputStream: &internal->ostream];
|
||||
RETAIN(internal->istream);
|
||||
RETAIN(internal->ostream);
|
||||
[internal->istream retain];
|
||||
[internal->ostream retain];
|
||||
if (internal->istream == nil || internal->ostream == nil)
|
||||
{
|
||||
NSLog(@"Unable to connect to %@:%@", n, p);
|
||||
|
|
|
@ -1956,11 +1956,11 @@ GSPrintf (FILE *fptr, NSString* format, ...)
|
|||
{
|
||||
static Class stringClass = 0;
|
||||
static NSStringEncoding enc;
|
||||
va_list ap;
|
||||
NSString *message;
|
||||
NSData *data;
|
||||
BOOL ok = NO;
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
va_list ap;
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSString *message;
|
||||
NSData *data;
|
||||
BOOL ok = NO;
|
||||
|
||||
if (stringClass == 0)
|
||||
{
|
||||
|
@ -1976,7 +1976,7 @@ GSPrintf (FILE *fptr, NSString* format, ...)
|
|||
{
|
||||
data = [message dataUsingEncoding: NSUTF8StringEncoding];
|
||||
}
|
||||
RELEASE(message);
|
||||
[message release];
|
||||
|
||||
if (data != nil)
|
||||
{
|
||||
|
@ -1987,7 +1987,7 @@ GSPrintf (FILE *fptr, NSString* format, ...)
|
|||
ok = YES;
|
||||
}
|
||||
}
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
|
|
@ -1746,7 +1746,7 @@ static NSString *endMarker = @"At end of incremental parse";
|
|||
* Creation of a new Parser by calling
|
||||
* -initWithSAXHandler:withContentsOfFile:
|
||||
* <example>
|
||||
* CREATE_AUTORELEASE_POOL(arp);
|
||||
* NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
* GSSAXHandler *h = [GSDebugSAXHandler handler];
|
||||
* GSXMLParser *p = [GSXMLParser parserWithSAXHandler: h
|
||||
* withContentsOfFile: @"macos.xml"];
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
*/
|
||||
if (dayOfWeek != 4)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSCalendarDate *thursday;
|
||||
|
||||
/*
|
||||
|
@ -72,7 +72,7 @@
|
|||
minutes: 0
|
||||
seconds: 0];
|
||||
dayOfYear = [thursday dayOfYear];
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -90,14 +90,14 @@
|
|||
*/
|
||||
- (id) initWithHexadecimalRepresentation: (NSString*)string
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSData *d;
|
||||
const char *src;
|
||||
const char *end;
|
||||
unsigned char *dst;
|
||||
unsigned int pos = 0;
|
||||
unsigned char byte = 0;
|
||||
BOOL high = NO;
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSData *d;
|
||||
const char *src;
|
||||
const char *end;
|
||||
unsigned char *dst;
|
||||
unsigned int pos = 0;
|
||||
unsigned char byte = 0;
|
||||
BOOL high = NO;
|
||||
|
||||
d = [string dataUsingEncoding: NSASCIIStringEncoding
|
||||
allowLossyConversion: YES];
|
||||
|
@ -152,7 +152,7 @@
|
|||
DESTROY(self);
|
||||
}
|
||||
NSZoneFree(NSDefaultMallocZone(), dst);
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
if (self == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
|
|
|
@ -723,7 +723,7 @@ static Class GSInlineArrayClass;
|
|||
index++;
|
||||
}
|
||||
_contents_array[_count] = 0;
|
||||
RELEASE(obj); /* Adjust array BEFORE releasing object. */
|
||||
[obj release]; /* Adjust array BEFORE releasing object. */
|
||||
_version++;
|
||||
}
|
||||
|
||||
|
@ -788,9 +788,9 @@ static Class GSInlineArrayClass;
|
|||
* array in case a retain or release causes an exception.
|
||||
*/
|
||||
obj = _contents_array[index];
|
||||
IF_NO_GC(RETAIN(anObject));
|
||||
[anObject retain];
|
||||
_contents_array[index] = anObject;
|
||||
RELEASE(obj);
|
||||
[obj release];
|
||||
_version++;
|
||||
}
|
||||
|
||||
|
|
|
@ -116,10 +116,6 @@ static Class mutableSetClass;
|
|||
{
|
||||
if (self == [GSSet class])
|
||||
{
|
||||
arrayClass = [NSArray class];
|
||||
setClass = [GSSet class];
|
||||
mutableSetClass = [GSMutableSet class];
|
||||
memberSel = @selector(member:);
|
||||
#if GS_WITH_GC
|
||||
/* We create a typed memory descriptor for map nodes.
|
||||
* Only the pointer to the key needs to be scanned.
|
||||
|
@ -128,6 +124,10 @@ static Class mutableSetClass;
|
|||
GC_set_bit(w, GC_WORD_OFFSET(GSIMapNode_t, key));
|
||||
nodeDesc = GC_make_descriptor(w, GC_WORD_LEN(GSIMapNode_t));
|
||||
#endif
|
||||
arrayClass = [NSArray class];
|
||||
setClass = [GSSet class];
|
||||
mutableSetClass = [GSMutableSet class];
|
||||
memberSel = @selector(member:);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -598,7 +598,6 @@ GSEQ_STRRANGE(NSString *ss, NSString *os, unsigned mask, NSRange aRange)
|
|||
{
|
||||
GSEQ_ST s = (GSEQ_ST)ss;
|
||||
GSEQ_OT o = (GSEQ_OT)os;
|
||||
unsigned myLength;
|
||||
unsigned myIndex;
|
||||
unsigned myEndIndex;
|
||||
unsigned strLength;
|
||||
|
@ -617,10 +616,10 @@ GSEQ_STRRANGE(NSString *ss, NSString *os, unsigned mask, NSRange aRange)
|
|||
NSRange (*orImp)(NSString*, SEL, unsigned);
|
||||
#endif
|
||||
|
||||
/* Check that the search range is reasonable */
|
||||
myLength = GSEQ_SLEN;
|
||||
|
||||
#if 0
|
||||
/* Check that the search range is reasonable */
|
||||
unsigned myLength = GSEQ_SLEN;
|
||||
|
||||
/* Range should be checked in calling code */
|
||||
if (aRange.location > myLength)
|
||||
[NSException raise: NSRangeException format: @"Invalid location."];
|
||||
|
|
|
@ -1904,9 +1904,9 @@ IF_NO_GC(
|
|||
inDirectory: (NSString*)subPath
|
||||
forLocalization: (NSString*)localizationName
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSString *result = nil;
|
||||
NSArray *array;
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSString *result = nil;
|
||||
NSArray *array;
|
||||
|
||||
if ([ext length] == 0)
|
||||
{
|
||||
|
@ -1937,8 +1937,9 @@ IF_NO_GC(
|
|||
}
|
||||
}
|
||||
}
|
||||
IF_NO_GC([result retain]; DESTROY(arp);)
|
||||
return AUTORELEASE(result);
|
||||
[result retain];
|
||||
[arp release];
|
||||
return [result autorelease];
|
||||
}
|
||||
|
||||
+ (NSArray *) preferredLocalizationsFromArray: (NSArray *)localizationsArray
|
||||
|
|
|
@ -634,8 +634,6 @@ static NSLock *cached_proxies_gate = nil;
|
|||
{
|
||||
NSNotificationCenter *nc;
|
||||
|
||||
GSMakeWeakPointer(self, "delegate");
|
||||
|
||||
#if GS_WITH_GC
|
||||
/* We create a typed memory descriptor for map nodes.
|
||||
* FIXME
|
||||
|
@ -645,6 +643,8 @@ static NSLock *cached_proxies_gate = nil;
|
|||
GC_set_bit(w, GC_WORD_OFFSET(GSIMapNode_t, value));
|
||||
nodeDesc = GC_make_descriptor(w, GC_WORD_LEN(GSIMapNode_t));
|
||||
#endif
|
||||
|
||||
GSMakeWeakPointer(self, "delegate");
|
||||
connectionClass = self;
|
||||
dateClass = [NSDate class];
|
||||
distantObjectClass = [NSDistantObject class];
|
||||
|
@ -708,17 +708,17 @@ static NSLock *cached_proxies_gate = nil;
|
|||
+ (NSDistantObject*) rootProxyForConnectionWithRegisteredName: (NSString*)n
|
||||
host: (NSString*)h
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSConnection *connection;
|
||||
NSDistantObject *proxy = nil;
|
||||
|
||||
connection = [self connectionWithRegisteredName: n host: h];
|
||||
if (connection != nil)
|
||||
{
|
||||
proxy = RETAIN([connection rootProxy]);
|
||||
proxy = [[connection rootProxy] retain];
|
||||
}
|
||||
RELEASE(arp);
|
||||
return AUTORELEASE(proxy);
|
||||
[arp release];
|
||||
return [proxy autorelease];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -734,7 +734,7 @@ static NSLock *cached_proxies_gate = nil;
|
|||
+ (NSDistantObject*) rootProxyForConnectionWithRegisteredName: (NSString*)n
|
||||
host: (NSString*)h usingNameServer: (NSPortNameServer*)s
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSConnection *connection;
|
||||
NSDistantObject *proxy = nil;
|
||||
|
||||
|
@ -745,7 +745,7 @@ static NSLock *cached_proxies_gate = nil;
|
|||
{
|
||||
proxy = RETAIN([connection rootProxy]);
|
||||
}
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
return AUTORELEASE(proxy);
|
||||
}
|
||||
|
||||
|
@ -1305,12 +1305,12 @@ static NSLock *cached_proxies_gate = nil;
|
|||
* is done before the deallocation completes.
|
||||
*/
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: NSConnectionDidDieNotification
|
||||
object: self];
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1885,7 +1885,7 @@ static NSLock *cached_proxies_gate = nil;
|
|||
|
||||
- (void) finalize
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
if (debug_connection)
|
||||
NSLog(@"finalising %@", self);
|
||||
|
@ -1950,7 +1950,7 @@ static NSLock *cached_proxies_gate = nil;
|
|||
|
||||
DESTROY(IrefGate);
|
||||
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -683,7 +683,7 @@ _GSDebugAllocationRemove(Class c, id o)
|
|||
}
|
||||
}
|
||||
[uniqueLock unlock];
|
||||
RELEASE(tag);
|
||||
[tag release];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1088,7 +1088,7 @@ NSMutableArray *
|
|||
GSPrivateStackAddresses(void)
|
||||
{
|
||||
NSMutableArray *stack;
|
||||
NSAutoreleasePool *pool;
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
#if HAVE_BACKTRACE
|
||||
void *addresses[1024];
|
||||
|
@ -1182,7 +1182,7 @@ GSPrivateStackAddresses(void)
|
|||
signal(SIGBUS, env->bus);
|
||||
}
|
||||
#endif
|
||||
RELEASE(pool);
|
||||
[pool release];
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
|
|
@ -736,13 +736,14 @@ static NSDistributedNotificationCenter *netCenter = nil;
|
|||
limit = [NSDate dateWithTimeIntervalSinceNow: 5.0];
|
||||
while (_remote == nil && [limit timeIntervalSinceNow] > 0)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
|
||||
[NSThread sleepForTimeInterval: 0.05];
|
||||
_remote = [NSConnection
|
||||
rootProxyForConnectionWithRegisteredName: service
|
||||
host: host usingNameServer: ns];
|
||||
IF_NO_GC([_remote retain];)
|
||||
IF_NO_GC(DESTROY(pool);)
|
||||
[_remote retain];
|
||||
[pool release];
|
||||
}
|
||||
if (_remote == nil)
|
||||
{
|
||||
|
|
|
@ -759,7 +759,8 @@ static void _terminate()
|
|||
static void
|
||||
_NSFoundationUncaughtExceptionHandler (NSException *exception)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
|
||||
fprintf(stderr, "%s: Uncaught exception %s, reason: %s\n",
|
||||
GSPrivateArgZero(),
|
||||
[[exception name] lossyCString], [[exception reason] lossyCString]);
|
||||
|
@ -770,7 +771,7 @@ _NSFoundationUncaughtExceptionHandler (NSException *exception)
|
|||
[[[exception _callStack] description] lossyCString]);
|
||||
}
|
||||
fflush(stderr); /* NEEDED UNDER MINGW */
|
||||
RELEASE(pool);
|
||||
[pool release];
|
||||
_terminate();
|
||||
}
|
||||
|
||||
|
@ -907,8 +908,8 @@ callUncaughtHandler(id value)
|
|||
|
||||
- (NSString*) description
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
NSString *result;
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
NSString *result;
|
||||
|
||||
if (_e_name == nil)
|
||||
{
|
||||
|
@ -945,9 +946,9 @@ callUncaughtHandler(id value)
|
|||
result = [NSString stringWithFormat: @"%@ NAME:%@ REASON:%@",
|
||||
[super description], _e_name, _e_reason];
|
||||
}
|
||||
IF_NO_GC([result retain];)
|
||||
IF_NO_GC(DESTROY(pool);)
|
||||
return AUTORELEASE(result);
|
||||
[result retain];
|
||||
[pool release];
|
||||
return [result autorelease];
|
||||
}
|
||||
|
||||
- (void) raise
|
||||
|
|
|
@ -666,7 +666,7 @@ static NSStringEncoding defaultEncoding;
|
|||
NSString *n = [a1 objectAtIndex: index];
|
||||
NSString *p1;
|
||||
NSString *p2;
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
|
||||
p1 = [path1 stringByAppendingPathComponent: n];
|
||||
p2 = [path2 stringByAppendingPathComponent: n];
|
||||
|
@ -1404,12 +1404,12 @@ static NSStringEncoding defaultEncoding;
|
|||
NSString *item;
|
||||
NSString *next;
|
||||
BOOL result;
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
item = [contents objectAtIndex: i];
|
||||
next = [path stringByAppendingPathComponent: item];
|
||||
result = [self removeFileAtPath: next handler: handler];
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
if (result == NO)
|
||||
{
|
||||
return NO;
|
||||
|
@ -2700,7 +2700,7 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
{
|
||||
NSDirectoryEnumerator *enumerator;
|
||||
NSString *dirEntry;
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
|
||||
enumerator = [self enumeratorAtPath: source];
|
||||
while ((dirEntry = [enumerator nextObject]))
|
||||
|
@ -2789,7 +2789,7 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
}
|
||||
[self changeFileAttributes: attributes atPath: destinationFile];
|
||||
}
|
||||
RELEASE(pool);
|
||||
[pool release];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
@ -2801,7 +2801,7 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
#ifdef HAVE_LINK
|
||||
NSDirectoryEnumerator *enumerator;
|
||||
NSString *dirEntry;
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
|
||||
enumerator = [self enumeratorAtPath: source];
|
||||
while ((dirEntry = [enumerator nextObject]))
|
||||
|
@ -2879,7 +2879,7 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
}
|
||||
[self changeFileAttributes: attributes atPath: destinationFile];
|
||||
}
|
||||
RELEASE(pool);
|
||||
[pool release];
|
||||
return YES;
|
||||
#else
|
||||
return NO;
|
||||
|
|
|
@ -468,13 +468,13 @@ static NSDictionary *makeReference(unsigned ref)
|
|||
|
||||
+ (BOOL) archiveRootObject: (id)anObject toFile: (NSString*)aPath
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
NSData *d;
|
||||
BOOL result;
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
NSData *d;
|
||||
BOOL result;
|
||||
|
||||
d = [self archivedDataWithRootObject: anObject];
|
||||
result = [d writeToFile: aPath atomically: YES];
|
||||
RELEASE(pool);
|
||||
[pool release];
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -485,8 +485,6 @@ static NSDictionary *makeReference(unsigned ref)
|
|||
|
||||
+ (void) initialize
|
||||
{
|
||||
GSMakeWeakPointer(self, "delegate");
|
||||
|
||||
#if GS_WITH_GC
|
||||
/* We create a typed memory descriptor for map nodes.
|
||||
*/
|
||||
|
@ -495,6 +493,9 @@ static NSDictionary *makeReference(unsigned ref)
|
|||
GC_set_bit(w, GC_WORD_OFFSET(GSIMapNode_t, value));
|
||||
nodeDesc = GC_make_descriptor(w, GC_WORD_LEN(GSIMapNode_t));
|
||||
#endif
|
||||
|
||||
GSMakeWeakPointer(self, "delegate");
|
||||
|
||||
if (globalClassMap == 0)
|
||||
{
|
||||
globalClassMap =
|
||||
|
|
|
@ -282,10 +282,10 @@ NSLog (NSString* format, ...)
|
|||
void
|
||||
NSLogv (NSString* format, va_list args)
|
||||
{
|
||||
NSString *prefix;
|
||||
NSString *message;
|
||||
static int pid = 0;
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSString *prefix;
|
||||
NSString *message;
|
||||
static int pid = 0;
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
if (_NSLog_printf_handler == NULL)
|
||||
{
|
||||
|
@ -357,6 +357,6 @@ NSLogv (NSString* format, va_list args)
|
|||
|
||||
[myLock unlock];
|
||||
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
}
|
||||
|
||||
|
|
|
@ -1087,11 +1087,11 @@ static Class messagePortClass;
|
|||
|
||||
static void clean_up_sockets(void)
|
||||
{
|
||||
NSMessagePort *port;
|
||||
NSData *name;
|
||||
NSMapEnumerator mEnum;
|
||||
BOOL unknownThread = GSRegisterCurrentThread();
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSMessagePort *port;
|
||||
NSData *name;
|
||||
NSMapEnumerator mEnum;
|
||||
BOOL unknownThread = GSRegisterCurrentThread();
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
mEnum = NSEnumerateMapTable(messagePortMap);
|
||||
while (NSNextMapEnumeratorPair(&mEnum, (void *)&name, (void *)&port))
|
||||
|
@ -1100,7 +1100,7 @@ static void clean_up_sockets(void)
|
|||
unlink([name bytes]);
|
||||
}
|
||||
NSEndMapTableEnumeration(&mEnum);
|
||||
IF_NO_GC(DESTROY(arp);)
|
||||
[arp release];
|
||||
if (unknownThread == YES)
|
||||
{
|
||||
GSUnregisterCurrentThread();
|
||||
|
|
|
@ -91,7 +91,7 @@ static void clean_up_names(void)
|
|||
NSMessagePort *port;
|
||||
NSString *name;
|
||||
BOOL unknownThread = GSRegisterCurrentThread();
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
mEnum = NSEnumerateMapTable(portToNamesMap);
|
||||
while (NSNextMapEnumeratorPair(&mEnum, (void *)&port, (void *)&name))
|
||||
|
@ -99,7 +99,7 @@ static void clean_up_names(void)
|
|||
[defaultServer removePort: port];
|
||||
}
|
||||
NSEndMapTableEnumeration(&mEnum);
|
||||
IF_NO_GC(DESTROY(arp);)
|
||||
[arp release];
|
||||
if (unknownThread == YES)
|
||||
{
|
||||
GSUnregisterCurrentThread();
|
||||
|
|
|
@ -373,8 +373,8 @@ static NSArray *empty = nil;
|
|||
|
||||
- (void) start
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
double prio = [NSThread threadPriority];
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
double prio = [NSThread threadPriority];
|
||||
|
||||
[internal->lock lock];
|
||||
NS_DURING
|
||||
|
@ -452,7 +452,7 @@ static NSArray *empty = nil;
|
|||
}
|
||||
NS_ENDHANDLER
|
||||
[internal->lock unlock];
|
||||
RELEASE(pool);
|
||||
[pool release];
|
||||
}
|
||||
|
||||
- (double) threadPriority
|
||||
|
|
|
@ -154,13 +154,13 @@ static Class NSPort_concrete_class;
|
|||
*/
|
||||
- (void) invalidate
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
_is_valid = NO;
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: NSPortDidBecomeInvalidNotification
|
||||
object: self];
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
}
|
||||
|
||||
- (BOOL) isValid
|
||||
|
|
|
@ -350,6 +350,14 @@ static IMP _xRefImp; /* Serialize a crossref. */
|
|||
{
|
||||
if (self == [NSPortCoder class])
|
||||
{
|
||||
#if GS_WITH_GC
|
||||
/* We create a typed memory descriptor for map nodes.
|
||||
*/
|
||||
GC_word w[GC_BITMAP_SIZE(GSIMapNode_t)] = {0};
|
||||
GC_set_bit(w, GC_WORD_OFFSET(GSIMapNode_t, key));
|
||||
GC_set_bit(w, GC_WORD_OFFSET(GSIMapNode_t, value));
|
||||
nodeDesc = GC_make_descriptor(w, GC_WORD_LEN(GSIMapNode_t));
|
||||
#endif
|
||||
connectionClass = [NSConnection class];
|
||||
mutableArrayClass = [NSMutableArray class];
|
||||
mutableDataClass = [NSMutableDataMalloc class];
|
||||
|
@ -365,14 +373,6 @@ static IMP _xRefImp; /* Serialize a crossref. */
|
|||
_eTagImp = [mutableDataClass instanceMethodForSelector: eTagSel];
|
||||
_xRefImp = [mutableDataClass instanceMethodForSelector: xRefSel];
|
||||
mutableDictionaryClass = [NSMutableDictionary class];
|
||||
#if GS_WITH_GC
|
||||
/* We create a typed memory descriptor for map nodes.
|
||||
*/
|
||||
GC_word w[GC_BITMAP_SIZE(GSIMapNode_t)] = {0};
|
||||
GC_set_bit(w, GC_WORD_OFFSET(GSIMapNode_t, key));
|
||||
GC_set_bit(w, GC_WORD_OFFSET(GSIMapNode_t, value));
|
||||
nodeDesc = GC_make_descriptor(w, GC_WORD_LEN(GSIMapNode_t));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -225,7 +225,7 @@ static NSMutableSet *mySet = nil;
|
|||
static void
|
||||
_gnu_process_args(int argc, char *argv[], char *env[])
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSString *arg0 = nil;
|
||||
int i;
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ foundIgnorableWhitespace: (NSString *)string
|
|||
|
||||
if (key == nil)
|
||||
{
|
||||
key = RETAIN([NSNull null]);
|
||||
key = [[NSNull null] retain];
|
||||
}
|
||||
[stack addObject: key];
|
||||
DESTROY(key);
|
||||
|
@ -191,7 +191,7 @@ foundIgnorableWhitespace: (NSString *)string
|
|||
|
||||
if (key == nil)
|
||||
{
|
||||
key = RETAIN([NSNull null]);
|
||||
key = [[NSNull null] retain];
|
||||
}
|
||||
[stack addObject: key];
|
||||
DESTROY(key);
|
||||
|
|
|
@ -423,7 +423,8 @@ static inline BOOL timerInvalidated(NSTimer *t)
|
|||
|
||||
- (void) _checkPerformers: (GSRunLoopCtxt*)context
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
if (context != nil)
|
||||
{
|
||||
GSIArray performers = context->performers;
|
||||
|
@ -481,11 +482,11 @@ static inline BOOL timerInvalidated(NSTimer *t)
|
|||
{
|
||||
[array[i] fire];
|
||||
RELEASE(array[i]);
|
||||
IF_NO_GC([arp emptyPool]);
|
||||
IF_NO_GC([arp emptyPool];)
|
||||
}
|
||||
}
|
||||
}
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -715,7 +716,7 @@ static inline BOOL timerInvalidated(NSTimer *t)
|
|||
*/
|
||||
if ([GSCurrentThread() isMainThread] == YES)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL (arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
GSRunLoopCtxt *context;
|
||||
NSNotificationCenter *ctr;
|
||||
NSNotification *not;
|
||||
|
@ -756,7 +757,7 @@ static inline BOOL timerInvalidated(NSTimer *t)
|
|||
userInfo: nil
|
||||
repeats: YES];
|
||||
context->housekeeper = timer;
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
}
|
||||
}
|
||||
return current;
|
||||
|
@ -942,7 +943,7 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
|
|||
if (context != nil)
|
||||
{
|
||||
NSString *savedMode = _currentMode;
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
_currentMode = mode;
|
||||
NS_DURING
|
||||
|
@ -982,7 +983,7 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
|
|||
{
|
||||
[t fire];
|
||||
GSPrivateNotifyASAP(_currentMode);
|
||||
IF_NO_GC([arp emptyPool]);
|
||||
IF_NO_GC([arp emptyPool];)
|
||||
updateTimer(t, d, now);
|
||||
}
|
||||
}
|
||||
|
@ -1007,7 +1008,7 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
|
|||
GSIArrayRemoveItemAtIndexNoRelease(timers, i);
|
||||
[t fire];
|
||||
GSPrivateNotifyASAP(_currentMode);
|
||||
IF_NO_GC([arp emptyPool]);
|
||||
IF_NO_GC([arp emptyPool];)
|
||||
if (updateTimer(t, d, now) == YES)
|
||||
{
|
||||
/* Updated ... replace in array.
|
||||
|
@ -1069,7 +1070,7 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
|
|||
}
|
||||
NS_ENDHANDLER
|
||||
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
|
||||
if (when == nil)
|
||||
{
|
||||
|
@ -1119,7 +1120,7 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
|
|||
NSTimeInterval ti = 0;
|
||||
int timeout_ms;
|
||||
NSString *savedMode = _currentMode;
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
NSAssert(mode, NSInvalidArgumentException);
|
||||
if (mode == nil)
|
||||
|
@ -1163,7 +1164,7 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
|
|||
}
|
||||
GSPrivateNotifyASAP(_currentMode);
|
||||
_currentMode = savedMode;
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
NS_VOIDRETURN;
|
||||
}
|
||||
|
||||
|
@ -1221,7 +1222,7 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
|
|||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1238,8 +1239,8 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
|
|||
*/
|
||||
- (BOOL) runMode: (NSString*)mode beforeDate: (NSDate*)date
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSDate *d;
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSDate *d;
|
||||
|
||||
NSAssert(mode != nil, NSInvalidArgumentException);
|
||||
|
||||
|
@ -1247,7 +1248,7 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
|
|||
d = [self limitDateForMode: mode];
|
||||
if (d == nil)
|
||||
{
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
@ -1260,13 +1261,13 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
|
|||
{
|
||||
d = [d earlierDate: date];
|
||||
}
|
||||
IF_NO_GC(RETAIN(d));
|
||||
[d retain];
|
||||
|
||||
/* Wait, listening to our input sources. */
|
||||
[self acceptInputForMode: mode beforeDate: d];
|
||||
|
||||
RELEASE(d);
|
||||
RELEASE(arp);
|
||||
[d release];
|
||||
[arp release];
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
|
|
@ -2270,7 +2270,7 @@ handle_printf_atsign (FILE *stream,
|
|||
int prefix_len = 0;
|
||||
unsigned length = [self length];
|
||||
unsigned aLength = [aString length];
|
||||
unichar *u,*w;
|
||||
unichar *u;
|
||||
unichar a1[length+1];
|
||||
unichar *s1 = a1;
|
||||
unichar a2[aLength+1];
|
||||
|
@ -2281,7 +2281,6 @@ handle_printf_atsign (FILE *stream,
|
|||
[aString getCharacters: s2 range: ((NSRange){0, aLength})];
|
||||
s2[aLength] = (unichar)0;
|
||||
u = s1;
|
||||
w = s2;
|
||||
|
||||
if (mask & NSCaseInsensitiveSearch)
|
||||
{
|
||||
|
|
|
@ -1150,7 +1150,7 @@ quotedFromString(NSString *aString)
|
|||
NSEnumerator *enumerator;
|
||||
NSString *key;
|
||||
unichar terminator = 0;
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
|
||||
// Win32 environment variables must be sorted by name
|
||||
enumerator = [[[env allKeys]
|
||||
|
|
|
@ -829,7 +829,7 @@ static void *nsthreadLauncher(void* thread)
|
|||
|
||||
/* The thread must persist until it finishes executing.
|
||||
*/
|
||||
RETAIN(self);
|
||||
[self retain];
|
||||
|
||||
/* Mark the thread as active whiul it's running.
|
||||
*/
|
||||
|
|
|
@ -993,7 +993,7 @@ static NSMapTable *absolutes = 0;
|
|||
}
|
||||
if (abbreviationDictionary == nil)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
NSString *path;
|
||||
|
||||
path = _time_zone_path (ABBREV_DICT, @"plist");
|
||||
|
@ -1038,7 +1038,7 @@ static NSMapTable *absolutes = 0;
|
|||
[md makeImmutableCopyOnFail: NO];
|
||||
abbreviationDictionary = md;
|
||||
}
|
||||
RELEASE(pool);
|
||||
[pool release];
|
||||
}
|
||||
if (zone_mutex != nil)
|
||||
{
|
||||
|
@ -1067,7 +1067,7 @@ static NSMapTable *absolutes = 0;
|
|||
}
|
||||
if (abbreviationMap == nil)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
NSMutableDictionary *md;
|
||||
NSMutableArray *ma;
|
||||
NSString *the_name;
|
||||
|
@ -1184,7 +1184,7 @@ static NSMapTable *absolutes = 0;
|
|||
|
||||
[md makeImmutableCopyOnFail: NO];
|
||||
abbreviationMap = RETAIN(md);
|
||||
RELEASE(pool);
|
||||
[pool release];
|
||||
}
|
||||
if (zone_mutex != nil)
|
||||
{
|
||||
|
@ -1717,9 +1717,10 @@ localZoneString, [zone name], sign, s/3600, (s/60)%60);
|
|||
}
|
||||
if (regionsArray == nil)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
int index, i;
|
||||
char name[80];
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
int index;
|
||||
int i;
|
||||
char name[80];
|
||||
FILE *fp;
|
||||
NSMutableArray *temp_array[24];
|
||||
NSString *path;
|
||||
|
@ -1839,7 +1840,7 @@ localZoneString, [zone name], sign, s/3600, (s/60)%60);
|
|||
}
|
||||
}
|
||||
regionsArray = [[NSArray alloc] initWithObjects: temp_array count: 24];
|
||||
RELEASE(pool);
|
||||
[pool release];
|
||||
}
|
||||
if (zone_mutex != nil)
|
||||
{
|
||||
|
|
|
@ -1559,9 +1559,9 @@ static BOOL isLocked = NO;
|
|||
|
||||
while ([_fileLock tryLock] == NO)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSDate *when;
|
||||
NSDate *lockDate;
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSDate *when;
|
||||
NSDate *lockDate;
|
||||
|
||||
lockDate = [_fileLock lockDate];
|
||||
when = [NSDateClass dateWithTimeIntervalSinceNow: 0.1];
|
||||
|
@ -1576,7 +1576,7 @@ static BOOL isLocked = NO;
|
|||
{
|
||||
NSLog(@"Failed to lock user defaults database even after "
|
||||
@"breaking old locks!");
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
@ -1593,7 +1593,7 @@ static BOOL isLocked = NO;
|
|||
{
|
||||
[NSThread sleepUntilDate: when];
|
||||
}
|
||||
RELEASE(arp);
|
||||
[arp release];
|
||||
}
|
||||
isLocked = YES;
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ static void clean_up_names(void)
|
|||
NSMessagePort *port;
|
||||
NSString *name;
|
||||
BOOL unknownThread = GSRegisterCurrentThread();
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
mEnum = NSEnumerateMapTable(portToNamesMap);
|
||||
while (NSNextMapEnumeratorPair(&mEnum, (void *)&port, (void *)&name))
|
||||
|
|
Loading…
Reference in a new issue