astyle formatting

This commit is contained in:
Daniel Marjamäki 2020-08-28 19:29:33 +02:00
parent 6ab3c93fb1
commit 18c29544eb
2 changed files with 12 additions and 8 deletions

View File

@ -4147,15 +4147,19 @@ static void valueFlowAfterAssign(TokenList *tokenlist, SymbolDatabase* symboldat
// Remove known values // Remove known values
std::set<ValueFlow::Value::ValueType> types; std::set<ValueFlow::Value::ValueType> types;
if (tok->astOperand1()->hasKnownValue()) { if (tok->astOperand1()->hasKnownValue()) {
for(const ValueFlow::Value& value:tok->astOperand1()->values()) { for (const ValueFlow::Value& value:tok->astOperand1()->values()) {
if (value.isKnown()) if (value.isKnown())
types.insert(value.valueType); types.insert(value.valueType);
} }
} }
values.remove_if([&](const ValueFlow::Value& value) { return types.count(value.valueType) > 0;}); values.remove_if([&](const ValueFlow::Value& value) {
return types.count(value.valueType) > 0;
});
// Remove container size if its not a container // Remove container size if its not a container
if (!astIsContainer(tok->astOperand2())) if (!astIsContainer(tok->astOperand2()))
values.remove_if([&](const ValueFlow::Value& value) { return value.valueType == ValueFlow::Value::CONTAINER_SIZE;}); values.remove_if([&](const ValueFlow::Value& value) {
return value.valueType == ValueFlow::Value::CONTAINER_SIZE;
});
if (values.empty()) if (values.empty())
continue; continue;
const bool constValue = isLiteralNumber(tok->astOperand2(), tokenlist->isCPP()); const bool constValue = isLiteralNumber(tok->astOperand2(), tokenlist->isCPP());
@ -5948,9 +5952,9 @@ static std::list<ValueFlow::Value> getIteratorValues(std::list<ValueFlow::Value>
} }
static void valueFlowIteratorAfterCondition(TokenList *tokenlist, static void valueFlowIteratorAfterCondition(TokenList *tokenlist,
SymbolDatabase *symboldatabase, SymbolDatabase *symboldatabase,
ErrorLogger *errorLogger, ErrorLogger *errorLogger,
const Settings *settings) const Settings *settings)
{ {
ValueFlowConditionHandler handler; ValueFlowConditionHandler handler;
handler.forward = [&](Token* start, handler.forward = [&](Token* start,
@ -5980,7 +5984,7 @@ static void valueFlowIteratorAfterCondition(TokenList *tokenlist,
if (!values.empty()) if (!values.empty())
cond.vartok = tok->astOperand1(); cond.vartok = tok->astOperand1();
} }
for(ValueFlow::Value& v:values) { for (ValueFlow::Value& v:values) {
v.setPossible(); v.setPossible();
v.assumeCondition(tok); v.assumeCondition(tok);
} }