Author: buzzdee
Date: Tue May 26 19:15:16 2015
New Revision: 38569

URL: http://svn.gna.org/viewcvs/gnustep?rev=38569&view=rev
Log:
A bunch of format string fixes and some casts to force formats

No objections from Fred Kiefer ;)


Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Model/GMArchiver.m
    libs/gui/trunk/Source/GSDisplayServer.m
    libs/gui/trunk/Source/GSXibLoader.m
    libs/gui/trunk/Source/NSAnimation.m
    libs/gui/trunk/Source/NSCachedImageRep.m
    libs/gui/trunk/Source/NSEvent.m
    libs/gui/trunk/Source/NSPrintPanel.m
    libs/gui/trunk/Source/NSSplitView.m
    libs/gui/trunk/Source/NSTextBlock.m
    libs/gui/trunk/Source/NSToolbarItem.m

Modified: libs/gui/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=38569&r1=38568&r2=38569&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog    (original)
+++ libs/gui/trunk/ChangeLog    Tue May 26 19:15:16 2015
@@ -8,6 +8,17 @@
          return value for NSMenu itemAtIndex change from
          id<NSMenuItem> to NSMenuitem* as it is done by Apple too
          fixes warnings in NSApplication.m and NSTextView.m
+       * Source/NSAnimation.m
+       * Source/NSCachedImageRep.m
+       * Source/NSEvent.m
+       * Source/NSPrintPanel.m
+       * Source/NSTextBlock.m
+       * Source/NSToolbarItem.m
+       * Source/GSDisplayServer.m
+       * Source/GSXibLoader.m
+       * Source/NSSplitView.m
+       * Model/GMArchiver.m
+         Format string fixes and casts 
 
 2015-05-22 Fred Kiefer <[email protected]>
 

Modified: libs/gui/trunk/Model/GMArchiver.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Model/GMArchiver.m?rev=38569&r1=38568&r2=38569&view=diff
==============================================================================
--- libs/gui/trunk/Model/GMArchiver.m   (original)
+++ libs/gui/trunk/Model/GMArchiver.m   Tue May 26 19:15:16 2015
@@ -475,7 +475,7 @@
 - (void) encodeShort: (short)value withName: (NSString*)name
 {
   if (!findingConditionals && name) {
-    id valueString = [NSString stringWithFormat: @"%s", value];
+    id valueString = [NSString stringWithFormat: @"%hd", value];
 
     [lastObjectRepresentation setObject: valueString forKey: name];
   }
@@ -511,7 +511,7 @@
 - (void) encodeLong: (long)value withName: (NSString*)name
 {
   if (!findingConditionals && name) {
-    id valueString = [NSString stringWithFormat: @"%l", value];
+    id valueString = [NSString stringWithFormat: @"%ld", value];
 
     [lastObjectRepresentation setObject: valueString forKey: name];
   }

Modified: libs/gui/trunk/Source/GSDisplayServer.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/GSDisplayServer.m?rev=38569&r1=38568&r2=38569&view=diff
==============================================================================
--- libs/gui/trunk/Source/GSDisplayServer.m     (original)
+++ libs/gui/trunk/Source/GSDisplayServer.m     Tue May 26 19:15:16 2015
@@ -1112,7 +1112,7 @@
        {
          NSEvent *event = events[i];
 
-          NSLog(@"index %d %@", i, event);
+          NSLog(@"index %lu %@", (unsigned long) i, event);
         }
     }
   else

Modified: libs/gui/trunk/Source/GSXibLoader.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/GSXibLoader.m?rev=38569&r1=38568&r2=38569&view=diff
==============================================================================
--- libs/gui/trunk/Source/GSXibLoader.m (original)
+++ libs/gui/trunk/Source/GSXibLoader.m Tue May 26 19:15:16 2015
@@ -410,7 +410,7 @@
                               __PRETTY_FUNCTION__,
                               NSStringFromClass([self class])];
           [NSException raise: NSInvalidArgumentException
-                      format: format];
+                      format: @"%@", format];
         }
       
       // Load the connection ID....
@@ -433,7 +433,7 @@
               NSString *format = [NSString stringWithFormat:@"%s:class: %@ - 
connection ID is missing or zero!",
                                   __PRETTY_FUNCTION__, NSStringFromClass([self 
class])];
               [NSException raise: NSInvalidArgumentException
-                          format: format];
+                          format: @"%@", format];
             }
         }
       else
@@ -442,7 +442,7 @@
                               __PRETTY_FUNCTION__,
                               NSStringFromClass([self class])];
           [NSException raise: NSInvalidArgumentException
-                      format: format];
+                      format: @"%@", format];
         }
     }
   else
@@ -582,7 +582,7 @@
                               __PRETTY_FUNCTION__,
                               NSStringFromClass([self class])];
           [NSException raise: NSInvalidArgumentException
-                      format: format];
+                      format: @"%@", format];
         }
       
       if ([coder containsValueForKey: @"object"])
@@ -632,7 +632,7 @@
 
 - (NSString *) description
 {
-  return [NSString stringWithFormat: @"<%@, %@, %@, %d>",
+  return [NSString stringWithFormat: @"<%@, %@, %@, %p>",
                   [self className],
                   object,
                   parent,

Modified: libs/gui/trunk/Source/NSAnimation.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSAnimation.m?rev=38569&r1=38568&r2=38569&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSAnimation.m (original)
+++ libs/gui/trunk/Source/NSAnimation.m Tue May 26 19:15:16 2015
@@ -797,7 +797,7 @@
         [delegate methodForSelector: @selector (animationShouldStart:)]
         : NULL;
       NSDebugMLLog(@"NSAnimationDelegate",
-                   @"Delegation methods : %x %x %x %x %x",
+                   @"Delegation methods : %p %p %p %p %p",
                    _delegate_animationDidReachProgressMark,
                    _delegate_animationValueForProgress,
                    _delegate_animationDidEnd,

Modified: libs/gui/trunk/Source/NSCachedImageRep.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSCachedImageRep.m?rev=38569&r1=38568&r2=38569&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSCachedImageRep.m    (original)
+++ libs/gui/trunk/Source/NSCachedImageRep.m    Tue May 26 19:15:16 2015
@@ -93,8 +93,8 @@
       pixelsWide <= 0 || pixelsHigh <= 0)
     {
       [NSException raise: NSInvalidArgumentException
-                 format: @"NSCachedImageRep created with size %@ pixelsWide %d 
pixelsHigh %d",
-                  NSStringFromSize(aSize), pixelsWide, pixelsHigh];
+                 format: @"NSCachedImageRep created with size %@ pixelsWide 
%li pixelsHigh %li",
+                  NSStringFromSize(aSize), (long int) pixelsWide, (long int) 
pixelsHigh];
     }
 
   // FIXME: Only create new window when separate is YES

Modified: libs/gui/trunk/Source/NSEvent.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSEvent.m?rev=38569&r1=38568&r2=38569&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSEvent.m     (original)
+++ libs/gui/trunk/Source/NSEvent.m     Tue May 26 19:15:16 2015
@@ -289,7 +289,7 @@
   if ([dict objectForKey: timerKey])
     [NSException raise: NSInternalInconsistencyException
                 format: @"Periodic events are already being generated for "
-                        @"this thread %x", GSCurrentThread()];
+                        @"this thread %p", GSCurrentThread()];
 
   /*
    *  Register a timer that will fire in delaySeconds.
@@ -609,25 +609,26 @@
       case NSRightMouseDown:
       case NSRightMouseUp:
         return [NSString stringWithFormat:
-          @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u,"
-          @" time = %f, window = %d, dpsContext = %p,"
-          @" event number = %d, click = %d, pressure = %f",
+          @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %lu,"
+          @" time = %f, window = %ld, dpsContext = %p,"
+          @" event number = %ld, click = %ld, pressure = %f",
           eventTypes[event_type], location_point.x, location_point.y,
-          modifier_flags, event_time, window_num, event_context,
-          event_data.mouse.event_num, event_data.mouse.click,
+          (unsigned long) modifier_flags, event_time, (long) window_num,
+         event_context, (long int) event_data.mouse.event_num,
+         (long int) event_data.mouse.click,
           event_data.mouse.pressure];
         break;
 
       case NSMouseEntered:
       case NSMouseExited:
         return [NSString stringWithFormat:
-          @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u,"
-          @" time = %f, window = %d, dpsContext = %p, "
-          @" event number = %d, tracking number = %d, user data = %p",
+          @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %lu,"
+          @" time = %f, window = %ld, dpsContext = %p, "
+          @" event number = %ld, tracking number = %ld, user data = %p",
           eventTypes[event_type], location_point.x, location_point.y,
-          modifier_flags, event_time, window_num, event_context,
-          event_data.tracking.event_num,
-          event_data.tracking.tracking_num,
+          (unsigned long) modifier_flags, event_time, (long) window_num, 
event_context,
+          (long) event_data.tracking.event_num,
+          (long) event_data.tracking.tracking_num,
           event_data.tracking.user_data];
         break;
 
@@ -635,11 +636,11 @@
       case NSKeyUp:
       case NSFlagsChanged:
         return [NSString stringWithFormat:
-          @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u,"
-          @" time = %f, window = %d, dpsContext = %p, "
+          @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %lu,"
+          @" time = %f, window = %ld, dpsContext = %p, "
           @" repeat = %s, keys = %@, ukeys = %@, keyCode = 0x%x",
           eventTypes[event_type], location_point.x, location_point.y,
-          modifier_flags, event_time, window_num, event_context,
+          (unsigned long) modifier_flags, event_time, (long) window_num, 
event_context,
           (event_data.key.repeat ? "YES" : "NO"),
           event_data.key.char_keys, event_data.key.unmodified_keys,
           event_data.key.key_code];
@@ -651,13 +652,13 @@
       case NSSystemDefined:
       case NSApplicationDefined:
         return [NSString stringWithFormat:
-          @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u,"
-          @" time = %f, window = %d, dpsContext = %p, "
-          @" subtype = %d, data1 = %p, data2 = %p",
+          @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %lu,"
+          @" time = %f, window = %ld, dpsContext = %p, "
+          @" subtype = %d, data1 = %lx, data2 = %lx",
           eventTypes[event_type], location_point.x, location_point.y,
-          modifier_flags, event_time, window_num, event_context,
-          event_data.misc.sub_type, event_data.misc.data1,
-          event_data.misc.data2];
+          (unsigned long) modifier_flags, event_time, (long) window_num, 
event_context,
+          event_data.misc.sub_type, (long) event_data.misc.data1,
+          (long) event_data.misc.data2];
         break;
 
       case NSScrollWheel:
@@ -666,14 +667,14 @@
       case NSOtherMouseDragged:
       case NSRightMouseDragged:
         return [NSString stringWithFormat:
-          @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u,"
-          @" time = %f, window = %d, dpsContext = %p,"
-          @" event number = %d, click = %d, pressure = %f"
-          @" button = %d, deltaX = %f, deltaY = %f, deltaZ = %f",
+          @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %lu,"
+          @" time = %f, window = %ld, dpsContext = %p,"
+          @" event number = %ld, click = %ld, pressure = %f"
+          @" button = %ld, deltaX = %f, deltaY = %f, deltaZ = %f",
           eventTypes[event_type], location_point.x, location_point.y,
-          modifier_flags, event_time, window_num, event_context,
-          event_data.mouse.event_num, event_data.mouse.click,
-          event_data.mouse.pressure, event_data.mouse.button,
+          (unsigned long) modifier_flags, event_time, (long) window_num, 
event_context,
+          (long ) event_data.mouse.event_num, (long) event_data.mouse.click,
+          event_data.mouse.pressure, (long) event_data.mouse.button,
           event_data.mouse.deltaX,
           event_data.mouse.deltaY,
           event_data.mouse.deltaZ];
@@ -686,10 +687,10 @@
 
       default:
         return [NSString stringWithFormat:
-          @"NSEvent: eventType = UNKNOWN!, point = { %f, %f }, modifiers = %u,"
-          @" time = %f, window = %d",
+          @"NSEvent: eventType = UNKNOWN!, point = { %f, %f }, modifiers = 
%lu,"
+          @" time = %f, window = %ld",
           location_point.x, location_point.y,
-          modifier_flags, event_time, window_num];
+          (unsigned long) modifier_flags, event_time, (long) window_num];
         break;
     }
 

Modified: libs/gui/trunk/Source/NSPrintPanel.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSPrintPanel.m?rev=38569&r1=38568&r2=38569&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSPrintPanel.m        (original)
+++ libs/gui/trunk/Source/NSPrintPanel.m        Tue May 26 19:15:16 2015
@@ -462,9 +462,9 @@
   else
     {
       NSString *str;
-      str = [NSString stringWithFormat: @"%d", _pages.location];
+      str = [NSString stringWithFormat: @"%lu", (unsigned long) 
_pages.location];
       [[fromRangeForm cellAtIndex: 0] setStringValue: str];
-      str = [NSString stringWithFormat: @"%d", NSMaxRange(_pages)-1];
+      str = [NSString stringWithFormat: @"%lu", (unsigned long) 
NSMaxRange(_pages)-1];
       [[toRangeForm cellAtIndex: 0] setStringValue: str];
     }
 }

Modified: libs/gui/trunk/Source/NSSplitView.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSSplitView.m?rev=38569&r1=38568&r2=38569&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSSplitView.m (original)
+++ libs/gui/trunk/Source/NSSplitView.m Tue May 26 19:15:16 2015
@@ -150,7 +150,7 @@
                 {
                   proportion = (NSWidth(frames[i]))/oldTotal;              
                 }
-              key = [NSString stringWithFormat: @"%u", i];
+              key = [NSString stringWithFormat: @"%lu", (unsigned long) i];
               [config setObject: [NSNumber numberWithDouble: proportion]
                          forKey: key];
             }
@@ -829,7 +829,7 @@
               NSNumber *proportion;
              NSString  *key;
 
-             key = [NSString stringWithFormat: @"%u", i];
+             key = [NSString stringWithFormat: @"%lu", (unsigned long) i];
               proportion = [config objectForKey: key];
               if (proportion == nil)
                 {

Modified: libs/gui/trunk/Source/NSTextBlock.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSTextBlock.m?rev=38569&r1=38568&r2=38569&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSTextBlock.m (original)
+++ libs/gui/trunk/Source/NSTextBlock.m Tue May 26 19:15:16 2015
@@ -72,7 +72,7 @@
 {
   if (edge >= sizeof(_borderColorForEdge) / sizeof(_borderColorForEdge[0]))
     [NSException raise: NSInvalidArgumentException
-                 format: @"invalid edge %d", edge];
+                 format: @"invalid edge %lu", (unsigned long) edge];
   ASSIGN(_borderColorForEdge[edge], color);
 }
 
@@ -167,7 +167,7 @@
                 format: @"invalid layer %d", layer];
   if (edge >= sizeof(_width[0]) / sizeof(_width[0][0]))
     [NSException raise: NSInvalidArgumentException
-                format: @"invalid edge %d", edge];
+                format: @"invalid edge %lu", (unsigned long) edge];
   return _width[layer][edge];
 }
 
@@ -179,7 +179,7 @@
                 format: @"invalid layer %d", layer];
   if (edge >= sizeof(_width[0]) / sizeof(_width[0][0]))
     [NSException raise: NSInvalidArgumentException
-                format: @"invalid edge %d", edge];
+                format: @"invalid edge %lu", (unsigned long) edge];
   return _widthType[layer][edge];
 }
 
@@ -193,7 +193,7 @@
                 format: @"invalid layer %d", layer];
   if (edge >= sizeof(_width[0]) / sizeof(_width[0][0]))
     [NSException raise: NSInvalidArgumentException
-                format: @"invalid edge %d", edge];
+                format: @"invalid edge %lu", (unsigned long) edge];
   _width[layer][edge] = val;
   _widthType[layer][edge] = type;
 }

Modified: libs/gui/trunk/Source/NSToolbarItem.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSToolbarItem.m?rev=38569&r1=38568&r2=38569&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSToolbarItem.m       (original)
+++ libs/gui/trunk/Source/NSToolbarItem.m       Tue May 26 19:15:16 2015
@@ -287,7 +287,7 @@
           index = [toolbar _indexOfItem: _toolbarItem];
         }
          [GSToolbarView setDraggedItemIndex:index];
-      [pboard setString: [NSString stringWithFormat:@"%d", index] 
+      [pboard setString: [NSString stringWithFormat:@"%ld", (long) index] 
               forType: GSMovableToolbarItemPboardType];
           
       [self dragImage: image 
@@ -777,7 +777,7 @@
           index = [toolbar _indexOfItem: _toolbarItem];
         }
          [GSToolbarView setDraggedItemIndex:index];
-      [pboard setString: [NSString stringWithFormat:@"%d", index] 
+      [pboard setString: [NSString stringWithFormat:@"%ld", (long) index] 
               forType: GSMovableToolbarItemPboardType];
       
       [self dragImage: image 


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

Reply via email to