Android: clang fix implicit conversion warning

The error message was:
 error: implicit conversion
      increases floating-point precision: 'float' to 'double'
      [-Werror,-Wdouble-promotion]

Change-Id: I2cbf035d4e7b223d1280d53255d54b2a6c48ea37
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
BogDan Vatra 2017-09-06 10:45:01 +03:00
parent e0b7de5dff
commit f56c797ef9

View File

@ -122,25 +122,25 @@ template<> inline char *toString(const QRegion &region)
#ifndef QT_NO_VECTOR2D
template<> inline char *toString(const QVector2D &v)
{
QByteArray result = "QVector2D(" + QByteArray::number(v.x()) + ", "
+ QByteArray::number(v.y()) + ')';
QByteArray result = "QVector2D(" + QByteArray::number(double(v.x())) + ", "
+ QByteArray::number(double(v.y())) + ')';
return qstrdup(result.constData());
}
#endif // !QT_NO_VECTOR2D
#ifndef QT_NO_VECTOR3D
template<> inline char *toString(const QVector3D &v)
{
QByteArray result = "QVector3D(" + QByteArray::number(v.x()) + ", "
+ QByteArray::number(v.y()) + ", " + QByteArray::number(v.z()) + ')';
QByteArray result = "QVector3D(" + QByteArray::number(double(v.x())) + ", "
+ QByteArray::number(double(v.y())) + ", " + QByteArray::number(double(v.z())) + ')';
return qstrdup(result.constData());
}
#endif // !QT_NO_VECTOR3D
#ifndef QT_NO_VECTOR4D
template<> inline char *toString(const QVector4D &v)
{
QByteArray result = "QVector4D(" + QByteArray::number(v.x()) + ", "
+ QByteArray::number(v.y()) + ", " + QByteArray::number(v.z())
+ ", " + QByteArray::number(v.w()) + ')';
QByteArray result = "QVector4D(" + QByteArray::number(double(v.x())) + ", "
+ QByteArray::number(double(v.y())) + ", " + QByteArray::number(double(v.z()))
+ ", " + QByteArray::number(double(v.w())) + ')';
return qstrdup(result.constData());
}
#endif // !QT_NO_VECTOR4D