summaryrefslogtreecommitdiffstats
path: root/Source/cmForEachCommand.cxx
diff options
context:
space:
mode:
authorAsit Dhal <dhal.asitk@gmail.com>2019-09-15 17:11:02 (GMT)
committerBrad King <brad.king@kitware.com>2019-09-18 18:18:46 (GMT)
commit9dba84cfa5e85e51ee6d6799f03a26656063ef8b (patch)
tree22fb29536def399e2ab763ac202a52467d45d7e2 /Source/cmForEachCommand.cxx
parent1423507a71199fd76b457ad9b215a6caca70ee58 (diff)
downloadCMake-9dba84cfa5e85e51ee6d6799f03a26656063ef8b.zip
CMake-9dba84cfa5e85e51ee6d6799f03a26656063ef8b.tar.gz
CMake-9dba84cfa5e85e51ee6d6799f03a26656063ef8b.tar.bz2
Refactor: Use cmStrCat to construct error strings
Replace string construction using std::stringstream with cmStrCat and cmWrap.
Diffstat (limited to 'Source/cmForEachCommand.cxx')
-rw-r--r--Source/cmForEachCommand.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 3c39c46..d563a1d 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -4,7 +4,6 @@
#include <cstdio>
#include <cstdlib>
-#include <sstream>
#include <utility>
#include "cm_memory.hxx"
@@ -146,10 +145,9 @@ bool cmForEachCommand(std::vector<std::string> const& args,
}
if ((start > stop && step > 0) || (start < stop && step < 0) ||
step == 0) {
- std::ostringstream str;
- str << "called with incorrect range specification: start ";
- str << start << ", stop " << stop << ", step " << step;
- status.SetError(str.str());
+ status.SetError(
+ cmStrCat("called with incorrect range specification: start ", start,
+ ", stop ", stop, ", step ", step));
return false;
}
std::vector<std::string> range;
@@ -204,10 +202,9 @@ bool HandleInMode(std::vector<std::string> const& args, cmMakefile& makefile)
cmExpandList(value, fb->Args, true);
}
} else {
- std::ostringstream e;
- e << "Unknown argument:\n"
- << " " << args[i] << "\n";
- makefile.IssueMessage(MessageType::FATAL_ERROR, e.str());
+ makefile.IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("Unknown argument:\n", " ", args[i], "\n"));
return true;
}
}