From 4d90725e77a2a5d8171f84697031deb227f72917 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 16 Jun 2020 10:45:33 +0200 Subject: [PATCH] Disable float-equal warnings in QGenericMatrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Those warnings can cause compile errors if someone instantiates the equality operator. Pick-to: 5.15 Change-Id: I95fab87a424b2d359a8f3e22134f9d3ff6219703 Reviewed-by: MÃ¥rten Nordheim --- src/gui/math3d/qgenericmatrix.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h index 692c29c996..81fc9eee62 100644 --- a/src/gui/math3d/qgenericmatrix.h +++ b/src/gui/math3d/qgenericmatrix.h @@ -219,6 +219,9 @@ Q_OUTOFLINE_TEMPLATE QGenericMatrix& QGenericMatrix::operator* return *this; } +QT_WARNING_PUSH +QT_WARNING_DISABLE_FLOAT_COMPARE + template Q_OUTOFLINE_TEMPLATE bool QGenericMatrix::operator==(const QGenericMatrix& other) const { @@ -233,14 +236,11 @@ Q_OUTOFLINE_TEMPLATE bool QGenericMatrix::operator==(const QGenericMatr template Q_OUTOFLINE_TEMPLATE bool QGenericMatrix::operator!=(const QGenericMatrix& other) const { - for (int row = 0; row < M; ++row) - for (int col = 0; col < N; ++col) { - if (m[col][row] != other.m[col][row]) - return true; - } - return false; + return !(*this == other); } +QT_WARNING_POP + template Q_OUTOFLINE_TEMPLATE QGenericMatrix& QGenericMatrix::operator/=(T divisor) {