From 51b62de4cb48d5c02e42fa28a6281c6bacc0ab5c Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Sat, 13 Jun 2015 02:30:13 -0700 Subject: [PATCH] Fix some warnings. --- Sparkle/SUAppcastItem.m | 2 +- Sparkle/SUDiskImageUnarchiver.m | 2 +- Sparkle/SUGuidedPackageInstaller.m | 5 +++-- Sparkle/SUHost.m | 2 +- Sparkle/SUPlainInstallerInternals.m | 14 +++++++------- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Sparkle/SUAppcastItem.m b/Sparkle/SUAppcastItem.m index 0f5b7920..1407d3fa 100644 --- a/Sparkle/SUAppcastItem.m +++ b/Sparkle/SUAppcastItem.m @@ -167,7 +167,7 @@ NSMutableDictionary *fakeAppCastDict = [dict mutableCopy]; [fakeAppCastDict removeObjectForKey:SUAppcastElementDeltas]; fakeAppCastDict[SURSSElementEnclosure] = deltaDictionary; - SUAppcastItem *deltaItem = [[[self class] alloc] initWithDictionary:fakeAppCastDict]; + SUAppcastItem *deltaItem = [[SUAppcastItem alloc] initWithDictionary:fakeAppCastDict]; deltas[deltaDictionary[SUAppcastAttributeDeltaFrom]] = deltaItem; } diff --git a/Sparkle/SUDiskImageUnarchiver.m b/Sparkle/SUDiskImageUnarchiver.m index f5d39fd9..a7ee21c6 100644 --- a/Sparkle/SUDiskImageUnarchiver.m +++ b/Sparkle/SUDiskImageUnarchiver.m @@ -65,7 +65,7 @@ CFRelease(uuid); } } - while (noErr == FSPathMakeRefWithOptions((UInt8 *)[mountPoint fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &tmpRef, NULL)); + while (noErr == FSPathMakeRefWithOptions((const UInt8 *)[mountPoint fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &tmpRef, NULL)); NSData *promptData = nil; promptData = [NSData dataWithBytes:"yes\n" length:4]; diff --git a/Sparkle/SUGuidedPackageInstaller.m b/Sparkle/SUGuidedPackageInstaller.m index bc83d42b..7537e30a 100644 --- a/Sparkle/SUGuidedPackageInstaller.m +++ b/Sparkle/SUGuidedPackageInstaller.m @@ -71,9 +71,10 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza validAuth = AuthorizationCopyRights(auth, &rights, kAuthorizationEmptyEnvironment, - kAuthorizationFlagPreAuthorize | + (AuthorizationFlags) + (kAuthorizationFlagPreAuthorize | kAuthorizationFlagExtendRights | - kAuthorizationFlagInteractionAllowed, + kAuthorizationFlagInteractionAllowed), NULL); if (validAuth != errAuthorizationSuccess) { diff --git a/Sparkle/SUHost.m b/Sparkle/SUHost.m index 8f559a87..a1b87634 100644 --- a/Sparkle/SUHost.m +++ b/Sparkle/SUHost.m @@ -151,7 +151,7 @@ typedef struct { if (!icon) { BOOL isMainBundle = (self.bundle == [NSBundle mainBundle]); - NSString *fileType = isMainBundle ? (NSString *)kUTTypeApplication : (NSString *)kUTTypeBundle; + NSString *fileType = isMainBundle ? (__bridge NSString *)kUTTypeApplication : (__bridge NSString *)kUTTypeBundle; icon = [[NSWorkspace sharedWorkspace] iconForFileType:fileType]; } return icon; diff --git a/Sparkle/SUPlainInstallerInternals.m b/Sparkle/SUPlainInstallerInternals.m index 41b297e8..1edd33a6 100644 --- a/Sparkle/SUPlainInstallerInternals.m +++ b/Sparkle/SUPlainInstallerInternals.m @@ -117,7 +117,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza FSVolumeRefNum vSrcRefNum = kFSInvalidVolumeRefNum; FSCatalogInfo catInfo; memset(&catInfo, 0, sizeof(catInfo)); - OSStatus err = FSPathMakeRef((UInt8 *)[path fileSystemRepresentation], &pathRef, NULL); + OSStatus err = FSPathMakeRef((const UInt8 *)[path fileSystemRepresentation], &pathRef, NULL); if( err == noErr ) { err = FSGetCatalogInfo(&pathRef, kFSCatInfoVolume, &catInfo, NULL, NULL, NULL); @@ -461,7 +461,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza NSString *tmpPath = [self _temporaryCopyNameForPath:dst didFindTrash:&didFindTrash]; // Make FSRef for destination: - err = FSPathMakeRefWithOptions((UInt8 *)[dst fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &dstRef, NULL); + err = FSPathMakeRefWithOptions((const UInt8 *)[dst fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &dstRef, NULL); hadFileAtDest = (err == noErr); // There is a file at the destination, move it aside. If we normalized the name, we might not get here, so don't error. if( hadFileAtDest ) { @@ -481,12 +481,12 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza if( hadFileAtDest ) { - err = FSPathMakeRef((UInt8 *)[[tmpPath stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); + err = FSPathMakeRef((const UInt8 *)[[tmpPath stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); if (err != noErr) - FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); + FSPathMakeRef((const UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); } - err = FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &dstDirRef, NULL); + err = FSPathMakeRef((const UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &dstDirRef, NULL); if (err == noErr && hadFileAtDest) { @@ -500,7 +500,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza } } - err = FSPathMakeRef((UInt8 *)[src fileSystemRepresentation], &srcRef, NULL); + err = FSPathMakeRef((const UInt8 *)[src fileSystemRepresentation], &srcRef, NULL); if (err == noErr) { NSFileManager *manager = [[NSFileManager alloc] init]; @@ -572,7 +572,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza NSFileManager *manager = [NSFileManager defaultManager]; #if __MAC_OS_X_VERSION_MIN_REQUIRED < 101000 if (!&NSURLQuarantinePropertiesKey) { - NSString *const quarantineAttribute = (NSString*)kLSItemQuarantineProperties; + NSString *const quarantineAttribute = (__bridge NSString *)kLSItemQuarantineProperties; const int removeXAttrOptions = XATTR_NOFOLLOW; [self removeXAttr:quarantineAttribute