Browse Source

Fix preprocessor indentation

Indent the C preprocessor directives to reflect their nesting
using the following script:

$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do
	cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
done
Dmitry V. Levin 1 month ago
parent
commit
89341445ad
7 changed files with 16 additions and 16 deletions
  1. 3
    3
      defs.h
  2. 3
    3
      print_fields.h
  3. 1
    1
      tests/accept_compat.h
  4. 6
    6
      tests/clone3.c
  5. 1
    1
      tests/getgroups.c
  6. 1
    1
      tests/ioctl_perf.c
  7. 1
    1
      tests/setgroups.c

+ 3
- 3
defs.h View File

@@ -819,9 +819,9 @@ extern const char *sprinttime(long long sec);
819 819
 extern const char *sprinttime_nsec(long long sec, unsigned long long nsec);
820 820
 extern const char *sprinttime_usec(long long sec, unsigned long long usec);
821 821
 
822
-#ifndef MAX_ADDR_LEN
823
-# define MAX_ADDR_LEN 32
824
-#endif
822
+# ifndef MAX_ADDR_LEN
823
+#  define MAX_ADDR_LEN 32
824
+# endif
825 825
 
826 826
 extern const char *sprint_mac_addr(const uint8_t addr[], size_t size);
827 827
 extern void print_mac_addr(const char *prefix,

+ 3
- 3
print_fields.h View File

@@ -79,14 +79,14 @@
79 79
 			      (xlat_), NULL);				\
80 80
 	} while (0)
81 81
 
82
-#define PRINT_FIELD_ERR_D(prefix_, where_, field_)			\
82
+# define PRINT_FIELD_ERR_D(prefix_, where_, field_)			\
83 83
 	do {								\
84 84
 		STRACE_PRINTF("%s%s=", (prefix_), #field_);		\
85 85
 		print_err(sign_extend_unsigned_to_ll((where_).field_),	\
86 86
 			  true);					\
87 87
 	} while (0)
88 88
 
89
-#define PRINT_FIELD_ERR_U(prefix_, where_, field_)			\
89
+# define PRINT_FIELD_ERR_U(prefix_, where_, field_)			\
90 90
 	do {								\
91 91
 		STRACE_PRINTF("%s%s=", (prefix_), #field_);		\
92 92
 		print_err(zero_extend_signed_to_ull((where_).field_),	\
@@ -261,7 +261,7 @@
261 261
 			       (size_));				\
262 262
 	} while (0)
263 263
 
264
-#define PRINT_FIELD_HWADDR_SZ(prefix_, where_, field_, size_, hwtype_)	\
264
+# define PRINT_FIELD_HWADDR_SZ(prefix_, where_, field_, size_, hwtype_)	\
265 265
 	do {								\
266 266
 		static_assert(sizeof(((where_).field_)[0]) == 1,	\
267 267
 			      "hwaddress is not a byte array");	\

+ 1
- 1
tests/accept_compat.h View File

@@ -10,7 +10,7 @@
10 10
 
11 11
 # include <unistd.h>
12 12
 # include <sys/socket.h>
13
-#include "scno.h"
13
+# include "scno.h"
14 14
 
15 15
 # if defined __NR_socketcall && defined __sparc__
16 16
 /*

+ 6
- 6
tests/clone3.c View File

@@ -142,7 +142,7 @@ print_addr64(const char *pfx, uint64_t addr)
142 142
 static void
143 143
 print_tls(const char *pfx, uint64_t arg_ptr, enum validity_flags vf)
144 144
 {
145
-# if defined HAVE_STRUCT_USER_DESC && defined __i386__
145
+#if defined HAVE_STRUCT_USER_DESC && defined __i386__
146 146
 	if (!(vf & TLS_VALID)) {
147 147
 		print_addr64(pfx, arg_ptr);
148 148
 		return;
@@ -169,9 +169,9 @@ print_tls(const char *pfx, uint64_t arg_ptr, enum validity_flags vf)
169 169
 	       arg->limit_in_pages,
170 170
 	       arg->seg_not_present,
171 171
 	       arg->useable);
172
-# else
172
+#else
173 173
 	print_addr64(pfx, arg_ptr);
174
-# endif
174
+#endif
175 175
 }
176 176
 
177 177
 static inline void
@@ -278,13 +278,13 @@ main(int argc, char *argv[])
278 278
 	int *parent_tid = tail_alloc(sizeof(*parent_tid));
279 279
 	long rc;
280 280
 
281
-# if defined HAVE_STRUCT_USER_DESC
281
+#if defined HAVE_STRUCT_USER_DESC
282 282
 	struct user_desc *tls = tail_alloc(sizeof(*tls));
283 283
 
284 284
 	fill_memory(tls, sizeof(*tls));
285
-# else
285
+#else
286 286
 	int *tls = tail_alloc(sizeof(*tls));
287
-# endif
287
+#endif
288 288
 
289 289
 	*pidfd = 0xbadc0ded;
290 290
 	*child_tid = 0xdeadface;

+ 1
- 1
tests/getgroups.c View File

@@ -17,7 +17,7 @@
17 17
 #else
18 18
 
19 19
 # include "tests.h"
20
-#include "scno.h"
20
+# include "scno.h"
21 21
 
22 22
 # ifdef __NR_getgroups
23 23
 

+ 1
- 1
tests/ioctl_perf.c View File

@@ -16,7 +16,7 @@
16 16
 # include <string.h>
17 17
 # include <unistd.h>
18 18
 # include <sys/ioctl.h>
19
-#include "scno.h"
19
+# include "scno.h"
20 20
 # include <linux/perf_event.h>
21 21
 
22 22
 /*

+ 1
- 1
tests/setgroups.c View File

@@ -17,7 +17,7 @@
17 17
 #else
18 18
 
19 19
 # include "tests.h"
20
-#include "scno.h"
20
+# include "scno.h"
21 21
 
22 22
 # ifdef __NR_setgroups
23 23
 

Loading…
Cancel
Save