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

QModbusDataUnit has inconsistent signedness for params and return values

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 6.2.0 Alpha
    • 5.12.0
    • SerialBus: MOD Bus
    • None
    • All
    • 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

          For Gerrit Dashboard: QTBUG-73743
          # Subject Branch Project Status CR V

          Activity

            People

              heimrich Karsten Heimrich
              cemsen Chris Emsen
              Maurice Kalinowski Maurice Kalinowski
              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