Skip to content

Commit

Permalink
Fix warnings (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmoon authored Jun 8, 2018
1 parent 1064886 commit 6c6ccf5
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 28 deletions.
6 changes: 5 additions & 1 deletion PINCache.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@
CC0105A81E271A1600890935 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = Pinterest;
TargetAttributes = {
CC0105B01E271A1600890935 = {
Expand Down Expand Up @@ -758,12 +758,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -815,12 +817,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
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 = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
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 = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
4 changes: 1 addition & 3 deletions PINCache.xcodeproj/xcshareddata/xcschemes/PINCache.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
2 changes: 1 addition & 1 deletion Source/PINDiskCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ typedef void (^PINDiskCacheBlock)(PINDiskCache *cache);
- (void)trimToSizeByDate:(NSUInteger)byteCount block:(nullable PINDiskCacheBlock)block __attribute__((deprecated));
- (void)removeAllObjects:(nullable PINDiskCacheBlock)block __attribute__((deprecated));
- (void)enumerateObjectsWithBlock:(PINDiskCacheFileURLBlock)block completionBlock:(nullable PINDiskCacheBlock)completionBlock __attribute__((deprecated));
- (void)setTtlCache:(BOOL)ttlCache __attribute__((unavailable("ttlCache is no longer a settable property and must now be set via initializer.")));
- (void)setTtlCache:(BOOL)ttlCache DEPRECATED_MSG_ATTRIBUTE("ttlCache is no longer a settable property and must now be set via initializer.");
@end

NS_ASSUME_NONNULL_END
18 changes: 9 additions & 9 deletions Source/PINDiskCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -1530,15 +1530,6 @@ - (BOOL)isTTLCache
return isTTLCache;
}

- (void)setTtlCache:(BOOL)ttlCache
{
[self.operationQueue scheduleOperation:^{
[self lock];
self->_ttlCache = ttlCache;
[self unlock];
} withPriority:PINOperationQueuePriorityHigh];
}

#if TARGET_OS_IPHONE
- (NSDataWritingOptions)writingProtectionOption
{
Expand Down Expand Up @@ -1657,6 +1648,15 @@ - (void)enumerateObjectsWithBlock:(PINDiskCacheFileURLBlock)block completionBloc
} completionBlock:completionBlock];
}

- (void)setTtlCache:(BOOL)ttlCache
{
[self.operationQueue scheduleOperation:^{
[self lock];
self->_ttlCache = ttlCache;
[self unlock];
} withPriority:PINOperationQueuePriorityHigh];
}

@end

@implementation PINDiskCacheMetadata
Expand Down
2 changes: 1 addition & 1 deletion Source/PINMemoryCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ typedef void (^PINMemoryCacheContainmentBlock)(BOOL containsObject);
- (void)trimToCostByDate:(NSUInteger)cost block:(nullable PINMemoryCacheBlock)block __attribute__((deprecated));
- (void)removeAllObjects:(nullable PINMemoryCacheBlock)block __attribute__((deprecated));
- (void)enumerateObjectsWithBlock:(PINMemoryCacheObjectBlock)block completionBlock:(nullable PINMemoryCacheBlock)completionBlock __attribute__((deprecated));
- (void)setTtlCache:(BOOL)ttlCache __attribute__((unavailable("ttlCache is no longer a settable property and must now be set via initializer.")));
- (void)setTtlCache:(BOOL)ttlCache DEPRECATED_MSG_ATTRIBUTE("ttlCache is no longer a settable property and must now be set via initializer.");
@end

NS_ASSUME_NONNULL_END
14 changes: 7 additions & 7 deletions Source/PINMemoryCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -810,13 +810,6 @@ - (BOOL)isTTLCache {
return isTTLCache;
}

- (void)setTtlCache:(BOOL)ttlCache {
[self lock];
_ttlCache = ttlCache;
[self unlock];
}


- (void)lock
{
__unused int result = pthread_mutex_lock(&_mutex);
Expand Down Expand Up @@ -891,4 +884,11 @@ - (void)enumerateObjectsWithBlock:(PINMemoryCacheObjectBlock)block completionBlo
} completionBlock:completionBlock];
}

- (void)setTtlCache:(BOOL)ttlCache
{
[self lock];
_ttlCache = ttlCache;
[self unlock];
}

@end

0 comments on commit 6c6ccf5

Please sign in to comment.