Skip to content

Commit 3e3d573

Browse files
authored
Fix compiler warnings for Xcode 16.3 (#2709)
Also silence project upgrade warnings.
1 parent 057702e commit 3e3d573

17 files changed

+23
-18
lines changed

Autoupdate/SPUSparkleDeltaArchive.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ - (void)finishEncodingItems
11411141
} else if (S_ISLNK(extractMode)) {
11421142
off_t fileSize = itemFileInfo.st_size;
11431143
if (fileSize > UINT16_MAX) {
1144-
_error = [NSError errorWithDomain:SPARKLE_DELTA_ARCHIVE_ERROR_DOMAIN code:SPARKLE_DELTA_ARCHIVE_ERROR_CODE_LINK_TOO_LONG userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Link path has a destination that is too long: %llu bytes", fileSize] }];
1144+
_error = [NSError errorWithDomain:SPARKLE_DELTA_ARCHIVE_ERROR_DOMAIN code:SPARKLE_DELTA_ARCHIVE_ERROR_CODE_LINK_TOO_LONG userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Link path has a destination that is too long: %lld bytes", fileSize] }];
11451145
break;
11461146
}
11471147

Autoupdate/SUBinaryDeltaApply.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa
389389
}
390390

391391
if (verbose) {
392-
fprintf(stderr, "\n👮 %s %s (0%o)", VERBOSE_MODIFIED, [relativePath fileSystemRepresentation], mode & PERMISSION_FLAGS);
392+
fprintf(stderr, "\n👮 %s %s (0%o)", VERBOSE_MODIFIED, [relativePath fileSystemRepresentation], (unsigned int)(mode & PERMISSION_FLAGS));
393393
}
394394
}
395395
}];

Autoupdate/SUBinaryDeltaCreate.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
477477
fprintf(stderr, "\n");
478478
}
479479
if (error != NULL) {
480-
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Permissions for Sparkle executable must be 0%o (found 0%o) on file %@", VALID_SPARKLE_EXECUTABLE_PERMISSIONS, permissions, @(ent->fts_path)] }];
480+
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Permissions for Sparkle executable must be 0%o (found 0%o) on file %@", (unsigned int)VALID_SPARKLE_EXECUTABLE_PERMISSIONS, permissions, @(ent->fts_path)] }];
481481
}
482482
return NO;
483483
}
@@ -591,7 +591,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
591591
fprintf(stderr, "\n");
592592
}
593593
if (error != NULL) {
594-
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Permissions for Sparkle executable must be 0%o (found 0%o) on file %@", VALID_SPARKLE_EXECUTABLE_PERMISSIONS, permissions, @(ent->fts_path)] }];
594+
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Permissions for Sparkle executable must be 0%o (found 0%o) on file %@", (unsigned int)VALID_SPARKLE_EXECUTABLE_PERMISSIONS, permissions, @(ent->fts_path)] }];
595595
}
596596
return NO;
597597
}

Autoupdate/SUCodeSigningVerifier.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ + (BOOL)codeSignatureIsValidAtBundleURL:(NSURL *)newBundleURL andMatchesSignatur
6868
// See https://github.com/sparkle-project/Sparkle/issues/376#issuecomment-48824267 and https://developer.apple.com/library/mac/technotes/tn2206
6969
// Additionally, there are several reasons to stay away from deep verification and to prefer EdDSA signing the download archive instead.
7070
// See https://github.com/sparkle-project/Sparkle/pull/523#commitcomment-17549302 and https://github.com/sparkle-project/Sparkle/issues/543
71-
SecCSFlags flags = (SecCSFlags) (kSecCSDefaultFlags | kSecCSCheckAllArchitectures);
71+
SecCSFlags flags = kSecCSCheckAllArchitectures;
7272
result = SecStaticCodeCheckValidityWithErrors(staticCode, flags, requirement, &cfError);
7373

7474
if (result != errSecSuccess) {
@@ -154,7 +154,7 @@ + (BOOL)codeSignatureIsValidAtBundleURL:(NSURL *)bundleURL checkNestedCode:(BOOL
154154
}
155155

156156
// See in -codeSignatureIsValidAtBundleURL:andMatchesSignatureAtBundleURL:error: for why kSecCSCheckNestedCode is not always passed
157-
SecCSFlags flags = (SecCSFlags) (kSecCSDefaultFlags | kSecCSCheckAllArchitectures);
157+
SecCSFlags flags = kSecCSCheckAllArchitectures;
158158
if (checkNestedCode) {
159159
flags |= kSecCSCheckNestedCode;
160160
}

Configurations/ConfigCommon.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,4 @@ GCC_WARN_UNUSED_PARAMETER = YES
164164
GCC_WARN_UNUSED_VARIABLE = YES
165165

166166
// Turn on all warnings, then disable a few which are almost impossible to avoid
167-
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access -Wno-declaration-after-statement -Wno-gnu-conditional-omitted-operand -Werror=undef
167+
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access -Wno-declaration-after-statement -Wno-gnu-conditional-omitted-operand -Wno-switch-default -Wno-missing-include-dirs -Werror=undef

Sparkle.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3016,7 +3016,7 @@
30163016
attributes = {
30173017
CLASSPREFIX = SU;
30183018
LastSwiftUpdateCheck = 1020;
3019-
LastUpgradeCheck = 1400;
3019+
LastUpgradeCheck = 1630;
30203020
ORGANIZATIONNAME = "Sparkle Project";
30213021
TargetAttributes = {
30223022
5D06E8CF0FD68C7C005AE3F6 = {

Sparkle.xcodeproj/xcshareddata/xcschemes/BinaryDelta.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1400"
3+
LastUpgradeVersion = "1630"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1400"
3+
LastUpgradeVersion = "1630"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle Test App.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1400"
3+
LastUpgradeVersion = "1630"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1400"
3+
LastUpgradeVersion = "1630"
44
version = "2.0">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)