From 444e2fd4cedc7b67542b04b889b07e732a03cb63 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Date: Tue, 7 Sep 2010 14:34:38 +0200
Subject: [PATCH] Quieten gcc compiler warnings.

---
 share/qtcreator/qmljsdebugger/jsdebuggeragent.cpp          | 2 ++
 src/plugins/debugger/debuggerengine.cpp                    | 6 +++---
 src/plugins/help/openpagesswitcher.cpp                     | 6 +++---
 src/plugins/projectexplorer/outputparser_test.cpp          | 2 +-
 src/plugins/qmljseditor/qmloutlinemodel.cpp                | 2 +-
 src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp | 3 ++-
 src/plugins/texteditor/linenumberfilter.cpp                | 2 +-
 7 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/share/qtcreator/qmljsdebugger/jsdebuggeragent.cpp b/share/qtcreator/qmljsdebugger/jsdebuggeragent.cpp
index a10c747b830..1ace46e2cd1 100644
--- a/share/qtcreator/qmljsdebugger/jsdebuggeragent.cpp
+++ b/share/qtcreator/qmljsdebugger/jsdebuggeragent.cpp
@@ -302,6 +302,8 @@ void JSDebuggerAgent::exceptionThrow(qint64 scriptId,
                                    bool hasHandler)
 {
     Q_UNUSED(scriptId);
+    Q_UNUSED(exception);
+    Q_UNUSED(hasHandler);
 //    qDebug() << Q_FUNC_INFO << exception.toString() << hasHandler;
 #if 0 //sometimes, we get exceptions that we should just ignore.
     if (!hasHandler && state != Stopped)
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp
index 05302371620..3d0c93632c5 100644
--- a/src/plugins/debugger/debuggerengine.cpp
+++ b/src/plugins/debugger/debuggerengine.cpp
@@ -105,10 +105,10 @@ using namespace TextEditor;
 //
 ///////////////////////////////////////////////////////////////////////
 
-DebuggerStartParameters::DebuggerStartParameters()
-  : attachPID(-1),
-    useTerminal(false),
+DebuggerStartParameters::DebuggerStartParameters() :
     isSnapshot(false),
+    attachPID(-1),
+    useTerminal(false),
     breakAtMain(false),
     qmlServerAddress("127.0.0.1"),
     qmlServerPort(0),
diff --git a/src/plugins/help/openpagesswitcher.cpp b/src/plugins/help/openpagesswitcher.cpp
index 9c5705c5f5b..f503939c9d7 100644
--- a/src/plugins/help/openpagesswitcher.cpp
+++ b/src/plugins/help/openpagesswitcher.cpp
@@ -124,10 +124,10 @@ bool OpenPagesSwitcher::eventFilter(QObject *object, QEvent *event)
                 emit setCurrentPage(m_openPagesWidget->currentIndex());
                 return true;
             }
-
-            Qt::KeyboardModifier modifier = Qt::ControlModifier;
 #ifdef Q_WS_MAC
-            modifier = Qt::AltModifier;
+            const Qt::KeyboardModifier modifier = Qt::AltModifier;
+#else
+            const Qt::KeyboardModifier modifier = Qt::ControlModifier;
 #endif
             if (key == Qt::Key_Backtab
                 && (ke->modifiers() == (modifier | Qt::ShiftModifier)))
diff --git a/src/plugins/projectexplorer/outputparser_test.cpp b/src/plugins/projectexplorer/outputparser_test.cpp
index ab3b714ec82..bd832378892 100644
--- a/src/plugins/projectexplorer/outputparser_test.cpp
+++ b/src/plugins/projectexplorer/outputparser_test.cpp
@@ -66,7 +66,7 @@ void OutputParserTester::testParsing(const QString &lines,
     }
      // first disconnect ourselves from the end of the parser chain again
     IOutputParser * parser = this;
-    while (parser = parser->childParser()) {
+    while ( (parser = parser->childParser()) ) {
         if (parser->childParser() == this) {
             childParser()->takeOutputParserChain();
             break;
diff --git a/src/plugins/qmljseditor/qmloutlinemodel.cpp b/src/plugins/qmljseditor/qmloutlinemodel.cpp
index cabad859f66..f6662b9f750 100644
--- a/src/plugins/qmljseditor/qmloutlinemodel.cpp
+++ b/src/plugins/qmljseditor/qmloutlinemodel.cpp
@@ -727,7 +727,7 @@ void QmlOutlineModel::moveObjectMember(AST::UiObjectMember *toMove,
         } else {
             *addedRange = rewriter.addObject(arrayBinding, strToMove);
         }
-    } else if (AST::UiObjectBinding *objectBinding = AST::cast<AST::UiObjectBinding*>(newParent)) {
+    } else if (AST::cast<AST::UiObjectBinding*>(newParent)) {
         qDebug() << "TODO: Reparent to UiObjectBinding";
         return;
         // target is a property
diff --git a/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp b/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp
index 84e1375f4c3..7b43c14c208 100644
--- a/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp
+++ b/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp
@@ -634,7 +634,8 @@ static QList<GeneratedFileInfo> updateableFiles(const QString &mainProFile)
         {GeneratedFileInfo::AppViewerCppFile, appViewerHFileName}
     };
     const QFileInfo mainProFileInfo(mainProFile);
-    for (int i = 0; i < sizeof files / sizeof files[0]; ++i) {
+    const int size = sizeof(files) / sizeof(files[0]);
+    for (int i = 0; i < size; ++i) {
         const QString fileName = mainProFileInfo.dir().absolutePath()
                 + QLatin1Char('/') + appViewerOriginsSubDir + files[i].fileName;
         if (!QFile::exists(fileName))
diff --git a/src/plugins/texteditor/linenumberfilter.cpp b/src/plugins/texteditor/linenumberfilter.cpp
index 6cbd99713a0..710b5cebec5 100644
--- a/src/plugins/texteditor/linenumberfilter.cpp
+++ b/src/plugins/texteditor/linenumberfilter.cpp
@@ -48,7 +48,7 @@ LineNumberFilter::LineNumberFilter(QObject *parent)
     setIncludedByDefault(true);
 }
 
-QList<FilterEntry> LineNumberFilter::matchesFor(QFutureInterface<Locator::FilterEntry> &future, const QString &entry)
+QList<FilterEntry> LineNumberFilter::matchesFor(QFutureInterface<Locator::FilterEntry> &, const QString &entry)
 {
     bool ok;
     QList<FilterEntry> value;
-- 
GitLab