From c7f66ecf1c865bf291157150ce02ec639d473c30 Mon Sep 17 00:00:00 2001 From: Automatic Release Builder Date: Tue, 29 Sep 2020 22:19:20 +0100 Subject: [PATCH] Fix some warnings from Xcode 12 --- src/Airports/runwayprefs.cxx | 2 +- src/Main/fg_io.cxx | 2 +- src/Main/logger.cxx | 2 +- src/Scripting/NasalUnitTesting.cxx | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Airports/runwayprefs.cxx b/src/Airports/runwayprefs.cxx index f937ba365..80d878850 100644 --- a/src/Airports/runwayprefs.cxx +++ b/src/Airports/runwayprefs.cxx @@ -146,7 +146,7 @@ void RunwayList::set(const std::string & tp, const std::string & lst) // timeOffsetInDays = weekday - currTimeDate->getGmt()->tm_wday; // timeCopy = timeCopy.substr(2,timeCopy.length()); type = tp; - for (const auto s : strutils::split(lst, ",")) { + for (const auto& s : strutils::split(lst, ",")) { auto ident = strutils::strip(s); // http://code.google.com/p/flightgear-bugs/issues/detail?id=1137 if ((ident.size() < 2) || !isdigit(ident[1])) { diff --git a/src/Main/fg_io.cxx b/src/Main/fg_io.cxx index 2a8412b8b..d5607eebb 100644 --- a/src/Main/fg_io.cxx +++ b/src/Main/fg_io.cxx @@ -345,7 +345,7 @@ FGIO::init() // port onto the port list copies the structure and destroys the // original, which closes the port and frees up the fd ... doh!!! - for (const auto config : *(globals->get_channel_options_list())) { + for (const auto& config : *(globals->get_channel_options_list())) { FGProtocol* p = add_channel(config); if (p) { addToPropertyTree(p->get_name(), config); diff --git a/src/Main/logger.cxx b/src/Main/logger.cxx index b402c276e..f1d9d15fc 100644 --- a/src/Main/logger.cxx +++ b/src/Main/logger.cxx @@ -38,7 +38,7 @@ FGLogger::init () std::vector children = logging->getChildren("log"); _logs.reserve(children.size()); - for (const auto child: children) { + for (const auto& child: children) { if (!child->getBoolValue("enabled", false)) continue; diff --git a/src/Scripting/NasalUnitTesting.cxx b/src/Scripting/NasalUnitTesting.cxx index f72a525a6..750bb095b 100644 --- a/src/Scripting/NasalUnitTesting.cxx +++ b/src/Scripting/NasalUnitTesting.cxx @@ -210,7 +210,7 @@ void executeNasalTestsInDir(const SGPath& path) { simgear::Dir d(path); - for (const auto testFile : d.children(simgear::Dir::TYPE_FILE, "*.nut")) { + for (const auto& testFile : d.children(simgear::Dir::TYPE_FILE, "*.nut")) { SG_LOG(SG_NASAL, SG_INFO, "Processing test file " << testFile); } // of test files iteration @@ -266,7 +266,7 @@ bool executeNasalTest(const SGPath& path) auto setUpFunc = localNS.get("setUp"); auto tearDown = localNS.get("tearDown"); - for (const auto& value : localNS) { + for (const auto value : localNS) { if (value.getKey().find("test_") == 0) { static_activeTest.reset(new ActiveTest);