diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-10-22 12:27:33 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-10-22 12:44:08 (GMT) |
commit | dbff78d964d1a034459074f168b505b41bab0c98 (patch) | |
tree | 93ceb643948e36cdc1a0933a3043faea05b44469 /src/script/api/qscriptvalue.cpp | |
parent | f51e6e91c92810deff7029c8d1edf9b11f03a908 (diff) | |
download | Qt-dbff78d964d1a034459074f168b505b41bab0c98.zip Qt-dbff78d964d1a034459074f168b505b41bab0c98.tar.gz Qt-dbff78d964d1a034459074f168b505b41bab0c98.tar.bz2 |
Use the qsreal type instead of double when working with QtScript numbers
The idea is that qsreal can be typedef'ed to float on platforms where it's
appropriate. Since the QScriptValue ctor takes a qsreal, we should not
convert it to a double internally.
Reviewed-by: Olivier Goffart
Diffstat (limited to 'src/script/api/qscriptvalue.cpp')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index b8340a7..26cd314 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -213,7 +213,7 @@ qint32 ToInt32(qsreal n) if (qIsNaN(n) || qIsInf(n) || (n == 0)) return 0; - double sign = (n < 0) ? -1.0 : 1.0; + qsreal sign = (n < 0) ? -1.0 : 1.0; qsreal abs_n = fabs(n); n = ::fmod(sign * ::floor(abs_n), D32); @@ -233,7 +233,7 @@ quint32 ToUint32(qsreal n) if (qIsNaN(n) || qIsInf(n) || (n == 0)) return 0; - double sign = (n < 0) ? -1.0 : 1.0; + qsreal sign = (n < 0) ? -1.0 : 1.0; qsreal abs_n = fabs(n); n = ::fmod(sign * ::floor(abs_n), D32); @@ -251,7 +251,7 @@ quint16 ToUint16(qsreal n) if (qIsNaN(n) || qIsInf(n) || (n == 0)) return 0; - double sign = (n < 0) ? -1.0 : 1.0; + qsreal sign = (n < 0) ? -1.0 : 1.0; qsreal abs_n = fabs(n); n = ::fmod(sign * ::floor(abs_n), D16); |