From e65a5529ad74bff6bf7682ab338cb3dd5f1d7ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 24 Mar 2018 12:30:11 +0100 Subject: [PATCH] astyle formatting [ci skip] --- lib/astutils.cpp | 10 +++++----- lib/library.cpp | 11 +++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/astutils.cpp b/lib/astutils.cpp index 0bb104994..a70ce74bc 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -266,18 +266,18 @@ bool isOppositeCond(bool isNot, bool cpp, const Token * const cond1, const Token if (cond2->str() == "!") return isOppositeCond(isNot, cpp, cond2, cond1, library, pure); - if(!isNot) { + if (!isNot) { if (cond1->str() == "==" && cond2->str() == "==") { - if(isSameExpression(cpp, true, cond1->astOperand1(), cond2->astOperand1(), library, pure)) + if (isSameExpression(cpp, true, cond1->astOperand1(), cond2->astOperand1(), library, pure)) return isDifferentKnownValues(cond1->astOperand2(), cond2->astOperand2()); - if(isSameExpression(cpp, true, cond1->astOperand2(), cond2->astOperand2(), library, pure)) + if (isSameExpression(cpp, true, cond1->astOperand2(), cond2->astOperand2(), library, pure)) return isDifferentKnownValues(cond1->astOperand1(), cond2->astOperand1()); } - if(Library::isContainerYield(cond1, Library::Container::EMPTY, "empty") && Library::isContainerYield(cond2->astOperand1(), Library::Container::SIZE, "size")) { + if (Library::isContainerYield(cond1, Library::Container::EMPTY, "empty") && Library::isContainerYield(cond2->astOperand1(), Library::Container::SIZE, "size")) { return !(cond2->str() == "==" && cond2->astOperand2()->getValue(0)); } - if(Library::isContainerYield(cond2, Library::Container::EMPTY, "empty") && Library::isContainerYield(cond1->astOperand1(), Library::Container::SIZE, "size")) { + if (Library::isContainerYield(cond2, Library::Container::EMPTY, "empty") && Library::isContainerYield(cond1->astOperand1(), Library::Container::SIZE, "size")) { return !(cond1->str() == "==" && cond1->astOperand2()->getValue(0)); } } diff --git a/lib/library.cpp b/lib/library.cpp index 7eccee4b6..4c17bad9c 100644 --- a/lib/library.cpp +++ b/lib/library.cpp @@ -923,17 +923,16 @@ const Library::Container* Library::detectContainer(const Token* typeStart, bool bool Library::isContainerYield(const Token * const cond, Library::Container::Yield y, const std::string& fallback) { - if(!cond) + if (!cond) return false; if (cond->str() == "(") { const Token* tok = cond->astOperand1(); - if(tok && tok->str() == ".") { - if(tok->astOperand1() && tok->astOperand1()->valueType()) { - if(const Library::Container *container = tok->astOperand1()->valueType()->container) { + if (tok && tok->str() == ".") { + if (tok->astOperand1() && tok->astOperand1()->valueType()) { + if (const Library::Container *container = tok->astOperand1()->valueType()->container) { return tok->astOperand2() && y == container->getYield(tok->astOperand2()->str()); } - } - else if(!fallback.empty()) { + } else if (!fallback.empty()) { return Token::simpleMatch(cond, "( )") && cond->previous()->str() == fallback; } }