summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2021-03-23 16:42:59 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2021-03-23 18:11:34 +0100
commit7366ff6f52e2e58ee477c5b25a2dbcda719343de (patch)
treea7692e697248dbfe49834a545c01aec6fc36bce4 /examples
parentca98926ad8ae299f04d9994cc7e129df4f6f5edf (diff)
Fix error in websocket example
std::min fails to deduce the correct type to use now that QByteArray::size returns qsizetype instead of always returning int. A cast is needed on 32-bit now though, so let's cast to 64-bit. Change-Id: Ib3acd06527f87ccd807d8bdba64e62809da5f858 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/remoteobjects/websockets/common/websocketiodevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/remoteobjects/websockets/common/websocketiodevice.cpp b/examples/remoteobjects/websockets/common/websocketiodevice.cpp
index 4c3e917..39cb4eb 100644
--- a/examples/remoteobjects/websockets/common/websocketiodevice.cpp
+++ b/examples/remoteobjects/websockets/common/websocketiodevice.cpp
@@ -83,7 +83,7 @@ void WebSocketIoDevice::close()
qint64 WebSocketIoDevice::readData(char *data, qint64 maxlen)
{
- auto sz = std::min(int(maxlen), m_buffer.size());
+ auto sz = std::min(maxlen, qint64(m_buffer.size()));
if (sz <= 0)
return sz;
memcpy(data, m_buffer.constData(), size_t(sz));