summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2020-03-24 04:19:36 (GMT)
committerAlex Turbov <i.zaufi@gmail.com>2020-03-24 13:33:33 (GMT)
commit8e3a65d96340f523e6ca8ac86b9360a94fe08fb9 (patch)
tree6d2af5dfd3b3512cf35d441751e6e396ef10f551 /Source/cmcmd.cxx
parent7099db5dd48d36e5d39ab17219278d834c8a88a7 (diff)
downloadCMake-8e3a65d96340f523e6ca8ac86b9360a94fe08fb9.zip
CMake-8e3a65d96340f523e6ca8ac86b9360a94fe08fb9.tar.gz
CMake-8e3a65d96340f523e6ca8ac86b9360a94fe08fb9.tar.bz2
Refactor: Avoid `std::endl` where it's not necessary (part 3)
The `std::endl` manipulator, except inserting `\n` character, also performs `os.flush()`, which may lead to undesired effects (like disk I/O in the middle of forming data strings). For the `std::stringstream` it also has no meaning. * replace multiple `operator<<` calls on a string literal w/ the only call and the only (bigger) string literal; * replace one character string literal used in `operator<<` w/ a char literal.
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 7eeb97f..ad2b13b 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -678,7 +678,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
} else if (!a.empty() && a[0] == '-') {
// Environment variable and command names cannot start in '-',
// so this must be an unknown option.
- std::cerr << "cmake -E env: unknown option '" << a << "'"
+ std::cerr << "cmake -E env: unknown option '" << a << '\''
<< std::endl;
return 1;
} else if (a.find('=') != std::string::npos) {
@@ -1654,11 +1654,13 @@ int cmcmd::WindowsCEEnvironment(const char* version, const std::string& name)
cmVisualStudioWCEPlatformParser parser(name.c_str());
parser.ParseVersion(version);
if (parser.Found()) {
- std::cout << "@echo off" << std::endl;
- std::cout << "echo Environment Selection: " << name << std::endl;
- std::cout << "set PATH=" << parser.GetPathDirectories() << std::endl;
- std::cout << "set INCLUDE=" << parser.GetIncludeDirectories() << std::endl;
- std::cout << "set LIB=" << parser.GetLibraryDirectories() << std::endl;
+ /* clang-format off */
+ std::cout << "@echo off\n"
+ "echo Environment Selection: " << name << "\n"
+ "set PATH=" << parser.GetPathDirectories() << "\n"
+ "set INCLUDE=" << parser.GetIncludeDirectories() << "\n"
+ "set LIB=" << parser.GetLibraryDirectories() << std::endl;
+ /* clang-format on */
return 0;
}
#else