From f6c23fa1e7c482dbdbf7d0e9c5c3189a3e3bdf91 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Sat, 1 Dec 2012 03:17:55 +0100 Subject: [PATCH] runastyle and fix checkInternal messages. --- lib/checkassignif.cpp | 2 +- lib/checknullpointer.cpp | 4 ++-- lib/token.cpp | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/checkassignif.cpp b/lib/checkassignif.cpp index 92a63d7aa..ed9fef11a 100644 --- a/lib/checkassignif.cpp +++ b/lib/checkassignif.cpp @@ -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()); diff --git a/lib/checknullpointer.cpp b/lib/checknullpointer.cpp index 2fbd709a1..df9bd02cd 100644 --- a/lib/checknullpointer.cpp +++ b/lib/checknullpointer.cpp @@ -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; } diff --git a/lib/token.cpp b/lib/token.cpp index 3cf31b9de..23f0e1518 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -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%)