From 51564504a81c9da0f2157663721eaaca2e76f911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 20 Mar 2021 18:54:00 +0100 Subject: [PATCH] astyle formatting --- lib/tokenize.cpp | 18 +++++++++--------- test/testsymboldatabase.cpp | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index d3a4c3cff..8c2311ab0 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -9928,9 +9928,9 @@ static bool isAlignAttribute(const Token * tok) static const Token* skipCPPOrAlignAttribute(const Token * tok) { - if(isCPPAttribute(tok)) { + if (isCPPAttribute(tok)) { return tok->link(); - }else if(isAlignAttribute(tok)) { + } else if (isAlignAttribute(tok)) { return tok->next()->link(); } return tok; @@ -10199,7 +10199,7 @@ void Tokenizer::findGarbageCode() const continue; } // skip C++ attributes [[...]] - if (isCPP11 && (isCPPAttribute(tok) || isAlignAttribute(tok)) ) { + if (isCPP11 && (isCPPAttribute(tok) || isAlignAttribute(tok))) { tok = skipCPPOrAlignAttribute(tok); continue; } @@ -10842,10 +10842,10 @@ void Tokenizer::simplifyCPPAttribute() return; for (Token *tok = list.front(); tok; tok = tok->next()) { - if (!isCPPAttribute(tok) && !isAlignAttribute(tok)){ + if (!isCPPAttribute(tok) && !isAlignAttribute(tok)) { continue; } - if(isCPPAttribute(tok)){ + if (isCPPAttribute(tok)) { if (Token::findsimplematch(tok->tokAt(2), "noreturn", tok->link())) { const Token * head = skipCPPOrAlignAttribute(tok); while (isCPPAttribute(head) || isAlignAttribute(head)) @@ -10854,7 +10854,7 @@ void Tokenizer::simplifyCPPAttribute() while (Token::Match(head, "%name%|::|*|&|<|>|,")) // skip return type head = head->next(); if (head && head->str() == "(" && isFunctionHead(head, "{|;")) { - head->previous()->isAttributeNoreturn(true); + head->previous()->isAttributeNoreturn(true); } } else if (Token::findsimplematch(tok->tokAt(2), "nodiscard", tok->link())) { const Token * head = skipCPPOrAlignAttribute(tok); @@ -10864,7 +10864,7 @@ void Tokenizer::simplifyCPPAttribute() while (Token::Match(head, "%name%|::|*|&|<|>|,")) head = head->next(); if (head && head->str() == "(" && isFunctionHead(head, "{|;")) { - head->previous()->isAttributeNodiscard(true); + head->previous()->isAttributeNodiscard(true); } } else if (Token::findsimplematch(tok->tokAt(2), "maybe_unused", tok->link())) { const Token* head = skipCPPOrAlignAttribute(tok); @@ -10901,10 +10901,10 @@ void Tokenizer::simplifyCPPAttribute() } Token::eraseTokens(tok, skipCPPOrAlignAttribute(tok)->next()); // fix iterator after removing - if(tok->previous()){ + if (tok->previous()) { tok = tok->previous(); tok->next()->deleteThis(); - }else{ + } else { tok->deleteThis(); tok = list.front(); } diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index 4d9e111b0..b5003a511 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -4693,8 +4693,8 @@ private: void symboldatabase93() { // alignas attribute GET_SYMBOL_DB("struct alignas(int) A{\n" - "};\n" - ); + "};\n" + ); ASSERT(db != nullptr); const Scope* scope = db->findScopeByName("A"); ASSERT(scope); @@ -6669,7 +6669,7 @@ private: "template [[nodiscard]] int func4() { }" "std::pair [[nodiscard]] func5();\n" "[[nodiscard]] std::pair func6();\n" - ); + ); ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS(true, db != nullptr); // not null