Skip to content

Commit 2c0a3c2

Browse files
committed
[SE-0111] Update for removal of argument labels from function types
1 parent 8976101 commit 2c0a3c2

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/swift/Data.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ public struct DispatchData : RandomAccessCollection {
8686
}
8787

8888
public func enumerateBytes(
89-
block: @noescape (buffer: UnsafeBufferPointer<UInt8>, byteIndex: Int, stop: inout Bool) -> Void)
89+
block: @noescape (_ buffer: UnsafeBufferPointer<UInt8>, _ byteIndex: Int, _ stop: inout Bool) -> Void)
9090
{
9191
_swift_dispatch_data_apply(__wrapped.__wrapped) { (data: dispatch_data_t, offset: Int, ptr: UnsafeRawPointer, size: Int) in
9292
let bytePtr = ptr.bindMemory(to: UInt8.self, capacity: size)
9393
let bp = UnsafeBufferPointer(start: bytePtr, count: size)
9494
var stop = false
95-
block(buffer: bp, byteIndex: offset, stop: &stop)
95+
block(bp, offset, &stop)
9696
return !stop
9797
}
9898
}

src/swift/IO.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@ public extension DispatchIO {
3434
public static let strictInterval = IntervalFlags(rawValue: 1)
3535
}
3636

37-
public class func read(fromFileDescriptor: Int32, maxLength: Int, runningHandlerOn queue: DispatchQueue, handler: (data: DispatchData, error: Int32) -> Void) {
37+
public class func read(fromFileDescriptor: Int32, maxLength: Int, runningHandlerOn queue: DispatchQueue, handler: (_ data: DispatchData, _ error: Int32) -> Void) {
3838
dispatch_read(fromFileDescriptor, maxLength, queue.__wrapped) { (data: dispatch_data_t, error: Int32) in
39-
handler(data: DispatchData(data: data), error: error)
39+
handler(DispatchData(data: data), error)
4040
}
4141
}
4242

43-
public class func write(toFileDescriptor: Int32, data: DispatchData, runningHandlerOn queue: DispatchQueue, handler: (data: DispatchData?, error: Int32) -> Void) {
43+
public class func write(toFileDescriptor: Int32, data: DispatchData, runningHandlerOn queue: DispatchQueue, handler: (_ data: DispatchData?, _ error: Int32) -> Void) {
4444
dispatch_write(toFileDescriptor, data.__wrapped.__wrapped, queue.__wrapped) { (data: dispatch_data_t?, error: Int32) in
45-
handler(data: data.flatMap { DispatchData(data: $0) }, error: error)
45+
handler(data.flatMap { DispatchData(data: $0) }, error)
4646
}
4747
}
4848

4949
public convenience init(
5050
type: StreamType,
5151
fileDescriptor: Int32,
5252
queue: DispatchQueue,
53-
cleanupHandler: (error: Int32) -> Void)
53+
cleanupHandler: (_ error: Int32) -> Void)
5454
{
5555
self.init(__type: type.rawValue, fd: fileDescriptor, queue: queue, handler: cleanupHandler)
5656
}
@@ -61,7 +61,7 @@ public extension DispatchIO {
6161
oflag: Int32,
6262
mode: mode_t,
6363
queue: DispatchQueue,
64-
cleanupHandler: (error: Int32) -> Void)
64+
cleanupHandler: (_ error: Int32) -> Void)
6565
{
6666
self.init(__type: type.rawValue, path: path, oflag: oflag, mode: mode, queue: queue, handler: cleanupHandler)
6767
}
@@ -70,20 +70,20 @@ public extension DispatchIO {
7070
type: StreamType,
7171
io: DispatchIO,
7272
queue: DispatchQueue,
73-
cleanupHandler: (error: Int32) -> Void)
73+
cleanupHandler: (_ error: Int32) -> Void)
7474
{
7575
self.init(__type: type.rawValue, io: io, queue: queue, handler: cleanupHandler)
7676
}
7777

78-
public func read(offset: off_t, length: Int, queue: DispatchQueue, ioHandler: (done: Bool, data: DispatchData?, error: Int32) -> Void) {
78+
public func read(offset: off_t, length: Int, queue: DispatchQueue, ioHandler: (_ done: Bool, _ data: DispatchData?, _ error: Int32) -> Void) {
7979
dispatch_io_read(self.__wrapped, offset, length, queue.__wrapped) { (done: Bool, data: dispatch_data_t?, error: Int32) in
80-
ioHandler(done: done, data: data.flatMap { DispatchData(data: $0) }, error: error)
80+
ioHandler(done, data.flatMap { DispatchData(data: $0) }, error)
8181
}
8282
}
8383

84-
public func write(offset: off_t, data: DispatchData, queue: DispatchQueue, ioHandler: (done: Bool, data: DispatchData?, error: Int32) -> Void) {
84+
public func write(offset: off_t, data: DispatchData, queue: DispatchQueue, ioHandler: (_ done: Bool, _ data: DispatchData?, _ error: Int32) -> Void) {
8585
dispatch_io_write(self.__wrapped, offset, data.__wrapped.__wrapped, queue.__wrapped) { (done: Bool, data: dispatch_data_t?, error: Int32) in
86-
ioHandler(done: done, data: data.flatMap { DispatchData(data: $0) }, error: error)
86+
ioHandler(done, data.flatMap { DispatchData(data: $0) }, error)
8787
}
8888
}
8989

src/swift/Wrapper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,17 @@ public class DispatchIO : DispatchObject {
9191
}
9292

9393
internal init(__type: UInt, fd: Int32, queue: DispatchQueue,
94-
handler: (error: Int32) -> Void) {
94+
handler: (_ error: Int32) -> Void) {
9595
__wrapped = dispatch_io_create(__type, fd, queue.__wrapped, handler)
9696
}
9797

9898
internal init(__type: UInt, path: UnsafePointer<Int8>, oflag: Int32,
99-
mode: mode_t, queue: DispatchQueue, handler: (error: Int32) -> Void) {
99+
mode: mode_t, queue: DispatchQueue, handler: (_ error: Int32) -> Void) {
100100
__wrapped = dispatch_io_create_with_path(__type, path, oflag, mode, queue.__wrapped, handler)
101101
}
102102

103103
internal init(__type: UInt, io: DispatchIO,
104-
queue: DispatchQueue, handler: (error: Int32) -> Void) {
104+
queue: DispatchQueue, handler: (_ error: Int32) -> Void) {
105105
__wrapped = dispatch_io_create_with_io(__type, io.__wrapped, queue.__wrapped, handler)
106106
}
107107

0 commit comments

Comments
 (0)