From 62d972061bf63003a39ec25732816d5da4794b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 14 Oct 2019 19:41:51 +0200 Subject: [PATCH] astyle formatting [ci skip] --- lib/tokenize.cpp | 6 ++--- test/testautovariables.cpp | 3 +-- test/testsimplifytypedef.cpp | 48 ++++++++++++++++++------------------ 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 388c5758a..4a44c9aa8 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -1544,11 +1544,11 @@ void Tokenizer::simplifyTypedef() tok2 = tok2->tokAt(2); // skip over function parameters - if (tok2->str() == "(" ) - tok2 = tok2->link(); + if (tok2->str() == "(") + tok2 = tok2->link(); if (tok2->strAt(1) == "(") - tok2 = tok2->linkAt(1); + tok2 = tok2->linkAt(1); // skip over const/noexcept while (Token::Match(tok2->next(), "const|noexcept")) diff --git a/test/testautovariables.cpp b/test/testautovariables.cpp index 30974e6ab..8beb9b6ca 100644 --- a/test/testautovariables.cpp +++ b/test/testautovariables.cpp @@ -1231,8 +1231,7 @@ private: ASSERT_EQUALS("", errout.str()); } - void returnReference14() - { + void returnReference14() { check("struct C { void* m; };\n" "struct A { void* &f(); };\n" "C* g() {\n" diff --git a/test/testsimplifytypedef.cpp b/test/testsimplifytypedef.cpp index 939a13f83..f630532d2 100644 --- a/test/testsimplifytypedef.cpp +++ b/test/testsimplifytypedef.cpp @@ -2545,44 +2545,44 @@ private: ASSERT_EQUALS(exp, tok(code, false)); } - void simplifyTypedef129() { + void simplifyTypedef129() { { - const char code[] = "class c {\n" - " typedef char foo[4];\n" - " foo &f ;\n" - "};"; + const char code[] = "class c {\n" + " typedef char foo[4];\n" + " foo &f ;\n" + "};"; const char exp [] = "class c { char ( & f ) [ 4 ] ; } ;"; ASSERT_EQUALS(exp, tok(code, false)); } { - const char code[] = "class c {\n" - " typedef char foo[4];\n" - " const foo &f;\n" - "};"; + const char code[] = "class c {\n" + " typedef char foo[4];\n" + " const foo &f;\n" + "};"; const char exp [] = "class c { const char ( & f ) [ 4 ] ; } ;"; ASSERT_EQUALS(exp, tok(code, false)); } { - const char code[] = "class c {\n" - " typedef char foo[4];\n" - " foo _a;\n" - " constexpr const foo &c_str() const noexcept { return _a; }\n" - "};"; + const char code[] = "class c {\n" + " typedef char foo[4];\n" + " foo _a;\n" + " constexpr const foo &c_str() const noexcept { return _a; }\n" + "};"; const char exp [] = "class c { char _a [ 4 ] ; const const char ( & c_str ( ) const noexcept ) [ 4 ] { return _a ; } } ;"; ASSERT_EQUALS(exp, tok(code, false)); } { - const char code[] = "class c {\n" - " typedef char foo[4];\n" - " foo _a;\n" - " constexpr operator foo &() const noexcept { return _a; }\n" - "};"; + const char code[] = "class c {\n" + " typedef char foo[4];\n" + " foo _a;\n" + " constexpr operator foo &() const noexcept { return _a; }\n" + "};"; const char actual [] = "class c { char _a [ 4 ] ; const operatorchar ( & ( ) const noexcept ) [ 4 ] { return _a ; } } ;"; const char exp [] = "class c { char _a [ 4 ] ; const operator char ( & ( ) const noexcept ) [ 4 ] { return _a ; } } ;"; @@ -2590,11 +2590,11 @@ private: } { - const char code[] = "class c {\n" - " typedef char foo[4];\n" - " foo _a;\n" - " constexpr operator const foo &() const noexcept { return _a; }\n" - "};"; + const char code[] = "class c {\n" + " typedef char foo[4];\n" + " foo _a;\n" + " constexpr operator const foo &() const noexcept { return _a; }\n" + "};"; const char actual [] = "class c { char _a [ 4 ] ; const operatorconstchar ( & ( ) const noexcept ) [ 4 ] { return _a ; } } ;"; const char exp [] = "class c { char _a [ 4 ] ; const operator const char ( & ( ) const noexcept ) [ 4 ] { return _a ; } } ;";