summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2018-08-07 13:01:25 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2018-08-07 15:02:39 (GMT)
commitb6802cd506cd459f94fae7e4cadc8b94daa09d59 (patch)
treea74ed3696e442cdb1bb08ee4c0f09263b8d19a71 /Source/cmGlobalGenerator.cxx
parenta688defcc6e0195eefedd2cbc70ec5e40534f597 (diff)
downloadCMake-b6802cd506cd459f94fae7e4cadc8b94daa09d59.zip
CMake-b6802cd506cd459f94fae7e4cadc8b94daa09d59.tar.gz
CMake-b6802cd506cd459f94fae7e4cadc8b94daa09d59.tar.bz2
cmGeneratedFileStream: clang-tidy applied to remove redundant ``c_str`` calls
After changing the ``cmGeneratedFileStream`` methods to accept ``std::string const&`` instead of ``const char*`` we don't need to call ``std::string::c_str`` anymore when passing a ``std::string`` to a ``cmGeneratedFileStream`` method. This patch removes all redundant ``std::string::c_str`` calls when passing a string to a ``cmGeneratedFileStream`` method. It was generated by building CMake with clang-tidy enabled using the following options: -DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy-4.0;-checks=-*,readability-redundant-string-cstr;-fix;-fix-errors
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 58821c2..324b56a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2904,7 +2904,7 @@ void cmGlobalGenerator::WriteRuleHashes(std::string const& pfile)
if (this->RuleHashes.empty()) {
cmSystemTools::RemoveFile(pfile);
} else {
- cmGeneratedFileStream fout(pfile.c_str());
+ cmGeneratedFileStream fout(pfile);
fout << "# Hashes of file build rules.\n";
for (auto const& rh : this->RuleHashes) {
fout.write(rh.second.Data, 32);
@@ -2919,7 +2919,7 @@ void cmGlobalGenerator::WriteSummary()
std::string fname = this->CMakeInstance->GetHomeOutputDirectory();
fname += cmake::GetCMakeFilesDirectory();
fname += "/TargetDirectories.txt";
- cmGeneratedFileStream fout(fname.c_str());
+ cmGeneratedFileStream fout(fname);
for (cmLocalGenerator* lg : this->LocalGenerators) {
const std::vector<cmGeneratorTarget*>& tgts = lg->GetGeneratorTargets();
@@ -2956,7 +2956,7 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
Json::Value& lj_sources = lj_root["sources"] = Json::arrayValue;
cmSystemTools::MakeDirectory(dir);
- cmGeneratedFileStream fout(file.c_str());
+ cmGeneratedFileStream fout(file);
std::vector<std::string> labels;
@@ -3030,7 +3030,7 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
}
}
}
- cmGeneratedFileStream json_fout(json_file.c_str());
+ cmGeneratedFileStream json_fout(json_file);
json_fout << lj_root;
} else
#endif
@@ -3105,7 +3105,7 @@ bool cmGlobalGenerator::GenerateCPackPropertiesFile()
return true;
}
- cmGeneratedFileStream file(path.c_str());
+ cmGeneratedFileStream file(path);
file << "# CPack properties\n";
for (auto const& i : installedFiles) {