minor refactoring
This commit is contained in:
parent
42b3bc68a5
commit
47f64df8aa
|
@ -166,21 +166,17 @@ void CheckAutoVariables::autoVariables()
|
|||
errorAutoVariableAssignment(tok->next(), false);
|
||||
} else if (Token::Match(tok, "[;{}] %var% . %var% = & %var%")) {
|
||||
// TODO: check if the parameter is only changed temporarily (#2969)
|
||||
if (printInconclusive) {
|
||||
if (isPtrArg(tok->next())) {
|
||||
const Token * const var2tok = tok->tokAt(6);
|
||||
if (isAutoVar(var2tok) && checkRvalueExpression(var2tok))
|
||||
errorAutoVariableAssignment(tok->next(), true);
|
||||
}
|
||||
if (printInconclusive && isPtrArg(tok->next())) {
|
||||
const Token * const var2tok = tok->tokAt(6);
|
||||
if (isAutoVar(var2tok) && checkRvalueExpression(var2tok))
|
||||
errorAutoVariableAssignment(tok->next(), true);
|
||||
}
|
||||
tok = tok->tokAt(6);
|
||||
} else if (Token::Match(tok, "[;{}] %var% . %var% = %var% ;")) {
|
||||
// TODO: check if the parameter is only changed temporarily (#2969)
|
||||
if (printInconclusive) {
|
||||
if (isPtrArg(tok->next())) {
|
||||
if (isAutoVarArray(tok->tokAt(5)))
|
||||
errorAutoVariableAssignment(tok->next(), true);
|
||||
}
|
||||
if (printInconclusive && isPtrArg(tok->next())) {
|
||||
if (isAutoVarArray(tok->tokAt(5)))
|
||||
errorAutoVariableAssignment(tok->next(), true);
|
||||
}
|
||||
tok = tok->tokAt(5);
|
||||
} else if (Token::Match(tok, "[;{}] * %var% = %var% ;")) {
|
||||
|
|
Loading…
Reference in New Issue