diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 2871f021e..083c4b8fb 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -925,7 +925,7 @@ static NSTimeInterval launchStartedAt; - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification - completionHandler:(void (^)())completionHandler + completionHandler:(void (^)(void))completionHandler { OWSAssertIsOnMainThread(); diff --git a/Signal/src/Jobs/MessageFetcherJob.swift b/Signal/src/Jobs/MessageFetcherJob.swift index 9c4c88c63..52ae389d3 100644 --- a/Signal/src/Jobs/MessageFetcherJob.swift +++ b/Signal/src/Jobs/MessageFetcherJob.swift @@ -26,7 +26,8 @@ public class MessageFetcherJob: NSObject { SwiftSingletons.register(self) } - @discardableResult public func run() -> Promise { + @discardableResult + public func run() -> Promise { Logger.debug("\(self.logTag) in \(#function)") guard signalService.isCensorshipCircumventionActive else { @@ -58,7 +59,9 @@ public class MessageFetcherJob: NSObject { return promise } - @objc public func run() -> AnyPromise { + @objc + @discardableResult + public func run() -> AnyPromise { return AnyPromise(run()) } diff --git a/Signal/src/ViewControllers/ConversationView/Cells/AttachmentUploadView.m b/Signal/src/ViewControllers/ConversationView/Cells/AttachmentUploadView.m index cf28de377..9e707185c 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/AttachmentUploadView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/AttachmentUploadView.m @@ -138,8 +138,8 @@ NS_ASSUME_NONNULL_BEGIN NSString *attachmentID = [userinfo objectForKey:kAttachmentUploadAttachmentIDKey]; if ([self.attachment.uniqueId isEqual:attachmentID]) { if (!isnan(progress)) { - [self.progressView setProgress:progress]; - self.lastProgress = progress; + [self.progressView setProgress:(CGFloat)progress]; + self.lastProgress = (CGFloat)progress; self.isAttachmentReady = self.attachment.isUploaded; } else { OWSFail(@"%@ Invalid attachment progress.", self.logTag); diff --git a/Signal/src/ViewControllers/HomeView/HomeViewCell.m b/Signal/src/ViewControllers/HomeView/HomeViewCell.m index 68d6eac7b..760f88c6b 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewCell.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewCell.m @@ -67,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN UIView *selectedBackgroundView = [UIView new]; selectedBackgroundView.backgroundColor = - [(UIColor.isThemeEnabled ? [UIColor ows_whiteColor] : [UIColor ows_blackColor]) colorWithAlphaComponent:0.08]; + [(UIColor.isThemeEnabled ? [UIColor ows_whiteColor] : [UIColor ows_blackColor]) colorWithAlphaComponent:0.08f]; self.selectedBackgroundView = selectedBackgroundView; diff --git a/SignalMessaging/SignalMessaging.h b/SignalMessaging/SignalMessaging.h index 1a6d3cdbd..cce161506 100644 --- a/SignalMessaging/SignalMessaging.h +++ b/SignalMessaging/SignalMessaging.h @@ -34,12 +34,14 @@ FOUNDATION_EXPORT const unsigned char SignalMessagingVersionString[]; #import #import #import +#import #import #import #import #import #import #import +#import #import #import #import diff --git a/SignalMessaging/ViewControllers/ScreenLockViewController.m b/SignalMessaging/ViewControllers/ScreenLockViewController.m index 958ee2cc3..24659c879 100644 --- a/SignalMessaging/ViewControllers/ScreenLockViewController.m +++ b/SignalMessaging/ViewControllers/ScreenLockViewController.m @@ -53,7 +53,7 @@ NSString *NSStringForScreenLockUIState(ScreenLockUIState value) const CGSize screenSize = UIScreen.mainScreen.bounds.size; const CGFloat shortScreenDimension = MIN(screenSize.width, screenSize.height); - const CGFloat imageSize = round(shortScreenDimension / 3.f); + const CGFloat imageSize = (CGFloat)round(shortScreenDimension / 3.f); [imageView autoSetDimension:ALDimensionWidth toSize:imageSize]; [imageView autoSetDimension:ALDimensionHeight toSize:imageSize]; diff --git a/SignalMessaging/categories/UIColor+OWS.m b/SignalMessaging/categories/UIColor+OWS.m index 22c242908..bbf0c9b35 100644 --- a/SignalMessaging/categories/UIColor+OWS.m +++ b/SignalMessaging/categories/UIColor+OWS.m @@ -2,8 +2,8 @@ // Copyright (c) 2018 Open Whisper Systems. All rights reserved. // -#import "OWSMath.h" #import "UIColor+OWS.h" +#import "OWSMath.h" #import "UIUtil.h" #import #import @@ -42,7 +42,7 @@ NSString *const UIColorKeyThemeEnabled = @"UIColorKeyThemeEnabled"; + (UIColor *)ows_signalBrandBlueColor { - return [UIColor colorWithRed:0.1135657504 green:0.4787300229 blue:0.89595204589999999 alpha:1.]; + return [UIColor colorWithRed:0.1135657504f green:0.4787300229f blue:0.89595204589999999f alpha:1.]; } + (UIColor *)ows_materialBlueColor diff --git a/SignalMessaging/categories/UIView+OWS.m b/SignalMessaging/categories/UIView+OWS.m index a55cf0371..7ff361669 100644 --- a/SignalMessaging/categories/UIView+OWS.m +++ b/SignalMessaging/categories/UIView+OWS.m @@ -19,7 +19,7 @@ static const CGFloat kIPhone7PlusScreenWidth = 414.f; CGFloat ScaleFromIPhone5To7Plus(CGFloat iPhone5Value, CGFloat iPhone7PlusValue) { CGFloat screenShortDimension = ScreenShortDimension(); - return round(CGFloatLerp(iPhone5Value, + return (CGFloat)round(CGFloatLerp(iPhone5Value, iPhone7PlusValue, CGFloatInverseLerp(screenShortDimension, kIPhone5ScreenWidth, kIPhone7PlusScreenWidth))); } @@ -27,7 +27,7 @@ CGFloat ScaleFromIPhone5To7Plus(CGFloat iPhone5Value, CGFloat iPhone7PlusValue) CGFloat ScaleFromIPhone5(CGFloat iPhone5Value) { CGFloat screenShortDimension = ScreenShortDimension(); - return round(iPhone5Value * screenShortDimension / kIPhone5ScreenWidth); + return (CGFloat)round(iPhone5Value * screenShortDimension / kIPhone5ScreenWidth); } #pragma mark - @@ -135,7 +135,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value) - (NSLayoutConstraint *)autoPinToAspectRatio:(CGFloat)ratio { // Clamp to ensure view has reasonable aspect ratio. - CGFloat clampedRatio = CGFloatClamp(ratio, 0.05, 95.0); + CGFloat clampedRatio = CGFloatClamp(ratio, 0.05f, 95.0f); if (clampedRatio != ratio) { OWSFail(@"Invalid aspect ratio: %f for view: %@", ratio, self); } @@ -254,10 +254,9 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value) { OWSAssert(self.superview); - self.frame = CGRectMake(round((self.superview.width - self.width) * 0.5f), - round((self.superview.height - self.height) * 0.5f), - self.width, - self.height); + CGFloat x = (CGFloat)round((self.superview.width - self.width) * 0.5f); + CGFloat y = (CGFloat)round((self.superview.height - self.height) * 0.5f); + self.frame = CGRectMake(x, y, self.width, self.height); } #pragma mark - RTL diff --git a/SignalMessaging/contacts/OWSContactsManager.m b/SignalMessaging/contacts/OWSContactsManager.m index 9f576679e..8c0ac14a7 100644 --- a/SignalMessaging/contacts/OWSContactsManager.m +++ b/SignalMessaging/contacts/OWSContactsManager.m @@ -332,7 +332,7 @@ NSString *const OWSContactsManagerSignalAccountsDidChangeNotification NSMutableSet *seenRecipientIds = [NSMutableSet new]; for (Contact *contact in contacts) { NSArray *signalRecipients = contactIdToSignalRecipientsMap[contact.uniqueId]; - for (SignalRecipient *signalRecipient in [signalRecipients sortedArrayUsingSelector:@selector(compare:)]) { + for (SignalRecipient *signalRecipient in [signalRecipients sortedArrayUsingSelector:@selector((compare:))]) { if ([seenRecipientIds containsObject:signalRecipient.recipientId]) { DDLogDebug(@"Ignoring duplicate contact: %@, %@", signalRecipient.recipientId, contact.fullName); continue; diff --git a/SignalMessaging/environment/migrations/OWS105AttachmentFilePaths.m b/SignalMessaging/environment/migrations/OWS105AttachmentFilePaths.m index 7542315d7..571e22224 100644 --- a/SignalMessaging/environment/migrations/OWS105AttachmentFilePaths.m +++ b/SignalMessaging/environment/migrations/OWS105AttachmentFilePaths.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // #import "OWS105AttachmentFilePaths.h" @@ -32,7 +32,7 @@ static NSString *const OWS105AttachmentFilePathsMigrationId = @"105"; [attachmentStreams addObject:attachmentStream]; }]; - DDLogInfo(@"Saving %zd attachment streams.", attachmentStreams.count); + DDLogInfo(@"Saving %lu attachment streams.", (unsigned long)attachmentStreams.count); // Persist the new localRelativeFilePath property of TSAttachmentStream. // For performance, we want to upgrade all existing attachment streams in diff --git a/SignalMessaging/environment/migrations/OWSResaveCollectionDBMigration.m b/SignalMessaging/environment/migrations/OWSResaveCollectionDBMigration.m index f38e67812..666f4f9fb 100644 --- a/SignalMessaging/environment/migrations/OWSResaveCollectionDBMigration.m +++ b/SignalMessaging/environment/migrations/OWSResaveCollectionDBMigration.m @@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN NSMutableArray *recordIds = [NSMutableArray new]; [dbConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) { [recordIds addObjectsFromArray:[transaction allKeysInCollection:collection]]; - DDLogInfo(@"%@ Migrating %zd records from: %@.", self.logTag, recordIds.count, collection); + DDLogInfo(@"%@ Migrating %lu records from: %@.", self.logTag, (unsigned long)recordIds.count, collection); } completionQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) completionBlock:^{ @@ -45,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN OWSAssert(dbConnection); OWSAssert(completion); - DDLogVerbose(@"%@ %s: %zd", self.logTag, __PRETTY_FUNCTION__, recordIds.count); + DDLogVerbose(@"%@ %s: %lu", self.logTag, __PRETTY_FUNCTION__, (unsigned long)recordIds.count); if (recordIds.count < 1) { completion(); diff --git a/SignalMessaging/profiles/OWSProfileManager.m b/SignalMessaging/profiles/OWSProfileManager.m index 72bcd180c..93254a9c4 100644 --- a/SignalMessaging/profiles/OWSProfileManager.m +++ b/SignalMessaging/profiles/OWSProfileManager.m @@ -531,14 +531,14 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640; - (void)logProfileWhitelist { [self.dbConnection asyncReadWithBlock:^(YapDatabaseReadTransaction *transaction) { - DDLogError(@"kOWSProfileManager_UserWhitelistCollection: %zd", - [transaction numberOfKeysInCollection:kOWSProfileManager_UserWhitelistCollection]); + DDLogError(@"kOWSProfileManager_UserWhitelistCollection: %lu", + (unsigned long)[transaction numberOfKeysInCollection:kOWSProfileManager_UserWhitelistCollection]); [transaction enumerateKeysInCollection:kOWSProfileManager_UserWhitelistCollection usingBlock:^(NSString *_Nonnull key, BOOL *_Nonnull stop) { DDLogError(@"\t profile whitelist user: %@", key); }]; - DDLogError(@"kOWSProfileManager_GroupWhitelistCollection: %zd", - [transaction numberOfKeysInCollection:kOWSProfileManager_GroupWhitelistCollection]); + DDLogError(@"kOWSProfileManager_GroupWhitelistCollection: %lu", + (unsigned long)[transaction numberOfKeysInCollection:kOWSProfileManager_GroupWhitelistCollection]); [transaction enumerateKeysInCollection:kOWSProfileManager_GroupWhitelistCollection usingBlock:^(NSString *_Nonnull key, BOOL *_Nonnull stop) { DDLogError(@"\t profile whitelist group: %@", key); diff --git a/SignalMessaging/profiles/OWSUserProfile.m b/SignalMessaging/profiles/OWSUserProfile.m index 0a2f460a4..2fcc75ace 100644 --- a/SignalMessaging/profiles/OWSUserProfile.m +++ b/SignalMessaging/profiles/OWSUserProfile.m @@ -330,11 +330,11 @@ NSString *const kLocalProfileUniqueId = @"kLocalProfileUniqueId"; // This should only be used in verbose, developer-only logs. - (NSString *)debugDescription { - return [NSString stringWithFormat:@"%@ %p %@ %zd %@ %@ %@", + return [NSString stringWithFormat:@"%@ %p %@ %lu %@ %@ %@", self.logTag, self, self.recipientId, - self.profileKey.keyData.length, + (unsigned long)self.profileKey.keyData.length, self.profileName, self.avatarUrlPath, self.avatarFileName]; diff --git a/SignalMessaging/utils/OWSAudioPlayer.m b/SignalMessaging/utils/OWSAudioPlayer.m index 7863704ef..302ffe4aa 100644 --- a/SignalMessaging/utils/OWSAudioPlayer.m +++ b/SignalMessaging/utils/OWSAudioPlayer.m @@ -155,7 +155,7 @@ NS_ASSUME_NONNULL_BEGIN self.delegate.audioPlaybackState = AudioPlaybackState_Paused; [self.audioPlayer pause]; [self.audioPlayerPoller invalidate]; - [self.delegate setAudioProgress:[self.audioPlayer currentTime] duration:[self.audioPlayer duration]]; + [self.delegate setAudioProgress:(CGFloat)[self.audioPlayer currentTime] duration:(CGFloat)[self.audioPlayer duration]]; [OWSAudioSession.shared endAudioActivity:self.audioActivity]; [DeviceSleepManager.sharedInstance removeBlockWithBlockObject:self]; @@ -194,7 +194,7 @@ NS_ASSUME_NONNULL_BEGIN OWSAssert(self.audioPlayer); OWSAssert(self.audioPlayerPoller); - [self.delegate setAudioProgress:[self.audioPlayer currentTime] duration:[self.audioPlayer duration]]; + [self.delegate setAudioProgress:(CGFloat)[self.audioPlayer currentTime] duration:(CGFloat)[self.audioPlayer duration]]; } - (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag diff --git a/SignalMessaging/utils/OWSContactAvatarBuilder.m b/SignalMessaging/utils/OWSContactAvatarBuilder.m index c190f5145..0cf165082 100644 --- a/SignalMessaging/utils/OWSContactAvatarBuilder.m +++ b/SignalMessaging/utils/OWSContactAvatarBuilder.m @@ -124,7 +124,7 @@ NS_ASSUME_NONNULL_BEGIN [initials appendString:@"#"]; } - CGFloat fontSize = (CGFloat)self.diameter / 2.8; + CGFloat fontSize = (CGFloat)self.diameter / 2.8f; UIImage *image = [[JSQMessagesAvatarImageFactory avatarImageWithUserInitials:initials backgroundColor:self.color diff --git a/SignalMessaging/utils/OWSMath.h b/SignalMessaging/utils/OWSMath.h index 4d4826017..e48779f71 100644 --- a/SignalMessaging/utils/OWSMath.h +++ b/SignalMessaging/utils/OWSMath.h @@ -30,7 +30,7 @@ static inline CGFloat CGFloatInverseLerp(CGFloat value, CGFloat minValue, CGFloa // Ceil to an even number static inline CGFloat CeilEven(CGFloat value) { - return 2.f * ceil(value * 0.5f); + return 2.f * (CGFloat)ceil(value * 0.5f); } void SetRandFunctionSeed(void); diff --git a/SignalMessaging/utils/ThreadUtil.m b/SignalMessaging/utils/ThreadUtil.m index e70951a8c..6d8c62cd1 100644 --- a/SignalMessaging/utils/ThreadUtil.m +++ b/SignalMessaging/utils/ThreadUtil.m @@ -731,7 +731,7 @@ NS_ASSUME_NONNULL_BEGIN OWSProdLogAndFail(@"%@ couldn't load uniqueIds for collection: %@.", self.logTag, collection); return; } - DDLogInfo(@"%@ Deleting %zd objects from: %@", self.logTag, uniqueIds.count, collection); + DDLogInfo(@"%@ Deleting %lu objects from: %@", self.logTag, (unsigned long)uniqueIds.count, collection); NSUInteger count = 0; for (NSString *uniqueId in uniqueIds) { // We need to fetch each object, since [TSYapDatabaseObject removeWithTransaction:] sometimes does important @@ -744,7 +744,7 @@ NS_ASSUME_NONNULL_BEGIN [object removeWithTransaction:transaction]; count++; }; - DDLogInfo(@"%@ Deleted %zd/%zd objects from: %@", self.logTag, count, uniqueIds.count, collection); + DDLogInfo(@"%@ Deleted %lu/%lu objects from: %@", self.logTag, (unsigned long)count, (unsigned long)uniqueIds.count, collection); } #pragma mark - Find Content diff --git a/SignalServiceKit/src/Account/TSAccountManager.m b/SignalServiceKit/src/Account/TSAccountManager.m index 0a5533296..e8805612d 100644 --- a/SignalServiceKit/src/Account/TSAccountManager.m +++ b/SignalServiceKit/src/Account/TSAccountManager.m @@ -414,7 +414,7 @@ NSString *const TSAccountManager_ServerSignalingKey = @"TSStorageServerSignaling case 423: { NSString *localizedMessage = NSLocalizedString(@"REGISTRATION_VERIFICATION_FAILED_WRONG_PIN", "Error message indicating that registration failed due to a missing or incorrect 2FA PIN."); - DDLogError(@"%@ 2FA PIN required: %ld", self.logTag, error.code); + DDLogError(@"%@ 2FA PIN required: %ld", self.logTag, (long)error.code); NSError *error = OWSErrorWithCodeDescription(OWSErrorCodeRegistrationMissing2FAPIN, localizedMessage); failureBlock(error); diff --git a/SignalServiceKit/src/Devices/OWSReadReceiptsForSenderMessage.m b/SignalServiceKit/src/Devices/OWSReadReceiptsForSenderMessage.m index ae7a29a48..37fd29c0e 100644 --- a/SignalServiceKit/src/Devices/OWSReadReceiptsForSenderMessage.m +++ b/SignalServiceKit/src/Devices/OWSReadReceiptsForSenderMessage.m @@ -85,7 +85,7 @@ NS_ASSUME_NONNULL_BEGIN - (NSString *)debugDescription { - return [NSString stringWithFormat:@"%@ with message timestamps: %zd", self.logTag, self.messageTimestamps.count]; + return [NSString stringWithFormat:@"%@ with message timestamps: %lu", self.logTag, (unsigned long)self.messageTimestamps.count]; } @end diff --git a/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.h b/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.h index 1d2e62159..040b941ef 100644 --- a/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.h +++ b/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.h @@ -36,23 +36,23 @@ typedef NS_ENUM(int32_t, TSErrorMessageType) { quotedMessage:(nullable TSQuotedMessage *)quotedMessage contactShare:(nullable OWSContact *)contact NS_UNAVAILABLE; +- (instancetype)initWithTimestamp:(uint64_t)timestamp + inThread:(nullable TSThread *)thread + messageBody:(nullable NSString *)body + attachmentIds:(NSArray *)attachmentIds + expiresInSeconds:(uint32_t)expiresInSeconds + expireStartedAt:(uint64_t)expireStartedAt NS_UNAVAILABLE; + - (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; - (instancetype)initWithTimestamp:(uint64_t)timestamp - inThread:(TSThread *)thread + inThread:(nullable TSThread *)thread failedMessageType:(TSErrorMessageType)errorMessageType recipientId:(nullable NSString *)recipientId NS_DESIGNATED_INITIALIZER; -- (instancetype)initWithTimestamp:(uint64_t)timestamp - inThread:(TSThread *)thread - failedMessageType:(TSErrorMessageType)errorMessageType; - - (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(nullable TSThread *)thread - messageBody:(nullable NSString *)body - attachmentIds:(NSArray *)attachmentIds - expiresInSeconds:(uint32_t)expiresInSeconds - expireStartedAt:(uint64_t)expireStartedAt NS_UNAVAILABLE; + failedMessageType:(TSErrorMessageType)errorMessageType; + (instancetype)corruptedMessageWithEnvelope:(OWSSignalServiceProtosEnvelope *)envelope withTransaction:(YapDatabaseReadWriteTransaction *)transaction; diff --git a/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.m b/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.m index 550aa1b92..ccb97a143 100644 --- a/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.m +++ b/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.m @@ -48,14 +48,7 @@ NSUInteger TSErrorMessageSchemaVersion = 1; } - (instancetype)initWithTimestamp:(uint64_t)timestamp - inThread:(TSThread *)thread - failedMessageType:(TSErrorMessageType)errorMessageType -{ - return [self initWithTimestamp:timestamp inThread:thread failedMessageType:errorMessageType recipientId:nil]; -} - -- (instancetype)initWithTimestamp:(uint64_t)timestamp - inThread:(TSThread *)thread + inThread:(nullable TSThread *)thread failedMessageType:(TSErrorMessageType)errorMessageType recipientId:(nullable NSString *)recipientId { @@ -83,6 +76,13 @@ NSUInteger TSErrorMessageSchemaVersion = 1; return self; } +- (instancetype)initWithTimestamp:(uint64_t)timestamp + inThread:(nullable TSThread *)thread + failedMessageType:(TSErrorMessageType)errorMessageType +{ + return [self initWithTimestamp:timestamp inThread:thread failedMessageType:errorMessageType recipientId:nil]; +} + - (instancetype)initWithEnvelope:(OWSSignalServiceProtosEnvelope *)envelope withTransaction:(YapDatabaseReadWriteTransaction *)transaction failedMessageType:(TSErrorMessageType)errorMessageType diff --git a/SignalServiceKit/src/Messages/OWSBatchMessageProcessor.m b/SignalServiceKit/src/Messages/OWSBatchMessageProcessor.m index d33fc9607..7c875f7dc 100644 --- a/SignalServiceKit/src/Messages/OWSBatchMessageProcessor.m +++ b/SignalServiceKit/src/Messages/OWSBatchMessageProcessor.m @@ -356,11 +356,11 @@ NSString *const OWSMessageContentJobFinderExtensionGroup = @"OWSMessageContentJo backgroundTask = nil; - DDLogVerbose(@"%@ completed %lu/%lu jobs. %zd jobs left.", + DDLogVerbose(@"%@ completed %lu/%lu jobs. %lu jobs left.", self.logTag, (unsigned long)processedJobs.count, (unsigned long)batchJobs.count, - [OWSMessageContentJob numberOfKeysInCollection]); + (unsigned long)[OWSMessageContentJob numberOfKeysInCollection]); // Wait a bit in hopes of increasing the batch size. // This delay won't affect the first message to arrive when this queue is idle, diff --git a/SignalServiceKit/src/Messages/OWSMessageManager.m b/SignalServiceKit/src/Messages/OWSMessageManager.m index 1cf944b0e..74f49f420 100644 --- a/SignalServiceKit/src/Messages/OWSMessageManager.m +++ b/SignalServiceKit/src/Messages/OWSMessageManager.m @@ -257,9 +257,9 @@ NS_ASSUME_NONNULL_BEGIN DDLogInfo(@"%@ Missing message for delivery receipt: %llu", self.logTag, timestamp); } else { if (messages.count > 1) { - DDLogInfo(@"%@ More than one message (%zd) for delivery receipt: %llu", + DDLogInfo(@"%@ More than one message (%lu) for delivery receipt: %llu", self.logTag, - messages.count, + (unsigned long)messages.count, timestamp); } for (TSOutgoingMessage *outgoingMessage in messages) { diff --git a/SignalServiceKit/src/Messages/OWSReadReceiptManager.m b/SignalServiceKit/src/Messages/OWSReadReceiptManager.m index 0a5c1bf42..551e069b5 100644 --- a/SignalServiceKit/src/Messages/OWSReadReceiptManager.m +++ b/SignalServiceKit/src/Messages/OWSReadReceiptManager.m @@ -226,9 +226,9 @@ NSString *const OWSReadReceiptManagerAreReadReceiptsEnabled = @"areReadReceiptsE [self.messageSender enqueueMessage:message success:^{ - DDLogInfo(@"%@ Successfully sent %zd read receipt to linked devices.", + DDLogInfo(@"%@ Successfully sent %lu read receipt to linked devices.", self.logTag, - readReceiptsForLinkedDevices.count); + (unsigned long)readReceiptsForLinkedDevices.count); } failure:^(NSError *error) { DDLogError(@"%@ Failed to send read receipt to linked devices with error: %@", self.logTag, error); @@ -250,7 +250,7 @@ NSString *const OWSReadReceiptManagerAreReadReceiptsEnabled = @"areReadReceiptsE [self.messageSender enqueueMessage:message success:^{ - DDLogInfo(@"%@ Successfully sent %zd read receipts to sender.", self.logTag, timestamps.count); + DDLogInfo(@"%@ Successfully sent %lu read receipts to sender.", self.logTag, (unsigned long)timestamps.count); } failure:^(NSError *error) { DDLogError(@"%@ Failed to send read receipts to sender with error: %@", self.logTag, error); diff --git a/SignalServiceKit/src/Network/API/TSNetworkManager.m b/SignalServiceKit/src/Network/API/TSNetworkManager.m index b6dfb3215..d0414d70f 100644 --- a/SignalServiceKit/src/Network/API/TSNetworkManager.m +++ b/SignalServiceKit/src/Network/API/TSNetworkManager.m @@ -202,7 +202,7 @@ typedef void (^failureBlock)(NSURLSessionDataTask *task, NSError *error); break; } case 411: { - DDLogInfo(@"Multi-device pairing: %zd, %@, %@", statusCode, networkError.debugDescription, request); + DDLogInfo(@"Multi-device pairing: %ld, %@, %@", (long)statusCode, networkError.debugDescription, request); failureBlock(task, [self errorWithHTTPCode:statusCode description:NSLocalizedString(@"MULTIDEVICE_PAIRING_MAX_DESC", nil) @@ -239,7 +239,7 @@ typedef void (^failureBlock)(NSURLSessionDataTask *task, NSError *error); break; } default: { - DDLogWarn(@"Unknown error: %zd, %@, %@", statusCode, networkError.debugDescription, request); + DDLogWarn(@"Unknown error: %ld, %@, %@", (long)statusCode, networkError.debugDescription, request); failureBlock(task, error); break; } diff --git a/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m b/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m index a187f8275..63eab3066 100644 --- a/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m +++ b/SignalServiceKit/src/Network/WebSockets/TSSocketManager.m @@ -584,8 +584,7 @@ NSString *const kNSNotification_SocketManagerStateDidChange = @"kNSNotification_ if (message.hasBody) { responseData = message.body; } - NSArray *_Nullable responseHeaders = message.headers; - + BOOL hasValidResponse = YES; id responseObject = responseData; if (responseData) { diff --git a/SignalServiceKit/src/Security/OWSWebsocketSecurityPolicy.m b/SignalServiceKit/src/Security/OWSWebsocketSecurityPolicy.m index a86edc5f2..20fdce6d3 100644 --- a/SignalServiceKit/src/Security/OWSWebsocketSecurityPolicy.m +++ b/SignalServiceKit/src/Security/OWSWebsocketSecurityPolicy.m @@ -1,9 +1,10 @@ -// Copyright © 2016 Open Whisper Systems. All rights reserved. +// +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// #import "OWSWebsocketSecurityPolicy.h" - -#import #import "OWSHTTPSecurityPolicy.h" +#import @implementation OWSWebsocketSecurityPolicy @@ -11,7 +12,11 @@ static OWSWebsocketSecurityPolicy *websocketSecurityPolicy = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // We use our own CA websocketSecurityPolicy = [[self alloc] initWithCertificateChainValidationEnabled:NO]; +#pragma clang diagnostic pop }); return websocketSecurityPolicy; } diff --git a/SignalServiceKit/src/Storage/AxolotlStore/OWSPrimaryStorage+SessionStore.m b/SignalServiceKit/src/Storage/AxolotlStore/OWSPrimaryStorage+SessionStore.m index a47cd5264..bcb7a00ca 100644 --- a/SignalServiceKit/src/Storage/AxolotlStore/OWSPrimaryStorage+SessionStore.m +++ b/SignalServiceKit/src/Storage/AxolotlStore/OWSPrimaryStorage+SessionStore.m @@ -2,8 +2,8 @@ // Copyright (c) 2018 Open Whisper Systems. All rights reserved. // -#import "OWSFileSystem.h" #import "OWSPrimaryStorage+SessionStore.h" +#import "OWSFileSystem.h" #import "YapDatabaseConnection+OWS.h" #import "YapDatabaseTransaction+OWS.h" #import @@ -66,6 +66,8 @@ NSString *const kSessionStoreDBConnectionKey = @"kSessionStoreDBConnectionKey"; return record; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (NSArray *)subDevicesSessions:(NSString *)contactIdentifier protocolContext:(nullable id)protocolContext { OWSAssert(contactIdentifier.length > 0); @@ -82,6 +84,7 @@ NSString *const kSessionStoreDBConnectionKey = @"kSessionStoreDBConnectionKey"; return dictionary ? dictionary.allKeys : @[]; } +#pragma clang diagnostic pop - (void)storeSession:(NSString *)contactIdentifier deviceId:(int)deviceId diff --git a/SignalServiceKit/src/Util/NSString+SSK.m b/SignalServiceKit/src/Util/NSString+SSK.m index 90406339c..549d23f4e 100644 --- a/SignalServiceKit/src/Util/NSString+SSK.m +++ b/SignalServiceKit/src/Util/NSString+SSK.m @@ -213,7 +213,7 @@ NS_ASSUME_NONNULL_BEGIN } else if (range.location != index || range.length < 1) { // This should never happen. OWSFail( - @"%@ unexpected composed character sequence: %zd, %@", self.logTag, index, NSStringFromRange(range)); + @"%@ unexpected composed character sequence: %lu, %@", self.logTag, (unsigned long)index, NSStringFromRange(range)); return YES; } index = range.location + range.length; diff --git a/SignalServiceKit/src/Util/OWSAnalytics.m b/SignalServiceKit/src/Util/OWSAnalytics.m index 121831c96..1a5f8178b 100755 --- a/SignalServiceKit/src/Util/OWSAnalytics.m +++ b/SignalServiceKit/src/Util/OWSAnalytics.m @@ -266,10 +266,10 @@ NSString *NSStringForOWSAnalyticsSeverity(OWSAnalyticsSeverity severity) static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ NSOperatingSystemVersion operatingSystemVersion = [[NSProcessInfo processInfo] operatingSystemVersion]; - result = [NSString stringWithFormat:@"%zd.%zd.%zd", - (NSUInteger)operatingSystemVersion.majorVersion, - (NSUInteger)operatingSystemVersion.minorVersion, - (NSUInteger)operatingSystemVersion.patchVersion]; + result = [NSString stringWithFormat:@"%lu.%lu.%lu", + (unsigned long)operatingSystemVersion.majorVersion, + (unsigned long)operatingSystemVersion.minorVersion, + (unsigned long)operatingSystemVersion.patchVersion]; }); return result; } diff --git a/SignalServiceKit/src/Util/OWSOperation.m b/SignalServiceKit/src/Util/OWSOperation.m index 59a005cbd..e9f02949e 100644 --- a/SignalServiceKit/src/Util/OWSOperation.m +++ b/SignalServiceKit/src/Util/OWSOperation.m @@ -98,12 +98,12 @@ NSString *const OWSOperationKeyIsFinished = @"isFinished"; - (void)reportError:(NSError *)error { - DDLogDebug(@"%@ reportError: %@, fatal?: %d, retryable?: %d, remainingRetries: %zd", + DDLogDebug(@"%@ reportError: %@, fatal?: %d, retryable?: %d, remainingRetries: %lu", self.logTag, error, error.isFatal, error.isRetryable, - self.remainingRetries); + (unsigned long)self.remainingRetries); if (error.isFatal) { [self failOperationWithError:error];