Tokenizer: removed unused variable

This commit is contained in:
Daniel Marjamäki 2012-09-01 09:57:48 +02:00
parent ff7373f46f
commit a8d419820b
1 changed files with 24 additions and 27 deletions

View File

@ -2826,36 +2826,33 @@ void Tokenizer::setVarId()
tok2->varId(varlist[tok2->str()]); tok2->varId(varlist[tok2->str()]);
} }
// Member functions for this class.. // Set variable ids in member functions for this class..
std::list<Token *> funclist; const std::string funcpattern(classname + " :: %var% (");
{ for (std::list<Token *>::iterator func = allMemberFunctions.begin(); func != allMemberFunctions.end(); ++func) {
const std::string funcpattern(classname + " :: %var% ("); Token *tok2 = *func;
for (std::list<Token *>::iterator func = allMemberFunctions.begin(); func != allMemberFunctions.end(); ++func) {
Token *tok2 = *func;
// Found a class function.. // Found a class function..
if (Token::Match(tok2, funcpattern.c_str())) { if (Token::Match(tok2, funcpattern.c_str())) {
// Goto the end parenthesis.. // Goto the end parenthesis..
tok2 = tok2->linkAt(3); tok2 = tok2->linkAt(3);
if (!tok2) if (!tok2)
break; break;
// If this is a function implementation.. add it to funclist // If this is a function implementation.. add it to funclist
if (Token::Match(tok2, ") const|volatile| {")) { if (Token::Match(tok2, ") const|volatile| {")) {
while (tok2->str() != "{") while (tok2->str() != "{")
tok2 = tok2->next(); tok2 = tok2->next();
setVarIdClassFunction(tok2, tok2->link(), varlist, &structMembers, &_varId); setVarIdClassFunction(tok2, tok2->link(), varlist, &structMembers, &_varId);
}
// constructor with initializer list
if (Token::Match(tok2, ") : %var% (")) {
const Token *tok3 = tok2;
while (Token::Match(tok3, ") [:,] %var% (")) {
tok3 = tok3->linkAt(3);
} }
if (Token::simpleMatch(tok3, ") {")) {
// constructor with initializer list setVarIdClassFunction(tok2, tok3->next()->link(), varlist, &structMembers, &_varId);
if (Token::Match(tok2, ") : %var% (")) {
const Token *tok3 = tok2;
while (Token::Match(tok3, ") [:,] %var% (")) {
tok3 = tok3->linkAt(3);
}
if (Token::simpleMatch(tok3, ") {")) {
setVarIdClassFunction(tok2, tok3->next()->link(), varlist, &structMembers, &_varId);
}
} }
} }
} }