From 3e50d680a37401c05d753982eb5d43c0f1225f63 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 9 Jul 2009 11:11:35 +1000 Subject: Directly copy QGenericMatrix members instead of using qMemCopy() Using qMemCopy limits QGenericMatrix to plain old types like float and double. Copying the values normally will allow copy constructors to work on non plain types. Reviewed-by: trustme --- src/gui/math3d/qgenericmatrix.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h index 1131f9b..7bdf70a 100644 --- a/src/gui/math3d/qgenericmatrix.h +++ b/src/gui/math3d/qgenericmatrix.h @@ -119,7 +119,9 @@ Q_INLINE_TEMPLATE QGenericMatrix::QGenericMatrix() template Q_INLINE_TEMPLATE QGenericMatrix::QGenericMatrix(const QGenericMatrix& other) { - qMemCopy(m, other.m, sizeof(m)); + for (int col = 0; col < N; ++col) + for (int row = 0; row < M; ++row) + m[col][row] = other.m[col][row]; } template -- cgit v0.12