Cast NSInteger to long.

Per Apple's Platform Dependencies in String Programming Guide, casting NSInteger to long before using %lu.

https://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265-SW5
This commit is contained in:
Steven Fisher 2012-07-23 11:05:58 -07:00
parent 76c5b8e4de
commit 69da97c5a8
2 changed files with 3 additions and 3 deletions

View file

@ -722,7 +722,7 @@ static inline NSString * AFMultipartFormFinalBoundary() {
self.request = request;
self.stringEncoding = encoding;
self.temporaryFilePath = [AFMultipartTemporaryFileDirectoryPath() stringByAppendingPathComponent:[NSString stringWithFormat:@"%lu", [[self.request URL] hash]]];
self.temporaryFilePath = [AFMultipartTemporaryFileDirectoryPath() stringByAppendingPathComponent:[NSString stringWithFormat:@"%lu", (long)[[self.request URL] hash]]];
self.outputStream = [NSOutputStream outputStreamToFileAtPath:self.temporaryFilePath append:NO];
NSRunLoop *runLoop = [NSRunLoop currentRunLoop];

View file

@ -77,11 +77,11 @@ static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) {
}
if (range.length == 1) {
[string appendFormat:@"%lu", range.location];
[string appendFormat:@"%lu", (long)range.location];
} else {
NSUInteger firstIndex = range.location;
NSUInteger lastIndex = firstIndex + range.length - 1;
[string appendFormat:@"%lu-%lu", firstIndex, lastIndex];
[string appendFormat:@"%lu-%lu", (long)firstIndex, (long)lastIndex];
}
range.location = nextIndex;