Proper function prototypes

// FREEBIE
This commit is contained in:
Michael Kirk 2017-11-30 16:57:56 -08:00
parent 5705b256e9
commit 5e7ca89930
16 changed files with 29 additions and 27 deletions

View File

@ -802,7 +802,7 @@ extension URLSessionTask {
return
}
guard let httpResponse = task.response as? HTTPURLResponse else {
Logger.error("\(TAG) missing or unexpected response: \(task.response)")
Logger.error("\(TAG) missing or unexpected response: \(String(describing: task.response))")
segmentRequestDidFail(assetRequest:assetRequest, assetSegment:assetSegment)
return
}

View File

@ -344,7 +344,7 @@ static const NSTimeInterval kSignedPreKeyUpdateFailureMaxFailureDuration = 10 *
[self clearSignedPreKeyRecordsWithKeyId:currentSignedPrekeyId success:nil];
}
+ (void)clearSignedPreKeyRecordsWithKeyId:(NSNumber *)keyId success:(void (^_Nullable)())successHandler
+ (void)clearSignedPreKeyRecordsWithKeyId:(NSNumber *)keyId success:(void (^_Nullable)(void))successHandler
{
if (!keyId) {
OWSFail(@"%@ Ignoring request to clear signed preKeys since no keyId was specified", self.logTag);

View File

@ -305,7 +305,7 @@ static const CGFloat kAttachmentDownloadProgressTheta = 0.001f;
return;
}
void (^abortDownload)() = ^{
void (^abortDownload)(void) = ^{
OWSFail(@"%@ Download aborted.", self.logTag);
[task cancel];
};

View File

@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
@class OWSSignalServiceProtosEnvelope;
typedef void (^DecryptSuccessBlock)(NSData *_Nullable plaintextData);
typedef void (^DecryptFailureBlock)();
typedef void (^DecryptFailureBlock)(void);
@interface OWSMessageDecrypter : OWSMessageHandler

View File

@ -47,7 +47,7 @@ static const CGFloat kAttachmentUploadProgressTheta = 0.001f;
success:(void (^)(void))successHandler
failure:(RetryableFailureHandler)failureHandler
{
void (^successHandlerWrapper)() = ^{
void (^successHandlerWrapper)(void) = ^{
[self fireProgressNotification:1 attachmentId:attachmentStream.uniqueId];
successHandler();
@ -61,7 +61,7 @@ static const CGFloat kAttachmentUploadProgressTheta = 0.001f;
if (attachmentStream.serverId) {
DDLogDebug(@"%@ Attachment previously uploaded.", self.logTag);
successHandlerWrapper(outgoingMessage);
successHandlerWrapper();
return;
}

View File

@ -1,4 +1,6 @@
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "TSRequest.h"
@ -12,4 +14,4 @@ NS_ASSUME_NONNULL_BEGIN
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END

View File

@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface TSProfileAvatarUploadFormRequest : TSRequest
- (nullable instancetype)init;
- (instancetype)init;
@end

View File

@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
@implementation TSProfileAvatarUploadFormRequest
- (nullable instancetype)init
- (instancetype)init
{
self = [super initWithURL:[NSURL URLWithString:textSecureProfileAvatarFormAPI]];

View File

@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)auditAsync;
// completion, if present, will be invoked on the main thread.
+ (void)auditAndCleanupAsync:(void (^_Nullable)())completion;
+ (void)auditAndCleanupAsync:(void (^_Nullable)(void))completion;
+ (NSSet<NSString *> *)filePathsInAttachmentsFolder;

View File

@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
});
}
+ (void)auditAndCleanupAsync:(void (^_Nullable)())completion
+ (void)auditAndCleanupAsync:(void (^_Nullable)(void))completion
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[OWSOrphanedDataCleaner auditAndCleanup:YES completion:completion];
@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN
// They can't be cleaned up - we don't want to delete the TSAttachmentStream or
// its corresponding message. Better that the broken message shows up in the
// conversation view.
+ (void)auditAndCleanup:(BOOL)shouldCleanup completion:(void (^_Nullable)())completion
+ (void)auditAndCleanup:(BOOL)shouldCleanup completion:(void (^_Nullable)(void))completion
{
NSSet<NSString *> *diskFilePaths = [self filePathsInAttachmentsFolder];
long long totalFileSize = [self fileSizeOfFilePaths:diskFilePaths.allObjects];

View File

@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
* Specifically, these migration should not depend on or affect the data
* of any database view.
*/
- (void)setupDatabaseWithSafeBlockingMigrations:(void (^_Nonnull)())safeBlockingMigrationsBlock;
- (void)setupDatabaseWithSafeBlockingMigrations:(void (^_Nonnull)(void))safeBlockingMigrationsBlock;
- (void)deleteThreadsAndMessages;
- (void)resetSignalStorage;

View File

@ -307,7 +307,7 @@ void setDatabaseInitialized()
};
}
- (void)setupDatabaseWithSafeBlockingMigrations:(void (^_Nonnull)())safeBlockingMigrationsBlock
- (void)setupDatabaseWithSafeBlockingMigrations:(void (^_Nonnull)(void))safeBlockingMigrationsBlock
{
// Synchronously register extensions which are essential for views.
[TSDatabaseView registerCrossProcessNotifier];

View File

@ -44,7 +44,7 @@ typedef NS_ENUM(NSUInteger, OWSAnalyticsSeverity) {
@end
typedef NSDictionary<NSString *, id> *_Nonnull (^OWSProdAssertParametersBlock)();
typedef NSDictionary<NSString *, id> *_Nonnull (^OWSProdAssertParametersBlock)(void);
// These methods should be used to assert errors for which we want to fire analytics events.
//

View File

@ -222,8 +222,8 @@ NSString *NSStringForOWSAnalyticsSeverity(OWSAnalyticsSeverity severity)
- (void)submitEvent:(NSDictionary *)eventDictionary
eventKey:(NSString *)eventKey
success:(void (^_Nonnull)())successBlock
failure:(void (^_Nonnull)())failureBlock
success:(void (^_Nonnull)(void))successBlock
failure:(void (^_Nonnull)(void))failureBlock
{
OWSAssert(eventDictionary);
OWSAssert(eventKey);
@ -311,7 +311,7 @@ NSString *NSStringForOWSAnalyticsSeverity(OWSAnalyticsSeverity severity)
return;
}
void (^addEvent)() = ^{
void (^addEvent)(void) = ^{
// Add super properties.
NSMutableDictionary *eventProperties = (properties ? [properties mutableCopy] : [NSMutableDictionary new]);
[eventProperties addEntriesFromDictionary:self.eventSuperProperties];

View File

@ -24,6 +24,6 @@ NS_ASSUME_NONNULL_BEGIN
@end
void AssertIsOnMainThread();
void AssertIsOnMainThread(void);
NS_ASSUME_NONNULL_END

View File

@ -30,12 +30,12 @@ typedef NS_ENUM(NSInteger, OWSErrorCode) {
};
extern NSError *OWSErrorWithCodeDescription(OWSErrorCode code, NSString *description);
extern NSError *OWSErrorMakeUnableToProcessServerResponseError();
extern NSError *OWSErrorMakeFailedToSendOutgoingMessageError();
extern NSError *OWSErrorMakeNoSuchSignalRecipientError();
extern NSError *OWSErrorMakeAssertionError();
extern NSError *OWSErrorMakeMessageSendDisabledDueToPreKeyUpdateFailuresError();
extern NSError *OWSErrorMakeMessageSendFailedToBlockListError();
extern NSError *OWSErrorMakeWriteAttachmentDataError();
extern NSError *OWSErrorMakeUnableToProcessServerResponseError(void);
extern NSError *OWSErrorMakeFailedToSendOutgoingMessageError(void);
extern NSError *OWSErrorMakeNoSuchSignalRecipientError(void);
extern NSError *OWSErrorMakeAssertionError(void);
extern NSError *OWSErrorMakeMessageSendDisabledDueToPreKeyUpdateFailuresError(void);
extern NSError *OWSErrorMakeMessageSendFailedToBlockListError(void);
extern NSError *OWSErrorMakeWriteAttachmentDataError(void);
NS_ASSUME_NONNULL_END