astyle formatting

This commit is contained in:
Daniel Marjamäki 2020-11-28 05:52:35 +01:00
parent 01df6e23ef
commit 484b68c550
3 changed files with 11 additions and 12 deletions

View File

@ -1518,7 +1518,7 @@ bool CheckUnusedVar::isRecordTypeWithoutSideEffects(const Type* type)
} }
const Function* initValueFunc = valueToken->function(); const Function* initValueFunc = valueToken->function();
if (initValueFunc && !isFunctionWithoutSideEffects(*initValueFunc, valueToken, if (initValueFunc && !isFunctionWithoutSideEffects(*initValueFunc, valueToken,
std::list<const Function*>{})) { std::list<const Function*> {})) {
return withoutSideEffects = false; return withoutSideEffects = false;
} }
} }
@ -1594,7 +1594,8 @@ bool CheckUnusedVar::isEmptyType(const Type* type)
} }
bool CheckUnusedVar::isFunctionWithoutSideEffects(const Function& func, const Token* functionUsageToken, bool CheckUnusedVar::isFunctionWithoutSideEffects(const Function& func, const Token* functionUsageToken,
std::list<const Function*> checkedFuncs) { std::list<const Function*> checkedFuncs)
{
// no body to analyze // no body to analyze
if (!func.hasBody()) { if (!func.hasBody()) {
return false; return false;
@ -1609,8 +1610,7 @@ bool CheckUnusedVar::isFunctionWithoutSideEffects(const Function& func, const To
bool sideEffectReturnFound = false; bool sideEffectReturnFound = false;
for (Token* bodyToken = func.functionScope->bodyStart->next(); bodyToken != func.functionScope->bodyEnd; for (Token* bodyToken = func.functionScope->bodyStart->next(); bodyToken != func.functionScope->bodyEnd;
bodyToken = bodyToken->next()) bodyToken = bodyToken->next()) {
{
const Variable* bodyVariable = bodyToken->variable(); const Variable* bodyVariable = bodyToken->variable();
if (bodyVariable) { if (bodyVariable) {
// check variable for side-effects // check variable for side-effects

View File

@ -515,8 +515,7 @@ private:
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }
void cleanFunction() void cleanFunction() {
{
// unknown function // unknown function
functionVariableUsage( functionVariableUsage(
"class F {\n" "class F {\n"