From faaef169f587084f517f16c72825f304bbef6dba Mon Sep 17 00:00:00 2001 From: Matthias Rauter Date: Mon, 12 Feb 2024 10:56:20 +0100 Subject: [PATCH] Fix unsigned/signed mismatch warning in KTX file reading On MSCV x86 (32bit) the comparison of qsizetype with std::numeric_limits::max() leads to a warning. This patch adds a static cast to avoid the warning. This is an ammendment to 28ecb523ce8490bff38b251b3df703c72e057519 Pick-to: 6.6 6.5 6.2 Change-Id: Ie50572165ac31aafa7d23570bc133c5c96cf8b00 Reviewed-by: Jonas Karlsson (cherry picked from commit 6463b36da05bf57f2ff5857be6fa56e2c240fe12) Reviewed-by: Qt Cherry-pick Bot --- src/gui/util/qktxhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/util/qktxhandler.cpp b/src/gui/util/qktxhandler.cpp index d6948cc01d3..35f1df1185a 100644 --- a/src/gui/util/qktxhandler.cpp +++ b/src/gui/util/qktxhandler.cpp @@ -105,7 +105,7 @@ QTextureFileData QKtxHandler::read() return QTextureFileData(); const QByteArray buf = device()->readAll(); - if (buf.size() > std::numeric_limits::max()) { + if (static_cast(buf.size()) > std::numeric_limits::max()) { qWarning(lcQtGuiTextureIO, "Too big KTX file %s", logName().constData()); return QTextureFileData(); }