diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:13:08 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:13:08 +0900 |
commit | 488e9638b71b8b9cdb3055835815d77720eae06b (patch) | |
tree | f023cbc75da671dd2b75d3143cde8a066d5a93aa /Source/cmWhileCommand.cxx | |
parent | f152fd464ac355590a5bb95451d4cd1ca1079d3c (diff) | |
download | cmake-488e9638b71b8b9cdb3055835815d77720eae06b.tar.gz cmake-488e9638b71b8b9cdb3055835815d77720eae06b.tar.bz2 cmake-488e9638b71b8b9cdb3055835815d77720eae06b.zip |
Imported Upstream version 3.10.0upstream/3.10.0
Diffstat (limited to 'Source/cmWhileCommand.cxx')
-rw-r--r-- | Source/cmWhileCommand.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 24d7bf1bf..a08003450 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -7,9 +7,10 @@ #include "cmExpandedCommandArgument.h" #include "cmMakefile.h" #include "cmSystemTools.h" -#include "cm_auto_ptr.hxx" #include "cmake.h" +#include <memory> // IWYU pragma: keep + cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf) : Makefile(mf) , Depth(0) @@ -34,7 +35,8 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff, // if this is the endwhile for this while loop then execute if (!this->Depth) { // Remove the function blocker for this scope or bail. - CM_AUTO_PTR<cmFunctionBlocker> fb(mf.RemoveFunctionBlocker(this, lff)); + std::unique_ptr<cmFunctionBlocker> fb( + mf.RemoveFunctionBlocker(this, lff)); if (!fb.get()) { return false; } @@ -60,11 +62,10 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff, while (isTrue) { if (!errorString.empty()) { std::string err = "had incorrect arguments: "; - unsigned int i; - for (i = 0; i < this->Args.size(); ++i) { - err += (this->Args[i].Delim ? "\"" : ""); - err += this->Args[i].Value; - err += (this->Args[i].Delim ? "\"" : ""); + for (cmListFileArgument const& arg : this->Args) { + err += (arg.Delim ? "\"" : ""); + err += arg.Value; + err += (arg.Delim ? "\"" : ""); err += " "; } err += "("; @@ -78,9 +79,9 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff, } // Invoke all the functions that were collected in the block. - for (unsigned int c = 0; c < this->Functions.size(); ++c) { + for (cmListFileFunction const& fn : this->Functions) { cmExecutionStatus status; - mf.ExecuteCommand(this->Functions[c], status); + mf.ExecuteCommand(fn, status); if (status.GetReturnInvoked()) { inStatus.SetReturnInvoked(); return true; |