Skip to content

Commit 93f5568

Browse files
committed
Updated project to Swift 5, fixed build warnings
1 parent 861ff28 commit 93f5568

File tree

7 files changed

+28
-25
lines changed

7 files changed

+28
-25
lines changed

SQLite.xcodeproj/project.pbxproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@
680680
isa = PBXProject;
681681
attributes = {
682682
LastSwiftUpdateCheck = 0720;
683-
LastUpgradeCheck = 0930;
683+
LastUpgradeCheck = 1020;
684684
TargetAttributes = {
685685
03A65E591C6BB0F50062603F = {
686686
CreatedOnToolsVersion = 7.2;
@@ -714,10 +714,11 @@
714714
};
715715
buildConfigurationList = EE247ACD1C3F04ED00AE3E12 /* Build configuration list for PBXProject "SQLite" */;
716716
compatibilityVersion = "Xcode 3.2";
717-
developmentRegion = English;
717+
developmentRegion = en;
718718
hasScannedForEncodings = 0;
719719
knownRegions = (
720720
en,
721+
Base,
721722
);
722723
mainGroup = EE247AC91C3F04ED00AE3E12;
723724
productRefGroup = EE247AD41C3F04ED00AE3E12 /* Products */;
@@ -1140,6 +1141,7 @@
11401141
isa = XCBuildConfiguration;
11411142
buildSettings = {
11421143
ALWAYS_SEARCH_USER_PATHS = NO;
1144+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
11431145
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
11441146
CLANG_CXX_LIBRARY = "libc++";
11451147
CLANG_ENABLE_MODULES = YES;
@@ -1200,6 +1202,7 @@
12001202
isa = XCBuildConfiguration;
12011203
buildSettings = {
12021204
ALWAYS_SEARCH_USER_PATHS = NO;
1205+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
12031206
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
12041207
CLANG_CXX_LIBRARY = "libc++";
12051208
CLANG_ENABLE_MODULES = YES;
@@ -1269,7 +1272,7 @@
12691272
SKIP_INSTALL = YES;
12701273
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
12711274
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
1272-
SWIFT_VERSION = 4.2;
1275+
SWIFT_VERSION = 5.0;
12731276
};
12741277
name = Debug;
12751278
};
@@ -1291,7 +1294,7 @@
12911294
PRODUCT_NAME = SQLite;
12921295
SKIP_INSTALL = YES;
12931296
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
1294-
SWIFT_VERSION = 4.2;
1297+
SWIFT_VERSION = 5.0;
12951298
};
12961299
name = Release;
12971300
};

SQLite.xcodeproj/xcshareddata/xcschemes/SQLite Mac.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0930"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

SQLite.xcodeproj/xcshareddata/xcschemes/SQLite iOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0930"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

SQLite.xcodeproj/xcshareddata/xcschemes/SQLite tvOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0930"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

SQLite.xcodeproj/xcshareddata/xcschemes/SQLite watchOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0930"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sources/SQLite/Foundation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ extension Data : Value {
3131
}
3232

3333
public static func fromDatatypeValue(_ dataValue: Blob) -> Data {
34-
return Data(bytes: dataValue.bytes)
34+
return Data(dataValue.bytes)
3535
}
3636

3737
public var datatypeValue: Blob {
38-
return withUnsafeBytes { (pointer: UnsafePointer<UInt8>) -> Blob in
39-
return Blob(bytes: pointer, length: count)
38+
return withUnsafeBytes { (pointer: UnsafeRawBufferPointer) -> Blob in
39+
return Blob(bytes: pointer.baseAddress!, length: count)
4040
}
4141
}
4242

Sources/SQLite/Typed/CustomFunctions.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,76 +39,76 @@ public extension Connection {
3939
/// The assigned types must be explicit.
4040
///
4141
/// - Returns: A closure returning an SQL expression to call the function.
42-
public func createFunction<Z : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping () -> Z) throws -> (() -> Expression<Z>) {
42+
func createFunction<Z : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping () -> Z) throws -> (() -> Expression<Z>) {
4343
let fn = try createFunction(function, 0, deterministic) { _ in block() }
4444
return { fn([]) }
4545
}
4646

47-
public func createFunction<Z : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping () -> Z?) throws -> (() -> Expression<Z?>) {
47+
func createFunction<Z : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping () -> Z?) throws -> (() -> Expression<Z?>) {
4848
let fn = try createFunction(function, 0, deterministic) { _ in block() }
4949
return { fn([]) }
5050
}
5151

5252
// MARK: -
5353

54-
public func createFunction<Z : Value, A : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A) -> Z) throws -> ((Expression<A>) -> Expression<Z>) {
54+
func createFunction<Z : Value, A : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A) -> Z) throws -> ((Expression<A>) -> Expression<Z>) {
5555
let fn = try createFunction(function, 1, deterministic) { args in block(value(args[0])) }
5656
return { arg in fn([arg]) }
5757
}
5858

59-
public func createFunction<Z : Value, A : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A?) -> Z) throws -> ((Expression<A?>) -> Expression<Z>) {
59+
func createFunction<Z : Value, A : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A?) -> Z) throws -> ((Expression<A?>) -> Expression<Z>) {
6060
let fn = try createFunction(function, 1, deterministic) { args in block(args[0].map(value)) }
6161
return { arg in fn([arg]) }
6262
}
6363

64-
public func createFunction<Z : Value, A : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A) -> Z?) throws -> ((Expression<A>) -> Expression<Z?>) {
64+
func createFunction<Z : Value, A : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A) -> Z?) throws -> ((Expression<A>) -> Expression<Z?>) {
6565
let fn = try createFunction(function, 1, deterministic) { args in block(value(args[0])) }
6666
return { arg in fn([arg]) }
6767
}
6868

69-
public func createFunction<Z : Value, A : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A?) -> Z?) throws -> ((Expression<A?>) -> Expression<Z?>) {
69+
func createFunction<Z : Value, A : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A?) -> Z?) throws -> ((Expression<A?>) -> Expression<Z?>) {
7070
let fn = try createFunction(function, 1, deterministic) { args in block(args[0].map(value)) }
7171
return { arg in fn([arg]) }
7272
}
7373

7474
// MARK: -
7575

76-
public func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A, B) -> Z) throws -> (Expression<A>, Expression<B>) -> Expression<Z> {
76+
func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A, B) -> Z) throws -> (Expression<A>, Expression<B>) -> Expression<Z> {
7777
let fn = try createFunction(function, 2, deterministic) { args in block(value(args[0]), value(args[1])) }
7878
return { a, b in fn([a, b]) }
7979
}
8080

81-
public func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A?, B) -> Z) throws -> (Expression<A?>, Expression<B>) -> Expression<Z> {
81+
func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A?, B) -> Z) throws -> (Expression<A?>, Expression<B>) -> Expression<Z> {
8282
let fn = try createFunction(function, 2, deterministic) { args in block(args[0].map(value), value(args[1])) }
8383
return { a, b in fn([a, b]) }
8484
}
8585

86-
public func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A, B?) -> Z) throws -> (Expression<A>, Expression<B?>) -> Expression<Z> {
86+
func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A, B?) -> Z) throws -> (Expression<A>, Expression<B?>) -> Expression<Z> {
8787
let fn = try createFunction(function, 2, deterministic) { args in block(value(args[0]), args[1].map(value)) }
8888
return { a, b in fn([a, b]) }
8989
}
9090

91-
public func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A, B) -> Z?) throws -> (Expression<A>, Expression<B>) -> Expression<Z?> {
91+
func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A, B) -> Z?) throws -> (Expression<A>, Expression<B>) -> Expression<Z?> {
9292
let fn = try createFunction(function, 2, deterministic) { args in block(value(args[0]), value(args[1])) }
9393
return { a, b in fn([a, b]) }
9494
}
9595

96-
public func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A?, B?) -> Z) throws -> (Expression<A?>, Expression<B?>) -> Expression<Z> {
96+
func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A?, B?) -> Z) throws -> (Expression<A?>, Expression<B?>) -> Expression<Z> {
9797
let fn = try createFunction(function, 2, deterministic) { args in block(args[0].map(value), args[1].map(value)) }
9898
return { a, b in fn([a, b]) }
9999
}
100100

101-
public func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A?, B) -> Z?) throws -> (Expression<A?>, Expression<B>) -> Expression<Z?> {
101+
func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A?, B) -> Z?) throws -> (Expression<A?>, Expression<B>) -> Expression<Z?> {
102102
let fn = try createFunction(function, 2, deterministic) { args in block(args[0].map(value), value(args[1])) }
103103
return { a, b in fn([a, b]) }
104104
}
105105

106-
public func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A, B?) -> Z?) throws -> (Expression<A>, Expression<B?>) -> Expression<Z?> {
106+
func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A, B?) -> Z?) throws -> (Expression<A>, Expression<B?>) -> Expression<Z?> {
107107
let fn = try createFunction(function, 2, deterministic) { args in block(value(args[0]), args[1].map(value)) }
108108
return { a, b in fn([a, b]) }
109109
}
110110

111-
public func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A?, B?) -> Z?) throws -> (Expression<A?>, Expression<B?>) -> Expression<Z?> {
111+
func createFunction<Z : Value, A : Value, B : Value>(_ function: String, deterministic: Bool = false, _ block: @escaping (A?, B?) -> Z?) throws -> (Expression<A?>, Expression<B?>) -> Expression<Z?> {
112112
let fn = try createFunction(function, 2, deterministic) { args in block(args[0].map(value), args[1].map(value)) }
113113
return { a, b in fn([a, b]) }
114114
}

0 commit comments

Comments
 (0)