From 8b59c39c420090bb68deb060c1a73deb38c12a5f Mon Sep 17 00:00:00 2001 From: PKEuS Date: Sat, 27 Dec 2014 11:09:54 +0100 Subject: [PATCH] Refactorization: Removed whitespaces at the end of Token::Match patterns --- lib/checkbufferoverrun.cpp | 4 ++-- lib/checknullpointer.cpp | 2 +- lib/checkstl.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 1040bad69..2420d060a 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -999,11 +999,11 @@ void CheckBufferOverrun::checkScope(const Token *tok, const ArrayInfo &arrayInfo //--------------------------------------------------------------------------- bool CheckBufferOverrun::isArrayOfStruct(const Token* tok, int &position) { - if (Token::Match(tok->next(), "%var% [ %num% ] ")) { + if (Token::Match(tok->next(), "%var% [ %num% ]")) { tok = tok->tokAt(4); int i = 1; for (;;) { - if (Token::Match(tok->next(), "[ %num% ] ")) { + if (Token::Match(tok->next(), "[ %num% ]")) { i++; tok = tok->tokAt(4); } else diff --git a/lib/checknullpointer.cpp b/lib/checknullpointer.cpp index 65736a20c..4d1527ccb 100644 --- a/lib/checknullpointer.cpp +++ b/lib/checknullpointer.cpp @@ -502,7 +502,7 @@ void CheckNullPointer::nullPointerDefaultArgument() } if (!tok) break; - } else if (Token::simpleMatch(tok, "if ( ")) { + } else if (Token::simpleMatch(tok, "if (")) { bool dependsOnPointer = false; const Token *endOfCondition = tok->next()->link(); if (!endOfCondition) diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index 8b6f6a662..6c7cb07da 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -847,7 +847,7 @@ void CheckStl::if_find() else if (Token::Match(decl, "%type% >")) { decl = decl->tokAt(2); if (warning && (Token::Match(decl, "* &| %varid%", varid) || - Token::Match(decl, "&| %varid% [ ]| %any% ]| ", varid))) + Token::Match(decl, "&| %varid% [ ]| %any% ]|", varid))) if_findError(tok, false); } @@ -858,7 +858,7 @@ void CheckStl::if_find() else if (performance && var->isStlStringType()) { decl = decl->next(); if (Token::Match(decl, "* &| %varid%", varid) || - Token::Match(decl, "&| %varid% [ ]| %any% ]| ", varid)) + Token::Match(decl, "&| %varid% [ ]| %any% ]|", varid)) if_findError(tok, true); } }