Fixed #5162: Tokenizer:simplifyInitVar: Unused pointer value (UNUSED_VALUE) returned_pointer: Pointer tok2 returned by tok2->next() is never used (CID 1124084).
This commit is contained in:
parent
4027848761
commit
347e1eae20
|
@ -6139,14 +6139,9 @@ void Tokenizer::simplifyInitVar()
|
||||||
while (tok1->str() != ",")
|
while (tok1->str() != ",")
|
||||||
tok1 = tok1->next();
|
tok1 = tok1->next();
|
||||||
tok1->str(";");
|
tok1->str(";");
|
||||||
unsigned int num = 0;
|
|
||||||
const Token *tok2 = tok;
|
const unsigned int numTokens = (Token::Match(tok, "class|struct|union")) ? 2U : 1U;
|
||||||
if (Token::Match(tok2, "class|struct|union")) {
|
list.insertTokens(tok1, tok, numTokens);
|
||||||
num++;
|
|
||||||
tok2 = tok2->next();
|
|
||||||
}
|
|
||||||
num++;
|
|
||||||
list.insertTokens(tok1, tok, num);
|
|
||||||
tok = initVar(tok);
|
tok = initVar(tok);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue