Skip to content

Commit 6c6ccf5

Browse files
authored
Fix warnings (#225)
1 parent 1064886 commit 6c6ccf5

8 files changed

+26
-28
lines changed

PINCache.xcodeproj/project.pbxproj

+5-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@
506506
CC0105A81E271A1600890935 /* Project object */ = {
507507
isa = PBXProject;
508508
attributes = {
509-
LastUpgradeCheck = 0900;
509+
LastUpgradeCheck = 0930;
510510
ORGANIZATIONNAME = Pinterest;
511511
TargetAttributes = {
512512
CC0105B01E271A1600890935 = {
@@ -758,12 +758,14 @@
758758
CLANG_WARN_BOOL_CONVERSION = YES;
759759
CLANG_WARN_COMMA = YES;
760760
CLANG_WARN_CONSTANT_CONVERSION = YES;
761+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
761762
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
762763
CLANG_WARN_EMPTY_BODY = YES;
763764
CLANG_WARN_ENUM_CONVERSION = YES;
764765
CLANG_WARN_INFINITE_RECURSION = YES;
765766
CLANG_WARN_INT_CONVERSION = YES;
766767
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
768+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
767769
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
768770
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
769771
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -815,12 +817,14 @@
815817
CLANG_WARN_BOOL_CONVERSION = YES;
816818
CLANG_WARN_COMMA = YES;
817819
CLANG_WARN_CONSTANT_CONVERSION = YES;
820+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
818821
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
819822
CLANG_WARN_EMPTY_BODY = YES;
820823
CLANG_WARN_ENUM_CONVERSION = YES;
821824
CLANG_WARN_INFINITE_RECURSION = YES;
822825
CLANG_WARN_INT_CONVERSION = YES;
823826
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
827+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
824828
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
825829
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
826830
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;

PINCache.xcodeproj/xcshareddata/xcschemes/PINCache-macOS.xcscheme

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
<TestableReference
@@ -56,7 +55,6 @@
5655
buildConfiguration = "Debug"
5756
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5857
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59-
language = ""
6058
launchStyle = "0"
6159
useCustomWorkingDirectory = "NO"
6260
ignoresPersistentStateOnLaunch = "NO"

PINCache.xcodeproj/xcshareddata/xcschemes/PINCache-tvOS.xcscheme

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
<TestableReference
@@ -56,7 +55,6 @@
5655
buildConfiguration = "Debug"
5756
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5857
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59-
language = ""
6058
launchStyle = "0"
6159
useCustomWorkingDirectory = "NO"
6260
ignoresPersistentStateOnLaunch = "NO"

PINCache.xcodeproj/xcshareddata/xcschemes/PINCache.xcscheme

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
<TestableReference
@@ -56,7 +55,6 @@
5655
buildConfiguration = "Debug"
5756
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5857
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59-
language = ""
6058
launchStyle = "0"
6159
useCustomWorkingDirectory = "NO"
6260
ignoresPersistentStateOnLaunch = "NO"

Source/PINDiskCache.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ typedef void (^PINDiskCacheBlock)(PINDiskCache *cache);
586586
- (void)trimToSizeByDate:(NSUInteger)byteCount block:(nullable PINDiskCacheBlock)block __attribute__((deprecated));
587587
- (void)removeAllObjects:(nullable PINDiskCacheBlock)block __attribute__((deprecated));
588588
- (void)enumerateObjectsWithBlock:(PINDiskCacheFileURLBlock)block completionBlock:(nullable PINDiskCacheBlock)completionBlock __attribute__((deprecated));
589-
- (void)setTtlCache:(BOOL)ttlCache __attribute__((unavailable("ttlCache is no longer a settable property and must now be set via initializer.")));
589+
- (void)setTtlCache:(BOOL)ttlCache DEPRECATED_MSG_ATTRIBUTE("ttlCache is no longer a settable property and must now be set via initializer.");
590590
@end
591591

592592
NS_ASSUME_NONNULL_END

Source/PINDiskCache.m

+9-9
Original file line numberDiff line numberDiff line change
@@ -1530,15 +1530,6 @@ - (BOOL)isTTLCache
15301530
return isTTLCache;
15311531
}
15321532

1533-
- (void)setTtlCache:(BOOL)ttlCache
1534-
{
1535-
[self.operationQueue scheduleOperation:^{
1536-
[self lock];
1537-
self->_ttlCache = ttlCache;
1538-
[self unlock];
1539-
} withPriority:PINOperationQueuePriorityHigh];
1540-
}
1541-
15421533
#if TARGET_OS_IPHONE
15431534
- (NSDataWritingOptions)writingProtectionOption
15441535
{
@@ -1657,6 +1648,15 @@ - (void)enumerateObjectsWithBlock:(PINDiskCacheFileURLBlock)block completionBloc
16571648
} completionBlock:completionBlock];
16581649
}
16591650

1651+
- (void)setTtlCache:(BOOL)ttlCache
1652+
{
1653+
[self.operationQueue scheduleOperation:^{
1654+
[self lock];
1655+
self->_ttlCache = ttlCache;
1656+
[self unlock];
1657+
} withPriority:PINOperationQueuePriorityHigh];
1658+
}
1659+
16601660
@end
16611661

16621662
@implementation PINDiskCacheMetadata

Source/PINMemoryCache.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ typedef void (^PINMemoryCacheContainmentBlock)(BOOL containsObject);
239239
- (void)trimToCostByDate:(NSUInteger)cost block:(nullable PINMemoryCacheBlock)block __attribute__((deprecated));
240240
- (void)removeAllObjects:(nullable PINMemoryCacheBlock)block __attribute__((deprecated));
241241
- (void)enumerateObjectsWithBlock:(PINMemoryCacheObjectBlock)block completionBlock:(nullable PINMemoryCacheBlock)completionBlock __attribute__((deprecated));
242-
- (void)setTtlCache:(BOOL)ttlCache __attribute__((unavailable("ttlCache is no longer a settable property and must now be set via initializer.")));
242+
- (void)setTtlCache:(BOOL)ttlCache DEPRECATED_MSG_ATTRIBUTE("ttlCache is no longer a settable property and must now be set via initializer.");
243243
@end
244244

245245
NS_ASSUME_NONNULL_END

Source/PINMemoryCache.m

+7-7
Original file line numberDiff line numberDiff line change
@@ -810,13 +810,6 @@ - (BOOL)isTTLCache {
810810
return isTTLCache;
811811
}
812812

813-
- (void)setTtlCache:(BOOL)ttlCache {
814-
[self lock];
815-
_ttlCache = ttlCache;
816-
[self unlock];
817-
}
818-
819-
820813
- (void)lock
821814
{
822815
__unused int result = pthread_mutex_lock(&_mutex);
@@ -891,4 +884,11 @@ - (void)enumerateObjectsWithBlock:(PINMemoryCacheObjectBlock)block completionBlo
891884
} completionBlock:completionBlock];
892885
}
893886

887+
- (void)setTtlCache:(BOOL)ttlCache
888+
{
889+
[self lock];
890+
_ttlCache = ttlCache;
891+
[self unlock];
892+
}
893+
894894
@end

0 commit comments

Comments
 (0)