]> granicus.if.org Git - strace/commitdiff
Fix preprocessor indentation
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 24 Sep 2019 21:35:26 +0000 (21:35 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 25 Sep 2019 01:02:03 +0000 (01:02 +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
print_fields.h
tests/accept_compat.h
tests/clone3.c
tests/getgroups.c
tests/ioctl_perf.c
tests/setgroups.c

diff --git a/defs.h b/defs.h
index 119ed515e4cc3cec46d00269d600fba6fb0000ad..06bf1248bb3ae9d2461a35c8ba1cf0a322bbcb92 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -819,9 +819,9 @@ extern const char *sprinttime(long long sec);
 extern const char *sprinttime_nsec(long long sec, unsigned long long nsec);
 extern const char *sprinttime_usec(long long sec, unsigned long long usec);
 
-#ifndef MAX_ADDR_LEN
-# define MAX_ADDR_LEN 32
-#endif
+# ifndef MAX_ADDR_LEN
+#  define MAX_ADDR_LEN 32
+# endif
 
 extern const char *sprint_mac_addr(const uint8_t addr[], size_t size);
 extern void print_mac_addr(const char *prefix,
index eda16f67cc67629fcb4904f24310e7e1afecb8fe..ce165ec5e9e4d0a50bc002c75e58967f9f864772 100644 (file)
                              (xlat_), NULL);                           \
        } while (0)
 
-#define PRINT_FIELD_ERR_D(prefix_, where_, field_)                     \
+# define PRINT_FIELD_ERR_D(prefix_, where_, field_)                    \
        do {                                                            \
                STRACE_PRINTF("%s%s=", (prefix_), #field_);             \
                print_err(sign_extend_unsigned_to_ll((where_).field_),  \
                          true);                                        \
        } while (0)
 
-#define PRINT_FIELD_ERR_U(prefix_, where_, field_)                     \
+# define PRINT_FIELD_ERR_U(prefix_, where_, field_)                    \
        do {                                                            \
                STRACE_PRINTF("%s%s=", (prefix_), #field_);             \
                print_err(zero_extend_signed_to_ull((where_).field_),   \
                               (size_));                                \
        } while (0)
 
-#define PRINT_FIELD_HWADDR_SZ(prefix_, where_, field_, size_, hwtype_) \
+# define PRINT_FIELD_HWADDR_SZ(prefix_, where_, field_, size_, hwtype_)        \
        do {                                                            \
                static_assert(sizeof(((where_).field_)[0]) == 1,        \
                              "hwaddress is not a byte array"); \
index 9ce6f6c2a7c96e7e6b379bef6792ec48e0a59407..0462e54e503dbf4668c4983ef37a87233cfb76e4 100644 (file)
@@ -10,7 +10,7 @@
 
 # include <unistd.h>
 # include <sys/socket.h>
-#include "scno.h"
+# include "scno.h"
 
 # if defined __NR_socketcall && defined __sparc__
 /*
index 8f9f5b1ecc266e82a3e880e20af4274307cf6ba8..69030dbf31daf07288c81e664ff1c3f97ed58b10 100644 (file)
@@ -142,7 +142,7 @@ print_addr64(const char *pfx, uint64_t addr)
 static void
 print_tls(const char *pfx, uint64_t arg_ptr, enum validity_flags vf)
 {
-# if defined HAVE_STRUCT_USER_DESC && defined __i386__
+#if defined HAVE_STRUCT_USER_DESC && defined __i386__
        if (!(vf & TLS_VALID)) {
                print_addr64(pfx, arg_ptr);
                return;
@@ -169,9 +169,9 @@ print_tls(const char *pfx, uint64_t arg_ptr, enum validity_flags vf)
               arg->limit_in_pages,
               arg->seg_not_present,
               arg->useable);
-# else
+#else
        print_addr64(pfx, arg_ptr);
-# endif
+#endif
 }
 
 static inline void
@@ -278,13 +278,13 @@ main(int argc, char *argv[])
        int *parent_tid = tail_alloc(sizeof(*parent_tid));
        long rc;
 
-# if defined HAVE_STRUCT_USER_DESC
+#if defined HAVE_STRUCT_USER_DESC
        struct user_desc *tls = tail_alloc(sizeof(*tls));
 
        fill_memory(tls, sizeof(*tls));
-# else
+#else
        int *tls = tail_alloc(sizeof(*tls));
-# endif
+#endif
 
        *pidfd = 0xbadc0ded;
        *child_tid = 0xdeadface;
index c5738a5df0cb817c67f6625ad032a6b46a85b6b4..221d5f3a6024a64f6eb35a0c6e86e22a3aa4ce3f 100644 (file)
@@ -17,7 +17,7 @@
 #else
 
 # include "tests.h"
-#include "scno.h"
+# include "scno.h"
 
 # ifdef __NR_getgroups
 
index cd976baa8e15d6f87152203bd947d8a37f0082c5..6a3513da387d7e2f3edb5f813008f88cbf2d0053 100644 (file)
@@ -16,7 +16,7 @@
 # include <string.h>
 # include <unistd.h>
 # include <sys/ioctl.h>
-#include "scno.h"
+# include "scno.h"
 # include <linux/perf_event.h>
 
 /*
index 6045ef70de7bd00178178caf1f3710efe830b8e5..d60c86c1dc0c861836079c55e54ef06710c3c004 100644 (file)
@@ -17,7 +17,7 @@
 #else
 
 # include "tests.h"
-#include "scno.h"
+# include "scno.h"
 
 # ifdef __NR_setgroups