From 1dac47c1418b44cf4a56b42bfca2b277795fd213 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 11 Sep 2018 11:07:32 +0200 Subject: Cleanups in Value/Primitive Get rid of Primitive and move the corresponding methods directly into Value. Mark many methods in Value as constexpr and turn Value into a POD type again. Keep Primitive as a pure alias to Value for source compatibility of other modules that might be using it. Change-Id: Icb47458947dd3482c8852e95782123ea4346f5ec Reviewed-by: Simon Hausmann --- src/qml/jsapi/qjsengine.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/qml/jsapi/qjsengine.cpp') diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp index f96414ea3f..4aa7c4b45d 100644 --- a/src/qml/jsapi/qjsengine.cpp +++ b/src/qml/jsapi/qjsengine.cpp @@ -726,16 +726,16 @@ bool QJSEngine::convertV2(const QJSValue &value, int type, void *ptr) double d = QV4::RuntimeHelpers::stringToNumber(string); switch (type) { case QMetaType::Int: - *reinterpret_cast(ptr) = QV4::Primitive::toInt32(d); + *reinterpret_cast(ptr) = QV4::Value::toInt32(d); return true; case QMetaType::UInt: - *reinterpret_cast(ptr) = QV4::Primitive::toUInt32(d); + *reinterpret_cast(ptr) = QV4::Value::toUInt32(d); return true; case QMetaType::LongLong: - *reinterpret_cast(ptr) = QV4::Primitive::toInteger(d); + *reinterpret_cast(ptr) = QV4::Value::toInteger(d); return true; case QMetaType::ULongLong: - *reinterpret_cast(ptr) = QV4::Primitive::toInteger(d); + *reinterpret_cast(ptr) = QV4::Value::toInteger(d); return true; case QMetaType::Double: *reinterpret_cast(ptr) = d; @@ -744,19 +744,19 @@ bool QJSEngine::convertV2(const QJSValue &value, int type, void *ptr) *reinterpret_cast(ptr) = d; return true; case QMetaType::Short: - *reinterpret_cast(ptr) = QV4::Primitive::toInt32(d); + *reinterpret_cast(ptr) = QV4::Value::toInt32(d); return true; case QMetaType::UShort: - *reinterpret_cast(ptr) = QV4::Primitive::toUInt32(d); + *reinterpret_cast(ptr) = QV4::Value::toUInt32(d); return true; case QMetaType::Char: - *reinterpret_cast(ptr) = QV4::Primitive::toInt32(d); + *reinterpret_cast(ptr) = QV4::Value::toInt32(d); return true; case QMetaType::UChar: - *reinterpret_cast(ptr) = QV4::Primitive::toUInt32(d); + *reinterpret_cast(ptr) = QV4::Value::toUInt32(d); return true; case QMetaType::QChar: - *reinterpret_cast(ptr) = QV4::Primitive::toUInt32(d); + *reinterpret_cast(ptr) = QV4::Value::toUInt32(d); return true; default: return false; -- cgit v1.2.3