SCTP: fix qsizetype miss

Found by clang 12:
qsctpsocket.cpp:172:56: error: result of comparison of constant 9223372036854775782 with expression of type 'int' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
            Q_ASSERT((datagramSize + int(bytesToRead)) < MaxByteArraySize);
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~

Change-Id: I7246c3e7bb894e0d9521fffd168af11764956d8f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Thiago Macieira 2021-06-22 08:28:18 -07:00
parent d6e01ae05c
commit 8b882f42e8
1 changed files with 2 additions and 2 deletions

View File

@ -156,7 +156,7 @@ bool QSctpSocketPrivate::canReadNotification()
const int savedCurrentChannel = currentReadChannel;
bool currentChannelRead = false;
do {
int datagramSize = incomingDatagram.size();
qsizetype datagramSize = incomingDatagram.size();
QIpPacketHeader header;
do {
@ -169,7 +169,7 @@ bool QSctpSocketPrivate::canReadNotification()
bytesToRead = 4096;
}
Q_ASSERT((datagramSize + int(bytesToRead)) < MaxByteArraySize);
Q_ASSERT((datagramSize + qsizetype(bytesToRead)) < MaxByteArraySize);
incomingDatagram.resize(datagramSize + int(bytesToRead));
#if defined (QSCTPSOCKET_DEBUG)