Cleanup warnings

Reviewed By: majak

Differential Revision: D3542606

fbshipit-source-id: 41246a012a32fafc4ddbb307c7b9919e3c203393
This commit is contained in:
Pieter De Baets 2016-07-12 05:51:56 -07:00 committed by Facebook Github Bot 2
parent 3be8c957b0
commit 7b7ecdf337
12 changed files with 37 additions and 29 deletions

View File

@ -62,10 +62,10 @@ RCT_EXTERN NSArray<Class> *RCTGetModuleClasses(void);
{ {
RCTAssertParam(bridge); RCTAssertParam(bridge);
if ((self = [super initWithBundleURL:bridge.bundleURL if (self = [super initWithDelegate:bridge.delegate
moduleProvider:bridge.moduleProvider bundleURL:bridge.bundleURL
launchOptions:bridge.launchOptions])) { moduleProvider:bridge.moduleProvider
launchOptions:bridge.launchOptions]) {
_parentBridge = bridge; _parentBridge = bridge;
/** /**
@ -87,6 +87,11 @@ RCT_EXTERN NSArray<Class> *RCTGetModuleClasses(void);
return self; return self;
} }
RCT_NOT_IMPLEMENTED(- (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate
bundleURL:(NSURL *)bundleURL
moduleProvider:(RCTBridgeModuleProviderBlock)block
launchOptions:(NSDictionary *)launchOptions)
- (void)start - (void)start
{ {
dispatch_queue_t bridgeQueue = dispatch_queue_create("com.facebook.react.RCTBridgeQueue", DISPATCH_QUEUE_CONCURRENT); dispatch_queue_t bridgeQueue = dispatch_queue_create("com.facebook.react.RCTBridgeQueue", DISPATCH_QUEUE_CONCURRENT);
@ -97,7 +102,7 @@ RCT_EXTERN NSArray<Class> *RCTGetModuleClasses(void);
dispatch_group_enter(initModulesAndLoadSource); dispatch_group_enter(initModulesAndLoadSource);
__weak RCTBatchedBridge *weakSelf = self; __weak RCTBatchedBridge *weakSelf = self;
__block NSData *sourceCode; __block NSData *sourceCode;
[self loadSource:^(NSError *error, NSData *source, int64_t sourceLength) { [self loadSource:^(NSError *error, NSData *source, __unused int64_t sourceLength) {
if (error) { if (error) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf stopLoadingWithError:error]; [weakSelf stopLoadingWithError:error];

View File

@ -18,6 +18,12 @@
RCTPerformanceLogger *_performanceLogger; RCTPerformanceLogger *_performanceLogger;
} }
// Private designated initializer
- (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate
bundleURL:(NSURL *)bundleURL
moduleProvider:(RCTBridgeModuleProviderBlock)block
launchOptions:(NSDictionary *)launchOptions NS_DESIGNATED_INITIALIZER;
// Used for the profiler flow events between JS and native // Used for the profiler flow events between JS and native
@property (nonatomic, assign) int64_t flowID; @property (nonatomic, assign) int64_t flowID;
@property (nonatomic, assign) CFMutableDictionaryRef flowIDMap; @property (nonatomic, assign) CFMutableDictionaryRef flowIDMap;

View File

@ -79,7 +79,7 @@ RCT_EXTERN NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass);
* or configuration. * or configuration.
*/ */
- (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate - (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate
launchOptions:(NSDictionary *)launchOptions NS_DESIGNATED_INITIALIZER; launchOptions:(NSDictionary *)launchOptions;
/** /**
* DEPRECATED: Use initWithDelegate:launchOptions: instead * DEPRECATED: Use initWithDelegate:launchOptions: instead
@ -93,7 +93,7 @@ RCT_EXTERN NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass);
*/ */
- (instancetype)initWithBundleURL:(NSURL *)bundleURL - (instancetype)initWithBundleURL:(NSURL *)bundleURL
moduleProvider:(RCTBridgeModuleProviderBlock)block moduleProvider:(RCTBridgeModuleProviderBlock)block
launchOptions:(NSDictionary *)launchOptions NS_DESIGNATED_INITIALIZER; launchOptions:(NSDictionary *)launchOptions;
/** /**
* This method is used to call functions in the JavaScript application context. * This method is used to call functions in the JavaScript application context.

View File

@ -126,15 +126,12 @@ static RCTBridge *RCTCurrentBridgeInstance = nil;
launchOptions:launchOptions]; launchOptions:launchOptions];
} }
/**
* Private designated initializer
*/
- (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate - (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate
bundleURL:(NSURL *)bundleURL bundleURL:(NSURL *)bundleURL
moduleProvider:(RCTBridgeModuleProviderBlock)block moduleProvider:(RCTBridgeModuleProviderBlock)block
launchOptions:(NSDictionary *)launchOptions launchOptions:(NSDictionary *)launchOptions
{ {
if ((self = [super init])) { if (self = [super init]) {
_performanceLogger = [RCTPerformanceLogger new]; _performanceLogger = [RCTPerformanceLogger new];
[_performanceLogger markStartForTag:RCTPLBridgeStartup]; [_performanceLogger markStartForTag:RCTPLBridgeStartup];
[_performanceLogger markStartForTag:RCTPLTTI]; [_performanceLogger markStartForTag:RCTPLTTI];

View File

@ -144,7 +144,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
static NSTimeInterval lastCommand = 0; static NSTimeInterval lastCommand = 0;
static NSTimeInterval lastDoubleCommand = 0; static NSTimeInterval lastDoubleCommand = 0;
static NSString *lastInput = nil; static NSString *lastInput = nil;
static UIKeyModifierFlags lastModifierFlags = nil; static UIKeyModifierFlags lastModifierFlags = 0;
if (firstPress) { if (firstPress) {
for (RCTKeyCommand *command in [RCTKeyCommands sharedInstance].commands) { for (RCTKeyCommand *command in [RCTKeyCommands sharedInstance].commands) {

View File

@ -118,7 +118,7 @@
return _data[tag][1] - _data[tag][0]; return _data[tag][1] - _data[tag][0];
} }
- (int64_t)valueForTag:(RCTPLTag)tag; - (int64_t)valueForTag:(RCTPLTag)tag
{ {
return _data[tag][1]; return _data[tag][1];
} }

View File

@ -383,7 +383,7 @@ RCT_EXPORT_METHOD(dismiss)
[self dismiss]; [self dismiss];
} }
- (void)redBoxWindow:(RCTRedBoxWindow *)redBoxWindow openStackFrameInEditor:(RCTJSStackFrame *)stackFrame - (void)redBoxWindow:(__unused RCTRedBoxWindow *)redBoxWindow openStackFrameInEditor:(RCTJSStackFrame *)stackFrame
{ {
if (![_bridge.bundleURL.scheme hasPrefix:@"http"]) { if (![_bridge.bundleURL.scheme hasPrefix:@"http"]) {
RCTLogWarn(@"Cannot open stack frame in editor because you're not connected to the packager."); RCTLogWarn(@"Cannot open stack frame in editor because you're not connected to the packager.");
@ -402,7 +402,7 @@ RCT_EXPORT_METHOD(dismiss)
[[[NSURLSession sharedSession] dataTaskWithRequest:request] resume]; [[[NSURLSession sharedSession] dataTaskWithRequest:request] resume];
} }
- (void)reloadFromRedBoxWindow:(RCTRedBoxWindow *)redBoxWindow { - (void)reloadFromRedBoxWindow:(__unused RCTRedBoxWindow *)redBoxWindow {
[[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification object:nil userInfo:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification object:nil userInfo:nil];
} }
@ -428,7 +428,7 @@ RCT_EXPORT_METHOD(dismiss)
- (void)showErrorMessage:(NSString *)message withRawStack:(NSString *)rawStack {} - (void)showErrorMessage:(NSString *)message withRawStack:(NSString *)rawStack {}
- (void)showErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack {} - (void)showErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack {}
- (void)updateErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack {} - (void)updateErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack {}
- (void)showErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack showIfHidden:(BOOL)shouldShow {} - (void)showErrorMessage:(NSString *)message withStack:(NSArray<NSDictionary *> *)stack isUpdate:(BOOL)isUpdate {}
- (void)dismiss {} - (void)dismiss {}
@end @end

View File

@ -168,7 +168,6 @@ RCT_EXPORT_MODULE()
NSDate *nextScheduledTarget = [NSDate distantFuture]; NSDate *nextScheduledTarget = [NSDate distantFuture];
NSMutableArray<NSNumber *> *timersToCall = [NSMutableArray new]; NSMutableArray<NSNumber *> *timersToCall = [NSMutableArray new];
for (_RCTTimer *timer in _timers.allValues) { for (_RCTTimer *timer in _timers.allValues) {
NSDate *target = timer.target;
if ([timer updateFoundNeedsJSUpdate]) { if ([timer updateFoundNeedsJSUpdate]) {
[timersToCall addObject:timer.callbackID]; [timersToCall addObject:timer.callbackID];
} }

View File

@ -558,11 +558,11 @@ dispatch_queue_t RCTGetUIManagerQueue(void)
} RCTFrameData; } RCTFrameData;
// Construct arrays then hand off to main thread // Construct arrays then hand off to main thread
NSInteger count = viewsWithNewFrames.count; NSUInteger count = viewsWithNewFrames.count;
NSMutableArray *reactTags = [[NSMutableArray alloc] initWithCapacity:count]; NSMutableArray *reactTags = [[NSMutableArray alloc] initWithCapacity:count];
NSMutableData *framesData = [[NSMutableData alloc] initWithLength:sizeof(RCTFrameData) * count]; NSMutableData *framesData = [[NSMutableData alloc] initWithLength:sizeof(RCTFrameData) * count];
{ {
NSInteger index = 0; NSUInteger index = 0;
RCTFrameData *frameDataArray = (RCTFrameData *)framesData.mutableBytes; RCTFrameData *frameDataArray = (RCTFrameData *)framesData.mutableBytes;
for (RCTShadowView *shadowView in viewsWithNewFrames) { for (RCTShadowView *shadowView in viewsWithNewFrames) {
reactTags[index] = shadowView.reactTag; reactTags[index] = shadowView.reactTag;
@ -849,7 +849,7 @@ RCT_EXPORT_METHOD(removeRootView:(nonnull NSNumber *)rootReactTag)
UIView *rootView = viewRegistry[rootReactTag]; UIView *rootView = viewRegistry[rootReactTag];
[uiManager _purgeChildren:(NSArray<id<RCTComponent>> *)rootView.reactSubviews [uiManager _purgeChildren:(NSArray<id<RCTComponent>> *)rootView.reactSubviews
fromRegistry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)viewRegistry]; fromRegistry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)viewRegistry];
[(NSMutableDictionary<NSNumber *, UIView *> *)viewRegistry removeObjectForKey:rootReactTag]; [(NSMutableDictionary *)viewRegistry removeObjectForKey:rootReactTag];
[[NSNotificationCenter defaultCenter] postNotificationName:RCTUIManagerDidRemoveRootViewNotification [[NSNotificationCenter defaultCenter] postNotificationName:RCTUIManagerDidRemoveRootViewNotification
object:uiManager object:uiManager

View File

@ -17,10 +17,10 @@
@property (nonatomic, assign) BOOL animateDrop; @property (nonatomic, assign) BOOL animateDrop;
@property (nonatomic, strong) UIColor *tintColor; @property (nonatomic, strong) UIColor *tintColor;
@property (nonatomic, strong) UIImage *image; @property (nonatomic, strong) UIImage *image;
@property (nonatomic, assign) NSInteger viewIndex; @property (nonatomic, assign) NSUInteger viewIndex;
@property (nonatomic, assign) NSInteger leftCalloutViewIndex; @property (nonatomic, assign) NSUInteger leftCalloutViewIndex;
@property (nonatomic, assign) NSInteger rightCalloutViewIndex; @property (nonatomic, assign) NSUInteger rightCalloutViewIndex;
@property (nonatomic, assign) NSInteger detailCalloutViewIndex; @property (nonatomic, assign) NSUInteger detailCalloutViewIndex;
@property (nonatomic, assign) BOOL draggable; @property (nonatomic, assign) BOOL draggable;
@end @end

View File

@ -370,7 +370,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
return _navigationController; return _navigationController;
} }
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer - (BOOL)gestureRecognizerShouldBegin:(__unused UIGestureRecognizer *)gestureRecognizer
{ {
return _navigationController.viewControllers.count > 1; return _navigationController.viewControllers.count > 1;
} }

View File

@ -9,11 +9,9 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@class RCTShadowView;
#import "RCTComponent.h" #import "RCTComponent.h"
//TODO: let's try to eliminate this category if possible @class RCTShadowView;
@interface UIView (React) <RCTComponent> @interface UIView (React) <RCTComponent>
@ -73,11 +71,14 @@
- (void)reactDidMakeFirstResponder; - (void)reactDidMakeFirstResponder;
- (BOOL)reactRespondsToTouch:(UITouch *)touch; - (BOOL)reactRespondsToTouch:(UITouch *)touch;
#if RCT_DEV
/** /**
Tools for debugging Tools for debugging
*/ */
#if RCT_DEV
@property (nonatomic, strong, setter=_DEBUG_setReactShadowView:) RCTShadowView *_DEBUG_reactShadowView; @property (nonatomic, strong, setter=_DEBUG_setReactShadowView:) RCTShadowView *_DEBUG_reactShadowView;
#endif #endif
@end @end