Skip to content

Commit

Permalink
Fixed compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
davbeck committed Aug 9, 2015
1 parent c176110 commit 62c532d
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 24 deletions.
1 change: 0 additions & 1 deletion CacheKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion Example/CacheKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = CK;
LastUpgradeCheck = 0510;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "David Beck";
TargetAttributes = {
6003F5AD195388D20070C39A = {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -23,10 +23,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -48,17 +48,21 @@
ReferencedContainer = "container:CacheKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6003F589195388D20070C39A"
Expand All @@ -71,12 +75,13 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6003F589195388D20070C39A"
Expand Down
2 changes: 1 addition & 1 deletion Example/CacheKit/CacheKit-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
19 changes: 12 additions & 7 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
2 changes: 1 addition & 1 deletion Example/Tests/Tests-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand Down
2 changes: 1 addition & 1 deletion Pod/FastImages/CKFastImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 13 additions & 5 deletions Pod/FastImages/CKFastImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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];
}
Expand All @@ -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;
}
Expand All @@ -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"]);
Expand Down

0 comments on commit 62c532d

Please sign in to comment.