summaryrefslogtreecommitdiffstats
path: root/Source/cmake.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/cmake.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/cmake.cxx')
-rw-r--r--Source/cmake.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 09d270d..62f33dc 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -647,7 +647,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
{
directoriesSet = true;
std::string path = arg.substr(2);
- path = cmSystemTools::CollapseFullPath(path.c_str());
+ path = cmSystemTools::CollapseFullPath(path);
cmSystemTools::ConvertToUnixSlashes(path);
this->SetHomeDirectory(path);
}
@@ -663,7 +663,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
{
directoriesSet = true;
std::string path = arg.substr(2);
- path = cmSystemTools::CollapseFullPath(path.c_str());
+ path = cmSystemTools::CollapseFullPath(path);
cmSystemTools::ConvertToUnixSlashes(path);
this->SetHomeOutputDirectory(path);
}
@@ -723,7 +723,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
else if(arg.find("--graphviz=",0) == 0)
{
std::string path = arg.substr(strlen("--graphviz="));
- path = cmSystemTools::CollapseFullPath(path.c_str());
+ path = cmSystemTools::CollapseFullPath(path);
cmSystemTools::ConvertToUnixSlashes(path);
this->GraphVizFile = path;
if ( this->GraphVizFile.empty() )
@@ -1212,7 +1212,7 @@ int cmake::DoPreConfigureChecks()
cacheStart += "/CMakeLists.txt";
std::string currentStart = this->GetHomeDirectory();
currentStart += "/CMakeLists.txt";
- if(!cmSystemTools::SameFile(cacheStart.c_str(), currentStart.c_str()))
+ if(!cmSystemTools::SameFile(cacheStart, currentStart))
{
std::string message = "The source \"";
message += currentStart;
@@ -1948,7 +1948,7 @@ void cmake::UpdateConversionPathTable()
{
// two entries per line
table >> a; table >> b;
- cmSystemTools::AddTranslationPath( a.c_str(), b.c_str());
+ cmSystemTools::AddTranslationPath( a, b);
}
}
}
@@ -2043,7 +2043,7 @@ int cmake::CheckBuildSystem()
pi != products.end(); ++pi)
{
if(!(cmSystemTools::FileExists(pi->c_str()) ||
- cmSystemTools::FileIsSymlink(pi->c_str())))
+ cmSystemTools::FileIsSymlink(*pi)))
{
if(verbose)
{
@@ -2166,7 +2166,7 @@ void cmake::TruncateOutputLog(const char* fname)
}
if ( !this->CacheManager->GetCacheValue("CMAKE_CACHEFILE_DIR") )
{
- cmSystemTools::RemoveFile(fullPath.c_str());
+ cmSystemTools::RemoveFile(fullPath);
return;
}
off_t fsize = st.st_size;
@@ -2392,7 +2392,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
std::string resultFile;
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
std::string destPath = cwd + "/__cmake_systeminformation";
- cmSystemTools::RemoveADirectory(destPath.c_str());
+ cmSystemTools::RemoveADirectory(destPath);
if (!cmSystemTools::MakeDirectory(destPath.c_str()))
{
std::cerr << "Error: --system-information must be run from a "
@@ -2474,7 +2474,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
}
// now run cmake on the CMakeLists file
- cmSystemTools::ChangeDirectory(destPath.c_str());
+ cmSystemTools::ChangeDirectory(destPath);
std::vector<std::string> args2;
args2.push_back(args[0]);
args2.push_back(destPath);
@@ -2490,12 +2490,12 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
}
// change back to the original directory
- cmSystemTools::ChangeDirectory(cwd.c_str());
+ cmSystemTools::ChangeDirectory(cwd);
// echo results to stdout if needed
if (writeToStdout)
{
- FILE* fin = cmsys::SystemTools::Fopen(resultFile.c_str(), "r");
+ FILE* fin = cmsys::SystemTools::Fopen(resultFile, "r");
if(fin)
{
const int bufferSize = 4096;
@@ -2514,7 +2514,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
}
// clean up the directory
- cmSystemTools::RemoveADirectory(destPath.c_str());
+ cmSystemTools::RemoveADirectory(destPath);
return 0;
}
@@ -2770,7 +2770,7 @@ int cmake::Build(const std::string& dir,
const std::vector<std::string>& nativeOptions,
bool clean)
{
- if(!cmSystemTools::FileIsDirectory(dir.c_str()))
+ if(!cmSystemTools::FileIsDirectory(dir))
{
std::cerr << "Error: " << dir << " is not a directory\n";
return 1;