From e0f416e52ef76eaee2b476e390a55ba2f150b27a Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Sun, 2 Aug 2009 22:11:17 +0300 Subject: [PATCH] astyle fix --- gui/test.cpp | 3 ++- src/mathlib.cpp | 38 +++++++++++++++++++------------------- src/tokenize.cpp | 3 ++- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/gui/test.cpp b/gui/test.cpp index aea81c240..bda964a60 100644 --- a/gui/test.cpp +++ b/gui/test.cpp @@ -18,7 +18,8 @@ void f(char k) void possible_style() { - std::list::iterator it;\n + std::list::iterator it; + \n for (it = ab.begin(); it != ab.end(); it++)\n ; } diff --git a/src/mathlib.cpp b/src/mathlib.cpp index 0fef8caba..2a61f734e 100644 --- a/src/mathlib.cpp +++ b/src/mathlib.cpp @@ -107,29 +107,29 @@ std::string MathLib::calculate(const std::string &first, const std::string &seco switch (action) { - case '+': - result = MathLib::add(first, second); - break; + case '+': + result = MathLib::add(first, second); + break; - case '-': - result = MathLib::subtract(first, second); - break; + case '-': + result = MathLib::subtract(first, second); + break; - case '*': - result = MathLib::multiply(first, second); - break; + case '*': + result = MathLib::multiply(first, second); + break; - case '/': - result = MathLib::divide(first, second); - break; + case '/': + result = MathLib::divide(first, second); + break; - default: - std::cout << "##### If you see this, there is a bug: " - << "MathLib::calculate() was called with unknown action '" - << action - << "' #####" - << std::endl; - break; + default: + std::cout << "##### If you see this, there is a bug: " + << "MathLib::calculate() was called with unknown action '" + << action + << "' #####" + << std::endl; + break; } return result; diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 7003d51f2..ac7d08ad3 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -2954,7 +2954,8 @@ bool Tokenizer::simplifyCalculations() // evaluate "2 + 2 - 2 - 2" // as (((2 + 2) - 2) - 2) = 0 // instead of ((2 + 2) - (2 - 2)) = 4 - if (Token::Match(tok->next(), "[+-*/]")) { + if (Token::Match(tok->next(), "[+-*/]")) + { tok = tok->tokAt(-2); continue; }