From 2d08564c8ac8b5cbf33608dfe8e1aaf9ea28909f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 19 Jun 2021 14:47:35 +0200 Subject: [PATCH] astyle formatting --- cppcheck-errors.rng | 95 ----------------------------------------- lib/forwardanalyzer.cpp | 3 +- lib/forwardanalyzer.h | 6 +-- lib/programmemory.cpp | 3 +- lib/valueflow.cpp | 72 +++++++++++++++---------------- 5 files changed, 40 insertions(+), 139 deletions(-) delete mode 100644 cppcheck-errors.rng diff --git a/cppcheck-errors.rng b/cppcheck-errors.rng deleted file mode 100644 index ed20228c9..000000000 --- a/cppcheck-errors.rng +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - 2 - - - - - - [1-9]\.[0-9]+.* - - - - - - - - - - - - - - - - - - - - error - information - performance - portability - style - warning - - - - - - - - - - - - - - 0 - - - - - - - 1 - - - - - - - - - - - 0 - - - - - 0 - - - - - - - - - - - - - - - - - - - - diff --git a/lib/forwardanalyzer.cpp b/lib/forwardanalyzer.cpp index 617019ee1..b24069b55 100644 --- a/lib/forwardanalyzer.cpp +++ b/lib/forwardanalyzer.cpp @@ -25,8 +25,7 @@ struct ForwardTraversal { Analyzer::Terminate terminate = Analyzer::Terminate::None; bool forked = false; - Progress Break(Analyzer::Terminate t = Analyzer::Terminate::None) - { + Progress Break(Analyzer::Terminate t = Analyzer::Terminate::None) { if ((!analyzeOnly || analyzeTerminate) && t != Analyzer::Terminate::None) terminate = t; return Progress::Break; diff --git a/lib/forwardanalyzer.h b/lib/forwardanalyzer.h index c3aa58669..4263fe033 100644 --- a/lib/forwardanalyzer.h +++ b/lib/forwardanalyzer.h @@ -26,9 +26,9 @@ class Token; template class ValuePtr; Analyzer::Result valueFlowGenericForward(Token* start, - const Token* end, - const ValuePtr& a, - const Settings* settings); + const Token* end, + const ValuePtr& a, + const Settings* settings); Analyzer::Result valueFlowGenericForward(Token* start, const ValuePtr& a, const Settings* settings); diff --git a/lib/programmemory.cpp b/lib/programmemory.cpp index 5963c8313..807abd2b4 100644 --- a/lib/programmemory.cpp +++ b/lib/programmemory.cpp @@ -262,8 +262,7 @@ static void fillProgramMemoryFromAssignments(ProgramMemory& pm, const Token* tok continue; } tok2 = cond->astParent()->previous(); - } - else if (conditionIsTrue(cond, state)) { + } else if (conditionIsTrue(cond, state)) { if (inElse) tok2 = tok2->link()->tokAt(-2); ++indentlevel; diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 33e584e4b..dbf05d82b 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -1665,11 +1665,11 @@ static void valueFlowGlobalStaticVar(TokenList *tokenList, const Settings *setti } static Analyzer::Result valueFlowForwardVariable(Token* const startToken, - const Token* const endToken, - const Variable* const var, - std::list values, - TokenList* const tokenlist, - const Settings* const settings); + const Token* const endToken, + const Variable* const var, + std::list values, + TokenList* const tokenlist, + const Settings* const settings); static void valueFlowReverse(TokenList* tokenlist, Token* tok, @@ -2408,12 +2408,12 @@ static std::vector getAliasesFromValues(std::list values, - std::vector aliases, - TokenList* const tokenlist, - const Settings* const settings) + const Token* const endToken, + const Variable* const var, + std::list values, + std::vector aliases, + TokenList* const tokenlist, + const Settings* const settings) { Analyzer::Action actions; Analyzer::Terminate terminate = Analyzer::Terminate::None; @@ -2428,11 +2428,11 @@ static Analyzer::Result valueFlowForwardVariable(Token* const startToken, } static Analyzer::Result valueFlowForwardVariable(Token* const startToken, - const Token* const endToken, - const Variable* const var, - std::list values, - TokenList* const tokenlist, - const Settings* const settings) + const Token* const endToken, + const Variable* const var, + std::list values, + TokenList* const tokenlist, + const Settings* const settings) { auto aliases = getAliasesFromValues(values); return valueFlowForwardVariable( @@ -2532,11 +2532,11 @@ struct OppositeExpressionAnalyzer : ExpressionAnalyzer { }; static Analyzer::Result valueFlowForwardExpression(Token* startToken, - const Token* endToken, - const Token* exprTok, - const std::list& values, - const TokenList* const tokenlist, - const Settings* settings) + const Token* endToken, + const Token* exprTok, + const std::list& values, + const TokenList* const tokenlist, + const Settings* settings) { Analyzer::Action actions; Analyzer::Terminate terminate = Analyzer::Terminate::None; @@ -2623,11 +2623,11 @@ ValuePtr makeAnalyzer(Token* exprTok, const ValueFlow::Value& value, c } static Analyzer::Result valueFlowForward(Token* startToken, - const Token* endToken, - const Token* exprTok, - std::list values, - TokenList* const tokenlist, - const Settings* settings) + const Token* endToken, + const Token* exprTok, + std::list values, + TokenList* const tokenlist, + const Settings* settings) { const Token* expr = solveExprValues(exprTok, values); if (expr->variable()) { @@ -4733,8 +4733,7 @@ struct SimpleConditionHandler : ConditionHandler { const Token* exprTok, const std::list& values, TokenList* tokenlist, - const Settings* settings) const OVERRIDE - { + const Settings* settings) const OVERRIDE { return valueFlowForward(start->next(), stop, exprTok, values, tokenlist, settings); } @@ -6094,18 +6093,18 @@ struct ContainerVariableAnalyzer : VariableAnalyzer { }; static Analyzer::Result valueFlowContainerForward(Token* tok, - const Token* endToken, - const Variable* var, - ValueFlow::Value value, - TokenList* tokenlist) + const Token* endToken, + const Variable* var, + ValueFlow::Value value, + TokenList* tokenlist) { ContainerVariableAnalyzer a(var, value, getAliasesFromValues({value}), tokenlist); return valueFlowGenericForward(tok, endToken, a, tokenlist->getSettings()); } static Analyzer::Result valueFlowContainerForward(Token* tok, - const Variable* var, - ValueFlow::Value value, - TokenList* tokenlist) + const Variable* var, + ValueFlow::Value value, + TokenList* tokenlist) { const Token * endOfVarScope = nullptr; if (var->isLocal() || var->isArgument()) @@ -6523,8 +6522,7 @@ struct ContainerConditionHandler : ConditionHandler { const Token* exprTok, const std::list& values, TokenList* tokenlist, - const Settings*) const OVERRIDE - { + const Settings*) const OVERRIDE { // TODO: Forward multiple values if (values.empty()) return {};