Author: thebeing
Date: Mon May 15 22:55:13 2017
New Revision: 40505
URL: http://svn.gna.org/viewcvs/gnustep?rev=40505&view=rev
Log:
Word-size related format string fixes
Modified:
libs/dbuskit/trunk/Source/DKArgument.m
libs/dbuskit/trunk/Source/DKEndpointManager.m
libs/dbuskit/trunk/Source/DKIntrospectionParserDelegate.m
libs/dbuskit/trunk/Source/DKMethod.m
libs/dbuskit/trunk/Source/DKNotificationCenter.m
libs/dbuskit/trunk/Source/DKSignal.m
Modified: libs/dbuskit/trunk/Source/DKArgument.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/dbuskit/trunk/Source/DKArgument.m?rev=40505&r1=40504&r2=40505&view=diff
==============================================================================
--- libs/dbuskit/trunk/Source/DKArgument.m (original)
+++ libs/dbuskit/trunk/Source/DKArgument.m Mon May 15 22:55:13 2017
@@ -905,13 +905,13 @@
{
DKProxy *rootProxy = [self proxyParent];
/*
- * Handle remote objects. We need a way to make sure that their
+ * Handle remote objects. We need a way to make sure that their
* scope is well defined. This means that they are either
* references to the same remote object that is the owner of the
* argument (so they are local to the receiver of the message)
* or the value is an outgoing proxy (so they are local to the
- * sender of the message, and the remote end will be able to
- * interpret the path correctly)
+ * sender of the message, and the remote end will be able to
+ * interpret the path correctly)
*/
if (([rootProxy hasSameScopeAs: value]) || ([value _isLocal]))
{
@@ -1563,7 +1563,7 @@
// Arrays can only have a single type:
if (childCount != 1)
{
- NSWarnMLog(@"Invalid number of children (%lu) for D-Bus array argument",
+ NSWarnMLog(@"Invalid number of children (%"PRIuPTR") for D-Bus array
argument",
childCount);
[self release];
return nil;
@@ -1646,7 +1646,7 @@
}
NSUInteger offset = idx++ % 128;
dbus_message_iter_get_basic(iter, (void*)(&bytes[0] + offset));
- // We filled the last byte of the on stack buffer, so we
+ // We filled the last byte of the on stack buffer, so we
if (127 == offset)
{
[data appendBytes: &bytes[0] length: 128];
@@ -1730,7 +1730,7 @@
}
else
{
- NSAssert1(([object respondsToSelector: @selector(objectEnumerator)] ||
+ NSAssert1(([object respondsToSelector: @selector(objectEnumerator)] ||
[object isKindOfClass: [NSData class]]),
@"Cannot enumerate contents of %@ when creating D-Bus array.",
object
@@ -1958,7 +1958,8 @@
@"Object '%@' cannot be marshalled as D-Bus struct.",
object);
NSAssert3(([object count] == childCount),
- @"Could not marshall object '%@' as D-Bus struct: Expected %lu members,
got %lu.",
+ @"Could not marshall object '%@' as D-Bus struct: Expected %"PRIuPTR""
+ @" members, got %"PRIuPTR".",
object,
[object count],
childCount);
@@ -2104,7 +2105,7 @@
{
NSEnumerator *theEnum = [object objectEnumerator];
NSString *signature = nil;
- if ([object respondsToSelector: @selector(isDBusStruct)]
+ if ([object respondsToSelector: @selector(isDBusStruct)]
&& [object isDBusStruct])
{
NSString *subSig = [self subSignatureForEnumerator: theEnum forStruct:
YES];
@@ -2134,9 +2135,9 @@
return [[[DKArgument alloc] initWithDBusSignature: "ay"
name: nil
parent: self] autorelease];
-
- }
- else if (((NSBoolNumberClass != Nil)
+
+ }
+ else if (((NSBoolNumberClass != Nil)
&& [object isKindOfClass: NSBoolNumberClass])
|| ((NSCFBooleanClass != Nil)
&& [object isKindOfClass: NSCFBooleanClass]))
@@ -2261,7 +2262,7 @@
// Dictionaries have exactly two types:
if (childCount != 2)
{
- NSWarnMLog(@"Invalid number of children (%lu) for D-Bus dict entry
argument. Ignoring argument.",
+ NSWarnMLog(@"Invalid number of children (%"PRIuPTR") for D-Bus dict entry
argument. Ignoring argument.",
childCount);
[self release];
return nil;
Modified: libs/dbuskit/trunk/Source/DKEndpointManager.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/dbuskit/trunk/Source/DKEndpointManager.m?rev=40505&r1=40504&r2=40505&view=diff
==============================================================================
--- libs/dbuskit/trunk/Source/DKEndpointManager.m (original)
+++ libs/dbuskit/trunk/Source/DKEndpointManager.m Mon May 15 22:55:13 2017
@@ -79,7 +79,7 @@
/* Definitions for the ring buffer, designwise inspired by EtoileThread */
// Needs to be 2^n
-#define DKRingSize 32
+#define DKRingSize ((NSUInteger)32)
#define DKRingMask (DKRingSize - 1)
@@ -141,8 +141,8 @@
ringBuffer[DKMaskIndex(producerCounter)] = x;\
__sync_fetch_and_add(&producerCounter, 1);\
[producerLock unlock];\
- NSDebugMLog(@"Inserting into ringbuffer (remaining capacity: %lu).",\
- (unsigned long)DKRingSpace);\
+ NSDebugMLog(@"Inserting into ringbuffer (remaining capacity: %"PRIuPTR").",\
+ DKRingSpace);\
} while (0)
@@ -152,13 +152,13 @@
#define DKRingRemove(x) do {\
if (NO == DKRingEmpty)\
{\
- NSDebugMLog(@"Removing element at %lu from ring buffer", (unsigned
long)DKMaskIndex(consumerCounter));\
+ NSDebugMLog(@"Removing element at %"PRIuPTR" from ring buffer", (unsigned
long)DKMaskIndex(consumerCounter));\
x = ringBuffer[DKMaskIndex(consumerCounter)];\
ringBuffer[DKMaskIndex(consumerCounter)] = (DKRingBufferElement){nil,
NULL, nil, NULL};\
[x.target autorelease];\
__sync_fetch_and_add(&consumerCounter, 1);\
}\
- NSDebugMLog(@"(new capacity: %lu).",\
+ NSDebugMLog(@"(new capacity: %"PRIuPTR").",\
(unsigned long)DKRingSpace);\
} while (0)
Modified: libs/dbuskit/trunk/Source/DKIntrospectionParserDelegate.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/dbuskit/trunk/Source/DKIntrospectionParserDelegate.m?rev=40505&r1=40504&r2=40505&view=diff
==============================================================================
--- libs/dbuskit/trunk/Source/DKIntrospectionParserDelegate.m (original)
+++ libs/dbuskit/trunk/Source/DKIntrospectionParserDelegate.m Mon May 15
22:55:13 2017
@@ -119,7 +119,7 @@
return;
}
xmlDepth++;
- NSDebugLog(@"Starting <%@> node '%@' at depth %lu.",
+ NSDebugLog(@"Starting <%@> node '%@' at depth %"PRIuPTR".",
aNode,
theName,
xmlDepth);
@@ -221,7 +221,7 @@
}
else
{
- NSDebugMLog(@"Ignoring <%@> node '%@' at depth %lu.",
+ NSDebugMLog(@"Ignoring <%@> node '%@' at depth %"PRIuPTR".",
aNode,
theName,
xmlDepth);
Modified: libs/dbuskit/trunk/Source/DKMethod.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/dbuskit/trunk/Source/DKMethod.m?rev=40505&r1=40504&r2=40505&view=diff
==============================================================================
--- libs/dbuskit/trunk/Source/DKMethod.m (original)
+++ libs/dbuskit/trunk/Source/DKMethod.m Mon May 15 22:55:13 2017
@@ -398,7 +398,7 @@
*/
// Initial type string containing self and _cmd.
- NSMutableString *typeString = [[NSMutableString alloc] initWithFormat:
@"@0:%lu", (unsigned long)sizeof(id)];
+ NSMutableString *typeString = [[NSMutableString alloc] initWithFormat:
@"@0:%"PRIuPTR"", sizeof(id)];
NSUInteger offset = sizeof(id) + sizeof(SEL);
NSString *returnValue = nil;
NSEnumerator *en = [inArgs objectEnumerator];
@@ -416,7 +416,7 @@
typeChar = [arg unboxedObjCTypeChar];
}
- [typeString appendFormat: @"%s%lu", typeChar, (unsigned long)offset];
+ [typeString appendFormat: @"%s%"PRIuPTR"", typeChar, offset];
if (doBox)
{
@@ -428,7 +428,7 @@
}
}
- returnValue = [NSString stringWithFormat: @"%s%lu%@", [self returnTypeBoxed:
doBox],
+ returnValue = [NSString stringWithFormat: @"%s%"PRIuPTR"%@", [self
returnTypeBoxed: doBox],
(unsigned long)offset,
typeString];
[typeString release];
Modified: libs/dbuskit/trunk/Source/DKNotificationCenter.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/dbuskit/trunk/Source/DKNotificationCenter.m?rev=40505&r1=40504&r2=40505&view=diff
==============================================================================
--- libs/dbuskit/trunk/Source/DKNotificationCenter.m (original)
+++ libs/dbuskit/trunk/Source/DKNotificationCenter.m Mon May 15 22:55:13 2017
@@ -316,7 +316,7 @@
match = @"";
}
[self setRule: match
- forKey: [NSString stringWithFormat: @"arg%lu", index]];
+ forKey: [NSString stringWithFormat: @"arg%"PRIuPTR"", index]];
}
}
@@ -943,7 +943,7 @@
interface: interfaceName
sender: sender
destination: destination
- filters: [NSDictionary dictionaryWithObject: filter
+ filters: [NSDictionary dictionaryWithObject: filter
forKey: [NSNumber
numberWithUnsignedInteger: index]]];
}
@@ -1078,7 +1078,7 @@
NSMutableDictionary *filterDict = [NSMutableDictionary dictionary];
if (firstFilter != nil)
{
- [filterDict setObject: firstFilter
+ [filterDict setObject: firstFilter
forKey: [NSNumber numberWithUnsignedInteger: firstIndex]];
}
@@ -1092,7 +1092,7 @@
if ((thisFilter != nil) && (thisIndex != 0))
{
- [filterDict setObject: thisFilter
+ [filterDict setObject: thisFilter
forKey: [NSNumber numberWithUnsignedInteger: thisIndex]];
processNextFilter = YES;
}
@@ -1430,7 +1430,7 @@
return;
}
DKSignal *sig = [self _signalForNotificationName: name
- generateStub: NO];
+ generateStub: NO];
[self _postSignal: sig
object: sender
userInfo: info];
@@ -1446,7 +1446,7 @@
generateStub: NO];
if ((nil == s) || ([s isStub]))
{
- // Non-existant or stub signals can't be posted
+ // Non-existant or stub signals can't be posted
// since we don't know how to serialise them
return;
}
@@ -1467,8 +1467,8 @@
// The local port manages the object graph
DKPort *localPort = [DKPort portForBusType: [[bus _endpoint] DBusBusType]];
-
- id<DKExportableObjectPathNode> p =
+
+ id<DKExportableObjectPathNode> p =
[localPort _proxyForObject: sender];
if (nil == p)
{
@@ -1476,7 +1476,7 @@
/*
* In the future, we'll do this:
p = [bus _port] _autoregisterObject: sender
- withParent: root];
+ withParent: root];
*/
return;
}
Modified: libs/dbuskit/trunk/Source/DKSignal.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/dbuskit/trunk/Source/DKSignal.m?rev=40505&r1=40504&r2=40505&view=diff
==============================================================================
--- libs/dbuskit/trunk/Source/DKSignal.m (original)
+++ libs/dbuskit/trunk/Source/DKSignal.m Mon May 15 22:55:13 2017
@@ -142,7 +142,7 @@
NSUInteger index = 0;
while (index < (numArgs))
{
- NSString *key = [NSString stringWithFormat: @"arg%lu", index];
+ NSString *key = [NSString stringWithFormat: @"arg%"PRIuPTR"", index];
DKArgument *arg = (DKArgument*)[args objectAtIndex: index];
NSString *annotatedKey = [arg annotationValueForKey:
@"org.gnustep.openstep.notification.key"];
@@ -185,7 +185,7 @@
NSUInteger index = 0;
for (index = 0; index < numArgs; index++)
{
- NSString *key = [NSString stringWithFormat: @"arg%lu", index];
+ NSString *key = [NSString stringWithFormat: @"arg%"PRIuPTR"", index];
DKArgument *arg = (DKArgument*)[args objectAtIndex: index];
NSString *annotatedKey = [arg annotationValueForKey:
@"org.gnustep.openstep.notification.key"];
@@ -194,7 +194,7 @@
{
value = [userInfo objectForKey: annotatedKey];
}
-
+
if (nil == value)
{
// second try, with the argN key
@@ -207,7 +207,7 @@
- (NSInteger)argumentIndexForAnnotatedKey: (NSString*)key
{
-
+
NSEnumerator *argEnum = [args objectEnumerator];
DKArgument *arg = nil;
NSInteger index = 0;
@@ -217,7 +217,7 @@
if ([annotatedKey isEqualToString: key])
{
return index;
- }
+ }
index++;
}
return NSNotFound;
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs