Skip to content

Commit

Permalink
Code cleanup - Xcode 9 build warning/issue.
Browse files Browse the repository at this point in the history
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.

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

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.

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAl  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
[DOCS] - Fixed potential compiler build issue on Xcode 9 after updating settings in project.
Closes #16554

Differential Revision: D6184949

Pulled By: shergin

fbshipit-source-id: 23083248a39c56f5cf50b5ff4390629dd6335f84
  • Loading branch information
nbomberger authored and facebook-github-bot committed Oct 30, 2017
1 parent 35ea342 commit 3fa6482
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Libraries/Image/RCTImageStoreManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/RCTImageStoreManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ - (float)handlerPriority
return 1;
}

- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)())block
- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)(void))block
{
dispatch_async(_methodQueue, ^{
[self removeImageForTag:imageTag];
Expand Down

0 comments on commit 3fa6482

Please sign in to comment.