Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-73743

QModbusDataUnit has inconsistent signedness for params and return values

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.12.0
    • Fix Version/s: 6.2.0 Alpha
    • Component/s: SerialBus: MOD Bus
    • Labels:
      None
    • Platform/s:
      All
    • Commits:
      93c5fedba1618bad1e6e3aaeff279a51c75f5e81 (qt/qtserialbus/dev)
    • Story Points:
      5
    • Sprint:
      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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              heimrich Karsten Heimrich
              Reporter:
              cemsen Chris Emsen
              PM Owner:
              Maurice Kalinowski Maurice Kalinowski
              RnD Owner:
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes