diff --git a/.travis.yml b/.travis.yml index 06b5ff5..dc3432d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,11 @@ -osx_image: xcode9.4 +osx_image: xcode10.2 language: objective-c env: matrix: - PLATFORM=iOS SDK=iphonesimulator SCHEME=TrueTime-iOS DESTINATION="platform=iOS Simulator,name=iPhone 6,OS=10.0" - PLATFORM=Mac SDK=macosx SCHEME=TrueTime-Mac DESTINATION="platform=macOS" - PLATFORM=tvOS SDK=appletvsimulator SCHEME=TrueTime-tvOS DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p,OS=10.0" -install: +install: - brew remove swiftlint --force || true - brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8d6cbc8/Formula/swiftlint.rb - brew remove carthage --force || true diff --git a/Sources/HostResolver.swift b/Sources/HostResolver.swift index 49eb7c0..3437b7d 100644 --- a/Sources/HostResolver.swift +++ b/Sources/HostResolver.swift @@ -29,7 +29,6 @@ final class HostResolver { /// - parameter callbackQueue: queue to fire `onComplete` callback /// - parameter onComplete: invoked upon first successfully resolved host /// or when all hosts fail - // swiftlint:disable:next function_parameter_count static func resolve(hosts: [(host: String, port: Int)], timeout: TimeInterval, logger: LogCallback?, diff --git a/Sources/NTPConnection.swift b/Sources/NTPConnection.swift index 7bd060b..5dee45f 100644 --- a/Sources/NTPConnection.swift +++ b/Sources/NTPConnection.swift @@ -243,7 +243,7 @@ private extension NTPConnection { return } - let packet = data.withUnsafeBytes { $0.pointee as ntp_packet_t }.nativeEndian + let packet = data.withUnsafeBytes { $0.load(as: ntp_packet_t.self) }.nativeEndian let responseTime = startTime.milliseconds + (responseTicks.milliseconds - requestTicks.milliseconds) diff --git a/Sources/SocketAddress.swift b/Sources/SocketAddress.swift index bf490a2..38a4e22 100644 --- a/Sources/SocketAddress.swift +++ b/Sources/SocketAddress.swift @@ -59,8 +59,8 @@ extension SocketAddress: CustomStringConvertible { } extension SocketAddress: Hashable { - var hashValue: Int { - return host.hashValue + func hash(into hasher: inout Hasher) { + hasher.combine(host.hashValue) } } diff --git a/TrueTime.xcodeproj/project.pbxproj b/TrueTime.xcodeproj/project.pbxproj index 25f590f..b7b86d1 100644 --- a/TrueTime.xcodeproj/project.pbxproj +++ b/TrueTime.xcodeproj/project.pbxproj @@ -639,7 +639,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = Instacart; TargetAttributes = { 280090491D444B64004C788E = { @@ -1033,6 +1033,7 @@ CLANG_WARN_COMMA = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -1065,6 +1066,7 @@ CLANG_WARN_COMMA = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -1077,6 +1079,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = ""; + SWIFT_COMPILATION_MODE = wholemodule; SWIFT_INSTALL_OBJC_HEADER = NO; SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_VERSION = 5.0; diff --git a/TrueTime.xcodeproj/xcshareddata/xcschemes/TrueTime-Mac.xcscheme b/TrueTime.xcodeproj/xcshareddata/xcschemes/TrueTime-Mac.xcscheme index 245aea0..b8db222 100644 --- a/TrueTime.xcodeproj/xcshareddata/xcschemes/TrueTime-Mac.xcscheme +++ b/TrueTime.xcodeproj/xcshareddata/xcschemes/TrueTime-Mac.xcscheme @@ -1,6 +1,6 @@