From b4c6bfb8deee36490b318bd5d33d2235b5cc9eb7 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 11 Apr 2019 16:56:23 +0200 Subject: [PATCH] Fix Xcode warnings and deprecations --- Passepartout/Sources/VPN/StandardVPNProvider.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Passepartout/Sources/VPN/StandardVPNProvider.swift b/Passepartout/Sources/VPN/StandardVPNProvider.swift index 12322d6d..73bc9d20 100644 --- a/Passepartout/Sources/VPN/StandardVPNProvider.swift +++ b/Passepartout/Sources/VPN/StandardVPNProvider.swift @@ -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)) }