Skip to content

Commit 5156450

Browse files
committed
astyle formatting
1 parent b2691bd commit 5156450

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

lib/tokenize.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9928,9 +9928,9 @@ static bool isAlignAttribute(const Token * tok)
99289928

99299929
static const Token* skipCPPOrAlignAttribute(const Token * tok)
99309930
{
9931-
if(isCPPAttribute(tok)) {
9931+
if (isCPPAttribute(tok)) {
99329932
return tok->link();
9933-
}else if(isAlignAttribute(tok)) {
9933+
} else if (isAlignAttribute(tok)) {
99349934
return tok->next()->link();
99359935
}
99369936
return tok;
@@ -10199,7 +10199,7 @@ void Tokenizer::findGarbageCode() const
1019910199
continue;
1020010200
}
1020110201
// skip C++ attributes [[...]]
10202-
if (isCPP11 && (isCPPAttribute(tok) || isAlignAttribute(tok)) ) {
10202+
if (isCPP11 && (isCPPAttribute(tok) || isAlignAttribute(tok))) {
1020310203
tok = skipCPPOrAlignAttribute(tok);
1020410204
continue;
1020510205
}
@@ -10842,10 +10842,10 @@ void Tokenizer::simplifyCPPAttribute()
1084210842
return;
1084310843

1084410844
for (Token *tok = list.front(); tok; tok = tok->next()) {
10845-
if (!isCPPAttribute(tok) && !isAlignAttribute(tok)){
10845+
if (!isCPPAttribute(tok) && !isAlignAttribute(tok)) {
1084610846
continue;
1084710847
}
10848-
if(isCPPAttribute(tok)){
10848+
if (isCPPAttribute(tok)) {
1084910849
if (Token::findsimplematch(tok->tokAt(2), "noreturn", tok->link())) {
1085010850
const Token * head = skipCPPOrAlignAttribute(tok);
1085110851
while (isCPPAttribute(head) || isAlignAttribute(head))
@@ -10854,7 +10854,7 @@ void Tokenizer::simplifyCPPAttribute()
1085410854
while (Token::Match(head, "%name%|::|*|&|<|>|,")) // skip return type
1085510855
head = head->next();
1085610856
if (head && head->str() == "(" && isFunctionHead(head, "{|;")) {
10857-
head->previous()->isAttributeNoreturn(true);
10857+
head->previous()->isAttributeNoreturn(true);
1085810858
}
1085910859
} else if (Token::findsimplematch(tok->tokAt(2), "nodiscard", tok->link())) {
1086010860
const Token * head = skipCPPOrAlignAttribute(tok);
@@ -10864,7 +10864,7 @@ void Tokenizer::simplifyCPPAttribute()
1086410864
while (Token::Match(head, "%name%|::|*|&|<|>|,"))
1086510865
head = head->next();
1086610866
if (head && head->str() == "(" && isFunctionHead(head, "{|;")) {
10867-
head->previous()->isAttributeNodiscard(true);
10867+
head->previous()->isAttributeNodiscard(true);
1086810868
}
1086910869
} else if (Token::findsimplematch(tok->tokAt(2), "maybe_unused", tok->link())) {
1087010870
const Token* head = skipCPPOrAlignAttribute(tok);
@@ -10901,10 +10901,10 @@ void Tokenizer::simplifyCPPAttribute()
1090110901
}
1090210902
Token::eraseTokens(tok, skipCPPOrAlignAttribute(tok)->next());
1090310903
// fix iterator after removing
10904-
if(tok->previous()){
10904+
if (tok->previous()) {
1090510905
tok = tok->previous();
1090610906
tok->next()->deleteThis();
10907-
}else{
10907+
} else {
1090810908
tok->deleteThis();
1090910909
tok = list.front();
1091010910
}

test/testsymboldatabase.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4693,8 +4693,8 @@ class TestSymbolDatabase: public TestFixture {
46934693

46944694
void symboldatabase93() { // alignas attribute
46954695
GET_SYMBOL_DB("struct alignas(int) A{\n"
4696-
"};\n"
4697-
);
4696+
"};\n"
4697+
);
46984698
ASSERT(db != nullptr);
46994699
const Scope* scope = db->findScopeByName("A");
47004700
ASSERT(scope);
@@ -6669,7 +6669,7 @@ class TestSymbolDatabase: public TestFixture {
66696669
"template <class T> [[nodiscard]] int func4() { }"
66706670
"std::pair<bool, char> [[nodiscard]] func5();\n"
66716671
"[[nodiscard]] std::pair<bool, char> func6();\n"
6672-
);
6672+
);
66736673
ASSERT_EQUALS("", errout.str());
66746674
ASSERT_EQUALS(true, db != nullptr); // not null
66756675

0 commit comments

Comments
 (0)