CheckCondition: Moved checks to 'normal'
This commit is contained in:
parent
ea9b2032c1
commit
4ce6de39c5
|
@ -161,6 +161,11 @@ bool CheckCondition::assignIfParseScope(const Token * const assignTok,
|
|||
if (Token::Match(tok2, "%varid% =", varid)) {
|
||||
return true;
|
||||
}
|
||||
if (bitop == '&' && Token::Match(tok2, "%varid% &= %num% ;", varid)) {
|
||||
const MathLib::bigint num2 = MathLib::toLongNumber(tok2->strAt(2));
|
||||
if (0 == (num & num2))
|
||||
mismatchingBitAndError(assignTok, num, tok2, num2);
|
||||
}
|
||||
if (Token::Match(tok2, "++|-- %varid%", varid) || Token::Match(tok2, "%varid% ++|--", varid))
|
||||
return true;
|
||||
if (Token::Match(tok2, "[(,] &| %varid% [,)]", varid) && isParameterChanged(tok2))
|
||||
|
|
|
@ -61,17 +61,19 @@ public:
|
|||
checkCondition.alwaysTrueFalse();
|
||||
checkCondition.duplicateCondition();
|
||||
checkCondition.checkPointerAdditionResultNotNull();
|
||||
}
|
||||
|
||||
/** @brief Run checks against the simplified token list */
|
||||
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {
|
||||
CheckCondition checkCondition(tokenizer, settings, errorLogger);
|
||||
checkCondition.assignIf();
|
||||
checkCondition.checkBadBitmaskCheck();
|
||||
checkCondition.comparison();
|
||||
checkCondition.checkModuloAlwaysTrueFalse();
|
||||
}
|
||||
|
||||
/** @brief Run checks against the simplified token list */
|
||||
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {
|
||||
(void)tokenizer;
|
||||
(void)settings;
|
||||
(void)errorLogger;
|
||||
}
|
||||
|
||||
/** mismatching assignment / comparison */
|
||||
void assignIf();
|
||||
|
||||
|
|
Loading…
Reference in New Issue