Merge pull request #22939 from yuwata/tree-wide-space

tree-wide: add space after if, switch, for, and while
This commit is contained in:
Yu Watanabe
2022-04-02 01:32:26 +09:00
committed by GitHub
57 changed files with 88 additions and 82 deletions

View File

@@ -2,7 +2,7 @@
BEGIN{
print "const char *arphrd_to_name(int id) {"
print " switch(id) {"
print " switch (id) {"
}
!/^HDLC$/ {
printf " case ARPHRD_%s: return \"%s\";\n", $1, $1

View File

@@ -162,7 +162,7 @@ struct _packed_ indirect_storage {
unsigned n_buckets; /* number of buckets */
unsigned idx_lowest_entry; /* Index below which all buckets are free.
Makes "while(hashmap_steal_first())" loops
Makes "while (hashmap_steal_first())" loops
O(n) instead of O(n^2) for unordered hashmaps. */
uint8_t _pad[3]; /* padding for the whole HashmapBase */
/* The bitfields in HashmapBase complete the alignment of the whole thing. */

View File

@@ -228,7 +228,7 @@ struct cmsghdr* cmsg_find(struct msghdr *mh, int level, int type, socklen_t leng
({ \
const union sockaddr_union *__sa = &(sa); \
size_t _len; \
switch(__sa->sa.sa_family) { \
switch (__sa->sa.sa_family) { \
case AF_INET: \
_len = sizeof(struct sockaddr_in); \
break; \

View File

@@ -113,4 +113,4 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
fputc_unlocked('\n', stdout); \
} \
funlockfile(stdout); \
} while(false)
} while (false)

View File

@@ -70,7 +70,7 @@ int getxattr_at_malloc(
by_procfs = true; /* fgetxattr() is not going to work, go via /proc/ link right-away */
}
for(;;) {
for (;;) {
_cleanup_free_ char *v = NULL;
ssize_t n;

View File

@@ -35,7 +35,7 @@ static BOOLEAN verify_gpt(union GptHeaderBuffer *gpt_header_buffer, EFI_LBA lba_
h = &gpt_header_buffer->gpt_header;
/* Some superficial validation of the GPT header */
if(CompareMem(&h->Header.Signature, "EFI PART", sizeof(h->Header.Signature) != 0))
if (CompareMem(&h->Header.Signature, "EFI PART", sizeof(h->Header.Signature) != 0))
return FALSE;
if (h->Header.HeaderSize < 92 || h->Header.HeaderSize > 512)

View File

@@ -22,7 +22,7 @@ static int bpf_access_type(const char *acc) {
assert(acc);
for (; *acc; acc++)
switch(*acc) {
switch (*acc) {
case 'r':
r |= BPF_DEVCG_ACC_READ;
break;

View File

@@ -2162,7 +2162,7 @@ static int install_error(
for (size_t i = 0; i < n_changes; i++)
switch(changes[i].type_or_errno) {
switch (changes[i].type_or_errno) {
case 0 ... _UNIT_FILE_CHANGE_TYPE_MAX: /* not errors */
continue;

View File

@@ -69,7 +69,7 @@ static int audit_callback(
}
static int callback_type_to_priority(int type) {
switch(type) {
switch (type) {
case SELINUX_ERROR:
return LOG_ERR;

View File

@@ -304,7 +304,7 @@ int mac_smack_setup(bool *loaded_policy) {
assert(loaded_policy);
r = write_access2_rules("/etc/smack/accesses.d/");
switch(r) {
switch (r) {
case -ENOENT:
log_debug("Smack is not enabled in the kernel.");
return 0;
@@ -336,7 +336,7 @@ int mac_smack_setup(bool *loaded_policy) {
#endif
r = write_cipso2_rules("/etc/smack/cipso.d/");
switch(r) {
switch (r) {
case -ENOENT:
log_debug("Smack/CIPSO is not enabled in the kernel.");
return 0;
@@ -352,7 +352,7 @@ int mac_smack_setup(bool *loaded_policy) {
}
r = write_netlabel_rules("/etc/smack/netlabel.d/");
switch(r) {
switch (r) {
case -ENOENT:
log_debug("Smack/CIPSO is not enabled in the kernel.");
return 0;
@@ -368,7 +368,7 @@ int mac_smack_setup(bool *loaded_policy) {
}
r = write_onlycap_list();
switch(r) {
switch (r) {
case -ENOENT:
log_debug("Smack is not enabled in the kernel.");
break;

View File

@@ -439,7 +439,7 @@ static int peer_address_compare_func(const SocketPeer *x, const SocketPeer *y) {
if (r != 0)
return r;
switch(x->peer.sa.sa_family) {
switch (x->peer.sa.sa_family) {
case AF_INET:
return memcmp(&x->peer.in.sin_addr, &y->peer.in.sin_addr, sizeof(x->peer.in.sin_addr));
case AF_INET6:

View File

@@ -233,7 +233,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argv);
while ((c = getopt_long(argc, argv, "hA:o:F:1D:rS:U:qn:", options, NULL)) >= 0)
switch(c) {
switch (c) {
case 'h':
return verb_help(0, NULL, NULL);

View File

@@ -252,23 +252,23 @@
CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
(CASE_F,__VA_ARGS__)
#define IN_SET(x, ...) \
({ \
sd_bool _found = sd_false; \
#define IN_SET(x, ...) \
({ \
sd_bool _found = sd_false; \
/* If the build breaks in the line below, you need to extend the case macros. (We use "long double" as \
* type for the array, in the hope that checkers such as ubsan don't complain that the initializers for \
* the array are not representable by the base type. Ideally we'd use typeof(x) as base type, but that \
* doesn't work, as we want to use this on bitfields and gcc refuses typeof() on bitfields.) */ \
static const long double __assert_in_set[] _unused_ = { __VA_ARGS__ }; \
assert_cc(ELEMENTSOF(__assert_in_set) <= 20); \
switch(x) { \
FOR_EACH_MAKE_CASE(__VA_ARGS__) \
_found = sd_true; \
break; \
default: \
break; \
} \
_found; \
assert_cc(ELEMENTSOF(__assert_in_set) <= 20); \
switch (x) { \
FOR_EACH_MAKE_CASE(__VA_ARGS__) \
_found = sd_true; \
break; \
default: \
break; \
} \
_found; \
})
/* Takes inspiration from Rust's Option::take() method: reads and returns a pointer, but at the same time

View File

@@ -353,7 +353,7 @@ try_acpi:
* http://www.acpi.info/DOWNLOADS/ACPIspec50.pdf
*/
switch(t) {
switch (t) {
case 1: /* Desktop */
case 3: /* Workstation */

View File

@@ -74,7 +74,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argv);
while ((c = getopt_long(argc, argv, "ust:r:h", options, NULL)) >= 0)
switch(c) {
switch (c) {
case 'h':
return help();

View File

@@ -911,7 +911,7 @@ static int parse_argv(int argc, char *argv[]) {
while ((c = getopt_long(argc, argv, "hD:", options, NULL)) >= 0)
switch(c) {
switch (c) {
case 'h':
return help();

View File

@@ -858,7 +858,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argv);
while ((c = getopt_long(argc, argv, "ho:", options, NULL)) >= 0)
switch(c) {
switch (c) {
case 'h':
return help();

View File

@@ -104,7 +104,7 @@ int journal_remote_get_writer(RemoteServer *s, const char *host, Writer **writer
const void *key;
int r;
switch(s->split_mode) {
switch (s->split_mode) {
case JOURNAL_WRITE_SPLIT_NONE:
key = "one and only";
break;
@@ -495,7 +495,7 @@ static int accept_connection(
return log_error_errno(errno, "accept() on fd:%d failed: %m", fd);
}
switch(socket_address_family(addr)) {
switch (socket_address_family(addr)) {
case AF_INET:
case AF_INET6: {
_cleanup_free_ char *a = NULL;

View File

@@ -24,7 +24,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
for (;;) {
switch(u->entry_state) {
switch (u->entry_state) {
case ENTRY_CURSOR: {
u->current_cursor = mfree(u->current_cursor);

View File

@@ -668,7 +668,7 @@ static int parse_argv(int argc, char *argv[]) {
opterr = 0;
while ((c = getopt_long(argc, argv, "hu:mM:D:", options, NULL)) >= 0)
switch(c) {
switch (c) {
case 'h':
return help();

Some files were not shown because too many files have changed in this diff Show More