diff --git a/Sources/TCompactProtocol.swift b/Sources/TCompactProtocol.swift index ac5b35a..886eeae 100644 --- a/Sources/TCompactProtocol.swift +++ b/Sources/TCompactProtocol.swift @@ -222,11 +222,11 @@ public class TCompactProtocol: TProtocol { /// /// - returns: zigzaged UInt32 func i32ToZigZag(_ n : Int32) -> UInt32 { - return UInt32(n << 1) ^ UInt32(n >> 31) + return UInt32(bitPattern: Int32(n << 1) ^ Int32(n >> 31)) } func i64ToZigZag(_ n : Int64) -> UInt64 { - return UInt64(n << 1) ^ UInt64(n >> 63) + return UInt64(bitPattern: Int64(n << 1) ^ Int64(n >> 63)) } func zigZagToi32(_ n: UInt32) -> Int32 { diff --git a/Sources/TSocketTransport.swift b/Sources/TSocketTransport.swift index 891bd27..0316e37 100644 --- a/Sources/TSocketTransport.swift +++ b/Sources/TSocketTransport.swift @@ -83,8 +83,8 @@ public class TCFSocketTransport: TStreamTransport { CFWriteStreamSetProperty(writeStream, .shouldCloseNativeSocket, kCFBooleanTrue) if secure { - CFReadStreamSetProperty(readStream, .socketSecurityLevel, StreamSocketSecurityLevel.negotiatedSSL._rawValue) - CFWriteStreamSetProperty(writeStream, .socketSecurityLevel, StreamSocketSecurityLevel.negotiatedSSL._rawValue) + CFReadStreamSetProperty(readStream, .socketSecurityLevel, StreamSocketSecurityLevel.negotiatedSSL.rawValue as CFString) + CFWriteStreamSetProperty(writeStream, .socketSecurityLevel, StreamSocketSecurityLevel.negotiatedSSL.rawValue as CFString) } inputStream = readStream as InputStream