From 8db8877c25bab3968538bcbb8704edf053a3ea7c Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 18 Oct 2020 20:36:21 +0200 Subject: [PATCH] Clang 12 compile error fixes (#9118) * Clang 12: Fix Autopilotplugin compile warning * Clang 12: Fix Vehicle CompInfo compile errors --- src/AutoPilotPlugins/AutoPilotPlugin.cc | 2 +- src/Terrain/TerrainQuery.cc | 2 +- src/Vehicle/CompInfoParam.cc | 2 +- src/Vehicle/CompInfoVersion.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AutoPilotPlugins/AutoPilotPlugin.cc b/src/AutoPilotPlugins/AutoPilotPlugin.cc index 6c1d860f7..ea98a2efb 100644 --- a/src/AutoPilotPlugins/AutoPilotPlugin.cc +++ b/src/AutoPilotPlugins/AutoPilotPlugin.cc @@ -61,7 +61,7 @@ void AutoPilotPlugin::parametersReadyPreChecks(void) _recalcSetupComplete(); // Connect signals in order to keep setupComplete up to date - for(const QVariant componentVariant: vehicleComponents()) { + for(QVariant componentVariant: vehicleComponents()) { VehicleComponent* component = qobject_cast(qvariant_cast(componentVariant)); if (component) { connect(component, &VehicleComponent::setupCompleteChanged, this, &AutoPilotPlugin::_recalcSetupComplete); diff --git a/src/Terrain/TerrainQuery.cc b/src/Terrain/TerrainQuery.cc index a065e8173..ae3f72c1e 100644 --- a/src/Terrain/TerrainQuery.cc +++ b/src/Terrain/TerrainQuery.cc @@ -241,7 +241,7 @@ void TerrainAirMapQuery::_parsePathData(const QJsonValue& pathJson) double lonStep = stepArray[1].toDouble(); QList heights; - for (const QJsonValue& profileValue: profileArray) { + for (QJsonValue profileValue: profileArray) { heights.append(profileValue.toDouble()); } diff --git a/src/Vehicle/CompInfoParam.cc b/src/Vehicle/CompInfoParam.cc index 53a09cbf7..e8d1c18f8 100644 --- a/src/Vehicle/CompInfoParam.cc +++ b/src/Vehicle/CompInfoParam.cc @@ -67,7 +67,7 @@ void CompInfoParam::setJson(const QString& metadataJsonFileName, const QString& } QJsonArray rgParameters = jsonObj[_jsonParametersKey].toArray(); - for (const QJsonValue& parameterValue: rgParameters) { + for (QJsonValue parameterValue: rgParameters) { QMap emptyDefineMap; if (!parameterValue.isObject()) { diff --git a/src/Vehicle/CompInfoVersion.cc b/src/Vehicle/CompInfoVersion.cc index d728fd997..f71243e41 100644 --- a/src/Vehicle/CompInfoVersion.cc +++ b/src/Vehicle/CompInfoVersion.cc @@ -59,7 +59,7 @@ void CompInfoVersion::setJson(const QString& metadataJsonFileName, const QString } QJsonArray rgSupportedTypes = jsonObj[_jsonSupportedCompMetadataTypesKey].toArray(); - for (const QJsonValue& typeValue: rgSupportedTypes) { + for (QJsonValue typeValue: rgSupportedTypes) { _supportedTypes.append(static_cast(typeValue.toInt())); } } -- 2.22.0