From 525ac8a372aca987db47ba1ed8e9dc53067064cc Mon Sep 17 00:00:00 2001 From: Stefan Reitshamer Date: Mon, 5 Nov 2012 05:34:12 -0500 Subject: [PATCH] Updated SDK to 'latest' (10.8). Fixed incorrect printf specifiers for 64-bit. --- ArqPackSet.m | 4 ++-- FileAttributes.m | 2 +- arq_restore.xcodeproj/project.pbxproj | 8 ++++---- http/CFHTTPConnection.m | 5 +++-- http/HTTPConnectionFactory.m | 12 ------------ http/URLConnection.m | 6 +++--- io/BufferedInputStream.m | 6 +++--- io/ChunkedInputStream.m | 2 +- io/CryptInputStream.m | 4 ++-- io/DataInputStreamFactory.m | 2 +- io/StringIO.m | 2 +- plist/ArrayNode.m | 2 +- plist/BooleanNode.m | 2 +- plist/DictNode.m | 2 +- plist/IntegerNode.m | 2 +- plist/RealNode.m | 2 +- plist/StringNode.m | 2 +- s3/S3Request.m | 2 +- shared/FileACL.m | 2 +- shared/NSError_extra.m | 2 +- shared/NSString_extra.m | 2 +- shared/RegexKitLite.m | 2 +- 22 files changed, 32 insertions(+), 43 deletions(-) diff --git a/ArqPackSet.m b/ArqPackSet.m index b1b718b..7458200 100644 --- a/ArqPackSet.m +++ b/ArqPackSet.m @@ -81,7 +81,7 @@ [myError autorelease]; if (sb == nil) { if ([myError isErrorWithDomain:[ArqPackSet errorDomain] code:ERROR_PACK_INDEX_ENTRY_NOT_RESOLVABLE]) { - SETNSERROR([ArqPackSet errorDomain], ERROR_NOT_FOUND, @"failed %u times to load blob for sha1 %@ from pack set %@", i, sha1, packSetName); + SETNSERROR([ArqPackSet errorDomain], ERROR_NOT_FOUND, @"failed %lu times to load blob for sha1 %@ from pack set %@", i, sha1, packSetName); } else if (error != NULL) { *error = myError; } @@ -195,7 +195,7 @@ if (pies == nil) { break; } - HSLogTrace(@"found %u entries in s3 pack sha1 %@ packset %@ computer %@ s3bucket %@", [pies count], packSHA1, packSetName, computerUUID, s3BucketName); + HSLogTrace(@"found %lu entries in s3 pack sha1 %@ packset %@ computer %@ s3bucket %@", [pies count], packSHA1, packSetName, computerUUID, s3BucketName); for (PackIndexEntry *pie in pies) { [entries setObject:pie forKey:[pie objectSHA1]]; } diff --git a/FileAttributes.m b/FileAttributes.m index 81427a2..9cc5955 100644 --- a/FileAttributes.m +++ b/FileAttributes.m @@ -128,7 +128,7 @@ static OSStatus SymlinkPathMakeRef(const UInt8 *path, FSRef *ref, Boolean *isDir CFTimeInterval theCreateTime; // double: seconds since reference date if (UCConvertUTCDateTimeToCFAbsoluteTime(&catalogInfo.createDate, &theCreateTime) != noErr) { - HSLogError(@"error converting create time %f to CFAbsoluteTime", catalogInfo.createDate); + HSLogError(@"error converting create time to CFAbsoluteTime"); } else { createTime.tv_sec = (int64_t)(theCreateTime + NSTimeIntervalSince1970); CFTimeInterval subsecond = theCreateTime - (double)((int64_t)theCreateTime); diff --git a/arq_restore.xcodeproj/project.pbxproj b/arq_restore.xcodeproj/project.pbxproj index 6da9438..dbd67ce 100644 --- a/arq_restore.xcodeproj/project.pbxproj +++ b/arq_restore.xcodeproj/project.pbxproj @@ -1215,7 +1215,7 @@ HEADER_SEARCH_PATHS = ""; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = arq_restore; - SDKROOT = macosx10.6; + SDKROOT = macosx; }; name = Debug; }; @@ -1237,7 +1237,7 @@ HEADER_SEARCH_PATHS = ""; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = arq_restore; - SDKROOT = macosx10.6; + SDKROOT = macosx; }; name = Release; }; @@ -1280,7 +1280,7 @@ HEADER_SEARCH_PATHS = ""; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = arq_verify; - SDKROOT = macosx10.6; + SDKROOT = macosx; }; name = Debug; }; @@ -1297,7 +1297,7 @@ HEADER_SEARCH_PATHS = ""; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = arq_verify; - SDKROOT = macosx10.6; + SDKROOT = macosx; }; name = Release; }; diff --git a/http/CFHTTPConnection.m b/http/CFHTTPConnection.m index b62c07b..6e74185 100644 --- a/http/CFHTTPConnection.m +++ b/http/CFHTTPConnection.m @@ -464,7 +464,8 @@ static void ReadStreamClientCallback(CFReadStreamRef readStream, CFStreamEventTy if (transferEncoding != nil && ![transferEncoding isEqualToString:@"Identity"]) { if ([[transferEncoding lowercaseString] isEqualToString:@"chunked"]) { HSLogTrace(@"%@: chunked response body", self); - ret = [[ChunkedInputStream alloc] initWithUnderlyingStream:self]; + BufferedInputStream *bis = [[BufferedInputStream alloc] initWithUnderlyingStream:self]; + ret = [[ChunkedInputStream alloc] initWithUnderlyingStream:bis]; } else { SETNSERROR(@"StreamErrorDomain", -1, @"unknown Transfer-Encoding '%@'", transferEncoding); return nil; @@ -516,7 +517,7 @@ static void ReadStreamClientCallback(CFReadStreamRef readStream, CFStreamEventTy return 0; } recvd = [readStream read:buf maxLength:length]; - HSLogTrace(@"received %d bytes", recvd); + HSLogTrace(@"received %ld bytes", recvd); if (recvd < 0) { [self handleStreamError]; if (error != NULL) { diff --git a/http/HTTPConnectionFactory.m b/http/HTTPConnectionFactory.m index 23eed93..68facae 100644 --- a/http/HTTPConnectionFactory.m +++ b/http/HTTPConnectionFactory.m @@ -94,18 +94,6 @@ static HTTPConnectionFactory *theFactory = nil; - (id)copyWithZone:(NSZone *)zone { return self; } -- (id)retain { - return self; -} -- (NSUInteger)retainCount { - return NSUIntegerMax; //denotes an object that cannot be released -} -- (void)release { - //do nothing -} -- (id)autorelease { - return self; -} - (id)init { if (self = [super init]) { diff --git a/http/URLConnection.m b/http/URLConnection.m index 122ff4e..9d57ab4 100644 --- a/http/URLConnection.m +++ b/http/URLConnection.m @@ -194,7 +194,7 @@ static NSString *RUN_LOOP_MODE = @"HTTPConnectionRunLoopMode"; receivedData = nil; offset = 0; } - HSLogTrace(@"received %d bytes", recvd); + HSLogTrace(@"received %ld bytes", recvd); return recvd; } @@ -236,7 +236,7 @@ static NSString *RUN_LOOP_MODE = @"HTTPConnectionRunLoopMode"; } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { NSAssert(receivedData == nil, @"must not discard unread bytes"); - HSLogTrace(@"received %u bytes", [data length]); + HSLogTrace(@"received %lu bytes", [data length]); [receivedData release]; receivedData = [data retain]; offset = 0; @@ -248,7 +248,7 @@ static NSString *RUN_LOOP_MODE = @"HTTPConnectionRunLoopMode"; } } - (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite { - HSLogTrace(@"%@: sent so far %u of %u", self, totalBytesWritten, totalBytesExpectedToWrite); + HSLogTrace(@"%@: sent so far %lu of %lu", self, totalBytesWritten, totalBytesExpectedToWrite); } - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse { return cachedResponse; diff --git a/io/BufferedInputStream.m b/io/BufferedInputStream.m index 7cf1eb4..74b24bc 100644 --- a/io/BufferedInputStream.m +++ b/io/BufferedInputStream.m @@ -66,7 +66,7 @@ } - (BOOL)readExactly:(NSUInteger)exactLength into:(unsigned char *)outBuf error:(NSError **)error { if (exactLength > 2147483648) { - SETNSERROR(@"InputStreamErrorDomain", -1, @"absurd length %u requested", exactLength); + SETNSERROR(@"InputStreamErrorDomain", -1, @"absurd length %lu requested", exactLength); return NO; } NSUInteger received = 0; @@ -76,7 +76,7 @@ return NO; } if (ret == 0) { - SETNSERROR([BufferedInputStream errorDomain], ERROR_EOF, @"%@ EOF after %u of %u bytes received", self, received, exactLength); + SETNSERROR([BufferedInputStream errorDomain], ERROR_EOF, @"%@ EOF after %lu of %lu bytes received", self, received, exactLength); return NO; } received += ret; @@ -88,7 +88,7 @@ NSUInteger received = 0; for (;;) { if (received > maxLength) { - SETNSERROR(@"InputStreamErrorDomain", -1, @"exceeded maxLength %u before finding CRLF", maxLength); + SETNSERROR(@"InputStreamErrorDomain", -1, @"exceeded maxLength %lu before finding CRLF", maxLength); free(lineBuf); return nil; } diff --git a/io/ChunkedInputStream.m b/io/ChunkedInputStream.m index 9d00693..77ca478 100644 --- a/io/ChunkedInputStream.m +++ b/io/ChunkedInputStream.m @@ -65,7 +65,7 @@ return -1; } chunkLength = (NSUInteger)scanned; - HSLogTrace(@"chunk length = %u", chunkLength); + HSLogTrace(@"chunk length = %lu", chunkLength); } if (chunkLength == 0) { SETNSERROR(@"StreamsErrorDomain", ERROR_EOF, @"EOF (zero chunk length)"); diff --git a/io/CryptInputStream.m b/io/CryptInputStream.m index d9db1eb..8ad21eb 100644 --- a/io/CryptInputStream.m +++ b/io/CryptInputStream.m @@ -145,7 +145,7 @@ SETNSERROR([Encryption errorDomain], -1, @"%@ error: %@", label, [OpenSSL errorMessage]); return NO; } - HSLogTrace(@"%@ final: outBufLen = %d", label, (NSInteger)outBufLen); + HSLogTrace(@"%@ final: outBufLen = %ld", label, (NSInteger)outBufLen); outBufLen = (NSInteger)theBufLen; } else { int theBufLen = 0; @@ -153,7 +153,7 @@ SETNSERROR([Encryption errorDomain], -1, @"%@ error: %@", label, [OpenSSL errorMessage]); return NO; } - HSLogTrace(@"%@ update: inBufLen = %d, outBufLen = %d", label, recvd, (NSInteger)outBufLen); + HSLogTrace(@"%@ update: inBufLen = %ld, outBufLen = %ld", label, recvd, (NSInteger)outBufLen); outBufLen = (NSInteger)theBufLen; } return YES; diff --git a/io/DataInputStreamFactory.m b/io/DataInputStreamFactory.m index 04532a1..26ecc08 100644 --- a/io/DataInputStreamFactory.m +++ b/io/DataInputStreamFactory.m @@ -57,6 +57,6 @@ #pragma mark NSObject - (NSString *)description { - return [NSString stringWithFormat:@"", [data length], dataDescription]; + return [NSString stringWithFormat:@"", [data length], dataDescription]; } @end diff --git a/io/StringIO.m b/io/StringIO.m index b45d94d..6fe51a9 100644 --- a/io/StringIO.m +++ b/io/StringIO.m @@ -79,7 +79,7 @@ return NO; } if (len > 2147483648) { - SETNSERROR(@"InputStreamErrorDomain", -1, @"absurd string length %u in [StringIO newString:]", len); + SETNSERROR(@"InputStreamErrorDomain", -1, @"absurd string length %llu in [StringIO newString:]", len); return NO; } unsigned char *buf = (unsigned char *)malloc(len); diff --git a/plist/ArrayNode.m b/plist/ArrayNode.m index e87f7ef..5bbe4ee 100644 --- a/plist/ArrayNode.m +++ b/plist/ArrayNode.m @@ -136,7 +136,7 @@ return result; } - (NSString *)description { - return [NSString stringWithFormat:@"", self, [list description]]; + return [NSString stringWithFormat:@"", [list description]]; } @end diff --git a/plist/BooleanNode.m b/plist/BooleanNode.m index 76ae5f1..8b5c5d9 100644 --- a/plist/BooleanNode.m +++ b/plist/BooleanNode.m @@ -79,6 +79,6 @@ return result; } - (NSString *)description { - return [NSString stringWithFormat:@"", self, (value ? @"YES" : @"NO")]; + return [NSString stringWithFormat:@"", (value ? @"YES" : @"NO")]; } @end diff --git a/plist/DictNode.m b/plist/DictNode.m index 3df7931..aeecf80 100644 --- a/plist/DictNode.m +++ b/plist/DictNode.m @@ -284,7 +284,7 @@ return result; } - (NSString *)description { - return [NSString stringWithFormat:@"", self, [dict description]]; + return [NSString stringWithFormat:@"", [dict description]]; } @end diff --git a/plist/IntegerNode.m b/plist/IntegerNode.m index a49162c..cdac5fb 100644 --- a/plist/IntegerNode.m +++ b/plist/IntegerNode.m @@ -101,7 +101,7 @@ return result; } - (NSString *)description { - return [NSString stringWithFormat:@"", self, value]; + return [NSString stringWithFormat:@"", value]; } @end diff --git a/plist/RealNode.m b/plist/RealNode.m index d0d7669..593608f 100644 --- a/plist/RealNode.m +++ b/plist/RealNode.m @@ -90,6 +90,6 @@ return result; } - (NSString *)description { - return [NSString stringWithFormat:@"", self, value]; + return [NSString stringWithFormat:@"", value]; } @end diff --git a/plist/StringNode.m b/plist/StringNode.m index 3bbcc33..dcf6b48 100644 --- a/plist/StringNode.m +++ b/plist/StringNode.m @@ -83,6 +83,6 @@ return result; } - (NSString *)description { - return [NSString stringWithFormat:@"", self, value]; + return [NSString stringWithFormat:@"", value]; } @end diff --git a/s3/S3Request.m b/s3/S3Request.m index 0079637..9c7a6d2 100644 --- a/s3/S3Request.m +++ b/s3/S3Request.m @@ -246,7 +246,7 @@ int code = [conn responseCode]; if (code >= 200 && code <= 299) { ret = [[ServerBlob alloc] initWithData:response mimeType:[conn responseContentType] downloadName:[conn responseDownloadName]]; - HSLogDebug(@"HTTP %d; returning response length=%d", code, [response length]); + HSLogDebug(@"HTTP %d; returning response length=%ld", code, [response length]); return ret; } diff --git a/shared/FileACL.m b/shared/FileACL.m index 74626ed..319b85e 100644 --- a/shared/FileACL.m +++ b/shared/FileACL.m @@ -54,7 +54,7 @@ acl_free(acl); int errnum = errno; HSLogError(@"acl_to_text from %@ error %d: %s", path, errnum, strerror(errnum)); - SETNSERROR(@"UnixErrorDomain", errnum, @"failed to convert ACL of @% to text: %s", path, strerror(errnum)); + SETNSERROR(@"UnixErrorDomain", errnum, @"failed to convert ACL of %@ to text: %s", path, strerror(errnum)); return NO; } *aclText = [NSString stringWithUTF8String:aclTextChars]; diff --git a/shared/NSError_extra.m b/shared/NSError_extra.m index 75bd18e..0353e37 100644 --- a/shared/NSError_extra.m +++ b/shared/NSError_extra.m @@ -124,7 +124,7 @@ if (SecCertificateCopyPublicKey(secCert, &key) == 0 && key != NULL) { CSSM_CSP_HANDLE cspHandle; if (SecKeyGetCSPHandle(key, &cspHandle) == 0) { - HSLog(@"SSL cert CSP handle: %d", (long)cspHandle); + HSLog(@"SSL cert CSP handle: %ld", (long)cspHandle); } else { HSLog(@"error getting SSL cert's key's CSP handle"); } diff --git a/shared/NSString_extra.m b/shared/NSString_extra.m index 7e338ac..31d8960 100644 --- a/shared/NSString_extra.m +++ b/shared/NSString_extra.m @@ -131,7 +131,7 @@ static unsigned char hexCharToInt(char c1) { NSUInteger index = 2; NSString *path = [NSString stringWithString:self]; while ([fm fileExistsAtPath:path]) { - path = [NSString stringWithFormat:@"%@_%u%@", left, index++, right]; + path = [NSString stringWithFormat:@"%@_%lu%@", left, index++, right]; } return path; } diff --git a/shared/RegexKitLite.m b/shared/RegexKitLite.m index b4a3ef9..7d57b89 100644 --- a/shared/RegexKitLite.m +++ b/shared/RegexKitLite.m @@ -501,7 +501,7 @@ static id performRegexOp(id self, SEL _cmd, RKLRegexOp doRegexOp, NSString *rege if((status > 0) && (exception == NULL)) { exception = RKLNSExceptionForRegex(regexString, options, NULL, status); } // If we had a problem, throw an exception. if(exception != NULL) { if([exception isKindOfClass:[NSException class]]) { [[NSException exceptionWithName:[exception name] reason:RKLStringFromClassAndMethod(self, _cmd, [exception reason]) userInfo:[exception userInfo]] raise]; } - else { [[NSAssertionHandler currentHandler] handleFailureInFunction:[exception objectForKey:@"function"] file:[exception objectForKey:@"file"] lineNumber:[[exception objectForKey:@"line"] longValue] description:[exception objectForKey:@"description"]]; } + else { [[NSAssertionHandler currentHandler] handleFailureInFunction:[exception objectForKey:@"function"] file:[exception objectForKey:@"file"] lineNumber:[[exception objectForKey:@"line"] longValue] description:@"%@", [exception objectForKey:@"description"]]; } } if(replaceMutable == YES) { // We're working on a mutable string and if there were successfull matches with replaced text we still have work to do. Done outside the cache lock. if(*((NSUInteger *)result) > 0) { NSCParameterAssert(resultObject != NULL); [matchString replaceCharactersInRange:searchRange withString:resultObject]; }