Refactorizations:
- Disabled some parts of setVarId() for C code. - Fixed mistake in <contaier> documentation
This commit is contained in:
parent
8dd569b9e1
commit
016e89e422
|
@ -2651,7 +2651,7 @@ void Tokenizer::setVarId()
|
|||
if (notstart.find(tok2->str()) != notstart.end())
|
||||
continue;
|
||||
|
||||
if (Token::simpleMatch(tok2, "const new") && !isC())
|
||||
if (!isC() && Token::simpleMatch(tok2, "const new"))
|
||||
continue;
|
||||
|
||||
bool decl = setVarIdParseDeclaration(&tok2, variableId, executableScope.top(), isCPP(), isC());
|
||||
|
@ -2697,7 +2697,7 @@ void Tokenizer::setVarId()
|
|||
} else
|
||||
decl = false;
|
||||
} else if (isCPP() && Token::Match(prev2, "%type% {") && Token::simpleMatch(tok2->link(), "} ;")) { // C++11 initialization style
|
||||
if (Token::Match(prev2, "do|try|else") || Token::Match(prev2->tokAt(-2), "struct|class"))
|
||||
if (Token::Match(prev2, "do|try|else") || Token::Match(prev2->tokAt(-2), "struct|class|:"))
|
||||
continue;
|
||||
} else
|
||||
decl = false;
|
||||
|
@ -2746,7 +2746,7 @@ void Tokenizer::setVarId()
|
|||
// Member functions and variables in this source
|
||||
std::list<Token *> allMemberFunctions;
|
||||
std::list<Token *> allMemberVars;
|
||||
{
|
||||
if (!isC()) {
|
||||
for (Token *tok2 = list.front(); tok2; tok2 = tok2->next()) {
|
||||
if (Token::Match(tok2, "%var% :: %var%")) {
|
||||
if (tok2->strAt(3) == "(")
|
||||
|
@ -2806,7 +2806,7 @@ void Tokenizer::setVarId()
|
|||
tok2->varId(varlist[classname][tok2->str()]);
|
||||
}
|
||||
|
||||
if (namesp)
|
||||
if (namesp || isC())
|
||||
continue;
|
||||
|
||||
// Set variable ids in member functions for this class..
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<bookinfo>
|
||||
<title>Cppcheck 1.69 dev</title>
|
||||
|
||||
<date>2014-09-28</date>
|
||||
<date>2015-01-03</date>
|
||||
</bookinfo>
|
||||
|
||||
<chapter>
|
||||
|
@ -938,8 +938,8 @@ Checking unusedvar.cpp...
|
|||
</size>
|
||||
<access indexOperator="array-like">
|
||||
<function name="at" yields="at_index"/>
|
||||
<function name="front" yields="fixed"/>
|
||||
<function name="back" yields="fixed"/>
|
||||
<function name="front" yields="item"/>
|
||||
<function name="back" yields="item"/>
|
||||
</access>
|
||||
</container>
|
||||
</def></programlisting>
|
||||
|
|
Loading…
Reference in New Issue