diff options
author | David Faure <faure@kde.org> | 2009-09-13 08:18:57 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-09-13 08:18:57 (GMT) |
commit | b2f2967411bcb23a807f6a17b042b4c58701af95 (patch) | |
tree | 7db490cf7846973e8b9850a87a0abd0e54944c0c /src/corelib/kernel | |
parent | 139cffbfe1598b32ffe658968694d163dc53e3dd (diff) | |
download | Qt-b2f2967411bcb23a807f6a17b042b4c58701af95.zip Qt-b2f2967411bcb23a807f6a17b042b4c58701af95.tar.gz Qt-b2f2967411bcb23a807f6a17b042b4c58701af95.tar.bz2 |
Fix -Wconversion warnings where possible.
In order to detect "int foo = myQReal" mistakes, one needs to compile with -Wconversion.
However that flag triggers many warnings inside Qt. This commit fixes many of them, like
qchar.h:295: warning: conversion to 'ushort' from 'unsigned int' may alter its value
qglobal.h:1026: warning: conversion to 'qreal' from 'qint64' may alter its value
qbytearray.h:441: warning: conversion to 'char' from 'int' may alter its value
Other warnings remain (such as those coming from bitfields)
Merge-request: 1460
Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qmath.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/kernel/qmath.h b/src/corelib/kernel/qmath.h index bc0f46f..b521323 100644 --- a/src/corelib/kernel/qmath.h +++ b/src/corelib/kernel/qmath.h @@ -56,7 +56,7 @@ inline int qCeil(qreal v) { #ifdef QT_USE_MATH_H_FLOATS if (sizeof(qreal) == sizeof(float)) - return int(ceilf(v)); + return int(ceilf(float(v))); else #endif return int(ceil(v)); @@ -66,7 +66,7 @@ inline int qFloor(qreal v) { #ifdef QT_USE_MATH_H_FLOATS if (sizeof(qreal) == sizeof(float)) - return int(floorf(v)); + return int(floorf(float(v))); else #endif return int(floor(v)); @@ -76,7 +76,7 @@ inline qreal qSin(qreal v) { #ifdef QT_USE_MATH_H_FLOATS if (sizeof(qreal) == sizeof(float)) - return sinf(v); + return sinf(float(v)); else #endif return sin(v); @@ -86,7 +86,7 @@ inline qreal qCos(qreal v) { #ifdef QT_USE_MATH_H_FLOATS if (sizeof(qreal) == sizeof(float)) - return cosf(v); + return cosf(float(v)); else #endif return cos(v); @@ -96,7 +96,7 @@ inline qreal qAcos(qreal v) { #ifdef QT_USE_MATH_H_FLOATS if (sizeof(qreal) == sizeof(float)) - return acosf(v); + return acosf(float(v)); else #endif return acos(v); @@ -106,7 +106,7 @@ inline qreal qSqrt(qreal v) { #ifdef QT_USE_MATH_H_FLOATS if (sizeof(qreal) == sizeof(float)) - return sqrtf(v); + return sqrtf(float(v)); else #endif return sqrt(v); @@ -116,7 +116,7 @@ inline qreal qLn(qreal v) { #ifdef QT_USE_MATH_H_FLOATS if (sizeof(qreal) == sizeof(float)) - return logf(v); + return logf(float(v)); else #endif return log(v); @@ -126,7 +126,7 @@ inline qreal qPow(qreal x, qreal y) { #ifdef QT_USE_MATH_H_FLOATS if (sizeof(qreal) == sizeof(float)) - return powf(x, y); + return powf(float(x), float(y)); else #endif return pow(x, y); |