From 25ad22c6afa4c33fccfabc342edee2c49ee9f6d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 23 Jul 2020 10:09:06 +0200 Subject: [PATCH] astyle formatting [ci skip] --- lib/astutils.cpp | 2 +- lib/ctu.cpp | 2 +- lib/valueflow.cpp | 10 ++++++---- test/teststl.cpp | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/astutils.cpp b/lib/astutils.cpp index c2a3403fb..fe151102b 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -1443,7 +1443,7 @@ bool isVariableChanged(const Token *tok, int indirect, const Settings *settings, return false; const Token *tok2 = tok; int derefs = 0; - while (Token::simpleMatch(tok2->astParent(), "*") || + while (Token::simpleMatch(tok2->astParent(), "*") || (Token::simpleMatch(tok2->astParent(), ".") && !Token::simpleMatch(tok2->astParent()->astParent(), "(")) || (Token::simpleMatch(tok2->astParent(), "[") && tok2 == tok2->astParent()->astOperand1())) { if (Token::simpleMatch(tok2->astParent(), "*") || tok2->astParent()->originalName() == "->") diff --git a/lib/ctu.cpp b/lib/ctu.cpp index fa9ffda39..e3bbaa9fe 100644 --- a/lib/ctu.cpp +++ b/lib/ctu.cpp @@ -425,7 +425,7 @@ static std::list> getUnsafeFunction(co if (Token::findmatch(tok2->link(), "return|throw", tok2)) return ret; int indirect = 0; - if(argvar->valueType()) + if (argvar->valueType()) indirect = argvar->valueType()->pointer; if (isVariableChanged(tok2->link(), tok2, indirect, argvar->declarationId(), false, settings, tokenizer->isCPP())) return ret; diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 031e9aa28..33261c295 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -2490,7 +2490,9 @@ struct SingleValueFlowForwardAnalyzer : ValueFlowForwardAnalyzer { virtual bool isAlias(const Token* tok) const OVERRIDE { if (value.isLifetimeValue()) return false; - for(const auto& m:{std::ref(getVars()), std::ref(getAliasedVars())}) { + for (const auto& m: { + std::ref(getVars()), std::ref(getAliasedVars()) + }) { for (const auto& p:m.get()) { nonneg int varid = p.first; const Variable* var = p.second; @@ -2567,7 +2569,7 @@ struct VariableForwardAnalyzer : SingleValueFlowForwardAnalyzer { VariableForwardAnalyzer(const Variable* v, const ValueFlow::Value& val, std::vector paliases, const TokenList* t) : SingleValueFlowForwardAnalyzer(val, t), var(v) { varids[var->declarationId()] = var; - for(const Variable* av:paliases) { + for (const Variable* av:paliases) { if (!av) continue; aliases[av->declarationId()] = av; @@ -2616,10 +2618,10 @@ static bool valueFlowForwardVariable(Token* const startToken, { std::vector aliases; for (const ValueFlow::Value& v : values) { - if (!v.tokvalue) + if (!v.tokvalue) continue; const Token* lifeTok = nullptr; - for(const ValueFlow::Value& lv:v.tokvalue->values()) { + for (const ValueFlow::Value& lv:v.tokvalue->values()) { if (!lv.isLocalLifetimeValue()) continue; if (lifeTok) { diff --git a/test/teststl.cpp b/test/teststl.cpp index e00595055..eeed041b1 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -4174,7 +4174,7 @@ private: " A *b = v.back();\n" " v.pop_back();\n" " delete b;\n" - "}\n" ,true); + "}\n",true); ASSERT_EQUALS("", errout.str()); check("struct A {};\n" @@ -4185,7 +4185,7 @@ private: " A *b = v.back();\n" " v.pop_back();\n" " delete b;\n" - "}\n" ,true); + "}\n",true); ASSERT_EQUALS("", errout.str()); check("struct A {};\n" @@ -4196,7 +4196,7 @@ private: " std::shared_ptr b = v.back();\n" " v.pop_back();\n" " delete b;\n" - "}\n" ,true); + "}\n",true); ASSERT_EQUALS("", errout.str()); }