diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-05-22 13:00:38 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-05-23 18:20:44 +0000 |
commit | b206d1c8082a9e01ad3755d311a4cf683ec35161 (patch) | |
tree | f16806fcb6bfdb66908162acae644af0c35610d0 /src/plugins/platforms/vnc/qvnc.cpp | |
parent | 595c1ae9e7be14162acdfcbc573f31ef6661e718 (diff) |
VNC plugin: explicitly cast int to uint16_t before calling htons
Otherwise there is a -Werror=narrowing error on big-endian
architectures (where htons does nothing).
Task-number: QTBUG-68390
Change-Id: Idb204a81aaedb9f4fde1d5fae406da36c7a1953e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/plugins/platforms/vnc/qvnc.cpp')
-rw-r--r-- | src/plugins/platforms/vnc/qvnc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/vnc/qvnc.cpp b/src/plugins/platforms/vnc/qvnc.cpp index 44fc1c6101..ffe00de2b1 100644 --- a/src/plugins/platforms/vnc/qvnc.cpp +++ b/src/plugins/platforms/vnc/qvnc.cpp @@ -552,9 +552,9 @@ void QVncClientCursor::write(QVncClient *client) const { const quint16 tmp[6] = { htons(0), htons(1), - htons(hotspot.x()), htons(hotspot.y()), - htons(cursor.width()), - htons(cursor.height()) }; + htons(uint16_t(hotspot.x())), htons(uint16_t(hotspot.y())), + htons(uint16_t(cursor.width())), + htons(uint16_t(cursor.height())) }; socket->write((char*)tmp, sizeof(tmp)); const qint32 encoding = qToBigEndian(-239); |