From 194fa0dc02ea1e1e7ae6a24f0b4197db39dcf652 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 10 Jun 2024 15:21:45 +0200 Subject: [PATCH] Fix build error from signed/unsigned mismatch When building for 32bit Android: qcolorclut_p.h:45:31: error: comparison of integers of different signs: 'qsizetype' (aka 'int') and 'unsigned int' [-Werror,-Wsign-compare] Q_ASSERT(table.size() == gridPointsX * gridPointsY * gridPointsZ * gridPointsW); ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix by casting the result of the multiplication explicitly to qsizetype. Change-Id: Ica9a2f9738959adfa841270ffdd4893bd7d1d4e8 Reviewed-by: Allan Sandfeld Jensen (cherry picked from commit 37ba5e94d681c8d65b0e44a14b0e1595d072800e) Reviewed-by: Qt Cherry-pick Bot --- src/gui/painting/qcolorclut_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qcolorclut_p.h b/src/gui/painting/qcolorclut_p.h index d95e9701b7e..9cf8b6f2670 100644 --- a/src/gui/painting/qcolorclut_p.h +++ b/src/gui/painting/qcolorclut_p.h @@ -42,7 +42,7 @@ public: QColorVector apply(const QColorVector &v) const { - Q_ASSERT(table.size() == gridPointsX * gridPointsY * gridPointsZ * gridPointsW); + Q_ASSERT(table.size() == qsizetype(gridPointsX * gridPointsY * gridPointsZ * gridPointsW)); QColorVector frac; const float x = std::clamp(v.x, 0.0f, 1.0f) * (gridPointsX - 1); const float y = std::clamp(v.y, 0.0f, 1.0f) * (gridPointsY - 1);