mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-21 14:40:26 -06:00
strings: Remove redundant calls to std::string::c_str()
Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
This commit is contained in:
@@ -152,7 +152,7 @@ void cmGeneratedFileStreamBase::Open(const char* name)
|
||||
#endif
|
||||
|
||||
// Make sure the temporary file that will be used is not present.
|
||||
cmSystemTools::RemoveFile(this->TempName.c_str());
|
||||
cmSystemTools::RemoveFile(this->TempName);
|
||||
|
||||
std::string dir = cmSystemTools::GetFilenamePath(this->TempName);
|
||||
cmSystemTools::MakeDirectory(dir.c_str());
|
||||
@@ -174,7 +174,7 @@ bool cmGeneratedFileStreamBase::Close()
|
||||
if(!this->Name.empty() &&
|
||||
this->Okay &&
|
||||
(!this->CopyIfDifferent ||
|
||||
cmSystemTools::FilesDiffer(this->TempName.c_str(), resname.c_str())))
|
||||
cmSystemTools::FilesDiffer(this->TempName, resname)))
|
||||
{
|
||||
// The destination is to be replaced. Rename the temporary to the
|
||||
// destination atomically.
|
||||
@@ -185,7 +185,7 @@ bool cmGeneratedFileStreamBase::Close()
|
||||
{
|
||||
this->RenameFile(gzname.c_str(), resname.c_str());
|
||||
}
|
||||
cmSystemTools::RemoveFile(gzname.c_str());
|
||||
cmSystemTools::RemoveFile(gzname);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -198,7 +198,7 @@ bool cmGeneratedFileStreamBase::Close()
|
||||
// Else, the destination was not replaced.
|
||||
//
|
||||
// Always delete the temporary file. We never want it to stay around.
|
||||
cmSystemTools::RemoveFile(this->TempName.c_str());
|
||||
cmSystemTools::RemoveFile(this->TempName);
|
||||
|
||||
return replaced;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user