Fix more build warnings.

This commit is contained in:
Matthew Chen 2018-06-01 14:43:04 -04:00
parent 97777ffeb5
commit 6bc145ce3a
11 changed files with 20 additions and 27 deletions

View file

@ -2567,7 +2567,7 @@
attributes = {
LastSwiftUpdateCheck = 0920;
LastTestingUpgradeCheck = 0600;
LastUpgradeCheck = 0910;
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = "Open Whisper Systems";
TargetAttributes = {
453518671FC635DD00210559 = {
@ -3486,6 +3486,7 @@
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_RECEIVER_WEAK = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
@ -3871,7 +3872,7 @@
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
@ -3943,7 +3944,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
@ -4022,7 +4023,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
@ -4086,6 +4087,7 @@
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_RECEIVER_WEAK = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
@ -4156,6 +4158,7 @@
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_RECEIVER_WEAK = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "0940"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
@ -46,7 +45,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "0940"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "0940"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
@ -41,7 +41,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
@ -61,7 +60,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View file

@ -26,7 +26,7 @@ public class MessageFetcherJob: NSObject {
SwiftSingletons.register(self)
}
public func run() -> Promise<Void> {
@discardableResult public func run() -> Promise<Void> {
Logger.debug("\(self.logTag) in \(#function)")
guard signalService.isCensorshipCircumventionActive else {

View file

@ -616,12 +616,12 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
if formattedDate.hasPrefix("00:") {
// Don't show the "hours" portion of the date format unless the
// call duration is at least 1 hour.
formattedDate = formattedDate.substring(from: formattedDate.index(formattedDate.startIndex, offsetBy: 3))
formattedDate = String(formattedDate[formattedDate.index(formattedDate.startIndex, offsetBy: 3)...])
} else {
// If showing the "hours" portion of the date format, strip any leading
// zeroes.
if formattedDate.hasPrefix("0") {
formattedDate = formattedDate.substring(from: formattedDate.index(formattedDate.startIndex, offsetBy: 1))
formattedDate = String(formattedDate[formattedDate.index(formattedDate.startIndex, offsetBy: 1)...])
}
}
return formattedDate

View file

@ -2880,7 +2880,7 @@ typedef enum : NSUInteger {
- (void)resetFrame
{
// fixes bug on frame being off after this selection
CGRect frame = [UIScreen mainScreen].applicationFrame;
CGRect frame = [UIScreen mainScreen].bounds;
self.view.frame = frame;
}

View file

@ -112,19 +112,13 @@ NSString *const Signal_Message_MarkAsRead_Identifier = @"Signal_Message_MarkAsRe
DDLogInfo(@"%@ received remote notification", self.logTag);
[AppReadiness runNowOrWhenAppIsReady:^{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
[self.messageFetcherJob run];
#pragma GCC diagnostic pop
}];
}
- (void)applicationDidBecomeActive {
[AppReadiness runNowOrWhenAppIsReady:^{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
[self.messageFetcherJob run];
#pragma GCC diagnostic pop
}];
}

View file

@ -377,9 +377,9 @@ const NSUInteger kAES256_KeyByteLength = 32;
return [paddedPlainText copy];
} else {
unsigned long paddingSize = paddedPlainText.length - unpaddedSize;
DDLogInfo(@"%@ decrypted padded attachment with unpaddedSize: %u, paddingSize: %lu",
DDLogInfo(@"%@ decrypted padded attachment with unpaddedSize: %lu, paddingSize: %lu",
self.logTag,
unpaddedSize,
(unsigned long)unpaddedSize,
paddingSize);
return [paddedPlainText subdataWithRange:NSMakeRange(0, unpaddedSize)];
}

View file

@ -267,9 +267,9 @@ NSString *NSStringForOWSAnalyticsSeverity(OWSAnalyticsSeverity severity)
dispatch_once(&onceToken, ^{
NSOperatingSystemVersion operatingSystemVersion = [[NSProcessInfo processInfo] operatingSystemVersion];
result = [NSString stringWithFormat:@"%zd.%zd.%zd",
operatingSystemVersion.majorVersion,
operatingSystemVersion.minorVersion,
operatingSystemVersion.patchVersion];
(NSUInteger)operatingSystemVersion.majorVersion,
(NSUInteger)operatingSystemVersion.minorVersion,
(NSUInteger)operatingSystemVersion.patchVersion];
});
return result;
}

View file

@ -98,7 +98,7 @@ NSString *const OWSOperationKeyIsFinished = @"isFinished";
- (void)reportError:(NSError *)error
{
DDLogDebug(@"%@ reportError: %@, fatal?: %d, retryable?: %d, remainingRetries: %d",
DDLogDebug(@"%@ reportError: %@, fatal?: %d, retryable?: %d, remainingRetries: %zd",
self.logTag,
error,
error.isFatal,