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 2 months ago
parent
commit
08f0efbb79
3 changed files with 37 additions and 37 deletions
  1. 8
    8
      filter_seccomp.c
  2. 25
    25
      netlink_crypto.c
  3. 4
    4
      rtnl_neightbl.c

+ 8
- 8
filter_seccomp.c View File

@@ -491,10 +491,10 @@ binary_match_filter_generator(struct sock_filter *filter, bool *overflow)
491 491
 {
492 492
 	unsigned short pos = 0;
493 493
 
494
-#if SUPPORTED_PERSONALITIES > 1
494
+# if SUPPORTED_PERSONALITIES > 1
495 495
 	SET_BPF_STMT(&filter[pos++], BPF_LD | BPF_W | BPF_ABS,
496 496
 		     offsetof(struct seccomp_data, arch));
497
-#endif
497
+# endif
498 498
 
499 499
 	/* Personalities are iterated in reverse-order in the BPF program so that
500 500
 	 * the x86 case is naturally handled.  In x86, the first and third
@@ -509,14 +509,14 @@ binary_match_filter_generator(struct sock_filter *filter, bool *overflow)
509 509
 		unsigned int bitarray = 0;
510 510
 		unsigned int i;
511 511
 
512
-#if SUPPORTED_PERSONALITIES > 1
512
+# if SUPPORTED_PERSONALITIES > 1
513 513
 		SET_BPF_JUMP(&filter[pos++], BPF_JMP | BPF_JEQ | BPF_K,
514 514
 			     audit_arch_vec[p].arch, 0, JMP_PLACEHOLDER_NEXT);
515
-#endif
515
+# endif
516 516
 		SET_BPF_STMT(&filter[pos++], BPF_LD | BPF_W | BPF_ABS,
517 517
 			     offsetof(struct seccomp_data, nr));
518 518
 
519
-#if SUPPORTED_PERSONALITIES > 1
519
+# if SUPPORTED_PERSONALITIES > 1
520 520
 		if (audit_arch_vec[p].flag) {
521 521
 			SET_BPF_JUMP(&filter[pos++], BPF_JMP | BPF_JGE | BPF_K,
522 522
 				     audit_arch_vec[p].flag, 2, 0);
@@ -529,7 +529,7 @@ binary_match_filter_generator(struct sock_filter *filter, bool *overflow)
529 529
 			SET_BPF_STMT(&filter[pos++], BPF_ALU | BPF_AND | BPF_K,
530 530
 				     ~audit_arch_vec[p].flag);
531 531
 		}
532
-#endif
532
+# endif
533 533
 
534 534
 		/* X = 1 << nr % 32 = 1 << nr & 0x1F; */
535 535
 		SET_BPF_STMT(&filter[pos++], BPF_ALU | BPF_AND | BPF_K, 0x1F);
@@ -588,9 +588,9 @@ binary_match_filter_generator(struct sock_filter *filter, bool *overflow)
588 588
 		}
589 589
 	}
590 590
 
591
-#if SUPPORTED_PERSONALITIES > 1
591
+# if SUPPORTED_PERSONALITIES > 1
592 592
 	SET_BPF_STMT(&filter[pos++], BPF_RET | BPF_K, SECCOMP_RET_TRACE);
593
-#endif
593
+# endif
594 594
 
595 595
 	return pos;
596 596
 }

+ 25
- 25
netlink_crypto.c View File

@@ -8,24 +8,24 @@
8 8
 
9 9
 #include "defs.h"
10 10
 
11
-# include "netlink.h"
12
-# include "nlattr.h"
13
-# include "print_fields.h"
11
+#include "netlink.h"
12
+#include "nlattr.h"
13
+#include "print_fields.h"
14 14
 
15
-# if HAVE_LINUX_CRYPTOUSER_H
16
-#  include <linux/cryptouser.h>
17
-# endif
15
+#if HAVE_LINUX_CRYPTOUSER_H
16
+# include <linux/cryptouser.h>
17
+#endif
18 18
 
19
-# include "xlat/crypto_nl_attrs.h"
19
+#include "xlat/crypto_nl_attrs.h"
20 20
 
21
-# define XLAT_MACROS_ONLY
22
-#  include "xlat/crypto_msgs.h"
23
-# undef XLAT_MACROS_ONLY
21
+#define XLAT_MACROS_ONLY
22
+# include "xlat/crypto_msgs.h"
23
+#undef XLAT_MACROS_ONLY
24 24
 
25 25
 
26
-# ifndef CRYPTO_MAX_NAME
27
-#  define CRYPTO_MAX_NAME 64
28
-# endif
26
+#ifndef CRYPTO_MAX_NAME
27
+# define CRYPTO_MAX_NAME 64
28
+#endif
29 29
 
30 30
 typedef struct {
31 31
 	char cru_name[CRYPTO_MAX_NAME];
@@ -72,35 +72,35 @@ typedef struct {
72 72
 	uint32_t seedsize;
73 73
 } struct_crypto_report_rng;
74 74
 
75
-# ifdef HAVE_STRUCT_CRYPTO_USER_ALG
75
+#ifdef HAVE_STRUCT_CRYPTO_USER_ALG
76 76
 static_assert(sizeof(struct_crypto_user_alg) == sizeof(struct crypto_user_alg),
77 77
 	      "struct crypto_user_alg mismatch, please update the decoder");
78
-# endif
79
-# ifdef HAVE_STRUCT_CRYPTO_REPORT_HASH
78
+#endif
79
+#ifdef HAVE_STRUCT_CRYPTO_REPORT_HASH
80 80
 static_assert(sizeof(struct_crypto_report_hash)
81 81
 	      == sizeof(struct crypto_report_hash),
82 82
 	      "struct crypto_report_hash mismatch, please update the decoder");
83
-# endif
84
-# ifdef HAVE_STRUCT_CRYPTO_REPORT_CIPHER
83
+#endif
84
+#ifdef HAVE_STRUCT_CRYPTO_REPORT_CIPHER
85 85
 static_assert(sizeof(struct_crypto_report_cipher)
86 86
 	      == sizeof(struct crypto_report_cipher),
87 87
 	      "struct crypto_report_cipher mismatch, please update the decoder");
88
-# endif
89
-# ifdef HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER
88
+#endif
89
+#ifdef HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER
90 90
 static_assert(sizeof(struct_crypto_report_blkcipher)
91 91
 	      == sizeof(struct crypto_report_blkcipher),
92 92
 	      "struct crypto_report_blkcipher mismatch, please update the decoder");
93
-# endif
94
-# ifdef HAVE_STRUCT_CRYPTO_REPORT_AEAD
93
+#endif
94
+#ifdef HAVE_STRUCT_CRYPTO_REPORT_AEAD
95 95
 static_assert(sizeof(struct_crypto_report_aead)
96 96
 	      == sizeof(struct crypto_report_aead),
97 97
 	      "struct crypto_report_aead mismatch, please update the decoder");
98
-# endif
99
-# ifdef HAVE_STRUCT_CRYPTO_REPORT_RNG
98
+#endif
99
+#ifdef HAVE_STRUCT_CRYPTO_REPORT_RNG
100 100
 static_assert(sizeof(struct_crypto_report_rng)
101 101
 	      == sizeof(struct crypto_report_rng),
102 102
 	      "struct crypto_report_rng mismatch, please update the decoder");
103
-# endif
103
+#endif
104 104
 
105 105
 
106 106
 static bool

+ 4
- 4
rtnl_neightbl.c View File

@@ -47,14 +47,14 @@ typedef struct {
47 47
 	uint64_t ndts_table_fulls; /**< Added by v4.3-rc1~96^2~202 */
48 48
 } struct_ndt_stats;
49 49
 
50
-# ifdef HAVE_STRUCT_NDT_CONFIG
50
+#ifdef HAVE_STRUCT_NDT_CONFIG
51 51
 static_assert(sizeof(struct ndt_config) == sizeof(struct_ndt_config),
52 52
 	      "Unexpected struct ndt_config size, please update the decoder");
53
-# endif
54
-# ifdef HAVE_STRUCT_NDT_STATS
53
+#endif
54
+#ifdef HAVE_STRUCT_NDT_STATS
55 55
 static_assert(sizeof(struct ndt_stats) <= sizeof(struct_ndt_stats),
56 56
 	      "Unexpected struct ndt_stats size, please update the decoder");
57
-# endif
57
+#endif
58 58
 
59 59
 
60 60
 static bool

Loading…
Cancel
Save