diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2018-01-31 15:20:02 (GMT) |
---|---|---|
committer | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2018-01-31 15:23:03 (GMT) |
commit | 653b894683abe63233cb8679b34ea39d9017e317 (patch) | |
tree | 200e5066b754d8ddfdc7beb86c4db179aa2e69d0 /Source/CTest/cmCTestGIT.cxx | |
parent | 4499cc8bb65e217e1cb2959452ed391af82e757b (diff) | |
download | CMake-653b894683abe63233cb8679b34ea39d9017e317.zip CMake-653b894683abe63233cb8679b34ea39d9017e317.tar.gz CMake-653b894683abe63233cb8679b34ea39d9017e317.tar.bz2 |
Reduce raw string pointers usage.
* Change some functions to take `std::string` instead of
`const char*` in the following classes: `cmMakeFile`, `cmake`,
`cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator`
and a few others.
* Greatly reduce using of `const char*` overloads for
`cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
* Remove many redundant `c_str()` conversions throughout the code.
Diffstat (limited to 'Source/CTest/cmCTestGIT.cxx')
-rw-r--r-- | Source/CTest/cmCTestGIT.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index 8cb795e..e85af5e 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -113,7 +113,7 @@ std::string cmCTestGIT::FindGitDir() // are a Windows application. Run "cygpath" to get Windows path. std::string cygpath_exe = cmSystemTools::GetFilenamePath(git); cygpath_exe += "/cygpath.exe"; - if (cmSystemTools::FileExists(cygpath_exe.c_str())) { + if (cmSystemTools::FileExists(cygpath_exe)) { char const* cygpath[] = { cygpath_exe.c_str(), "-w", git_dir.c_str(), 0 }; OneLineParser cygpath_out(this, "cygpath-out> ", git_dir_line); @@ -249,7 +249,7 @@ bool cmCTestGIT::UpdateImpl() if (this->GetGitVersion() < cmCTestGITVersion(1, 6, 5, 0)) { recursive = nullptr; // No need to require >= 1.6.5 if there are no submodules. - if (cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str())) { + if (cmSystemTools::FileExists(top_dir + "/.gitmodules")) { this->Log << "Git < 1.6.5 cannot update submodules recursively\n"; } } @@ -258,7 +258,7 @@ bool cmCTestGIT::UpdateImpl() if (this->GetGitVersion() < cmCTestGITVersion(1, 8, 1, 0)) { sync_recursive = nullptr; // No need to require >= 1.8.1 if there are no submodules. - if (cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str())) { + if (cmSystemTools::FileExists(top_dir + "/.gitmodules")) { this->Log << "Git < 1.8.1 cannot synchronize submodules recursively\n"; } } @@ -553,15 +553,15 @@ private: void DoHeaderLine() { // Look for header fields that we need. - if (cmHasLiteralPrefix(this->Line.c_str(), "commit ")) { + if (cmHasLiteralPrefix(this->Line, "commit ")) { this->Rev.Rev = this->Line.c_str() + 7; - } else if (cmHasLiteralPrefix(this->Line.c_str(), "author ")) { + } else if (cmHasLiteralPrefix(this->Line, "author ")) { Person author; this->ParsePerson(this->Line.c_str() + 7, author); this->Rev.Author = author.Name; this->Rev.EMail = author.EMail; this->Rev.Date = this->FormatDateTime(author); - } else if (cmHasLiteralPrefix(this->Line.c_str(), "committer ")) { + } else if (cmHasLiteralPrefix(this->Line, "committer ")) { Person committer; this->ParsePerson(this->Line.c_str() + 10, committer); this->Rev.Committer = committer.Name; |