Refactorization: Fixed VS warning about variable shadowing.

This commit is contained in:
PKEuS 2015-11-06 17:35:08 +01:00
parent be36539ad7
commit 72bc6d1f33
2 changed files with 4 additions and 7 deletions

View File

@ -2524,8 +2524,7 @@ static void setVarIdStructMembers(Token **tok1,
void Tokenizer::setVarIdClassDeclaration(Token * const startToken, void Tokenizer::setVarIdClassDeclaration(Token * const startToken,
const std::map<std::string, unsigned int> &variableId, const std::map<std::string, unsigned int> &variableId,
const unsigned int scopeStartVarId, const unsigned int scopeStartVarId,
std::map<unsigned int, std::map<std::string,unsigned int> >& structMembers, std::map<unsigned int, std::map<std::string,unsigned int> >& structMembers)
unsigned int *_varId)
{ {
// end of scope // end of scope
const Token * const endToken = startToken->link(); const Token * const endToken = startToken->link();
@ -2581,7 +2580,7 @@ void Tokenizer::setVarIdClassDeclaration(Token * const startToken,
const std::map<std::string, unsigned int>::const_iterator it = variableId.find(tok->str()); const std::map<std::string, unsigned int>::const_iterator it = variableId.find(tok->str());
if (it != variableId.end()) { if (it != variableId.end()) {
tok->varId(it->second); tok->varId(it->second);
setVarIdStructMembers(&tok, structMembers, _varId); setVarIdStructMembers(&tok, structMembers, &_varId);
} }
} }
} else if (indentlevel == 0 && tok->str() == ":" && !initListArgLastToken) } else if (indentlevel == 0 && tok->str() == ":" && !initListArgLastToken)
@ -2701,8 +2700,7 @@ void Tokenizer::setVarId()
setVarIdClassDeclaration(tok->link(), setVarIdClassDeclaration(tok->link(),
variableId, variableId,
scopeStack.top().startVarid, scopeStack.top().startVarid,
structMembers, structMembers);
&_varId);
} }
if (scopeInfo.empty()) { if (scopeInfo.empty()) {

View File

@ -719,8 +719,7 @@ private:
void setVarIdClassDeclaration(Token * const startToken, void setVarIdClassDeclaration(Token * const startToken,
const std::map<std::string, unsigned int> &variableId, const std::map<std::string, unsigned int> &variableId,
const unsigned int scopeStartVarId, const unsigned int scopeStartVarId,
std::map<unsigned int, std::map<std::string,unsigned int> >& structMembers, std::map<unsigned int, std::map<std::string,unsigned int> >& structMembers);
unsigned int *_varId);
public: public: