Skip to content

Commit 3953a37

Browse files
committed
Update CSocketAddress
1 parent 7a75f2f commit 3953a37

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Sources/Socket/System/CSocketAddress.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ internal protocol CSocketAddress {
1010
internal extension CSocketAddress {
1111

1212
func withUnsafePointer<Result>(
13-
_ body: (UnsafePointer<CInterop.SocketAddress>, UInt32) throws -> Result
13+
_ body: (UnsafePointer<CInterop.SocketAddress>, CInterop.SocketLength) throws -> Result
1414
) rethrows -> Result {
1515
return try Swift.withUnsafeBytes(of: self) {
16-
return try body($0.baseAddress!.assumingMemoryBound(to: CInterop.SocketAddress.self), UInt32(MemoryLayout<Self>.size))
16+
return try body($0.baseAddress!.assumingMemoryBound(to: CInterop.SocketAddress.self), CInterop.SocketLength(MemoryLayout<Self>.size))
1717
}
1818
}
1919

2020
mutating func withUnsafeMutablePointer<Result>(
21-
_ body: (UnsafeMutablePointer<CInterop.SocketAddress>, UInt32) throws -> Result
21+
_ body: (UnsafeMutablePointer<CInterop.SocketAddress>, CInterop.SocketLength) throws -> Result
2222
) rethrows -> Result {
2323
return try Swift.withUnsafeMutableBytes(of: &self) {
24-
return try body($0.baseAddress!.assumingMemoryBound(to: CInterop.SocketAddress.self), UInt32(MemoryLayout<Self>.size))
24+
return try body($0.baseAddress!.assumingMemoryBound(to: CInterop.SocketAddress.self), CInterop.SocketLength(MemoryLayout<Self>.size))
2525
}
2626
}
2727
}

0 commit comments

Comments
 (0)