From 62c532d7b50082cbd2cd73644490f65024f7fa3b Mon Sep 17 00:00:00 2001 From: David Beck Date: Sat, 8 Aug 2015 17:55:19 -0700 Subject: [PATCH] Fixed compile warnings --- CacheKit.podspec | 1 - Example/CacheKit.xcodeproj/project.pbxproj | 7 ++++++- .../xcshareddata/xcschemes/CacheKit.xcscheme | 19 ++++++++++++------- Example/CacheKit/CacheKit-Info.plist | 2 +- Example/Podfile.lock | 19 ++++++++++++------- Example/Tests/Tests-Info.plist | 2 +- Pod/FastImages/CKFastImage.h | 2 +- Pod/FastImages/CKFastImage.m | 18 +++++++++++++----- 8 files changed, 46 insertions(+), 24 deletions(-) diff --git a/CacheKit.podspec b/CacheKit.podspec index 00800c5..8c1388a 100644 --- a/CacheKit.podspec +++ b/CacheKit.podspec @@ -23,6 +23,5 @@ Pod::Spec.new do |spec| fast_images_spec.dependency 'CacheKit/Core' fast_images_spec.ios.source_files = 'Pod/FastImages' - fast_images_spec.osx.source_files = '' end end diff --git a/Example/CacheKit.xcodeproj/project.pbxproj b/Example/CacheKit.xcodeproj/project.pbxproj index 9d4064c..48d3cfc 100644 --- a/Example/CacheKit.xcodeproj/project.pbxproj +++ b/Example/CacheKit.xcodeproj/project.pbxproj @@ -253,7 +253,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = CK; - LastUpgradeCheck = 0510; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "David Beck"; TargetAttributes = { 6003F5AD195388D20070C39A = { @@ -451,6 +451,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -515,6 +516,7 @@ GCC_PREFIX_HEADER = "CacheKit/CacheKit-Prefix.pch"; INFOPLIST_FILE = "CacheKit/CacheKit-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.0; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -530,6 +532,7 @@ GCC_PREFIX_HEADER = "CacheKit/CacheKit-Prefix.pch"; INFOPLIST_FILE = "CacheKit/CacheKit-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.0; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -552,6 +555,7 @@ "$(inherited)", ); INFOPLIST_FILE = "Tests/Tests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; WRAPPER_EXTENSION = xctest; @@ -571,6 +575,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; INFOPLIST_FILE = "Tests/Tests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; WRAPPER_EXTENSION = xctest; diff --git a/Example/CacheKit.xcodeproj/xcshareddata/xcschemes/CacheKit.xcscheme b/Example/CacheKit.xcodeproj/xcshareddata/xcschemes/CacheKit.xcscheme index d6f83eb..c99a932 100644 --- a/Example/CacheKit.xcodeproj/xcshareddata/xcschemes/CacheKit.xcscheme +++ b/Example/CacheKit.xcodeproj/xcshareddata/xcschemes/CacheKit.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -48,17 +48,21 @@ ReferencedContainer = "container:CacheKit.xcodeproj"> + + - + - + CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 2d959c7..a313c0a 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,7 +1,12 @@ PODS: - - CacheKit (0.1.1): - - CacheKit/standard (= 0.1.1) - - CacheKit/standard (0.1.1): + - CacheKit (0.3.0): + - CacheKit/Core (= 0.3.0) + - CacheKit/FastImages (= 0.3.0) + - FMDB (~> 2.4) + - CacheKit/Core (0.3.0): + - FMDB (~> 2.4) + - CacheKit/FastImages (0.3.0): + - CacheKit/Core - FMDB (~> 2.4) - FMDB (2.5): - FMDB/standard (= 2.5) @@ -14,10 +19,10 @@ DEPENDENCIES: EXTERNAL SOURCES: CacheKit: - :path: ../ + :path: "../" SPEC CHECKSUMS: - CacheKit: 9e996d0228ff11ccf2575b9e40615d8ee04d92ba - FMDB: 0efa188cf0dd1ce82c27a478cd5f5fa245308677 + CacheKit: 1942ea8f30e63bc6d8aae24ebcb868600d60def3 + FMDB: 96e8f1bcc1329e269330f99770ad4285d9003e52 -COCOAPODS: 0.36.0 +COCOAPODS: 0.38.2 diff --git a/Example/Tests/Tests-Info.plist b/Example/Tests/Tests-Info.plist index 41520ed..169b6f7 100644 --- a/Example/Tests/Tests-Info.plist +++ b/Example/Tests/Tests-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/Pod/FastImages/CKFastImage.h b/Pod/FastImages/CKFastImage.h index ae26c11..47b77c1 100644 --- a/Pod/FastImages/CKFastImage.h +++ b/Pod/FastImages/CKFastImage.h @@ -59,7 +59,7 @@ typedef NS_ENUM(uint8_t, CKFastImageStyle) { @param bytes The buffer containing image data. @return A new `CKFastImage` instance. */ -- (instancetype)initWithBytesNoCopy:(const void *)bytes length:(NSUInteger)length NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithBytesNoCopy:(const void *)data length:(NSUInteger)length size:(CGSize)size scale:(CGFloat)scale style:(CKFastImageStyle)style NS_DESIGNATED_INITIALIZER; /** The bytes representing the image. diff --git a/Pod/FastImages/CKFastImage.m b/Pod/FastImages/CKFastImage.m index 830595c..e0000b6 100644 --- a/Pod/FastImages/CKFastImage.m +++ b/Pod/FastImages/CKFastImage.m @@ -110,7 +110,12 @@ - (UIImage *)image { - (void)dealloc { - free(_bytes); + free((void *)_bytes); +} + +- (instancetype)init +{ + return [self initWithBytesNoCopy:NULL length:0 size:CGSizeZero scale:1.0 style:CKFastImageStyle32BitBGRA]; } - (instancetype)initWithImage:(UIImage *)image @@ -153,7 +158,7 @@ - (instancetype)initWithSize:(CGSize)size scale:(CGFloat)scale style:(CKFastImag CGContextRelease(context); - self = [self initWithBytesNoCopy:bytes length:length]; + self = [self initWithBytesNoCopy:bytes length:length size:size scale:scale style:style]; if (self != nil) { _image = [UIImage imageWithCGImage:imageRef scale:scale orientation:UIImageOrientationUp]; } @@ -163,10 +168,13 @@ - (instancetype)initWithSize:(CGSize)size scale:(CGFloat)scale style:(CKFastImag return self; } -- (instancetype)initWithBytesNoCopy:(const void *)data length:(NSUInteger)length +- (instancetype)initWithBytesNoCopy:(const void *)data length:(NSUInteger)length size:(CGSize)size scale:(CGFloat)scale style:(CKFastImageStyle)style { self = [super init]; if (self) { + _size = size; + _scale = scale; + _style = style; _bytes = data; _length = length; } @@ -178,11 +186,11 @@ - (instancetype)initWithBytesNoCopy:(const void *)data length:(NSUInteger)length - (instancetype)initWithCoder:(NSCoder *)coder { - self = [super init]; + self = [self init]; if (self) { const void *bytes = [coder decodeBytesForKey:@"bytes" returnedLength:&_length]; _bytes = malloc(_length); - memcpy(_bytes, bytes, _length); + memcpy((void *)_bytes, bytes, _length); _scale = [coder decodeDoubleForKey:@"scale"]; _size = CGSizeMake([coder decodeDoubleForKey:@"size.x"], [coder decodeDoubleForKey:@"size.y"]);