diff options
author | Brad King <brad.king@kitware.com> | 2014-10-21 19:08:01 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-10-21 19:08:01 (GMT) |
commit | ae5686f8d0e4f153991d5a7c0cf7406fa7d3468c (patch) | |
tree | 7e4833de51d717fbd989acfe7c1ea1a1594f94d6 /Source/cmake.cxx | |
parent | 4f9fcd356b07143a570b39cb5be72d4e3a4e83dc (diff) | |
parent | cc1139cc304b6bd4c8403d437cf08f73e06e243a (diff) | |
download | CMake-ae5686f8d0e4f153991d5a7c0cf7406fa7d3468c.zip CMake-ae5686f8d0e4f153991d5a7c0cf7406fa7d3468c.tar.gz CMake-ae5686f8d0e4f153991d5a7c0cf7406fa7d3468c.tar.bz2 |
Merge topic 'remove-redundant-c_str'
cc1139cc strings: Remove redundant calls to std::string::c_str()
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 26 |
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; |