Skip to content

Commit 2bb7384

Browse files
committed
astyle formatting
1 parent ac846b9 commit 2bb7384

8 files changed

Lines changed: 17 additions & 15 deletions

File tree

lib/checkstl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ void CheckStl::invalidContainer()
857857
if (skipVarIds.count(info.tok->varId()) > 0)
858858
return false;
859859
// if (Token::simpleMatch(info.tok->next(), "."))
860-
// return false;
860+
// return false;
861861
if (Token::Match(info.tok->astParent(), "%assign%") && astIsLHS(info.tok))
862862
skipVarIds.insert(info.tok->varId());
863863
if (info.tok->variable()->isReference() &&
@@ -2024,7 +2024,7 @@ void CheckStl::checkDereferenceInvalidIterator2()
20242024
}
20252025

20262026
// Can iterator point to END or before START?
2027-
for(const ValueFlow::Value& value:tok->values()) {
2027+
for (const ValueFlow::Value& value:tok->values()) {
20282028
if (!printInconclusive && value.isInconclusive())
20292029
continue;
20302030
if (!value.isIteratorValue())
@@ -2488,7 +2488,7 @@ void CheckStl::knownEmptyContainerLoop()
24882488
const Token* contTok = splitTok->astOperand2();
24892489
if (!contTok)
24902490
continue;
2491-
for(const ValueFlow::Value& v:contTok->values()) {
2491+
for (const ValueFlow::Value& v:contTok->values()) {
24922492
if (!v.isKnown())
24932493
continue;
24942494
if (!v.isContainerSizeValue())

lib/checkstl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class CPPCHECKLIB CheckStl : public Check {
189189

190190
/** @brief Look for loops that can replaced with std algorithms */
191191
void useStlAlgorithm();
192-
192+
193193
void knownEmptyContainerLoop();
194194

195195
void checkMutexes();

lib/programmemory.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,7 @@ void execute(const Token *expr,
542542
*result = 0;
543543
else
544544
*error = true;
545-
}
546-
else if (Token::Match(expr->tokAt(-3), "%var% . %name% (")) {
545+
} else if (Token::Match(expr->tokAt(-3), "%var% . %name% (")) {
547546
const Token* containerTok = expr->tokAt(-3);
548547
if (astIsContainer(containerTok)) {
549548
Library::Container::Yield yield = containerTok->valueType()->container->getYield(expr->strAt(-1));

lib/symboldatabase.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,10 +1452,10 @@ void SymbolDatabase::createSymbolDatabaseExprIds()
14521452
}
14531453

14541454
// Apply CSE
1455-
for(const auto& p:exprs) {
1455+
for (const auto& p:exprs) {
14561456
const std::vector<Token*>& tokens = p.second;
1457-
for(Token* tok1:tokens) {
1458-
for(Token* tok2:tokens) {
1457+
for (Token* tok1:tokens) {
1458+
for (Token* tok2:tokens) {
14591459
if (tok1 == tok2)
14601460
continue;
14611461
if (tok1->exprId() == tok2->exprId())

lib/tokenlist.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,7 @@ static Token * skipDecl(Token *tok)
484484
return tok;
485485
} else if (Token::Match(vartok, "%var% [:=(]")) {
486486
return vartok;
487-
}
488-
else if (Token::simpleMatch(vartok, "decltype (")) {
487+
} else if (Token::simpleMatch(vartok, "decltype (")) {
489488
return vartok->linkAt(1)->next();
490489
}
491490
vartok = vartok->next();

lib/valueflow.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5649,8 +5649,10 @@ struct ContainerVariableForwardAnalyzer : VariableForwardAnalyzer {
56495649
if (rhs->tokType() == Token::eString)
56505650
return Action::Read | Action::Write;
56515651
if (rhs->valueType() && rhs->valueType()->container && rhs->valueType()->container->stdStringLike) {
5652-
if (std::any_of(rhs->values().begin(), rhs->values().end(), [&](const ValueFlow::Value &rhsval) { return rhsval.isKnown() && rhsval.isContainerSizeValue(); }))
5653-
return Action::Read | Action::Write;
5652+
if (std::any_of(rhs->values().begin(), rhs->values().end(), [&](const ValueFlow::Value &rhsval) {
5653+
return rhsval.isKnown() && rhsval.isContainerSizeValue();
5654+
}))
5655+
return Action::Read | Action::Write;
56545656
}
56555657
} else if (Token::Match(tok, "%name% . %name% (")) {
56565658
Library::Container::Action action = tok->valueType()->container->getAction(tok->strAt(2));

test/testvalueflow.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ class TestValueFlow : public TestFixture {
326326

327327
std::list<ValueFlow::Value> tokenValues(const char code[], const char tokstr[], ValueFlow::Value::ValueType vt, const Settings *s = nullptr) {
328328
std::list<ValueFlow::Value> values = tokenValues(code, tokstr, s);
329-
values.remove_if([&](const ValueFlow::Value& v) { return v.valueType != vt; });
329+
values.remove_if([&](const ValueFlow::Value& v) {
330+
return v.valueType != vt;
331+
});
330332
return values;
331333
}
332334

test/testvarid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class TestVarID : public TestFixture {
202202
TEST_CASE(setVarIdStructMembers1);
203203

204204
TEST_CASE(decltype1);
205-
205+
206206
TEST_CASE(exprid1);
207207
}
208208

0 commit comments

Comments
 (0)