standardise -setDebug: extension

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39554 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2016-03-17 08:12:45 +00:00
parent 1db866fde7
commit 67e4c0581d
8 changed files with 42 additions and 15 deletions

View file

@ -1,3 +1,16 @@
2016-03-17 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/GNUstepBase/GSXML.h:
* Source/Additions/GSXML.m:
* Source/GSHTTPURLHandle.m:
* Source/NSConnection.m:
* Source/NSDistantObject.m:
* Source/NSURLHandle.m:
* Source/NSURLRequest.m:
Make -setDebug: consistently set/return an integer even if the
underlying meaning is boolean. Avoid compiler warnings when
calling the method on an id and signature is not known.
2016-03-15 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSCalendarDate.m:

View file

@ -701,9 +701,10 @@ extern "C" {
- (void) setCompact: (BOOL)flag;
/**
* Specify whether to perform debug trace on I/O
* Specify whether to perform debug trace on I/O<br />
* Return the previous value
*/
- (void) setDebug: (BOOL)flag;
- (int) setDebug: (int)flag;
/**
* Sets the delegate object which will receive callbacks when an XMLRPC

View file

@ -5454,14 +5454,15 @@ static void indentation(unsigned level, NSMutableString *str)
return YES;
}
- (void) setDebug: (BOOL)flag
- (int) setDebug: (int)flag
{
#ifdef GNUSTEP
if ([handle respondsToSelector: _cmd] == YES)
{
[(id)handle setDebug: flag];
return [(id)handle setDebug: flag];
}
#endif
return NO;
}
- (void) setCompact: (BOOL)flag

View file

@ -128,7 +128,7 @@ static NSString *httpVersion = @"1.1";
reading,
} connectionState;
}
- (void) setDebug: (BOOL)flag;
- (int) setDebug: (int)flag;
- (void) _tryLoadInBackground: (NSURL*)fromURL;
@end
@ -1304,9 +1304,12 @@ debugWrite(GSHTTPURLHandle *handle, NSData *data)
return result;
}
- (void) setDebug: (BOOL)flag
- (int) setDebug: (int)flag
{
debug = flag;
int old = debug;
debug = flag ? YES : NO;
return old;
}
- (void) setReturnAll: (BOOL)flag

View file

@ -335,7 +335,7 @@ GS_PRIVATE_INTERNAL(NSConnection)
- (void) handlePortMessage: (NSPortMessage*)msg;
- (void) _runInNewThread;
+ (void) setDebug: (int)val;
+ (int) setDebug: (int)val;
- (void) _enableKeepalive;
- (void) addLocalObject: (NSDistantObject*)anObj;
@ -2466,9 +2466,12 @@ static NSLock *cached_proxies_gate = nil;
[loop run];
}
+ (void) setDebug: (int)val
+ (int) setDebug: (int)val
{
int old = debug_connection;
debug_connection = val;
return old;
}
- (void) _keepalive: (NSNotification*)n

View file

@ -380,13 +380,16 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder
@end
@interface NSDistantObject (Debug)
+ (void) setDebug: (int)val;
+ (int) setDebug: (int)val;
@end
@implementation NSDistantObject (Debug)
+ (void) setDebug: (int)val
+ (int) setDebug: (int)val
{
int old = debug_proxy;
debug_proxy = val;
return old;
}
@end

View file

@ -559,9 +559,9 @@ static Class NSURLHandleClass = 0;
/* Private method ... subclasses override this to enable debug to be
* turned off and on.
*/
- (void) setDebug: (BOOL)aFlag
- (int) setDebug: (int)aFlag
{
return;
return NO;
}
/**

View file

@ -276,9 +276,12 @@ typedef struct {
return o;
}
- (void) setDebug: (BOOL)flag
- (int) setDebug: (int)flag
{
this->debug = flag;
int old = this->debug;
this->debug = flag ? YES : NO;
return old;
}
- (NSTimeInterval) timeoutInterval