mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
Increased warning levels to -Wall -Wextra, and fixed Xcode 7 beta issues
Summary: @public I've increased the warning levels in the OSS frameworks, which caught a bunch of minor issues. I also fixed some new errors in Xcode 7 relating to designated initializers and TLS security. Test Plan: * Test the sample apps and make sure they still work. * Run tests.
This commit is contained in:
@@ -246,8 +246,9 @@ static __strong NSData *CRLFCRLF;
|
||||
|
||||
- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray *)protocols;
|
||||
{
|
||||
RCTAssertParam(request);
|
||||
|
||||
if ((self = [super init])) {
|
||||
assert(request.URL);
|
||||
_url = request.URL;
|
||||
_urlRequest = request;
|
||||
|
||||
@@ -255,23 +256,24 @@ static __strong NSData *CRLFCRLF;
|
||||
|
||||
[self _RCTSR_commonInit];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
RCT_NOT_IMPLEMENTED(-init)
|
||||
|
||||
- (instancetype)initWithURLRequest:(NSURLRequest *)request;
|
||||
{
|
||||
return [self initWithURLRequest:request protocols:nil];
|
||||
}
|
||||
|
||||
- (instancetype)initWithURL:(NSURL *)url;
|
||||
- (instancetype)initWithURL:(NSURL *)URL;
|
||||
{
|
||||
return [self initWithURL:url protocols:nil];
|
||||
return [self initWithURL:URL protocols:nil];
|
||||
}
|
||||
|
||||
- (instancetype)initWithURL:(NSURL *)url protocols:(NSArray *)protocols;
|
||||
- (instancetype)initWithURL:(NSURL *)URL protocols:(NSArray *)protocols;
|
||||
{
|
||||
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
|
||||
NSURLRequest *request = URL ? [NSURLRequest requestWithURL:URL] : nil;
|
||||
return [self initWithURLRequest:request protocols:protocols];
|
||||
}
|
||||
|
||||
@@ -1610,7 +1612,7 @@ static NSRunLoop *networkRunLoop = nil;
|
||||
_runLoop = [NSRunLoop currentRunLoop];
|
||||
dispatch_group_leave(_waitGroup);
|
||||
|
||||
NSTimer *timer = [[NSTimer alloc] initWithFireDate:[NSDate distantFuture] interval:0.0 target:nil selector:nil userInfo:nil repeats:NO];
|
||||
NSTimer *timer = [[NSTimer alloc] initWithFireDate:[NSDate distantFuture] interval:0.0 target:self selector:@selector(step) userInfo:nil repeats:NO];
|
||||
[_runLoop addTimer:timer forMode:NSDefaultRunLoopMode];
|
||||
|
||||
while ([_runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]) { }
|
||||
@@ -1618,6 +1620,11 @@ static NSRunLoop *networkRunLoop = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)step
|
||||
{
|
||||
// Does nothing
|
||||
}
|
||||
|
||||
- (NSRunLoop *)runLoop;
|
||||
{
|
||||
dispatch_group_wait(_waitGroup, DISPATCH_TIME_FOREVER);
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
@@ -159,6 +160,10 @@
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
WARNING_CFLAGS = (
|
||||
"-Werror",
|
||||
"-Wall",
|
||||
);
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -187,6 +192,7 @@
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
@@ -195,6 +201,10 @@
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
WARNING_CFLAGS = (
|
||||
"-Werror",
|
||||
"-Wall",
|
||||
);
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -202,6 +212,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
@@ -218,6 +229,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
|
||||
@@ -43,7 +43,9 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (instancetype)initWithURL:(NSURL *)URL
|
||||
{
|
||||
if (self = [super init]) {
|
||||
RCTAssertParam(URL);
|
||||
|
||||
if ((self = [super init])) {
|
||||
_url = URL;
|
||||
}
|
||||
return self;
|
||||
|
||||
Reference in New Issue
Block a user