summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/qscriptengine.cpp2
-rw-r--r--src/script/api/qscriptengine_p.h2
-rw-r--r--src/script/api/qscriptvalue.cpp6
-rw-r--r--src/script/api/qscriptvalue_p.h4
4 files changed, 7 insertions, 7 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));
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index cde116d..3766559 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -451,7 +451,7 @@ inline void QScriptValuePrivate::initFrom(JSC::JSValue value)
engine->registerScriptValue(this);
}
-inline void QScriptValuePrivate::initFrom(double value)
+inline void QScriptValuePrivate::initFrom(qsreal value)
{
type = Number;
numberValue = value;
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);
diff --git a/src/script/api/qscriptvalue_p.h b/src/script/api/qscriptvalue_p.h
index 77b5084..9634515 100644
--- a/src/script/api/qscriptvalue_p.h
+++ b/src/script/api/qscriptvalue_p.h
@@ -81,7 +81,7 @@ public:
inline ~QScriptValuePrivate();
inline void initFrom(JSC::JSValue value);
- inline void initFrom(double value);
+ inline void initFrom(qsreal value);
inline void initFrom(const QString &value);
inline bool isJSC() const;
@@ -124,7 +124,7 @@ public:
QScriptEnginePrivate *engine;
Type type;
JSC::JSValue jscValue;
- double numberValue;
+ qsreal numberValue;
QString stringValue;
// linked list of engine's script values