Fix other warnings in qtdeclarative found by GCC 4.7
authorThiago Macieira <thiago.macieira@intel.com>
Sat, 22 Dec 2012 06:54:02 +0000 (22:54 -0800)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sun, 23 Dec 2012 00:36:45 +0000 (01:36 +0100)
qml/qml/qqmlimport.cpp:982:30: error: unused parameter 'errors' [-Werror=unused-parameter]
quick/util/qquickanimationcontroller.cpp:66:6: error: unused parameter 'job' [-Werror=unused-parameter]'
quick/items/qquickshadereffectnode.cpp:160:17: error: case value '38' not in enumerated type 'QVariant::Type' [-Werror=switch]
quick/items/qquickwindowmanager.cpp:286:60: error: 'renderTime' may be used uninitialized in this function [-Werror=maybe-uninitialized]
quick/items/qquickitem.cpp:5267:67: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]

and a few more repeated from the above

Change-Id: Id1950c6ba98f7f8475975716b21bd795ecb4bd20
Reviewed-by: Alan Alpert <aalpert@rim.com>
src/plugins/qmltooling/shared/qpacketprotocol.cpp
src/qml/qml/qqmlimport.cpp
src/quick/items/qquickitem.cpp
src/quick/items/qquickshadereffectnode.cpp
src/quick/items/qquickshadereffectsource.cpp
src/quick/items/qquickwindowmanager.cpp
src/quick/util/qquickanimationcontroller.cpp

index 205601c..020e5db 100644 (file)
@@ -290,6 +290,7 @@ void QPacketProtocol::send(const QPacket & p)
     d->sendingPackets.append(sendSize);
     qint32 sendSize32 = sendSize;
     qint64 writeBytes = d->dev->write((char *)&sendSize32, sizeof(qint32));
+    Q_UNUSED(writeBytes);
     Q_ASSERT(writeBytes == sizeof(qint32));
     writeBytes = d->dev->write(p.b);
     Q_ASSERT(writeBytes == p.b.size());
index 7a2f4ea..adce26b 100644 (file)
@@ -986,6 +986,7 @@ QQmlImportNamespace::Import *QQmlImportsPrivate::addImportToNamespace(QQmlImport
 {
     Q_ASSERT(nameSpace);
     Q_ASSERT(errors);
+    Q_UNUSED(errors);
     Q_ASSERT(url.isEmpty() || url.endsWith(Slash));
 
     QQmlImportNamespace::Import *import = new QQmlImportNamespace::Import;
index afe91e0..6668cb7 100644 (file)
@@ -5272,7 +5272,7 @@ void QQuickItem::setFlags(Flags flags)
 {
     Q_D(QQuickItem);
 
-    if ((flags & ItemIsFocusScope) != (d->flags & ItemIsFocusScope)) {
+    if (int(flags & ItemIsFocusScope) != int(d->flags & ItemIsFocusScope)) {
         if (flags & ItemIsFocusScope && !d->childItems.isEmpty() && d->window) {
             qWarning("QQuickItem: Cannot set FocusScope once item has children and is in a window.");
             flags &= ~ItemIsFocusScope;
@@ -5282,7 +5282,7 @@ void QQuickItem::setFlags(Flags flags)
         }
     }
 
-    if ((flags & ItemClipsChildrenToShape) != (d->flags & ItemClipsChildrenToShape))
+    if (int(flags & ItemClipsChildrenToShape) != int(d->flags & ItemClipsChildrenToShape))
         d->dirty(QQuickItemPrivate::Clip);
 
     d->flags = flags;
index 622000e..15989db 100644 (file)
@@ -153,7 +153,7 @@ void QQuickCustomMaterialShader::updateState(const RenderState &state, QSGMateri
                 if (state.isMatrixDirty())
                     program()->setUniformValue(loc, state.combinedMatrix());
             } else if (d.specialType == UniformData::None) {
-                switch (d.value.type()) {
+                switch (int(d.value.type())) {
                 case QMetaType::QColor:
                     program()->setUniformValue(loc, qt_premultiply_color(qvariant_cast<QColor>(d.value)));
                     break;
index 2b613df..0c4e263 100644 (file)
@@ -695,6 +695,7 @@ void QQuickShaderEffectSource::setSourceItem(QQuickItem *item)
 void QQuickShaderEffectSource::sourceItemDestroyed(QObject *item)
 {
     Q_ASSERT(item == m_sourceItem);
+    Q_UNUSED(item);
     m_sourceItem = 0;
     update();
     emit sourceItemChanged();
index 5da904a..1249468 100644 (file)
@@ -253,7 +253,7 @@ void QQuickTrivialWindowManager::renderWindow(QQuickWindow *window)
     QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window);
     cd->polishItems();
 
-    int renderTime, syncTime;
+    int renderTime = 0, syncTime = 0;
     QTime renderTimer;
     if (qquick_render_timing())
         renderTimer.start();
index e4a82ca..71efda5 100644 (file)
@@ -67,6 +67,7 @@ void QQuickAnimationControllerPrivate::animationFinished(QAbstractAnimationJob *
 {
     Q_Q(QQuickAnimationController);
     Q_ASSERT(animationInstance && animationInstance == job);
+    Q_UNUSED(job);
 
     animationInstance->removeAnimationChangeListener(this, QAbstractAnimationJob::Completion | QAbstractAnimationJob::CurrentTime);
 
@@ -84,6 +85,7 @@ void QQuickAnimationControllerPrivate::animationCurrentTimeChanged(QAbstractAnim
 {
     Q_Q(QQuickAnimationController);
     Q_ASSERT(animationInstance && animationInstance == job);
+    Q_UNUSED(job);
     const qreal newProgress = currentTime * 1.0 / animationInstance->duration();
     if (progress != newProgress) {
         progress = newProgress;