Skip to content

Commit ae86891

Browse files
committed
Swift 1.2 beta 2
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
1 parent 5532303 commit ae86891

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

SQLite Tests/StatementTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func withBlob(block: Blob -> ()) {
154154
let length = 1
155155
let buflen = Int(length) + 1
156156
let buffer = UnsafeMutablePointer<()>.alloc(buflen)
157-
memcpy(buffer, "4", UInt(length))
157+
memcpy(buffer, "4", length)
158158
block(Blob(bytes: buffer, length: length))
159159
buffer.dealloc(buflen)
160160
}

SQLite/Database.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import Foundation
2727
/// A connection (handle) to a SQLite database.
2828
public final class Database {
2929

30-
internal var handle = COpaquePointer.null()
30+
internal var handle: COpaquePointer = nil
3131

3232
/// Whether or not the database was opened in a read-only state.
3333
public var readonly: Bool { return sqlite3_db_readonly(handle, nil) == 1 }

SQLite/Functions.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ public extension Database {
173173

174174
}
175175

176-
private func asValue<A: Value>(value: Binding?) -> A {
176+
private func asValue<A: Value>(value: Binding) -> A {
177177
return A.fromDatatypeValue(value as! A.Datatype) as! A
178178
}
179+
180+
private func asValue<A: Value>(value: Binding?) -> A {
181+
return asValue(value!)
182+
}

SQLite/Query.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ public struct Row {
768768
}
769769
public func get<V: Value>(column: Expression<V?>) -> V? {
770770
func valueAtIndex(idx: Int) -> V? {
771-
if let value = values[idx] as? V.Datatype { return (V.fromDatatypeValue(value) as! V) }
771+
if let value = self.values[idx] as? V.Datatype { return (V.fromDatatypeValue(value) as! V) }
772772
return nil
773773
}
774774

@@ -821,8 +821,7 @@ public struct QueryGenerator: GeneratorType {
821821
private lazy var columnNames: [String: Int] = {
822822
var (columnNames, idx) = ([String: Int](), 0)
823823
column: for each in self.query.columns ?? [Expression<()>(literal: "*")] {
824-
// FIXME: rdar://19769314 // split(each.expression.SQL) { $0 == "." }
825-
let pair = split(each.expression.SQL, { $0 == "." })
824+
let pair = split(each.expression.SQL) { $0 == "." }
826825
let (tableName, column) = (pair.count > 1 ? pair.first : nil, pair.last!)
827826

828827
func expandGlob(namespace: Bool) -> Query -> () {

SQLite/Statement.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal let SQLITE_TRANSIENT = sqlite3_destructor_type(COpaquePointer(bitPatter
2828
/// A single SQL statement.
2929
public final class Statement {
3030

31-
private var handle = COpaquePointer.null()
31+
private var handle: COpaquePointer = nil
3232

3333
private let database: Database
3434

0 commit comments

Comments
 (0)