mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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
This commit is contained in:
@@ -253,7 +253,7 @@ void cmLocalGenerator::GenerateTestFiles()
|
||||
file += "/";
|
||||
file += "CTestTestfile.cmake";
|
||||
|
||||
cmGeneratedFileStream fout(file.c_str());
|
||||
cmGeneratedFileStream fout(file);
|
||||
fout.SetCopyIfDifferent(true);
|
||||
|
||||
fout << "# CMake generated Testfile for " << std::endl
|
||||
@@ -429,7 +429,7 @@ void cmLocalGenerator::GenerateInstallRules()
|
||||
toplevel_install = 1;
|
||||
}
|
||||
file += "/cmake_install.cmake";
|
||||
cmGeneratedFileStream fout(file.c_str());
|
||||
cmGeneratedFileStream fout(file);
|
||||
fout.SetCopyIfDifferent(true);
|
||||
|
||||
// Write the header.
|
||||
|
||||
Reference in New Issue
Block a user