diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2019-01-19 01:20:00 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2019-01-19 01:30:13 (GMT) |
commit | 2c50a725763eb2201f356852eab98dfdf9c27591 (patch) | |
tree | 4fcd6733fd674c3d03ee700f706fb4af2efae1b7 /Source/cmDependsC.cxx | |
parent | a61c061b6143cb6d8920b1b5796a867c0f104556 (diff) | |
download | CMake-2c50a725763eb2201f356852eab98dfdf9c27591.zip CMake-2c50a725763eb2201f356852eab98dfdf9c27591.tar.gz CMake-2c50a725763eb2201f356852eab98dfdf9c27591.tar.bz2 |
cmDepends: all members accept std::string arguments
Most `const char*` arguments converted to `const std::string&`
in `cmDepends` and derived classes.
In addition performed minor code cleanup.
Diffstat (limited to 'Source/cmDependsC.cxx')
-rw-r--r-- | Source/cmDependsC.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 072d116..f6ac4f2 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -24,7 +24,7 @@ cmDependsC::cmDependsC() } cmDependsC::cmDependsC( - cmLocalGenerator* lg, const char* targetDir, const std::string& lang, + cmLocalGenerator* lg, const std::string& targetDir, const std::string& lang, const std::map<std::string, DependencyVector>* validDeps) : cmDepends(lg, targetDir) , ValidDeps(validDeps) @@ -53,8 +53,8 @@ cmDependsC::cmDependsC( } this->IncludeRegexLine.compile(INCLUDE_REGEX_LINE); - this->IncludeRegexScan.compile(scanRegex.c_str()); - this->IncludeRegexComplain.compile(complainRegex.c_str()); + this->IncludeRegexScan.compile(scanRegex); + this->IncludeRegexComplain.compile(complainRegex); this->IncludeRegexLineString = INCLUDE_REGEX_LINE_MARKER INCLUDE_REGEX_LINE; this->IncludeRegexScanString = INCLUDE_REGEX_SCAN_MARKER; this->IncludeRegexScanString += scanRegex; @@ -212,7 +212,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, // Scan this file for new dependencies. Pass the directory // containing the file to handle double-quote includes. std::string dir = cmSystemTools::GetFilenamePath(fullName); - this->Scan(fin, dir.c_str(), fullName); + this->Scan(fin, dir, fullName); } else { // Skip file with encoding we do not implement. } @@ -342,7 +342,7 @@ void cmDependsC::WriteCacheFile() const } } -void cmDependsC::Scan(std::istream& is, const char* directory, +void cmDependsC::Scan(std::istream& is, const std::string& directory, const std::string& fullName) { cmIncludeLines* newCacheEntry = new cmIncludeLines; @@ -418,7 +418,7 @@ void cmDependsC::SetupTransforms() sep = "|"; } xform += ")[ \t]*\\(([^),]*)\\)"; - this->IncludeRegexTransform.compile(xform.c_str()); + this->IncludeRegexTransform.compile(xform); // Build a string that encodes all transformation rules and will // change when rules are changed. @@ -460,11 +460,11 @@ void cmDependsC::TransformLine(std::string& line) // Construct the transformed line. std::string newline = this->IncludeRegexTransform.match(1); std::string arg = this->IncludeRegexTransform.match(4); - for (const char* c = tri->second.c_str(); *c; ++c) { - if (*c == '%') { + for (char c : tri->second) { + if (c == '%') { newline += arg; } else { - newline += *c; + newline += c; } } |