From ec3d76be5e6d1e4484b73b53661b5c554f55a906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 7 Aug 2015 20:27:32 +0200 Subject: [PATCH] astyle formatting --- lib/checkother.cpp | 2 +- lib/checkother.h | 2 +- test/testother.cpp | 270 ++++++++++++++++++++++----------------------- 3 files changed, 137 insertions(+), 137 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 6b22e39af..6024567a2 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2614,6 +2614,6 @@ void CheckOther::checkInterlockedDecrement() void CheckOther::raceAfterInterlockedDecrementError(const Token* tok) { reportError(tok, Severity::error, "raceAfterInterlockedDecrement", - "Race condition: non-interlocked access after InterlockedDecrement(). Use InterlockedDecrement() return value instead."); + "Race condition: non-interlocked access after InterlockedDecrement(). Use InterlockedDecrement() return value instead."); } diff --git a/lib/checkother.h b/lib/checkother.h index f546fc364..6a0362098 100644 --- a/lib/checkother.h +++ b/lib/checkother.h @@ -230,7 +230,7 @@ public: void checkInterlockedDecrement(); - void checkNewAfterDelete(); + void checkNewAfterDelete(); private: // Error messages.. diff --git a/test/testother.cpp b/test/testother.cpp index 7cfc969b9..e08d67a79 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -6256,201 +6256,201 @@ private: void raceAfterInterlockedDecrement() { checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " InterlockedDecrement(&counter);\n" - " whatever();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " InterlockedDecrement(&counter);\n" + " whatever();\n" + "}\n"); ASSERT_EQUALS("", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " InterlockedDecrement(&counter);\n" - " if (counter)\n" - " return;\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " InterlockedDecrement(&counter);\n" + " if (counter)\n" + " return;\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("[test.cpp:4]: (error) Race condition: non-interlocked access after InterlockedDecrement(). Use InterlockedDecrement() return value instead.\n", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " InterlockedDecrement(&counter);\n" - " if (!counter)\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " InterlockedDecrement(&counter);\n" + " if (!counter)\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("[test.cpp:4]: (error) Race condition: non-interlocked access after InterlockedDecrement(). Use InterlockedDecrement() return value instead.\n", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " InterlockedDecrement(&counter);\n" - " if (counter > 0)\n" - " return;\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " InterlockedDecrement(&counter);\n" + " if (counter > 0)\n" + " return;\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("[test.cpp:4]: (error) Race condition: non-interlocked access after InterlockedDecrement(). Use InterlockedDecrement() return value instead.\n", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " InterlockedDecrement(&counter);\n" - " if (0 < counter)\n" - " return;\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " InterlockedDecrement(&counter);\n" + " if (0 < counter)\n" + " return;\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("[test.cpp:4]: (error) Race condition: non-interlocked access after InterlockedDecrement(). Use InterlockedDecrement() return value instead.\n", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " InterlockedDecrement(&counter);\n" - " if (counter == 0)\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " InterlockedDecrement(&counter);\n" + " if (counter == 0)\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("[test.cpp:4]: (error) Race condition: non-interlocked access after InterlockedDecrement(). Use InterlockedDecrement() return value instead.\n", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " InterlockedDecrement(&counter);\n" - " if (0 == counter)\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " InterlockedDecrement(&counter);\n" + " if (0 == counter)\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("[test.cpp:4]: (error) Race condition: non-interlocked access after InterlockedDecrement(). Use InterlockedDecrement() return value instead.\n", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " InterlockedDecrement(&counter);\n" - " if (0 != counter)\n" - " return;\n" - " destroy()\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " InterlockedDecrement(&counter);\n" + " if (0 != counter)\n" + " return;\n" + " destroy()\n" + "}\n"); ASSERT_EQUALS("[test.cpp:4]: (error) Race condition: non-interlocked access after InterlockedDecrement(). Use InterlockedDecrement() return value instead.\n", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " InterlockedDecrement(&counter);\n" - " if (counter != 0)\n" - " return;\n" - " destroy()\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " InterlockedDecrement(&counter);\n" + " if (counter != 0)\n" + " return;\n" + " destroy()\n" + "}\n"); ASSERT_EQUALS("[test.cpp:4]: (error) Race condition: non-interlocked access after InterlockedDecrement(). Use InterlockedDecrement() return value instead.\n", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " InterlockedDecrement(&counter);\n" - " if (counter <= 0)\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " InterlockedDecrement(&counter);\n" + " if (counter <= 0)\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("[test.cpp:4]: (error) Race condition: non-interlocked access after InterlockedDecrement(). Use InterlockedDecrement() return value instead.\n", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " InterlockedDecrement(&counter);\n" - " if (0 >= counter)\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " InterlockedDecrement(&counter);\n" + " if (0 >= counter)\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("[test.cpp:4]: (error) Race condition: non-interlocked access after InterlockedDecrement(). Use InterlockedDecrement() return value instead.\n", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " int newCount = InterlockedDecrement(&counter);\n" - " if (newCount)\n" - " return;\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " int newCount = InterlockedDecrement(&counter);\n" + " if (newCount)\n" + " return;\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " int newCount = InterlockedDecrement(&counter);\n" - " if (!newCount)\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " int newCount = InterlockedDecrement(&counter);\n" + " if (!newCount)\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " int newCount = InterlockedDecrement(&counter);\n" - " if (newCount > 0)\n" - " return;\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " int newCount = InterlockedDecrement(&counter);\n" + " if (newCount > 0)\n" + " return;\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " int newCount = InterlockedDecrement(&counter);\n" - " if (0 < newCount)\n" - " return;\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " int newCount = InterlockedDecrement(&counter);\n" + " if (0 < newCount)\n" + " return;\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " int newCount = InterlockedDecrement(&counter);\n" - " if (newCount == 0)\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " int newCount = InterlockedDecrement(&counter);\n" + " if (newCount == 0)\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " int newCount = InterlockedDecrement(&counter);\n" - " if (0 == newCount)\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " int newCount = InterlockedDecrement(&counter);\n" + " if (0 == newCount)\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " int newCount = InterlockedDecrement(&counter);\n" - " if (0 != newCount)\n" - " return;\n" - " destroy()\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " int newCount = InterlockedDecrement(&counter);\n" + " if (0 != newCount)\n" + " return;\n" + " destroy()\n" + "}\n"); ASSERT_EQUALS("", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " int newCount = InterlockedDecrement(&counter);\n" - " if (newCount != 0)\n" - " return;\n" - " destroy()\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " int newCount = InterlockedDecrement(&counter);\n" + " if (newCount != 0)\n" + " return;\n" + " destroy()\n" + "}\n"); ASSERT_EQUALS("", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " int newCount = InterlockedDecrement(&counter);\n" - " if (newCount <= 0)\n" - " destroy();\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " int newCount = InterlockedDecrement(&counter);\n" + " if (newCount <= 0)\n" + " destroy();\n" + "}\n"); ASSERT_EQUALS("", errout.str()); checkInterlockedDecrement( - "void f() {\n" - " int counter = 0;\n" - " int newCount = InterlockedDecrement(&counter);\n" - " if (0 >= newCount)\n" - " destroy;\n" - "}\n"); + "void f() {\n" + " int counter = 0;\n" + " int newCount = InterlockedDecrement(&counter);\n" + " if (0 >= newCount)\n" + " destroy;\n" + "}\n"); ASSERT_EQUALS("", errout.str()); } };