summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.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/cmMakefileTargetGenerator.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/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 7cae305..79baca6 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -124,7 +124,7 @@ void cmMakefileTargetGenerator::CreateRuleFile()
// Open the rule file. This should be copy-if-different because the
// rules may depend on this file itself.
this->BuildFileStream =
- new cmGeneratedFileStream(this->BuildFileNameFull.c_str(), false,
+ new cmGeneratedFileStream(this->BuildFileNameFull, false,
this->GlobalGenerator->GetMakefileEncoding());
this->BuildFileStream->SetCopyIfDifferent(true);
if (!this->BuildFileStream) {
@@ -237,8 +237,7 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules()
if (!cmSystemTools::FileExists(dependFileNameFull)) {
// Write an empty dependency file.
cmGeneratedFileStream depFileStream(
- dependFileNameFull.c_str(), false,
- this->GlobalGenerator->GetMakefileEncoding());
+ dependFileNameFull, false, this->GlobalGenerator->GetMakefileEncoding());
depFileStream << "# Empty dependencies file for "
<< this->GeneratorTarget->GetName() << ".\n"
<< "# This may be replaced when dependencies are built."
@@ -250,7 +249,7 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules()
this->FlagFileNameFull = this->TargetBuildDirectoryFull;
this->FlagFileNameFull += "/flags.make";
this->FlagFileStream =
- new cmGeneratedFileStream(this->FlagFileNameFull.c_str(), false,
+ new cmGeneratedFileStream(this->FlagFileNameFull, false,
this->GlobalGenerator->GetMakefileEncoding());
this->FlagFileStream->SetCopyIfDifferent(true);
if (!this->FlagFileStream) {
@@ -974,8 +973,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
this->InfoFileNameFull += "/DependInfo.cmake";
this->InfoFileNameFull =
this->LocalGenerator->ConvertToFullPath(this->InfoFileNameFull);
- this->InfoFileStream =
- new cmGeneratedFileStream(this->InfoFileNameFull.c_str());
+ this->InfoFileStream = new cmGeneratedFileStream(this->InfoFileNameFull);
this->InfoFileStream->SetCopyIfDifferent(true);
if (!*this->InfoFileStream) {
return;
@@ -1446,7 +1444,7 @@ void cmMakefileTargetGenerator::CreateLinkScript(
std::string linkScriptName = this->TargetBuildDirectoryFull;
linkScriptName += "/";
linkScriptName += name;
- cmGeneratedFileStream linkScriptStream(linkScriptName.c_str());
+ cmGeneratedFileStream linkScriptStream(linkScriptName);
linkScriptStream.SetCopyIfDifferent(true);
for (std::string const& link_command : link_commands) {
// Do not write out empty commands or commands beginning in the
@@ -1530,7 +1528,7 @@ std::string cmMakefileTargetGenerator::CreateResponseFile(
std::string responseFileNameFull = this->TargetBuildDirectoryFull;
responseFileNameFull += "/";
responseFileNameFull += name;
- cmGeneratedFileStream responseStream(responseFileNameFull.c_str());
+ cmGeneratedFileStream responseStream(responseFileNameFull);
responseStream.SetCopyIfDifferent(true);
responseStream << options << "\n";
@@ -1718,7 +1716,7 @@ void cmMakefileTargetGenerator::GenDefFile(
cmOutputConverter::SHELL);
real_link_commands.insert(real_link_commands.begin(), cmd);
// create a list of obj files for the -E __create_def to read
- cmGeneratedFileStream fout(objlist_file.c_str());
+ cmGeneratedFileStream fout(objlist_file);
if (mdi->WindowsExportAllSymbols) {
for (std::string const& obj : this->Objects) {