Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
xcode recommended changes
Browse files Browse the repository at this point in the history
  • Loading branch information
btoews committed Sep 25, 2018
1 parent 9ae2d4b commit 338d544
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
4 changes: 1 addition & 3 deletions APDU/Data/Endian.swift
Expand Up @@ -37,6 +37,4 @@ extension UInt8: EndianProtocol {
public var littleEndian: UInt8 { return self }
}

public protocol EndianEnumProtocol: RawRepresentable {
associatedtype RawValue: EndianProtocol
}
public protocol EndianEnumProtocol: RawRepresentable where RawValue: EndianProtocol {}
12 changes: 6 additions & 6 deletions SoftU2F.xcodeproj/project.pbxproj
Expand Up @@ -1134,7 +1134,7 @@
PROVISIONING_PROFILE_SPECIFIER = SoftU2FTool;
SWIFT_OBJC_BRIDGING_HEADER = "SoftU2FTool/SoftU2F-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
};
name = Debug;
Expand All @@ -1158,7 +1158,7 @@
PROVISIONING_PROFILE = "0d639ce7-4261-41e5-8e5d-8a39cdfc8c41";
PROVISIONING_PROFILE_SPECIFIER = SoftU2FTool;
SWIFT_OBJC_BRIDGING_HEADER = "SoftU2FTool/SoftU2F-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
};
name = Release;
Expand All @@ -1181,7 +1181,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "SoftU2FToolTests/SoftU2FTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SoftU2F.app/Contents/MacOS/SoftU2F";
};
Expand All @@ -1204,7 +1204,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "SoftU2FToolTests/SoftU2FTests-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SoftU2F.app/Contents/MacOS/SoftU2F";
};
Expand Down Expand Up @@ -1292,7 +1292,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -1320,7 +1320,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.github.APDU;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down
2 changes: 1 addition & 1 deletion SoftU2FTool/WebSafeBase64.swift
Expand Up @@ -22,7 +22,7 @@ class WebSafeBase64 {

let padding: Int

switch b64.characters.count % 4 {
switch b64.count % 4 {
case 0:
padding = 0
case 2:
Expand Down
6 changes: 3 additions & 3 deletions SoftU2FToolTests/WebSafeBase64Tests.swift
Expand Up @@ -14,9 +14,9 @@ class WebSafeBase64Tests: XCTestCase {
let orig = Data(repeating: 0x41, count: length)
let encoded = WebSafeBase64.encode(orig)

XCTAssertNil(encoded.characters.index(of: Character("+")))
XCTAssertNil(encoded.characters.index(of: Character("/")))
XCTAssertNil(encoded.characters.index(of: Character("=")))
XCTAssertFalse(encoded.contains("+"))
XCTAssertFalse(encoded.contains("/"))
XCTAssertFalse(encoded.contains("="))

let decoded = WebSafeBase64.decode(encoded)
XCTAssertNotNil(decoded)
Expand Down

0 comments on commit 338d544

Please sign in to comment.