diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-09 13:38:10 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-11 13:02:23 +0200 |
commit | 262d7261033df7650938c38401112a4767d926ff (patch) | |
tree | 8a9ecd61f546d40afa796e5ec3e786301fba1258 /src/qml/jsruntime/qv4value_p.h | |
parent | 6324e987e23b4fefc622f1fc6493baa1a3e47ee9 (diff) |
Continue conversion to using scoped values
This converts all methods in qv4runtime_p.h to not
use raw values in arguments anymore.
The conversion of return values will be done in a separate
commit.
Change-Id: Ie6e8f3bed459d09cb831f7f87920b7eada161502
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 5fbd4ac2d7..8d6f26ea57 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -59,8 +59,6 @@ QT_BEGIN_NAMESPACE namespace QV4 { -double __qmljs_to_number(const QV4::Value &value); -Q_QML_EXPORT QV4::String *__qmljs_convert_to_string(QV4::ExecutionContext *ctx, const QV4::Value &value); QV4::Object *__qmljs_convert_to_object(QV4::ExecutionContext *ctx, const QV4::Value &value); inline Managed *Value::asManaged() const @@ -193,48 +191,6 @@ inline bool Value::toBoolean() const } } -inline Object *Value::toObject(ExecutionContext *ctx) const -{ - if (isObject()) - return objectValue(); - return __qmljs_convert_to_object(ctx, *this); -} - -inline int Value::toInt32() const -{ - if (isConvertibleToInt()) - return int_32; - double d; - if (isDouble()) - d = dbl; - else - d = __qmljs_to_number(*this); - - const double D32 = 4294967296.0; - const double D31 = D32 / 2.0; - - if ((d >= -D31 && d < D31)) - return static_cast<int>(d); - - return Value::toInt32(d); -} - -inline unsigned int Value::toUInt32() const -{ - if (isConvertibleToInt()) - return (unsigned) int_32; - double d; - if (isDouble()) - d = dbl; - else - d = __qmljs_to_number(*this); - - const double D32 = 4294967296.0; - if (d >= 0 && d < D32) - return static_cast<uint>(d); - return toUInt32(d); -} - inline uint Value::asArrayIndex() const { if (isInteger() && int_32 >= 0) @@ -380,6 +336,7 @@ public: } private: + friend struct ValueRef; PersistentValuePrivate *d; }; @@ -414,6 +371,7 @@ public: void markOnce(); private: + friend struct ValueRef; PersistentValuePrivate *d; }; |