From: Friedemann Kleint Date: Fri, 4 Oct 2013 08:28:23 +0000 (+0200) Subject: Reshuffle inlined functions to fix MinGW-warnings. X-Git-Tag: upstream/5.2.1~276 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d108aeacac4835758e3e5f605b4845958ac82825;p=platform%2Fupstream%2Fqtdeclarative.git Reshuffle inlined functions to fix MinGW-warnings. When compiling QtQuick: qv4value_p.h:80:17: warning: 'QV4::Managed* QV4::Value::asManaged() const' redeclared without dllimport attribute after being referenced with dll linkage ^ qv4value_p.h:180:14: warning: 'static QV4::Value QV4::Value::fromManaged(QV4::Managed*)' redeclared without dllimport attribute after being referenced with dll linkage ^ qv4value_p.h:285:16: warning: 'QV4::String* QV4::Value::asString() const' redeclared without dllimport attribute after being referenced with dll linkage Change-Id: I548a2f8049b8eca06ab1061f56416a332820dc01 Reviewed-by: Erik Verbruggen --- diff --git a/src/qml/jsruntime/qv4value_def_p.h b/src/qml/jsruntime/qv4value_def_p.h index c0b59f6..24d62cf 100644 --- a/src/qml/jsruntime/qv4value_def_p.h +++ b/src/qml/jsruntime/qv4value_def_p.h @@ -338,6 +338,64 @@ struct Q_QML_EXPORT Value inline void mark() const; }; +inline Managed *Value::asManaged() const +{ + if (isManaged()) + return managed(); + return 0; +} + +inline String *Value::asString() const +{ + if (isString()) + return stringValue(); + return 0; +} + +struct Q_QML_EXPORT Primitive : public Value +{ + static Primitive emptyValue(); + static Primitive fromBoolean(bool b); + static Primitive fromInt32(int i); + static Primitive undefinedValue(); + static Primitive nullValue(); + static Primitive fromDouble(double d); + static Primitive fromUInt32(uint i); + + static double toInteger(double fromNumber); + static int toInt32(double value); + static unsigned int toUInt32(double value); + + inline operator ValueRef(); + Value asValue() const { return *this; } +}; + +inline Primitive Primitive::undefinedValue() +{ + Primitive v; +#if QT_POINTER_SIZE == 8 + v.val = quint64(Undefined_Type) << Tag_Shift; +#else + v.tag = Undefined_Type; + v.int_32 = 0; +#endif + return v; +} + +inline Value Value::fromManaged(Managed *m) +{ + if (!m) + return QV4::Primitive::undefinedValue(); + Value v; +#if QT_POINTER_SIZE == 8 + v.m = m; +#else + v.tag = Managed_Type; + v.m = m; +#endif + return v; +} + struct SafeValue : public Value { SafeValue &operator =(const ScopedValue &v); @@ -366,24 +424,6 @@ struct SafeValue : public Value inline Referenced asRef(); }; -struct Q_QML_EXPORT Primitive : public Value -{ - static Primitive emptyValue(); - static Primitive fromBoolean(bool b); - static Primitive fromInt32(int i); - static Primitive undefinedValue(); - static Primitive nullValue(); - static Primitive fromDouble(double d); - static Primitive fromUInt32(uint i); - - static double toInteger(double fromNumber); - static int toInt32(double value); - static unsigned int toUInt32(double value); - - inline operator ValueRef(); - Value asValue() const { return *this; } -}; - template struct Safe : public SafeValue { diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 507c0f9..7345098 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -77,13 +77,6 @@ inline bool Value::isPrimitive() const return !isObject(); } -inline Managed *Value::asManaged() const -{ - if (isManaged()) - return managed(); - return 0; -} - inline ExecutionEngine *Value::engine() const { Managed *m = asManaged(); return m ? m->engine() : 0; @@ -97,18 +90,6 @@ inline void Value::mark() const { m->mark(); } -inline Primitive Primitive::undefinedValue() -{ - Primitive v; -#if QT_POINTER_SIZE == 8 - v.val = quint64(Undefined_Type) << Tag_Shift; -#else - v.tag = Undefined_Type; - v.int_32 = 0; -#endif - return v; -} - inline Primitive Primitive::nullValue() { Primitive v; @@ -165,20 +146,6 @@ inline Primitive Primitive::fromUInt32(uint i) return v; } -inline Value Value::fromManaged(Managed *m) -{ - if (!m) - return QV4::Primitive::undefinedValue(); - Value v; -#if QT_POINTER_SIZE == 8 - v.m = m; -#else - v.tag = Managed_Type; - v.m = m; -#endif - return v; -} - inline double Value::toNumber() const { if (integerCompatible()) @@ -270,13 +237,6 @@ inline uint Value::asArrayLength(bool *ok) const return idx; } -inline String *Value::asString() const -{ - if (isString()) - return stringValue(); - return 0; -} - inline Object *Value::asObject() const { return isObject() ? objectValue() : 0;