Enable -Weverything for Debug builds

This commit is contained in:
Pierre-Olivier Latour
2014-03-20 08:56:54 -07:00
parent 0a48f42ccb
commit ed0f3ac68e
4 changed files with 20 additions and 10 deletions
+3 -3
View File
@@ -157,7 +157,7 @@ static dispatch_queue_t _formatterQueue = NULL;
if (remainingLength >= 0) {
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];
if (result != size) {
if (result != (NSInteger)size) {
LOG_ERROR(@"Failed writing request body on socket %i (error %i)", _socket, (int)result);
return false;
}
@@ -173,8 +173,8 @@ static dispatch_queue_t _formatterQueue = NULL;
block(NO);
}
} else {
DNOT_REACHED();
block(NO);
DNOT_REACHED();
}
} else {
block(NO);
@@ -360,7 +360,7 @@ static dispatch_queue_t _formatterQueue = NULL;
NSInteger length = _request.contentLength;
if (initialData.length) {
NSInteger result = [_request write:initialData.bytes maxLength:initialData.length];
if (result == initialData.length) {
if (result == (NSInteger)initialData.length) {
length -= initialData.length;
DCHECK(length >= 0);
} else {
+2 -2
View File
@@ -529,7 +529,7 @@ static NSStringEncoding _StringEncodingFromCharset(NSString* charset) {
NSUInteger dataLength = range.location - 2;
if (_tmpPath) {
ssize_t result = write(_tmpFile, dataBytes, dataLength);
if (result == dataLength) {
if (result == (ssize_t)dataLength) {
if (close(_tmpFile) == 0) {
_tmpFile = 0;
GCDWebServerMultiPartFile* file = [[GCDWebServerMultiPartFile alloc] initWithContentType:_contentType fileName:_fileName temporaryPath:_tmpPath];
@@ -567,7 +567,7 @@ static NSStringEncoding _StringEncodingFromCharset(NSString* charset) {
if (_tmpPath && (_parserData.length > margin)) {
NSUInteger length = _parserData.length - margin;
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];
} else {
DNOT_REACHED();
+4 -4
View File
@@ -181,7 +181,7 @@
- (NSInteger)read:(void*)buffer maxLength:(NSUInteger)length {
DCHECK(_offset >= 0);
NSInteger size = 0;
if (_offset < _data.length) {
if (_offset < (NSInteger)_data.length) {
size = MIN(_data.length - _offset, length);
bcopy((char*)_data.bytes + _offset, buffer, size);
_offset += size;
@@ -282,10 +282,10 @@
}
if ((range.location != NSNotFound) || (range.length > 0)) {
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);
} 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;
}
if (range.length == 0) {
@@ -337,7 +337,7 @@
if (_file <= 0) {
return NO;
}
if (lseek(_file, _offset, SEEK_SET) != _offset) {
if (lseek(_file, _offset, SEEK_SET) != (off_t)_offset) {
close(_file);
_file = 0;
return NO;
+11 -1
View File
@@ -314,7 +314,16 @@
CLANG_ENABLE_OBJC_ARC = YES;
GCC_OPTIMIZATION_LEVEL = 0;
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;
};
@@ -323,6 +332,7 @@
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
GCC_PREPROCESSOR_DEFINITIONS = NDEBUG;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
WARNING_CFLAGS = "-Wall";
};
name = Release;