Enable -Weverything for Debug builds
This commit is contained in:
@ -157,7 +157,7 @@ static dispatch_queue_t _formatterQueue = NULL;
|
|||||||
if (remainingLength >= 0) {
|
if (remainingLength >= 0) {
|
||||||
bool success = dispatch_data_apply(buffer, ^bool(dispatch_data_t region, size_t offset, const void* buffer, size_t size) {
|
bool success = dispatch_data_apply(buffer, ^bool(dispatch_data_t region, size_t offset, const void* buffer, size_t size) {
|
||||||
NSInteger result = [_request write:buffer maxLength:size];
|
NSInteger result = [_request write:buffer maxLength:size];
|
||||||
if (result != size) {
|
if (result != (NSInteger)size) {
|
||||||
LOG_ERROR(@"Failed writing request body on socket %i (error %i)", _socket, (int)result);
|
LOG_ERROR(@"Failed writing request body on socket %i (error %i)", _socket, (int)result);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -173,8 +173,8 @@ static dispatch_queue_t _formatterQueue = NULL;
|
|||||||
block(NO);
|
block(NO);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DNOT_REACHED();
|
|
||||||
block(NO);
|
block(NO);
|
||||||
|
DNOT_REACHED();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
block(NO);
|
block(NO);
|
||||||
@ -360,7 +360,7 @@ static dispatch_queue_t _formatterQueue = NULL;
|
|||||||
NSInteger length = _request.contentLength;
|
NSInteger length = _request.contentLength;
|
||||||
if (initialData.length) {
|
if (initialData.length) {
|
||||||
NSInteger result = [_request write:initialData.bytes maxLength:initialData.length];
|
NSInteger result = [_request write:initialData.bytes maxLength:initialData.length];
|
||||||
if (result == initialData.length) {
|
if (result == (NSInteger)initialData.length) {
|
||||||
length -= initialData.length;
|
length -= initialData.length;
|
||||||
DCHECK(length >= 0);
|
DCHECK(length >= 0);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -529,7 +529,7 @@ static NSStringEncoding _StringEncodingFromCharset(NSString* charset) {
|
|||||||
NSUInteger dataLength = range.location - 2;
|
NSUInteger dataLength = range.location - 2;
|
||||||
if (_tmpPath) {
|
if (_tmpPath) {
|
||||||
ssize_t result = write(_tmpFile, dataBytes, dataLength);
|
ssize_t result = write(_tmpFile, dataBytes, dataLength);
|
||||||
if (result == dataLength) {
|
if (result == (ssize_t)dataLength) {
|
||||||
if (close(_tmpFile) == 0) {
|
if (close(_tmpFile) == 0) {
|
||||||
_tmpFile = 0;
|
_tmpFile = 0;
|
||||||
GCDWebServerMultiPartFile* file = [[GCDWebServerMultiPartFile alloc] initWithContentType:_contentType fileName:_fileName temporaryPath:_tmpPath];
|
GCDWebServerMultiPartFile* file = [[GCDWebServerMultiPartFile alloc] initWithContentType:_contentType fileName:_fileName temporaryPath:_tmpPath];
|
||||||
@ -567,7 +567,7 @@ static NSStringEncoding _StringEncodingFromCharset(NSString* charset) {
|
|||||||
if (_tmpPath && (_parserData.length > margin)) {
|
if (_tmpPath && (_parserData.length > margin)) {
|
||||||
NSUInteger length = _parserData.length - margin;
|
NSUInteger length = _parserData.length - margin;
|
||||||
ssize_t result = write(_tmpFile, _parserData.bytes, length);
|
ssize_t result = write(_tmpFile, _parserData.bytes, length);
|
||||||
if (result == length) {
|
if (result == (ssize_t)length) {
|
||||||
[_parserData replaceBytesInRange:NSMakeRange(0, length) withBytes:NULL length:0];
|
[_parserData replaceBytesInRange:NSMakeRange(0, length) withBytes:NULL length:0];
|
||||||
} else {
|
} else {
|
||||||
DNOT_REACHED();
|
DNOT_REACHED();
|
||||||
|
|||||||
@ -181,7 +181,7 @@
|
|||||||
- (NSInteger)read:(void*)buffer maxLength:(NSUInteger)length {
|
- (NSInteger)read:(void*)buffer maxLength:(NSUInteger)length {
|
||||||
DCHECK(_offset >= 0);
|
DCHECK(_offset >= 0);
|
||||||
NSInteger size = 0;
|
NSInteger size = 0;
|
||||||
if (_offset < _data.length) {
|
if (_offset < (NSInteger)_data.length) {
|
||||||
size = MIN(_data.length - _offset, length);
|
size = MIN(_data.length - _offset, length);
|
||||||
bcopy((char*)_data.bytes + _offset, buffer, size);
|
bcopy((char*)_data.bytes + _offset, buffer, size);
|
||||||
_offset += size;
|
_offset += size;
|
||||||
@ -282,10 +282,10 @@
|
|||||||
}
|
}
|
||||||
if ((range.location != NSNotFound) || (range.length > 0)) {
|
if ((range.location != NSNotFound) || (range.length > 0)) {
|
||||||
if (range.location != NSNotFound) {
|
if (range.location != NSNotFound) {
|
||||||
range.location = MIN(range.location, info.st_size);
|
range.location = MIN(range.location, (NSUInteger)info.st_size);
|
||||||
range.length = MIN(range.length, info.st_size - range.location);
|
range.length = MIN(range.length, info.st_size - range.location);
|
||||||
} else {
|
} else {
|
||||||
range.length = MIN(range.length, info.st_size);
|
range.length = MIN(range.length, (NSUInteger)info.st_size);
|
||||||
range.location = info.st_size - range.length;
|
range.location = info.st_size - range.length;
|
||||||
}
|
}
|
||||||
if (range.length == 0) {
|
if (range.length == 0) {
|
||||||
@ -337,7 +337,7 @@
|
|||||||
if (_file <= 0) {
|
if (_file <= 0) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
if (lseek(_file, _offset, SEEK_SET) != _offset) {
|
if (lseek(_file, _offset, SEEK_SET) != (off_t)_offset) {
|
||||||
close(_file);
|
close(_file);
|
||||||
_file = 0;
|
_file = 0;
|
||||||
return NO;
|
return NO;
|
||||||
|
|||||||
@ -314,7 +314,16 @@
|
|||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
WARNING_CFLAGS = "-Wall";
|
WARNING_CFLAGS = (
|
||||||
|
"-Wall",
|
||||||
|
"-Weverything",
|
||||||
|
"-Wno-gnu-statement-expression",
|
||||||
|
"-Wno-direct-ivar-access",
|
||||||
|
"-Wno-implicit-retain-self",
|
||||||
|
"-Wno-assign-enum",
|
||||||
|
"-Wno-format-nonliteral",
|
||||||
|
"-Wno-cast-align",
|
||||||
|
);
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
@ -323,6 +332,7 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = NDEBUG;
|
GCC_PREPROCESSOR_DEFINITIONS = NDEBUG;
|
||||||
|
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||||
WARNING_CFLAGS = "-Wall";
|
WARNING_CFLAGS = "-Wall";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
|
|||||||
Reference in New Issue
Block a user