QtDeclarative: Fix warnings about uninitialized variables.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Mon, 21 May 2012 11:41:43 +0000 (13:41 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 21 May 2012 13:54:40 +0000 (15:54 +0200)
Change-Id: Ie918f1e813b243b250cedfc2e94e9c66288d08e3
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
src/qml/qml/qqmlcompiler.cpp
src/quick/items/qquickanimatedsprite.cpp
src/quick/items/qquickshadereffect.cpp
src/quick/scenegraph/coreapi/qsgrenderer.cpp

index 54035fc..47a5672 100644 (file)
@@ -2540,7 +2540,7 @@ bool QQmlCompiler::testQualifiedEnumAssignment(QQmlScript::Property *prop,
         return true;
 
     QString enumValue = parts.at(1);
-    int value;
+    int value = 0;
     bool ok;
 
     if (toQmlType(obj) == type) {
index 52b9f1c..8d89c22 100644 (file)
@@ -594,7 +594,7 @@ void QQuickAnimatedSprite::prepareNextFrame()
     qreal time =  timeInt / 1000.;
 
     double frameAt; //double just for modf
-    qreal progress;
+    qreal progress = 0.0;
     if (!m_paused) {
         //Advance State (keeps time for psuedostates)
         m_spriteEngine->updateSprites(timeInt);
index 4842d97..952ecef 100644 (file)
@@ -297,9 +297,12 @@ void QQuickShaderEffectCommon::updateParseLog(bool ignoreAttributes)
 void QQuickShaderEffectCommon::lookThroughShaderCode(QQuickItem *item, Key::ShaderType shaderType, const QByteArray &code)
 {
     int index = 0;
-    int typeIndex, typeLength, nameIndex, nameLength;
+    int typeIndex = -1;
+    int typeLength = 0;
+    int nameIndex = -1;
+    int nameLength = 0;
     const char *s = code.constData();
-    VariableQualifier decl;
+    VariableQualifier decl = AttributeQualifier;
     while ((index = qt_search_for_variable(s, code.size(), index, decl, typeIndex, typeLength,
                                            nameIndex, nameLength)) != -1)
     {
index 76200b9..92b99b8 100644 (file)
@@ -240,8 +240,8 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
 #ifdef QSG_RENDERER_TIMING
     if (qsg_render_timing)
         frameTimer.start();
-    int bindTime;
-    int renderTime;
+    int bindTime = 0;
+    int renderTime = 0;
 #endif
 
     m_bindable = &bindable;