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