summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2010-09-16 15:50:57 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2010-09-16 15:50:57 (GMT)
commit59463ef1a33a22113e1c577c450d7b2c70916bbc (patch)
tree3e6862307f8c951f2732ce909db6a757d80c944a /Source/cmMakefile.cxx
parentf117423336a91f4f50f031d0acc892d4c10316c3 (diff)
downloadCMake-59463ef1a33a22113e1c577c450d7b2c70916bbc.zip
CMake-59463ef1a33a22113e1c577c450d7b2c70916bbc.tar.gz
CMake-59463ef1a33a22113e1c577c450d7b2c70916bbc.tar.bz2
Rework CheckVariableForUnused usage
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx10
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);
}