From 8c2a5c98139462b0d547ecc4505f3a2050ea6fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 6 May 2018 09:50:53 +0200 Subject: [PATCH] astyle formatting [ci skip] --- lib/checkleakautovar.cpp | 6 +++--- lib/valueflow.cpp | 36 ++++++++++++++++++------------------ test/testbufferoverrun.cpp | 24 ++++++++++++------------ 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/checkleakautovar.cpp b/lib/checkleakautovar.cpp index 5982ae449..2772ed99e 100644 --- a/lib/checkleakautovar.cpp +++ b/lib/checkleakautovar.cpp @@ -198,9 +198,9 @@ static bool isPointerReleased(const Token *startToken, const Token *endToken, un for (const Token *tok = startToken; tok && tok != endToken; tok = tok->next()) { if (tok->varId() != varid) continue; - if(Token::Match(tok, "%var% . release ( )")) + if (Token::Match(tok, "%var% . release ( )")) return true; - if(Token::Match(tok, "%var% =")) + if (Token::Match(tok, "%var% =")) return false; } return false; @@ -581,7 +581,7 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken, tok = typeEndTok->linkAt(2); unsigned varid = typeEndTok->next()->varId(); - if(isPointerReleased(typeEndTok->tokAt(2), endToken, varid)) + if (isPointerReleased(typeEndTok->tokAt(2), endToken, varid)) continue; bool arrayDelete = false; diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index e47a3e8d8..4eb07bb17 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -1723,15 +1723,15 @@ static bool valueFlowForward(Token * const startToken, Token * const startToken1 = tok2->linkAt(1)->next(); bool vfresult = valueFlowForward(startToken1->next(), - startToken1->link(), - var, - varid, - truevalues, - constValue, - subFunction, - tokenlist, - errorLogger, - settings); + startToken1->link(), + var, + varid, + truevalues, + constValue, + subFunction, + tokenlist, + errorLogger, + settings); if (!condAlwaysFalse && isVariableChanged(startToken1, startToken1->link(), varid, var->isGlobal(), settings, tokenlist->isCPP())) { removeValues(values, truevalues); @@ -1751,15 +1751,15 @@ static bool valueFlowForward(Token * const startToken, Token * const startTokenElse = tok2->tokAt(2); vfresult = valueFlowForward(startTokenElse->next(), - startTokenElse->link(), - var, - varid, - falsevalues, - constValue, - subFunction, - tokenlist, - errorLogger, - settings); + startTokenElse->link(), + var, + varid, + falsevalues, + constValue, + subFunction, + tokenlist, + errorLogger, + settings); if (!condAlwaysTrue && isVariableChanged(startTokenElse, startTokenElse->link(), varid, var->isGlobal(), settings, tokenlist->isCPP())) { removeValues(values, falsevalues); diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index a8fb49666..322218606 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -1780,18 +1780,18 @@ private: } void array_index_negative3() { - check("int f(int i) {\n" - " int p[2] = {0, 0};\n" - " if(i >= 2)\n" - " return 0;\n" - " else if(i == 0)\n" - " return 0;\n" - " return p[i - 1];\n" - "}\n" - "void g(int i) {\n" - " if( i == 0 )\n" - " return f(i);\n" - "}"); + check("int f(int i) {\n" + " int p[2] = {0, 0};\n" + " if(i >= 2)\n" + " return 0;\n" + " else if(i == 0)\n" + " return 0;\n" + " return p[i - 1];\n" + "}\n" + "void g(int i) {\n" + " if( i == 0 )\n" + " return f(i);\n" + "}"); ASSERT_EQUALS("", errout.str()); }