From 535afba59b4d5cc09a047132c5c21a210df86e45 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 13 Feb 2024 14:55:24 +0100 Subject: [PATCH] Fix build with gcc-14 Work-around SiC change made to qfloat16 when using native floats. Pick-to: 6.5 Change-Id: I981505e6eff7277ad14512b56fad334be6e79016 Reviewed-by: Ville Voutilainen Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira (cherry picked from commit dcb2186c2a3199d39af09bb81376437b55b907ef) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit a1413a6ecd100cde04a4c72bc0cf90d7c706dd6c) --- .../gui/painting/qcolortransform/tst_qcolortransform.cpp | 8 ++++---- tests/auto/gui/rhi/qrhi/tst_qrhi.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/auto/gui/painting/qcolortransform/tst_qcolortransform.cpp b/tests/auto/gui/painting/qcolortransform/tst_qcolortransform.cpp index 06e8db3e71b..2019d8a8385 100644 --- a/tests/auto/gui/painting/qcolortransform/tst_qcolortransform.cpp +++ b/tests/auto/gui/painting/qcolortransform/tst_qcolortransform.cpp @@ -182,21 +182,21 @@ void tst_QColorTransform::mapRGBAFP16x4() else QVERIFY(result != testColor); - testColor = QRgbaFloat16{0.0f, 0.0f, 0.0f, 1.0f}; + testColor = QRgbaFloat16{qfloat16(0.0f), qfloat16(0.0f), qfloat16(0.0f), qfloat16(1.0f)}; result = transform.map(testColor); QCOMPARE(result, testColor); - testColor = QRgbaFloat16{1.0f, 1.0f, 1.0f, 1.0f}; + testColor = QRgbaFloat16{qfloat16(1.0f), qfloat16(1.0f), qfloat16(1.0f), qfloat16(1.0f)}; result = transform.map(testColor); QCOMPARE(result, testColor); - testColor = QRgbaFloat16{1.0f, 1.0f, 0.0f, 1.0f}; + testColor = QRgbaFloat16{qfloat16(1.0f), qfloat16(1.0f), qfloat16(1.0f), qfloat16(1.0f)}; result = transform.map(testColor); QCOMPARE(result.alpha(), 1.0f); if (sharesRed) QCOMPARE(result.red(), 1.0f); - testColor = QRgbaFloat16{0.0f, 1.0f, 1.0f, 1.0f}; + testColor = QRgbaFloat16{qfloat16(0.0f), qfloat16(1.0f), qfloat16(1.0f), qfloat16(1.0f)}; result = transform.map(testColor); // QRgbaFloat16 might overflow blue if we convert to a smaller gamut: QCOMPARE(result.blue16(), 65535); diff --git a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp index ac66c19e59a..f3bc441a845 100644 --- a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp +++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp @@ -6760,9 +6760,9 @@ void tst_QRhi::halfPrecisionAttributes() // To avoid these errors, we pad the vertices to 8 byte stride. // static const qfloat16 vertices[] = { - -1.0, -1.0, 0.0, 0.0, - 1.0, -1.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, + qfloat16(-1.0), qfloat16(-1.0), qfloat16(0.0), qfloat16(0.0), + qfloat16(1.0), qfloat16(-1.0), qfloat16(0.0), qfloat16(0.0), + qfloat16(0.0), qfloat16(1.0), qfloat16(0.0), qfloat16(0.0), }; QScopedPointer vbuf(rhi->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertices)));