Skip to content

Commit

Permalink
Minor fixes for nullability analyzer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisballinger committed Jul 8, 2016
1 parent a65dc7e commit 0711099
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 97 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
language: objective-c
osx_image: xcode7.3
language: objective-c

install:
- gem install cocoapods -v 1.0.1 --no-rdoc --no-ri
- pod install --project-directory=./Tests/iOS --no-repo-update
- pod install --project-directory=./Tests/Mac --no-repo-update

script:
- xctool -workspace ./Tests/iOS/CocoaAsyncSocket.xcworkspace -scheme CocoaAsyncSocketTestsiOS -sdk iphonesimulator -arch x86_64 test
- xctool -workspace ./Tests/Mac/CocoaAsyncSocket.xcworkspace -scheme CocoaAsyncSocketTestsMac -sdk macosx -arch x86_64 test
- xctool -project CocoaAsyncSocket.xcodeproj -scheme "iOS Framework" -sdk iphonesimulator -arch x86_64 build
- xctool -project CocoaAsyncSocket.xcodeproj -scheme "Mac Framework" -sdk macosx -arch x86_64 build
- xctool -project CocoaAsyncSocket.xcodeproj -scheme "Mac Framework" -sdk macosx -arch x86_64 build
2 changes: 1 addition & 1 deletion CocoaAsyncSocket.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'CocoaAsyncSocket'
s.version = '7.5.0'
s.version = '7.5.1'
s.license = { :type => 'public domain', :text => <<-LICENSE
Public Domain License
Expand Down
8 changes: 4 additions & 4 deletions Source/GCD/GCDAsyncSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,8 @@ typedef NS_ENUM(NSInteger, GCDAsyncSocketError) {
*
* See also: (BOOL)enableBackgroundingOnSocket
**/
- (CFReadStreamRef)readStream;
- (CFWriteStreamRef)writeStream;
- (nullable CFReadStreamRef)readStream;
- (nullable CFWriteStreamRef)writeStream;

/**
* This method is only available from within the context of a performBlock: invocation.
Expand Down Expand Up @@ -1000,7 +1000,7 @@ typedef NS_ENUM(NSInteger, GCDAsyncSocketError) {
*
* Provides access to the socket's SSLContext, if SSL/TLS has been started on the socket.
**/
- (SSLContextRef)sslContext;
- (nullable SSLContextRef)sslContext;

#pragma mark Utilities

Expand Down Expand Up @@ -1045,7 +1045,7 @@ typedef NS_ENUM(NSInteger, GCDAsyncSocketError) {
#pragma mark -
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

@protocol GCDAsyncSocketDelegate
@protocol GCDAsyncSocketDelegate <NSObject>
@optional

/**
Expand Down
6 changes: 4 additions & 2 deletions Source/GCD/GCDAsyncSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -6457,8 +6457,10 @@ - (void)maybeStartTLS
#if TARGET_OS_IPHONE
{
GCDAsyncSpecialPacket *tlsPacket = (GCDAsyncSpecialPacket *)currentRead;
NSDictionary *tlsSettings = tlsPacket->tlsSettings;

NSDictionary *tlsSettings = @{};
if (tlsPacket) {
tlsSettings = tlsPacket->tlsSettings;
}
NSNumber *value = [tlsSettings objectForKey:GCDAsyncSocketUseCFStreamForTLS];
if (value && [value boolValue])
useSecureTransport = NO;
Expand Down
6 changes: 3 additions & 3 deletions Source/GCD/GCDAsyncUdpSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef NS_ENUM(NSInteger, GCDAsyncUdpSocketError) {

@class GCDAsyncUdpSocket;

@protocol GCDAsyncUdpSocketDelegate
@protocol GCDAsyncUdpSocketDelegate <NSObject>
@optional

/**
Expand Down Expand Up @@ -960,8 +960,8 @@ typedef BOOL (^GCDAsyncUdpSocketSendFilterBlock)(NSData *data, NSData *address,
* However, if you need one for any reason,
* these methods are a convenient way to get access to a safe instance of one.
**/
- (CFReadStreamRef)readStream;
- (CFWriteStreamRef)writeStream;
- (nullable CFReadStreamRef)readStream;
- (nullable CFWriteStreamRef)writeStream;

/**
* This method is only available from within the context of a performBlock: invocation.
Expand Down
50 changes: 25 additions & 25 deletions Tests/Mac/CocoaAsyncSocket.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

/* Begin PBXBuildFile section */
2DBCA5C81B8CF4F3004F3128 /* GCDAsyncSocketUNTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBCA5C71B8CF4F3004F3128 /* GCDAsyncSocketUNTests.m */; };
C5817ED6954C81C5BFFB369D /* Pods_CocoaAsyncSocketTestsMac.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 349D39E69EC35E02747D830D /* Pods_CocoaAsyncSocketTestsMac.framework */; };
439EF337A9890757E22FAEC3 /* Pods_CocoaAsyncSocketTestsMac.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1859AD1F79C285DFDC07C37C /* Pods_CocoaAsyncSocketTestsMac.framework */; };
D900F31E1C753B2A00F0AEF0 /* SwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D900F31D1C753B2A00F0AEF0 /* SwiftTests.swift */; };
D938B4E51B752ED500FE8AB3 /* GCDAsyncSocketConnectionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D938B4E31B752ED500FE8AB3 /* GCDAsyncSocketConnectionTests.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
08EFE8D9A08D54EDB815BD18 /* Pods-CocoaAsyncSocketTestsMac.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaAsyncSocketTestsMac.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaAsyncSocketTestsMac/Pods-CocoaAsyncSocketTestsMac.debug.xcconfig"; sourceTree = "<group>"; };
1859AD1F79C285DFDC07C37C /* Pods_CocoaAsyncSocketTestsMac.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CocoaAsyncSocketTestsMac.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2DBCA5C71B8CF4F3004F3128 /* GCDAsyncSocketUNTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GCDAsyncSocketUNTests.m; sourceTree = SOURCE_ROOT; };
349D39E69EC35E02747D830D /* Pods_CocoaAsyncSocketTestsMac.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CocoaAsyncSocketTestsMac.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4460C5A7B492241459C411C9 /* Pods-CocoaAsyncSocketTestsMac.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaAsyncSocketTestsMac.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaAsyncSocketTestsMac/Pods-CocoaAsyncSocketTestsMac.debug.xcconfig"; sourceTree = "<group>"; };
BDB8EE324743565611FC60D2 /* Pods-CocoaAsyncSocketTestsMac.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaAsyncSocketTestsMac.release.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaAsyncSocketTestsMac/Pods-CocoaAsyncSocketTestsMac.release.xcconfig"; sourceTree = "<group>"; };
4CB28BA2043D8CD03AFA18E8 /* Pods-CocoaAsyncSocketTestsMac.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaAsyncSocketTestsMac.release.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaAsyncSocketTestsMac/Pods-CocoaAsyncSocketTestsMac.release.xcconfig"; sourceTree = "<group>"; };
D900F31D1C753B2A00F0AEF0 /* SwiftTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftTests.swift; path = ../Shared/SwiftTests.swift; sourceTree = "<group>"; };
D938B4E31B752ED500FE8AB3 /* GCDAsyncSocketConnectionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GCDAsyncSocketConnectionTests.m; path = ../Shared/GCDAsyncSocketConnectionTests.m; sourceTree = "<group>"; };
D9BC0D8D1A0458EF0059D906 /* CocoaAsyncSocketTestsMac.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CocoaAsyncSocketTestsMac.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -29,26 +29,26 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C5817ED6954C81C5BFFB369D /* Pods_CocoaAsyncSocketTestsMac.framework in Frameworks */,
439EF337A9890757E22FAEC3 /* Pods_CocoaAsyncSocketTestsMac.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
7ACF152BD7CD12F9AA8833DD /* Pods */ = {
2DF9645286609056FA561D1D /* Pods */ = {
isa = PBXGroup;
children = (
4460C5A7B492241459C411C9 /* Pods-CocoaAsyncSocketTestsMac.debug.xcconfig */,
BDB8EE324743565611FC60D2 /* Pods-CocoaAsyncSocketTestsMac.release.xcconfig */,
08EFE8D9A08D54EDB815BD18 /* Pods-CocoaAsyncSocketTestsMac.debug.xcconfig */,
4CB28BA2043D8CD03AFA18E8 /* Pods-CocoaAsyncSocketTestsMac.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
8A39D84502FB17BD9FB03CBB /* Frameworks */ = {
6BD64EE47346406202F80C93 /* Frameworks */ = {
isa = PBXGroup;
children = (
349D39E69EC35E02747D830D /* Pods_CocoaAsyncSocketTestsMac.framework */,
1859AD1F79C285DFDC07C37C /* Pods_CocoaAsyncSocketTestsMac.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -76,8 +76,8 @@
children = (
D9873DA11A057F34004C014F /* Tests */,
D9BC0D801A0457F40059D906 /* Products */,
7ACF152BD7CD12F9AA8833DD /* Pods */,
8A39D84502FB17BD9FB03CBB /* Frameworks */,
2DF9645286609056FA561D1D /* Pods */,
6BD64EE47346406202F80C93 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -114,12 +114,12 @@
isa = PBXNativeTarget;
buildConfigurationList = D9BC0D951A0458EF0059D906 /* Build configuration list for PBXNativeTarget "CocoaAsyncSocketTestsMac" */;
buildPhases = (
3F5D3600EFCAC33250963F1A /* Check Pods Manifest.lock */,
4AB46844DACF12294B502E98 /* [CP] Check Pods Manifest.lock */,
D9BC0D891A0458EF0059D906 /* Sources */,
D9BC0D8A1A0458EF0059D906 /* Frameworks */,
D9BC0D8B1A0458EF0059D906 /* Resources */,
46E4B24E7D6621E48A697455 /* Copy Pods Resources */,
F2AB5BD430AF4C0FD63BBCD8 /* Embed Pods Frameworks */,
AA94AAA5A64A884AD2E4A6DD /* [CP] Embed Pods Frameworks */,
ADC6CEFA3FD08AEA679AEBA7 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -172,49 +172,49 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
3F5D3600EFCAC33250963F1A /* Check Pods Manifest.lock */ = {
4AB46844DACF12294B502E98 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
46E4B24E7D6621E48A697455 /* Copy Pods Resources */ = {
AA94AAA5A64A884AD2E4A6DD /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CocoaAsyncSocketTestsMac/Pods-CocoaAsyncSocketTestsMac-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CocoaAsyncSocketTestsMac/Pods-CocoaAsyncSocketTestsMac-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
F2AB5BD430AF4C0FD63BBCD8 /* Embed Pods Frameworks */ = {
ADC6CEFA3FD08AEA679AEBA7 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CocoaAsyncSocketTestsMac/Pods-CocoaAsyncSocketTestsMac-frameworks.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CocoaAsyncSocketTestsMac/Pods-CocoaAsyncSocketTestsMac-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -253,7 +253,7 @@
};
D9BC0D931A0458EF0059D906 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 4460C5A7B492241459C411C9 /* Pods-CocoaAsyncSocketTestsMac.debug.xcconfig */;
baseConfigurationReference = 08EFE8D9A08D54EDB815BD18 /* Pods-CocoaAsyncSocketTestsMac.debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
Expand Down Expand Up @@ -303,7 +303,7 @@
};
D9BC0D941A0458EF0059D906 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BDB8EE324743565611FC60D2 /* Pods-CocoaAsyncSocketTestsMac.release.xcconfig */;
baseConfigurationReference = 4CB28BA2043D8CD03AFA18E8 /* Pods-CocoaAsyncSocketTestsMac.release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
Expand Down
16 changes: 7 additions & 9 deletions Tests/Mac/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
PODS:
- CocoaAsyncSocket (7.4.3):
- CocoaAsyncSocket/All (= 7.4.3)
- CocoaAsyncSocket/All (7.4.3):
- CocoaAsyncSocket/GCD
- CocoaAsyncSocket/RunLoop
- CocoaAsyncSocket/GCD (7.4.3)
- CocoaAsyncSocket/RunLoop (7.4.3)
- CocoaAsyncSocket (7.5.0):
- CocoaAsyncSocket/GCD (= 7.5.0)
- CocoaAsyncSocket/GCD (7.5.0)

DEPENDENCIES:
- CocoaAsyncSocket (from `../../CocoaAsyncSocket.podspec`)
Expand All @@ -15,6 +11,8 @@ EXTERNAL SOURCES:
:path: "../../CocoaAsyncSocket.podspec"

SPEC CHECKSUMS:
CocoaAsyncSocket: a18c75dca4b08723628a0bacca6e94803d90be91
CocoaAsyncSocket: 3baeb1ddd969f81cf9fca81053ae49ef2d1cbbfa

COCOAPODS: 0.39.0
PODFILE CHECKSUM: e2d5a11e69cc6a8c9e8f637d8505ac427b7b8e02

COCOAPODS: 1.0.1
Loading

0 comments on commit 0711099

Please sign in to comment.