astyle fix
This commit is contained in:
parent
be82d09003
commit
e0f416e52e
|
@ -18,7 +18,8 @@ void f(char k)
|
||||||
|
|
||||||
void possible_style()
|
void possible_style()
|
||||||
{
|
{
|
||||||
std::list<int>::iterator it;\n
|
std::list<int>::iterator it;
|
||||||
|
\n
|
||||||
for (it = ab.begin(); it != ab.end(); it++)\n
|
for (it = ab.begin(); it != ab.end(); it++)\n
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,29 +107,29 @@ std::string MathLib::calculate(const std::string &first, const std::string &seco
|
||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case '+':
|
case '+':
|
||||||
result = MathLib::add(first, second);
|
result = MathLib::add(first, second);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '-':
|
case '-':
|
||||||
result = MathLib::subtract(first, second);
|
result = MathLib::subtract(first, second);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '*':
|
case '*':
|
||||||
result = MathLib::multiply(first, second);
|
result = MathLib::multiply(first, second);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '/':
|
case '/':
|
||||||
result = MathLib::divide(first, second);
|
result = MathLib::divide(first, second);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
std::cout << "##### If you see this, there is a bug: "
|
std::cout << "##### If you see this, there is a bug: "
|
||||||
<< "MathLib::calculate() was called with unknown action '"
|
<< "MathLib::calculate() was called with unknown action '"
|
||||||
<< action
|
<< action
|
||||||
<< "' #####"
|
<< "' #####"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -2954,7 +2954,8 @@ bool Tokenizer::simplifyCalculations()
|
||||||
// evaluate "2 + 2 - 2 - 2"
|
// evaluate "2 + 2 - 2 - 2"
|
||||||
// as (((2 + 2) - 2) - 2) = 0
|
// as (((2 + 2) - 2) - 2) = 0
|
||||||
// instead of ((2 + 2) - (2 - 2)) = 4
|
// instead of ((2 + 2) - (2 - 2)) = 4
|
||||||
if (Token::Match(tok->next(), "[+-*/]")) {
|
if (Token::Match(tok->next(), "[+-*/]"))
|
||||||
|
{
|
||||||
tok = tok->tokAt(-2);
|
tok = tok->tokAt(-2);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue