From c73a0aac136bf0b95f0d87cb3f4b0fe4408caaad Mon Sep 17 00:00:00 2001 From: Rob Napier Date: Thu, 22 Jun 2017 16:52:51 -0400 Subject: [PATCH] Cleanup warnings for Cocoapods --- .swift-version | 1 + Changelog.md | 4 ++++ RNCryptor-objc.podspec | 2 +- RNCryptor.xcodeproj/project.pbxproj | 4 ++-- RNCryptor/RNCryptor.m | 6 ++++++ 5 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .swift-version diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..9f55b2c --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +3.0 diff --git a/Changelog.md b/Changelog.md index ed5fae5..6a1d9c0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,7 @@ +# Version 3.0.5 + +# Clean up warnings for CocoaPods + # Version 3.0.4 * Remove non-modular header from framework header #11 diff --git a/RNCryptor-objc.podspec b/RNCryptor-objc.podspec index d0c82c8..51d7bce 100644 --- a/RNCryptor-objc.podspec +++ b/RNCryptor-objc.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'RNCryptor-objc' - s.version = '3.0.4' + s.version = '3.0.5' s.summary = 'Encryptor/Decryptor for iOS.' s.authors = {'Rob Napier' => 'robnapier@gmail.com'} s.license = { diff --git a/RNCryptor.xcodeproj/project.pbxproj b/RNCryptor.xcodeproj/project.pbxproj index bc1ba02..7e788ce 100644 --- a/RNCryptor.xcodeproj/project.pbxproj +++ b/RNCryptor.xcodeproj/project.pbxproj @@ -1199,7 +1199,7 @@ CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = NO; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1241,7 +1241,7 @@ CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = NO; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; diff --git a/RNCryptor/RNCryptor.m b/RNCryptor/RNCryptor.m index 63605ad..70a7e72 100755 --- a/RNCryptor/RNCryptor.m +++ b/RNCryptor/RNCryptor.m @@ -317,7 +317,10 @@ + (NSData *)keyForPassword:(NSString *)password salt:(NSData *)salt settings:(RN CCPseudoRandomAlgorithm prf, uint rounds, uint8_t *derivedKey, size_t derivedKeyLen); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunreachable-code" PBKDF = CCKeyDerivationPBKDF ?: RN_CCKeyDerivationPBKDF; +#pragma clang diagnostic pop result = PBKDF(keySettings.PBKDFAlgorithm, // algorithm passwordData.bytes, // password @@ -396,7 +399,10 @@ + (NSData *)randomDataOfLength:(size_t)length result = SecRandomCopyBytes(NULL, length, data.mutableBytes); } else { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunreachable-code" result = RN_SecRandomCopyBytes(NULL, length, data.mutableBytes); +#pragma clang diagnostic pop } NSAssert(result == 0, @"Unable to generate random bytes: %d", errno);