diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2010-09-16 15:50:57 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2010-09-16 15:50:57 (GMT) |
commit | 59463ef1a33a22113e1c577c450d7b2c70916bbc (patch) | |
tree | 3e6862307f8c951f2732ce909db6a757d80c944a /Source/cmMakefile.cxx | |
parent | f117423336a91f4f50f031d0acc892d4c10316c3 (diff) | |
download | CMake-59463ef1a33a22113e1c577c450d7b2c70916bbc.zip CMake-59463ef1a33a22113e1c577c450d7b2c70916bbc.tar.gz CMake-59463ef1a33a22113e1c577c450d7b2c70916bbc.tar.bz2 |
Rework CheckVariableForUnused usage
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 592e05e..df871ec 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1771,7 +1771,7 @@ bool cmMakefile::VariableCleared(const char* var) const return false; } -bool cmMakefile::CheckForUnused(const char* reason, const char* name) +void cmMakefile::CheckForUnused(const char* reason, const char* name) const { if (this->WarnUnused && !this->VariableUsed(name)) { @@ -1786,10 +1786,8 @@ bool cmMakefile::CheckForUnused(const char* reason, const char* name) msg << file->FilePath << ":" << file->Line << ":" << " warning: (" << reason << ") unused variable \'" << name << "\'"; cmSystemTools::Message(msg.str().c_str()); - return true; } } - return false; } void cmMakefile::RemoveDefinition(const char* name) @@ -3429,7 +3427,11 @@ void cmMakefile::PopScope() for (; it != locals.end(); ++it) { init.erase(*it); - if (!this->CheckForUnused("out of scope", it->c_str())) + if (!this->VariableUsed(it->c_str())) + { + this->CheckForUnused("out of scope", it->c_str()); + } + else { usage.erase(*it); } |