From 4fdef15a32fe666a90073ffe00da4779d7902a65 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Fri, 6 Oct 2017 13:20:18 -0400 Subject: Fixing block types to support -Wstrict-prototypes. --- Foundation/GTMNSThread+Blocks.h | 6 +++--- Foundation/GTMNSThread+Blocks.m | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'Foundation') diff --git a/Foundation/GTMNSThread+Blocks.h b/Foundation/GTMNSThread+Blocks.h index e3700bb..17bfbc7 100644 --- a/Foundation/GTMNSThread+Blocks.h +++ b/Foundation/GTMNSThread+Blocks.h @@ -30,10 +30,10 @@ // and this method returns immediately. // If self is the current thread, the block will be performed immediately, and // then this method will return. -- (void)gtm_performBlock:(void (^)())block; +- (void)gtm_performBlock:(void (^)(void))block; -- (void)gtm_performWaitingUntilDone:(BOOL)waitDone block:(void (^)())block; -+ (void)gtm_performBlockInBackground:(void (^)())block; +- (void)gtm_performWaitingUntilDone:(BOOL)waitDone block:(void (^)(void))block; ++ (void)gtm_performBlockInBackground:(void (^)(void))block; @end #endif // NS_BLOCKS_AVAILABLE diff --git a/Foundation/GTMNSThread+Blocks.m b/Foundation/GTMNSThread+Blocks.m index 4ab3ee5..8318193 100644 --- a/Foundation/GTMNSThread+Blocks.m +++ b/Foundation/GTMNSThread+Blocks.m @@ -25,11 +25,11 @@ @implementation NSThread (GTMBlocksAdditions) -+ (void)gtm_runBlockOnCurrentThread:(void (^)())block { ++ (void)gtm_runBlockOnCurrentThread:(void (^)(void))block { block(); } -- (void)gtm_performBlock:(void (^)())block { +- (void)gtm_performBlock:(void (^)(void))block { if ([[NSThread currentThread] isEqual:self]) { block(); } else { @@ -37,14 +37,14 @@ } } -- (void)gtm_performWaitingUntilDone:(BOOL)waitDone block:(void (^)())block { +- (void)gtm_performWaitingUntilDone:(BOOL)waitDone block:(void (^)(void))block { [NSThread performSelector:@selector(gtm_runBlockOnCurrentThread:) onThread:self withObject:[[block copy] autorelease] waitUntilDone:waitDone]; } -+ (void)gtm_performBlockInBackground:(void (^)())block { ++ (void)gtm_performBlockInBackground:(void (^)(void))block { [NSThread performSelectorInBackground:@selector(gtm_runBlockOnCurrentThread:) withObject:[[block copy] autorelease]]; } -- cgit v1.2.3