diff options
author | Friedemann Kleint <[email protected]> | 2013-10-04 10:28:23 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-10-05 21:00:34 +0200 |
commit | d108aeacac4835758e3e5f605b4845958ac82825 (patch) | |
tree | faa730d89a85d88d9424fda213ce5363b175671d /src/qml/jsruntime | |
parent | 717c65e199ed456e5d637d9802422fdefdedeb28 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4value_def_p.h | 76 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 40 |
2 files changed, 58 insertions, 58 deletions
diff --git a/src/qml/jsruntime/qv4value_def_p.h b/src/qml/jsruntime/qv4value_def_p.h index c0b59f6711..24d62cf54f 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<T> 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 <typename T> struct Safe : public SafeValue { diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 507c0f9575..73450981a3 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; |