runastyle and fix checkInternal messages.

This commit is contained in:
Edoardo Prezioso 2012-12-01 03:17:55 +01:00
parent 9ce6630b28
commit f6c23fa1e7
3 changed files with 5 additions and 7 deletions

View File

@ -54,7 +54,7 @@ void CheckAssignIf::assignIf()
bitop = tok->strAt(2).at(0);
num = MathLib::toLongNumber(tok->next()->str());
} else {
const Token * const endToken = Token::findmatch(tok, ";");
const Token * const endToken = Token::findsimplematch(tok, ";");
if (endToken && Token::Match(endToken->tokAt(-2), "[&|] %num% ;")) {
bitop = endToken->strAt(-2).at(0);
num = MathLib::toLongNumber(endToken->previous()->str());

View File

@ -1212,7 +1212,7 @@ void CheckNullPointer::nullPointerDefaultArgument()
bool unknown = _settings->inconclusive;
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 (Token::Match(tok, "if ( ")) {
if (Token::simpleMatch(tok, "if ( ")) {
bool dependsOnPointer = false;
const Token *endOfCondition = tok->next()->link();
for (const Token *tok2 = tok->next(); tok2 != endOfCondition; tok2 = tok2->next()) {
@ -1220,7 +1220,7 @@ void CheckNullPointer::nullPointerDefaultArgument()
dependsOnPointer = true;
}
}
if (dependsOnPointer && Token::Match(endOfCondition, ") {")) {
if (dependsOnPointer && Token::simpleMatch(endOfCondition, ") {")) {
tok = endOfCondition->next()->link();
continue;
}

View File

@ -639,8 +639,7 @@ bool Token::Match(const Token *tok, const char pattern[], unsigned int varid)
multicompare(p,tok->isNumber(),ismulticomp);
}
break;
case 'c':
{
case 'c': {
p += 1;
// Character (%char%)
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);
}
break;
case 'o':
{
case 'o': {
++p;
if (p[1] == '%') {
// Op (%op%)