mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Tidied for gcc-3 warnings etc
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10226 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9af91298d4
commit
520315fb6a
6 changed files with 48 additions and 37 deletions
|
@ -1,5 +1,7 @@
|
|||
2001-06-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSConnection.m: Change some deprecated runloop methods for
|
||||
standard ones.
|
||||
* Source/NSRunLoop.m: ([runMode:beforeDate:]) Check for task
|
||||
completion and send out notifications if required.
|
||||
* Source/NSTask.m: ([waitUntilExit]) schedule a timer so that the
|
||||
|
|
|
@ -125,6 +125,11 @@ typedef enum {
|
|||
|
||||
@interface NSRunLoop(GNUstepExtensions)
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* The following ten methods are DEPRECATED
|
||||
* They will be removed in later releases of GNUstep
|
||||
*/
|
||||
+ currentInstance;
|
||||
+ (NSString*) currentMode;
|
||||
+ (void) run;
|
||||
|
@ -139,6 +144,7 @@ typedef enum {
|
|||
forMode: (NSString*)mode;
|
||||
- (void) runUntilDate: (NSDate*)limit_date
|
||||
forMode: (NSString*)mode;
|
||||
#endif
|
||||
/*
|
||||
* These next two are general purpose methods for letting objects
|
||||
* ask the runloop to watch for events for them. Only one object
|
||||
|
|
|
@ -1886,6 +1886,7 @@ NSDictionary *locale)
|
|||
|
||||
all_done:
|
||||
/* Unlock the stream. */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Handle an unknown format specifier. This prints out a canonicalized
|
||||
|
|
|
@ -2326,6 +2326,7 @@ static BOOL multi_threaded = NO;
|
|||
NSDate *timeout_date = nil;
|
||||
NSTimeInterval delay_interval = 0.001;
|
||||
NSDate *delay_date = nil;
|
||||
NSRunLoop *runLoop = [runLoopClass currentRunLoop];
|
||||
|
||||
if (debug_connection > 5)
|
||||
NSLog(@"Waiting for reply sequence %d on %x:%x",
|
||||
|
@ -2377,8 +2378,8 @@ static BOOL multi_threaded = NO;
|
|||
* were waiting for the final timeout, then we must break out
|
||||
* of the loop.
|
||||
*/
|
||||
if ([runLoopClass runOnceBeforeDate: limit_date
|
||||
forMode: NSConnectionReplyMode] == NO)
|
||||
if ([runLoop runMode: NSConnectionReplyMode
|
||||
beforeDate: limit_date] == NO)
|
||||
{
|
||||
if (limit_date == timeout_date)
|
||||
{
|
||||
|
@ -2393,8 +2394,8 @@ static BOOL multi_threaded = NO;
|
|||
/*
|
||||
* Normal operation - wait for data to be recieved or for a timeout.
|
||||
*/
|
||||
if ([runLoopClass runOnceBeforeDate: timeout_date
|
||||
forMode: NSConnectionReplyMode] == NO)
|
||||
if ([runLoop runMode: NSConnectionReplyMode
|
||||
beforeDate: timeout_date] == NO)
|
||||
{
|
||||
M_LOCK(_queueGate);
|
||||
node = GSIMapNodeForKey(_replyMap, (GSIMapKey)sn);
|
||||
|
|
|
@ -274,7 +274,7 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
|
|||
{
|
||||
timer = nil;
|
||||
[target performSelector: selector withObject: argument];
|
||||
[[[NSRunLoop currentInstance] _timedPerformers]
|
||||
[[[NSRunLoop currentRunLoop] _timedPerformers]
|
||||
removeObjectIdenticalTo: self];
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
|
|||
selector: (SEL)aSelector
|
||||
object: (id)arg
|
||||
{
|
||||
NSMutableArray *perf = [[NSRunLoop currentInstance] _timedPerformers];
|
||||
NSMutableArray *perf = [[NSRunLoop currentRunLoop] _timedPerformers];
|
||||
unsigned count = [perf count];
|
||||
|
||||
if (count > 0)
|
||||
|
@ -340,7 +340,7 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
|
|||
withObject: (id)argument
|
||||
afterDelay: (NSTimeInterval)seconds
|
||||
{
|
||||
NSRunLoop *loop = [NSRunLoop currentInstance];
|
||||
NSRunLoop *loop = [NSRunLoop currentRunLoop];
|
||||
GSTimedPerformer *item;
|
||||
|
||||
item = [[GSTimedPerformer alloc] initWithSelector: aSelector
|
||||
|
@ -361,7 +361,7 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
|
|||
|
||||
if (count > 0)
|
||||
{
|
||||
NSRunLoop *loop = [NSRunLoop currentInstance];
|
||||
NSRunLoop *loop = [NSRunLoop currentRunLoop];
|
||||
NSString *marray[count];
|
||||
GSTimedPerformer *item;
|
||||
unsigned i;
|
||||
|
@ -581,26 +581,6 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
|
|||
[[self currentRunLoop] run];
|
||||
}
|
||||
|
||||
+ (void) runUntilDate: date
|
||||
{
|
||||
[[self currentRunLoop] runUntilDate: date];
|
||||
}
|
||||
|
||||
+ (void) runUntilDate: date forMode: (NSString*)mode
|
||||
{
|
||||
[[self currentRunLoop] runUntilDate: date forMode: mode];
|
||||
}
|
||||
|
||||
+ (BOOL) runOnceBeforeDate: date
|
||||
{
|
||||
return [[self currentRunLoop] runOnceBeforeDate: date];
|
||||
}
|
||||
|
||||
+ (BOOL) runOnceBeforeDate: date forMode: (NSString*)mode
|
||||
{
|
||||
return [[self currentRunLoop] runOnceBeforeDate: date forMode: mode];
|
||||
}
|
||||
|
||||
- (void) addEvent: (void*)data
|
||||
type: (RunLoopEventType)type
|
||||
watcher: (id<RunLoopEvents>)watcher
|
||||
|
@ -668,11 +648,6 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
|
|||
}
|
||||
}
|
||||
|
||||
- (BOOL) runOnceBeforeDate: date
|
||||
{
|
||||
return [self runOnceBeforeDate: date forMode: _current_mode];
|
||||
}
|
||||
|
||||
/* Running the run loop once through for timers and input listening. */
|
||||
|
||||
- (BOOL) runOnceBeforeDate: date forMode: (NSString*)mode
|
||||
|
@ -680,7 +655,12 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
|
|||
return [self runMode: mode beforeDate: date];
|
||||
}
|
||||
|
||||
- (void) runUntilDate: date forMode: (NSString*)mode
|
||||
- (BOOL) runOnceBeforeDate: date
|
||||
{
|
||||
return [self runOnceBeforeDate: date forMode: _current_mode];
|
||||
}
|
||||
|
||||
- (void) runUntilDate: (NSDate*)date forMode: (NSString*)mode
|
||||
{
|
||||
double ti = [date timeIntervalSinceNow];
|
||||
BOOL mayDoMore = YES;
|
||||
|
@ -695,6 +675,26 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
|
|||
}
|
||||
}
|
||||
|
||||
+ (void) runUntilDate: (NSDate*)date forMode: (NSString*)mode
|
||||
{
|
||||
[[self currentRunLoop] runUntilDate: date forMode: mode];
|
||||
}
|
||||
|
||||
+ (void) runUntilDate: (NSDate*)date
|
||||
{
|
||||
[[self currentRunLoop] runUntilDate: date];
|
||||
}
|
||||
|
||||
+ (BOOL) runOnceBeforeDate: date forMode: (NSString*)mode
|
||||
{
|
||||
return [[self currentRunLoop] runOnceBeforeDate: date forMode: mode];
|
||||
}
|
||||
|
||||
+ (BOOL) runOnceBeforeDate: (NSDate*)date
|
||||
{
|
||||
return [[self currentRunLoop] runOnceBeforeDate: date];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
@ -1341,7 +1341,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
|
|||
RELEASE(arp);
|
||||
}
|
||||
|
||||
- (BOOL) runMode: (NSString*)mode beforeDate: date
|
||||
- (BOOL) runMode: (NSString*)mode beforeDate: (NSDate*)date
|
||||
{
|
||||
id d;
|
||||
|
||||
|
@ -1402,7 +1402,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
|
|||
[self runUntilDate: theFuture];
|
||||
}
|
||||
|
||||
- (void) runUntilDate: date
|
||||
- (void) runUntilDate: (NSDate*)date
|
||||
{
|
||||
[self runUntilDate: date forMode: _current_mode];
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <Foundation/NSNotification.h>
|
||||
#include <Foundation/NSNotificationQueue.h>
|
||||
#include <Foundation/NSTask.h>
|
||||
#include <Foundation/NSTimer.h>
|
||||
#include <Foundation/NSLock.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
|
||||
|
@ -525,7 +526,7 @@ pty_slave(const char* name)
|
|||
* Poll at 0.1 second intervals.
|
||||
*/
|
||||
limit = [[NSDate alloc] initWithTimeIntervalSinceNow: 0.1];
|
||||
if (timer = nil)
|
||||
if (timer == nil)
|
||||
{
|
||||
timer = [NSTimer scheduledTimerWithTimeInterval: 0.1
|
||||
target: nil
|
||||
|
|
Loading…
Reference in a new issue