summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2014-10-15 12:54:05 (GMT)
committerNils Gladitz <nilsgladitz@gmail.com>2014-10-15 12:54:05 (GMT)
commitcc1139cc304b6bd4c8403d437cf08f73e06e243a (patch)
treee9645a08b795a6eef8233e82c07370bc3cfa0673 /Source/cmCoreTryCompile.cxx
parent1b3495d32e1523648da08e138482a654f8765333 (diff)
downloadCMake-cc1139cc304b6bd4c8403d437cf08f73e06e243a.zip
CMake-cc1139cc304b6bd4c8403d437cf08f73e06e243a.tar.gz
CMake-cc1139cc304b6bd4c8403d437cf08f73e06e243a.tar.bz2
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.
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index bc5708d..512f5cf 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -233,7 +233,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{
// remove any CMakeCache.txt files so we will have a clean test
std::string ccFile = this->BinaryDirectory + "/CMakeCache.txt";
- cmSystemTools::RemoveFile(ccFile.c_str());
+ cmSystemTools::RemoveFile(ccFile);
// Choose sources.
if(!useSources)
@@ -279,7 +279,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
sourceDirectory = this->BinaryDirectory.c_str();
// now create a CMakeLists.txt file in that directory
- FILE *fout = cmsys::SystemTools::Fopen(outFileName.c_str(),"w");
+ FILE *fout = cmsys::SystemTools::Fopen(outFileName,"w");
if (!fout)
{
cmOStringStream e;
@@ -514,8 +514,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
if ((res==0) && (copyFile.size()))
{
if(this->OutputFile.empty() ||
- !cmSystemTools::CopyFileAlways(this->OutputFile.c_str(),
- copyFile.c_str()))
+ !cmSystemTools::CopyFileAlways(this->OutputFile,
+ copyFile))
{
cmOStringStream emsg;
emsg << "Cannot copy output executable\n"
@@ -580,10 +580,10 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
std::string fullPath = binDir;
fullPath += "/";
fullPath += dir.GetFile(static_cast<unsigned long>(fileNum));
- if(cmSystemTools::FileIsDirectory(fullPath.c_str()))
+ if(cmSystemTools::FileIsDirectory(fullPath))
{
this->CleanupFiles(fullPath.c_str());
- cmSystemTools::RemoveADirectory(fullPath.c_str());
+ cmSystemTools::RemoveADirectory(fullPath);
}
else
{
@@ -599,7 +599,7 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
}
if(retry.Count == 0)
#else
- if(!cmSystemTools::RemoveFile(fullPath.c_str()))
+ if(!cmSystemTools::RemoveFile(fullPath))
#endif
{
std::string m = "Remove failed on file: " + fullPath;
@@ -649,7 +649,7 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName)
command += tmpOutputFile;
if(cmSystemTools::FileExists(command.c_str()))
{
- tmpOutputFile = cmSystemTools::CollapseFullPath(command.c_str());
+ tmpOutputFile = cmSystemTools::CollapseFullPath(command);
this->OutputFile = tmpOutputFile;
return;
}