]> granicus.if.org Git - strace/commitdiff
Fix preprocessor indentation
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 11 Jul 2019 17:51:22 +0000 (17:51 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 11 Jul 2019 17:51:22 +0000 (17:51 +0000)
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

defs.h
kernel_timex.h
linux/csky/raw_syscall.h
syscall.c
tests/clone-flags.c
tests/fspick.c
tests/inotify_init.c
tests/inotify_init1.c

diff --git a/defs.h b/defs.h
index b6140fe0b08dbc4da32481401e40e622ae1fa0ca..93b35d715bd01bd8078aa0ec97ffb49f0d642478 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -1460,12 +1460,12 @@ popcount32(const uint32_t *a, unsigned int size)
        for (; size; ++a, --size) {
                uint32_t x = *a;
 
-#ifdef HAVE___BUILTIN_POPCOUNT
+# ifdef HAVE___BUILTIN_POPCOUNT
                count += __builtin_popcount(x);
-#else
+# else
                for (; x; ++count)
                        x &= x - 1;
-#endif
+# endif
        }
 
        return count;
index a597e3539f380400f03aa3e46f4bd77014b84cf3..11b29e02de2390c20ae69aa165c539b0eff483e2 100644 (file)
@@ -37,7 +37,7 @@ typedef struct {
        int pad3[11];
 } kernel_timex64_t;
 
-#ifdef SPARC64
+# ifdef SPARC64
 
 typedef struct {
        unsigned int modes;
@@ -69,7 +69,7 @@ typedef struct {
        int pad3[11];
 } kernel_sparc64_timex_t;
 
-#endif /* SPARC64 */
+# endif /* SPARC64 */
 
 # if HAVE_ARCH_TIME32_SYSCALLS
 
index aad0abdc53c157d9edf7e1b0c7f1a021e25b17c8..0ffb83ca290f5526868d751dcf49301f0629ec2a 100644 (file)
@@ -6,18 +6,18 @@
  */
 
 #ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
 
 # include "kernel_types.h"
 
 static inline kernel_ulong_t
 raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
 {
-#if defined(__CSKYABIV2__)
+# if defined(__CSKYABIV2__)
        register kernel_ulong_t scno __asm__("r7") = nr;
-#else
+# else
        register kernel_ulong_t scno __asm__("r1") = nr;
-#endif
+# endif
        register kernel_ulong_t a0 __asm__("a0");
        asm volatile("trap 0"
                : "+r"(scno), "=r"(a0)
index 3a31c3cb5ecddf1356416a56b0103482bc8693df..e020b18030c7b57d07c81fc6af8bce0e15e3a2bb 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -580,10 +580,10 @@ syscall_entering_decode(struct tcb *tcp)
                return res;
        }
 
-# ifdef SYS_syscall_subcall
+#ifdef SYS_syscall_subcall
        if (tcp_sysent(tcp)->sen == SEN_syscall)
                decode_syscall_subcall(tcp);
-# endif
+#endif
 #if defined SYS_ipc_subcall    \
  || defined SYS_socket_subcall
        switch (tcp_sysent(tcp)->sen) {
index b7475cfdf1c06db60929f4d029bb3b30970ac71a..04bb2c76061f2f354846e59cb91927ec57bc3115 100644 (file)
@@ -50,14 +50,14 @@ wait_cloned(pid_t pid, int sig, const char *text)
 
 #ifdef IA64
 extern int __clone2(int (*)(void *), void *, size_t, int, void *, ...);
-#define do_clone(fn_, stack_, size_, flags_, arg_, ...) \
+# define do_clone(fn_, stack_, size_, flags_, arg_, ...) \
        wait_cloned(__clone2((fn_), (stack_), (size_), (flags_), (arg_), \
                             ## __VA_ARGS__), (flags_) & 0xff, #flags_)
 # define SYSCALL_NAME "clone2"
 # define STACK_SIZE_FMT ", stack_size=%#lx"
 # define STACK_SIZE_ARG child_stack_size,
 #else
-#define do_clone(fn_, stack_, size_, flags_, arg_, ...) \
+# define do_clone(fn_, stack_, size_, flags_, arg_, ...) \
        wait_cloned(clone((fn_), (stack_), (flags_), (arg_),    \
                          ## __VA_ARGS__), (flags_) & 0xff, #flags_)
 # define SYSCALL_NAME "clone"
index e794458fed794fa6b30eba62cc8cde21134dfa57..35a75f6b1cbad2ded1234909e232e42c7dbc2c85 100644 (file)
@@ -69,21 +69,21 @@ main(void)
               dfd, path, fname, "0xfffffff0 /* FSPICK_??? */", errstr);
 
        k_fspick(-1, efault, 0xf);
-#  ifndef PATH_TRACING
+# ifndef PATH_TRACING
        printf("fspick(-1, %p, %s) = %s\n",
               efault,
               "FSPICK_CLOEXEC|FSPICK_SYMLINK_NOFOLLOW"
               "|FSPICK_NO_AUTOMOUNT|FSPICK_EMPTY_PATH",
               errstr);
-#  endif
+# endif
 
        k_fspick(-1, empty, -1);
-#  ifndef PATH_TRACING
+# ifndef PATH_TRACING
        printf("fspick(-1, \"\", %s|0xfffffff0) = %s\n",
               "FSPICK_CLOEXEC|FSPICK_SYMLINK_NOFOLLOW"
               "|FSPICK_NO_AUTOMOUNT|FSPICK_EMPTY_PATH",
               errstr);
-#  endif
+# endif
 
        if (k_fspick(-1, path, 0) < 0)
                printf("fspick(-1, \"%s\", 0) = %s\n",
index 363811cc7d1fb3f62c7b7170a44789a201d95494..7b5e74af86667a4e696491b4cc721e0b54fe1b4b 100644 (file)
 int
 main(void)
 {
-#ifdef PRINT_PATHS
+# ifdef PRINT_PATHS
        skip_if_unavailable("/proc/self/fd/");
-#endif
+# endif
 
        long rc = syscall(__NR_inotify_init, 42);
 
-#ifdef PRINT_PATHS
+# ifdef PRINT_PATHS
        if (rc < 0)
                perror_msg_and_skip("inotify_init");
-#endif
+# endif
 
        printf("inotify_init() = "
-#ifdef PRINT_PATHS
+# ifdef PRINT_PATHS
               "%ld<anon_inode:inotify>\n", rc
-#else
+# else
               "%s\n", sprintrc(rc)
-#endif
+# endif
               );
 
        puts("+++ exited with 0 +++");
index 2408b6471136bcb48e180107307e0fcd3f108832..17e2f4ba656a7be52c713ab658d1050804e295dd 100644 (file)
 # endif
 # define all_flags (O_NONBLOCK | cloexec_flag)
 
-#ifdef PRINT_PATHS
-# define RC_FMT "%ld<%s>"
-#else
-# define RC_FMT "%s"
-#endif
+# ifdef PRINT_PATHS
+#  define RC_FMT "%ld<%s>"
+# else
+#  define RC_FMT "%s"
+# endif
 
 int
 main(void)
 {
-#ifdef PRINT_PATHS
+# ifdef PRINT_PATHS
        skip_if_unavailable("/proc/self/fd/");
-#endif
+# endif
 
        static const kernel_ulong_t bogus_flags1 =
                (kernel_ulong_t) 0xfacefeeddeadbeefULL | O_NONBLOCK;
@@ -57,7 +57,7 @@ main(void)
 
        rc = syscall(__NR_inotify_init1, all_flags);
 
-#ifdef PRINT_PATHS
+# ifdef PRINT_PATHS
        if (rc < 0)
                perror_msg_and_skip("inotify_init(%#x)", all_flags);
 
@@ -91,15 +91,15 @@ main(void)
                error_msg_and_fail("Unexpected first char '%c' of inotify fd "
                                   "link path", buf[0]);
        }
-#endif
+# endif
 
        printf("inotify_init1(IN_NONBLOCK%s) = " RC_FMT "\n",
               all_flags & cloexec_flag ? "|IN_CLOEXEC" : "",
-#ifdef PRINT_PATHS
+# ifdef PRINT_PATHS
               rc, inotify_path
-#else
+# else
               sprintrc(rc)
-#endif
+# endif
               );
 
        puts("+++ exited with 0 +++");