astyle formatting

This commit is contained in:
Daniel Marjamäki 2020-08-23 17:17:33 +02:00
parent ac846b96d1
commit 2bb73840fc
8 changed files with 17 additions and 15 deletions

View File

@ -542,8 +542,7 @@ void execute(const Token *expr,
*result = 0; *result = 0;
else else
*error = true; *error = true;
} } else if (Token::Match(expr->tokAt(-3), "%var% . %name% (")) {
else if (Token::Match(expr->tokAt(-3), "%var% . %name% (")) {
const Token* containerTok = expr->tokAt(-3); const Token* containerTok = expr->tokAt(-3);
if (astIsContainer(containerTok)) { if (astIsContainer(containerTok)) {
Library::Container::Yield yield = containerTok->valueType()->container->getYield(expr->strAt(-1)); Library::Container::Yield yield = containerTok->valueType()->container->getYield(expr->strAt(-1));

View File

@ -484,8 +484,7 @@ static Token * skipDecl(Token *tok)
return tok; return tok;
} else if (Token::Match(vartok, "%var% [:=(]")) { } else if (Token::Match(vartok, "%var% [:=(]")) {
return vartok; return vartok;
} } else if (Token::simpleMatch(vartok, "decltype (")) {
else if (Token::simpleMatch(vartok, "decltype (")) {
return vartok->linkAt(1)->next(); return vartok->linkAt(1)->next();
} }
vartok = vartok->next(); vartok = vartok->next();

View File

@ -5649,7 +5649,9 @@ struct ContainerVariableForwardAnalyzer : VariableForwardAnalyzer {
if (rhs->tokType() == Token::eString) if (rhs->tokType() == Token::eString)
return Action::Read | Action::Write; return Action::Read | Action::Write;
if (rhs->valueType() && rhs->valueType()->container && rhs->valueType()->container->stdStringLike) { if (rhs->valueType() && rhs->valueType()->container && rhs->valueType()->container->stdStringLike) {
if (std::any_of(rhs->values().begin(), rhs->values().end(), [&](const ValueFlow::Value &rhsval) { return rhsval.isKnown() && rhsval.isContainerSizeValue(); })) if (std::any_of(rhs->values().begin(), rhs->values().end(), [&](const ValueFlow::Value &rhsval) {
return rhsval.isKnown() && rhsval.isContainerSizeValue();
}))
return Action::Read | Action::Write; return Action::Read | Action::Write;
} }
} else if (Token::Match(tok, "%name% . %name% (")) { } else if (Token::Match(tok, "%name% . %name% (")) {

View File

@ -326,7 +326,9 @@ private:
std::list<ValueFlow::Value> tokenValues(const char code[], const char tokstr[], ValueFlow::Value::ValueType vt, const Settings *s = nullptr) { std::list<ValueFlow::Value> tokenValues(const char code[], const char tokstr[], ValueFlow::Value::ValueType vt, const Settings *s = nullptr) {
std::list<ValueFlow::Value> values = tokenValues(code, tokstr, s); std::list<ValueFlow::Value> values = tokenValues(code, tokstr, s);
values.remove_if([&](const ValueFlow::Value& v) { return v.valueType != vt; }); values.remove_if([&](const ValueFlow::Value& v) {
return v.valueType != vt;
});
return values; return values;
} }