summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2023-05-07 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2023-05-07 08:00:00 +0000
commit60848f9ce7ce7b21d0aa7f92c6a3f001352d5952 (patch)
tree8db459920abd36dbf857de59b24df63374548189
parent908111b7d091ee0defddd619b2dc352d37656407 (diff)
downloadstrace-60848f9ce7ce7b21d0aa7f92c6a3f001352d5952.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:]]' src tests |grep -v '\.sh$') |while read f; do cppi < "$f" > "$f".cppi; mv "$f".cppi "$f" done
-rw-r--r--src/linux/mips/raw_syscall.h10
-rw-r--r--src/macros.h2
-rw-r--r--src/print_fields.h2
-rw-r--r--src/strauss.h2
-rw-r--r--tests/ptrace.c6
-rw-r--r--tests/signalfd4.c22
-rw-r--r--tests/time_enjoyment.h12
7 files changed, 28 insertions, 28 deletions
diff --git a/src/linux/mips/raw_syscall.h b/src/linux/mips/raw_syscall.h
index 3ffc46bdc..1765ac128 100644
--- a/src/linux/mips/raw_syscall.h
+++ b/src/linux/mips/raw_syscall.h
@@ -12,17 +12,17 @@
# include "kernel_types.h"
-#if __mips_isa_rev >= 6
-#define SYSCALL_CLOBBERLIST \
+# if __mips_isa_rev >= 6
+# define SYSCALL_CLOBBERLIST \
"memory", "$1", "$3", "$8", "$9", \
"$10", "$11", "$12", "$13", "$14", "$15", \
"$24", "$25"
-#else
-#define SYSCALL_CLOBBERLIST \
+# else
+# define SYSCALL_CLOBBERLIST \
"memory", "hi", "lo", "$1", "$3", "$8", "$9", \
"$10", "$11", "$12", "$13", "$14", "$15", \
"$24", "$25"
-#endif
+# endif
static inline kernel_ulong_t
raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
diff --git a/src/macros.h b/src/macros.h
index 659d47191..7fd1ae24c 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -142,7 +142,7 @@ is_filled(const char *ptr, char fill, size_t size)
"Unexpected size of " #type_ "(" #sz_ " expected)")
/** Checks that ioctl code's size field contains the expected value. */
-#define CHECK_IOCTL_SIZE(ioc_, sz_) \
+# define CHECK_IOCTL_SIZE(ioc_, sz_) \
static_assert(_IOC_SIZE(ioc_) == (sz_), \
"Unexpected size field value in " #ioc_ " (" #sz_" expected)")
diff --git a/src/print_fields.h b/src/print_fields.h
index b8cc84858..60ecf56af 100644
--- a/src/print_fields.h
+++ b/src/print_fields.h
@@ -771,7 +771,7 @@ tprint_sysret_end(void)
} while (0)
-#define MAYBE_PRINT_FIELD_LEN(print_prefix_, where_, field_, \
+# define MAYBE_PRINT_FIELD_LEN(print_prefix_, where_, field_, \
len_, print_func_, ...) \
do { \
unsigned int start = offsetof(typeof(where_), field_); \
diff --git a/src/strauss.h b/src/strauss.h
index 71608d42d..ba8824af9 100644
--- a/src/strauss.h
+++ b/src/strauss.h
@@ -8,7 +8,7 @@
*/
#ifndef STRACE_STRAUSS_H
-#define STRACE_STRAUSS_H
+# define STRACE_STRAUSS_H
enum { STRAUSS_START_VERBOSITY = 5 };
diff --git a/tests/ptrace.c b/tests/ptrace.c
index 7c69af61d..ca8d6f489 100644
--- a/tests/ptrace.c
+++ b/tests/ptrace.c
@@ -2004,9 +2004,9 @@ main(void)
},
#endif
{ ARG_XLAT_KNOWN(0x5, "BUS_MCEERR_AO"),
-# if !defined(BUS_OPFETCH) && defined(HAVE_SIGINFO_T_SI_ADDR_LSB)
+#if !defined(BUS_OPFETCH) && defined(HAVE_SIGINFO_T_SI_ADDR_LSB)
", si_addr_lsb=0xdead"
-# endif
+#endif
},
{ ARG_STR(0x6) },
{ ARG_STR(0x499602d2) },
@@ -2067,7 +2067,7 @@ main(void)
{ ARG_XLAT_KNOWN(0x3, "SEGV_BNDERR"),
", si_lower=0x" UP64BIT("beefface") "cafedead"
", si_upper=0x" UP64BIT("badc0ded") "dadfaced",
-#endif /* HAVE_SIGINFO_T_SI_LOWER */
+# endif /* HAVE_SIGINFO_T_SI_LOWER */
},
#endif /* SEGV_STACKFLOW */
#ifdef __SEGV_PSTKOVF
diff --git a/tests/signalfd4.c b/tests/signalfd4.c
index 6b2aac530..a945dcf84 100644
--- a/tests/signalfd4.c
+++ b/tests/signalfd4.c
@@ -20,9 +20,9 @@
# include <sys/signalfd.h>
# include "kernel_fcntl.h"
-#ifndef SKIP_IF_PROC_IS_UNAVAILABLE
-# define SKIP_IF_PROC_IS_UNAVAILABLE
-#endif
+# ifndef SKIP_IF_PROC_IS_UNAVAILABLE
+# define SKIP_IF_PROC_IS_UNAVAILABLE
+# endif
int
main(void)
@@ -39,28 +39,28 @@ main(void)
int fd = signalfd(-1, &mask, SFD_CLOEXEC | SFD_NONBLOCK);
-#ifdef PRINT_SIGNALFD
+# ifdef PRINT_SIGNALFD
if (fd == -1)
perror_msg_and_skip("signalfd");
-#endif
+# endif
printf("signalfd4(-1, [%s], %u, SFD_CLOEXEC|SFD_NONBLOCK) = %s",
sigs1, size, sprintrc(fd));
-#ifdef PRINT_SIGNALFD
+# ifdef PRINT_SIGNALFD
printf("<signalfd:[%s]>\n", sigs1);
-#else
+# else
putchar('\n');
-#endif
+# endif
sigaddset(&mask, SIGCHLD);
fd = signalfd(fd, &mask, 0);
-#ifdef PRINT_SIGNALFD
+# ifdef PRINT_SIGNALFD
printf("signalfd4(%d<signalfd:[%s]>, [%s], %u, 0) = %s<signalfd:[%s]>\n",
fd, sigs1, sigs2, size, sprintrc(fd), sigs2);
-#else
+# else
printf("signalfd4(%d, [%s], %u, 0) = %s\n", fd, sigs2, size, sprintrc(fd));
-#endif
+# endif
puts("+++ exited with 0 +++");
return 0;
diff --git a/tests/time_enjoyment.h b/tests/time_enjoyment.h
index bae03a20d..65faa9856 100644
--- a/tests/time_enjoyment.h
+++ b/tests/time_enjoyment.h
@@ -1,11 +1,11 @@
#ifndef STRACE_TESTS_TIME_ENJOYMENT_H
-#define STRACE_TESTS_TIME_ENJOYMENT_H
+# define STRACE_TESTS_TIME_ENJOYMENT_H
-#include <fcntl.h>
-#include <sched.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+# include <fcntl.h>
+# include <sched.h>
+# include <time.h>
+# include <sys/types.h>
+# include <sys/stat.h>
enum {
NUM_USER_ITERS_SQRT = 2000,