Permalink
Browse files

Turn on more warnings

  • Loading branch information...
danielctull committed Jan 3, 2013
1 parent 5b5245a commit 32c4f80faa9564a833a3a587fef61d94fb321437
Showing with 46 additions and 15 deletions.
  1. +31 −0 DCTImageCache.xcodeproj/project.pbxproj
  2. +13 −13 DCTImageCache/DCTImageCache.m
  3. +2 −2 DCTImageCache/_DCTImageCacheDiskCache.m
@@ -616,11 +616,26 @@
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+ GCC_WARN_MISSING_PARENTHESES = YES;
+ GCC_WARN_SHADOW = YES;
+ GCC_WARN_SIGN_COMPARE = YES;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
SDKROOT = iphoneos;
+ WARNING_CFLAGS = "";
};
name = Debug;
};
@@ -633,12 +648,28 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+ GCC_WARN_MISSING_PARENTHESES = YES;
+ GCC_WARN_SHADOW = YES;
+ GCC_WARN_SIGN_COMPARE = YES;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
+ WARNING_CFLAGS = "";
};
name = Release;
};
@@ -92,15 +92,15 @@ - (void)removeImagesWithAttributes:(DCTImageCacheAttributes *)attributes {
_DCTImageCacheProcessManager *processManager = [_DCTImageCacheProcessManager new];
[processManager addCancelProxy:cancelProxy];
- processManager.process = [_diskCache hasImageWithAttributes:attributes handler:^(BOOL hasImage, NSError *error) {
+ processManager.process = [_diskCache hasImageWithAttributes:attributes handler:^(BOOL hasImage, NSError *diskError) {
if (hasImage) {
- [processManager finishWithHasImage:hasImage error:error];
+ [processManager finishWithHasImage:hasImage error:diskError];
return;
}
- processManager.process = [_fetcher fetchImageWithAttributes:attributes handler:^(UIImage *image, NSError *error) {
- [processManager finishWithImage:image error:error];
+ processManager.process = [_fetcher fetchImageWithAttributes:attributes handler:^(UIImage *image, NSError *fetchError) {
+ [processManager finishWithImage:image error:fetchError];
if (!image) return;
[_diskCache setImage:image forAttributes:attributes];
}];
@@ -133,19 +133,19 @@ - (void)removeImagesWithAttributes:(DCTImageCacheAttributes *)attributes {
_DCTImageCacheProcessManager *processManager = [_DCTImageCacheProcessManager new];
[processManager addCancelProxy:cancelProxy];
- processManager.process = [_diskCache fetchImageWithAttributes:attributes handler:^(UIImage *image, NSError *error) {
+ processManager.process = [_diskCache fetchImageWithAttributes:attributes handler:^(UIImage *diskImage, NSError *diskError) {
- if (image) {
- [_memoryCache setImage:image forAttributes:attributes];
- [processManager finishWithImage:image error:error];
+ if (diskImage) {
+ [_memoryCache setImage:diskImage forAttributes:attributes];
+ [processManager finishWithImage:diskImage error:diskError];
return;
}
- processManager.process = [_fetcher fetchImageWithAttributes:attributes handler:^(UIImage *image, NSError *error) {
- [processManager finishWithImage:image error:error];
- if (!image) return;
- [_memoryCache setImage:image forAttributes:attributes];
- [_diskCache setImage:image forAttributes:attributes];
+ processManager.process = [_fetcher fetchImageWithAttributes:attributes handler:^(UIImage *fetchImage, NSError *fetchError) {
+ [processManager finishWithImage:fetchImage error:fetchError];
+ if (!fetchImage) return;
+ [_memoryCache setImage:fetchImage forAttributes:attributes];
+ [_diskCache setImage:fetchImage forAttributes:attributes];
}];
}];
@@ -158,8 +158,8 @@ - (UIImage *)imageWithAttributes:(DCTImageCacheAttributes *)attributes {
_DCTImageCacheItem *item = [items lastObject];
UIImage *image = [NSKeyedUnarchiver unarchiveObjectWithData:item.imageData];
[processManager finishWithImage:image error:nil];
- [items enumerateObjectsUsingBlock:^(_DCTImageCacheItem *item, NSUInteger idx, BOOL *stop) {
- [_managedObjectContext refreshObject:item mergeChanges:NO];
+ [items enumerateObjectsUsingBlock:^(_DCTImageCacheItem *cacheItem, NSUInteger idx, BOOL *stop) {
+ [_managedObjectContext refreshObject:cacheItem mergeChanges:NO];
}];
};
operation.queuePriority = _DCTImageCacheDiskCachePriorityFetch;

0 comments on commit 32c4f80

Please sign in to comment.