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

QModbusDataUnit has inconsistent types for valueCount() and value()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.13.0
    • SerialBus: MOD Bus
    • None
    • All

      getters\setters for length of the array use uint's.

      getters\setters for accessing the values use int's.

      This generates compiler and clang warnings about changing signedness - requiring lots of pointless casting to make the code clean.

      void OnModbusReadComplete (const QModbusDataUnit *pData)
      {
        for (int i=0; i<static_cast <int>(pData->valueCount ()); i++)
        {
          do_something_with_value (pData->value (i));
        }
      }

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

            heimrich Karsten Heimrich
            chrisemsen Chris Emsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes