Skip to content

Commit 59e80c5

Browse files
vivkongbryanpkc
authored andcommitted
Change the type of _stdlib_fd_set._data to [UInt] so that it also works correctly for 64-bit big-endian systems.
1 parent 9c62086 commit 59e80c5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stdlib/private/SwiftPrivateLibcExtras/SwiftPrivateLibcExtras.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ public var _stdlib_FD_SETSIZE: CInt {
3838
}
3939

4040
public struct _stdlib_fd_set {
41-
var _data: [UInt32]
41+
var _data: [UInt]
4242
static var _wordBits: Int {
43-
return sizeof(UInt32) * 8
43+
return sizeof(UInt) * 8
4444
}
4545

4646
public init() {
47-
_data = [UInt32](
47+
_data = [UInt](
4848
repeating: 0,
4949
count: Int(_stdlib_FD_SETSIZE) / _stdlib_fd_set._wordBits)
5050
}
@@ -53,20 +53,20 @@ public struct _stdlib_fd_set {
5353
let fdInt = Int(fd)
5454
return (
5555
_data[fdInt / _stdlib_fd_set._wordBits] &
56-
UInt32(1 << (fdInt % _stdlib_fd_set._wordBits))
56+
UInt(1 << (fdInt % _stdlib_fd_set._wordBits))
5757
) != 0
5858
}
5959

6060
public mutating func set(_ fd: CInt) {
6161
let fdInt = Int(fd)
6262
_data[fdInt / _stdlib_fd_set._wordBits] |=
63-
UInt32(1 << (fdInt % _stdlib_fd_set._wordBits))
63+
UInt(1 << (fdInt % _stdlib_fd_set._wordBits))
6464
}
6565

6666
public mutating func clear(_ fd: CInt) {
6767
let fdInt = Int(fd)
6868
_data[fdInt / _stdlib_fd_set._wordBits] &=
69-
~UInt32(1 << (fdInt % _stdlib_fd_set._wordBits))
69+
~UInt(1 << (fdInt % _stdlib_fd_set._wordBits))
7070
}
7171

7272
public mutating func zero() {

0 commit comments

Comments
 (0)