From 4a7280598b99379425043a8773dd274e5bcb24d5 Mon Sep 17 00:00:00 2001 From: David Skoland Date: Tue, 6 Oct 2020 18:11:26 +0200 Subject: Fix Clang compiler warnings (-Wrange-loop-analysis) In a macOS environment, Clang throws a number of compiler warnings about loop variables when building qtbase. See task for more info about the environment. This changes a handful of loop variables, like QJsonValue references into QJsonValueRefs. Task-number: QTBUG-87216 Pick-to: 5.15 Change-Id: I26006efd7c75c2d56ebc7f7efb4c9bdcabe92e8b Reviewed-by: Thiago Macieira --- src/gui/util/qshadernodesloader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui/util/qshadernodesloader.cpp') diff --git a/src/gui/util/qshadernodesloader.cpp b/src/gui/util/qshadernodesloader.cpp index e6dcc8799b..db1755e33a 100644 --- a/src/gui/util/qshadernodesloader.cpp +++ b/src/gui/util/qshadernodesloader.cpp @@ -121,7 +121,7 @@ void QShaderNodesLoader::load(const QJsonObject &prototypesObject) const QJsonValue inputsValue = nodeObject.value(QStringLiteral("inputs")); if (inputsValue.isArray()) { const QJsonArray inputsArray = inputsValue.toArray(); - for (const QJsonValue &inputValue : inputsArray) { + for (const QJsonValue inputValue : inputsArray) { if (!inputValue.isString()) { qWarning() << "Non-string value in inputs"; hasError = true; @@ -138,7 +138,7 @@ void QShaderNodesLoader::load(const QJsonObject &prototypesObject) const QJsonValue outputsValue = nodeObject.value(QStringLiteral("outputs")); if (outputsValue.isArray()) { const QJsonArray outputsArray = outputsValue.toArray(); - for (const QJsonValue &outputValue : outputsArray) { + for (const QJsonValue outputValue : outputsArray) { if (!outputValue.isString()) { qWarning() << "Non-string value in outputs"; hasError = true; @@ -186,7 +186,7 @@ void QShaderNodesLoader::load(const QJsonObject &prototypesObject) const QJsonValue rulesValue = nodeObject.value(QStringLiteral("rules")); if (rulesValue.isArray()) { const QJsonArray rulesArray = rulesValue.toArray(); - for (const QJsonValue &ruleValue : rulesArray) { + for (const QJsonValue ruleValue : rulesArray) { if (!ruleValue.isObject()) { qWarning() << "Rules should be objects"; hasError = true; -- cgit v1.2.3