Cleanup variable names

* fix typo
* use camelCase instead of underscore
This commit is contained in:
Dmitry-Me 2016-08-01 14:33:56 +03:00
parent 1c51fbce7a
commit b3877a8ba0
1 changed files with 7 additions and 7 deletions

View File

@ -185,28 +185,28 @@ bool isSameExpression(bool cpp, bool macro, const Token *tok1, const Token *tok2
if (!t1 || !t2 || t1->str() != ")" || t2->str() != ")") if (!t1 || !t2 || t1->str() != ")" || t2->str() != ")")
return false; return false;
} }
bool noncommuative_equals = bool noncommutativeEquals =
isSameExpression(cpp, macro, tok1->astOperand1(), tok2->astOperand1(), constFunctions); isSameExpression(cpp, macro, tok1->astOperand1(), tok2->astOperand1(), constFunctions);
noncommuative_equals = noncommuative_equals && noncommutativeEquals = noncommutativeEquals &&
isSameExpression(cpp, macro, tok1->astOperand2(), tok2->astOperand2(), constFunctions); isSameExpression(cpp, macro, tok1->astOperand2(), tok2->astOperand2(), constFunctions);
if (noncommuative_equals) if (noncommutativeEquals)
return true; return true;
const bool commutative = tok1->astOperand1() && tok1->astOperand2() && Token::Match(tok1, "%or%|%oror%|+|*|&|&&|^|==|!="); const bool commutative = tok1->astOperand1() && tok1->astOperand2() && Token::Match(tok1, "%or%|%oror%|+|*|&|&&|^|==|!=");
bool commuative_equals = commutative && bool commutativeEquals = commutative &&
isSameExpression(cpp, macro, tok1->astOperand2(), tok2->astOperand1(), constFunctions); isSameExpression(cpp, macro, tok1->astOperand2(), tok2->astOperand1(), constFunctions);
commuative_equals = commuative_equals && commutativeEquals = commutativeEquals &&
isSameExpression(cpp, macro, tok1->astOperand1(), tok2->astOperand2(), constFunctions); isSameExpression(cpp, macro, tok1->astOperand1(), tok2->astOperand2(), constFunctions);
// in c++, "a"+b might be different to b+"a" // in c++, "a"+b might be different to b+"a"
if (cpp && commuative_equals && tok1->str() == "+" && if (cpp && commutativeEquals && tok1->str() == "+" &&
(tok1->astOperand1()->tokType() == Token::eString || tok1->astOperand2()->tokType() == Token::eString)) { (tok1->astOperand1()->tokType() == Token::eString || tok1->astOperand2()->tokType() == Token::eString)) {
const Token * const other = tok1->astOperand1()->tokType() != Token::eString ? tok1->astOperand1() : tok1->astOperand2(); const Token * const other = tok1->astOperand1()->tokType() != Token::eString ? tok1->astOperand1() : tok1->astOperand2();
return other && astIsIntegral(other,false); return other && astIsIntegral(other,false);
} }
return commuative_equals; return commutativeEquals;
} }
bool isOppositeCond(bool isNot, bool cpp, const Token * const cond1, const Token * const cond2, const std::set<std::string> &constFunctions) bool isOppositeCond(bool isNot, bool cpp, const Token * const cond1, const Token * const cond2, const std::set<std::string> &constFunctions)