From 4bb08e0a9b2d4b652f9bdf06f24c5db57c249abb Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sun, 18 Dec 2011 15:42:48 +0100 Subject: [PATCH 1/2] Remove trailing whitespace Alex --- Source/cmDependsC.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index a76b3af5f..32b212ab8 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -237,10 +237,10 @@ bool cmDependsC::WriteDependencies(const char *src, const char *obj, fileIt->second->Used=true; dependencies.insert(fullName); for (std::vector::const_iterator incIt= - fileIt->second->UnscannedEntries.begin(); + fileIt->second->UnscannedEntries.begin(); incIt!=fileIt->second->UnscannedEntries.end(); ++incIt) { - if (this->Encountered.find(incIt->FileName) == + if (this->Encountered.find(incIt->FileName) == this->Encountered.end()) { this->Encountered.insert(incIt->FileName); @@ -278,7 +278,7 @@ bool cmDependsC::WriteDependencies(const char *src, const char *obj, for(std::set::iterator i=dependencies.begin(); i != dependencies.end(); ++i) { - makeDepends << obj << ": " << + makeDepends << obj << ": " << this->LocalGenerator->Convert(i->c_str(), cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKEFILE) @@ -321,9 +321,9 @@ void cmDependsC::ReadCacheFile() haveFileName=true; int newer=0; cmFileTimeComparison comp; - bool res=comp.FileTimeCompare(this->CacheFileName.c_str(), + bool res=comp.FileTimeCompare(this->CacheFileName.c_str(), line.c_str(), &newer); - + if ((res==true) && (newer==1)) //cache is newer than the parsed file { cacheEntry=new cmIncludeLines; @@ -391,7 +391,7 @@ void cmDependsC::WriteCacheFile() const { return; } - + cacheOut << this->IncludeRegexLineString << "\n\n"; cacheOut << this->IncludeRegexScanString << "\n\n"; cacheOut << this->IncludeRegexComplainString << "\n\n"; @@ -406,7 +406,7 @@ void cmDependsC::WriteCacheFile() const cacheOut<first.c_str()<::const_iterator - incIt=fileIt->second->UnscannedEntries.begin(); + incIt=fileIt->second->UnscannedEntries.begin(); incIt!=fileIt->second->UnscannedEntries.end(); ++incIt) { cacheOut<FileName.c_str()<Used=true; this->FileCache[fullName]=newCacheEntry; - + // Read one line at a time. std::string line; while(cmSystemTools::GetLineFromStream(is, line)) From 318b0cdf2306a9198baa837885d65423e5f7fc96 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sun, 18 Dec 2011 15:44:33 +0100 Subject: [PATCH 2/2] Add comment about one more problem of the C depency scanner. Alex --- Source/cmDependsC.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 32b212ab8..44841a900 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -465,6 +465,9 @@ void cmDependsC::Scan(std::istream& is, const char* directory, // that this check does not account for the possibility of two // headers with the same name in different directories when one // is included by double-quotes and the other by angle brackets. + // It also does not work properly if two header files with the same + // name exist in different directories, and both are included from a + // file their own directory by simply using "filename.h" (#12619) // This kind of problem will be fixed when a more // preprocessor-like implementation of this scanner is created. if (this->IncludeRegexScan.find(entry.FileName.c_str()))