Stabilize Code
authorAlan Alpert <aalpert@blackberry.com>
Mon, 1 Apr 2013 18:14:48 +0000 (11:14 -0700)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 2 Apr 2013 18:07:20 +0000 (20:07 +0200)
Apparently it is no longer necessary to rely on undefined compiler
behavior.

Change-Id: I8e93dc0de663713c714d7894f4c66acb0aec30b4
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
src/qml/qml/qqmlcompiler.cpp
src/qml/qml/qqmlpropertycache.cpp
src/qml/qml/v8/qv8engine.cpp

index a5f1cc5..6951c8c 100644 (file)
@@ -2527,7 +2527,7 @@ bool QQmlCompiler::buildPropertyLiteralAssignment(QQmlScript::Property *prop,
 struct StaticQtMetaObject : public QObject
 {
     static const QMetaObject *get()
-        { return &static_cast<StaticQtMetaObject*> (0)->staticQtMetaObject; }
+        { return &staticQtMetaObject; }
 };
 
 bool QQmlCompiler::testQualifiedEnumAssignment(QQmlScript::Property *prop,
index e1aa310..b1ffc9a 100644 (file)
@@ -1055,7 +1055,7 @@ QStringList QQmlPropertyCache::propertyNames() const
 struct StaticQtMetaObject : public QObject
 {
     static const QMetaObject *get()
-        { return &static_cast<StaticQtMetaObject*> (0)->staticQtMetaObject; }
+        { return &staticQtMetaObject; }
 };
 
 static int EnumType(const QMetaObject *metaobj, const QByteArray &str, int type)
index 2f14b62..e80da46 100644 (file)
@@ -563,7 +563,7 @@ QVariant QV8Engine::toBasicVariant(v8::Handle<v8::Value> value)
 struct StaticQtMetaObject : public QObject
 {
     static const QMetaObject *get()
-        { return &static_cast<StaticQtMetaObject*> (0)->staticQtMetaObject; }
+        { return &staticQtMetaObject; }
 };
 
 void QV8Engine::initializeGlobal(v8::Handle<v8::Object> global)