Fix Xcode warnings and deprecations

This commit is contained in:
Davide De Rosa 2019-04-11 16:56:23 +02:00
parent 2b3600bd0d
commit b4c6bfb8de
1 changed files with 5 additions and 2 deletions

View File

@ -75,6 +75,9 @@ public class StandardVPNProvider: VPNProvider {
case .disconnected, .invalid:
return .disconnected
@unknown default:
return .disconnected
}
}
@ -202,8 +205,8 @@ public class StandardVPNProvider: VPNProvider {
}
return
}
let bytesIn: UInt = data.subdata(in: 0..<8).withUnsafeBytes { $0.pointee }
let bytesOut: UInt = data.subdata(in: 8..<16).withUnsafeBytes { $0.pointee }
let bytesIn: UInt = data.subdata(in: 0..<8).withUnsafeBytes { $0.load(as: UInt.self) }
let bytesOut: UInt = data.subdata(in: 8..<16).withUnsafeBytes { $0.load(as: UInt.self) }
DispatchQueue.main.async {
completionHandler((bytesIn, bytesOut))
}