diff --git a/Headers/Foundation/NSArray.h b/Headers/Foundation/NSArray.h
index 22575ac..740f881 100644
--- a/Headers/Foundation/NSArray.h
+++ b/Headers/Foundation/NSArray.h
@@ -67,7 +67,7 @@ typedef NSUInteger NSBinarySearchingOptions;
+ (id) arrayWithContentsOfURL: (NSURL*)aURL;
#endif
+ (id) arrayWithObject: (id)anObject;
-+ (id) arrayWithObjects: (id)firstObject, ...;
++ (id) arrayWithObjects: (id)firstObject, ... NS_REQUIRES_NIL_TERMINATION;
+ (id) arrayWithObjects: (const id[])objects count: (NSUInteger)count;
- (NSArray*) arrayByAddingObject: (id)anObject;
@@ -93,7 +93,7 @@ typedef NSUInteger NSBinarySearchingOptions;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
- (id) initWithContentsOfURL: (NSURL*)aURL;
#endif
-- (id) initWithObjects: firstObject, ...;
+- (id) initWithObjects: firstObject, ... NS_REQUIRES_NIL_TERMINATION;
/**
* This should initialize the array with count (may be zero) objects.
diff --git a/Headers/Foundation/NSBundle.h b/Headers/Foundation/NSBundle.h
index 887e9fd..eb4a951 100644
--- a/Headers/Foundation/NSBundle.h
+++ b/Headers/Foundation/NSBundle.h
@@ -334,16 +334,9 @@ GS_EXPORT NSString* const NSLoadedClasses;
localized equivalent found. This can be useful during development to check
where a given string in the UI is "coming from".
*/
-#ifdef __clang__
- (NSString*) localizedStringForKey: (NSString*)key
value: (NSString*)value
- table: (NSString*)tableName
- __attribute__((format_arg(1)));
-#else
-- (NSString*) localizedStringForKey: (NSString*)key
- value: (NSString*)value
- table: (NSString*)tableName;
-#endif
+ table: (NSString*)tableName NS_FORMAT_ARGUMENT(1);
/** Returns the absolute path to the resources directory of the bundle. */
- (NSString*) resourcePath;
diff --git a/Headers/Foundation/NSDictionary.h b/Headers/Foundation/NSDictionary.h
index 8a00dd3..59c2640 100644
--- a/Headers/Foundation/NSDictionary.h
+++ b/Headers/Foundation/NSDictionary.h
@@ -47,7 +47,7 @@ extern "C" {
+ (id) dictionaryWithObjects: (const id[])objects
forKeys: (const id[])keys
count: (NSUInteger)count;
-+ (id) dictionaryWithObjectsAndKeys: (id)firstObject, ...;
++ (id) dictionaryWithObjectsAndKeys: (id)firstObject, ... NS_REQUIRES_NIL_TERMINATION;
- (NSArray*) allKeys;
- (NSArray*) allKeysForObject: (id)anObject;
@@ -79,7 +79,7 @@ DEFINE_BLOCK_TYPE(GSKeysAndObjectsEnumeratorBlock, void, id, id, BOOL*);
- (id) initWithDictionary: (NSDictionary*)otherDictionary;
- (id) initWithDictionary: (NSDictionary*)other copyItems: (BOOL)shouldCopy;
- (id) initWithObjects: (NSArray*)objects forKeys: (NSArray*)keys;
-- (id) initWithObjectsAndKeys: (id)firstObject, ...;
+- (id) initWithObjectsAndKeys: (id)firstObject, ... NS_REQUIRES_NIL_TERMINATION;
- (id) initWithObjects: (const id[])objects
forKeys: (const id[])keys
count: (NSUInteger)count; // Primitive
diff --git a/Headers/Foundation/NSException.h b/Headers/Foundation/NSException.h
index 1f4e3a3..faf0d2d 100644
--- a/Headers/Foundation/NSException.h
+++ b/Headers/Foundation/NSException.h
@@ -124,7 +124,7 @@ extern "C" {
* raised using the -raise method.
*/
+ (void) raise: (NSString*)name
- format: (NSString*)format,...;
+ format: (NSString*)format, ... NS_FORMAT_FUNCTION(2,3);
/**
* Creates an exception with a name and a reason string using the
@@ -134,7 +134,7 @@ extern "C" {
*/
+ (void) raise: (NSString*)name
format: (NSString*)format
- arguments: (va_list)argList;
+ arguments: (va_list)argList NS_FORMAT_FUNCTION(2,0);
#if OS_API_VERSION(100500,GS_API_LATEST) && GS_API_VERSION( 11501,GS_API_LATEST)
/** Returns an array of the call stack return addresses at the point when
@@ -387,13 +387,13 @@ GS_EXPORT void _NSRemoveHandler( NSHandler *handler );
- (void) handleFailureInFunction: (NSString*)functionName
file: (NSString*)fileName
lineNumber: (NSInteger)line
- description: (NSString*)format,... GS_NORETURN_METHOD;
+ description: (NSString*)format, ... GS_NORETURN_METHOD NS_FORMAT_FUNCTION(4,5);
- (void) handleFailureInMethod: (SEL)aSelector
object: object
file: (NSString*)fileName
lineNumber: (NSInteger)line
- description: (NSString*)format,... GS_NORETURN_METHOD;
+ description: (NSString*)format,... GS_NORETURN_METHOD NS_FORMAT_FUNCTION(5,6);
@end
extern NSString *const NSAssertionHandlerKey;
diff --git a/Headers/Foundation/NSObjCRuntime.h b/Headers/Foundation/NSObjCRuntime.h
index 538033a..1ec6802 100644
--- a/Headers/Foundation/NSObjCRuntime.h
+++ b/Headers/Foundation/NSObjCRuntime.h
@@ -115,6 +115,24 @@ enum
*/
typedef NSUInteger NSSortOptions;
+#ifdef __clang__
+#define NS_REQUIRES_NIL_TERMINATION __attribute__((sentinel))
+#else
+#define NS_REQUIRES_NIL_TERMINATION
+#endif //__clang__
+
+#ifdef __clang__
+#define NS_FORMAT_FUNCTION(F,A) __attribute__((format(__NSString__, F, A)))
+#else
+#define NS_FORMAT_FUNCTION(F,A)
+#endif //__clang__
+
+#ifdef __clang__
+#define NS_FORMAT_ARGUMENT(A) __attribute__((format_arg(A)))
+#else
+#define NS_FORMAT_ARGUMENT(A)
+#endif //__clang__
+
#import
#if OS_API_VERSION(100500,GS_API_LATEST)
@@ -143,8 +161,8 @@ GS_EXPORT int _NSLogDescriptor;
GS_EXPORT NSRecursiveLock *GSLogLock(void);
#endif
-GS_EXPORT void NSLog (NSString *format, ...);
-GS_EXPORT void NSLogv (NSString *format, va_list args);
+GS_EXPORT void NSLog (NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
+GS_EXPORT void NSLogv (NSString *format, va_list args) NS_FORMAT_FUNCTION(1,0);
#ifndef YES
#define YES 1
@@ -171,11 +189,6 @@ enum {NSNotFound = NSIntegerMax};
DEFINE_BLOCK_TYPE(NSComparator, NSComparisonResult, id, id);
-#ifdef __clang__
-#define NS_REQUIRES_NIL_TERMINATION __attribute__((sentinel))
-#endif //__clang__
-
-
#if defined(__cplusplus)
}
#endif
diff --git a/Headers/Foundation/NSSet.h b/Headers/Foundation/NSSet.h
index 51ba07e..360531f 100644
--- a/Headers/Foundation/NSSet.h
+++ b/Headers/Foundation/NSSet.h
@@ -45,7 +45,7 @@ extern "C" {
+ (id) set;
+ (id) setWithArray: (NSArray*)objects;
+ (id) setWithObject: (id)anObject;
-+ (id) setWithObjects: (id)firstObject, ...;
++ (id) setWithObjects: (id)firstObject, ... NS_REQUIRES_NIL_TERMINATION;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
+ (id) setWithObjects: (const id[])objects
count: (NSUInteger)count;
@@ -61,7 +61,7 @@ extern "C" {
- (id) init;
- (id) initWithArray: (NSArray*)other;
-- (id) initWithObjects: (id)firstObject, ...;
+- (id) initWithObjects: (id)firstObject, ... NS_REQUIRES_NIL_TERMINATION;
- (id) initWithObjects: (const id[])objects
count: (NSUInteger)count;
- (id) initWithSet: (NSSet*)other;
diff --git a/Headers/Foundation/NSString.h b/Headers/Foundation/NSString.h
index 5097d4e..73275d1 100644
--- a/Headers/Foundation/NSString.h
+++ b/Headers/Foundation/NSString.h
@@ -274,7 +274,7 @@ typedef NSUInteger NSStringEncodingConversionOptions;
+ (id) stringWithCString: (const char*)byteString
length: (NSUInteger)length;
+ (id) stringWithCString: (const char*)byteString;
-+ (id) stringWithFormat: (NSString*)format,...;
++ (id) stringWithFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
+ (id) stringWithContentsOfFile:(NSString *)path;
// Initializing Newly Allocated Strings
@@ -344,9 +344,9 @@ typedef NSUInteger NSStringEncodingConversionOptions;
length: (NSUInteger)length;
- (id) initWithCString: (const char*)byteString;
- (id) initWithString: (NSString*)string;
-- (id) initWithFormat: (NSString*)format, ...;
+- (id) initWithFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
- (id) initWithFormat: (NSString*)format
- arguments: (va_list)argList;
+ arguments: (va_list)argList NS_FORMAT_FUNCTION(1,0);
- (id) initWithData: (NSData*)data
encoding: (NSStringEncoding)encoding;
- (id) initWithContentsOfFile: (NSString*)path;
@@ -361,7 +361,7 @@ typedef NSUInteger NSStringEncodingConversionOptions;
range: (NSRange)aRange;
// Combining Strings
-- (NSString*) stringByAppendingFormat: (NSString*)format,...;
+- (NSString*) stringByAppendingFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
- (NSString*) stringByAppendingString: (NSString*)aString;
// Dividing Strings into Substrings
@@ -724,16 +724,16 @@ typedef NSUInteger NSStringEncodingConversionOptions;
*/
- (NSArray*) stringsByAppendingPaths: (NSArray*)paths;
-+ (NSString*) localizedStringWithFormat: (NSString*)format, ...;
++ (NSString*) localizedStringWithFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
+ (id) stringWithString: (NSString*)aString;
+ (id) stringWithContentsOfURL: (NSURL*)url;
+ (id) stringWithUTF8String: (const char*)bytes;
- (id) initWithFormat: (NSString*)format
- locale: (NSDictionary*)locale, ...;
+ locale: (NSDictionary*)locale, ... NS_FORMAT_FUNCTION(1,3);
- (id) initWithFormat: (NSString*)format
locale: (NSDictionary*)locale
- arguments: (va_list)argList;
+ arguments: (va_list)argList NS_FORMAT_FUNCTION(1,0);
- (id) initWithUTF8String: (const char *)bytes;
- (id) initWithContentsOfURL: (NSURL*)url;
- (NSString*) substringWithRange: (NSRange)aRange;
@@ -813,7 +813,7 @@ typedef NSUInteger NSStringEncodingConversionOptions;
+ (id) stringWithCString: (const char*)byteString
length: (NSUInteger)length;
+ (id) stringWithCString: (const char*)byteString;
-+ (id) stringWithFormat: (NSString*)format,...;
++ (id) stringWithFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
+ (id) stringWithContentsOfFile: (NSString*)path;
+ (NSMutableString*) stringWithCapacity: (NSUInteger)capacity;
@@ -821,7 +821,7 @@ typedef NSUInteger NSStringEncodingConversionOptions;
- (id) initWithCapacity: (NSUInteger)capacity;
// Modify A String
-- (void) appendFormat: (NSString*)format, ...;
+- (void) appendFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
- (void) appendString: (NSString*)aString;
- (void) deleteCharactersInRange: (NSRange)range;
- (void) insertString: (NSString*)aString atIndex: (NSUInteger)loc;
diff --git a/Headers/GNUstepBase/GNUstep.h b/Headers/GNUstepBase/GNUstep.h
index fb8aac7..d0ba5ba 100644
--- a/Headers/GNUstepBase/GNUstep.h
+++ b/Headers/GNUstepBase/GNUstep.h
@@ -343,14 +343,15 @@ id __object = (object); (__object != nil) ? [__object autorelease] : nil; })
#define GS_RANGE_CHECK(RANGE, SIZE) \
if (RANGE.location > SIZE || RANGE.length > (SIZE - RANGE.location)) \
[NSException raise: NSRangeException \
- format: @"in %s, range { %u, %u } extends beyond size (%u)", \
- GSNameFromSelector(_cmd), RANGE.location, RANGE.length, SIZE]
+ format: @"in %s, range { %lu, %lu } extends beyond size (%lu)", \
+ GSNameFromSelector(_cmd), (unsigned long)RANGE.location, \
+ (unsigned long)RANGE.length, (unsigned long)SIZE]
/** Checks whether INDEX is strictly less than OVER (within C array space). */
#define CHECK_INDEX_RANGE_ERROR(INDEX, OVER) \
if (INDEX >= OVER) \
[NSException raise: NSRangeException \
- format: @"in %s, index %d is out of range", \
- GSNameFromSelector(_cmd), INDEX]
+ format: @"in %s, index %ld is out of range", \
+ GSNameFromSelector(_cmd), (long)INDEX]
#endif /* __GNUSTEP_GNUSTEP_H_INCLUDED_ */
diff --git a/Headers/GNUstepBase/GSIArray.h b/Headers/GNUstepBase/GSIArray.h
index 716d1ac..ad87dc1 100644
--- a/Headers/GNUstepBase/GSIArray.h
+++ b/Headers/GNUstepBase/GSIArray.h
@@ -51,7 +51,7 @@ extern "C" {
#endif
#ifdef GSI_ARRAY_CHECKS
-#define GSI_ARRAY_CHECK NSCAssert(array->count <= array->cap && array->old <= array->cap, NSInternalInconsistencyException)
+#define GSI_ARRAY_CHECK NSCAssert1(array->count <= array->cap && array->old <= array->cap, @"%@", NSInternalInconsistencyException)
#else
#define GSI_ARRAY_CHECK
#endif
@@ -399,7 +399,7 @@ GSIArrayInsertionPosition(GSIArray array, GSIArrayItem item,
index++;
}
#ifdef GSI_ARRAY_CHECKS
- NSCAssert(index <= array->count, NSInternalInconsistencyException);
+ NSCAssert1(index <= array->count, @"%@", NSInternalInconsistencyException);
#endif
return index;
}
@@ -414,8 +414,8 @@ GSIArrayCheckSort(GSIArray array,
for (i = 1; i < array->count; i++)
{
#ifdef GSI_ARRAY_CHECKS
- NSCAssert(((*sorter)(array->ptr[i-1], array->ptr[i])
- != NSOrderedDescending), NSInvalidArgumentException);
+ NSCAssert1(((*sorter)(array->ptr[i-1], array->ptr[i])
+ != NSOrderedDescending), @"%@", NSInvalidArgumentException);
#endif
}
}
@@ -458,7 +458,7 @@ GSIArrayRemoveItemAtIndex(GSIArray array, unsigned index)
{
#if defined(GSI_ARRAY_NO_RELEASE)
# ifdef GSI_ARRAY_CHECKS
- NSCAssert(index < array->count, NSInvalidArgumentException);
+ NSCAssert1(index < array->count, @"%@", NSInvalidArgumentException);
# endif
while (++index < array->count)
array->ptr[index-1] = array->ptr[index];
@@ -469,7 +469,7 @@ GSIArrayRemoveItemAtIndex(GSIArray array, unsigned index)
#else
GSIArrayItem tmp;
# ifdef GSI_ARRAY_CHECKS
- NSCAssert(index < array->count, NSInvalidArgumentException);
+ NSCAssert1(index < array->count, @"%@", NSInvalidArgumentException);
# endif
tmp = array->ptr[index];
while (++index < array->count)
@@ -486,7 +486,7 @@ static INLINE void
GSIArrayRemoveLastItem(GSIArray array)
{
#ifdef GSI_ARRAY_CHECKS
- NSCAssert(array->count, NSInvalidArgumentException);
+ NSCAssert1(array->count, @"%@", NSInvalidArgumentException);
#endif
array->count--;
#if !defined(GSI_ARRAY_NO_RELEASE)
@@ -501,7 +501,7 @@ static INLINE void
GSIArrayRemoveItemAtIndexNoRelease(GSIArray array, unsigned index)
{
#ifdef GSI_ARRAY_CHECKS
- NSCAssert(index < array->count, NSInvalidArgumentException);
+ NSCAssert1(index < array->count, @"%@", NSInvalidArgumentException);
#endif
while (++index < array->count)
array->ptr[index-1] = array->ptr[index];
@@ -516,14 +516,14 @@ GSIArraySetItemAtIndex(GSIArray array, GSIArrayItem item, unsigned index)
{
#if defined(GSI_ARRAY_NO_RELEASE)
# ifdef GSI_ARRAY_CHECKS
- NSCAssert(index < array->count, NSInvalidArgumentException);
+ NSCAssert1(index < array->count, @"%@", NSInvalidArgumentException);
# endif
GSI_ARRAY_RETAIN(array, item);
array->ptr[index] = item;
#else
GSIArrayItem tmp;
# ifdef GSI_ARRAY_CHECKS
- NSCAssert(index < array->count, NSInvalidArgumentException);
+ NSCAssert1(index < array->count, @"%@", NSInvalidArgumentException);
# endif
tmp = array->ptr[index];
GSI_ARRAY_RETAIN(array, item);
@@ -546,7 +546,7 @@ static INLINE GSIArrayItem
GSIArrayItemAtIndex(GSIArray array, unsigned index)
{
#ifdef GSI_ARRAY_CHECKS
- NSCAssert(index < array->count, NSInvalidArgumentException);
+ NSCAssert1(index < array->count, @"%@", NSInvalidArgumentException);
#endif
return array->ptr[index];
}
@@ -555,7 +555,7 @@ static INLINE GSIArrayItem
GSIArrayLastItem(GSIArray array)
{
#ifdef GSI_ARRAY_CHECKS
- NSCAssert(array->count, NSInvalidArgumentException);
+ NSCAssert1(array->count, @"%@", NSInvalidArgumentException);
#endif
return array->ptr[array->count-1];
}
diff --git a/Headers/GNUstepBase/GSObjCRuntime.h b/Headers/GNUstepBase/GSObjCRuntime.h
index ae783dd..0b5057c 100644
--- a/Headers/GNUstepBase/GSObjCRuntime.h
+++ b/Headers/GNUstepBase/GSObjCRuntime.h
@@ -449,7 +449,7 @@ GSAutoreleasedBuffer(unsigned size);
*
*/
GS_EXPORT BOOL
-GSPrintf (FILE *fptr, NSString *format, ...);
+GSPrintf (FILE *fptr, NSString *format, ...) NS_FORMAT_FUNCTION(2,3);
diff --git a/Source/Additions/GCArray.m b/Source/Additions/GCArray.m
index 29865f1..6fd3813 100644
--- a/Source/Additions/GCArray.m
+++ b/Source/Additions/GCArray.m
@@ -208,8 +208,9 @@ static Class gcClass = 0;
if (index >= _count)
{
[NSException raise: NSRangeException
- format: @"address@hidden@]: index: %u",
- NSStringFromClass([self class]), NSStringFromSelector(_cmd), index];
+ format: @"address@hidden@]: index: %lu",
+ NSStringFromClass([self class]), NSStringFromSelector(_cmd),
+ (unsigned long)index];
}
return _contents[index];
}
@@ -333,8 +334,9 @@ static Class gcClass = 0;
if (index > _count)
{
[NSException raise: NSRangeException
- format: @"address@hidden@]: bad index %u",
- NSStringFromClass([self class]), NSStringFromSelector(_cmd), index];
+ format: @"address@hidden@]: bad index %lu",
+ NSStringFromClass([self class]), NSStringFromSelector(_cmd),
+ (unsigned long)index];
}
if (_count == _maxCount)
@@ -419,8 +421,9 @@ static Class gcClass = 0;
if (index >= _count)
{
[NSException raise: NSRangeException
- format: @"address@hidden@]: bad index %u",
- NSStringFromClass([self class]), NSStringFromSelector(_cmd), index];
+ format: @"address@hidden@]: bad index %lu",
+ NSStringFromClass([self class]), NSStringFromSelector(_cmd),
+ (unsigned long)index];
}
ASSIGN(_contents[index], anObject);
_isGCObject[index] = [anObject isKindOfClass: gcClass];
diff --git a/Source/Additions/GSMime.m b/Source/Additions/GSMime.m
index 6620692..13eff1f 100644
--- a/Source/Additions/GSMime.m
+++ b/Source/Additions/GSMime.m
@@ -1300,7 +1300,7 @@ wordData(NSString *word)
{
NSMutableString *desc;
- desc = [NSMutableString stringWithFormat: @"GSMimeParser <%0x> -\n", self];
+ desc = [NSMutableString stringWithFormat: @"GSMimeParser <%p> -\n", self];
[desc appendString: [document description]];
return desc;
}
@@ -1533,7 +1533,8 @@ wordData(NSString *word)
return NO; /* Want no more data */
}
- NSDebugMLLog(@"GSMime", @"Parse %u bytes - '%*.*s'", l, l, l, [d bytes]);
+ NSDebugMLLog(@"GSMime", @"Parse %lu bytes - '%*.*s'",
+ (unsigned long)l, (int)l, (int)l, [d bytes]);
r = [self _endOfHeaders: d];
if (r.location == NSNotFound)
@@ -1620,8 +1621,8 @@ wordData(NSString *word)
* This is an intermediary response ... so we have
* to restart the parsing operation!
*/
- NSDebugMLLog(@"GSMime",
- @"Parsed http continuation", "");
+ NSDebugMLLog(@"GSMime", @"%@",
+ @"Parsed http continuation");
flags.inBody = 0;
if ([d length] == 0)
{
@@ -2414,7 +2415,8 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
NSDebugMLLog(@"GSMime", @"Parse body expects %u bytes", expect);
}
- NSDebugMLLog(@"GSMime", @"Parse %u bytes - '%*.*s'", l, l, l, [d bytes]);
+ NSDebugMLLog(@"GSMime", @"Parse %lu bytes - '%*.*s'",
+ (unsigned long)l, (int)l, (int)l, [d bytes]);
// NSDebugMLLog(@"GSMime", @"Boundary - '%*.*s'", [boundary length], [boundary length], [boundary bytes]);
if ([context atEnd] == YES)
@@ -2470,7 +2472,7 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
flags.inBody = 0;
flags.complete = 1;
- NSDebugMLLog(@"GSMime", @"Parse body complete", "");
+ NSDebugMLLog(@"GSMime", @"%@", @"Parse body complete");
/*
* If no content type is supplied, we assume text ... unless
* we have something that's known to be a file.
@@ -3419,7 +3421,7 @@ static NSCharacterSet *tokenSet = nil;
{
NSMutableString *desc;
- desc = [NSMutableString stringWithFormat: @"GSMimeHeader <%0x> -\n", self];
+ desc = [NSMutableString stringWithFormat: @"GSMimeHeader <%p> -\n", self];
[desc appendFormat: @" name: address@hidden", [self name]];
[desc appendFormat: @" value: address@hidden", [self value]];
[desc appendFormat: @" params: address@hidden", [self parameters]];
@@ -3825,7 +3827,8 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
if (ok == NO)
{
NSDebugMLLog(@"GSMime",
- @"Value for '%@' too long for folding at %u in header", n, fold);
+ @"Value for '%@' too long for folding at %lu in header", n,
+ (unsigned long)fold);
}
while ((k = [e nextObject]) != nil)
@@ -3843,16 +3846,16 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
if (ok == NO)
{
NSDebugMLLog(@"GSMime",
- @"Parameter name '%@' in '%@' too long for folding at %u",
- k, n, fold);
+ @"Parameter name '%@' in '%@' too long for folding at %lu",
+ k, n, (unsigned long)fold);
}
offset = appendBytes(md, offset, fold, "=", 1);
offset = appendString(md, offset, fold, v, &ok);
if (ok == NO)
{
NSDebugMLLog(@"GSMime",
- @"Parameter value for '%@' in '%@' too long for folding at %u",
- k, n, fold);
+ @"Parameter value for '%@' in '%@' too long for folding at %lu",
+ k, n, (unsigned long)fold);
}
}
[md appendBytes: "\r\n" length: 2];
@@ -5438,7 +5441,7 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
NSMutableString *desc;
NSDictionary *locale;
- desc = [NSMutableString stringWithFormat: @"GSMimeDocument <%0x> -\n", self];
+ desc = [NSMutableString stringWithFormat: @"GSMimeDocument <%p> -\n", self];
locale = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
[desc appendString: [headers descriptionWithLocale: locale]];
[desc appendFormat: @"\nDocument content -\n%@", content];
diff --git a/Source/Additions/GSXML.m b/Source/Additions/GSXML.m
index a5acaea..ab03922 100644
--- a/Source/Additions/GSXML.m
+++ b/Source/Additions/GSXML.m
@@ -3306,8 +3306,8 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
colNumber: (NSInteger)colNumber
lineNumber: (NSInteger)lineNumber
{
- e = [NSString stringWithFormat: @"at line: %d column: %d ... %@",
- lineNumber, colNumber, e];
+ e = [NSString stringWithFormat: @"at line: %ld column: %ld ... %@",
+ (long)lineNumber, (long)colNumber, e];
[self warning: e];
}
@@ -3318,8 +3318,8 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
colNumber: (NSInteger)colNumber
lineNumber: (NSInteger)lineNumber
{
- e = [NSString stringWithFormat: @"at line: %d column: %d ... %@",
- lineNumber, colNumber, e];
+ e = [NSString stringWithFormat: @"at line: %ld column: %ld ... %@",
+ (long)lineNumber, (long)colNumber, e];
[self error: e];
}
@@ -3330,8 +3330,8 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
colNumber: (NSInteger)colNumber
lineNumber: (NSInteger)lineNumber
{
- e = [NSString stringWithFormat: @"at line: %d column: %d ... %@",
- lineNumber, colNumber, e];
+ e = [NSString stringWithFormat: @"at line: %ld column: %ld ... %@",
+ (long)lineNumber, (long)colNumber, e];
[self fatalError: e];
}
@@ -3791,7 +3791,8 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
}
- (NSString *) description
{
- return [NSString_class stringWithFormat: @"NodeSet (count %u)", [self count]];
+ return [NSString_class stringWithFormat: @"NodeSet (count %lu)",
+ (unsigned long)[self count]];
}
@end
diff --git a/Source/Additions/NSObject+GNUstepBase.m b/Source/Additions/NSObject+GNUstepBase.m
index 09b318c..eee0a2d 100644
--- a/Source/Additions/NSObject+GNUstepBase.m
+++ b/Source/Additions/NSObject+GNUstepBase.m
@@ -37,7 +37,7 @@
+ (id) notImplemented: (SEL)selector
{
[NSException raise: NSGenericException
- format: @"method %@ not implemented in %s(class)",
+ format: @"method %@ not implemented in %@(class)",
selector ? (id)NSStringFromSelector(selector) : (id)@"(null)",
NSStringFromClass(self)];
return nil;
diff --git a/Source/GSArray.m b/Source/GSArray.m
index f8ddc50..d42f506 100644
--- a/Source/GSArray.m
+++ b/Source/GSArray.m
@@ -89,8 +89,8 @@ static Class GSInlineArrayClass;
self, @"Array", nil, nil];
reason = [NSString stringWithFormat:
- @"Index %d is out of range %d (in '%@')",
- index, _count, NSStringFromSelector(sel)];
+ @"Index %lu is out of range %d (in '%@')",
+ (unsigned long)index, _count, NSStringFromSelector(sel)];
exception = [NSException exceptionWithName: NSRangeException
reason: reason
diff --git a/Source/GSAttributedString.m b/Source/GSAttributedString.m
index 02d9efe..0870fdd 100644
--- a/Source/GSAttributedString.m
+++ b/Source/GSAttributedString.m
@@ -373,7 +373,7 @@ _attributesAtIndexEffectiveRange(
GSAttrInfo *found = nil;
used = (*cntImp)(_infoArray, cntSel);
- NSCAssert(used > 0, NSInternalInconsistencyException);
+ NSCAssert1(used > 0, @"%@", NSInternalInconsistencyException);
high = used - 1;
if (index >= tmpLength)
@@ -551,14 +551,14 @@ _attributesAtIndexEffectiveRange(
unsigned len = [_textChars length];
unsigned c = (*cntImp)(_infoArray, cntSel);
- NSAssert(c > 0, NSInternalInconsistencyException);
+ NSAssert1(c > 0, @"%@", NSInternalInconsistencyException);
info = OBJECTAT(0);
- NSAssert(info->loc == 0, NSInternalInconsistencyException);
+ NSAssert1(info->loc == 0, @"%@", NSInternalInconsistencyException);
for (i = 1; i < c; i++)
{
info = OBJECTAT(i);
- NSAssert(info->loc > l, NSInternalInconsistencyException);
- NSAssert(info->loc < len, NSInternalInconsistencyException);
+ NSAssert1(info->loc > l, @"%@", NSInternalInconsistencyException);
+ NSAssert1(info->loc < len, @"%@", NSInternalInconsistencyException);
l = info->loc;
}
}
diff --git a/Source/GSAvahiNetServiceBrowser.m b/Source/GSAvahiNetServiceBrowser.m
index 56cafdd..b48d8b0 100644
--- a/Source/GSAvahiNetServiceBrowser.m
+++ b/Source/GSAvahiNetServiceBrowser.m
@@ -459,8 +459,8 @@ GSAvahiServiceBrowserEvent(
/* We can't recover if the type is wrong and we don't want to
* leak random memory.
*/
- NSAssert((_type < GSAvahiBrowserMax) && (_type != GSAvahiUnknownBrowser),
- NSInternalInconsistencyException);
+ NSAssert1((_type < GSAvahiBrowserMax) && (_type != GSAvahiUnknownBrowser),
+ @"%@", NSInternalInconsistencyException);
[self setHasFirstEvent: NO];
switch (_type)
{
diff --git a/Source/GSHTTPAuthentication.m b/Source/GSHTTPAuthentication.m
index 659c1f5..edca59e 100644
--- a/Source/GSHTTPAuthentication.m
+++ b/Source/GSHTTPAuthentication.m
@@ -102,10 +102,10 @@ static GSMimeParser *mimeParser = nil;
NSURLProtectionSpace *known = nil;
GSHTTPAuthentication *authentication = nil;
- NSAssert([credential isKindOfClass: [NSURLCredential class]] == YES,
- NSInvalidArgumentException);
- NSAssert([space isKindOfClass: [NSURLProtectionSpace class]] == YES,
- NSInvalidArgumentException);
+ NSAssert1([credential isKindOfClass: [NSURLCredential class]] == YES,
+ @"%@", NSInvalidArgumentException);
+ NSAssert1([space isKindOfClass: [NSURLProtectionSpace class]] == YES,
+ @"%@", NSInvalidArgumentException);
[storeLock lock];
NS_DURING
diff --git a/Source/GSHTTPURLHandle.m b/Source/GSHTTPURLHandle.m
index e7a2753..d07c6d6 100644
--- a/Source/GSHTTPURLHandle.m
+++ b/Source/GSHTTPURLHandle.m
@@ -409,7 +409,7 @@ debugWrite(GSHTTPURLHandle *handle, NSData *data)
if ((id)NSMapGet(wProperties, (void*)@"Content-Length") == nil)
{
NSMapInsert(wProperties, (void*)@"Content-Length",
- (void*)[NSString stringWithFormat: @"%d", [wData length]]);
+ (void*)[NSString stringWithFormat: @"%lu", (unsigned long)[wData length]]);
}
if ([wData length] > 0)
diff --git a/Source/GSSocketStream.m b/Source/GSSocketStream.m
index d7d1025..54e1022 100644
--- a/Source/GSSocketStream.m
+++ b/Source/GSSocketStream.m
@@ -596,7 +596,7 @@ static NSArray *keys = nil;
- (void) stream: (NSStream*)stream handleEvent: (NSStreamEvent)event
{
NSDebugMLLog(@"NSStream",
- @"GSTLSHandler got %d on %p", event, stream);
+ @"GSTLSHandler got %d on %p", (int)event, stream);
if (handshake == YES)
{
@@ -862,7 +862,7 @@ static NSString * const GSSOCKSAckConn = @"GSSOCKSAckConn";
address = [[NSString alloc] initWithUTF8String:
(char*)inet_ntoa(addr->sin_addr)];
port = [[NSString alloc] initWithFormat: @"%d",
- (NSInteger)GSSwapBigI16ToHost(addr->sin_port)];
+ GSSwapBigI16ToHost(addr->sin_port)];
/* Now reconfigure the streams so they will actually connect
* to the socks proxy server.
diff --git a/Source/GSStream.m b/Source/GSStream.m
index 7fac3f7..1d29816 100644
--- a/Source/GSStream.m
+++ b/Source/GSStream.m
@@ -525,7 +525,7 @@ static RunLoopEventType typeForStream(NSStream *aStream)
else
{
[NSException raise: NSInvalidArgumentException
- format: @"Unknown event (%d) passed to _sendEvent:", event];
+ format: @"Unknown event (%d) passed to _sendEvent:", (int)event];
}
}
diff --git a/Source/GSString.m b/Source/GSString.m
index d31833b..fbdecb2 100644
--- a/Source/GSString.m
+++ b/Source/GSString.m
@@ -4432,7 +4432,7 @@ agree, create a new GSUInlineString otherwise.
{
if (_contents.c != 0)
{
-NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException);
+NSAssert1(_flags.owned == 1 && _zone != 0, @"%@", NSInternalInconsistencyException);
NSZoneFree(self->_zone, self->_contents.c);
self->_contents.c = 0;
self->_zone = 0;
@@ -4883,7 +4883,7 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException);
- (id) makeImmutableCopyOnFail: (BOOL)force
{
-NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException);
+NSAssert1(_flags.owned == 1 && _zone != 0, @"%@", NSInternalInconsistencyException);
if (_flags.wide == 1)
{
GSClassSwizzle(self, [GSUnicodeBufferString class]);
@@ -5505,8 +5505,9 @@ literalIsEqual(NXConstantString *self, id anObject)
if (NSNotFound == aRange.location)
[NSException raise: NSRangeException
- format: @"in %s, range { %u, %u } extends beyond string",
- GSNameFromSelector(_cmd), aRange.location, aRange.length];
+ format: @"in %s, range { %lu, %lu } extends beyond string",
+ GSNameFromSelector(_cmd), (unsigned long)aRange.location,
+ (unsigned long)aRange.length];
while (index < aRange.location && (i < nxcslen || n > 0))
{
@@ -5524,8 +5525,9 @@ literalIsEqual(NXConstantString *self, id anObject)
if (index != max)
{
[NSException raise: NSRangeException
- format: @"in %s, range { %u, %u } extends beyond string",
- GSNameFromSelector(_cmd), aRange.location, aRange.length];
+ format: @"in %s, range { %lu, %lu } extends beyond string",
+ GSNameFromSelector(_cmd), (unsigned long)aRange.location,
+ (unsigned long)aRange.length];
}
}
diff --git a/Source/GSTLS.m b/Source/GSTLS.m
index b10868d..e2b29d7 100644
--- a/Source/GSTLS.m
+++ b/Source/GSTLS.m
@@ -499,7 +499,7 @@ static NSMutableDictionary *certificateListCache = nil;
int i;
[str appendString: @"\n"];
- [str appendFormat: _(@"- Certificate info:\n")];
+ [str appendFormat: @"%@", _(@"- Certificate info:\n")];
expiret = gnutls_x509_crt_get_expiration_time(cert);
activet = gnutls_x509_crt_get_activation_time(cert);
diff --git a/Source/NSAssertionHandler.m b/Source/NSAssertionHandler.m
index b53f185..c98428d 100644
--- a/Source/NSAssertionHandler.m
+++ b/Source/NSAssertionHandler.m
@@ -97,8 +97,8 @@ NSString *const NSAssertionHandlerKey = @"NSAssertionHandler";
va_start(ap, format);
message =
[NSString
- stringWithFormat: @"%@:%d Assertion failed in address@hidden %@",
- fileName, line, functionName, format];
+ stringWithFormat: @"%@:%ld Assertion failed in address@hidden %@",
+ fileName, (long)line, functionName, format];
NSLogv(message, ap);
[NSException raise: NSInternalInconsistencyException
@@ -125,8 +125,8 @@ NSString *const NSAssertionHandlerKey = @"NSAssertionHandler";
va_start(ap, format);
message =
[NSString
- stringWithFormat: @"%@:%d Assertion failed in %@(%@), method address@hidden %@",
- fileName, line, NSStringFromClass([object class]),
+ stringWithFormat: @"%@:%ld Assertion failed in %@(%@), method address@hidden %@",
+ fileName, (long)line, NSStringFromClass([object class]),
class_isMetaClass([object class]) ? @"class" : @"instance",
NSStringFromSelector(aSelector), format];
NSLogv(message, ap);
diff --git a/Source/NSBundle.m b/Source/NSBundle.m
index 6e7d923..21d76b0 100644
--- a/Source/NSBundle.m
+++ b/Source/NSBundle.m
@@ -391,7 +391,7 @@ GSPrivateExecutablePath()
beenHere = YES;
}
[load_lock unlock];
- NSCAssert(executablePath != nil, NSInternalInconsistencyException);
+ NSCAssert1(executablePath != nil, @"%@", NSInternalInconsistencyException);
}
return executablePath;
}
@@ -1016,8 +1016,8 @@ static void
_bundle_load_callback(Class theClass, struct objc_category *theCategory)
{
const char *className;
- NSCAssert(_loadingBundle, NSInternalInconsistencyException);
- NSCAssert(_loadingFrameworks, NSInternalInconsistencyException);
+ NSCAssert1(_loadingBundle, @"%@", NSInternalInconsistencyException);
+ NSCAssert1(_loadingFrameworks, @"%@", NSInternalInconsistencyException);
/* We never record categories - if this is a category, just do nothing. */
if (theCategory != 0)
@@ -1473,7 +1473,7 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
_mainBundle = [self alloc];
/* Please note that _mainBundle should *not* be nil. */
_mainBundle = [_mainBundle initWithPath: path];
- NSAssert(_mainBundle != nil, NSInternalInconsistencyException);
+ NSAssert1(_mainBundle != nil, @"%@", NSInternalInconsistencyException);
}
[load_lock unlock];
diff --git a/Source/NSCalendarDate.m b/Source/NSCalendarDate.m
index e8c5c23..8dc20db 100644
--- a/Source/NSCalendarDate.m
+++ b/Source/NSCalendarDate.m
@@ -917,7 +917,7 @@ static inline int getDigits(const char *from, char *to, int limit, BOOL *error)
error = YES;
NSDebugMLog(
@"Expected literal '%%' but got end of string parsing"
- @"'%@' using '%@'", source[sourceIdx],
+ @"'%@' using '%@'",
description, fmt);
}
break;
@@ -1530,24 +1530,24 @@ static inline int getDigits(const char *from, char *to, int limit, BOOL *error)
if (month < 1 || month > 12)
{
- NSWarnMLog(@"invalid month given - %u", month);
+ NSWarnMLog(@"invalid month given - %lu", (unsigned long)month);
}
c = lastDayOfGregorianMonth(month, year);
if (day < 1 || day > c)
{
- NSWarnMLog(@"invalid day given - %u", day);
+ NSWarnMLog(@"invalid day given - %lu", (unsigned long)day);
}
if (hour > 23)
{
- NSWarnMLog(@"invalid hour given - %u", hour);
+ NSWarnMLog(@"invalid hour given - %lu", (unsigned long)hour);
}
if (minute > 59)
{
- NSWarnMLog(@"invalid minute given - %u", minute);
+ NSWarnMLog(@"invalid minute given - %lu", (unsigned long)minute);
}
if (second > 59)
{
- NSWarnMLog(@"invalid second given - %u", second);
+ NSWarnMLog(@"invalid second given - %lu", (unsigned long)second);
}
// Calculate date as GMT
diff --git a/Source/NSCallBacks.m b/Source/NSCallBacks.m
index 4dbad5b..39e27b9 100644
--- a/Source/NSCallBacks.m
+++ b/Source/NSCallBacks.m
@@ -65,7 +65,7 @@ _NS_int_release(void *table, void* i)
NSString *
_NS_int_describe(void *table, void* i)
{
- return [NSString stringWithFormat: @"%d", (int)(intptr_t)i];
+ return [NSString stringWithFormat: @"%ld", (long)(intptr_t)i];
}
/** For owned `void *' **/
@@ -100,7 +100,7 @@ _NS_owned_void_p_release(void *table, void *p)
NSString *
_NS_owned_void_p_describe(void *table, void *p)
{
- return [NSString stringWithFormat: @"%#x", p];
+ return [NSString stringWithFormat: @"%p", p];
}
/** For non-retained Objective-C objects **/
@@ -199,7 +199,7 @@ _NS_non_owned_void_p_release(void *table, void *p)
NSString *
_NS_non_owned_void_p_describe(void *table, void *p)
{
- return [NSString stringWithFormat: @"%0x", p];
+ return [NSString stringWithFormat: @"%p", p];
}
/** For pointers to structures and `int *' **/
@@ -232,5 +232,5 @@ NSString *
_NS_int_p_describe(void *table, int *p)
{
/* Is this useful? */
- return [NSString stringWithFormat: @"%d(%#x)", *p, p];
+ return [NSString stringWithFormat: @"%d(%p)", *p, p];
}
diff --git a/Source/NSConcreteHashTable.m b/Source/NSConcreteHashTable.m
index a3b10a6..28b445e 100644
--- a/Source/NSConcreteHashTable.m
+++ b/Source/NSConcreteHashTable.m
@@ -312,7 +312,7 @@ NSCreateHashTableWithZone(
if (concreteClass == Nil)
{
[NSConcreteHashTable class]; // Force +initialize
- NSCAssert(concreteClass != Nil, NSInternalInconsistencyException);
+ NSCAssert1(concreteClass != Nil, @"%@", NSInternalInconsistencyException);
}
table = (GSIMapTable)[concreteClass allocWithZone: zone];
diff --git a/Source/NSConcreteMapTable.m b/Source/NSConcreteMapTable.m
index 75eb27b..820618b 100644
--- a/Source/NSConcreteMapTable.m
+++ b/Source/NSConcreteMapTable.m
@@ -457,7 +457,7 @@ NSCreateMapTableWithZone(
if (concreteClass == Nil)
{
[NSConcreteMapTable class]; // Force +initialize
- NSCAssert(concreteClass != Nil, NSInternalInconsistencyException);
+ NSCAssert1(concreteClass != Nil, @"%@", NSInternalInconsistencyException);
}
table = (GSIMapTable)[concreteClass allocWithZone: zone];
diff --git a/Source/NSConnection.m b/Source/NSConnection.m
index 5de98af..ade8c34 100644
--- a/Source/NSConnection.m
+++ b/Source/NSConnection.m
@@ -2039,8 +2039,8 @@ static NSLock *cached_proxies_gate = nil;
}
[self _sendOutRmc: op type: METHOD_REQUEST];
- NSDebugMLLog(@"NSConnection", @"Sent message %s RMC %d to 0x%x",
- sel_getName([inv selector]), seq, (uintptr_t)self);
+ NSDebugMLLog(@"NSConnection", @"Sent message %s RMC %d to %p",
+ sel_getName([inv selector]), seq, self);
if (needsResponse == NO)
{
@@ -3230,7 +3230,7 @@ static NSLock *cached_proxies_gate = nil;
}
NS_ENDHANDLER
- NSDebugMLLog(@"NSConnection", @"Consuming reply RMC %d on %x", sn, self);
+ NSDebugMLLog(@"NSConnection", @"Consuming reply RMC %d on %p", sn, self);
return rmc;
}
@@ -3453,7 +3453,7 @@ static NSLock *cached_proxies_gate = nil;
}
if (raiseException == YES)
{
- [NSException raise: NSPortTimeoutException format: text];
+ [NSException raise: NSPortTimeoutException format: @"%@", text];
}
else
{
@@ -3504,9 +3504,9 @@ static NSLock *cached_proxies_gate = nil;
* Record the value in the IlocalObjects map, retaining it.
*/
node = GSIMapNodeForKey(IlocalObjects, (GSIMapKey)object);
- NSAssert(node == 0, NSInternalInconsistencyException);
+ NSAssert1(node == 0, @"%@", NSInternalInconsistencyException);
node = GSIMapNodeForKey(IlocalTargets, (GSIMapKey)(NSUInteger)target);
- NSAssert(node == 0, NSInternalInconsistencyException);
+ NSAssert1(node == 0, @"%@", NSInternalInconsistencyException);
IF_NO_GC([anObj retain];)
GSIMapAddPair(IlocalObjects, (GSIMapKey)object, (GSIMapVal)((id)anObj));
diff --git a/Source/NSData.m b/Source/NSData.m
index d3b86c0..f51e204 100644
--- a/Source/NSData.m
+++ b/Source/NSData.m
@@ -2844,7 +2844,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
if (*cursor >= length)
{
[NSException raise: NSRangeException
- format: @"Range: (%u, 1) Size: %d", *cursor, length];
+ format: @"Range: (%u, 1) Size: %lu", *cursor, (unsigned long)length];
}
*tag = *((unsigned char*)bytes + (*cursor)++);
if (*tag & _GSC_MAYX)
@@ -2860,8 +2860,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
if (*cursor >= length)
{
[NSException raise: NSRangeException
- format: @"Range: (%u, 1) Size: %d",
- *cursor, length];
+ format: @"Range: (%u, 1) Size: %lu",
+ *cursor, (unsigned long)length];
}
*ref = (unsigned int)*((unsigned char*)bytes + (*cursor)++);
return;
@@ -2873,8 +2873,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
if (*cursor >= length-1)
{
[NSException raise: NSRangeException
- format: @"Range: (%u, 1) Size: %d",
- *cursor, length];
+ format: @"Range: (%u, 1) Size: %lu",
+ *cursor, (unsigned long)length];
}
#if NEED_WORD_ALIGNMENT
if ((*cursor % __alignof__(uint16_t)) != 0)
@@ -2893,8 +2893,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
if (*cursor >= length-3)
{
[NSException raise: NSRangeException
- format: @"Range: (%u, 1) Size: %d",
- *cursor, length];
+ format: @"Range: (%u, 1) Size: %lu",
+ *cursor, (unsigned long)length];
}
#if NEED_WORD_ALIGNMENT
if ((*cursor % __alignof__(uint32_t)) != 0)
@@ -3058,7 +3058,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
bytes = mmap(0, length, PROT_READ, MAP_SHARED, fd, 0);
if (bytes == MAP_FAILED)
{
- NSWarnMLog(@"mapping failed for %s - %@", path, [NSError _last]);
+ NSWarnMLog(@"mapping failed for %@ - %@", path, [NSError _last]);
close(fd);
DESTROY(self);
self = [dataMalloc allocWithZone: NSDefaultMallocZone()];
@@ -3728,7 +3728,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
if (tmp == 0)
{
[NSException raise: NSMallocException
- format: @"Unable to set data capacity to '%d'", size];
+ format: @"Unable to set data capacity to '%lu'", (unsigned long)size];
}
if (bytes)
{
@@ -3922,8 +3922,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
if (newid == -1) /* Created memory? */
{
[NSException raise: NSMallocException
- format: @"Unable to create shared memory segment (size:%u) - address@hidden",
- size, [NSError _last]];
+ format: @"Unable to create shared memory segment (size:%lu) - address@hidden",
+ (unsigned long)size, [NSError _last]];
}
tmp = shmat(newid, 0, 0);
if ((intptr_t)tmp == -1) /* Attached memory? */
diff --git a/Source/NSDictionary.m b/Source/NSDictionary.m
index 01a445b..346eb70 100644
--- a/Source/NSDictionary.m
+++ b/Source/NSDictionary.m
@@ -827,7 +827,7 @@ static SEL appSel;
for (i = 0; i < c; i++)
{
k[i] = (*nxtObj)(e, nxtSel);
- NSAssert (k[i], NSInternalInconsistencyException);
+ NSAssert1(k[i], @"%@", NSInternalInconsistencyException);
}
result = [[NSArray_class allocWithZone: NSDefaultMallocZone()]
initWithObjects: k count: c];
diff --git a/Source/NSDistantObject.m b/Source/NSDistantObject.m
index 8ac85fd..2a708f7 100644
--- a/Source/NSDistantObject.m
+++ b/Source/NSDistantObject.m
@@ -185,7 +185,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder
*/
decoder_connection = [(NSPortCoder*)aCoder connection];
- NSAssert(decoder_connection, NSInternalInconsistencyException);
+ NSAssert1(decoder_connection, @"%@", NSInternalInconsistencyException);
/* First get the tag, so we know what values need to be decoded. */
[aCoder decodeValueOfObjCType: @encode(typeof(proxy_tag))
@@ -285,7 +285,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder
[aCoder decodeValueOfObjCType: @encode(id)
at: &proxy_connection_out_port];
- NSAssert(proxy_connection_out_port, NSInternalInconsistencyException);
+ NSAssert1(proxy_connection_out_port, @"%@", NSInternalInconsistencyException);
/*
# If there already exists a connection for talking to the
* out port, we use that one rather than creating a new one from
@@ -305,10 +305,10 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder
NSLog(@"Receiving a triangle-connection proxy 0x%x "
@"connection %p\n", target, proxy_connection);
- NSAssert(proxy_connection != decoder_connection,
- NSInternalInconsistencyException);
- NSAssert([proxy_connection isValid],
- NSInternalInconsistencyException);
+ NSAssert1(proxy_connection != decoder_connection,
+ @"%@", NSInternalInconsistencyException);
+ NSAssert1([proxy_connection isValid],
+ @"%@", NSInternalInconsistencyException);
/*
* We may not already have a proxy for the object on the
@@ -342,7 +342,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder
{
NSDistantObject *proxy;
- NSAssert([aConnection isValid], NSInternalInconsistencyException);
+ NSAssert1([aConnection isValid], @"%@", NSInternalInconsistencyException);
/*
* If there already is a local proxy for this target/connection
@@ -362,7 +362,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder
{
NSDistantObject *proxy;
- NSAssert([aConnection isValid], NSInternalInconsistencyException);
+ NSAssert1([aConnection isValid], @"%@", NSInternalInconsistencyException);
/*
* If there already is a local proxy for this target/connection
@@ -483,7 +483,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder
*/
encoder_connection = [(NSPortCoder*)aRmc connection];
- NSAssert(encoder_connection, NSInternalInconsistencyException);
+ NSAssert1(encoder_connection, @"%@", NSInternalInconsistencyException);
if (![encoder_connection isValid])
[NSException
raise: NSGenericException
@@ -542,12 +542,12 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder
NSPort *proxy_connection_out_port = [_connection sendPort];
NSDistantObject *localProxy;
- NSAssert(proxy_connection_out_port,
- NSInternalInconsistencyException);
- NSAssert([proxy_connection_out_port isValid],
- NSInternalInconsistencyException);
- NSAssert(proxy_connection_out_port != [encoder_connection sendPort],
- NSInternalInconsistencyException);
+ NSAssert1(proxy_connection_out_port,
+ @"%@", NSInternalInconsistencyException);
+ NSAssert1([proxy_connection_out_port isValid],
+ @"%@", NSInternalInconsistencyException);
+ NSAssert1(proxy_connection_out_port != [encoder_connection sendPort],
+ @"%@", NSInternalInconsistencyException);
proxy_tag = PROXY_REMOTE_FOR_BOTH;
@@ -620,7 +620,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder
*/
- (id) initWithLocal: (id)anObject connection: (NSConnection*)aConnection
{
- NSAssert([aConnection isValid], NSInternalInconsistencyException);
+ NSAssert1([aConnection isValid], @"%@", NSInternalInconsistencyException);
_object = RETAIN(anObject);
_handle = 0;
@@ -641,7 +641,7 @@ GS_ROOT_CLASS @interface GSDistantObjectPlaceHolder
*/
- (id) initWithTarget: (unsigned)target connection: (NSConnection*)aConnection
{
- NSAssert([aConnection isValid], NSInternalInconsistencyException);
+ NSAssert1([aConnection isValid], @"%@", NSInternalInconsistencyException);
_object = nil;
_handle = target;
diff --git a/Source/NSDistributedNotificationCenter.m b/Source/NSDistributedNotificationCenter.m
index 3913ba8..e2a2499 100644
--- a/Source/NSDistributedNotificationCenter.m
+++ b/Source/NSDistributedNotificationCenter.m
@@ -796,8 +796,8 @@ static NSDistributedNotificationCenter *netCenter = nil;
removeObserver: self
name: NSConnectionDidDieNotification
object: connection];
- NSAssert(connection == [_remote connectionForProxy],
- NSInternalInconsistencyException);
+ NSAssert1(connection == [_remote connectionForProxy],
+ @"%@", NSInternalInconsistencyException);
RELEASE(_remote);
_remote = nil;
}
diff --git a/Source/NSFileHandle.m b/Source/NSFileHandle.m
index 5b55f25..5bb5da5 100644
--- a/Source/NSFileHandle.m
+++ b/Source/NSFileHandle.m
@@ -976,7 +976,7 @@ GSTLSHandlePush(gnutls_transport_ptr_t handle, const void *buffer, size_t len)
- (BOOL) sslHandshakeEstablished: (BOOL*)result outgoing: (BOOL)isOutgoing
{
- NSAssert(0 != result, NSInvalidArgumentException);
+ NSAssert1(0 != result, @"%@", NSInvalidArgumentException);
if (YES == [session active])
{
diff --git a/Source/NSFileManager.m b/Source/NSFileManager.m
index 2d39b1f..0f0c43a 100644
--- a/Source/NSFileManager.m
+++ b/Source/NSFileManager.m
@@ -428,8 +428,8 @@ static NSStringEncoding defaultEncoding;
{
allOk = NO;
str = [NSString stringWithFormat:
- @"Unable to change NSFileOwnerAccountID to '%u' - %@",
- num, [NSError _last]];
+ @"Unable to change NSFileOwnerAccountID to '%lu' - %@",
+ (unsigned long)num, [NSError _last]];
ASSIGN(_lastError, str);
}
}
@@ -494,8 +494,8 @@ static NSStringEncoding defaultEncoding;
{
allOk = NO;
str = [NSString stringWithFormat:
- @"Unable to change NSFileGroupOwnerAccountID to '%u' - %@",
- num, [NSError _last]];
+ @"Unable to change NSFileGroupOwnerAccountID to '%lu' - %@",
+ (unsigned long)num, [NSError _last]];
ASSIGN(_lastError, str);
}
}
@@ -549,7 +549,7 @@ static NSStringEncoding defaultEncoding;
allOk = NO;
str = [NSString stringWithFormat:
@"Unable to change NSFilePosixPermissions to '%o' - %@",
- num, [NSError _last]];
+ (unsigned int)num, [NSError _last]];
ASSIGN(_lastError, str);
}
}
diff --git a/Source/NSHTTPCookieStorage.m b/Source/NSHTTPCookieStorage.m
index deba824..800273a 100644
--- a/Source/NSHTTPCookieStorage.m
+++ b/Source/NSHTTPCookieStorage.m
@@ -280,8 +280,8 @@ static NSHTTPCookieStorage *storage = nil;
NSString *path = [cookie path];
NSString *domain = [cookie domain];
- NSAssert([cookie isKindOfClass: [NSHTTPCookie class]] == YES,
- NSInvalidArgumentException);
+ NSAssert1([cookie isKindOfClass: [NSHTTPCookie class]] == YES,
+ @"%@", NSInvalidArgumentException);
remove_ck = nil;
while ((ck = [ckenum nextObject]))
diff --git a/Source/NSIndexPath.m b/Source/NSIndexPath.m
index 80cd2be..f6dac18 100644
--- a/Source/NSIndexPath.m
+++ b/Source/NSIndexPath.m
@@ -136,14 +136,14 @@ static NSIndexPath *dummy = nil;
NSMutableString *m = [[super description] mutableCopy];
NSUInteger i;
- [m appendFormat: @"%u indexes [", _length];
+ [m appendFormat: @"%lu indexes [", (unsigned long)_length];
for (i = 0; i < _length; i++)
{
if (i > 0)
{
[m appendString: @", "];
}
- [m appendFormat: @"%u", _indexes[i]];
+ [m appendFormat: @"%lu", (unsigned long)_indexes[i]];
}
[m appendString: @"]"];
return AUTORELEASE(m);
@@ -297,7 +297,8 @@ static NSIndexPath *dummy = nil;
NSZoneFree(NSDefaultMallocZone(), dst);
}
[NSException raise: NSGenericException format:
- @"Unable to decode unsigned integers of size %u", s];
+ @"Unable to decode unsigned integers of size %lu",
+ (unsigned long)s];
}
self = [self initWithIndexes: dst length: length];
if ((void*)dst != src)
diff --git a/Source/NSIndexSet.m b/Source/NSIndexSet.m
index fea975b..dd46df2 100644
--- a/Source/NSIndexSet.m
+++ b/Source/NSIndexSet.m
@@ -288,19 +288,20 @@ static NSUInteger posForIndex(GSIArray array, NSUInteger index)
[super description]];
}
m = [NSMutableString stringWithFormat:
- @"address@hidden of indexes: %u (in %u ranges), indexes:",
- [super description], [self count], c];
+ @"address@hidden of indexes: %lu (in %lu ranges), indexes:",
+ [super description], (unsigned long)[self count], (unsigned long)c];
for (i = 0; i < c; i++)
{
NSRange r = GSIArrayItemAtIndex(_array, i).ext;
if (r.length > 1)
{
- [m appendFormat: @" (%u-%u)", r.location, NSMaxRange(r) - 1];
+ [m appendFormat: @" (%lu-%lu)", (unsigned long)r.location,
+ (unsigned long)(NSMaxRange(r) - 1)];
}
else
{
- [m appendFormat: @" %u", r.location];
+ [m appendFormat: @" %lu", (unsigned long)r.location];
}
}
[m appendString: @"]"];
@@ -660,8 +661,8 @@ static NSUInteger posForIndex(GSIArray array, NSUInteger index)
break;
}
}
- NSAssert(index + offset < length && bytes[index + offset] < 0x80,
- NSInternalInconsistencyException);
+ NSAssert1(index + offset < length && bytes[index + offset] < 0x80,
+ @"%@", NSInternalInconsistencyException);
next = index + offset + 1;
value = bytes[index + offset];
while (offset-- > 0)
@@ -678,8 +679,8 @@ static NSUInteger posForIndex(GSIArray array, NSUInteger index)
break;
}
}
- NSAssert(index + offset < length && bytes[index + offset] < 0x80,
- NSInternalInconsistencyException);
+ NSAssert1(index + offset < length && bytes[index + offset] < 0x80,
+ @"%@", NSInternalInconsistencyException);
next = index + offset + 1;
value = bytes[index + offset];
while (offset-- > 0)
@@ -1451,8 +1452,8 @@ static NSUInteger posForIndex(GSIArray array, NSUInteger index)
- (id) _initWithBytes: (const void*)bytes length: (NSUInteger)length
{
- NSAssert(length % sizeof(GSIArrayItem) == 0, NSInvalidArgumentException);
- NSAssert(length % __alignof__(GSIArrayItem) == 0, NSInvalidArgumentException);
+ NSAssert1(length % sizeof(GSIArrayItem) == 0, @"%@", NSInvalidArgumentException);
+ NSAssert1(length % __alignof__(GSIArrayItem) == 0, @"%@", NSInvalidArgumentException);
length /= sizeof(NSRange);
_data = NSZoneMalloc([self zone], sizeof(GSIArray_t));
_array->ptr = (GSIArrayItem*)bytes;
diff --git a/Source/NSJSONSerialization.m b/Source/NSJSONSerialization.m
index 3f86ec0..353381f 100644
--- a/Source/NSJSONSerialization.m
+++ b/Source/NSJSONSerialization.m
@@ -265,8 +265,8 @@ parseError(ParserState *state)
*/
NSDictionary *userInfo = [[NSDictionary alloc] initWithObjectsAndKeys:
_(@"JSON Parse error"), NSLocalizedDescriptionKey,
- _(([NSString stringWithFormat: @"Unexpected character %c at index %d",
- (char)currentChar(state), state->sourceIndex])),
+ _(([NSString stringWithFormat: @"Unexpected character %c at index %ld",
+ (char)currentChar(state), (long)state->sourceIndex])),
NSLocalizedFailureReasonErrorKey,
nil];
state->error = [NSError errorWithDomain: NSCocoaErrorDomain
diff --git a/Source/NSKeyValueCoding.m b/Source/NSKeyValueCoding.m
index 9a6c9f5..953d889 100644
--- a/Source/NSKeyValueCoding.m
+++ b/Source/NSKeyValueCoding.m
@@ -342,7 +342,7 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
}
#endif
[NSException raise: NSInvalidArgumentException
- format: @"%@ -- %@ 0x%x: Given nil value to set for key \"address@hidden"",
+ format: @"%@ -- %@ %p: Given nil value to set for key \"address@hidden"",
NSStringFromSelector(_cmd), NSStringFromClass([self class]),
self, aKey];
}
@@ -899,7 +899,7 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
{
GSOnceMLog(@"This method is deprecated, use -setNilValueForKey:");
[NSException raise: NSInvalidArgumentException
- format: @"%@ -- %@ 0x%x: Given nil value to set for key \"address@hidden"",
+ format: @"%@ -- %@ %p: Given nil value to set for key \"address@hidden"",
NSStringFromSelector(_cmd), NSStringFromClass([self class]), self, aKey];
}
diff --git a/Source/NSKeyedUnarchiver.m b/Source/NSKeyedUnarchiver.m
index 5b68f37..31383b0 100644
--- a/Source/NSKeyedUnarchiver.m
+++ b/Source/NSKeyedUnarchiver.m
@@ -394,13 +394,13 @@ static NSMapTable *globalClassMap = 0;
{
[NSException raise: NSInvalidUnarchiveOperationException
format: @"[%@ address@hidden: type missmatch",
- NSStringFromClass([self class]), NSStringFromSelector(_cmd), o];
+ NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
}
if ([o count] != expected)
{
[NSException raise: NSInvalidUnarchiveOperationException
format: @"[%@ address@hidden: count missmatch",
- NSStringFromClass([self class]), NSStringFromSelector(_cmd), o];
+ NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
}
NSGetSizeAndAlignment(type, 0, &size);
memcpy(buf, [o bytes], expected * size);
diff --git a/Source/NSLog.m b/Source/NSLog.m
index 64e8462..de92bd8 100644
--- a/Source/NSLog.m
+++ b/Source/NSLog.m
@@ -341,7 +341,7 @@ NSLogv (NSString* format, va_list args)
{
if (GSPrivateDefaultsFlag(GSLogThread) == YES)
{
- prefix = [NSString stringWithFormat: @"[thread:%x] ",
+ prefix = [NSString stringWithFormat: @"[thread:%p] ",
GSCurrentThread()];
}
else
@@ -355,7 +355,7 @@ NSLogv (NSString* format, va_list args)
if (GSPrivateDefaultsFlag(GSLogThread) == YES)
{
prefix = [NSString
- stringWithFormat: @"%@ address@hidden,%x] ",
+ stringWithFormat: @"%@ address@hidden,%p] ",
[[NSCalendarDate calendarDate]
descriptionWithCalendarFormat: @"%Y-%m-%d %H:%M:%S.%F"],
[[NSProcessInfo processInfo] processName],
diff --git a/Source/NSMessagePort.m b/Source/NSMessagePort.m
index 6546515..f396d5c 100644
--- a/Source/NSMessagePort.m
+++ b/Source/NSMessagePort.m
@@ -164,8 +164,8 @@ decodePort(NSData *data)
GSPortInfo *pi;
pih = (GSPortItemHeader*)[data bytes];
- NSCAssert(GSSwapBigI32ToHost(pih->type) == GSP_PORT,
- NSInternalInconsistencyException);
+ NSCAssert1(GSSwapBigI32ToHost(pih->type) == GSP_PORT,
+ @"%@", NSInternalInconsistencyException);
pi = (GSPortInfo*)&pih[1];
if (pi->version != 0)
{
@@ -351,7 +351,7 @@ static Class runLoopClass;
const unsigned char *name;
M_LOCK(myLock);
- NSDebugMLLog(@"NSMessagePort", @"Connecting on 0x%x before %@", self, when);
+ NSDebugMLLog(@"NSMessagePort", @"Connecting on %p before %@", self, when);
if (state != GS_H_UNCON)
{
BOOL result;
@@ -500,7 +500,7 @@ static Class runLoopClass;
type: ET_WDESC
forMode: nil
all: YES];
- NSDebugMLLog(@"NSMessagePort", @"invalidated 0x%x", self);
+ NSDebugMLLog(@"NSMessagePort", @"invalidated %p", self);
[[self recvPort] removeHandle: self];
[[self sendPort] removeHandle: self];
}
@@ -527,7 +527,7 @@ static Class runLoopClass;
forMode: (NSString*)mode
{
NSDebugMLLog(@"NSMessagePort_details",
- @"received %s event on 0x%x",
+ @"received %s event on %p",
type != ET_WDESC ? "read" : "write", self);
/*
* If we have been invalidated (desc < 0) then we should ignore this
@@ -587,7 +587,7 @@ static Class runLoopClass;
{
if (res == 0)
{
- NSDebugMLLog(@"NSMessagePort", @"read eof on 0x%x", self);
+ NSDebugMLLog(@"NSMessagePort", @"read eof on %p", self);
M_UNLOCK(myLock);
[self invalidate];
return;
@@ -603,7 +603,7 @@ static Class runLoopClass;
res = 0; /* Interrupted - continue */
}
NSDebugMLLog(@"NSMessagePort_details",
- @"read %d bytes on 0x%x", res, self);
+ @"read %d bytes on %p", res, self);
rLength += res;
while (valid == YES && rLength >= rWant)
@@ -733,7 +733,7 @@ static Class runLoopClass;
h = (GSPortMsgHeader*)bytes;
rId = GSSwapBigI32ToHost(h->mId);
nItems = GSSwapBigI32ToHost(h->nItems);
- NSAssert(nItems >0, NSInternalInconsistencyException);
+ NSAssert1(nItems >0, @"%@", NSInternalInconsistencyException);
rItems
= [mutableArrayClass allocWithZone: NSDefaultMallocZone()];
rItems = [rItems initWithCapacity: nItems];
@@ -861,7 +861,7 @@ static Class runLoopClass;
rId = 0;
DESTROY(rItems);
NSDebugMLLog(@"NSMessagePort_details",
- @"got message %@ on 0x%x", pm, self);
+ @"got message %@ on %p", pm, self);
IF_NO_GC([rp retain];)
M_UNLOCK(myLock);
NS_DURING
@@ -909,7 +909,7 @@ static Class runLoopClass;
if (len == (int)[d length])
{
NSDebugMLLog(@"NSMessagePort_details",
- @"wrote %d bytes on 0x%x", len, self);
+ @"wrote %d bytes on %p", len, self);
state = GS_H_CONNECTED;
}
else
@@ -959,7 +959,7 @@ static Class runLoopClass;
else
{
NSDebugMLLog(@"NSMessagePort_details",
- @"wrote %d bytes on 0x%x", res, self);
+ @"wrote %d bytes on %p", res, self);
wLength += res;
if (wLength == l)
{
@@ -984,7 +984,7 @@ static Class runLoopClass;
* message completed - remove from list.
*/
NSDebugMLLog(@"NSMessagePort_details",
- @"completed 0x%x on 0x%x", components, self);
+ @"completed %p on %p", components, self);
wData = nil;
wItem = 0;
[wMsgs removeObjectAtIndex: 0];
@@ -1002,9 +1002,9 @@ static Class runLoopClass;
NSRunLoop *l;
BOOL sent = NO;
- NSAssert([components count] > 0, NSInternalInconsistencyException);
+ NSAssert1([components count] > 0, @"%@", NSInternalInconsistencyException);
NSDebugMLLog(@"NSMessagePort_details",
- @"Sending message 0x%x %@ on 0x%x(%d) before %@",
+ @"Sending message %p %@ on %p(%d) before %@",
components, components, self, desc, when);
M_LOCK(myLock);
[wMsgs addObject: components];
@@ -1046,7 +1046,7 @@ static Class runLoopClass;
}
M_UNLOCK(myLock);
NSDebugMLLog(@"NSMessagePort_details",
- @"Message send 0x%x on 0x%x status %d", components, self, sent);
+ @"Message send %p on %p status %d", components, self, sent);
RELEASE(self);
return sent;
}
@@ -1408,7 +1408,7 @@ typedef struct {
- (void) finalize
{
- NSDebugMLLog(@"NSMessagePort", @"NSMessagePort 0x%x finalized", self);
+ NSDebugMLLog(@"NSMessagePort", @"NSMessagePort %p finalized", self);
[self invalidate];
if (_internal != 0)
{
@@ -1574,13 +1574,12 @@ typedef struct {
if (d == nil)
{
- NSDebugMLLog(@"NSMessagePort",
- @"No delegate to handle incoming message", 0);
+ NSDebugMLLog(@"NSMessagePort", @"No delegate to handle incoming message");
return;
}
if ([d respondsToSelector: @selector(handlePortMessage:)] == NO)
{
- NSDebugMLLog(@"NSMessagePort", @"delegate doesn't handle messages", 0);
+ NSDebugMLLog(@"NSMessagePort", @"delegate doesn't handle messages");
return;
}
[d handlePortMessage: m];
diff --git a/Source/NSNotificationCenter.m b/Source/NSNotificationCenter.m
index 2992edb..e407229 100644
--- a/Source/NSNotificationCenter.m
+++ b/Source/NSNotificationCenter.m
@@ -510,7 +510,7 @@ static inline void unlockNCTable(NCTable* t)
#ifndef __OBJC_GC__
static void obsFree(Observation *o)
{
- NSCAssert(o->retained >= 0, NSInternalInconsistencyException);
+ NSCAssert1(o->retained >= 0, @"%@", NSInternalInconsistencyException);
if (o->retained-- == 0)
{
NCTable *t = o->link;
diff --git a/Source/NSNumber.m b/Source/NSNumber.m
index d5e1619..4a0a027 100644
--- a/Source/NSNumber.m
+++ b/Source/NSNumber.m
@@ -368,7 +368,7 @@ static BOOL useSmallFloat;
#if OBJC_SMALL_OBJECT_SHIFT == 1
#define FORMAT @"%d"
#else
-#define FORMAT @"%lld"
+#define FORMAT @"%ld"
#endif
#include "NSNumberMethods.h"
diff --git a/Source/NSNumberFormatter.m b/Source/NSNumberFormatter.m
index 9d0a953..6dcdddd 100644
--- a/Source/NSNumberFormatter.m
+++ b/Source/NSNumberFormatter.m
@@ -290,9 +290,9 @@ GS_PRIVATE_INTERNAL(NSNumberFormatter)
- (int32_t) attributeForKey: (int)key
{
- NSAssert(key >= 0
+ NSAssert1(key >= 0
&& key < sizeof(_attributes) / sizeof(*_attributes),
- NSInvalidArgumentException);
+ @"%@", NSInvalidArgumentException);
#if GS_USE_ICU == 1
if (_attributes[key] <= 0)
{
@@ -304,9 +304,9 @@ GS_PRIVATE_INTERNAL(NSNumberFormatter)
- (BOOL) boolForKey: (int)key
{
- NSAssert(key >= 0
+ NSAssert1(key >= 0
&& key < sizeof(_attributes) / sizeof(*_attributes),
- NSInvalidArgumentException);
+ @"%@", NSInvalidArgumentException);
#if GS_USE_ICU == 1
if (0 == _attributes[key])
{
@@ -328,9 +328,9 @@ GS_PRIVATE_INTERNAL(NSNumberFormatter)
int32_t length;
UErrorCode err = U_ZERO_ERROR;
- NSAssert(key >= 0
+ NSAssert1(key >= 0
&& key < sizeof(_symbols) / sizeof(*_symbols),
- NSInvalidArgumentException);
+ @"%@", NSInvalidArgumentException);
length = unum_getSymbol(_formatter, key, buffer, BUFFER_SIZE, &err);
if (length > BUFFER_SIZE)
length = BUFFER_SIZE;
@@ -347,9 +347,9 @@ GS_PRIVATE_INTERNAL(NSNumberFormatter)
int32_t length;
UErrorCode err = U_ZERO_ERROR;
- NSAssert(key >= 0
+ NSAssert1(key >= 0
&& key < sizeof(_textAttributes) / sizeof(*_textAttributes),
- NSInvalidArgumentException);
+ @"%@", NSInvalidArgumentException);
length = unum_getTextAttribute(_formatter, key, buffer, BUFFER_SIZE, &err);
if (length > BUFFER_SIZE)
length = BUFFER_SIZE;
@@ -361,9 +361,9 @@ GS_PRIVATE_INTERNAL(NSNumberFormatter)
- (void) setAttribute: (int32_t)value forKey: (int)key
{
- NSAssert(key >= 0
+ NSAssert1(key >= 0
&& key < sizeof(_attributes) / sizeof(*_attributes),
- NSInvalidArgumentException);
+ @"%@", NSInvalidArgumentException);
#if GS_USE_ICU == 1
if (value < 0)
value = -1;
@@ -375,9 +375,9 @@ GS_PRIVATE_INTERNAL(NSNumberFormatter)
- (void) setBool: (BOOL)value forKey: (int)key
{
- NSAssert(key >= 0
+ NSAssert1(key >= 0
&& key < sizeof(_symbols) / sizeof(*_symbols),
- NSInvalidArgumentException);
+ @"%@", NSInvalidArgumentException);
#if GS_USE_ICU == 1
_attributes[key] = (value ? 2 : 1);
unum_setAttribute (_formatter, key, (int32_t)(value ? 1 : 0));
@@ -392,9 +392,9 @@ GS_PRIVATE_INTERNAL(NSNumberFormatter)
NSUInteger length;
UErrorCode err = U_ZERO_ERROR;
- NSAssert(key >= 0
+ NSAssert1(key >= 0
&& key < sizeof(_symbols) / sizeof(*_symbols),
- NSInvalidArgumentException);
+ @"%@", NSInvalidArgumentException);
ASSIGNCOPY(_symbols[key], value);
length = [value length];
if (length > BUFFER_SIZE)
@@ -412,9 +412,9 @@ GS_PRIVATE_INTERNAL(NSNumberFormatter)
NSUInteger length;
UErrorCode err = U_ZERO_ERROR;
- NSAssert(key >= 0
+ NSAssert1(key >= 0
&& key < sizeof(_textAttributes) / sizeof(*_textAttributes),
- NSInvalidArgumentException);
+ @"%@", NSInvalidArgumentException);
ASSIGNCOPY(_textAttributes[key], value);
length = [value length];
if (length > BUFFER_SIZE)
diff --git a/Source/NSObject.m b/Source/NSObject.m
index 2a2f214..75fb009 100644
--- a/Source/NSObject.m
+++ b/Source/NSObject.m
@@ -1840,7 +1840,8 @@ static id gs_weak_load(id obj)
[NSException
raise: NSGenericException
format: @"Autorelease would release object too many times.\n"
- @"%d release(s) versus %d retain(s)", release_count, retain_count];
+ @"%lu release(s) versus %lu retain(s)",
+ (unsigned long)release_count, (unsigned long)retain_count];
}
(*autorelease_imp)(autorelease_class, autorelease_sel, self);
diff --git a/Source/NSOperation.m b/Source/NSOperation.m
index e5287f2..7cc2ce3 100644
--- a/Source/NSOperation.m
+++ b/Source/NSOperation.m
@@ -718,9 +718,9 @@ static NSOperationQueue *mainQueue = nil;
if (YES == invalidArg)
{
[NSException raise: NSInvalidArgumentException
- format: @"address@hidden@] object at index %u is not an NSOperation",
+ format: @"address@hidden@] object at index %lu is not an NSOperation",
NSStringFromClass([self class]), NSStringFromSelector(_cmd),
- index];
+ (unsigned long)index];
}
}
if (YES == shouldWait)
@@ -813,8 +813,8 @@ static NSOperationQueue *mainQueue = nil;
&& cnt != NSOperationQueueDefaultMaxConcurrentOperationCount)
{
[NSException raise: NSInvalidArgumentException
- format: @"address@hidden@] cannot set negative (%d) count",
- NSStringFromClass([self class]), NSStringFromSelector(_cmd), cnt];
+ format: @"address@hidden@] cannot set negative (%ld) count",
+ NSStringFromClass([self class]), NSStringFromSelector(_cmd), (long)cnt];
}
[internal->lock lock];
if (cnt != internal->count)
diff --git a/Source/NSPointerArray.m b/Source/NSPointerArray.m
index 249b5ea..bff1254 100644
--- a/Source/NSPointerArray.m
+++ b/Source/NSPointerArray.m
@@ -235,8 +235,8 @@ static Class concreteClass = Nil;
self, @"Array", nil, nil];
reason = [NSString stringWithFormat:
- @"Index %d is out of range %d (in '%@')",
- index, _count, NSStringFromSelector(sel)];
+ @"Index %lu is out of range %lu (in '%@')",
+ (unsigned long)index, (unsigned long)_count, NSStringFromSelector(sel)];
exception = [NSException exceptionWithName: NSRangeException
reason: reason
diff --git a/Source/NSPort.m b/Source/NSPort.m
index 427e8dc..356a648 100644
--- a/Source/NSPort.m
+++ b/Source/NSPort.m
@@ -202,9 +202,9 @@ static Class NSPort_concrete_class;
- (void) setDelegate: (id) anObject
{
- NSAssert(anObject == nil
+ NSAssert1(anObject == nil
|| [anObject respondsToSelector: @selector(handlePortMessage:)],
- NSInvalidArgumentException);
+ @"%@", NSInvalidArgumentException);
_delegate = anObject;
}
diff --git a/Source/NSPortCoder.m b/Source/NSPortCoder.m
index 5c36b59..1967a78 100644
--- a/Source/NSPortCoder.m
+++ b/Source/NSPortCoder.m
@@ -493,8 +493,8 @@ static unsigned encodingVersion;
if (count != expected)
{
[NSException raise: NSInternalInconsistencyException
- format: @"expected array count %u and got %u",
- expected, count];
+ format: @"expected array count %lu and got %lu",
+ (unsigned long)expected, (unsigned long)count];
}
switch (*type)
@@ -1823,8 +1823,8 @@ static unsigned encodingVersion;
}
else
{
- NSAssert(recv == [_conn receivePort] && send == [_conn sendPort],
- NSInvalidArgumentException);
+ NSAssert1(recv == [_conn receivePort] && send == [_conn sendPort],
+ @"%@", NSInvalidArgumentException);
/*
* Re-initialising - destroy old components.
*/
diff --git a/Source/NSPortMessage.m b/Source/NSPortMessage.m
index c004b15..b90a02d 100644
--- a/Source/NSPortMessage.m
+++ b/Source/NSPortMessage.m
@@ -46,7 +46,7 @@
- (NSString*) description
{
return [NSString stringWithFormat:
- @"NSPortMessage 0x%x (Id %u)\n Send: address@hidden Recv: address@hidden Components -\n%@",
+ @"NSPortMessage %p (Id %u)\n Send: address@hidden Recv: address@hidden Components -\n%@",
self, _msgid, _send, _recv, _components];
}
diff --git a/Source/NSPredicate.m b/Source/NSPredicate.m
index 2312386..b24821a 100644
--- a/Source/NSPredicate.m
+++ b/Source/NSPredicate.m
@@ -1524,7 +1524,7 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
- (id) _eval_count: (NSArray *)expressions
{
- NSAssert(_argc == 1, NSInternalInconsistencyException);
+ NSAssert1(_argc == 1, @"%@", NSInternalInconsistencyException);
return [NSNumber numberWithUnsignedInt:
[[expressions objectAtIndex: 0] count]];
}
diff --git a/Source/NSPropertyList.m b/Source/NSPropertyList.m
index 59d4e44..bde80b4 100644
--- a/Source/NSPropertyList.m
+++ b/Source/NSPropertyList.m
@@ -2898,9 +2898,9 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml,
unsigned count;
unsigned pos;
-NSAssert(0 != counter, NSInvalidArgumentException);
+NSAssert1(0 != counter, @"%@", NSInvalidArgumentException);
pos = *counter;
-NSAssert(pos + index_size < _length, NSInvalidArgumentException);
+NSAssert1(pos + index_size < _length, @"%@", NSInvalidArgumentException);
index = _bytes[pos++];
for (count = 1; count < index_size; count++)
{
@@ -2916,21 +2916,21 @@ NSAssert(pos + index_size < _length, NSInvalidArgumentException);
unsigned pos;
unsigned char c;
-NSAssert(0 != counter, NSInvalidArgumentException);
+NSAssert1(0 != counter, @"%@", NSInvalidArgumentException);
pos = *counter;
-NSAssert(pos <= _length, NSInvalidArgumentException);
+NSAssert1(pos <= _length, @"%@", NSInvalidArgumentException);
c = _bytes[pos++];
if (c == 0x10)
{
-NSAssert(pos + 1 < _length, NSInvalidArgumentException);
+NSAssert1(pos + 1 < _length, @"%@", NSInvalidArgumentException);
count = _bytes[pos++];
*counter = pos;
return count;
}
else if (c == 0x11)
{
-NSAssert(pos + 2 < _length, NSInvalidArgumentException);
+NSAssert1(pos + 2 < _length, @"%@", NSInvalidArgumentException);
count = _bytes[pos++];
count = (count << 8) + _bytes[pos++];
*counter = pos;
@@ -2940,9 +2940,9 @@ NSAssert(pos + 2 < _length, NSInvalidArgumentException);
{
unsigned len = c - 0x10;
-NSAssert(pos + 1 < _length, NSInvalidArgumentException);
+NSAssert1(pos + 1 < _length, @"%@", NSInvalidArgumentException);
count = _bytes[pos++];
-NSAssert(pos + count < _length, NSInvalidArgumentException);
+NSAssert1(pos + count < _length, @"%@", NSInvalidArgumentException);
while (len-- > 0)
{
count = (count << 8) + _bytes[pos++];
@@ -3036,7 +3036,7 @@ NSAssert(pos + count < _length, NSInvalidArgumentException);
// short data
unsigned len = next - 0x40;
-NSAssert(counter + len <= _length, NSInvalidArgumentException);
+NSAssert1(counter + len <= _length, @"%@", NSInvalidArgumentException);
if (mutability == NSPropertyListMutableContainersAndLeaves)
{
result = [NSMutableData dataWithBytes: _bytes + counter
@@ -3054,7 +3054,7 @@ NSAssert(counter + len <= _length, NSInvalidArgumentException);
unsigned long len;
len = [self readCountAt: &counter];
-NSAssert(counter + len <= _length, NSInvalidArgumentException);
+NSAssert1(counter + len <= _length, @"%@", NSInvalidArgumentException);
if (mutability == NSPropertyListMutableContainersAndLeaves)
{
result = [NSMutableData dataWithBytes: _bytes + counter
diff --git a/Source/NSRange.m b/Source/NSRange.m
index 5680920..b2e92ee 100644
--- a/Source/NSRange.m
+++ b/Source/NSRange.m
@@ -88,8 +88,8 @@ NSString *
NSStringFromRange(NSRange range)
{
setupCache();
- return [NSStringClass stringWithFormat: @"{location=%d, length=%d}",
- range.location, range.length];
+ return [NSStringClass stringWithFormat: @"{location=%lu, length=%lu}",
+ (unsigned long)range.location, (unsigned long)range.length];
}
GS_EXPORT void _NSRangeExceptionRaise ()
diff --git a/Source/NSRunLoop.m b/Source/NSRunLoop.m
index 37ffef0..42bfa32 100644
--- a/Source/NSRunLoop.m
+++ b/Source/NSRunLoop.m
@@ -1129,7 +1129,7 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
NSString *savedMode = _currentMode;
NSAutoreleasePool *arp = [NSAutoreleasePool new];
- NSAssert(mode, NSInvalidArgumentException);
+ NSAssert1(mode, @"%@", NSInvalidArgumentException);
if (mode == nil)
{
mode = NSDefaultRunLoopMode;
@@ -1249,7 +1249,7 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSDate *d;
- NSAssert(mode != nil, NSInvalidArgumentException);
+ NSAssert1(mode != nil, @"%@", NSInvalidArgumentException);
/* Find out how long we can wait before first limit date. */
d = [self limitDateForMode: mode];
diff --git a/Source/NSSerializer.m b/Source/NSSerializer.m
index cac253f..3dba83b 100644
--- a/Source/NSSerializer.m
+++ b/Source/NSSerializer.m
@@ -389,7 +389,7 @@ static BOOL shouldBeCompact = NO;
_NSSerializerInfo info;
NSMutableData *d;
- NSAssert(propertyList != nil, NSInvalidArgumentException);
+ NSAssert1(propertyList != nil, @"%@", NSInvalidArgumentException);
d = [NSMutableData dataWithCapacity: 1024];
initSerializerInfo(&info, d, shouldBeCompact);
serializeToInfo(propertyList, &info);
@@ -406,8 +406,8 @@ static BOOL shouldBeCompact = NO;
{
_NSSerializerInfo info;
- NSAssert(propertyList != nil, NSInvalidArgumentException);
- NSAssert(d != nil, NSInvalidArgumentException);
+ NSAssert1(propertyList != nil, @"%@", NSInvalidArgumentException);
+ NSAssert1(d != nil, @"%@", NSInvalidArgumentException);
initSerializerInfo(&info, d, shouldBeCompact);
serializeToInfo(propertyList, &info);
endSerializerInfo(&info);
@@ -422,8 +422,8 @@ static BOOL shouldBeCompact = NO;
{
_NSSerializerInfo info;
- NSAssert(propertyList != nil, NSInvalidArgumentException);
- NSAssert(d != nil, NSInvalidArgumentException);
+ NSAssert1(propertyList != nil, @"%@", NSInvalidArgumentException);
+ NSAssert1(d != nil, @"%@", NSInvalidArgumentException);
initSerializerInfo(&info, d, flag);
serializeToInfo(propertyList, &info);
endSerializerInfo(&info);
@@ -863,7 +863,7 @@ deserializeFromInfo(_NSDeserializerInfo* info)
{
return nil;
}
- NSAssert(cursor != 0, NSInvalidArgumentException);
+ NSAssert1(cursor != 0, @"%@", NSInvalidArgumentException);
if (initDeserializerInfo(&info, data, cursor, flag) == YES)
{
o = deserializeFromInfo(&info);
@@ -931,7 +931,7 @@ deserializeFromInfo(_NSDeserializerInfo* info)
{
return nil;
}
- NSAssert(cursor != 0, NSInvalidArgumentException);
+ NSAssert1(cursor != 0, @"%@", NSInvalidArgumentException);
if (length > [data length] - *cursor)
{
_NSDeserializerInfo info;
diff --git a/Source/NSSocketPort.m b/Source/NSSocketPort.m
index b2b402d..cad7567 100644
--- a/Source/NSSocketPort.m
+++ b/Source/NSSocketPort.m
@@ -265,8 +265,8 @@ decodePort(NSData *data, NSString *defaultAddress)
unichar c;
pih = (GSPortItemHeader*)[data bytes];
- NSCAssert(GSSwapBigI32ToHost(pih->type) == GSP_PORT,
- NSInternalInconsistencyException);
+ NSCAssert1(GSSwapBigI32ToHost(pih->type) == GSP_PORT,
+ @"%@", NSInternalInconsistencyException);
pi = (GSPortInfo*)&pih[1];
pnum = GSSwapBigI16ToHost(pi->num);
if (strncmp(pi->addr, "VER", 3) == 0)
@@ -465,7 +465,7 @@ static Class runLoopClass;
NSRunLoop *l;
M_LOCK(myLock);
- NSDebugMLLog(@"GSTcpHandle", @"Connecting on 0x%x before %@", self, when);
+ NSDebugMLLog(@"GSTcpHandle", @"Connecting on %p before %@", self, when);
if (state != GS_H_UNCON)
{
BOOL result;
@@ -680,7 +680,7 @@ static Class runLoopClass;
- (NSString*) description
{
- return [NSString stringWithFormat: @"Handle (%d) to %s:%d",
+ return [NSString stringWithFormat: @"Handle (%d) to %@",
desc, GSPrivateSockaddrName(&sockAddr)];
}
@@ -733,7 +733,7 @@ static Class runLoopClass;
forMode: nil
all: YES];
#endif
- NSDebugMLLog(@"GSTcpHandle", @"invalidated 0x%x", self);
+ NSDebugMLLog(@"GSTcpHandle", @"invalidated %p", self);
[[self recvPort] removeHandle: self];
[[self sendPort] removeHandle: self];
#if defined(__MINGW__)
@@ -799,7 +799,7 @@ static Class runLoopClass;
{
if (res == 0)
{
- NSDebugMLLog(@"GSTcpHandle", @"read eof on 0x%x", self);
+ NSDebugMLLog(@"GSTcpHandle", @"read eof on %p", self);
[self invalidate];
return;
}
@@ -817,7 +817,7 @@ static Class runLoopClass;
}
res = 0; /* Interrupted - continue */
}
- NSDebugMLLog(@"GSTcpHandle", @"read %d bytes on 0x%x", res, self);
+ NSDebugMLLog(@"GSTcpHandle", @"read %d bytes on %p", res, self);
rLength += res;
while (valid == YES && rLength >= rWant)
@@ -942,7 +942,7 @@ static Class runLoopClass;
h = (GSPortMsgHeader*)bytes;
rId = GSSwapBigI32ToHost(h->mId);
nItems = GSSwapBigI32ToHost(h->nItems);
- NSAssert(nItems >0, NSInternalInconsistencyException);
+ NSAssert1(nItems >0, @"%@", NSInternalInconsistencyException);
rItems = [mutableArrayClass allocWithZone: NSDefaultMallocZone()];
rItems = [rItems initWithCapacity: nItems];
if (rWant > sizeof(GSPortMsgHeader))
@@ -1068,7 +1068,7 @@ static Class runLoopClass;
rId = 0;
DESTROY(rItems);
NSDebugMLLog(@"GSTcpHandle",
- @"got message %@ on 0x%x", pm, self);
+ @"got message %@ on %p", pm, self);
IF_NO_GC(RETAIN(rp);)
M_UNLOCK(myLock);
NS_DURING
@@ -1117,7 +1117,7 @@ static Class runLoopClass;
{
ASSIGN(defaultAddress, GSPrivateSockaddrHost(&sockAddr));
NSDebugMLLog(@"GSTcpHandle",
- @"wrote %d bytes on 0x%x", len, self);
+ @"wrote %d bytes on %p", len, self);
state = GS_H_CONNECTED;
}
else
@@ -1176,7 +1176,7 @@ static Class runLoopClass;
else
{
NSDebugMLLog(@"GSTcpHandle",
- @"wrote %d bytes on 0x%x", res, self);
+ @"wrote %d bytes on %p", res, self);
wLength += res;
if (wLength == l)
{
@@ -1201,7 +1201,7 @@ static Class runLoopClass;
* message completed - remove from list.
*/
NSDebugMLLog(@"GSTcpHandle",
- @"completed 0x%x on 0x%x", components, self);
+ @"completed %p on %p", components, self);
wData = nil;
wItem = 0;
[wMsgs removeObjectAtIndex: 0];
@@ -1334,9 +1334,9 @@ static Class runLoopClass;
NSRunLoop *l;
BOOL sent = NO;
- NSAssert([components count] > 0, NSInternalInconsistencyException);
+ NSAssert1([components count] > 0, @"%@", NSInternalInconsistencyException);
NSDebugMLLog(@"GSTcpHandle",
- @"Sending message 0x%x %@ on 0x%x(%d) before %@",
+ @"Sending message %p %@ on %p(%d) before %@",
components, components, self, desc, when);
M_LOCK(myLock);
[wMsgs addObject: components];
@@ -1430,7 +1430,7 @@ static Class runLoopClass;
}
M_UNLOCK(myLock);
NSDebugMLLog(@"GSTcpHandle",
- @"Message send 0x%x on 0x%x status %d", components, self, sent);
+ @"Message send %p on %p status %d", components, self, sent);
RELEASE(self);
return sent;
}
@@ -1786,7 +1786,7 @@ static Class tcpPortClass;
- (void) finalize
{
- NSDebugMLLog(@"NSPort", @"NSSocketPort 0x%x finalized", self);
+ NSDebugMLLog(@"NSPort", @"NSSocketPort %p finalized", self);
[self invalidate];
if (handles != 0)
{
@@ -2001,12 +2001,12 @@ static Class tcpPortClass;
if (d == nil)
{
- NSDebugMLLog(@"NSPort", @"No delegate to handle incoming message", 0);
+ NSDebugMLLog(@"NSPort", @"No delegate to handle incoming message");
return;
}
if ([d respondsToSelector: @selector(handlePortMessage:)] == NO)
{
- NSDebugMLLog(@"NSPort", @"delegate doesn't handle messages", 0);
+ NSDebugMLLog(@"NSPort", @"delegate doesn't handle messages");
return;
}
[d handlePortMessage: m];
@@ -2122,7 +2122,7 @@ static Class tcpPortClass;
#endif
GSTcpHandle *handle;
- NSDebugMLLog(@"NSPort", @"received %s event %p on 0x%x",
+ NSDebugMLLog(@"NSPort", @"received %s event %p on %p",
type == ET_RPORT ? "read" : "write", extra, self);
#if defined(__MINGW__)
diff --git a/Source/NSSortDescriptor.m b/Source/NSSortDescriptor.m
index 7d87f9e..be7db1b 100644
--- a/Source/NSSortDescriptor.m
+++ b/Source/NSSortDescriptor.m
@@ -132,7 +132,7 @@ static BOOL initialized = NO;
if (key == nil)
{
[NSException raise: NSInvalidArgumentException
- format: _(@"Passed nil key when initializing "
+ format: @"%@", _(@"Passed nil key when initializing "
@"an NSSortDescriptor.")];
}
if (selector == NULL)
diff --git a/Source/NSTask.m b/Source/NSTask.m
index b0f9370..6921b22 100644
--- a/Source/NSTask.m
+++ b/Source/NSTask.m
@@ -538,8 +538,8 @@ pty_slave(const char* name)
[NSException raise: NSInvalidArgumentException
format: @"NSTask - task has been launched"];
}
- NSAssert(hdl != nil && ([hdl isKindOfClass: [NSFileHandle class]] ||
- [hdl isKindOfClass: [NSPipe class]]), NSInvalidArgumentException);
+ NSAssert1(hdl != nil && ([hdl isKindOfClass: [NSFileHandle class]] ||
+ [hdl isKindOfClass: [NSPipe class]]), @"%@", NSInvalidArgumentException);
ASSIGN(_standardError, hdl);
}
@@ -560,8 +560,8 @@ pty_slave(const char* name)
[NSException raise: NSInvalidArgumentException
format: @"NSTask - task has been launched"];
}
- NSAssert(hdl != nil && ([hdl isKindOfClass: [NSFileHandle class]] ||
- [hdl isKindOfClass: [NSPipe class]]), NSInvalidArgumentException);
+ NSAssert1(hdl != nil && ([hdl isKindOfClass: [NSFileHandle class]] ||
+ [hdl isKindOfClass: [NSPipe class]]), @"%@", NSInvalidArgumentException);
ASSIGN(_standardInput, hdl);
}
@@ -582,8 +582,8 @@ pty_slave(const char* name)
[NSException raise: NSInvalidArgumentException
format: @"NSTask - task has been launched"];
}
- NSAssert(hdl != nil && ([hdl isKindOfClass: [NSFileHandle class]] ||
- [hdl isKindOfClass: [NSPipe class]]), NSInvalidArgumentException);
+ NSAssert1(hdl != nil && ([hdl isKindOfClass: [NSFileHandle class]] ||
+ [hdl isKindOfClass: [NSPipe class]]), @"%@", NSInvalidArgumentException);
ASSIGN(_standardOutput, hdl);
}
diff --git a/Source/NSThread.m b/Source/NSThread.m
index fdc34b9..05fed4c 100644
--- a/Source/NSThread.m
+++ b/Source/NSThread.m
@@ -735,7 +735,7 @@ unregisterActiveThread(NSThread *thread)
if (_active == NO)
{
[NSException raise: NSInternalInconsistencyException
- format: @"address@hidden@] called on inactive thread",
+ format: @"address@hidden@] called on inactive thread",
NSStringFromClass([self class]),
NSStringFromSelector(_cmd)];
}
@@ -821,21 +821,21 @@ static void *nsthreadLauncher(void* thread)
if (_active == YES)
{
[NSException raise: NSInternalInconsistencyException
- format: @"address@hidden@] called on active thread",
+ format: @"address@hidden@] called on active thread",
NSStringFromClass([self class]),
NSStringFromSelector(_cmd)];
}
if (_cancelled == YES)
{
[NSException raise: NSInternalInconsistencyException
- format: @"address@hidden@] called on cancelled thread",
+ format: @"address@hidden@] called on cancelled thread",
NSStringFromClass([self class]),
NSStringFromSelector(_cmd)];
}
if (_finished == YES)
{
[NSException raise: NSInternalInconsistencyException
- format: @"address@hidden@] called on finished thread",
+ format: @"address@hidden@] called on finished thread",
NSStringFromClass([self class]),
NSStringFromSelector(_cmd)];
}
diff --git a/Source/NSTimeZone.m b/Source/NSTimeZone.m
index c65eada..e3355ed 100644
--- a/Source/NSTimeZone.m
+++ b/Source/NSTimeZone.m
@@ -760,8 +760,8 @@ static NSMapTable *absolutes = 0;
* Should never happen now we round to the minute
* for MacOS-X compatibnility.
*/
- name = [[NSString alloc] initWithFormat: @"NSAbsoluteTimeZone:%d",
- anOffset];
+ name = [[NSString alloc] initWithFormat: @"NSAbsoluteTimeZone:%ld",
+ (long)anOffset];
}
}
else
@@ -1750,7 +1750,7 @@ LOCALDBKEY, LOCALDBKEY, _time_zone_path (ZONES_DIR, nil));
@"but abbreviations do not uniquely represent timezones, so this may\n"
@"not have found the timezone you were expecting. The timezone found\n"
@"was '%@' (currently UTC%c%02d%02d)\n\n",
-localZoneString, [zone name], sign, s/3600, (s/60)%60);
+localZoneString, [zone name], sign, (int)(s/3600), (int)((s/60)%60));
}
}
}
@@ -2288,10 +2288,10 @@ localZoneString, [zone name], sign, s/3600, (s/60)%60);
- (NSString*) description
{
- return [NSString stringWithFormat: @"%@(%@, %s%d)", [self name],
+ return [NSString stringWithFormat: @"%@(%@, %s%ld)", [self name],
[self timeZoneAbbreviation],
([self isDaylightSavingTimeZone]? "IS_DST, ": ""),
- [self timeZoneSecondsFromGMT]];
+ (long)[self timeZoneSecondsFromGMT]];
}
/**
diff --git a/Source/NSURLProtocol.m b/Source/NSURLProtocol.m
index bb02b04..2103306 100644
--- a/Source/NSURLProtocol.m
+++ b/Source/NSURLProtocol.m
@@ -135,7 +135,7 @@ static NSLock *pairLock = nil;
[self close];
return;
}
- NSAssert(ip != nil, NSGenericException);
+ NSAssert1(ip != nil, @"%@", NSGenericException);
if (ti > 120.0)
{
ASSIGN(expires, [NSDate dateWithTimeIntervalSinceNow: 120.0]);
diff --git a/Source/NSURLResponse.m b/Source/NSURLResponse.m
index 26c9e8a..64ee6e9 100644
--- a/Source/NSURLResponse.m
+++ b/Source/NSURLResponse.m
@@ -342,7 +342,7 @@ typedef struct {
+ (NSString *) localizedStringForStatusCode: (NSInteger)statusCode
{
// FIXME ... put real responses in here
- return [NSString stringWithFormat: @"%d", statusCode];
+ return [NSString stringWithFormat: @"%ld", (long)statusCode];
}
- (NSDictionary *) allHeaderFields
diff --git a/Source/NSUnarchiver.m b/Source/NSUnarchiver.m
index 84dcf22..0036cf9 100644
--- a/Source/NSUnarchiver.m
+++ b/Source/NSUnarchiver.m
@@ -587,8 +587,8 @@ static unsigned encodingVersion;
if (count != expected)
{
[NSException raise: NSInternalInconsistencyException
- format: @"expected array count %u and got %u",
- expected, count];
+ format: @"expected array count %lu and got %lu",
+ (unsigned long)expected, (unsigned long)count];
}
switch (*type)
diff --git a/Source/NSXMLDTD.m b/Source/NSXMLDTD.m
index 2b5653b..53a8b85 100644
--- a/Source/NSXMLDTD.m
+++ b/Source/NSXMLDTD.m
@@ -214,16 +214,16 @@ GS_PRIVATE_INTERNAL(NSXMLDTD)
NSUInteger childCount = [self childCount];
// Check to make sure this is a valid addition...
- NSAssert(nil != child, NSInvalidArgumentException);
- NSAssert(index <= childCount, NSInvalidArgumentException);
- NSAssert(nil == [child parent], NSInvalidArgumentException);
- NSAssert(NSXMLAttributeKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLDTDKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLDocumentKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLElementKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLInvalidKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLNamespaceKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLTextKind != theKind, NSInvalidArgumentException);
+ NSAssert1(nil != child, @"%@", NSInvalidArgumentException);
+ NSAssert1(index <= childCount, @"%@", NSInvalidArgumentException);
+ NSAssert1(nil == [child parent], @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLAttributeKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLDTDKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLDocumentKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLElementKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLInvalidKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLNamespaceKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLTextKind != theKind, @"%@", NSInvalidArgumentException);
[self _insertChild: child atIndex: index];
}
diff --git a/Source/NSXMLDocument.m b/Source/NSXMLDocument.m
index 8b1edd2..ed705db 100644
--- a/Source/NSXMLDocument.m
+++ b/Source/NSXMLDocument.m
@@ -238,7 +238,7 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
{
NSXMLDTD *old;
- NSAssert(documentTypeDeclaration != nil, NSInvalidArgumentException);
+ NSAssert1(documentTypeDeclaration != nil, @"%@", NSInvalidArgumentException);
// detach the old DTD, this also removes the corresponding child
old = [self DTD];
@@ -342,17 +342,17 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
NSUInteger childCount = [self childCount];
// Check to make sure this is a valid addition...
- NSAssert(nil != child, NSInvalidArgumentException);
- NSAssert(index <= childCount, NSInvalidArgumentException);
- NSAssert(nil == [child parent], NSInvalidArgumentException);
- NSAssert(NSXMLAttributeKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLDTDKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLDocumentKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLElementDeclarationKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLEntityDeclarationKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLInvalidKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLNamespaceKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLNotationDeclarationKind != theKind, NSInvalidArgumentException);
+ NSAssert1(nil != child, @"%@", NSInvalidArgumentException);
+ NSAssert1(index <= childCount, @"%@", NSInvalidArgumentException);
+ NSAssert1(nil == [child parent], @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLAttributeKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLDTDKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLDocumentKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLElementDeclarationKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLEntityDeclarationKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLInvalidKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLNamespaceKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLNotationDeclarationKind != theKind, @"%@", NSInvalidArgumentException);
[self _insertChild: child atIndex: index];
}
diff --git a/Source/NSXMLElement.m b/Source/NSXMLElement.m
index edf84b0..76deb99 100644
--- a/Source/NSXMLElement.m
+++ b/Source/NSXMLElement.m
@@ -646,17 +646,17 @@ extern void ensure_oldNs(xmlNodePtr node);
NSUInteger childCount = [self childCount];
// Check to make sure this is a valid addition...
- NSAssert(nil != child, NSInvalidArgumentException);
- NSAssert(index <= childCount, NSInvalidArgumentException);
- NSAssert(nil == [child parent], NSInvalidArgumentException);
- NSAssert(NSXMLAttributeKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLDTDKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLDocumentKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLElementDeclarationKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLEntityDeclarationKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLInvalidKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLNamespaceKind != theKind, NSInvalidArgumentException);
- NSAssert(NSXMLNotationDeclarationKind != theKind, NSInvalidArgumentException);
+ NSAssert1(nil != child, @"%@", NSInvalidArgumentException);
+ NSAssert1(index <= childCount, @"%@", NSInvalidArgumentException);
+ NSAssert1(nil == [child parent], @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLAttributeKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLDTDKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLDocumentKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLElementDeclarationKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLEntityDeclarationKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLInvalidKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLNamespaceKind != theKind, @"%@", NSInvalidArgumentException);
+ NSAssert1(NSXMLNotationDeclarationKind != theKind, @"%@", NSInvalidArgumentException);
[self _insertChild: child atIndex: index];
}
diff --git a/Source/NSXMLParser.m b/Source/NSXMLParser.m
index bbac548..dce23b5 100644
--- a/Source/NSXMLParser.m
+++ b/Source/NSXMLParser.m
@@ -1395,7 +1395,7 @@ NSLog(@"_processTag ", flag?@"/": @"", tag, attributes);
// hh; hex value
if (result != 0)
{
- *result = [[NSString alloc] initWithFormat: @"%C", val];
+ *result = [[NSString alloc] initWithFormat: @"%C", (unichar)val];
}
return YES;
}
@@ -1404,7 +1404,7 @@ NSLog(@"_processTag ", flag?@"/": @"", tag, attributes);
// &ddd; decimal value
if (result != 0)
{
- *result = [[NSString alloc] initWithFormat: @"%C", val];
+ *result = [[NSString alloc] initWithFormat: @"%C", (unichar)val];
}
return YES;
}
diff --git a/Source/unix/GSRunLoopCtxt.m b/Source/unix/GSRunLoopCtxt.m
index ac24293..ee2df1b 100644
--- a/Source/unix/GSRunLoopCtxt.m
+++ b/Source/unix/GSRunLoopCtxt.m
@@ -393,7 +393,7 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
[port getFds: port_fd_array count: &port_fd_count];
}
NSDebugMLLog(@"NSRunLoop",
- @"listening to %d port handles\n", port_fd_count);
+ @"listening to %ld port handles\n", (long)port_fd_count);
while (port_fd_count--)
{
fd = port_fd_array[port_fd_count];
diff --git a/Tools/AGSParser.m b/Tools/AGSParser.m
index ce9b9b8..0e5c0d6 100644
--- a/Tools/AGSParser.m
+++ b/Tools/AGSParser.m
@@ -78,7 +78,7 @@
if (createSec)
{
secHeading = [NSString stringWithFormat:
- @"\n\n", toolName];
+ @"\n%@\n", toolName];
//The %@ tool
[m replaceCharactersInRange: r withString: secHeading];
}
@@ -264,7 +264,7 @@ in the returned dictionary. */
BOOL wasInArgList = inArgList;
NSMutableArray *a = nil;
- NSAssert([d objectForKey: @"Args"] == nil, NSInternalInconsistencyException);
+ NSAssert1([d objectForKey: @"Args"] == nil, @"%@", NSInternalInconsistencyException);
a = [[NSMutableArray alloc] initWithCapacity: 4];
[d setObject: a forKey: @"Args"];
RELEASE(a);
diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m
index 5eeacc8..af53619 100644
--- a/Tools/autogsdoc.m
+++ b/Tools/autogsdoc.m
@@ -842,15 +842,13 @@ main(int argc, char **argv, char **env)
NSArray *args = [argsRecognized allKeys];
GSPrintf(stderr, @"Usage:\n");
- GSPrintf(stderr, [NSString stringWithFormat:
- @" %@ [options] [files]\n", [argsGiven objectAtIndex: 0]]);
+ GSPrintf(stderr, @" %@ [options] [files]\n", [argsGiven objectAtIndex: 0]);
GSPrintf(stderr, @"\n Options:\n");
for (i = 0; i < [args count]; i++)
{
arg = [args objectAtIndex: i];
- GSPrintf(stderr,
- [NSString stringWithFormat: @" address@hidden@\n\n",
- arg, [argsRecognized objectForKey: arg]]);
+ GSPrintf(stderr, @" address@hidden@\n\n",
+ arg, [argsRecognized objectForKey: arg]);
}
GSPrintf(stderr, @"\n Files:\n");
diff --git a/Tools/sfparse.m b/Tools/sfparse.m
index c7505fe..f3eedff 100644
--- a/Tools/sfparse.m
+++ b/Tools/sfparse.m
@@ -162,8 +162,8 @@ main(int argc, char** argv, char **env)
if (result == nil)
GSPrintf(stderr, @"Parsing '%@' - nil property list\n", file);
else if ([result isKindOfClass: [NSDictionary class]] == YES)
- GSPrintf(stderr, @"Parsing '%@' - seems ok (%d entries)\n",
- file, [result count]);
+ GSPrintf(stderr, @"Parsing '%@' - seems ok (%lu entries)\n",
+ file, (unsigned long)[result count]);
else
GSPrintf(stderr, @"Parsing '%@' - unexpected class - address@hidden",
file, [[result class] description]);