Skip to content

Commit cabba82

Browse files
twpaynegopherbot
authored andcommitted
windows: use uint32 for serial comm flags for consistency
This is a follow-up to https://go-review.googlesource.com/c/sys/+/572295 and specifically the comment https://go-review.googlesource.com/c/sys/+/572295/comment/a00e1a2e_e3b01666/. All other structs and methods us uint32 in golang.org/x/sys/windows for flag bitmasks, so make the serial communication structs use uint32 to be consistent with the rest of the package. As a side effect the DTR_CONTROL_* and RTS_CONTROL_* constants are updated to reflect the positions of the bits in the 32-bit flags. Change-Id: Ie19774a8ef5411d7df1e5b0d36806aa1d401fa86 GitHub-Last-Rev: bc93d94 GitHub-Pull-Request: #189 Reviewed-on: https://go-review.googlesource.com/c/sys/+/575635 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Alex Brainman <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
1 parent 1a50d97 commit cabba82

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

windows/syscall_windows.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -1864,14 +1864,14 @@ const (
18641864
CBR_128000 = 128000
18651865
CBR_256000 = 256000
18661866

1867-
DTR_CONTROL_DISABLE = 0x00
1868-
DTR_CONTROL_ENABLE = 0x01
1869-
DTR_CONTROL_HANDSHAKE = 0x02
1870-
1871-
RTS_CONTROL_DISABLE = 0x00
1872-
RTS_CONTROL_ENABLE = 0x01
1873-
RTS_CONTROL_HANDSHAKE = 0x02
1874-
RTS_CONTROL_TOGGLE = 0x03
1867+
DTR_CONTROL_DISABLE = 0x00000000
1868+
DTR_CONTROL_ENABLE = 0x00000010
1869+
DTR_CONTROL_HANDSHAKE = 0x00000020
1870+
1871+
RTS_CONTROL_DISABLE = 0x00000000
1872+
RTS_CONTROL_ENABLE = 0x00001000
1873+
RTS_CONTROL_HANDSHAKE = 0x00002000
1874+
RTS_CONTROL_TOGGLE = 0x00003000
18751875

18761876
NOPARITY = 0
18771877
ODDPARITY = 1

windows/types_windows.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3382,15 +3382,15 @@ type BLOB struct {
33823382
}
33833383

33843384
type ComStat struct {
3385-
Flags [4]uint8
3385+
Flags uint32
33863386
CBInQue uint32
33873387
CBOutQue uint32
33883388
}
33893389

33903390
type DCB struct {
33913391
DCBlength uint32
33923392
BaudRate uint32
3393-
Flags [4]uint8
3393+
Flags uint32
33943394
wReserved uint16
33953395
XonLim uint16
33963396
XoffLim uint16

0 commit comments

Comments
 (0)