diff --git a/Frameworks/Foundation/NSRunLoop.mm b/Frameworks/Foundation/NSRunLoop.mm index f87fd23540..0c8336c567 100644 --- a/Frameworks/Foundation/NSRunLoop.mm +++ b/Frameworks/Foundation/NSRunLoop.mm @@ -315,38 +315,7 @@ - (void)addPort:(id)port forMode:(id)mode { UNIMPLEMENTED(); } -- (BOOL)containsTimer:(NSTimer*)timer forMode:(NSString*)mode { - NSArray* modeStates = [self _statesForMode:mode]; - - for (NSRunLoopState* curMode in modeStates) { - if ([curMode containsTimer:timer]) { - [modeStates release]; - return TRUE; - } - } - - return FALSE; -} - -- (NSArray*)_getModes { - pthread_mutex_lock(&_modeLock); - - NSEnumerator* keys = [_modes keyEnumerator]; - - NSEnumerator* curKey = [keys nextObject]; - NSMutableArray* ret = [NSMutableArray new]; - - while (curKey != nil) { - [ret addObject:curKey]; - - curKey = [keys nextObject]; - } - - pthread_mutex_unlock(&_modeLock); - return ret; -} - -- (NSArray*)resolveCommonModes:(NSArray*)modes { +- (NSArray*)_createResolvedCommonModes:(NSArray*)modes { NSMutableArray* result = [[NSMutableArray alloc] init]; for (unsigned int i = 0; i < [modes count]; i++) { @@ -366,7 +335,7 @@ - (NSArray*)resolveCommonModes:(NSArray*)modes { @Status Interoperable */ - (void)performSelector:(SEL)selector target:(id)target argument:(id)argument order:(NSUInteger)order modes:(NSArray*)modes { - NSArray* performModes = [self resolveCommonModes:modes]; + NSArray* performModes = [self _createResolvedCommonModes:modes]; NSOrderedPerform* perform = [[NSOrderedPerform alloc] initWithSelector:selector target:target argument:argument order:order modes:performModes]; [performModes release]; @@ -443,8 +412,9 @@ - (void)removePort:(NSPort*)aPort forMode:(NSString*)mode { @end @implementation NSRunLoop (Internal) -- (StrongId)_statesForMode:(NSString*)mode { - StrongId result = [NSMutableArray new]; + +- (NSArray*)_statesForMode:(NSString*)mode { + NSMutableArray* result = [NSMutableArray array]; if ([mode isEqualToString:NSRunLoopCommonModes]) { for (NSString* common in _commonModes) { @@ -458,17 +428,17 @@ @implementation NSRunLoop (Internal) } - (void)_addInputSource:(NSInputSource*)source forMode:(NSString*)mode { - StrongId modeStates = [self _statesForMode:mode]; + NSArray* modeStates = [self _statesForMode:mode]; - for (NSRunLoopState* curMode in static_cast(modeStates)) { + for (NSRunLoopState* curMode in modeStates) { [curMode addInputSource:source]; } } - (void)_removeInputSource:(NSInputSource*)source forMode:(NSString*)mode { - StrongId modeStates = [self _statesForMode:mode]; + NSArray* modeStates = [self _statesForMode:mode]; - for (NSRunLoopState* curMode in static_cast(modeStates)) { + for (NSRunLoopState* curMode in modeStates) { [curMode removeInputSource:source]; } } diff --git a/Frameworks/include/NSRunLoop+Internal.h b/Frameworks/include/NSRunLoop+Internal.h index 9cbc9a0fd9..9b34dfee12 100644 --- a/Frameworks/include/NSRunLoop+Internal.h +++ b/Frameworks/include/NSRunLoop+Internal.h @@ -31,7 +31,7 @@ - (void)_removeInputSource:(NSInputSource*)source forMode:(NSString*)mode; - (void)_addObserver:(NSObject*)observer forMode:(NSString*)mode; - (void)_removeObserver:(NSObject*)observer forMode:(NSString*)mode; -- (StrongId)_statesForMode:(NSString*)mode; +- (NSArray*)_statesForMode:(NSString*)mode; - (void)_processMainRunLoop:(int)value; - (void)_shutdown; - (void)removeTimer:(NSTimer*)timer forMode:(NSString*)mode;