diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 789399262..1150b0d75 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -10427,14 +10427,14 @@ void Tokenizer::simplifyMathExpressions() Token * const tok2 = tok->linkAt(3); if (!Token::Match(tok2, ") , %num% ) + pow|powf|powl ( cos|cosf|cosl (")) continue; - const std::string leftExponent = tok2->strAt(2); + std::string leftExponent = tok2->strAt(2); if (!isTwoNumber(leftExponent)) continue; // left exponent is not 2 Token * const tok3 = tok2->tokAt(8); if (!Token::Match(tok3->link(), ") , %num% )")) continue; Token * const tok4 = tok3->link(); - const std::string rightExponent = tok4->strAt(2); + std::string rightExponent = tok4->strAt(2); if (!isTwoNumber(rightExponent)) continue; // right exponent is not 2 if (tok->tokAt(3)->stringifyList(tok2->next()) == tok3->stringifyList(tok3->link()->next())) { @@ -10445,14 +10445,14 @@ void Tokenizer::simplifyMathExpressions() Token * const tok2 = tok->linkAt(3); if (!Token::Match(tok2, ") , %num% ) + pow|powf|powl ( sin|sinf|sinl (")) continue; - const std::string leftExponent = tok2->strAt(2); + std::string leftExponent = tok2->strAt(2); if (!isTwoNumber(leftExponent)) continue; // left exponent is not 2 Token * const tok3 = tok2->tokAt(8); if (!Token::Match(tok3->link(), ") , %num% )")) continue; Token * const tok4 = tok3->link(); - const std::string rightExponent = tok4->strAt(2); + std::string rightExponent = tok4->strAt(2); if (!isTwoNumber(rightExponent)) continue; // right exponent is not 2 if (tok->tokAt(3)->stringifyList(tok2->next()) == tok3->stringifyList(tok3->link()->next())) { @@ -10463,14 +10463,14 @@ void Tokenizer::simplifyMathExpressions() Token * const tok2 = tok->linkAt(3); if (!Token::Match(tok2, ") , %num% ) - pow|powf|powl ( cosh|coshf|coshl (")) continue; - const std::string leftExponent = tok2->strAt(2); + std::string leftExponent = tok2->strAt(2); if (!isTwoNumber(leftExponent)) continue; // left exponent is not 2 Token * const tok3 = tok2->tokAt(8); if (!Token::Match(tok3->link(), ") , %num% )")) continue; Token * const tok4 = tok3->link(); - const std::string rightExponent = tok4->strAt(2); + std::string rightExponent = tok4->strAt(2); if (!isTwoNumber(rightExponent)) continue; // right exponent is not 2 if (tok->tokAt(3)->stringifyList(tok2->next()) == tok3->stringifyList(tok3->link()->next())) { @@ -10481,14 +10481,14 @@ void Tokenizer::simplifyMathExpressions() Token * const tok2 = tok->linkAt(3); if (!Token::Match(tok2, ") , %num% ) - pow|powf|powl ( sinh|sinhf|sinhl (")) continue; - const std::string leftExponent = tok2->strAt(2); + std::string leftExponent = tok2->strAt(2); if (!isTwoNumber(leftExponent)) continue; // left exponent is not 2 Token * const tok3 = tok2->tokAt(8); if (!Token::Match(tok3->link(), ") , %num% )")) continue; Token * const tok4 = tok3->link(); - const std::string rightExponent = tok4->strAt(2); + std::string rightExponent = tok4->strAt(2); if (!isTwoNumber(rightExponent)) continue; // right exponent is not 2 if (tok->tokAt(3)->stringifyList(tok2->next()) == tok3->stringifyList(tok3->link()->next())) {