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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Duplicate
    • Affects Version/s: 5.13.0
    • Fix Version/s: None
    • Component/s: SerialBus: MOD Bus
    • Labels:
      None
    • Platform/s:
      All

      Description

      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));
        }
      }

        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:
              chrisemsen Chris Emsen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes