Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.12.0
-
None
-
-
5
-
93c5fedba1618bad1e6e3aaeff279a51c75f5e81 (qt/qtserialbus/dev)
-
Qt6_Foundation_Sprint 30, Qt6_Foundation_Sprint 31
Description
`valueCount()` returns an unsigned value - fair enough the number of values can never be negative.
However, all the other accessor functions take `index` as an int - signed by default.
This means there will always have to be a messy static_cast somewhere when looping through the values. Even the example code for `readReady()` is not warning free...
Some consistency would be great please, all signed, or all unsigned, and warning free compiles.
TODO:
- change value()/setValue() to use qsizetype
- change valueCount()/setValueCount() to use qsizetype
- adapt example code and documention to use qsizetype
Attachments
Issue Links
- is duplicated by
-
QTBUG-81702 QModbusDataUnit has inconsistent types for valueCount() and value()
- Closed
- relates to
-
QTBUG-64145 Qt SerialBus Changes in Qt 6
- Closed
For Gerrit Dashboard: QTBUG-73743 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
340720,4 | Fix QModbusDataUnit inconsistent signedness for params and return values | dev | qt/qtserialbus | Status: MERGED | +2 | 0 |