runastyle and fix checkInternal messages.
This commit is contained in:
parent
9ce6630b28
commit
f6c23fa1e7
|
@ -54,7 +54,7 @@ void CheckAssignIf::assignIf()
|
||||||
bitop = tok->strAt(2).at(0);
|
bitop = tok->strAt(2).at(0);
|
||||||
num = MathLib::toLongNumber(tok->next()->str());
|
num = MathLib::toLongNumber(tok->next()->str());
|
||||||
} else {
|
} else {
|
||||||
const Token * const endToken = Token::findmatch(tok, ";");
|
const Token * const endToken = Token::findsimplematch(tok, ";");
|
||||||
if (endToken && Token::Match(endToken->tokAt(-2), "[&|] %num% ;")) {
|
if (endToken && Token::Match(endToken->tokAt(-2), "[&|] %num% ;")) {
|
||||||
bitop = endToken->strAt(-2).at(0);
|
bitop = endToken->strAt(-2).at(0);
|
||||||
num = MathLib::toLongNumber(endToken->previous()->str());
|
num = MathLib::toLongNumber(endToken->previous()->str());
|
||||||
|
|
|
@ -1212,7 +1212,7 @@ void CheckNullPointer::nullPointerDefaultArgument()
|
||||||
bool unknown = _settings->inconclusive;
|
bool unknown = _settings->inconclusive;
|
||||||
for (const Token *tok = scope->classStart; tok != scope->classEnd; tok = tok->next()) {
|
for (const Token *tok = scope->classStart; tok != scope->classEnd; tok = tok->next()) {
|
||||||
// If we encounter a possible NULL-pointer check, skip over its body
|
// If we encounter a possible NULL-pointer check, skip over its body
|
||||||
if (Token::Match(tok, "if ( ")) {
|
if (Token::simpleMatch(tok, "if ( ")) {
|
||||||
bool dependsOnPointer = false;
|
bool dependsOnPointer = false;
|
||||||
const Token *endOfCondition = tok->next()->link();
|
const Token *endOfCondition = tok->next()->link();
|
||||||
for (const Token *tok2 = tok->next(); tok2 != endOfCondition; tok2 = tok2->next()) {
|
for (const Token *tok2 = tok->next(); tok2 != endOfCondition; tok2 = tok2->next()) {
|
||||||
|
@ -1220,7 +1220,7 @@ void CheckNullPointer::nullPointerDefaultArgument()
|
||||||
dependsOnPointer = true;
|
dependsOnPointer = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dependsOnPointer && Token::Match(endOfCondition, ") {")) {
|
if (dependsOnPointer && Token::simpleMatch(endOfCondition, ") {")) {
|
||||||
tok = endOfCondition->next()->link();
|
tok = endOfCondition->next()->link();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -639,8 +639,7 @@ bool Token::Match(const Token *tok, const char pattern[], unsigned int varid)
|
||||||
multicompare(p,tok->isNumber(),ismulticomp);
|
multicompare(p,tok->isNumber(),ismulticomp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c': {
|
||||||
{
|
|
||||||
p += 1;
|
p += 1;
|
||||||
// Character (%char%)
|
// Character (%char%)
|
||||||
if (p[0] == 'h') {
|
if (p[0] == 'h') {
|
||||||
|
@ -668,8 +667,7 @@ bool Token::Match(const Token *tok, const char pattern[], unsigned int varid)
|
||||||
multicompare(p,tok->isBoolean(),ismulticomp);
|
multicompare(p,tok->isBoolean(),ismulticomp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o': {
|
||||||
{
|
|
||||||
++p;
|
++p;
|
||||||
if (p[1] == '%') {
|
if (p[1] == '%') {
|
||||||
// Op (%op%)
|
// Op (%op%)
|
||||||
|
|
Loading…
Reference in New Issue