From aeb5e8319c14721a03c3ab797c893efeb29bb162 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 7 Jun 2013 22:43:14 +0200 Subject: [PATCH] Fix two qqmlecmascript tests (assignSequenceTypes one of them) In various places in the engine we do QVariant(v4Value.booleanValue()), which unfortunately constructs a QVariant from an unsigned int. IIRC we used Bool(uint) as type in the run-time to ensure that the compiler allocates an entire general purpose register for JIT calls on all platforms, so those functions remain untouched. But I think it's safe to at least change the getters in Value, as those are never called directly from generated code. Change-Id: Ia235141b8bcfc38403a7967436c68e73e7eee669 Reviewed-by: Lars Knoll --- src/qml/qml/v4/qv4value_p.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qml/qml/v4/qv4value_p.h b/src/qml/qml/v4/qv4value_p.h index 6cb8c48..207ee22 100644 --- a/src/qml/qml/v4/qv4value_p.h +++ b/src/qml/qml/v4/qv4value_p.h @@ -159,7 +159,7 @@ struct Q_QML_EXPORT Value return false; } - Bool booleanValue() const { + bool booleanValue() const { return int_32; } double doubleValue() const { @@ -226,7 +226,7 @@ struct Q_QML_EXPORT Value int toInt32() const; unsigned int toUInt32() const; - Bool toBoolean() const; + bool toBoolean() const; double toInteger() const; double toNumber() const; QString toQString() const; @@ -393,7 +393,7 @@ inline Value Value::fromObject(Object *o) return v; } -inline Bool Value::toBoolean() const +inline bool Value::toBoolean() const { switch (type()) { case Value::Undefined_Type: -- 2.7.4