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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.13.0
    • SerialBus: MOD Bus
    • None
    • 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

              heimrich Karsten Heimrich
              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