From 9c4cbc0cc768fe8694d6e19b62b8ea8f4fb9d966 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 23 Apr 2015 13:15:40 +0200 Subject: QGenericMatrix: remove one of two non-initializing ctors ...and port to the remaining one. Can't do the same for QMatrix4x4, because that class is exported. Change-Id: I5448921af9e9194532be1b9f8d739b5c418a5e0b Reviewed-by: Konstantin Ritt --- src/gui/math3d/qgenericmatrix.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h index d23ff86f64..c08faaaa8b 100644 --- a/src/gui/math3d/qgenericmatrix.h +++ b/src/gui/math3d/qgenericmatrix.h @@ -92,8 +92,6 @@ private: #endif T m[N][M]; // Column-major order to match OpenGL. - explicit QGenericMatrix(int) {} // Construct without initializing identity matrix. - #if !defined(Q_NO_TEMPLATE_FRIENDS) template friend class QGenericMatrix; @@ -169,7 +167,7 @@ Q_OUTOFLINE_TEMPLATE void QGenericMatrix::fill(T value) template Q_OUTOFLINE_TEMPLATE QGenericMatrix QGenericMatrix::transposed() const { - QGenericMatrix result(1); + QGenericMatrix result(Qt::Uninitialized); for (int row = 0; row < M; ++row) for (int col = 0; col < N; ++col) result.m[row][col] = m[col][row]; @@ -237,7 +235,7 @@ Q_OUTOFLINE_TEMPLATE QGenericMatrix& QGenericMatrix::operator/ template Q_OUTOFLINE_TEMPLATE QGenericMatrix operator+(const QGenericMatrix& m1, const QGenericMatrix& m2) { - QGenericMatrix result(1); + QGenericMatrix result(Qt::Uninitialized); for (int row = 0; row < M; ++row) for (int col = 0; col < N; ++col) result.m[col][row] = m1.m[col][row] + m2.m[col][row]; @@ -247,7 +245,7 @@ Q_OUTOFLINE_TEMPLATE QGenericMatrix operator+(const QGenericMatrix Q_OUTOFLINE_TEMPLATE QGenericMatrix operator-(const QGenericMatrix& m1, const QGenericMatrix& m2) { - QGenericMatrix result(1); + QGenericMatrix result(Qt::Uninitialized); for (int row = 0; row < M; ++row) for (int col = 0; col < N; ++col) result.m[col][row] = m1.m[col][row] - m2.m[col][row]; @@ -257,7 +255,7 @@ Q_OUTOFLINE_TEMPLATE QGenericMatrix operator-(const QGenericMatrix Q_OUTOFLINE_TEMPLATE QGenericMatrix operator*(const QGenericMatrix& m1, const QGenericMatrix& m2) { - QGenericMatrix result(1); + QGenericMatrix result(Qt::Uninitialized); for (int row = 0; row < M2; ++row) { for (int col = 0; col < M1; ++col) { T sum(0.0f); @@ -272,7 +270,7 @@ Q_OUTOFLINE_TEMPLATE QGenericMatrix operator*(const QGenericMatrix Q_OUTOFLINE_TEMPLATE QGenericMatrix operator-(const QGenericMatrix& matrix) { - QGenericMatrix result(1); + QGenericMatrix result(Qt::Uninitialized); for (int row = 0; row < M; ++row) for (int col = 0; col < N; ++col) result.m[col][row] = -matrix.m[col][row]; @@ -282,7 +280,7 @@ Q_OUTOFLINE_TEMPLATE QGenericMatrix operator-(const QGenericMatrix Q_OUTOFLINE_TEMPLATE QGenericMatrix operator*(T factor, const QGenericMatrix& matrix) { - QGenericMatrix result(1); + QGenericMatrix result(Qt::Uninitialized); for (int row = 0; row < M; ++row) for (int col = 0; col < N; ++col) result.m[col][row] = matrix.m[col][row] * factor; @@ -292,7 +290,7 @@ Q_OUTOFLINE_TEMPLATE QGenericMatrix operator*(T factor, const QGenericM template Q_OUTOFLINE_TEMPLATE QGenericMatrix operator*(const QGenericMatrix& matrix, T factor) { - QGenericMatrix result(1); + QGenericMatrix result(Qt::Uninitialized); for (int row = 0; row < M; ++row) for (int col = 0; col < N; ++col) result.m[col][row] = matrix.m[col][row] * factor; @@ -302,7 +300,7 @@ Q_OUTOFLINE_TEMPLATE QGenericMatrix operator*(const QGenericMatrix Q_OUTOFLINE_TEMPLATE QGenericMatrix operator/(const QGenericMatrix& matrix, T divisor) { - QGenericMatrix result(1); + QGenericMatrix result(Qt::Uninitialized); for (int row = 0; row < M; ++row) for (int col = 0; col < N; ++col) result.m[col][row] = matrix.m[col][row] / divisor; -- cgit v1.2.3