Blob Blame History Raw
From bb9c27c217a9b995c101cbb2023c4084ce76a07b Mon Sep 17 00:00:00 2001
From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Date: Thu, 25 Nov 2021 16:51:55 +0300
Subject: [PATCH 060/120] clang-format: disable wrong struct pointer
 declaration format

When we declare struct and at the same time declare variable pointer of
this struct type, it looks like clang-format threats "*" as a
multiplication operator instead of indirection (pointer declaration)
operator and puts spaces on both sides, which looks wrong.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 criu/fdstore.c                                    | 4 +++-
 test/zdtm/lib/test.c                              | 4 +++-
 test/zdtm/static/child_subreaper_and_reparent.c   | 4 +++-
 test/zdtm/static/child_subreaper_existing_child.c | 4 +++-
 test/zdtm/static/file_fown.c                      | 4 +++-
 5 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/criu/fdstore.c b/criu/fdstore.c
index 77935484f..65264a511 100644
--- a/criu/fdstore.c
+++ b/criu/fdstore.c
@@ -13,10 +13,12 @@
 #include "rst-malloc.h"
 #include "log.h"
 
+/* clang-format off */
 static struct fdstore_desc {
 	int next_id;
 	mutex_t lock; /* to protect a peek offset */
-} * desc;
+} *desc;
+/* clang-format on */
 
 int fdstore_init(void)
 {
diff --git a/test/zdtm/lib/test.c b/test/zdtm/lib/test.c
index 81da81eba..57eb42046 100644
--- a/test/zdtm/lib/test.c
+++ b/test/zdtm/lib/test.c
@@ -20,9 +20,11 @@
 #include "ns.h"
 
 futex_t sig_received;
+/* clang-format off */
 static struct {
 	futex_t stage;
-} * test_shared_state;
+} *test_shared_state;
+/* clang-format on */
 
 enum {
 	TEST_INIT_STAGE = 0,
diff --git a/test/zdtm/static/child_subreaper_and_reparent.c b/test/zdtm/static/child_subreaper_and_reparent.c
index ba03517ba..c71778ae9 100644
--- a/test/zdtm/static/child_subreaper_and_reparent.c
+++ b/test/zdtm/static/child_subreaper_and_reparent.c
@@ -19,11 +19,13 @@ enum {
 	TEST_EXIT,
 };
 
+/* clang-format off */
 struct shared {
 	futex_t fstate;
 	int parent_before_cr;
 	int parent_after_cr;
-} * sh;
+} *sh;
+/* clang-format on */
 
 int orphan(void)
 {
diff --git a/test/zdtm/static/child_subreaper_existing_child.c b/test/zdtm/static/child_subreaper_existing_child.c
index 4805aa41d..92d22bc4a 100644
--- a/test/zdtm/static/child_subreaper_existing_child.c
+++ b/test/zdtm/static/child_subreaper_existing_child.c
@@ -18,10 +18,12 @@ enum {
 	TEST_EXIT,
 };
 
+/* clang-format off */
 struct shared {
 	futex_t fstate;
 	int ppid_after_reparent;
-} * sh;
+} *sh;
+/* clang-format on */
 
 int orphan(void)
 {
diff --git a/test/zdtm/static/file_fown.c b/test/zdtm/static/file_fown.c
index eb42a826e..2c5ba82c2 100644
--- a/test/zdtm/static/file_fown.c
+++ b/test/zdtm/static/file_fown.c
@@ -22,12 +22,14 @@
 const char *test_doc = "Check for signal delivery on file owners";
 const char *test_author = "Cyrill Gorcunov <gorcunov@openvz.org>";
 
+/* clang-format off */
 struct params {
 	int sigio;
 	int pipe_flags[2];
 	int pipe_pid[2];
 	int pipe_sig[2];
-} * shared;
+} *shared;
+/* clang-format on */
 
 static void signal_handler_io(int status)
 {
-- 
2.34.1