diff options
author | Tom Payne <twpayne@gmail.com> | 2024-04-02 09:21:08 +0000 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2024-04-04 14:40:38 +0000 |
commit | cabba82f75d7f55a0657810d02d534745dee5d59 (patch) | |
tree | a8e6526c5d12b28804ad27a8600393703561cd2c | |
parent | 1a50d9738bb732c5dc3de113b13fb9ac06da1369 (diff) | |
download | golang-x-sys-cabba82f75d7f55a0657810d02d534745dee5d59.tar.gz |
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: bc93d94a45ae36676c259ce534361ccff7b185de
GitHub-Pull-Request: golang/sys#189
Reviewed-on: https://go-review.googlesource.com/c/sys/+/575635
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
-rw-r--r-- | windows/syscall_windows.go | 16 | ||||
-rw-r--r-- | windows/types_windows.go | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/windows/syscall_windows.go b/windows/syscall_windows.go index ce78c58..6525c62 100644 --- a/windows/syscall_windows.go +++ b/windows/syscall_windows.go @@ -1864,14 +1864,14 @@ const ( CBR_128000 = 128000 CBR_256000 = 256000 - DTR_CONTROL_DISABLE = 0x00 - DTR_CONTROL_ENABLE = 0x01 - DTR_CONTROL_HANDSHAKE = 0x02 - - RTS_CONTROL_DISABLE = 0x00 - RTS_CONTROL_ENABLE = 0x01 - RTS_CONTROL_HANDSHAKE = 0x02 - RTS_CONTROL_TOGGLE = 0x03 + DTR_CONTROL_DISABLE = 0x00000000 + DTR_CONTROL_ENABLE = 0x00000010 + DTR_CONTROL_HANDSHAKE = 0x00000020 + + RTS_CONTROL_DISABLE = 0x00000000 + RTS_CONTROL_ENABLE = 0x00001000 + RTS_CONTROL_HANDSHAKE = 0x00002000 + RTS_CONTROL_TOGGLE = 0x00003000 NOPARITY = 0 ODDPARITY = 1 diff --git a/windows/types_windows.go b/windows/types_windows.go index a3a7ab8..d8cb71d 100644 --- a/windows/types_windows.go +++ b/windows/types_windows.go @@ -3382,7 +3382,7 @@ type BLOB struct { } type ComStat struct { - Flags [4]uint8 + Flags uint32 CBInQue uint32 CBOutQue uint32 } @@ -3390,7 +3390,7 @@ type ComStat struct { type DCB struct { DCBlength uint32 BaudRate uint32 - Flags [4]uint8 + Flags uint32 wReserved uint16 XonLim uint16 XoffLim uint16 |