diff options
author | Brad King <brad.king@kitware.com> | 2018-02-01 13:04:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-02-01 13:05:33 (GMT) |
commit | f8ca0ab3ac858730874176bf332808061fe179c6 (patch) | |
tree | 4aa58a0ff03b4713940fc41fcf81196017e35a5d /Source/cmDependsC.cxx | |
parent | 3ffc9b99bb20b56d5dc232fee8c988aa34474a2f (diff) | |
parent | 653b894683abe63233cb8679b34ea39d9017e317 (diff) | |
download | CMake-f8ca0ab3ac858730874176bf332808061fe179c6.zip CMake-f8ca0ab3ac858730874176bf332808061fe179c6.tar.gz CMake-f8ca0ab3ac858730874176bf332808061fe179c6.tar.bz2 |
Merge topic 'std-string-apis'
653b8946 Reduce raw string pointers usage.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1729
Diffstat (limited to 'Source/cmDependsC.cxx')
-rw-r--r-- | Source/cmDependsC.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 29755d9..62bc8d9 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -131,14 +131,12 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, // If not a full path, find the file in the include path. std::string fullName; - if ((srcFiles > 0) || - cmSystemTools::FileIsFullPath(current.FileName.c_str())) { - if (cmSystemTools::FileExists(current.FileName.c_str(), true)) { + if ((srcFiles > 0) || cmSystemTools::FileIsFullPath(current.FileName)) { + if (cmSystemTools::FileExists(current.FileName, true)) { fullName = current.FileName; } } else if (!current.QuotedLocation.empty() && - cmSystemTools::FileExists(current.QuotedLocation.c_str(), - true)) { + cmSystemTools::FileExists(current.QuotedLocation, true)) { // The include statement producing this entry was a double-quote // include and the included file is present in the directory of // the source containing the include statement. @@ -157,7 +155,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, cmSystemTools::CollapseCombinedPath(i, current.FileName); // Look for the file in this location. - if (cmSystemTools::FileExists(tempPathStr.c_str(), true)) { + if (cmSystemTools::FileExists(tempPathStr, true)) { fullName = tempPathStr; HeaderLocationCache[current.FileName] = fullName; break; @@ -226,15 +224,14 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, // directory. We must do the same here. std::string binDir = this->LocalGenerator->GetBinaryDirectory(); std::string obj_i = this->LocalGenerator->ConvertToRelativePath(binDir, obj); - std::string obj_m = cmSystemTools::ConvertToOutputPath(obj_i.c_str()); + std::string obj_m = cmSystemTools::ConvertToOutputPath(obj_i); internalDepends << obj_i << std::endl; for (std::string const& dep : dependencies) { - makeDepends - << obj_m << ": " - << cmSystemTools::ConvertToOutputPath( - this->LocalGenerator->ConvertToRelativePath(binDir, dep).c_str()) - << std::endl; + makeDepends << obj_m << ": " + << cmSystemTools::ConvertToOutputPath( + this->LocalGenerator->ConvertToRelativePath(binDir, dep)) + << std::endl; internalDepends << " " << dep << std::endl; } makeDepends << std::endl; @@ -363,7 +360,7 @@ void cmDependsC::Scan(std::istream& is, const char* directory, entry.FileName = this->IncludeRegexLine.match(2); cmSystemTools::ConvertToUnixSlashes(entry.FileName); if (this->IncludeRegexLine.match(3) == "\"" && - !cmSystemTools::FileIsFullPath(entry.FileName.c_str())) { + !cmSystemTools::FileIsFullPath(entry.FileName)) { // This was a double-quoted include with a relative path. We // must check for the file in the directory containing the // file we are scanning. |