diff options
Diffstat (limited to 'Source/cmDependsC.cxx')
-rw-r--r-- | Source/cmDependsC.cxx | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 78bb1b2..18e123e 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -29,7 +29,7 @@ #define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: " cmDependsC::cmDependsC() - : ValidDeps(0) + : ValidDeps(CM_NULLPTR) { } @@ -105,7 +105,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, std::set<std::string> dependencies; bool haveDeps = false; - if (this->ValidDeps != 0) { + if (this->ValidDeps != CM_NULLPTR) { std::map<std::string, DependencyVector>::const_iterator tmpIt = this->ValidDeps->find(obj); if (tmpIt != this->ValidDeps->end()) { @@ -158,7 +158,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, this->HeaderLocationCache.find(current.FileName); if (headerLocationIt != this->HeaderLocationCache.end()) { fullName = headerLocationIt->second; - } else + } else { for (std::vector<std::string>::const_iterator i = this->IncludePath.begin(); i != this->IncludePath.end(); ++i) { @@ -175,6 +175,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, break; } } + } } // Complain if the file cannot be found and matches the complain @@ -268,31 +269,31 @@ void cmDependsC::ReadCacheFile() } std::string line; - cmIncludeLines* cacheEntry = 0; + cmIncludeLines* cacheEntry = CM_NULLPTR; bool haveFileName = false; while (cmSystemTools::GetLineFromStream(fin, line)) { if (line.empty()) { - cacheEntry = 0; + cacheEntry = CM_NULLPTR; haveFileName = false; continue; } // the first line after an empty line is the name of the parsed file - if (haveFileName == false) { + if (!haveFileName) { haveFileName = true; int newer = 0; cmFileTimeComparison comp; bool res = comp.FileTimeCompare(this->CacheFileName.c_str(), line.c_str(), &newer); - if ((res == true) && (newer == 1)) // cache is newer than the parsed file + if (res && newer == 1) // cache is newer than the parsed file { cacheEntry = new cmIncludeLines; this->FileCache[line] = cacheEntry; } // file doesn't exist, check that the regular expressions // haven't changed - else if (res == false) { + else if (!res) { if (line.find(INCLUDE_REGEX_LINE_MARKER) == 0) { if (line != this->IncludeRegexLineString) { return; @@ -311,7 +312,7 @@ void cmDependsC::ReadCacheFile() } } } - } else if (cacheEntry != 0) { + } else if (cacheEntry != CM_NULLPTR) { UnscannedEntry entry; entry.FileName = line; if (cmSystemTools::GetLineFromStream(fin, line)) { @@ -343,16 +344,16 @@ void cmDependsC::WriteCacheFile() const this->FileCache.begin(); fileIt != this->FileCache.end(); ++fileIt) { if (fileIt->second->Used) { - cacheOut << fileIt->first.c_str() << std::endl; + cacheOut << fileIt->first << std::endl; for (std::vector<UnscannedEntry>::const_iterator incIt = fileIt->second->UnscannedEntries.begin(); incIt != fileIt->second->UnscannedEntries.end(); ++incIt) { - cacheOut << incIt->FileName.c_str() << std::endl; + cacheOut << incIt->FileName << std::endl; if (incIt->QuotedLocation.empty()) { cacheOut << "-" << std::endl; } else { - cacheOut << incIt->QuotedLocation.c_str() << std::endl; + cacheOut << incIt->QuotedLocation << std::endl; } } cacheOut << std::endl; |