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/qscriptengine.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/qscriptengine.cpp')
-rw-r--r-- | src/script/api/qscriptengine.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index c3c8caf..3f2c9b4 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -2577,7 +2577,7 @@ QScriptValue QScriptEnginePrivate::create(int type, const void *ptr) #endif break; case QMetaType::Double: - result = QScriptValue(*reinterpret_cast<const double*>(ptr)); + result = QScriptValue(qsreal(*reinterpret_cast<const double*>(ptr))); break; case QMetaType::QString: result = QScriptValue(q_func(), *reinterpret_cast<const QString*>(ptr)); |