Author: rfm
Date: Thu Mar 17 09:12:45 2016
New Revision: 39554

URL: http://svn.gna.org/viewcvs/gnustep?rev=39554&view=rev
Log:
standardise -setDebug: extension

Modified:
    libs/base/trunk/ChangeLog
    libs/base/trunk/Headers/GNUstepBase/GSXML.h
    libs/base/trunk/Source/Additions/GSXML.m
    libs/base/trunk/Source/GSHTTPURLHandle.m
    libs/base/trunk/Source/NSConnection.m
    libs/base/trunk/Source/NSDistantObject.m
    libs/base/trunk/Source/NSURLHandle.m
    libs/base/trunk/Source/NSURLRequest.m

Modified: libs/base/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=39554&r1=39553&r2=39554&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog   (original)
+++ libs/base/trunk/ChangeLog   Thu Mar 17 09:12:45 2016
@@ -1,3 +1,16 @@
+2016-03-17  Richard Frith-Macdonald <[email protected]>
+
+        * 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 <[email protected]>
 
        * Source/NSCalendarDate.m:

Modified: libs/base/trunk/Headers/GNUstepBase/GSXML.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Headers/GNUstepBase/GSXML.h?rev=39554&r1=39553&r2=39554&view=diff
==============================================================================
--- libs/base/trunk/Headers/GNUstepBase/GSXML.h (original)
+++ libs/base/trunk/Headers/GNUstepBase/GSXML.h Thu Mar 17 09:12:45 2016
@@ -701,9 +701,10 @@
 - (void) setCompact: (BOOL)flag;
 
 /**
- * Specify whether to perform debug trace on I/O
- */
-- (void) setDebug: (BOOL)flag;
+ * Specify whether to perform debug trace on I/O<br />
+ * Return the previous value
+ */
+- (int) setDebug: (int)flag;
 
 /**
  * Sets the delegate object which will receive callbacks when an XMLRPC

Modified: libs/base/trunk/Source/Additions/GSXML.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/Additions/GSXML.m?rev=39554&r1=39553&r2=39554&view=diff
==============================================================================
--- libs/base/trunk/Source/Additions/GSXML.m    (original)
+++ libs/base/trunk/Source/Additions/GSXML.m    Thu Mar 17 09:12:45 2016
@@ -5454,14 +5454,15 @@
   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

Modified: libs/base/trunk/Source/GSHTTPURLHandle.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/GSHTTPURLHandle.m?rev=39554&r1=39553&r2=39554&view=diff
==============================================================================
--- libs/base/trunk/Source/GSHTTPURLHandle.m    (original)
+++ libs/base/trunk/Source/GSHTTPURLHandle.m    Thu Mar 17 09:12:45 2016
@@ -128,7 +128,7 @@
     reading,
   } connectionState;
 }
-- (void) setDebug: (BOOL)flag;
+- (int) setDebug: (int)flag;
 - (void) _tryLoadInBackground: (NSURL*)fromURL;
 @end
 
@@ -1304,9 +1304,12 @@
   return result;
 }
 
-- (void) setDebug: (BOOL)flag
-{
-  debug = flag;
+- (int) setDebug: (int)flag
+{
+  int   old = debug;
+
+  debug = flag ? YES : NO;
+  return old;
 }
 
 - (void) setReturnAll: (BOOL)flag

Modified: libs/base/trunk/Source/NSConnection.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSConnection.m?rev=39554&r1=39553&r2=39554&view=diff
==============================================================================
--- libs/base/trunk/Source/NSConnection.m       (original)
+++ libs/base/trunk/Source/NSConnection.m       Thu Mar 17 09:12:45 2016
@@ -335,7 +335,7 @@
 
 - (void) handlePortMessage: (NSPortMessage*)msg;
 - (void) _runInNewThread;
-+ (void) setDebug: (int)val;
++ (int) setDebug: (int)val;
 - (void) _enableKeepalive;
 
 - (void) addLocalObject: (NSDistantObject*)anObj;
@@ -2466,9 +2466,12 @@
   [loop run];
 }
 
-+ (void) setDebug: (int)val
-{
++ (int) setDebug: (int)val
+{
+  int   old = debug_connection;
+
   debug_connection = val;
+  return old;
 }
 
 - (void) _keepalive: (NSNotification*)n

Modified: libs/base/trunk/Source/NSDistantObject.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSDistantObject.m?rev=39554&r1=39553&r2=39554&view=diff
==============================================================================
--- libs/base/trunk/Source/NSDistantObject.m    (original)
+++ libs/base/trunk/Source/NSDistantObject.m    Thu Mar 17 09:12:45 2016
@@ -380,13 +380,16 @@
 @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
 

Modified: libs/base/trunk/Source/NSURLHandle.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSURLHandle.m?rev=39554&r1=39553&r2=39554&view=diff
==============================================================================
--- libs/base/trunk/Source/NSURLHandle.m        (original)
+++ libs/base/trunk/Source/NSURLHandle.m        Thu Mar 17 09:12:45 2016
@@ -559,9 +559,9 @@
 /* Private method ... subclasses override this to enable debug to be
  * turned off and on.
  */
-- (void) setDebug: (BOOL)aFlag
-{
-  return;
+- (int) setDebug: (int)aFlag
+{
+  return NO;
 }
 
 /**

Modified: libs/base/trunk/Source/NSURLRequest.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSURLRequest.m?rev=39554&r1=39553&r2=39554&view=diff
==============================================================================
--- libs/base/trunk/Source/NSURLRequest.m       (original)
+++ libs/base/trunk/Source/NSURLRequest.m       Thu Mar 17 09:12:45 2016
@@ -276,9 +276,12 @@
   return o;
 }
 
-- (void) setDebug: (BOOL)flag
-{
-  this->debug = flag;
+- (int) setDebug: (int)flag
+{
+  int   old = this->debug;
+
+  this->debug = flag ? YES : NO;
+  return old;
 }
 
 - (NSTimeInterval) timeoutInterval


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to