From 1e4054ce2f4f7b488b5d4963f32d4025e20cf537 Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Fri, 18 Nov 2016 14:05:34 +0100 Subject: Add -Wdouble-promotion to headersclean Fixes: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion] Task-number: QTBUG-57068 Change-Id: I897a341aca83873bc6abd256a82a3b9f09409833 Reviewed-by: Thiago Macieira --- src/gui/math3d/qquaternion.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gui/math3d/qquaternion.h') diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h index 21b051e08e..808e0ee6d7 100644 --- a/src/gui/math3d/qquaternion.h +++ b/src/gui/math3d/qquaternion.h @@ -202,7 +202,8 @@ inline QQuaternion QQuaternion::inverted() const double(yp) * double(yp) + double(zp) * double(zp); if (!qFuzzyIsNull(len)) - return QQuaternion(wp / len, -xp / len, -yp / len, -zp / len); + return QQuaternion(double(wp) / len, double(-xp) / len, + double(-yp) / len, double(-zp) / len); return QQuaternion(0.0f, 0.0f, 0.0f, 0.0f); } @@ -251,7 +252,7 @@ inline const QQuaternion operator*(const QQuaternion &q1, const QQuaternion& q2) float zz = (q1.wp + q1.yp) * (q2.wp - q2.zp); float ww = (q1.zp + q1.xp) * (q2.xp + q2.yp); float xx = ww + yy + zz; - float qq = 0.5 * (xx + (q1.zp - q1.xp) * (q2.xp - q2.yp)); + float qq = 0.5f * (xx + (q1.zp - q1.xp) * (q2.xp - q2.yp)); float w = qq - ww + (q1.zp - q1.yp) * (q2.yp - q2.zp); float x = qq - xx + (q1.xp + q1.wp) * (q2.xp + q2.wp); -- cgit v1.2.3