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:
CaS 2001-06-21 13:36:13 +00:00
parent d9d407e690
commit 0104b79cb6
6 changed files with 48 additions and 37 deletions

View file

@ -1,5 +1,7 @@
2001-06-21 Richard Frith-Macdonald <rfm@gnu.org> 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 * Source/NSRunLoop.m: ([runMode:beforeDate:]) Check for task
completion and send out notifications if required. completion and send out notifications if required.
* Source/NSTask.m: ([waitUntilExit]) schedule a timer so that the * Source/NSTask.m: ([waitUntilExit]) schedule a timer so that the

View file

@ -125,6 +125,11 @@ typedef enum {
@interface NSRunLoop(GNUstepExtensions) @interface NSRunLoop(GNUstepExtensions)
#if 0
/*
* The following ten methods are DEPRECATED
* They will be removed in later releases of GNUstep
*/
+ currentInstance; + currentInstance;
+ (NSString*) currentMode; + (NSString*) currentMode;
+ (void) run; + (void) run;
@ -139,6 +144,7 @@ typedef enum {
forMode: (NSString*)mode; forMode: (NSString*)mode;
- (void) runUntilDate: (NSDate*)limit_date - (void) runUntilDate: (NSDate*)limit_date
forMode: (NSString*)mode; forMode: (NSString*)mode;
#endif
/* /*
* These next two are general purpose methods for letting objects * These next two are general purpose methods for letting objects
* ask the runloop to watch for events for them. Only one object * ask the runloop to watch for events for them. Only one object

View file

@ -1886,6 +1886,7 @@ NSDictionary *locale)
all_done: all_done:
/* Unlock the stream. */ /* Unlock the stream. */
return;
} }
/* Handle an unknown format specifier. This prints out a canonicalized /* Handle an unknown format specifier. This prints out a canonicalized

View file

@ -2326,6 +2326,7 @@ static BOOL multi_threaded = NO;
NSDate *timeout_date = nil; NSDate *timeout_date = nil;
NSTimeInterval delay_interval = 0.001; NSTimeInterval delay_interval = 0.001;
NSDate *delay_date = nil; NSDate *delay_date = nil;
NSRunLoop *runLoop = [runLoopClass currentRunLoop];
if (debug_connection > 5) if (debug_connection > 5)
NSLog(@"Waiting for reply sequence %d on %x:%x", 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 * were waiting for the final timeout, then we must break out
* of the loop. * of the loop.
*/ */
if ([runLoopClass runOnceBeforeDate: limit_date if ([runLoop runMode: NSConnectionReplyMode
forMode: NSConnectionReplyMode] == NO) beforeDate: limit_date] == NO)
{ {
if (limit_date == timeout_date) 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. * Normal operation - wait for data to be recieved or for a timeout.
*/ */
if ([runLoopClass runOnceBeforeDate: timeout_date if ([runLoop runMode: NSConnectionReplyMode
forMode: NSConnectionReplyMode] == NO) beforeDate: timeout_date] == NO)
{ {
M_LOCK(_queueGate); M_LOCK(_queueGate);
node = GSIMapNodeForKey(_replyMap, (GSIMapKey)sn); node = GSIMapNodeForKey(_replyMap, (GSIMapKey)sn);

View file

@ -274,7 +274,7 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
{ {
timer = nil; timer = nil;
[target performSelector: selector withObject: argument]; [target performSelector: selector withObject: argument];
[[[NSRunLoop currentInstance] _timedPerformers] [[[NSRunLoop currentRunLoop] _timedPerformers]
removeObjectIdenticalTo: self]; removeObjectIdenticalTo: self];
} }
@ -311,7 +311,7 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
selector: (SEL)aSelector selector: (SEL)aSelector
object: (id)arg object: (id)arg
{ {
NSMutableArray *perf = [[NSRunLoop currentInstance] _timedPerformers]; NSMutableArray *perf = [[NSRunLoop currentRunLoop] _timedPerformers];
unsigned count = [perf count]; unsigned count = [perf count];
if (count > 0) if (count > 0)
@ -340,7 +340,7 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
withObject: (id)argument withObject: (id)argument
afterDelay: (NSTimeInterval)seconds afterDelay: (NSTimeInterval)seconds
{ {
NSRunLoop *loop = [NSRunLoop currentInstance]; NSRunLoop *loop = [NSRunLoop currentRunLoop];
GSTimedPerformer *item; GSTimedPerformer *item;
item = [[GSTimedPerformer alloc] initWithSelector: aSelector item = [[GSTimedPerformer alloc] initWithSelector: aSelector
@ -361,7 +361,7 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
if (count > 0) if (count > 0)
{ {
NSRunLoop *loop = [NSRunLoop currentInstance]; NSRunLoop *loop = [NSRunLoop currentRunLoop];
NSString *marray[count]; NSString *marray[count];
GSTimedPerformer *item; GSTimedPerformer *item;
unsigned i; unsigned i;
@ -581,26 +581,6 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
[[self currentRunLoop] run]; [[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 - (void) addEvent: (void*)data
type: (RunLoopEventType)type type: (RunLoopEventType)type
watcher: (id<RunLoopEvents>)watcher 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. */ /* Running the run loop once through for timers and input listening. */
- (BOOL) runOnceBeforeDate: date forMode: (NSString*)mode - (BOOL) runOnceBeforeDate: date forMode: (NSString*)mode
@ -680,7 +655,12 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
return [self runMode: mode beforeDate: date]; 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]; double ti = [date timeIntervalSinceNow];
BOOL mayDoMore = YES; 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 @end
@ -1341,7 +1341,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
RELEASE(arp); RELEASE(arp);
} }
- (BOOL) runMode: (NSString*)mode beforeDate: date - (BOOL) runMode: (NSString*)mode beforeDate: (NSDate*)date
{ {
id d; id d;
@ -1402,7 +1402,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
[self runUntilDate: theFuture]; [self runUntilDate: theFuture];
} }
- (void) runUntilDate: date - (void) runUntilDate: (NSDate*)date
{ {
[self runUntilDate: date forMode: _current_mode]; [self runUntilDate: date forMode: _current_mode];
} }

View file

@ -37,6 +37,7 @@
#include <Foundation/NSNotification.h> #include <Foundation/NSNotification.h>
#include <Foundation/NSNotificationQueue.h> #include <Foundation/NSNotificationQueue.h>
#include <Foundation/NSTask.h> #include <Foundation/NSTask.h>
#include <Foundation/NSTimer.h>
#include <Foundation/NSLock.h> #include <Foundation/NSLock.h>
#include <Foundation/NSDebug.h> #include <Foundation/NSDebug.h>
@ -525,7 +526,7 @@ pty_slave(const char* name)
* Poll at 0.1 second intervals. * Poll at 0.1 second intervals.
*/ */
limit = [[NSDate alloc] initWithTimeIntervalSinceNow: 0.1]; limit = [[NSDate alloc] initWithTimeIntervalSinceNow: 0.1];
if (timer = nil) if (timer == nil)
{ {
timer = [NSTimer scheduledTimerWithTimeInterval: 0.1 timer = [NSTimer scheduledTimerWithTimeInterval: 0.1
target: nil target: nil