From 3fa648204c6b89e16b9f9d89dd5705f42e087bb6 Mon Sep 17 00:00:00 2001 From: Nathaniel Bomberger Date: Sun, 29 Oct 2017 23:10:39 -0700 Subject: [PATCH] Code cleanup - Xcode 9 build warning/issue. Summary: Xcode 9 has compiler settings that are more strict. This can occur if someone updates there project to use the default settings. This patch declares the default type instead of allowing the compiler to determine it. Instead of `()` we now say `(void)` in a block call. It was just annoying me, and it has no side effects. If there are side effects, then we should fix the type and not go with empty to represent void. Update project settings in Xcode. This code doesn't have any known side effects since the compiler assumes the type is void when not declared. [DOCS] - Fixed potential compiler build issue on Xcode 9 after updating settings in project. Closes https://github.com/facebook/react-native/pull/16554 Differential Revision: D6184949 Pulled By: shergin fbshipit-source-id: 23083248a39c56f5cf50b5ff4390629dd6335f84 --- Libraries/Image/RCTImageStoreManager.h | 2 +- Libraries/Image/RCTImageStoreManager.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/Image/RCTImageStoreManager.h b/Libraries/Image/RCTImageStoreManager.h index 9d7ddffd4..2bdffbe30 100644 --- a/Libraries/Image/RCTImageStoreManager.h +++ b/Libraries/Image/RCTImageStoreManager.h @@ -11,7 +11,7 @@ * Set and get cached image data asynchronously. It is safe to call these from any * thread. The callbacks will be called on an unspecified thread. */ -- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)())block; +- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)(void))block; - (void)storeImageData:(NSData *)imageData withBlock:(void (^)(NSString *imageTag))block; - (void)getImageDataForTag:(NSString *)imageTag withBlock:(void (^)(NSData *imageData))block; diff --git a/Libraries/Image/RCTImageStoreManager.m b/Libraries/Image/RCTImageStoreManager.m index d57971de6..87fe71387 100644 --- a/Libraries/Image/RCTImageStoreManager.m +++ b/Libraries/Image/RCTImageStoreManager.m @@ -37,7 +37,7 @@ RCT_EXPORT_MODULE() return 1; } -- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)())block +- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)(void))block { dispatch_async(_methodQueue, ^{ [self removeImageForTag:imageTag];