Skip to content

Commit 37e6b81

Browse files
committed
Format
1 parent 2ba733a commit 37e6b81

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

lib/astutils.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,10 @@ bool isStlStringType(const Token* tok)
429429
(Token::simpleMatch(tok, "std :: basic_string <") && !Token::simpleMatch(tok->linkAt(3), "> ::"));
430430
}
431431

432-
bool isVoidCast(const Token *tok)
432+
bool isVoidCast(const Token* tok)
433433
{
434-
return Token::simpleMatch(tok, "(") && tok->isCast() && tok->valueType() && tok->valueType()->type == ValueType::Type::VOID && tok->valueType()->pointer == 0;
434+
return Token::simpleMatch(tok, "(") && tok->isCast() && tok->valueType() &&
435+
tok->valueType()->type == ValueType::Type::VOID && tok->valueType()->pointer == 0;
435436
}
436437

437438
bool isTemporary(const Token* tok, const Library* library, bool unknown)

lib/astutils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const Token * astIsVariableComparison(const Token *tok, const std::string &comp,
188188
bool isVariableDecl(const Token* tok);
189189
bool isStlStringType(const Token* tok);
190190

191-
bool isVoidCast(const Token *tok);
191+
bool isVoidCast(const Token* tok);
192192

193193
bool isTemporary(const Token* tok, const Library* library, bool unknown = false);
194194

lib/checkother.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,14 +1643,14 @@ static bool isVariableMutableInInitializer(const Token* start, const Token * end
16431643

16441644
static bool isCastToVoid(const Variable* var)
16451645
{
1646-
if(!var)
1646+
if (!var)
16471647
return false;
1648-
if(!var->scope())
1648+
if (!var->scope())
16491649
return false;
1650-
for (const Token *tok = var->scope()->bodyStart; tok != var->scope()->bodyEnd; tok = tok->next()) {
1651-
if(tok->varId() != var->declarationId())
1650+
for (const Token* tok = var->scope()->bodyStart; tok != var->scope()->bodyEnd; tok = tok->next()) {
1651+
if (tok->varId() != var->declarationId())
16521652
continue;
1653-
if(isVoidCast(tok->astParent()))
1653+
if (isVoidCast(tok->astParent()))
16541654
return true;
16551655
}
16561656
return false;

test/testother.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12164,8 +12164,7 @@ class TestOther : public TestFixture {
1216412164
" for (auto &j : g(std::move(l))) { (void)j; }\n"
1216512165
" }\n"
1216612166
"}\n");
12167-
ASSERT_EQUALS("[test.cpp:4:36]: (warning) Access of moved variable 'l'. [accessMoved]\n",
12168-
errout_str());
12167+
ASSERT_EQUALS("[test.cpp:4:36]: (warning) Access of moved variable 'l'. [accessMoved]\n", errout_str());
1216912168
}
1217012169

1217112170
void moveCallback()

0 commit comments

Comments
 (0)