summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-07-09 01:11:35 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-07-09 01:11:35 (GMT)
commit3e50d680a37401c05d753982eb5d43c0f1225f63 (patch)
treecd52d303d28f719ddd316a203af702c42fae69bf
parent6cb86a552f4f320b47232ef745ae897ad5ead591 (diff)
downloadQt-3e50d680a37401c05d753982eb5d43c0f1225f63.zip
Qt-3e50d680a37401c05d753982eb5d43c0f1225f63.tar.gz
Qt-3e50d680a37401c05d753982eb5d43c0f1225f63.tar.bz2
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
-rw-r--r--src/gui/math3d/qgenericmatrix.h4
1 files changed, 3 insertions, 1 deletions
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<N, M, T, InnerT>::QGenericMatrix()
template <int N, int M, typename T, typename InnerT>
Q_INLINE_TEMPLATE QGenericMatrix<N, M, T, InnerT>::QGenericMatrix(const QGenericMatrix<N, M, T, InnerT>& 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 <int N, int M, typename T, typename InnerT>