From 9ae41fe4abe3085ae7e16b5653ecd91588a56c92 Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Thu, 14 Jun 2018 20:31:20 +0200 Subject: [PATCH 1/2] Explicitly specify types to silence "Messaging unqualified id" warning that's new in Xcode 10. Removed __has_feature(objc_generics) check and use generisc to help silence the warnings. --- Sparkle/Autoupdate/Autoupdate.m | 2 +- Sparkle/SPUURLRequest.m | 2 +- Sparkle/SUAppcast.h | 5 ----- Sparkle/SUAppcastItem.m | 4 ++-- Sparkle/SUAutomaticUpdateAlert.m | 2 +- Sparkle/SUBinaryDeltaCommon.m | 2 +- Sparkle/SUDSAVerifier.m | 2 +- Sparkle/SUFileManager.m | 8 ++++---- Sparkle/SUHost.m | 2 +- Sparkle/SUOperatingSystem.m | 2 +- Sparkle/SUPipedUnarchiver.m | 2 +- Sparkle/SUStatusController.m | 2 +- Sparkle/SUUpdateAlert.m | 4 ++-- Sparkle/SUUpdatePermissionPrompt.h | 2 +- Sparkle/SUUpdatePermissionPrompt.m | 8 ++++---- Sparkle/SUUpdater.h | 4 ---- Sparkle/SUUpdater.m | 8 ++++---- Sparkle/SUUpdaterDelegate.h | 4 ---- TestApplication/SUTestApplicationDelegate.m | 2 +- TestApplication/SUTestWebServer.m | 2 +- fileop/fileop.m | 16 ++++++++-------- 21 files changed, 36 insertions(+), 49 deletions(-) diff --git a/Sparkle/Autoupdate/Autoupdate.m b/Sparkle/Autoupdate/Autoupdate.m index 44cf3a59..ea4083f8 100644 --- a/Sparkle/Autoupdate/Autoupdate.m +++ b/Sparkle/Autoupdate/Autoupdate.m @@ -232,7 +232,7 @@ int main(int __unused argc, const char __unused *argv[]) { @autoreleasepool { - NSArray *args = [[NSProcessInfo processInfo] arguments]; + NSArray *args = [[NSProcessInfo processInfo] arguments]; if (args.count < 5 || args.count > 7) { return EXIT_FAILURE; } diff --git a/Sparkle/SPUURLRequest.m b/Sparkle/SPUURLRequest.m index fad9fcd5..13e4ad3a 100644 --- a/Sparkle/SPUURLRequest.m +++ b/Sparkle/SPUURLRequest.m @@ -50,7 +50,7 @@ static NSString *SPUURLRequestNetworkServiceTypeKey = @"SPUURLRequestNetworkServ + (instancetype)URLRequestWithRequest:(NSURLRequest *)request { - return [[[self class] alloc] initWithURL:request.URL cachePolicy:request.cachePolicy timeoutInterval:request.timeoutInterval httpHeaderFields:request.allHTTPHeaderFields networkServiceType:request.networkServiceType]; + return [(SPUURLRequest *)[[self class] alloc] initWithURL:request.URL cachePolicy:request.cachePolicy timeoutInterval:request.timeoutInterval httpHeaderFields:request.allHTTPHeaderFields networkServiceType:request.networkServiceType]; } + (BOOL)supportsSecureCoding diff --git a/Sparkle/SUAppcast.h b/Sparkle/SUAppcast.h index f2f43389..34276b7d 100644 --- a/Sparkle/SUAppcast.h +++ b/Sparkle/SUAppcast.h @@ -22,12 +22,7 @@ NS_ASSUME_NONNULL_BEGIN SU_EXPORT @interface SUAppcast : NSObject @property (copy, nullable) NSString *userAgentString; - -#if __has_feature(objc_generics) @property (copy, nullable) NSDictionary *httpHeaders; -#else -@property (copy, nullable) NSDictionary *httpHeaders; -#endif - (void)fetchAppcastFromURL:(NSURL *)url inBackground:(BOOL)bg completionBlock:(void (^)(NSError *_Nullable))err; - (SUAppcast *)copyWithoutDeltaUpdates; diff --git a/Sparkle/SUAppcastItem.m b/Sparkle/SUAppcastItem.m index c4293034..89e4580a 100644 --- a/Sparkle/SUAppcastItem.m +++ b/Sparkle/SUAppcastItem.m @@ -55,7 +55,7 @@ - (BOOL)isCriticalUpdate { - return [[self.propertiesDictionary objectForKey:SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate]; + return [(NSArray *)[self.propertiesDictionary objectForKey:SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate]; } - (BOOL)isMacOsUpdate @@ -97,7 +97,7 @@ // 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:SURSSAttributeURL] componentsSeparatedByString:@"_"]; + NSArray *fileComponents = [(NSString *)[enclosure objectForKey:SURSSAttributeURL] componentsSeparatedByString:@"_"]; if ([fileComponents count] > 1) { newVersion = [[fileComponents lastObject] stringByDeletingPathExtension]; } diff --git a/Sparkle/SUAutomaticUpdateAlert.m b/Sparkle/SUAutomaticUpdateAlert.m index f0e7fea9..6ecc20b1 100644 --- a/Sparkle/SUAutomaticUpdateAlert.m +++ b/Sparkle/SUAutomaticUpdateAlert.m @@ -110,7 +110,7 @@ static NSString *const SUAutomaticUpdateAlertTouchBarIndentifier = @"" SPARKLE_B - (NSTouchBar *)makeTouchBar { - NSTouchBar *touchBar = [[NSClassFromString(@"NSTouchBar") alloc] init]; + NSTouchBar *touchBar = [(NSTouchBar *)[NSClassFromString(@"NSTouchBar") alloc] init]; touchBar.defaultItemIdentifiers = @[SUAutomaticUpdateAlertTouchBarIndentifier,]; touchBar.principalItemIdentifier = SUAutomaticUpdateAlertTouchBarIndentifier; touchBar.delegate = self; diff --git a/Sparkle/SUBinaryDeltaCommon.m b/Sparkle/SUBinaryDeltaCommon.m index b5731cbe..8ede8dcb 100644 --- a/Sparkle/SUBinaryDeltaCommon.m +++ b/Sparkle/SUBinaryDeltaCommon.m @@ -242,7 +242,7 @@ BOOL modifyPermissions(NSString *path, mode_t desiredPermissions) return NO; } mode_t newMode = ([permissions unsignedShortValue] & ~PERMISSION_FLAGS) | desiredPermissions; - int (*changeModeFunc)(const char *, mode_t) = [[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeSymbolicLink] ? lchmod : chmod; + int (*changeModeFunc)(const char *, mode_t) = [(NSString *)[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeSymbolicLink] ? lchmod : chmod; if (changeModeFunc([path fileSystemRepresentation], newMode) != 0) { return NO; } diff --git a/Sparkle/SUDSAVerifier.m b/Sparkle/SUDSAVerifier.m index a0fa38a9..8aa6a2e2 100644 --- a/Sparkle/SUDSAVerifier.m +++ b/Sparkle/SUDSAVerifier.m @@ -34,7 +34,7 @@ return NO; } - SUDSAVerifier *verifier = [[self alloc] initWithPublicKeyData:[pkeyString dataUsingEncoding:NSUTF8StringEncoding]]; + SUDSAVerifier *verifier = [(SUDSAVerifier *)[self alloc] initWithPublicKeyData:[pkeyString dataUsingEncoding:NSUTF8StringEncoding]]; if (!verifier) { return NO; diff --git a/Sparkle/SUFileManager.m b/Sparkle/SUFileManager.m index 1ab95cbf..03fdaaa9 100644 --- a/Sparkle/SUFileManager.m +++ b/Sparkle/SUFileManager.m @@ -71,12 +71,12 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { + (instancetype)defaultManager { - return [[self alloc] initWithAuthorizationToolPath:nil]; + return [(SUFileManager *)[self alloc] initWithAuthorizationToolPath:nil]; } + (instancetype)fileManagerWithAuthorizationToolPath:(NSString *)authorizationToolPath { - return [[self alloc] initWithAuthorizationToolPath:authorizationToolPath]; + return [(SUFileManager *)[self alloc] initWithAuthorizationToolPath:authorizationToolPath]; } - (instancetype)fileManagerByPreservingAuthorizationRights @@ -269,7 +269,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { } if (isDirectory != NULL) { - *isDirectory = [[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeDirectory]; + *isDirectory = [(NSString *)[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeDirectory]; } return YES; @@ -304,7 +304,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { - (BOOL)_removeQuarantineWithAuthenticationAtRootURL:(NSURL *)rootURL error:(NSError *__autoreleasing *)error { // Because this is a system utility, it's fine to follow the symbolic link if one exists - if (![_fileManager fileExistsAtPath:@(XATTR_UTILITY_PATH)]) { + if (![_fileManager fileExistsAtPath:(NSString *)@(XATTR_UTILITY_PATH)]) { if (error != NULL) { *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileNoSuchFileError userInfo:@{ NSLocalizedDescriptionKey: @"xattr utility does not exist on this system." }]; } diff --git a/Sparkle/SUHost.m b/Sparkle/SUHost.m index fe7345cd..658aa9ae 100644 --- a/Sparkle/SUHost.m +++ b/Sparkle/SUHost.m @@ -161,7 +161,7 @@ - (BOOL)boolForInfoDictionaryKey:(NSString *)key { - return [[self objectForInfoDictionaryKey:key] boolValue]; + return [(NSNumber *)[self objectForInfoDictionaryKey:key] boolValue]; } - (id)objectForUserDefaultsKey:(NSString *)defaultName diff --git a/Sparkle/SUOperatingSystem.m b/Sparkle/SUOperatingSystem.m index fada18c3..6cda6499 100644 --- a/Sparkle/SUOperatingSystem.m +++ b/Sparkle/SUOperatingSystem.m @@ -32,7 +32,7 @@ NSURL *url = [coreServices URLByAppendingPathComponent:@"SystemVersion.plist"]; assert(url != nil); NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfURL:url]; - NSArray *components = [ [dictionary objectForKey: @"ProductVersion"] componentsSeparatedByString:@"."]; + NSArray *components = [ (NSString *)[dictionary objectForKey: @"ProductVersion"] componentsSeparatedByString:@"."]; version.majorVersion = components.count > 0 ? [ [components objectAtIndex:0] integerValue] : 0; version.minorVersion = components.count > 1 ? [ [components objectAtIndex:1] integerValue] : 0; version.patchVersion = components.count > 2 ? [ [components objectAtIndex:2] integerValue] : 0; diff --git a/Sparkle/SUPipedUnarchiver.m b/Sparkle/SUPipedUnarchiver.m index 3c3e2005..1aa17163 100644 --- a/Sparkle/SUPipedUnarchiver.m +++ b/Sparkle/SUPipedUnarchiver.m @@ -100,7 +100,7 @@ // Get the file size. NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:self.archivePath error:nil]; - NSUInteger expectedLength = [[attributes objectForKey:NSFileSize] unsignedIntegerValue]; + NSUInteger expectedLength = [(NSNumber *)[attributes objectForKey:NSFileSize] unsignedIntegerValue]; if (expectedLength > 0) { NSFileHandle *archiveInput = [NSFileHandle fileHandleForReadingAtPath:self.archivePath]; diff --git a/Sparkle/SUStatusController.m b/Sparkle/SUStatusController.m index 79661065..7bb932ab 100644 --- a/Sparkle/SUStatusController.m +++ b/Sparkle/SUStatusController.m @@ -136,7 +136,7 @@ static NSString *const SUStatusControllerTouchBarIndentifier = @"" SPARKLE_BUNDL - (NSTouchBar *)makeTouchBar { - NSTouchBar *touchBar = [[NSClassFromString(@"NSTouchBar") alloc] init]; + NSTouchBar *touchBar = [(NSTouchBar *)[NSClassFromString(@"NSTouchBar") alloc] init]; touchBar.defaultItemIdentifiers = @[ SUStatusControllerTouchBarIndentifier,]; touchBar.principalItemIdentifier = SUStatusControllerTouchBarIndentifier; touchBar.delegate = self; diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index c635274f..f6e4eec5 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -263,7 +263,7 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE return finalString; } -- (void)webView:(WebView *)sender didFinishLoadForFrame:frame +- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame { if ([frame parentFrame] == nil) { self.webViewFinishedLoading = YES; @@ -329,7 +329,7 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE - (NSTouchBar *)makeTouchBar { - NSTouchBar *touchBar = [[NSClassFromString(@"NSTouchBar") alloc] init]; + NSTouchBar *touchBar = [(NSTouchBar *)[NSClassFromString(@"NSTouchBar") alloc] init]; touchBar.defaultItemIdentifiers = @[SUUpdateAlertTouchBarIndentifier,]; touchBar.principalItemIdentifier = SUUpdateAlertTouchBarIndentifier; touchBar.delegate = self; diff --git a/Sparkle/SUUpdatePermissionPrompt.h b/Sparkle/SUUpdatePermissionPrompt.h index 53f8b0da..7d1fdffd 100644 --- a/Sparkle/SUUpdatePermissionPrompt.h +++ b/Sparkle/SUUpdatePermissionPrompt.h @@ -24,7 +24,7 @@ typedef NS_ENUM(NSInteger, SUPermissionPromptResult) { + (void)promptWithHost:(SUHost *)host systemProfile:(NSArray *)profile reply:(void (^)(SUUpdatePermissionResponse *))reply; - (IBAction)toggleMoreInfo:(id)sender; -- (IBAction)finishPrompt:(id)sender; +- (IBAction)finishPrompt:(NSButton *)sender; @end #endif diff --git a/Sparkle/SUUpdatePermissionPrompt.m b/Sparkle/SUUpdatePermissionPrompt.m index 4000fd85..f038af2b 100644 --- a/Sparkle/SUUpdatePermissionPrompt.m +++ b/Sparkle/SUUpdatePermissionPrompt.m @@ -52,7 +52,7 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE - (BOOL)shouldAskAboutProfile { - return [[self.host objectForInfoDictionaryKey:SUEnableSystemProfilingKey] boolValue]; + return [(NSNumber *)[self.host objectForInfoDictionaryKey:SUEnableSystemProfilingKey] boolValue]; } - (instancetype)initWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile reply:(void (^)(SUUpdatePermissionResponse *))reply @@ -80,7 +80,7 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE } if (![NSApp modalWindow]) { // do not prompt if there is is another modal window on screen - SUUpdatePermissionPrompt *prompt = [[[self class] alloc] initWithHost:host systemProfile:profile reply:reply]; + SUUpdatePermissionPrompt *prompt = [(SUUpdatePermissionPrompt *)[[self class] alloc] initWithHost:host systemProfile:profile reply:reply]; NSWindow *window = [prompt window]; if (window) { [NSApp runModalForWindow:window]; @@ -159,7 +159,7 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE [self.moreInfoView setHidden:!self.isShowingMoreInfo]; } -- (IBAction)finishPrompt:(id)sender +- (IBAction)finishPrompt:(NSButton *)sender { SUUpdatePermissionResponse *response = [[SUUpdatePermissionResponse alloc] initWithAutomaticUpdateChecks:([sender tag] == 1) sendSystemProfile:self.shouldSendProfile]; self.reply(response); @@ -170,7 +170,7 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE - (NSTouchBar *)makeTouchBar { - NSTouchBar *touchBar = [[NSClassFromString(@"NSTouchBar") alloc] init]; + NSTouchBar *touchBar = [(NSTouchBar *)[NSClassFromString(@"NSTouchBar") alloc] init]; touchBar.defaultItemIdentifiers = @[SUUpdatePermissionPromptTouchBarIndentifier,]; touchBar.principalItemIdentifier = SUUpdatePermissionPromptTouchBarIndentifier; touchBar.delegate = self; diff --git a/Sparkle/SUUpdater.h b/Sparkle/SUUpdater.h index a4744755..bc1d4916 100644 --- a/Sparkle/SUUpdater.h +++ b/Sparkle/SUUpdater.h @@ -160,11 +160,7 @@ SU_EXPORT @interface SUUpdater : NSObject The keys of this dictionary are HTTP header fields (NSString) and values are corresponding values (NSString) */ -#if __has_feature(objc_generics) @property (copy) NSDictionary *httpHeaders; -#else -@property (copy) NSDictionary *httpHeaders; -#endif /*! A property indicating whether or not the user's system profile information is sent when checking for updates. diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 3c2815bc..51ab7361 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -88,7 +88,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults if (bundle == nil) bundle = [NSBundle mainBundle]; id updater = [sharedUpdaters objectForKey:[NSValue valueWithNonretainedObject:bundle]]; if (updater == nil) { - updater = [[[self class] alloc] initForBundle:bundle]; + updater = [(SUUpdater *)[[self class] alloc] initForBundle:bundle]; } return updater; } @@ -315,7 +315,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults } // Do not use reachability for a preflight check. This can be deceptive and a bad idea. Apple does not recommend doing it. - SUUpdateDriver *theUpdateDriver = [[(automatic ? [SUAutomaticUpdateDriver class] : [SUScheduledUpdateDriver class])alloc] initWithUpdater:self]; + SUUpdateDriver *theUpdateDriver = [(SUBasicUpdateDriver *)[(automatic ? [SUAutomaticUpdateDriver class] : [SUScheduledUpdateDriver class])alloc] initWithUpdater:self]; [self checkForUpdatesWithDriver:theUpdateDriver]; } @@ -537,7 +537,7 @@ static NSString *escapeURLComponent(NSString *str) { const NSTimeInterval oneWeek = 60 * 60 * 24 * 7; sendingSystemProfile &= (-[lastSubmitDate timeIntervalSinceNow] >= oneWeek); - NSArray *parameters = @[]; + NSArray *> *parameters = @[]; if ([self.delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)]) { parameters = [parameters arrayByAddingObjectsFromArray:[self.delegate feedParametersForUpdater:self sendingSystemProfile:sendingSystemProfile]]; } @@ -550,7 +550,7 @@ static NSString *escapeURLComponent(NSString *str) { // Build up the parameterized URL. NSMutableArray *parameterStrings = [NSMutableArray array]; - for (NSDictionary *currentProfileInfo in parameters) { + for (NSDictionary *currentProfileInfo in parameters) { [parameterStrings addObject:[NSString stringWithFormat:@"%@=%@", escapeURLComponent([[currentProfileInfo objectForKey:@"key"] description]), escapeURLComponent([[currentProfileInfo objectForKey:@"value"] description])]]; } diff --git a/Sparkle/SUUpdaterDelegate.h b/Sparkle/SUUpdaterDelegate.h index ec5586f5..86d1eb9e 100644 --- a/Sparkle/SUUpdaterDelegate.h +++ b/Sparkle/SUUpdaterDelegate.h @@ -64,11 +64,7 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey; \return An array of dictionaries with keys: "key", "value", "displayKey", "displayValue", the latter two being specifically for display to the user. */ -#if __has_feature(objc_generics) - (NSArray *> *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile; -#else -- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile; -#endif /*! Returns a custom appcast URL. diff --git a/TestApplication/SUTestApplicationDelegate.m b/TestApplication/SUTestApplicationDelegate.m index 42380108..5cdc3c82 100644 --- a/TestApplication/SUTestApplicationDelegate.m +++ b/TestApplication/SUTestApplicationDelegate.m @@ -30,7 +30,7 @@ static NSString * const UPDATED_VERSION = @"2.0"; NSBundle *mainBundle = [NSBundle mainBundle]; // Check if we are already up to date - if ([[mainBundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey] isEqualToString:UPDATED_VERSION]) { + if ([(NSString *)[mainBundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey] isEqualToString:UPDATED_VERSION]) { NSAlert *alreadyUpdatedAlert = [[NSAlert alloc] init]; alreadyUpdatedAlert.messageText = @"Update succeeded!"; alreadyUpdatedAlert.informativeText = @"This is the updated version of Sparkle Test App.\n\nDelete and rebuild the app to test updates again."; diff --git a/TestApplication/SUTestWebServer.m b/TestApplication/SUTestWebServer.m index 2ca31e8e..47a4ab09 100644 --- a/TestApplication/SUTestWebServer.m +++ b/TestApplication/SUTestWebServer.m @@ -96,7 +96,7 @@ NSString *requestLine = lines.count >= 3 ? [lines objectAtIndex:0] : nil; NSArray *parts = requestLine ? [requestLine componentsSeparatedByString:@" "] : nil; // Only process GET requests for existing files - if ([[parts objectAtIndex:0] isEqualToString:@"GET"]) { + if ([(NSString *)[parts objectAtIndex:0] isEqualToString:@"GET"]) { // Use NSURL to strip out query parameters NSString *path = [NSURL URLWithString:[parts objectAtIndex:1] relativeToURL:nil].path; NSString *filePath = [self.workingDirectory stringByAppendingString:path]; diff --git a/fileop/fileop.m b/fileop/fileop.m index 397ccb79..4eec69c9 100644 --- a/fileop/fileop.m +++ b/fileop/fileop.m @@ -85,11 +85,11 @@ int main(int argc, const char *argv[]) // This tool should be executed as root, so we should not try to authorize SUFileManager *fileManager = [SUFileManager defaultManager]; - if ([command isEqualToString:@(SUFileOpRemoveQuarantineCommand)]) { + if ([command isEqualToString:(NSString *)@(SUFileOpRemoveQuarantineCommand)]) { if (![fileManager releaseItemFromQuarantineAtRootURL:fileURL error:NULL]) { exit(SUQuarantineRemovalFailure); } - } else if ([command isEqualToString:@(SUFileOpCopyCommand)]) { + } else if ([command isEqualToString:(NSString *)@(SUFileOpCopyCommand)]) { if (destinationURL != nil) { if (![fileManager copyItemAtURL:fileURL toURL:destinationURL error:NULL]) { exit(SUCopyFailure); @@ -97,7 +97,7 @@ int main(int argc, const char *argv[]) } else { exit(SUInvalidOrNoDestination | SUCopyFailure); } - } else if ([command isEqualToString:@(SUFileOpMoveCommand)]) { + } else if ([command isEqualToString:(NSString *)@(SUFileOpMoveCommand)]) { if (destinationURL != nil) { if (![fileManager moveItemAtURL:fileURL toURL:destinationURL error:NULL]) { exit(SUMoveFailure); @@ -105,7 +105,7 @@ int main(int argc, const char *argv[]) } else { exit(SUInvalidOrNoDestination | SUMoveFailure); } - } else if ([command isEqualToString:@(SUFileOpChangeOwnerAndGroupCommand)]) { + } else if ([command isEqualToString:(NSString *)@(SUFileOpChangeOwnerAndGroupCommand)]) { if (destinationURL != nil) { if (![fileManager changeOwnerAndGroupOfItemAtRootURL:fileURL toMatchURL:destinationURL error:NULL]) { exit(SUChangeOwnerAndGroupFailure); @@ -113,19 +113,19 @@ int main(int argc, const char *argv[]) } else { exit(SUInvalidOrNoDestination | SUChangeOwnerAndGroupFailure); } - } else if ([command isEqualToString:@(SUFileOpUpdateModificationAndAccessTimeCommand)]) { + } else if ([command isEqualToString:(NSString *)@(SUFileOpUpdateModificationAndAccessTimeCommand)]) { if (![fileManager updateModificationAndAccessTimeOfItemAtURL:fileURL error:NULL]) { exit(SUTouchFailure); } - } else if ([command isEqualToString:@(SUFileOpMakeDirectoryCommand)]) { + } else if ([command isEqualToString:(NSString *)@(SUFileOpMakeDirectoryCommand)]) { if (![fileManager makeDirectoryAtURL:fileURL error:NULL]) { exit(SUMakeDirectoryFailure); } - } else if ([command isEqualToString:@(SUFileOpRemoveCommand)]) { + } else if ([command isEqualToString:(NSString *)@(SUFileOpRemoveCommand)]) { if (![fileManager removeItemAtURL:fileURL error:NULL]) { exit(SURemoveFailure); } - } else if ([command isEqualToString:@(SUFileOpInstallCommand)]) { + } else if ([command isEqualToString:(NSString *)@(SUFileOpInstallCommand)]) { // The one command that can *only* be run as the root user NSString *installerPath = @"/usr/sbin/installer"; From 3034eca85b174b9fdac1058e4a31cde5edf20177 Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Thu, 14 Jun 2018 20:31:58 +0200 Subject: [PATCH 2/2] Updated readme to indicate that the 10.11 SDK is required to compile Xcode 7 was released with 10.11, the reference to the 10.8 SDK is out of date. --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 58c7e5f4..d54435c6 100644 --- a/README.markdown +++ b/README.markdown @@ -30,7 +30,7 @@ Secure and reliable software update framework for Cocoa developers. ## Requirements * Runtime: macOS 10.7 or greater -* Build: Xcode 7 and 10.8 SDK or greater +* Build: Xcode 7 and 10.11 SDK or greater * HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/)) ## Usage