From 38b688c89524c55dae77aae4786a28efe8a5c60a Mon Sep 17 00:00:00 2001 From: slembcke Date: Wed, 22 Oct 2014 13:31:11 -0500 Subject: [PATCH] Cleaning up warnings. --- CCRendererGLSupport.m | 4 ++-- UnitTests/CCPackageDownloadTests.m | 4 ++-- cocos2d-tests.xcodeproj/project.pbxproj | 14 +++++++------- cocos2d-ui-tests/tests/CCPackageTest.m | 4 ++-- cocos2d.xcodeproj/project.pbxproj | 10 ++-------- cocos2d/CCPackageDownload.m | 6 +++--- 6 files changed, 18 insertions(+), 24 deletions(-) diff --git a/CCRendererGLSupport.m b/CCRendererGLSupport.m index 2c8ab85d407..13f62e27959 100644 --- a/CCRendererGLSupport.m +++ b/CCRendererGLSupport.m @@ -288,8 +288,8 @@ -(instancetype)initWithTexture:(CCTexture *)texture depthStencilFormat:(GLuint)d // associate texture with FBO glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture.name, 0); - GLuint width = texture.pixelWidth; - GLuint height = texture.pixelHeight; + GLuint width = (GLuint)texture.pixelWidth; + GLuint height = (GLuint)texture.pixelHeight; #if __CC_PLATFORM_ANDROID diff --git a/UnitTests/CCPackageDownloadTests.m b/UnitTests/CCPackageDownloadTests.m index 83c7192bcd5..f2e3b6c6d2d 100644 --- a/UnitTests/CCPackageDownloadTests.m +++ b/UnitTests/CCPackageDownloadTests.m @@ -75,7 +75,7 @@ - (void)startLoading { byteRangeStart = [self parseRangeHeaderValue:self.request.allHTTPHeaderFields[@"Range"]]; headers[@"Accept-Ranges"] = @"bytes"; - headers[@"Content-Range"] = [NSString stringWithFormat:@"bytes %u-%u/%u", byteRangeStart, fileSize - 1, fileSize]; + headers[@"Content-Range"] = [NSString stringWithFormat:@"bytes %u-%u/%u", (unsigned int)byteRangeStart, (unsigned int)fileSize - 1, (unsigned int)fileSize]; } NSData *data = [[NSData dataWithContentsOfFile:pathToPackage] subdataWithRange:NSMakeRange(byteRangeStart, fileSize - byteRangeStart)]; @@ -85,7 +85,7 @@ - (void)startLoading NSHTTPURLResponse *response; if (pathToPackage) { - headers[@"Content-Length"] = [NSString stringWithFormat:@"%u", [data length]]; + headers[@"Content-Length"] = [NSString stringWithFormat:@"%u", (unsigned int)[data length]]; response = [[NSHTTPURLResponse alloc] initWithURL:self.request.URL statusCode:200 HTTPVersion:@"HTTP/1.1" diff --git a/cocos2d-tests.xcodeproj/project.pbxproj b/cocos2d-tests.xcodeproj/project.pbxproj index ab377dd1ea1..326a278ce6e 100644 --- a/cocos2d-tests.xcodeproj/project.pbxproj +++ b/cocos2d-tests.xcodeproj/project.pbxproj @@ -47,7 +47,6 @@ B7E2605817E7D278007067F0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B7E2605717E7D278007067F0 /* Foundation.framework */; }; B7E2605A17E7D278007067F0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B7E2605917E7D278007067F0 /* CoreGraphics.framework */; }; B7E2605C17E7D278007067F0 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B7E2605B17E7D278007067F0 /* CoreText.framework */; }; - B7E2605E17E7D278007067F0 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B7E2605D17E7D278007067F0 /* GameKit.framework */; }; B7E2620017E7D321007067F0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B7E261FF17E7D321007067F0 /* AppDelegate.m */; }; B7E2620E17E7D34D007067F0 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B7E2620217E7D34D007067F0 /* Default-568h@2x.png */; }; B7E2620F17E7D34D007067F0 /* Default-Landscape~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = B7E2620317E7D34D007067F0 /* Default-Landscape~ipad.png */; }; @@ -150,7 +149,6 @@ D3763C0419E73188006C050D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B7E2605717E7D278007067F0 /* Foundation.framework */; }; D3763C0519E73188006C050D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B7E2605917E7D278007067F0 /* CoreGraphics.framework */; }; D3763C0619E73188006C050D /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B7E2605B17E7D278007067F0 /* CoreText.framework */; }; - D3763C0719E73188006C050D /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B7E2605D17E7D278007067F0 /* GameKit.framework */; }; D3763D3819E734C5006C050D /* MainMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = B7E2622017E7D3B2007067F0 /* MainMenu.m */; }; D3763D3919E734C5006C050D /* TestBase.m in Sources */ = {isa = PBXBuildFile; fileRef = B71B087B17EA5B490082EBC0 /* TestBase.m */; }; D3763D3A19E734C5006C050D /* CCCacheTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E28FE19197FCE4500F78989 /* CCCacheTest.m */; }; @@ -360,7 +358,6 @@ B7E2605717E7D278007067F0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; B7E2605917E7D278007067F0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; B7E2605B17E7D278007067F0 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; }; - B7E2605D17E7D278007067F0 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; B7E261FE17E7D321007067F0 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = "cocos2d-ui-tests/ios/AppDelegate.h"; sourceTree = SOURCE_ROOT; }; B7E261FF17E7D321007067F0 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = "cocos2d-ui-tests/ios/AppDelegate.m"; sourceTree = SOURCE_ROOT; }; B7E2620217E7D34D007067F0 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; @@ -513,7 +510,6 @@ B7E2605817E7D278007067F0 /* Foundation.framework in Frameworks */, B7E2605A17E7D278007067F0 /* CoreGraphics.framework in Frameworks */, B7E2605C17E7D278007067F0 /* CoreText.framework in Frameworks */, - B7E2605E17E7D278007067F0 /* GameKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -532,7 +528,6 @@ D3763C0419E73188006C050D /* Foundation.framework in Frameworks */, D3763C0519E73188006C050D /* CoreGraphics.framework in Frameworks */, D3763C0619E73188006C050D /* CoreText.framework in Frameworks */, - D3763C0719E73188006C050D /* GameKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -665,7 +660,6 @@ B7E2605717E7D278007067F0 /* Foundation.framework */, B7E2605917E7D278007067F0 /* CoreGraphics.framework */, B7E2605B17E7D278007067F0 /* CoreText.framework */, - B7E2605D17E7D278007067F0 /* GameKit.framework */, 75556A03185636F100ED1B0F /* XCTest.framework */, ); name = Frameworks; @@ -947,6 +941,11 @@ }; B7E2604717E7D278007067F0 = { DevelopmentTeam = 96LKF67VJA; + SystemCapabilities = { + com.apple.GameCenter = { + enabled = 0; + }; + }; }; }; }; @@ -1573,9 +1572,10 @@ CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; + COPY_PHASE_STRIP = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "cocos2d-ui-tests/ios/Prefix.pch"; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; INFOPLIST_FILE = "cocos2d-ui-tests/ios/Resources/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; MTL_HEADER_SEARCH_PATHS = "/Users/slembcke/Development/cocos2d-iphone/cocos2d"; diff --git a/cocos2d-ui-tests/tests/CCPackageTest.m b/cocos2d-ui-tests/tests/CCPackageTest.m index d77c49e2c87..3159f423bf7 100644 --- a/cocos2d-ui-tests/tests/CCPackageTest.m +++ b/cocos2d-ui-tests/tests/CCPackageTest.m @@ -189,12 +189,12 @@ - (void)packageUnzippingFailed:(CCPackage *)package error:(NSError *)error - (void)packageDownloadProgress:(CCPackage *)package downloadedBytes:(NSUInteger)downloadedBytes totalBytes:(NSUInteger)totalBytes { - NSLog(@"downloading... %u / %u", downloadedBytes, totalBytes); + NSLog(@"downloading... %u / %u", (unsigned int)downloadedBytes, (unsigned int)totalBytes); } - (void)packageUnzippingProgress:(CCPackage *)package unzippedBytes:(NSUInteger)unzippedBytes totalBytes:(NSUInteger)totalBytes { - NSLog(@"unzipping... %u / %u", unzippedBytes, totalBytes); + NSLog(@"unzipping... %u / %u", (unsigned int)unzippedBytes, (unsigned int)totalBytes); } @end diff --git a/cocos2d.xcodeproj/project.pbxproj b/cocos2d.xcodeproj/project.pbxproj index fc152bd2204..784cba0764e 100644 --- a/cocos2d.xcodeproj/project.pbxproj +++ b/cocos2d.xcodeproj/project.pbxproj @@ -1938,7 +1938,6 @@ isa = PBXGroup; children = ( 83409E3219D5B791004B7EB9 /* SSZipArchiveExampleApp.app */, - 83409E3419D5B791004B7EB9 /* SSZipArchiveTests.xctest */, 83409E3619D5B791004B7EB9 /* libSSZipArchive.a */, 7A40378319E36EFF007B6E8F /* libSSZipArchiveAndroid.a */, 7A59498219E38C8300F65F90 /* libSSZipArchiveMac.a */, @@ -2978,13 +2977,6 @@ remoteRef = 7A40377A19E36EFF007B6E8F /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 83409E3219D5B791004B7EB9 /* SSZipArchiveExampleApp.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = SSZipArchiveExampleApp.app; - remoteRef = 83409E3119D5B791004B7EB9 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 7A40378319E36EFF007B6E8F /* libSSZipArchiveAndroid.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -3575,6 +3567,7 @@ DEBUG, "COCOS2D_DEBUG=1", ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_THUMB_SUPPORT = NO; GCC_TREAT_WARNINGS_AS_ERRORS = NO; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; @@ -3610,6 +3603,7 @@ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_THUMB_SUPPORT = NO; GCC_TREAT_WARNINGS_AS_ERRORS = NO; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; diff --git a/cocos2d/CCPackageDownload.m b/cocos2d/CCPackageDownload.m index 35c954fd56a..9fd70c76d6a 100644 --- a/cocos2d/CCPackageDownload.m +++ b/cocos2d/CCPackageDownload.m @@ -94,7 +94,7 @@ - (NSString *)sha1:(NSString *)str { const char *cStr = [str UTF8String]; unsigned char result[CC_SHA1_DIGEST_LENGTH]; - CC_SHA1(cStr, strlen(cStr), result); + CC_SHA1(cStr, (CC_LONG)strlen(cStr), result); NSString *hash = [NSString stringWithFormat: @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", result[0], result[1], result[2], result[3], result[4], @@ -263,7 +263,7 @@ - (NSURLRequest *)createRequest if (_fileSize > 0) { - NSString *requestRange = [NSString stringWithFormat:@"bytes=%d-", _fileSize]; + NSString *requestRange = [NSString stringWithFormat:@"bytes=%d-", (unsigned int)_fileSize]; [result setValue:requestRange forHTTPHeaderField:@"Range"]; } @@ -408,7 +408,7 @@ - (void)forwardResponseErrorToDelegate:(NSHTTPURLResponse *)httpResponse NSError *error = [NSError errorWithDomain:@"Cocos2d" code:PACKAGE_ERROR_DOWNLOAD_SERVER_RESPONSE_NOT_OK userInfo:@{ - NSLocalizedDescriptionKey : [NSString stringWithFormat:@"Error: The host respondeded with status code %d.", [httpResponse statusCode]], + NSLocalizedDescriptionKey : [NSString stringWithFormat:@"Error: The host respondeded with status code %d.", (unsigned int)[httpResponse statusCode]], @"HTTPResponse" : httpResponse }];