summaryrefslogtreecommitdiffstats
path: root/src/gui/math3d/qquaternion.h
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2016-11-18 14:05:34 +0100
committerJesus Fernandez <jesus.fernandez@qt.io>2016-11-30 17:04:17 +0000
commit1e4054ce2f4f7b488b5d4963f32d4025e20cf537 (patch)
tree14704334cc04990e2754b630dbc91f6df4b37c6d /src/gui/math3d/qquaternion.h
parent4a7f3c327b851f0b118b7d84ce00b53f3f1df712 (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/math3d/qquaternion.h')
-rw-r--r--src/gui/math3d/qquaternion.h5
1 files changed, 3 insertions, 2 deletions
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);