From cd60df74f07419c6c695272f99c48338e66b2b61 Mon Sep 17 00:00:00 2001 From: Ryan Nielsen Date: Mon, 1 Apr 2013 21:53:01 -0700 Subject: [PATCH] Silence Xcode and clang analyzer warnings for everythign except GC and nib warnings --- SUBinaryDeltaCommon.m | 2 +- SUPlainInstallerInternals.m | 4 ++-- Sparkle.xcodeproj/project.pbxproj | 17 ++++++++++++++++- .../xcshareddata/xcschemes/Sparkle.xcscheme | 4 ++-- finish_installation.m | 2 +- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/SUBinaryDeltaCommon.m b/SUBinaryDeltaCommon.m index 4315d95d..d0241234 100644 --- a/SUBinaryDeltaCommon.m +++ b/SUBinaryDeltaCommon.m @@ -44,7 +44,7 @@ NSString *temporaryFilename(NSString *base) NSString *template = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.XXXXXXXXXX", base]]; char buffer[MAXPATHLEN]; strcpy(buffer, [template fileSystemRepresentation]); - return [NSString stringWithUTF8String:mktemp(buffer)]; + return [NSString stringWithUTF8String:mkstemp(buffer)]; } static void _hashOfBuffer(unsigned char *hash, const char* buffer, size_t bufferLength) diff --git a/SUPlainInstallerInternals.m b/SUPlainInstallerInternals.m index 475862a9..a89d4175 100644 --- a/SUPlainInstallerInternals.m +++ b/SUPlainInstallerInternals.m @@ -455,7 +455,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza { err = FSPathMakeRef((UInt8 *)[[tmpPath stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); if (err != noErr) - err = FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); + FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); } err = FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &dstDirRef, NULL); @@ -495,7 +495,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza { // We better move the old version back to its old location if( hadFileAtDest ) - success = [manager moveItemAtPath:tmpPath toPath:dst error:error]; + [manager moveItemAtPath:tmpPath toPath:dst error:error]; if (error != NULL) *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't move %@ to %@.", dst, tmpPath] forKey:NSLocalizedDescriptionKey]]; return NO; diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index ea22d451..8a9da595 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -1014,7 +1014,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0430; + LastUpgradeCheck = 0460; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Sparkle" */; compatibilityVersion = "Xcode 3.2"; @@ -1516,6 +1516,7 @@ i386, x86_64, ); + COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; }; name = Debug; @@ -1528,6 +1529,7 @@ i386, x86_64, ); + COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; }; @@ -1550,6 +1552,7 @@ baseConfigurationReference = FA1941D30D94A70100DD942E /* ConfigRelaunchDebug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; @@ -1573,6 +1576,7 @@ baseConfigurationReference = FA1941D40D94A70100DD942E /* ConfigRelaunchRelease.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; @@ -1596,6 +1600,7 @@ baseConfigurationReference = FA1941D40D94A70100DD942E /* ConfigRelaunchRelease.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + COMBINE_HIDPI_IMAGES = YES; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = finish_installation.pch; @@ -1646,6 +1651,7 @@ i386, x86_64, ); + COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; }; @@ -1655,6 +1661,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 615409A8103BA09100125AF1 /* ConfigTestAppReleaseGCSupport.xcconfig */; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; }; name = "Release (GC dual-mode; 10.5+)"; }; @@ -1662,6 +1669,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = FA302AFD109D13190060F891 /* ConfigUnitTestReleaseGCSupport.xcconfig */; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; }; name = "Release (GC dual-mode; 10.5+)"; }; @@ -1669,6 +1677,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = FA3AAF3A1050B273004B3130 /* ConfigUnitTestDebug.xcconfig */; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; }; name = Debug; }; @@ -1676,6 +1685,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = FA3AAF391050B273004B3130 /* ConfigUnitTestRelease.xcconfig */; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; }; name = Release; }; @@ -1683,6 +1693,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = FA1941CB0D94A70100DD942E /* ConfigTestAppDebug.xcconfig */; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; }; name = Debug; }; @@ -1690,6 +1701,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = FA1941D20D94A70100DD942E /* ConfigTestAppRelease.xcconfig */; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; }; name = Release; }; @@ -1698,6 +1710,7 @@ baseConfigurationReference = 8B887B711517F447000BB292 /* ConfigServiceDebug.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; INFOPLIST_FILE = SandboxService.plist; OTHER_CFLAGS = "-DDEBUG"; @@ -1710,6 +1723,7 @@ baseConfigurationReference = 8B887B721517F447000BB292 /* ConfigServiceRelease.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; INFOPLIST_FILE = SandboxService.plist; VALID_ARCHS = x86_64; @@ -1721,6 +1735,7 @@ baseConfigurationReference = 8B887B721517F447000BB292 /* ConfigServiceRelease.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; INFOPLIST_FILE = SandboxService.plist; VALID_ARCHS = x86_64; diff --git a/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme b/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme index 33554de4..1e5f2905 100644 --- a/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme +++ b/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme @@ -1,6 +1,6 @@ diff --git a/finish_installation.m b/finish_installation.m index 9956d782..0d0ec9d9 100644 --- a/finish_installation.m +++ b/finish_installation.m @@ -146,7 +146,7 @@ // Perhaps a poor assumption but: if we're not relaunching, we assume we shouldn't be showing any UI either. Because non-relaunching installations are kicked off without any user interaction, we shouldn't be interrupting them. if (shouldRelaunch) { - SUStatusController* statusCtl = [[SUStatusController alloc] initWithHost: host]; // We quit anyway after we've installed, so leak this for now. + SUStatusController* statusCtl = [[[SUStatusController alloc] initWithHost: host] autorelease]; // We quit anyway after we've installed, so leak this for now. [statusCtl setButtonTitle: SULocalizedString(@"Cancel Update",@"") target: nil action: Nil isDefault: NO]; [statusCtl beginActionWithTitle: SULocalizedString(@"Installing update...",@"") maxProgressValue: 0 statusText: @""];