From: Friedemann Kleint Date: Mon, 21 May 2012 11:41:43 +0000 (+0200) Subject: QtDeclarative: Fix warnings about uninitialized variables. X-Git-Tag: 071012131707~351 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16d19743823a6d8eb5cf7789e0e1420c09faab63;p=profile%2Fivi%2Fqtdeclarative.git QtDeclarative: Fix warnings about uninitialized variables. Change-Id: Ie918f1e813b243b250cedfc2e94e9c66288d08e3 Reviewed-by: Roberto Raggi --- diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index 54035fc..47a5672 100644 --- a/src/qml/qml/qqmlcompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -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) { diff --git a/src/quick/items/qquickanimatedsprite.cpp b/src/quick/items/qquickanimatedsprite.cpp index 52b9f1c..8d89c22 100644 --- a/src/quick/items/qquickanimatedsprite.cpp +++ b/src/quick/items/qquickanimatedsprite.cpp @@ -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); diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp index 4842d97..952ecef 100644 --- a/src/quick/items/qquickshadereffect.cpp +++ b/src/quick/items/qquickshadereffect.cpp @@ -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) { diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp index 76200b9..92b99b8 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp @@ -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;