From a7148d97ff05f5d43ce12fb61d68a89763ef0650 Mon Sep 17 00:00:00 2001 From: andym Date: Mon, 14 Jan 2008 15:49:13 +0000 Subject: [PATCH] Numerous minor changes courtesy Sean McBride. Mostly clarifications. --- NSFileManager+Authentication.m | 4 +- NSString+extras.m | 4 +- NTSynchronousTask.m | 14 ++-- RSS.m | 22 +++--- SUAppcastItem.m | 117 +++++++++++++++--------------- SUAutomaticUpdateAlert.h | 4 +- SUAutomaticUpdateAlert.m | 6 +- SUStandardVersionComparator.h | 2 +- SUStatusController.h | 2 +- SUStatusController.m | 8 +- SUSystemProfiler.m | 4 +- SUUpdateAlert.h | 2 +- SUUpdateAlert.m | 8 +- SUUpdater.m | 2 +- SUUserDefaults.h | 4 +- SUUserDefaults.m | 25 +++++-- SUVersionComparisonProtocol.h | 2 +- Sparkle.h | 4 +- Sparkle.xcodeproj/project.pbxproj | 31 +++++++- 19 files changed, 153 insertions(+), 112 deletions(-) diff --git a/NSFileManager+Authentication.m b/NSFileManager+Authentication.m index 790daf52..e9c60943 100644 --- a/NSFileManager+Authentication.m +++ b/NSFileManager+Authentication.m @@ -57,7 +57,7 @@ NSString *tmp = [[[dst stringByDeletingPathExtension] stringByAppendingString:@".old"] stringByAppendingPathExtension:[dst pathExtension]]; BOOL res = NO; struct stat sb; - if((stat([src UTF8String], &sb) != 0) || (stat([tmp UTF8String], &sb) == 0) || stat([dst UTF8String], &sb) != 0) + if((stat([src fileSystemRepresentation], &sb) != 0) || (stat([tmp fileSystemRepresentation], &sb) == 0) || stat([dst fileSystemRepresentation], &sb) != 0) return false; NSString *command = [NSString stringWithFormat:@"mv -f \"%@\" \"%@\" && cp -f -R \"%@\" \"%@\" && rm -rf \"%@\" && chown -R %d:%d \"%@\"", @@ -73,7 +73,7 @@ AuthorizationRef auth; if(AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &auth) == errAuthorizationSuccess) { - char const* arguments[] = { "-c", [command UTF8String], NULL }; + char const* arguments[] = { "-c", [command fileSystemRepresentation], NULL }; if(AuthorizationExecuteWithPrivileges(auth, "/bin/sh", kAuthorizationFlagDefaults, (char**)arguments, NULL) == errAuthorizationSuccess) { int status; diff --git a/NSString+extras.m b/NSString+extras.m index a252c881..6a4d2403 100644 --- a/NSString+extras.m +++ b/NSString+extras.m @@ -88,9 +88,9 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMA - (NSString *) stripHTML { - NSInteger len = [self length]; + NSUInteger len = [self length]; NSMutableString *s = [NSMutableString stringWithCapacity: len]; - NSInteger i = 0, level = 0; + NSUInteger i = 0, level = 0; for (i = 0; i < len; i++) { diff --git a/NTSynchronousTask.m b/NTSynchronousTask.m index d2ff7db2..2b992e2e 100644 --- a/NTSynchronousTask.m +++ b/NTSynchronousTask.m @@ -36,14 +36,16 @@ - (id)init; { self = [super init]; + if (self) + { + [self setTask:[[[NSTask alloc] init] autorelease]]; + [self setOutputPipe:[[[NSPipe alloc] init] autorelease]]; + [self setInputPipe:[[[NSPipe alloc] init] autorelease]]; - [self setTask:[[[NSTask alloc] init] autorelease]]; - [self setOutputPipe:[[[NSPipe alloc] init] autorelease]]; - [self setInputPipe:[[[NSPipe alloc] init] autorelease]]; + [[self task] setStandardInput:[self inputPipe]]; + [[self task] setStandardOutput:[self outputPipe]]; + } - [[self task] setStandardInput:[self inputPipe]]; - [[self task] setStandardOutput:[self outputPipe]]; - return self; } diff --git a/RSS.m b/RSS.m index b73db123..159a3a70 100644 --- a/RSS.m +++ b/RSS.m @@ -482,7 +482,7 @@ NSComparisonResult compareNewsItems(id item1, id item2, void *context) Also trim white space, remove HTML when appropriate. */ - NSString *description, *link, *title; + NSString *description, *normalizedLink, *title; BOOL nilDescription = NO; /*Description*/ @@ -505,9 +505,9 @@ NSComparisonResult compareNewsItems(id item1, id item2, void *context) /*Link*/ - link = [rssItem objectForKey: linkKey]; + normalizedLink = [rssItem objectForKey: linkKey]; - if ([NSString stringIsEmpty: link]) { + if ([NSString stringIsEmpty: normalizedLink]) { /*Try to get a URL from the description.*/ @@ -517,21 +517,21 @@ NSComparisonResult compareNewsItems(id item1, id item2, void *context) if ([stringComponents count] > 1) { - link = [stringComponents objectAtIndex: 1]; + normalizedLink = [stringComponents objectAtIndex: 1]; - stringComponents = [link componentsSeparatedByString: @"\""]; + stringComponents = [normalizedLink componentsSeparatedByString: @"\""]; - link = [stringComponents objectAtIndex: 0]; + normalizedLink = [stringComponents objectAtIndex: 0]; } /*if*/ } /*if*/ } /*if*/ - if (link == nil) - link = @""; + if (normalizedLink == nil) + normalizedLink = @""; - link = [link trimWhiteSpace]; + normalizedLink = [normalizedLink trimWhiteSpace]; - [rssItem setObject: link forKey: linkKey]; + [rssItem setObject: normalizedLink forKey: linkKey]; /*Title*/ @@ -703,7 +703,7 @@ NSComparisonResult compareNewsItems(id item1, id item2, void *context) } /*if*/ } /*for*/ - value = [valueMutable copy]; + value = [[valueMutable trimWhiteSpace] retain]; [valueMutable autorelease]; diff --git a/SUAppcastItem.m b/SUAppcastItem.m index 4d482bc5..66df66d0 100644 --- a/SUAppcastItem.m +++ b/SUAppcastItem.m @@ -13,65 +13,68 @@ - initWithDictionary:(NSDictionary *)dict { - [super init]; - [self setTitle:[dict objectForKey:@"title"]]; - [self setDate:[dict objectForKey:@"pubDate"]]; - [self setDescription:[dict objectForKey:@"description"]]; - - id enclosure = [dict objectForKey:@"enclosure"]; - [self setDSASignature:[enclosure objectForKey:@"sparkle:dsaSignature"]]; - [self setMD5Sum:[enclosure objectForKey:@"sparkle:md5Sum"]]; - - [self setFileURL:[NSURL URLWithString:[[enclosure objectForKey:@"url"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; - - // Find the appropriate release notes URL. - if ([dict objectForKey:@"sparkle:releaseNotesLink"]) + self = [super init]; + if (self) { - [self setReleaseNotesURL:[NSURL URLWithString:[dict objectForKey:@"sparkle:releaseNotesLink"]]]; + [self setTitle:[dict objectForKey:@"title"]]; + [self setDate:[dict objectForKey:@"pubDate"]]; + [self setDescription:[dict objectForKey:@"description"]]; + + id enclosure = [dict objectForKey:@"enclosure"]; + [self setDSASignature:[enclosure objectForKey:@"sparkle:dsaSignature"]]; + [self setMD5Sum:[enclosure objectForKey:@"sparkle:md5Sum"]]; + + [self setFileURL:[NSURL URLWithString:[[enclosure objectForKey:@"url"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; + + // Find the appropriate release notes URL. + if ([dict objectForKey:@"sparkle:releaseNotesLink"]) + { + [self setReleaseNotesURL:[NSURL URLWithString:[dict objectForKey:@"sparkle:releaseNotesLink"]]]; + } + else if ([[self description] hasPrefix:@"http://"]) // if the description starts with http://, use that. + { + [self setReleaseNotesURL:[NSURL URLWithString:[self description]]]; + } + else + { + [self setReleaseNotesURL:nil]; + } + + NSString *minVersion = [dict objectForKey:@"sparkle:minimumSystemVersion"]; + if(minVersion) + [self setMinimumSystemVersion:minVersion]; + else + [self setMinimumSystemVersion:@"10.3.0"];//sparkle doesn't run on 10.2-, so we don't have to worry about it + + // Try to find a version string. + // Finding the new version number from the RSS feed is a little bit hacky. There are two ways: + // 1. A "sparkle:version" attribute on the enclosure tag, an extension from the RSS spec. + // 2. If there isn't a version attribute, Sparkle will parse the path in the enclosure, expecting + // that it will look like this: http://something.com/YourApp_0.5.zip. It'll read whatever's between the last + // underscore and the last period as the version number. So name your packages like this: APPNAME_VERSION.extension. + // The big caveat with this is that you can't have underscores in your version strings, as that'll confuse Sparkle. + // Feel free to change the separator string to a hyphen or something more suited to your needs if you like. + NSString *newVersion = [enclosure objectForKey:@"sparkle:version"]; + if (!newVersion) // no sparkle:version attribute + { + // Separate the url by underscores and take the last component, as that'll be closest to the end, + // then we remove the extension. Hopefully, this will be the version. + NSArray *fileComponents = [[enclosure objectForKey:@"url"] componentsSeparatedByString:@"_"]; + if ([fileComponents count] > 1) + newVersion = [[fileComponents lastObject] stringByDeletingPathExtension]; + } + [self setFileVersion:newVersion]; + + NSString *shortVersionString = [enclosure objectForKey:@"sparkle:shortVersionString"]; + if (shortVersionString) + { + if (![[self fileVersion] isEqualToString:shortVersionString]) + shortVersionString = [shortVersionString stringByAppendingFormat:@"/%@", [self fileVersion]]; + [self setVersionString:shortVersionString]; + } + else + [self setVersionString:[self fileVersion]]; } - else if ([[self description] hasPrefix:@"http://"]) // if the description starts with http://, use that. - { - [self setReleaseNotesURL:[NSURL URLWithString:[self description]]]; - } - else - { - [self setReleaseNotesURL:nil]; - } - - NSString *minVersion = [dict objectForKey:@"sparkle:minimumSystemVersion"]; - if(minVersion) - [self setMinimumSystemVersion:minVersion]; - else - [self setMinimumSystemVersion:@"10.3.0"];//sparkle doesn't run on 10.2-, so we don't have to worry about it - - // Try to find a version string. - // Finding the new version number from the RSS feed is a little bit hacky. There are two ways: - // 1. A "sparkle:version" attribute on the enclosure tag, an extension from the RSS spec. - // 2. If there isn't a version attribute, Sparkle will parse the path in the enclosure, expecting - // that it will look like this: http://something.com/YourApp_0.5.zip. It'll read whatever's between the last - // underscore and the last period as the version number. So name your packages like this: APPNAME_VERSION.extension. - // The big caveat with this is that you can't have underscores in your version strings, as that'll confuse Sparkle. - // Feel free to change the separator string to a hyphen or something more suited to your needs if you like. - NSString *newVersion = [enclosure objectForKey:@"sparkle:version"]; - if (!newVersion) // no sparkle:version attribute - { - // Separate the url by underscores and take the last component, as that'll be closest to the end, - // then we remove the extension. Hopefully, this will be the version. - NSArray *fileComponents = [[enclosure objectForKey:@"url"] componentsSeparatedByString:@"_"]; - if ([fileComponents count] > 1) - newVersion = [[fileComponents lastObject] stringByDeletingPathExtension]; - } - [self setFileVersion:newVersion]; - - NSString *shortVersionString = [enclosure objectForKey:@"sparkle:shortVersionString"]; - if (shortVersionString) - { - if (![[self fileVersion] isEqualToString:shortVersionString]) - shortVersionString = [shortVersionString stringByAppendingFormat:@"/%@", [self fileVersion]]; - [self setVersionString:shortVersionString]; - } - else - [self setVersionString:[self fileVersion]]; return self; } diff --git a/SUAutomaticUpdateAlert.h b/SUAutomaticUpdateAlert.h index 47174807..2b8ea1b8 100644 --- a/SUAutomaticUpdateAlert.h +++ b/SUAutomaticUpdateAlert.h @@ -15,11 +15,11 @@ NSBundle *hostBundle; } -- initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hostBundle; +- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hostBundle; - (IBAction)relaunchNow:sender; - (IBAction)relaunchLater:sender; @end -#endif \ No newline at end of file +#endif diff --git a/SUAutomaticUpdateAlert.m b/SUAutomaticUpdateAlert.m index 4948b3b6..4a0865dd 100644 --- a/SUAutomaticUpdateAlert.m +++ b/SUAutomaticUpdateAlert.m @@ -11,7 +11,7 @@ @implementation SUAutomaticUpdateAlert -- initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hb; +- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hb; { updateItem = [item retain]; hostBundle = [hb retain]; @@ -19,12 +19,12 @@ NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUAutomaticUpdateAlert" ofType:@"nib"]; if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations. { - NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingString:@"/Sparkle.framework"]; + NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"]; NSBundle *framework = [NSBundle bundleWithPath:frameworkPath]; path = [framework pathForResource:@"SUAutomaticUpdateAlert" ofType:@"nib"]; } - [super initWithWindowNibPath:path owner:self]; + self = [super initWithWindowNibPath:path owner:self]; [self setShouldCascadeWindows:NO]; return self; diff --git a/SUStandardVersionComparator.h b/SUStandardVersionComparator.h index b45a5b9b..0bc15706 100644 --- a/SUStandardVersionComparator.h +++ b/SUStandardVersionComparator.h @@ -3,7 +3,7 @@ // Sparkle // // Created by Andy Matuschak on 12/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. +// Copyright 2007 Andy Matuschak. All rights reserved. // #ifndef SUSTANDARDVERSIONCOMPARATOR_H diff --git a/SUStatusController.h b/SUStatusController.h index c7f26468..8778d027 100644 --- a/SUStatusController.h +++ b/SUStatusController.h @@ -18,7 +18,7 @@ NSBundle *hostBundle; } -- initWithHostBundle:(NSBundle *)hostBundle; +- (id)initWithHostBundle:(NSBundle *)hostBundle; // Pass 0 for the max progress value to get an indeterminate progress bar. // Pass nil for the status text to not show it. diff --git a/SUStatusController.m b/SUStatusController.m index 0b2c8e43..714947af 100644 --- a/SUStatusController.m +++ b/SUStatusController.m @@ -11,17 +11,17 @@ @implementation SUStatusController -- initWithHostBundle:(NSBundle *)hb +- (id)initWithHostBundle:(NSBundle *)hb { hostBundle = [hb retain]; NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUStatus" ofType:@"nib"]; if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations. { - NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingString:@"/Sparkle.framework"]; + NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"]; NSBundle *framework = [NSBundle bundleWithPath:frameworkPath]; path = [framework pathForResource:@"SUStatus" ofType:@"nib"]; } - [super initWithWindowNibPath:path owner:self]; + self = [super initWithWindowNibPath:path owner:self]; [self setShouldCascadeWindows:NO]; return self; } @@ -119,5 +119,3 @@ } @end - - diff --git a/SUSystemProfiler.m b/SUSystemProfiler.m index 785d9836..3354bf22 100644 --- a/SUSystemProfiler.m +++ b/SUSystemProfiler.m @@ -16,7 +16,7 @@ + (NSDictionary *)modelTranslationTable { NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUModelTranslation" ofType:@"plist"]; - return [[NSDictionary alloc] initWithContentsOfFile:path]; + return [[[NSDictionary alloc] initWithContentsOfFile:path] autorelease]; } + (NSMutableArray *)systemProfileInformationArrayWithHostBundle:(NSBundle *)hostBundle @@ -30,7 +30,7 @@ int value = 0 ; unsigned long length = sizeof(value) ; - // OS version (Apple recommends using SystemVersion.plist instead of Gestalt() here, don't ask me why). + // OS version NSString *currentSystemVersion = SUSystemVersionString(); if (currentSystemVersion != nil) [profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"osVersion",@"OS Version",currentSystemVersion,currentSystemVersion,nil] forKeys:profileDictKeys]]; diff --git a/SUUpdateAlert.h b/SUUpdateAlert.h index 781819e2..c16fc6ce 100644 --- a/SUUpdateAlert.h +++ b/SUUpdateAlert.h @@ -28,7 +28,7 @@ typedef enum BOOL webViewFinishedLoading; } -- initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hostBundle; +- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hostBundle; - (void)setDelegate:delegate; - (IBAction)installUpdate:sender; diff --git a/SUUpdateAlert.m b/SUUpdateAlert.m index 9eb9367c..ae1da129 100644 --- a/SUUpdateAlert.m +++ b/SUUpdateAlert.m @@ -13,7 +13,7 @@ @implementation SUUpdateAlert -- initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hb +- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hb { hostBundle = [hb retain]; updateItem = [item retain]; @@ -21,12 +21,12 @@ NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUUpdateAlert" ofType:@"nib"]; if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations. { - NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingString:@"/Sparkle.framework"]; + NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"]; NSBundle *framework = [NSBundle bundleWithPath:frameworkPath]; path = [framework pathForResource:@"SUUpdateAlert" ofType:@"nib"]; } - [super initWithWindowNibPath:path owner:self]; + self = [super initWithWindowNibPath:path owner:self]; [self setShouldCascadeWindows:NO]; return self; } @@ -158,7 +158,7 @@ - (NSString *)descriptionText { - return [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available%Cyou have %@. Would you like to download it now?", nil), [hostBundle name], [updateItem versionString], 0x2014, [hostBundle displayVersion]]; + return [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available%Cyou have %@. Would you like to download it now?", nil), [hostBundle name], [updateItem versionString], 0x2014, [hostBundle displayVersion]]; } - (void)webView:(WebView *)sender didFinishLoadForFrame:frame diff --git a/SUUpdater.m b/SUUpdater.m index 6eabcbb5..e1ad29ee 100644 --- a/SUUpdater.m +++ b/SUUpdater.m @@ -45,7 +45,7 @@ return [SUUpdater alloc]; } -- init +- (id)init { self = [super init]; if (self) diff --git a/SUUserDefaults.h b/SUUserDefaults.h index 85293a30..ba2eedb2 100644 --- a/SUUserDefaults.h +++ b/SUUserDefaults.h @@ -3,7 +3,7 @@ // Sparkle // // Created by Andy Matuschak on 12/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. +// Copyright 2007 Andy Matuschak. All rights reserved. // #ifndef SUUSERDEFAULTS_H @@ -32,7 +32,7 @@ */ - (void)setIdentifier:(NSString *)identifier; -- objectForKey:(NSString *)defaultName; +- (id)objectForKey:(NSString *)defaultName; - (void)setObject:(id)value forKey:(NSString *)defaultName; - (BOOL)boolForKey:(NSString *)defaultName; - (void)setBool:(BOOL)value forKey:(NSString *)defaultName; diff --git a/SUUserDefaults.m b/SUUserDefaults.m index e8742a7e..ff31632f 100644 --- a/SUUserDefaults.m +++ b/SUUserDefaults.m @@ -3,7 +3,7 @@ // Sparkle // // Created by Andy Matuschak on 12/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. +// Copyright 2007 Andy Matuschak. All rights reserved. // #import "Sparkle.h" @@ -27,6 +27,7 @@ - (void)setIdentifier:(NSString *)anIdentifier { + [identifier autorelease]; identifier = [anIdentifier copy]; } @@ -36,10 +37,15 @@ [NSException raise:@"SUUserDefaultsMissingIdentifier" format:@"You must set the SUUserDefaults identifier before using it."]; } -- objectForKey:(NSString *)defaultName +- (id)objectForKey:(NSString *)defaultName { [self verifyIdentifier]; - return (id)CFPreferencesCopyValue((CFStringRef)defaultName, (CFStringRef)identifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); + CFPropertyListRef obj = CFPreferencesCopyValue((CFStringRef)defaultName, (CFStringRef)identifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); +#if MAC_OS_X_VERSION_MIN_REQUIRED > 1050 + return [NSMakeCollectable(obj) autorelease]; +#else + return [(id)obj autorelease]; +#endif } - (void)setObject:(id)value forKey:(NSString *)defaultName; @@ -51,12 +57,17 @@ - (BOOL)boolForKey:(NSString *)defaultName { + BOOL value; [self verifyIdentifier]; - CFPropertyListRef plr = (CFPropertyListRef)CFPreferencesCopyValue((CFStringRef)defaultName, (CFStringRef)identifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); + CFPropertyListRef plr = CFPreferencesCopyValue((CFStringRef)defaultName, (CFStringRef)identifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); if (plr == NULL) - return NO; - else - return CFBooleanGetValue((CFBooleanRef)plr); + value = NO; + else { + value = (BOOL)CFBooleanGetValue((CFBooleanRef)plr); + CFRelease(plr); + } + + return value; } - (void)setBool:(BOOL)value forKey:(NSString *)defaultName diff --git a/SUVersionComparisonProtocol.h b/SUVersionComparisonProtocol.h index a45cba90..3d11ae87 100644 --- a/SUVersionComparisonProtocol.h +++ b/SUVersionComparisonProtocol.h @@ -3,7 +3,7 @@ // Sparkle // // Created by Andy Matuschak on 12/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. +// Copyright 2007 Andy Matuschak. All rights reserved. // #ifndef SUVERSIONCOMPARISONPROTOCOL_H diff --git a/Sparkle.h b/Sparkle.h index ee203bc2..e4411f5b 100644 --- a/Sparkle.h +++ b/Sparkle.h @@ -22,7 +22,7 @@ #endif // This returns a version string of the form X.Y.Z -inline NSString* SUSystemVersionString(void) +static inline NSString* SUSystemVersionString(void) { SInt32 major, minor, bugfix; OSErr err1 = Gestalt(gestaltSystemVersionMajor, &major); @@ -31,7 +31,7 @@ inline NSString* SUSystemVersionString(void) NSString* verStr = nil; if (!err1 && !err2 && !err3) { - verStr = [NSString stringWithFormat:@"%ld.%ld.%ld", major, minor, bugfix]; + verStr = [NSString stringWithFormat:@"%d.%d.%d", major, minor, bugfix]; } return verStr; } diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 97d59814..276ea280 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -26,6 +26,7 @@ 61299A8E09CA790200B7442F /* SUUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A8C09CA790200B7442F /* SUUnarchiver.m */; }; 61299B3609CB04E000B7442F /* Sparkle.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299B3509CB04E000B7442F /* Sparkle.h */; settings = {ATTRIBUTES = (Public, ); }; }; 61407C390A4099050009F71F /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; }; + 6160E7E10D3B4A8800E9CD71 /* NTSynchronousTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 610EC1C00CF3914D00AE239E /* NTSynchronousTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6196CFF909C72148000DC222 /* SUStatusController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6196CFE309C71ADE000DC222 /* SUStatusController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6196CFFA09C72149000DC222 /* SUStatusController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6196CFE409C71ADE000DC222 /* SUStatusController.m */; }; 61A225930D1C3ADD00430CCD /* NSBundle+SUAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A225910D1C3ADD00430CCD /* NSBundle+SUAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -469,6 +470,7 @@ 61A225A40D1C4AC000430CCD /* SUStandardVersionComparator.h in Headers */, 61A2262B0D1C58FD00430CCD /* SUUserDefaults.h in Headers */, 61A2279C0D1CEE7600430CCD /* SUSystemProfiler.h in Headers */, + 6160E7E10D3B4A8800E9CD71 /* NTSynchronousTask.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -904,7 +906,19 @@ ppc, ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_SHADOW = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.4; "MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4; @@ -915,7 +929,7 @@ "SDKROOT[arch=i386]" = /Developer/SDKs/MacOSX10.4u.sdk; "SDKROOT[arch=ppc]" = /Developer/SDKs/MacOSX10.3.9.sdk; VALID_ARCHS = "ppc7400 ppc970 i386 x86_64 ppc"; - WARNING_CFLAGS = "-wall"; + WARNING_CFLAGS = "-Wall"; }; name = Debug; }; @@ -929,7 +943,20 @@ x86_64, ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_SHADOW = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.4; "MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4; @@ -942,7 +969,7 @@ "SDKROOT[arch=ppc]" = /Developer/SDKs/MacOSX10.3.9.sdk; "SDKROOT[arch=x86_64]" = /Developer/SDKs/MacOSX10.5.sdk; VALID_ARCHS = "ppc7400 ppc970 i386 x86_64 ppc"; - WARNING_CFLAGS = "-wall"; + WARNING_CFLAGS = "-Wall"; }; name = Release; };