diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-06-16 10:45:33 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-06-17 22:05:15 +0200 |
commit | 4d90725e77a2a5d8171f84697031deb227f72917 (patch) | |
tree | d6f10d1dabcf5587feb36317c74a8715391901dc /src/gui/math3d | |
parent | 57d46aef2a1f08f56f6925f386e082835c64bf2c (diff) |
Disable float-equal warnings in QGenericMatrix
Those warnings can cause compile errors if someone instantiates the
equality operator.
Pick-to: 5.15
Change-Id: I95fab87a424b2d359a8f3e22134f9d3ff6219703
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/gui/math3d')
-rw-r--r-- | src/gui/math3d/qgenericmatrix.h | 12 |
1 files 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<N, M, T>& QGenericMatrix<N, M, T>::operator* return *this; } +QT_WARNING_PUSH +QT_WARNING_DISABLE_FLOAT_COMPARE + template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator==(const QGenericMatrix<N, M, T>& other) const { @@ -233,14 +236,11 @@ Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator==(const QGenericMatr template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator!=(const QGenericMatrix<N, M, T>& 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 <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator/=(T divisor) { |