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 5 months ago
parent
commit
b63700cc56
8 changed files with 36 additions and 36 deletions
  1. 3
    3
      defs.h
  2. 2
    2
      kernel_timex.h
  3. 4
    4
      linux/csky/raw_syscall.h
  4. 2
    2
      syscall.c
  5. 2
    2
      tests/clone-flags.c
  6. 4
    4
      tests/fspick.c
  7. 7
    7
      tests/inotify_init.c
  8. 12
    12
      tests/inotify_init1.c

+ 3
- 3
defs.h View File

@@ -1460,12 +1460,12 @@ popcount32(const uint32_t *a, unsigned int size)
1460 1460
 	for (; size; ++a, --size) {
1461 1461
 		uint32_t x = *a;
1462 1462
 
1463
-#ifdef HAVE___BUILTIN_POPCOUNT
1463
+# ifdef HAVE___BUILTIN_POPCOUNT
1464 1464
 		count += __builtin_popcount(x);
1465
-#else
1465
+# else
1466 1466
 		for (; x; ++count)
1467 1467
 			x &= x - 1;
1468
-#endif
1468
+# endif
1469 1469
 	}
1470 1470
 
1471 1471
 	return count;

+ 2
- 2
kernel_timex.h View File

@@ -37,7 +37,7 @@ typedef struct {
37 37
 	int pad3[11];
38 38
 } kernel_timex64_t;
39 39
 
40
-#ifdef SPARC64
40
+# ifdef SPARC64
41 41
 
42 42
 typedef struct {
43 43
 	unsigned int modes;
@@ -69,7 +69,7 @@ typedef struct {
69 69
 	int pad3[11];
70 70
 } kernel_sparc64_timex_t;
71 71
 
72
-#endif /* SPARC64 */
72
+# endif /* SPARC64 */
73 73
 
74 74
 # if HAVE_ARCH_TIME32_SYSCALLS
75 75
 

+ 4
- 4
linux/csky/raw_syscall.h View File

@@ -6,18 +6,18 @@
6 6
  */
7 7
 
8 8
 #ifndef STRACE_RAW_SYSCALL_H
9
-#define STRACE_RAW_SYSCALL_H
9
+# define STRACE_RAW_SYSCALL_H
10 10
 
11 11
 # include "kernel_types.h"
12 12
 
13 13
 static inline kernel_ulong_t
14 14
 raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
15 15
 {
16
-#if defined(__CSKYABIV2__)
16
+# if defined(__CSKYABIV2__)
17 17
 	register kernel_ulong_t scno __asm__("r7") = nr;
18
-#else
18
+# else
19 19
 	register kernel_ulong_t scno __asm__("r1") = nr;
20
-#endif
20
+# endif
21 21
 	register kernel_ulong_t a0 __asm__("a0");
22 22
 	asm volatile("trap 0"
23 23
 		: "+r"(scno), "=r"(a0)

+ 2
- 2
syscall.c View File

@@ -580,10 +580,10 @@ syscall_entering_decode(struct tcb *tcp)
580 580
 		return res;
581 581
 	}
582 582
 
583
-# ifdef SYS_syscall_subcall
583
+#ifdef SYS_syscall_subcall
584 584
 	if (tcp_sysent(tcp)->sen == SEN_syscall)
585 585
 		decode_syscall_subcall(tcp);
586
-# endif
586
+#endif
587 587
 #if defined SYS_ipc_subcall	\
588 588
  || defined SYS_socket_subcall
589 589
 	switch (tcp_sysent(tcp)->sen) {

+ 2
- 2
tests/clone-flags.c View File

@@ -50,14 +50,14 @@ wait_cloned(pid_t pid, int sig, const char *text)
50 50
 
51 51
 #ifdef IA64
52 52
 extern int __clone2(int (*)(void *), void *, size_t, int, void *, ...);
53
-#define do_clone(fn_, stack_, size_, flags_, arg_, ...) \
53
+# define do_clone(fn_, stack_, size_, flags_, arg_, ...) \
54 54
 	wait_cloned(__clone2((fn_), (stack_), (size_), (flags_), (arg_), \
55 55
 			     ## __VA_ARGS__), (flags_) & 0xff, #flags_)
56 56
 # define SYSCALL_NAME "clone2"
57 57
 # define STACK_SIZE_FMT ", stack_size=%#lx"
58 58
 # define STACK_SIZE_ARG child_stack_size,
59 59
 #else
60
-#define do_clone(fn_, stack_, size_, flags_, arg_, ...) \
60
+# define do_clone(fn_, stack_, size_, flags_, arg_, ...) \
61 61
 	wait_cloned(clone((fn_), (stack_), (flags_), (arg_),	\
62 62
 			  ## __VA_ARGS__), (flags_) & 0xff, #flags_)
63 63
 # define SYSCALL_NAME "clone"

+ 4
- 4
tests/fspick.c View File

@@ -69,21 +69,21 @@ main(void)
69 69
 	       dfd, path, fname, "0xfffffff0 /* FSPICK_??? */", errstr);
70 70
 
71 71
 	k_fspick(-1, efault, 0xf);
72
-#  ifndef PATH_TRACING
72
+# ifndef PATH_TRACING
73 73
 	printf("fspick(-1, %p, %s) = %s\n",
74 74
 	       efault,
75 75
 	       "FSPICK_CLOEXEC|FSPICK_SYMLINK_NOFOLLOW"
76 76
 	       "|FSPICK_NO_AUTOMOUNT|FSPICK_EMPTY_PATH",
77 77
 	       errstr);
78
-#  endif
78
+# endif
79 79
 
80 80
 	k_fspick(-1, empty, -1);
81
-#  ifndef PATH_TRACING
81
+# ifndef PATH_TRACING
82 82
 	printf("fspick(-1, \"\", %s|0xfffffff0) = %s\n",
83 83
 	       "FSPICK_CLOEXEC|FSPICK_SYMLINK_NOFOLLOW"
84 84
 	       "|FSPICK_NO_AUTOMOUNT|FSPICK_EMPTY_PATH",
85 85
 	       errstr);
86
-#  endif
86
+# endif
87 87
 
88 88
 	if (k_fspick(-1, path, 0) < 0)
89 89
 		printf("fspick(-1, \"%s\", 0) = %s\n",

+ 7
- 7
tests/inotify_init.c View File

@@ -19,23 +19,23 @@
19 19
 int
20 20
 main(void)
21 21
 {
22
-#ifdef PRINT_PATHS
22
+# ifdef PRINT_PATHS
23 23
 	skip_if_unavailable("/proc/self/fd/");
24
-#endif
24
+# endif
25 25
 
26 26
 	long rc = syscall(__NR_inotify_init, 42);
27 27
 
28
-#ifdef PRINT_PATHS
28
+# ifdef PRINT_PATHS
29 29
 	if (rc < 0)
30 30
 		perror_msg_and_skip("inotify_init");
31
-#endif
31
+# endif
32 32
 
33 33
 	printf("inotify_init() = "
34
-#ifdef PRINT_PATHS
34
+# ifdef PRINT_PATHS
35 35
 	       "%ld<anon_inode:inotify>\n", rc
36
-#else
36
+# else
37 37
 	       "%s\n", sprintrc(rc)
38
-#endif
38
+# endif
39 39
 	       );
40 40
 
41 41
 	puts("+++ exited with 0 +++");

+ 12
- 12
tests/inotify_init1.c View File

@@ -25,18 +25,18 @@
25 25
 # endif
26 26
 # define all_flags (O_NONBLOCK | cloexec_flag)
27 27
 
28
-#ifdef PRINT_PATHS
29
-# define RC_FMT "%ld<%s>"
30
-#else
31
-# define RC_FMT "%s"
32
-#endif
28
+# ifdef PRINT_PATHS
29
+#  define RC_FMT "%ld<%s>"
30
+# else
31
+#  define RC_FMT "%s"
32
+# endif
33 33
 
34 34
 int
35 35
 main(void)
36 36
 {
37
-#ifdef PRINT_PATHS
37
+# ifdef PRINT_PATHS
38 38
 	skip_if_unavailable("/proc/self/fd/");
39
-#endif
39
+# endif
40 40
 
41 41
 	static const kernel_ulong_t bogus_flags1 =
42 42
 		(kernel_ulong_t) 0xfacefeeddeadbeefULL | O_NONBLOCK;
@@ -57,7 +57,7 @@ main(void)
57 57
 
58 58
 	rc = syscall(__NR_inotify_init1, all_flags);
59 59
 
60
-#ifdef PRINT_PATHS
60
+# ifdef PRINT_PATHS
61 61
 	if (rc < 0)
62 62
 		perror_msg_and_skip("inotify_init(%#x)", all_flags);
63 63
 
@@ -91,15 +91,15 @@ main(void)
91 91
 		error_msg_and_fail("Unexpected first char '%c' of inotify fd "
92 92
 				   "link path", buf[0]);
93 93
 	}
94
-#endif
94
+# endif
95 95
 
96 96
 	printf("inotify_init1(IN_NONBLOCK%s) = " RC_FMT "\n",
97 97
 	       all_flags & cloexec_flag ? "|IN_CLOEXEC" : "",
98
-#ifdef PRINT_PATHS
98
+# ifdef PRINT_PATHS
99 99
 	       rc, inotify_path
100
-#else
100
+# else
101 101
 	       sprintrc(rc)
102
-#endif
102
+# endif
103 103
 	       );
104 104
 
105 105
 	puts("+++ exited with 0 +++");

Loading…
Cancel
Save