diff options
56 files changed, 87 insertions, 81 deletions
diff --git a/src/basic/arphrd-to-name.awk b/src/basic/arphrd-to-name.awk index d25a4e9bcb..302504b651 100644 --- a/src/basic/arphrd-to-name.awk +++ b/src/basic/arphrd-to-name.awk @@ -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 diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c index bd7a6b0d6e..1855367072 100644 --- a/src/basic/hashmap.c +++ b/src/basic/hashmap.c @@ -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. */ diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h index 57e655154c..2fd1a2a165 100644 --- a/src/basic/socket-util.h +++ b/src/basic/socket-util.h @@ -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; \ diff --git a/src/basic/string-table.h b/src/basic/string-table.h index 97c1adc07d..e3a26a623c 100644 --- a/src/basic/string-table.h +++ b/src/basic/string-table.h @@ -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) diff --git a/src/basic/xattr-util.c b/src/basic/xattr-util.c index ac4fd7b1c5..0b661d9325 100644 --- a/src/basic/xattr-util.c +++ b/src/basic/xattr-util.c @@ -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; diff --git a/src/boot/efi/xbootldr.c b/src/boot/efi/xbootldr.c index 6fa7e49e5d..793e3949b2 100644 --- a/src/boot/efi/xbootldr.c +++ b/src/boot/efi/xbootldr.c @@ -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) diff --git a/src/core/bpf-devices.c b/src/core/bpf-devices.c index f62c6f1931..46996d28f4 100644 --- a/src/core/bpf-devices.c +++ b/src/core/bpf-devices.c @@ -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; diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 572c59dda4..6bf4e6bf76 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -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; diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c index ad098e99df..d77901caa5 100644 --- a/src/core/selinux-access.c +++ b/src/core/selinux-access.c @@ -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; diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c index f88cb80834..b76bb74465 100644 --- a/src/core/smack-setup.c +++ b/src/core/smack-setup.c @@ -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; diff --git a/src/core/socket.c b/src/core/socket.c index 802c6afde6..0d96f1a933 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -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: diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c index 7235544285..01e922a962 100644 --- a/src/coredump/coredumpctl.c +++ b/src/coredump/coredumpctl.c @@ -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); diff --git a/src/fundamental/macro-fundamental.h b/src/fundamental/macro-fundamental.h index 15b93165dc..1c198f6ad9 100644 --- a/src/fundamental/macro-fundamental.h +++ b/src/fundamental/macro-fundamental.h @@ -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 diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 5d381e157b..6c69818230 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -353,7 +353,7 @@ try_acpi: * http://www.acpi.info/DOWNLOADS/ACPIspec50.pdf */ - switch(t) { + switch (t) { case 1: /* Desktop */ case 3: /* Workstation */ diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c index 26c8d66067..e70354e444 100644 --- a/src/hwdb/hwdb.c +++ b/src/hwdb/hwdb.c @@ -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(); diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index 38972fe1a9..8fb07bc02f 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -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(); diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c index 7c3c9ff44a..4fe5812d2f 100644 --- a/src/journal-remote/journal-remote-main.c +++ b/src/journal-remote/journal-remote-main.c @@ -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(); diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index d1f394b027..e8fe04165e 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -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; diff --git a/src/journal-remote/journal-upload-journal.c b/src/journal-remote/journal-upload-journal.c index 164ed6590c..cf9c760202 100644 --- a/src/journal-remote/journal-upload-journal.c +++ b/src/journal-remote/journal-upload-journal.c @@ -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); diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c index 6ccea604e6..db6cedfb16 100644 --- a/src/journal-remote/journal-upload.c +++ b/src/journal-remote/journal-upload.c @@ -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(); diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 2b3d3dc037..fa091b1131 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -772,7 +772,7 @@ static void server_cache_hostname(Server *s) { } static bool shall_try_append_again(JournalFile *f, int r) { - switch(r) { + switch (r) { case -E2BIG: /* Hit configured limit */ case -EFBIG: /* Hit fs limit */ diff --git a/src/libsystemd-network/dhcp6-option.c b/src/libsystemd-network/dhcp6-option.c index 4e6ee7970e..eccfbe8b65 100644 --- a/src/libsystemd-network/dhcp6-option.c +++ b/src/libsystemd-network/dhcp6-option.c @@ -548,7 +548,7 @@ static int dhcp6_option_parse_ia_options(sd_dhcp6_client *client, const uint8_t assert(buf || buflen == 0); - for(size_t offset = 0; offset < buflen;) { + for (size_t offset = 0; offset < buflen;) { const uint8_t *data; size_t data_len; uint16_t code; @@ -557,7 +557,7 @@ static int dhcp6_option_parse_ia_options(sd_dhcp6_client *client, const uint8_t if (r < 0) return r; - switch(code) { + switch (code) { case SD_DHCP6_OPTION_STATUS_CODE: { _cleanup_free_ char *msg = NULL; diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index e8534e8e86..d2c6361cb8 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -247,7 +247,7 @@ int sd_dhcp_client_set_request_option(sd_dhcp_client *client, uint8_t option) { assert_return(client, -EINVAL); assert_return(IN_SET(client->state, DHCP_STATE_INIT, DHCP_STATE_STOPPED), -EBUSY); - switch(option) { + switch (option) { case SD_DHCP_OPTION_PAD: case SD_DHCP_OPTION_OVERLOAD: diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c index e6e0e08ab2..8de7c671df 100644 --- a/src/libsystemd-network/sd-dhcp-lease.c +++ b/src/libsystemd-network/sd-dhcp-lease.c @@ -629,7 +629,7 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const void *option, void assert(lease); - switch(code) { + switch (code) { case SD_DHCP_OPTION_IP_ADDRESS_LEASE_TIME: r = lease_parse_u32(option, len, &lease->lifetime, 1); diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c index 64f5286ead..5c9ba9f618 100644 --- a/src/libsystemd-network/sd-dhcp-server.c +++ b/src/libsystemd-network/sd-dhcp-server.c @@ -737,7 +737,7 @@ static int parse_request(uint8_t code, uint8_t len, const void *option, void *us assert(req); - switch(code) { + switch (code) { case SD_DHCP_OPTION_IP_ADDRESS_LEASE_TIME: if (len == 4) req->lifetime = unaligned_read_be32(option); @@ -1096,7 +1096,7 @@ int dhcp_server_handle_message(sd_dhcp_server *server, DHCPMessage *message, siz existing_lease = hashmap_get(server->bound_leases_by_client_id, &req->client_id); static_lease = hashmap_get(server->static_leases_by_client_id, &req->client_id); - switch(type) { + switch (type) { case DHCP_DISCOVER: { be32_t address = INADDR_ANY; diff --git a/src/libsystemd-network/sd-dhcp6-lease.c b/src/libsystemd-network/sd-dhcp6-lease.c index 8734e5a824..a4cc2c920c 100644 --- a/src/libsystemd-network/sd-dhcp6-lease.c +++ b/src/libsystemd-network/sd-dhcp6-lease.c @@ -338,7 +338,7 @@ int dhcp6_lease_add_ntp(sd_dhcp6_lease *lease, const uint8_t *optval, size_t opt if (r < 0) return r; - switch(subopt) { + switch (subopt) { case DHCP6_NTP_SUBOPTION_SRV_ADDR: case DHCP6_NTP_SUBOPTION_MC_ADDR: if (sublen != 16) diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c index 7497c3ef3a..fb86e6c994 100644 --- a/src/libsystemd-network/test-dhcp-client.c +++ b/src/libsystemd-network/test-dhcp-client.c @@ -156,7 +156,7 @@ static void test_dhcp_identifier_set_iaid(void) { } static int check_options(uint8_t code, uint8_t len, const void *option, void *userdata) { - switch(code) { + switch (code) { case SD_DHCP_OPTION_CLIENT_IDENTIFIER: { uint32_t iaid; diff --git a/src/libsystemd-network/test-dhcp-option.c b/src/libsystemd-network/test-dhcp-option.c index b01b1f57a3..ec4f9706d5 100644 --- a/src/libsystemd-network/test-dhcp-option.c +++ b/src/libsystemd-network/test-dhcp-option.c @@ -53,7 +53,7 @@ static struct option_desc option_tests[] = { }; static const char *dhcp_type(int type) { - switch(type) { + switch (type) { case DHCP_DISCOVER: return "DHCPDISCOVER"; case DHCP_OFFER: @@ -125,7 +125,7 @@ static void test_ignore_opts(uint8_t *descoption, int *descpos, int *desclen) { assert_se(*descpos >= 0); while (*descpos < *desclen) { - switch(descoption[*descpos]) { + switch (descoption[*descpos]) { case SD_DHCP_OPTION_PAD: *descpos += 1; break; diff --git a/src/libsystemd-network/test-ipv4ll.c b/src/libsystemd-network/test-ipv4ll.c index e90e73459d..44d0bfe17c 100644 --- a/src/libsystemd-network/test-ipv4ll.c +++ b/src/libsystemd-network/test-ipv4ll.c @@ -29,7 +29,7 @@ static void* basic_request_handler_userdata = (void*) 0xCABCAB; static void basic_request_handler(sd_ipv4ll *ll, int event, void *userdata) { assert_se(userdata == basic_request_handler_userdata); - switch(event) { + switch (event) { case SD_IPV4LL_EVENT_STOP: basic_request_handler_stop = 1; break; diff --git a/src/libsystemd/sd-journal/audit_type-to-name.awk b/src/libsystemd/sd-journal/audit_type-to-name.awk index 1657866a6a..a859c44d45 100644 --- a/src/libsystemd/sd-journal/audit_type-to-name.awk +++ b/src/libsystemd/sd-journal/audit_type-to-name.awk @@ -1,11 +1,14 @@ # SPDX-License-Identifier: LGPL-2.1-or-later BEGIN{ - print "const char *audit_type_to_string(int type) {\n\tswitch(type) {" + print "const char *audit_type_to_string(int type) {" + print " switch (type) {" } { printf " case AUDIT_%s: return \"%s\";\n", $1, $1 } END{ - print " default: return NULL;\n\t}\n}\n" + print " default: return NULL;" + print " }" + print "}" } diff --git a/src/libsystemd/sd-netlink/netlink-message-rtnl.c b/src/libsystemd/sd-netlink/netlink-message-rtnl.c index 56fb74727e..87b1c3c3c8 100644 --- a/src/libsystemd/sd-netlink/netlink-message-rtnl.c +++ b/src/libsystemd/sd-netlink/netlink-message-rtnl.c @@ -277,7 +277,7 @@ int sd_rtnl_message_new_nexthop(sd_netlink *rtnl, sd_netlink_message **ret, int r; assert_return(rtnl_message_type_is_nexthop(nlmsg_type), -EINVAL); - switch(nlmsg_type) { + switch (nlmsg_type) { case RTM_DELNEXTHOP: assert_return(nh_family == AF_UNSPEC, -EINVAL); _fallthrough_; diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c index 051dac95c2..0a2a3effb2 100644 --- a/src/libsystemd/sd-netlink/netlink-types.c +++ b/src/libsystemd/sd-netlink/netlink-types.c @@ -63,7 +63,7 @@ int type_system_root_get_type_system_and_header_size( if (IN_SET(type, NLMSG_DONE, NLMSG_ERROR)) nl_type = type_system_get_type(&basic_type_system, type); else - switch(nl->protocol) { + switch (nl->protocol) { case NETLINK_ROUTE: nl_type = rtnl_get_type(type); break; diff --git a/src/libsystemd/sd-path/sd-path.c b/src/libsystemd/sd-path/sd-path.c index 385cfd3006..ac33e349c0 100644 --- a/src/libsystemd/sd-path/sd-path.c +++ b/src/libsystemd/sd-path/sd-path.c @@ -516,7 +516,7 @@ static int get_search(uint64_t type, char ***list) { assert(list); - switch(type) { + switch (type) { case SD_PATH_SEARCH_BINARIES: return search_from_environment(list, diff --git a/src/partition/growfs.c b/src/partition/growfs.c index af6a9ef600..0d1da2773f 100644 --- a/src/partition/growfs.c +++ b/src/partition/growfs.c @@ -165,7 +165,7 @@ static int parse_argv(int argc, char *argv[]) { assert(argv); while ((c = getopt_long(argc, argv, "hn", options, NULL)) >= 0) - switch(c) { + switch (c) { case 'h': return help(); diff --git a/src/resolve/dns_type-to-name.awk b/src/resolve/dns_type-to-name.awk index 2d9794b761..92187d5652 100644 --- a/src/resolve/dns_type-to-name.awk +++ b/src/resolve/dns_type-to-name.awk @@ -1,7 +1,8 @@ # SPDX-License-Identifier: LGPL-2.1-or-later BEGIN{ - print "const char *dns_type_to_string(int type) {\n\tswitch(type) {" + print "const char *dns_type_to_string(int type) {" + print " switch (type) {" } { printf " case DNS_TYPE_%s: return ", $1; @@ -9,5 +10,7 @@ BEGIN{ printf "\"%s\";\n", $1 } END{ - print " default: return NULL;\n\t}\n}\n" + print " default: return NULL;" + print " }" + print "}" } diff --git a/src/resolve/resolvconf-compat.c b/src/resolve/resolvconf-compat.c index bf73830e94..d95df29793 100644 --- a/src/resolve/resolvconf-compat.c +++ b/src/resolve/resolvconf-compat.c @@ -136,7 +136,7 @@ int resolvconf_parse_argv(int argc, char *argv[]) { arg_mode = _MODE_INVALID; while ((c = getopt_long(argc, argv, "hadxpfm:uIi:l:Rr:vV", options, NULL)) >= 0) - switch(c) { + switch (c) { case 'h': return resolvconf_help(); diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index 96a505f5e1..245c273fde 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -2753,7 +2753,7 @@ static int compat_parse_argv(int argc, char *argv[]) { assert(argv); while ((c = getopt_long(argc, argv, "h46i:t:c:p:", options, NULL)) >= 0) - switch(c) { + switch (c) { case 'h': return compat_help(); @@ -3048,7 +3048,7 @@ static int native_parse_argv(int argc, char *argv[]) { assert(argv); while ((c = getopt_long(argc, argv, "h46i:t:c:p:", options, NULL)) >= 0) - switch(c) { + switch (c) { case 'h': return native_help(); diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index 48b91d6870..50785a6823 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -102,7 +102,7 @@ void dns_packet_set_flags(DnsPacket *p, bool dnssec_checking_disabled, bool trun h = DNS_PACKET_HEADER(p); - switch(p->protocol) { + switch (p->protocol) { case DNS_PROTOCOL_LLMNR: assert(!truncated); diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c index 83140d79f8..ff271486d7 100644 --- a/src/resolve/resolved-dns-rr.c +++ b/src/resolve/resolved-dns-rr.c @@ -403,7 +403,7 @@ static DnsResourceRecord* dns_resource_record_free(DnsResourceRecord *rr) { assert(rr); if (rr->key) { - switch(rr->key->type) { + switch (rr->key->type) { case DNS_TYPE_SRV: free(rr->srv.name); @@ -1166,7 +1166,7 @@ ssize_t dns_resource_record_payload(DnsResourceRecord *rr, void **out) { assert(rr); assert(out); - switch(rr->unparsable ? _DNS_TYPE_INVALID : rr->key->type) { + switch (rr->unparsable ? _DNS_TYPE_INVALID : rr->key->type) { case DNS_TYPE_SRV: case DNS_TYPE_PTR: case DNS_TYPE_NS: diff --git a/src/resolve/resolved-dnstls-gnutls.c b/src/resolve/resolved-dnstls-gnutls.c index 8c8628ebbb..acdad6fa91 100644 --- a/src/resolve/resolved-dnstls-gnutls.c +++ b/src/resolve/resolved-dnstls-gnutls.c @@ -185,7 +185,7 @@ ssize_t dnstls_stream_writev(DnsStream *stream, const struct iovec *iov, size_t ss = gnutls_record_uncork(stream->dnstls_data.session, 0); if (ss < 0) - switch(ss) { + switch (ss) { case GNUTLS_E_INTERRUPTED: return -EINTR; case GNUTLS_E_AGAIN: @@ -209,7 +209,7 @@ ssize_t dnstls_stream_read(DnsStream *stream, void *buf, size_t count) { ss = gnutls_record_recv(stream->dnstls_data.session, buf, count); if (ss < 0) - switch(ss) { + switch (ss) { case GNUTLS_E_INTERRUPTED: return -EINTR; case GNUTLS_E_AGAIN: diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 23aed96b48..aeea0a02d5 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -1074,7 +1074,7 @@ int config_parse_warn_compat( Disabled reason = ltype; - switch(reason) { + switch (reason) { case DISABLED_CONFIGURATION: log_syntax(unit, LOG_DEBUG, filename, line, 0, diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c index 6c9aeb1c6c..ef605346f2 100644 --- a/src/shared/ethtool-util.c +++ b/src/shared/ethtool-util.c @@ -393,7 +393,7 @@ int ethtool_get_permanent_hw_addr(int *ethtool_fd, const char *ifname, struct hw if (dest != _v) \ updated = true; \ dest = _v; \ - } while(false) + } while (false) #define UPDATE_WITH_MAX(dest, max, val, updated) \ do { \ @@ -404,7 +404,7 @@ int ethtool_get_permanent_hw_addr(int *ethtool_fd, const char *ifname, struct hw if (dest != _v) \ updated = true; \ dest = _v; \ - } while(false) + } while (false) int ethtool_set_wol( int *ethtool_fd, diff --git a/src/shared/in-addr-prefix-util.c b/src/shared/in-addr-prefix-util.c index f907949c22..e23b8f9d13 100644 --- a/src/shared/in-addr-prefix-util.c +++ b/src/shared/in-addr-prefix-util.c @@ -108,7 +108,7 @@ int in_addr_prefixes_reduce(Set *prefixes) { struct in_addr_prefix *p; SET_FOREACH(p, prefixes) - switch(p->family) { + switch (p->family) { case AF_INET: assert(p->prefixlen <= 32); if (p->prefixlen == 0) @@ -147,7 +147,7 @@ int in_addr_prefixes_reduce(Set *prefixes) { if (p->prefixlen == 0) continue; - switch(p->family) { + switch (p->family) { case AF_INET: prefixlens = ipv4_prefixlens; n = &ipv4_n_prefixlens; diff --git a/src/shared/install.c b/src/shared/install.c index 8e81ec41bf..58bccdcaa8 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -330,7 +330,7 @@ void unit_file_dump_changes(int r, const char *verb, const UnitFileChange *chang for (size_t i = 0; i < n_changes; i++) { assert(verb || changes[i].type_or_errno >= 0); - switch(changes[i].type_or_errno) { + switch (changes[i].type_or_errno) { case UNIT_FILE_SYMLINK: if (!quiet) log_info("Created symlink %s %s %s.", diff --git a/src/shared/journal-importer.c b/src/shared/journal-importer.c index c6caf9330a..7c355b6c89 100644 --- a/src/shared/journal-importer.c +++ b/src/shared/journal-importer.c @@ -281,7 +281,7 @@ static int process_special_field(JournalImporter *imp, char *line) { int journal_importer_process_data(JournalImporter *imp) { int r; - switch(imp->state) { + switch (imp->state) { case IMPORTER_STATE_LINE: { char *line, *sep; size_t n = 0; diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c index 694c0383f5..78f06b25fe 100644 --- a/src/shared/mount-util.c +++ b/src/shared/mount-util.c @@ -531,7 +531,7 @@ int mode_to_inaccessible_node( if (!runtime_dir) runtime_dir = "/run"; - switch(mode & S_IFMT) { + switch (mode & S_IFMT) { case S_IFREG: node = "/systemd/inaccessible/reg"; break; diff --git a/src/shared/seccomp-util.c b/src/shared/seccomp-util.c index e597a156cf..c465bf58dd 100644 --- a/src/shared/seccomp-util.c +++ b/src/shared/seccomp-util.c @@ -107,7 +107,7 @@ const char* seccomp_arch_to_string(uint32_t c) { * Names used here should be the same as those used for ConditionArchitecture=, * except for "subarchitectures" like x32. */ - switch(c) { + switch (c) { case SCMP_ARCH_NATIVE: return "native"; case SCMP_ARCH_X86: diff --git a/src/shared/service-util.c b/src/shared/service-util.c index 99b1108b77..68aa5775f5 100644 --- a/src/shared/service-util.c +++ b/src/shared/service-util.c @@ -58,7 +58,7 @@ int service_parse_argv( assert(argv); while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) - switch(c) { + switch (c) { case 'h': return help(argv[0], service, description, bus_objects); diff --git a/src/shared/udev-util.h b/src/shared/udev-util.h index a48beb95ea..ce016e88db 100644 --- a/src/shared/udev-util.h +++ b/src/shared/udev-util.h @@ -79,7 +79,7 @@ bool udev_available(void); (void) sd_device_get_syspath(_d, &_p); \ (void) sd_device_get_subsystem(_d, &_s); \ STAP_PROBEV(udev, name, device_action_to_string(_a), _n, _p, _s __VA_OPT__(,) __VA_ARGS__);\ - } while(false); + } while (false); #else #define DEVICE_TRACE_POINT(name, dev, ...) ((void) 0) #endif diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index f108529bbd..65e391d02a 100644 --- a/src/sleep/sleep.c +++ b/src/sleep/sleep.c @@ -352,7 +352,7 @@ static int parse_argv(int argc, char *argv[]) { assert(argv); while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) - switch(c) { + switch (c) { case 'h': return help(); diff --git a/src/test/test-alloc-util.c b/src/test/test-alloc-util.c index 05c3195d6e..f2064cf2ed 100644 --- a/src/test/test-alloc-util.c +++ b/src/test/test-alloc-util.c @@ -163,7 +163,7 @@ TEST(auto_erase_memory) { assert_se(MALLOC_SIZEOF_SAFE(f) >= sizeof(*f) * n); \ assert_se(malloc_usable_size(f) >= sizeof(*f) * n); \ assert_se(__builtin_object_size(f, 0) >= sizeof(*f) * n); \ - } while(false) + } while (false) TEST(malloc_size_safe) { _cleanup_free_ uint32_t *f = NULL; diff --git a/src/tmpfiles/test-offline-passwd.c b/src/tmpfiles/test-offline-passwd.c index 5978e69b86..b70cef4753 100644 --- a/src/tmpfiles/test-offline-passwd.c +++ b/src/tmpfiles/test-offline-passwd.c @@ -51,7 +51,7 @@ static int parse_argv(int argc, char *argv[]) { assert_se(argv); while ((c = getopt_long(argc, argv, "r:", options, NULL)) >= 0) - switch(c) { + switch (c) { case 'r': arg_root = optarg; break; diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c index cdb66bb3b7..85cf5201c6 100644 --- a/src/udev/cdrom_id/cdrom_id.c +++ b/src/udev/cdrom_id/cdrom_id.c @@ -541,7 +541,7 @@ static int dvd_ram_media_update_state(Context *c) { return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Invalid format capacities length."); - switch(format[8] & 3) { + switch (format[8] & 3) { case 1: /* This means that last format was interrupted or failed, blank dvd-ram discs are * factory formatted. Take no action here as it takes quite a while to reformat a diff --git a/src/udev/mtd_probe/probe_smartmedia.c b/src/udev/mtd_probe/probe_smartmedia.c index f4612ba4f9..368fab8827 100644 --- a/src/udev/mtd_probe/probe_smartmedia.c +++ b/src/udev/mtd_probe/probe_smartmedia.c @@ -61,7 +61,7 @@ int probe_smart_media(int mtd_fd, mtd_info_t* info) { return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Unexpected sector size: %i", sector_size); - switch(size_in_megs) { + switch (size_in_megs) { case 1: case 2: spare_count = 6; diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c index e9db2847cf..162b3516b8 100644 --- a/src/udev/udevadm-hwdb.c +++ b/src/udev/udevadm-hwdb.c @@ -48,7 +48,7 @@ static int parse_argv(int argc, char *argv[]) { int c; while ((c = getopt_long(argc, argv, "ust:r:Vh", options, NULL)) >= 0) - switch(c) { + switch (c) { case 'u': arg_update = true; break; diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index 66ddf3a779..a088c1727c 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -345,7 +345,7 @@ static int query_device(QueryType query, sd_device* device) { assert(device); - switch(query) { + switch (query) { case QUERY_NAME: { const char *node; |