| 383 | |
| 384 | |
| 385 | static bool notvar(const Token *tok, nonneg int varid) |
| 386 | { |
| 387 | if (!tok) |
| 388 | return false; |
| 389 | if (Token::Match(tok, "&&|;")) |
| 390 | return notvar(tok->astOperand1(),varid) || notvar(tok->astOperand2(),varid); |
| 391 | if (tok->str() == "(" && Token::Match(tok->astOperand1(), "UNLIKELY|LIKELY")) |
| 392 | return notvar(tok->astOperand2(), varid); |
| 393 | const Token *vartok = astIsVariableComparison(tok, "==", "0"); |
| 394 | return vartok && (vartok->varId() == varid); |
| 395 | } |
| 396 | |
| 397 | static bool ifvar(const Token *tok, nonneg int varid, const std::string &comp, const std::string &rhs) |
| 398 | { |
no test coverage detected