aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2019-01-16 14:47:24 +0100
committerAlessandro Portale <alessandro.portale@qt.io>2019-01-16 20:22:56 +0000
commit128a33548badc3cdc1b5658e31115d4a4db95135 (patch)
treed1a97b11e0aeb3a740816cb4f97c2a2428325ab4
parent7f641d3c08b91675b6475c8dee968b072bc3a881 (diff)
Fix warning: "Missing reference in range-for with non trivial type"
[-Wclazy-range-loop] Change-Id: I5dcb263c754d423740e7bce3dcb948d52f2dec67 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
-rw-r--r--src/libs/languageserverprotocol/languagefeatures.cpp2
-rw-r--r--src/plugins/android/androidsdkmanager.cpp2
-rw-r--r--src/plugins/coreplugin/find/highlightscrollbarcontroller.cpp2
-rw-r--r--src/plugins/debugger/breakpoint.cpp2
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp2
-rw-r--r--src/plugins/debugger/debuggerruncontrol.cpp3
-rw-r--r--src/plugins/debugger/watchhandler.cpp2
-rw-r--r--src/plugins/git/gerrit/gerritremotechooser.cpp2
-rw-r--r--src/plugins/git/gitgrep.cpp2
-rw-r--r--src/plugins/languageclient/languageclientmanager.cpp2
-rw-r--r--src/plugins/perfprofiler/perftimelinemodelmanager.cpp2
-rw-r--r--src/plugins/projectexplorer/customtoolchain.cpp2
-rw-r--r--src/plugins/projectexplorer/msvctoolchain.cpp4
-rw-r--r--src/plugins/projectexplorer/windebuginterface.cpp2
14 files changed, 16 insertions, 15 deletions
diff --git a/src/libs/languageserverprotocol/languagefeatures.cpp b/src/libs/languageserverprotocol/languagefeatures.cpp
index bcff1385c0..154138cabc 100644
--- a/src/libs/languageserverprotocol/languagefeatures.cpp
+++ b/src/libs/languageserverprotocol/languagefeatures.cpp
@@ -281,7 +281,7 @@ template<typename Symbol>
QList<Symbol> documentSymbolsResultArray(const QJsonArray &array)
{
QList<Symbol> ret;
- for (auto arrayValue : array) {
+ for (const auto &arrayValue : array) {
if (arrayValue.isObject())
ret << Symbol(arrayValue.toObject());
}
diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp
index f911e908c6..85b72e2a27 100644
--- a/src/plugins/android/androidsdkmanager.cpp
+++ b/src/plugins/android/androidsdkmanager.cpp
@@ -609,7 +609,7 @@ bool SdkManagerOutputParser::parseAbstractData(SdkManagerOutputParser::GenericPa
extraKeys << installLocationKey << revisionKey << descriptionKey;
foreach (QString line, input) {
QString value;
- for (auto key: extraKeys) {
+ for (const auto &key: qAsConst(extraKeys)) {
if (valueForKey(key, line, &value)) {
if (key == installLocationKey)
output.installedLocation = Utils::FileName::fromString(value);
diff --git a/src/plugins/coreplugin/find/highlightscrollbarcontroller.cpp b/src/plugins/coreplugin/find/highlightscrollbarcontroller.cpp
index c760460fac..2ea32798de 100644
--- a/src/plugins/coreplugin/find/highlightscrollbarcontroller.cpp
+++ b/src/plugins/coreplugin/find/highlightscrollbarcontroller.cpp
@@ -295,7 +295,7 @@ void HighlightScrollBarOverlay::updateCache()
m_highlightCache.clear();
const QHash<Id, QVector<Highlight>> highlightsForId = m_highlightController->highlights();
- for (QVector<Highlight> highlights : highlightsForId) {
+ for (const QVector<Highlight> &highlights : highlightsForId) {
for (const auto &highlight : highlights) {
auto &highlightMap = m_highlightCache[highlight.priority][highlight.color];
insertPosition(&highlightMap, highlight.position);
diff --git a/src/plugins/debugger/breakpoint.cpp b/src/plugins/debugger/breakpoint.cpp
index b5d8236b2f..28e7953126 100644
--- a/src/plugins/debugger/breakpoint.cpp
+++ b/src/plugins/debugger/breakpoint.cpp
@@ -156,7 +156,7 @@ bool BreakpointParameters::isQmlFileAndLineBreakpoint() const
qmlExtensionString = ".qml;.js";
const auto qmlFileExtensions = qmlExtensionString.splitRef(';', QString::SkipEmptyParts);
- for (QStringRef extension : qmlFileExtensions) {
+ for (const QStringRef &extension : qmlFileExtensions) {
if (fileName.endsWith(extension, Qt::CaseInsensitive))
return true;
}
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index ebaf1a65b7..75de739c7d 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -2776,7 +2776,7 @@ void CdbEngine::setupScripting(const DebuggerResponse &response)
}
const QString commands = stringSetting(ExtraDumperCommands);
if (!commands.isEmpty()) {
- for (auto command : commands.split('\n', QString::SkipEmptyParts))
+ for (const auto &command : commands.split('\n', QString::SkipEmptyParts))
runCommand({command, ScriptCommand});
}
}
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index 7c2bc7ec19..c08e5ea471 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -781,7 +781,8 @@ bool DebuggerRunTool::fixupParameters()
rp.symbolFile = rp.inferior.executable;
// Copy over DYLD_IMAGE_SUFFIX etc
- for (auto var : QStringList({"DYLD_IMAGE_SUFFIX", "DYLD_LIBRARY_PATH", "DYLD_FRAMEWORK_PATH"}))
+ for (const auto &var :
+ QStringList({"DYLD_IMAGE_SUFFIX", "DYLD_LIBRARY_PATH", "DYLD_FRAMEWORK_PATH"}))
if (rp.inferior.environment.hasKey(var))
rp.debugger.environment.set(var, rp.inferior.environment.value(var));
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index 3826e33a9f..b48acc8360 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -2114,7 +2114,7 @@ void WatchHandler::notifyUpdateStarted(const UpdateParameters &updateParameters)
item->forAllChildren(marker);
});
} else {
- for (auto iname : inames) {
+ for (const QString &iname : qAsConst(inames)) {
if (WatchItem *item = m_model->findItem(iname))
item->forAllChildren(marker);
}
diff --git a/src/plugins/git/gerrit/gerritremotechooser.cpp b/src/plugins/git/gerrit/gerritremotechooser.cpp
index c242b1c6ad..36082a3f26 100644
--- a/src/plugins/git/gerrit/gerritremotechooser.cpp
+++ b/src/plugins/git/gerrit/gerritremotechooser.cpp
@@ -124,7 +124,7 @@ bool GerritRemoteChooser::updateRemotes(bool forceReload)
void GerritRemoteChooser::addRemote(const GerritServer &server, const QString &name)
{
if (!m_allowDups) {
- for (auto remote : m_remotes) {
+ for (const auto &remote : qAsConst(m_remotes)) {
if (remote.second == server)
return;
}
diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp
index 41f35ea4a8..9d21655237 100644
--- a/src/plugins/git/gitgrep.cpp
+++ b/src/plugins/git/gitgrep.cpp
@@ -134,7 +134,7 @@ public:
}
single.matchingLine = text;
- for (auto match : qAsConst(matches)) {
+ for (const auto &match : qAsConst(matches)) {
single.matchStart = match.matchStart;
single.matchLength = match.matchLength;
single.regexpCapturedTexts = match.regexpCapturedTexts;
diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp
index 4e811d68d0..7d578eaa39 100644
--- a/src/plugins/languageclient/languageclientmanager.cpp
+++ b/src/plugins/languageclient/languageclientmanager.cpp
@@ -136,7 +136,7 @@ void LanguageClientManager::removeMarks(const Utils::FileName &fileName)
if (!doc)
return;
- for (auto marks : managerInstance->m_marks[fileName]) {
+ for (const auto &marks : qAsConst(managerInstance->m_marks[fileName])) {
for (TextEditor::TextMark *mark : marks) {
doc->removeMark(mark);
delete mark;
diff --git a/src/plugins/perfprofiler/perftimelinemodelmanager.cpp b/src/plugins/perfprofiler/perftimelinemodelmanager.cpp
index 5bbeed2508..85171e85dd 100644
--- a/src/plugins/perfprofiler/perftimelinemodelmanager.cpp
+++ b/src/plugins/perfprofiler/perftimelinemodelmanager.cpp
@@ -128,7 +128,7 @@ void PerfTimelineModelManager::clear()
{
QVariantList perfModels = models();
Timeline::TimelineModelAggregator::clear();
- for (QVariant var : perfModels)
+ for (QVariant &var : perfModels)
delete qvariant_cast<PerfTimelineModel *>(var);
qDeleteAll(m_unfinished);
m_unfinished.clear();
diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp
index fa27dbb0c6..1833875102 100644
--- a/src/plugins/projectexplorer/customtoolchain.cpp
+++ b/src/plugins/projectexplorer/customtoolchain.cpp
@@ -524,7 +524,7 @@ CustomToolChainConfigWidget::CustomToolChainConfigWidget(CustomToolChain *tc) :
Q_ASSERT(tc);
const QList<CustomToolChain::Parser> parsers = CustomToolChain::parsers();
- for (auto parser : parsers)
+ for (const auto &parser : parsers)
m_errorParserComboBox->addItem(parser.displayName, parser.parserId.toString());
auto parserLayoutWidget = new QWidget;
diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp
index 9a86738d1f..711cf30acc 100644
--- a/src/plugins/projectexplorer/msvctoolchain.cpp
+++ b/src/plugins/projectexplorer/msvctoolchain.cpp
@@ -274,7 +274,7 @@ static QVector<VisualStudioInstallation> detectVisualStudioFromVsWhere(const QSt
return installations;
}
- for (const QJsonValue vsVersion : versions) {
+ for (const QJsonValue &vsVersion : versions) {
const QJsonObject vsVersionObj = vsVersion.toObject();
if (vsVersionObj.isEmpty()) {
qWarning() << "Could not obtain object from vswhere version";
@@ -1751,7 +1751,7 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect(const QList<ToolChain *> &al
{MsvcToolChain::amd64, "x64"},
{MsvcToolChain::ia64, "ia64"},
};
- for (auto platform : platforms) {
+ for (const auto &platform : platforms) {
tmp.append(findOrCreateToolChain(alreadyKnown,
generateDisplayName(name,
MsvcToolChain::WindowsSDK,
diff --git a/src/plugins/projectexplorer/windebuginterface.cpp b/src/plugins/projectexplorer/windebuginterface.cpp
index 2f7bbcc4d8..e9fdb939a5 100644
--- a/src/plugins/projectexplorer/windebuginterface.cpp
+++ b/src/plugins/projectexplorer/windebuginterface.cpp
@@ -192,7 +192,7 @@ void WinDebugInterface::dispatchDebugOutput()
m_readySignalEmitted = false;
m_outputMutex.unlock();
- for (auto p : output)
+ for (const auto &p : qAsConst(output))
emit debugOutput(p.first, p.second);
if (hasMoreOutput)
emit _q_debugOutputReady();