summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2020-09-23 16:00:00 +0000
committerDmitry V. Levin <ldv@altlinux.org>2020-09-23 16:29:35 +0000
commit405db69dc7ac679d4e8a71575106c96f0b548f7c (patch)
tree817d93e910620af58c8cb81c9987b479b6e6032a
parent4fce4dc90501b29c51ec170d47e3e0c25b2888ff (diff)
downloadstrace-405db69dc7ac679d4e8a71575106c96f0b548f7c.tar.gz
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
-rw-r--r--defs.h14
-rw-r--r--tests/close_range.c10
-rw-r--r--tests/faccessat2.c4
-rw-r--r--tests/fork--pidns-translation.c36
-rw-r--r--tests/io_uring_setup.c6
-rw-r--r--tests/nlattr_ifla_xdp.c2
-rw-r--r--tests/pidfd_getfd.c6
-rw-r--r--tests/pidns.h14
-rw-r--r--tests/sched_xetparam.c2
-rw-r--r--tests/semtimedop.c20
-rw-r--r--tests/sockopt-timestamp.c4
-rw-r--r--tests/xettimeofday.c12
-rw-r--r--trie.h6
-rw-r--r--types/tee.h14
-rw-r--r--xgetdents.h2
15 files changed, 76 insertions, 76 deletions
diff --git a/defs.h b/defs.h
index 3417e03c7..7151e90cb 100644
--- a/defs.h
+++ b/defs.h
@@ -1758,7 +1758,7 @@ scno_is_valid(kernel_ulong_t scno)
# define SYS_FUNC(syscall_name) int SYS_FUNC_NAME(sys_ ## syscall_name)(struct tcb *tcp)
-#define ILOG2_ITER_(val_, ret_, bit_) \
+# define ILOG2_ITER_(val_, ret_, bit_) \
do { \
typeof(ret_) shift_ = \
((val_) > ((((typeof(val_)) 1) \
@@ -1810,12 +1810,12 @@ ilog2_32(uint32_t val)
return ret;
}
-#if SIZEOF_KERNEL_LONG_T > 4
-# define ilog2_klong ilog2_64
-#else
-# define ilog2_klong ilog2_32
-#endif
+# if SIZEOF_KERNEL_LONG_T > 4
+# define ilog2_klong ilog2_64
+# else
+# define ilog2_klong ilog2_32
+# endif
-#undef ILOG2_ITER_
+# undef ILOG2_ITER_
#endif /* !STRACE_DEFS_H */
diff --git a/tests/close_range.c b/tests/close_range.c
index 44c0e5237..b3a3ab7df 100644
--- a/tests/close_range.c
+++ b/tests/close_range.c
@@ -16,11 +16,11 @@
# include <stdio.h>
# include <unistd.h>
-#ifdef HAVE_LINUX_CLOSE_RANGE_H
-# include <linux/close_range.h>
-#else
-# define CLOSE_RANGE_UNSHARE (1U << 1)
-#endif
+# ifdef HAVE_LINUX_CLOSE_RANGE_H
+# include <linux/close_range.h>
+# else
+# define CLOSE_RANGE_UNSHARE (1U << 1)
+# endif
# ifndef FD0_PATH
# define FD0_PATH ""
diff --git a/tests/faccessat2.c b/tests/faccessat2.c
index b63c3d58e..74d17cd59 100644
--- a/tests/faccessat2.c
+++ b/tests/faccessat2.c
@@ -148,10 +148,10 @@ main(void)
paths[path_i].val,
modes[mode_i].val,
flags[flag_i].val);
- # ifdef PATH_TRACING
+# ifdef PATH_TRACING
if (dirfds[dirfd_i].val == fd ||
paths[path_i].val == fd_path)
- # endif
+# endif
printf("faccessat2(%s, %s, %s, %s) = %s\n",
dirfds[dirfd_i].str,
paths[path_i].str,
diff --git a/tests/fork--pidns-translation.c b/tests/fork--pidns-translation.c
index 1499a6030..1d490ce4a 100644
--- a/tests/fork--pidns-translation.c
+++ b/tests/fork--pidns-translation.c
@@ -13,24 +13,24 @@
#ifdef __NR_fork
-#include <errno.h>
-#include <limits.h>
-#include <sched.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <linux/sched.h>
-#include "nsfs.h"
-
-#ifndef CLONE_NEWUSER
-# define CLONE_NEWUSER 0x10000000
-#endif
-
-#ifndef CLONE_NEWPID
-# define CLONE_NEWPID 0x20000000
-#endif
+# include <errno.h>
+# include <limits.h>
+# include <sched.h>
+# include <signal.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <sys/wait.h>
+# include <unistd.h>
+# include <linux/sched.h>
+# include "nsfs.h"
+
+# ifndef CLONE_NEWUSER
+# define CLONE_NEWUSER 0x10000000
+# endif
+
+# ifndef CLONE_NEWPID
+# define CLONE_NEWPID 0x20000000
+# endif
static int
fork_chain(int depth)
diff --git a/tests/io_uring_setup.c b/tests/io_uring_setup.c
index a59e4a1ad..d54f8c9bc 100644
--- a/tests/io_uring_setup.c
+++ b/tests/io_uring_setup.c
@@ -152,7 +152,7 @@ main(void)
params->cq_off.ring_entries,
params->cq_off.overflow,
params->cq_off.cqes);
-#ifdef HAVE_STRUCT_IO_CQRING_OFFSETS_FLAGS
+# ifdef HAVE_STRUCT_IO_CQRING_OFFSETS_FLAGS
printflags(uring_cqring_flags,
params->cq_off.flags,
"IORING_CQ_???");
@@ -162,7 +162,7 @@ main(void)
printf(", resv2=%#llx",
(unsigned long long)
params->cq_off.resv2);
-#else
+# else
union {
struct {
uint32_t flags;
@@ -178,7 +178,7 @@ main(void)
printf(", resv2=%#llx",
(unsigned long long)
params->cq_off.resv[1]);
-#endif
+# endif
printf("}}) = %ld<anon_inode:[io_uring]>\n", rc);
}
diff --git a/tests/nlattr_ifla_xdp.c b/tests/nlattr_ifla_xdp.c
index 05de47e17..3796e5ea1 100644
--- a/tests/nlattr_ifla_xdp.c
+++ b/tests/nlattr_ifla_xdp.c
@@ -36,7 +36,7 @@ enum { XDP_ATTACHED_MULTI = 4 };
#include "nlattr_ifla.h"
#ifndef FD9_PATH
-#define FD9_PATH ""
+# define FD9_PATH ""
#endif
int
diff --git a/tests/pidfd_getfd.c b/tests/pidfd_getfd.c
index 3208439cf..fef770971 100644
--- a/tests/pidfd_getfd.c
+++ b/tests/pidfd_getfd.c
@@ -74,12 +74,12 @@ main(void)
close(dupfd);
int pidfd = syscall(__NR_pidfd_open, pid, 0);
-#if PRINT_PIDFD
+# if PRINT_PIDFD
char pidfd_str[sizeof("<pid:>") + 3 * sizeof(int)];
snprintf(pidfd_str, sizeof(pidfd_str), "<pid:%d>", pid);
-#else
+# else
const char *pidfd_str = PIDFD_PATH;
-#endif
+# endif
rc = k_pidfd_getfd(pidfd, dupfd, 0);
printf("pidfd_getfd(%d%s, %d%s, 0) = %s%s\n",
pidfd, pidfd >= 0 ? pidfd_str : "",
diff --git a/tests/pidns.h b/tests/pidns.h
index 76963eb36..bafc0d77e 100644
--- a/tests/pidns.h
+++ b/tests/pidns.h
@@ -7,15 +7,15 @@
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef STRACE_PIDNS_H
-#define STRACE_PIDNS_H
+# define STRACE_PIDNS_H
-#ifdef PIDNS_TRANSLATION
-# define PIDNS_TEST_INIT pidns_test_init()
-#else
-# define PIDNS_TEST_INIT
-#endif
+# ifdef PIDNS_TRANSLATION
+# define PIDNS_TEST_INIT pidns_test_init()
+# else
+# define PIDNS_TEST_INIT
+# endif
-#include <sys/types.h>
+# include <sys/types.h>
enum pid_type {
PT_TID,
diff --git a/tests/sched_xetparam.c b/tests/sched_xetparam.c
index aa9c68cc2..9e681b8bf 100644
--- a/tests/sched_xetparam.c
+++ b/tests/sched_xetparam.c
@@ -7,7 +7,7 @@
#include "tests.h"
#include "scno.h"
-# include "pidns.h"
+#include "pidns.h"
#if defined __NR_sched_getparam && defined __NR_sched_setparam
diff --git a/tests/semtimedop.c b/tests/semtimedop.c
index 915300ba7..e3cea328a 100644
--- a/tests/semtimedop.c
+++ b/tests/semtimedop.c
@@ -10,16 +10,16 @@
#if defined __NR_semtimedop || defined __NR_socketcall
-#include <sys/ipc.h>
-#include <sys/sem.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#define XLAT_MACROS_ONLY
-#include "xlat/semop_flags.h"
-#undef XLAT_MACROS_ONLY
+# include <sys/ipc.h>
+# include <sys/sem.h>
+# include <stdint.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <unistd.h>
+
+# define XLAT_MACROS_ONLY
+# include "xlat/semop_flags.h"
+# undef XLAT_MACROS_ONLY
union semun {
int val;
diff --git a/tests/sockopt-timestamp.c b/tests/sockopt-timestamp.c
index d0fca5215..9dd1f9610 100644
--- a/tests/sockopt-timestamp.c
+++ b/tests/sockopt-timestamp.c
@@ -19,8 +19,8 @@
# include <linux/time_types.h>
#endif
-# include "kernel_timeval.h"
-# include "kernel_old_timespec.h"
+#include "kernel_timeval.h"
+#include "kernel_old_timespec.h"
#define XLAT_MACROS_ONLY
#include "xlat/sock_options.h"
diff --git a/tests/xettimeofday.c b/tests/xettimeofday.c
index e35709dc3..eca3959b0 100644
--- a/tests/xettimeofday.c
+++ b/tests/xettimeofday.c
@@ -11,12 +11,12 @@
#ifdef __NR_gettimeofday
-#include <assert.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include "scno.h"
+# include <assert.h>
+# include <stdio.h>
+# include <stdint.h>
+# include <unistd.h>
+# include <sys/time.h>
+# include "scno.h"
int
main(void)
diff --git a/trie.h b/trie.h
index deb87a54e..da8f45e77 100644
--- a/trie.h
+++ b/trie.h
@@ -8,10 +8,10 @@
*/
#ifndef STRACE_TRIE_H
-#define STRACE_TRIE_H
+# define STRACE_TRIE_H
-#include <stdbool.h>
-#include <stdint.h>
+# include <stdbool.h>
+# include <stdint.h>
/**
* Trie control structure.
diff --git a/types/tee.h b/types/tee.h
index f2b2c8aed..ab3a25de9 100644
--- a/types/tee.h
+++ b/types/tee.h
@@ -6,15 +6,15 @@
*/
#ifndef STRACE_TYPES_TEE_H
-#define STRACE_TYPES_TEE_H
+# define STRACE_TYPES_TEE_H
-#include <linux/ioctl.h>
+# include <linux/ioctl.h>
-#ifdef HAVE_LINUX_TEE_H
-# include <linux/tee.h>
-#else
-# define TEE_IOCTL_UUID_LEN 16
-#endif
+# ifdef HAVE_LINUX_TEE_H
+# include <linux/tee.h>
+# else
+# define TEE_IOCTL_UUID_LEN 16
+# endif
typedef struct {
uint64_t buf_ptr;
diff --git a/xgetdents.h b/xgetdents.h
index c9060c009..968057b51 100644
--- a/xgetdents.h
+++ b/xgetdents.h
@@ -8,7 +8,7 @@
#ifndef STRACE_XGETDENTS_H
# define STRACE_XGETDENTS_H
-#include "defs.h"
+# include "defs.h"
typedef unsigned int (*decode_dentry_head_fn)(struct tcb *, const void *);
typedef int (*decode_dentry_tail_fn)(struct tcb *, kernel_ulong_t,