From bfd5a0687fcc65e5617d5bab69ff653393f23e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 17 May 2024 08:54:00 +0200 Subject: [PATCH] various: move const ptr indicator to return value --- meson.build | 2 +- src/basic/af-list.c | 4 +-- src/basic/af-list.h | 2 +- src/basic/architecture.h | 2 +- src/basic/arphrd-util.h | 2 +- src/basic/cap-list.c | 4 +-- src/basic/cap-list.h | 4 +-- src/basic/confidential-virt.h | 2 +- src/basic/errno-list.c | 2 +- src/basic/errno-list.h | 2 +- src/basic/fd-util.c | 2 +- src/basic/fd-util.h | 2 +- src/basic/filesystems.c | 2 +- src/basic/filesystems.h | 2 +- src/basic/glyph-util.c | 2 +- src/basic/glyph-util.h | 8 +++--- src/basic/log.c | 2 +- src/basic/log.h | 6 ++--- src/basic/mountpoint-util.c | 2 +- src/basic/mountpoint-util.h | 2 +- src/basic/os-util.c | 2 +- src/basic/os-util.h | 2 +- src/basic/path-util.h | 2 +- src/basic/process-util.h | 4 +-- src/basic/rlimit-util.h | 2 +- src/basic/runtime-scope.h | 4 +-- src/basic/signal-util.c | 2 +- src/basic/signal-util.h | 2 +- src/basic/string-table.h | 2 +- src/basic/string-util.h | 8 +++--- src/basic/terminal-util.c | 2 +- src/basic/terminal-util.h | 8 +++--- src/basic/unit-def.c | 2 +- src/basic/unit-def.h | 16 ++++++------ src/basic/virt.h | 2 +- src/boot/bootctl-util.c | 2 +- src/boot/bootctl-util.h | 2 +- src/boot/bootctl.h | 2 +- src/core/cgroup.c | 4 +-- src/core/cgroup.h | 4 +-- src/core/execute.c | 2 +- src/core/execute.h | 2 +- src/core/kill.h | 4 +-- src/core/timer.h | 2 +- src/core/unit.c | 2 +- src/core/unit.h | 6 ++--- .../cryptsetup-tokens/cryptsetup-token.h | 2 +- src/home/home-util.c | 4 +-- src/home/home-util.h | 4 +-- src/home/homed-home.h | 2 +- src/journal/journald-server.h | 4 +-- src/libsystemd-network/dhcp-client-internal.h | 2 +- src/libsystemd-network/dhcp-duid-internal.h | 2 +- src/libsystemd-network/dhcp6-protocol.h | 6 ++--- src/libsystemd/sd-bus/bus-internal.c | 2 +- src/libsystemd/sd-bus/bus-internal.h | 2 +- src/libsystemd/sd-device/device-private.h | 2 +- src/libsystemd/sd-journal/audit-type.h | 2 +- src/libsystemd/sd-json/sd-json.c | 2 +- src/libudev/libudev.h | 26 +++++++++---------- src/login/logind-inhibit.c | 2 +- src/login/logind-inhibit.h | 4 +-- src/login/logind-session.h | 2 +- src/machine/machine.h | 2 +- src/network/netdev/bareudp.h | 2 +- src/network/netdev/fou-tunnel.h | 2 +- src/network/netdev/geneve.h | 2 +- src/network/netdev/netdev-util.h | 2 +- src/network/netdev/netdev.h | 2 +- src/network/netdev/tunnel.h | 2 +- src/network/netdev/vxlan.h | 2 +- src/network/networkd-dhcp-common.h | 2 +- src/network/networkd-link.h | 2 +- src/network/networkd-route-util.h | 2 +- src/network/networkd-routing-policy-rule.h | 2 +- src/network/networkd-util.h | 12 ++++----- src/nspawn/nspawn-settings.h | 6 ++--- src/portable/portable.h | 4 +-- src/resolve/dns-type.c | 2 +- src/resolve/dns-type.h | 10 +++---- src/resolve/resolved-dns-packet.c | 6 ++--- src/resolve/resolved-dns-packet.h | 6 ++--- src/resolve/resolved-dns-query.c | 2 +- src/resolve/resolved-dns-query.h | 2 +- src/resolve/resolved-dns-question.c | 2 +- src/resolve/resolved-dns-question.h | 2 +- src/resolve/resolved-dns-rr.c | 2 +- src/resolve/resolved-dns-server.c | 4 +-- src/resolve/resolved-dns-server.h | 4 +-- src/shared/bond-util.h | 16 ++++++------ src/shared/bpf-program.h | 2 +- src/shared/bridge-util.h | 2 +- src/shared/cryptsetup-util.c | 2 +- src/shared/cryptsetup-util.h | 2 +- src/shared/discover-image.h | 2 +- src/shared/dissect-image.h | 2 +- src/shared/ethtool-util.h | 8 +++--- src/shared/firewall-util-private.h | 2 +- src/shared/firewall-util.h | 4 +-- src/shared/geneve-util.h | 2 +- src/shared/gpt.c | 6 ++--- src/shared/gpt.h | 6 ++--- src/shared/group-record.c | 2 +- src/shared/group-record.h | 2 +- src/shared/install.h | 8 +++--- src/shared/ip-protocol-list.c | 4 +-- src/shared/ip-protocol-list.h | 4 +-- src/shared/ipvlan-util.h | 4 +-- src/shared/macvlan-util.h | 2 +- src/shared/netif-naming-scheme.h | 4 +-- src/shared/netif-util.c | 2 +- src/shared/netif-util.h | 2 +- src/shared/nsflags.c | 2 +- src/shared/nsflags.h | 2 +- src/shared/pretty-print.h | 4 +-- src/shared/seccomp-util.h | 2 +- src/shared/socket-netlink.c | 2 +- src/shared/socket-netlink.h | 2 +- src/shared/tests.c | 2 +- src/shared/tests.h | 2 +- src/shared/tpm2-event-log.c | 2 +- src/shared/tpm2-event-log.h | 2 +- src/shared/tpm2-util.c | 12 ++++----- src/shared/tpm2-util.h | 14 +++++----- src/shared/user-record-show.c | 2 +- src/shared/user-record-show.h | 2 +- src/shared/user-record.c | 20 +++++++------- src/shared/user-record.h | 22 ++++++++-------- src/shared/watchdog.c | 2 +- src/shared/watchdog.h | 2 +- src/shared/wifi-util.h | 4 +-- src/systemd/sd-device.h | 20 +++++++------- src/sysupdate/sysupdate-resource.h | 4 +-- src/sysupdate/sysupdate-update-set.c | 4 +-- src/sysupdate/sysupdate-update-set.h | 4 +-- src/udev/net/link-config.h | 2 +- src/udev/udev-builtin.c | 2 +- src/udev/udev-builtin.h | 2 +- src/udev/udev-rules.h | 2 +- src/vmspawn/vmspawn-settings.h | 2 +- src/vmspawn/vmspawn-util.h | 4 +-- 141 files changed, 272 insertions(+), 272 deletions(-) diff --git a/meson.build b/meson.build index 82350df5b44..dd335c12445 100644 --- a/meson.build +++ b/meson.build @@ -723,7 +723,7 @@ gperf = find_program('gperf') gperf_test_format = ''' #include -const char * in_word_set(const char *, @0@); +const char* in_word_set(const char *, @0@); @1@ ''' gperf_snippet = run_command(sh, '-c', 'echo foo,bar | "$1" -L ANSI-C', '_', gperf, diff --git a/src/basic/af-list.c b/src/basic/af-list.c index a9ab891e20d..91a20b2e0c0 100644 --- a/src/basic/af-list.c +++ b/src/basic/af-list.c @@ -12,7 +12,7 @@ static const struct af_name* lookup_af(register const char *str, register GPERF_ #include "af-from-name.h" #include "af-to-name.h" -const char *af_to_name(int id) { +const char* af_to_name(int id) { if (id <= 0) return NULL; @@ -39,7 +39,7 @@ int af_max(void) { return ELEMENTSOF(af_names); } -const char *af_to_ipv4_ipv6(int id) { +const char* af_to_ipv4_ipv6(int id) { /* Pretty often we want to map the address family to the typically used protocol name for IPv4 + * IPv6. Let's add special helpers for that. */ return id == AF_INET ? "ipv4" : diff --git a/src/basic/af-list.h b/src/basic/af-list.h index 9592b9ed3c9..e17762a35c0 100644 --- a/src/basic/af-list.h +++ b/src/basic/af-list.h @@ -5,7 +5,7 @@ #include "string-util.h" -const char *af_to_name(int id); +const char* af_to_name(int id); int af_from_name(const char *name); static inline const char* af_to_name_short(int id) { diff --git a/src/basic/architecture.h b/src/basic/architecture.h index 788f3abc37f..26aa9f405e3 100644 --- a/src/basic/architecture.h +++ b/src/basic/architecture.h @@ -242,5 +242,5 @@ Architecture uname_architecture(void); # error "Please register your architecture here!" #endif -const char *architecture_to_string(Architecture a) _const_; +const char* architecture_to_string(Architecture a) _const_; Architecture architecture_from_string(const char *s) _pure_; diff --git a/src/basic/arphrd-util.h b/src/basic/arphrd-util.h index 33f5694abd0..0fd75a04363 100644 --- a/src/basic/arphrd-util.h +++ b/src/basic/arphrd-util.h @@ -4,7 +4,7 @@ #include #include -const char *arphrd_to_name(int id); +const char* arphrd_to_name(int id); int arphrd_from_name(const char *name); size_t arphrd_to_hw_addr_len(uint16_t arphrd); diff --git a/src/basic/cap-list.c b/src/basic/cap-list.c index 80d48c142e3..b4fe75a37e8 100644 --- a/src/basic/cap-list.c +++ b/src/basic/cap-list.c @@ -18,7 +18,7 @@ static const struct capability_name* lookup_capability(register const char *str, #include "cap-from-name.h" #include "cap-to-name.h" -const char *capability_to_name(int id) { +const char* capability_to_name(int id) { if (id < 0) return NULL; if (id >= capability_list_length()) @@ -27,7 +27,7 @@ const char *capability_to_name(int id) { return capability_names[id]; } -const char *capability_to_string(int id, char buf[static CAPABILITY_TO_STRING_MAX]) { +const char* capability_to_string(int id, char buf[static CAPABILITY_TO_STRING_MAX]) { const char *p; if (id < 0) diff --git a/src/basic/cap-list.h b/src/basic/cap-list.h index 3028197b56a..95b03c48ddc 100644 --- a/src/basic/cap-list.h +++ b/src/basic/cap-list.h @@ -8,8 +8,8 @@ * "0x", two bytes for the hex value, and one trailing NUL byte. */ #define CAPABILITY_TO_STRING_MAX (2 + 2 + 1) -const char *capability_to_name(int id); -const char *capability_to_string(int id, char buf[static CAPABILITY_TO_STRING_MAX]); +const char* capability_to_name(int id); +const char* capability_to_string(int id, char buf[static CAPABILITY_TO_STRING_MAX]); #define CAPABILITY_TO_STRING(id) capability_to_string(id, (char[CAPABILITY_TO_STRING_MAX]) {}) int capability_from_name(const char *name); diff --git a/src/basic/confidential-virt.h b/src/basic/confidential-virt.h index c02f3b23217..ed749948379 100644 --- a/src/basic/confidential-virt.h +++ b/src/basic/confidential-virt.h @@ -21,5 +21,5 @@ typedef enum ConfidentialVirtualization { ConfidentialVirtualization detect_confidential_virtualization(void); -const char *confidential_virtualization_to_string(ConfidentialVirtualization v) _const_; +const char* confidential_virtualization_to_string(ConfidentialVirtualization v) _const_; ConfidentialVirtualization confidential_virtualization_from_string(const char *s) _pure_; diff --git a/src/basic/errno-list.c b/src/basic/errno-list.c index 2aeb38c438d..ba0f7c16283 100644 --- a/src/basic/errno-list.c +++ b/src/basic/errno-list.c @@ -12,7 +12,7 @@ static const struct errno_name* lookup_errno(register const char *str, #include "errno-from-name.h" #include "errno-to-name.h" -const char *errno_to_name(int id) { +const char* errno_to_name(int id) { if (id < 0) id = -id; diff --git a/src/basic/errno-list.h b/src/basic/errno-list.h index 082b833e491..81c193df12e 100644 --- a/src/basic/errno-list.h +++ b/src/basic/errno-list.h @@ -8,7 +8,7 @@ */ #define ERRNO_MAX 4095 -const char *errno_to_name(int id); +const char* errno_to_name(int id); int errno_from_name(const char *name); static inline bool errno_is_valid(int n) { return n > 0 && n <= ERRNO_MAX; diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c index 298477ed0de..b4d11fa4628 100644 --- a/src/basic/fd-util.c +++ b/src/basic/fd-util.c @@ -1091,7 +1091,7 @@ int fds_are_same_mount(int fd1, int fd2) { return statx_mount_same(&st1.nsx, &st2.nsx); } -const char *accmode_to_string(int flags) { +const char* accmode_to_string(int flags) { switch (flags & O_ACCMODE) { case O_RDONLY: return "ro"; diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h index a047c3a3f41..4080b67a666 100644 --- a/src/basic/fd-util.h +++ b/src/basic/fd-util.h @@ -163,7 +163,7 @@ char *format_proc_pid_fd_path(char buf[static PROC_PID_FD_PATH_MAX], pid_t pid, int proc_fd_enoent_errno(void); -const char *accmode_to_string(int flags); +const char* accmode_to_string(int flags); /* Like ASSERT_PTR, but for fds */ #define ASSERT_FD(fd) \ diff --git a/src/basic/filesystems.c b/src/basic/filesystems.c index 7d34e4e9ad0..aff1791c1d1 100644 --- a/src/basic/filesystems.c +++ b/src/basic/filesystems.c @@ -3,7 +3,7 @@ #include "filesystems-gperf.h" #include "stat-util.h" -const char *fs_type_to_string(statfs_f_type_t magic) { +const char* fs_type_to_string(statfs_f_type_t magic) { switch (magic) { #include "filesystem-switch-case.h" diff --git a/src/basic/filesystems.h b/src/basic/filesystems.h index f9edbc1f292..4e6c6c47fc3 100644 --- a/src/basic/filesystems.h +++ b/src/basic/filesystems.h @@ -34,7 +34,7 @@ extern const FilesystemSet filesystem_sets[]; const FilesystemSet *filesystem_set_find(const char *name); -const char *fs_type_to_string(statfs_f_type_t magic); +const char* fs_type_to_string(statfs_f_type_t magic); int fs_type_from_string(const char *name, const statfs_f_type_t **ret); bool fs_in_group(const struct statfs *s, enum FilesystemGroups fs_group); diff --git a/src/basic/glyph-util.c b/src/basic/glyph-util.c index d37be3234af..68fd3971adf 100644 --- a/src/basic/glyph-util.c +++ b/src/basic/glyph-util.c @@ -23,7 +23,7 @@ bool emoji_enabled(void) { return cached_emoji_enabled; } -const char *special_glyph_full(SpecialGlyph code, bool force_utf) { +const char* special_glyph_full(SpecialGlyph code, bool force_utf) { /* A list of a number of interesting unicode glyphs we can use to decorate our output. It's probably wise to be * conservative here, and primarily stick to the glyphs defined in the eurlatgr font, so that display still diff --git a/src/basic/glyph-util.h b/src/basic/glyph-util.h index db8dbbff262..9b5c3a8d226 100644 --- a/src/basic/glyph-util.h +++ b/src/basic/glyph-util.h @@ -61,16 +61,16 @@ typedef enum SpecialGlyph { bool emoji_enabled(void); -const char *special_glyph_full(SpecialGlyph code, bool force_utf) _const_; +const char* special_glyph_full(SpecialGlyph code, bool force_utf) _const_; -static inline const char *special_glyph(SpecialGlyph code) { +static inline const char* special_glyph(SpecialGlyph code) { return special_glyph_full(code, false); } -static inline const char *special_glyph_check_mark(bool b) { +static inline const char* special_glyph_check_mark(bool b) { return b ? special_glyph(SPECIAL_GLYPH_CHECK_MARK) : special_glyph(SPECIAL_GLYPH_CROSS_MARK); } -static inline const char *special_glyph_check_mark_space(bool b) { +static inline const char* special_glyph_check_mark_space(bool b) { return b ? special_glyph(SPECIAL_GLYPH_CHECK_MARK) : " "; } diff --git a/src/basic/log.c b/src/basic/log.c index 13ad19a051f..50b405b8438 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -1741,7 +1741,7 @@ void log_setup(void) { log_show_color(true); } -const char *_log_set_prefix(const char *prefix, bool force) { +const char* _log_set_prefix(const char *prefix, bool force) { const char *old = log_prefix; if (prefix || force) diff --git a/src/basic/log.h b/src/basic/log.h index 726f035cfca..0597bd1e84b 100644 --- a/src/basic/log.h +++ b/src/basic/log.h @@ -49,7 +49,7 @@ static inline void clear_log_syntax_callback(dummy_t *dummy) { set_log_syntax_callback(/* cb= */ NULL, /* userdata= */ NULL); } -const char *log_target_to_string(LogTarget target) _const_; +const char* log_target_to_string(LogTarget target) _const_; LogTarget log_target_from_string(const char *s) _pure_; void log_set_target(LogTarget target); void log_set_target_and_open(LogTarget target); @@ -432,8 +432,8 @@ typedef struct LogRateLimit { #define log_ratelimit_error_errno(error, ...) log_ratelimit_full_errno(LOG_ERR, error, __VA_ARGS__) #define log_ratelimit_emergency_errno(error, ...) log_ratelimit_full_errno(log_emergency_level(), error, __VA_ARGS__) -const char *_log_set_prefix(const char *prefix, bool force); -static inline const char *_log_unset_prefixp(const char **p) { +const char* _log_set_prefix(const char *prefix, bool force); +static inline const char* _log_unset_prefixp(const char **p) { assert(p); _log_set_prefix(*p, true); return NULL; diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c index 03e56f6cabd..de15ac73ca3 100644 --- a/src/basic/mountpoint-util.c +++ b/src/basic/mountpoint-util.c @@ -647,7 +647,7 @@ int mount_nofollow( return mount_fd(source, fd, filesystemtype, mountflags, data); } -const char *mount_propagation_flag_to_string(unsigned long flags) { +const char* mount_propagation_flag_to_string(unsigned long flags) { switch (flags & (MS_SHARED|MS_SLAVE|MS_PRIVATE)) { case 0: diff --git a/src/basic/mountpoint-util.h b/src/basic/mountpoint-util.h index e5f21780f8f..90a1343e0c2 100644 --- a/src/basic/mountpoint-util.h +++ b/src/basic/mountpoint-util.h @@ -70,7 +70,7 @@ int mount_nofollow( unsigned long mountflags, const void *data); -const char *mount_propagation_flag_to_string(unsigned long flags); +const char* mount_propagation_flag_to_string(unsigned long flags); int mount_propagation_flag_from_string(const char *name, unsigned long *ret); bool mount_propagation_flag_is_valid(unsigned long flag); diff --git a/src/basic/os-util.c b/src/basic/os-util.c index 0d26d189d16..0da4e9d0798 100644 --- a/src/basic/os-util.c +++ b/src/basic/os-util.c @@ -476,7 +476,7 @@ int os_release_support_ended(const char *support_end, bool quiet, usec_t *ret_eo return DIV_ROUND_UP(now(CLOCK_REALTIME), USEC_PER_SEC) > (usec_t) eol; } -const char *os_release_pretty_name(const char *pretty_name, const char *name) { +const char* os_release_pretty_name(const char *pretty_name, const char *name) { /* Distills a "pretty" name to show from os-release data. First argument is supposed to be the * PRETTY_NAME= field, the second one the NAME= field. This function is trivial, of course, and * exists mostly to ensure we use the same logic wherever possible. */ diff --git a/src/basic/os-util.h b/src/basic/os-util.h index f6a12a3fb1c..071c9080b71 100644 --- a/src/basic/os-util.h +++ b/src/basic/os-util.h @@ -57,4 +57,4 @@ int load_os_release_pairs_with_prefix(const char *root, const char *prefix, char int os_release_support_ended(const char *support_end, bool quiet, usec_t *ret_eol); -const char *os_release_pretty_name(const char *pretty_name, const char *name); +const char* os_release_pretty_name(const char *pretty_name, const char *name); diff --git a/src/basic/path-util.h b/src/basic/path-util.h index 792b8ff2cbc..8b5c8fbf3c1 100644 --- a/src/basic/path-util.h +++ b/src/basic/path-util.h @@ -203,7 +203,7 @@ bool dot_or_dot_dot(const char *path); bool path_implies_directory(const char *path); -static inline const char *skip_dev_prefix(const char *p) { +static inline const char* skip_dev_prefix(const char *p) { const char *e; /* Drop any /dev prefix if there is any */ diff --git a/src/basic/process-util.h b/src/basic/process-util.h index cbcb91b6eb0..59732a86768 100644 --- a/src/basic/process-util.h +++ b/src/basic/process-util.h @@ -113,12 +113,12 @@ bool oom_score_adjust_is_valid(int oa); #define OPINIONATED_PERSONALITY_MASK 0xFFUL unsigned long personality_from_string(const char *p); -const char *personality_to_string(unsigned long); +const char* personality_to_string(unsigned long); int safe_personality(unsigned long p); int opinionated_personality(unsigned long *ret); -const char *sigchld_code_to_string(int i) _const_; +const char* sigchld_code_to_string(int i) _const_; int sigchld_code_from_string(const char *s) _pure_; int sched_policy_to_string_alloc(int i, char **s); diff --git a/src/basic/rlimit-util.h b/src/basic/rlimit-util.h index afc1a1f2622..b5f99894871 100644 --- a/src/basic/rlimit-util.h +++ b/src/basic/rlimit-util.h @@ -6,7 +6,7 @@ #include "macro.h" #include "missing_resource.h" -const char *rlimit_to_string(int i) _const_; +const char* rlimit_to_string(int i) _const_; int rlimit_from_string(const char *s) _pure_; int rlimit_from_string_harder(const char *s) _pure_; diff --git a/src/basic/runtime-scope.h b/src/basic/runtime-scope.h index 6553e4c1999..ba900fed1e7 100644 --- a/src/basic/runtime-scope.h +++ b/src/basic/runtime-scope.h @@ -13,7 +13,7 @@ typedef enum RuntimeScope { _RUNTIME_SCOPE_INVALID = -EINVAL, } RuntimeScope; -const char *runtime_scope_to_string(RuntimeScope scope) _const_; +const char* runtime_scope_to_string(RuntimeScope scope) _const_; RuntimeScope runtime_scope_from_string(const char *s) _const_; -const char *runtime_scope_cmdline_option_to_string(RuntimeScope scope) _const_; +const char* runtime_scope_cmdline_option_to_string(RuntimeScope scope) _const_; diff --git a/src/basic/signal-util.c b/src/basic/signal-util.c index 27d094b7bd9..bb04351d4ba 100644 --- a/src/basic/signal-util.c +++ b/src/basic/signal-util.c @@ -151,7 +151,7 @@ static const char *const static_signal_table[] = { DEFINE_PRIVATE_STRING_TABLE_LOOKUP(static_signal, int); -const char *signal_to_string(int signo) { +const char* signal_to_string(int signo) { static thread_local char buf[STRLEN("RTMIN+") + DECIMAL_STR_MAX(int)]; const char *name; diff --git a/src/basic/signal-util.h b/src/basic/signal-util.h index 8826fbeb7b7..80579a59f33 100644 --- a/src/basic/signal-util.h +++ b/src/basic/signal-util.h @@ -37,7 +37,7 @@ int sigset_add_many_internal(sigset_t *ss, ...); int sigprocmask_many_internal(int how, sigset_t *old, ...); #define sigprocmask_many(...) sigprocmask_many_internal(__VA_ARGS__, -1) -const char *signal_to_string(int i) _const_; +const char* signal_to_string(int i) _const_; int signal_from_string(const char *s) _pure_; void nop_signal_handler(int sig); diff --git a/src/basic/string-table.h b/src/basic/string-table.h index d1d90df786b..639443d02b3 100644 --- a/src/basic/string-table.h +++ b/src/basic/string-table.h @@ -15,7 +15,7 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k /* For basic lookup tables with strictly enumerated entries */ #define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \ - scope const char *name##_to_string(type i) { \ + scope const char* name##_to_string(type i) { \ if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \ return NULL; \ return name##_table[i]; \ diff --git a/src/basic/string-util.h b/src/basic/string-util.h index b5da8bea059..63fcbe2337f 100644 --- a/src/basic/string-util.h +++ b/src/basic/string-util.h @@ -49,7 +49,7 @@ static inline const char* strnull(const char *s) { return s ?: "(null)"; } -static inline const char *strna(const char *s) { +static inline const char* strna(const char *s) { return s ?: "n/a"; } @@ -81,11 +81,11 @@ static inline const char* enabled_disabled(bool b) { (typeof(p)) (isempty(_p) ? NULL : _p); \ }) -static inline const char *empty_to_na(const char *p) { +static inline const char* empty_to_na(const char *p) { return isempty(p) ? "n/a" : p; } -static inline const char *empty_to_dash(const char *str) { +static inline const char* empty_to_dash(const char *str) { return isempty(str) ? "-" : str; } @@ -95,7 +95,7 @@ static inline bool empty_or_dash(const char *str) { (str[0] == '-' && str[1] == 0); } -static inline const char *empty_or_dash_to_null(const char *p) { +static inline const char* empty_or_dash_to_null(const char *p) { return empty_or_dash(p) ? NULL : p; } #define empty_or_dash_to_null(p) \ diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index dda592089cb..787ae7abace 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -790,7 +790,7 @@ bool tty_is_vc_resolve(const char *tty) { return tty_is_vc(tty); } -const char *default_term_for_tty(const char *tty) { +const char* default_term_for_tty(const char *tty) { return tty && tty_is_vc_resolve(tty) ? "linux" : "vt220"; } diff --git a/src/basic/terminal-util.h b/src/basic/terminal-util.h index ecfe574451e..0c1c6373bc4 100644 --- a/src/basic/terminal-util.h +++ b/src/basic/terminal-util.h @@ -160,7 +160,7 @@ bool tty_is_vc(const char *tty); bool tty_is_vc_resolve(const char *tty); bool tty_is_console(const char *tty) _pure_; int vtnr_from_tty(const char *tty); -const char *default_term_for_tty(const char *tty); +const char* default_term_for_tty(const char *tty); int make_console_stdio(void); @@ -198,15 +198,15 @@ static inline bool colors_enabled(void) { } \ } -static inline const char *ansi_underline(void) { +static inline const char* ansi_underline(void) { return underline_enabled() ? ANSI_UNDERLINE : ""; } -static inline const char *ansi_add_underline(void) { +static inline const char* ansi_add_underline(void) { return underline_enabled() ? ANSI_ADD_UNDERLINE : ""; } -static inline const char *ansi_add_underline_grey(void) { +static inline const char* ansi_add_underline_grey(void) { return underline_enabled() ? (colors_enabled() ? ANSI_ADD_UNDERLINE_GREY : ANSI_ADD_UNDERLINE) : ""; } diff --git a/src/basic/unit-def.c b/src/basic/unit-def.c index d03363bd379..09d881b8441 100644 --- a/src/basic/unit-def.c +++ b/src/basic/unit-def.c @@ -58,7 +58,7 @@ const char* unit_dbus_interface_from_type(UnitType t) { return table[t]; } -const char *unit_dbus_interface_from_name(const char *name) { +const char* unit_dbus_interface_from_name(const char *name) { UnitType t; t = unit_name_to_type(name); diff --git a/src/basic/unit-def.h b/src/basic/unit-def.h index 8e73e286da1..b818b5ea263 100644 --- a/src/basic/unit-def.h +++ b/src/basic/unit-def.h @@ -284,24 +284,24 @@ char *unit_dbus_path_from_name(const char *name); int unit_name_from_dbus_path(const char *path, char **name); const char* unit_dbus_interface_from_type(UnitType t); -const char *unit_dbus_interface_from_name(const char *name); +const char* unit_dbus_interface_from_name(const char *name); -const char *unit_type_to_string(UnitType i) _const_; +const char* unit_type_to_string(UnitType i) _const_; UnitType unit_type_from_string(const char *s) _pure_; const char* unit_type_to_capitalized_string(UnitType t); -const char *unit_load_state_to_string(UnitLoadState i) _const_; +const char* unit_load_state_to_string(UnitLoadState i) _const_; UnitLoadState unit_load_state_from_string(const char *s) _pure_; -const char *unit_active_state_to_string(UnitActiveState i) _const_; +const char* unit_active_state_to_string(UnitActiveState i) _const_; UnitActiveState unit_active_state_from_string(const char *s) _pure_; -const char *freezer_state_to_string(FreezerState i) _const_; +const char* freezer_state_to_string(FreezerState i) _const_; FreezerState freezer_state_from_string(const char *s) _pure_; FreezerState freezer_state_finish(FreezerState i) _const_; -const char *unit_marker_to_string(UnitMarker m) _const_; +const char* unit_marker_to_string(UnitMarker m) _const_; UnitMarker unit_marker_from_string(const char *s) _pure_; const char* automount_state_to_string(AutomountState i) _const_; @@ -334,10 +334,10 @@ SwapState swap_state_from_string(const char *s) _pure_; const char* target_state_to_string(TargetState i) _const_; TargetState target_state_from_string(const char *s) _pure_; -const char *timer_state_to_string(TimerState i) _const_; +const char* timer_state_to_string(TimerState i) _const_; TimerState timer_state_from_string(const char *s) _pure_; -const char *unit_dependency_to_string(UnitDependency i) _const_; +const char* unit_dependency_to_string(UnitDependency i) _const_; UnitDependency unit_dependency_from_string(const char *s) _pure_; const char* notify_access_to_string(NotifyAccess i) _const_; diff --git a/src/basic/virt.h b/src/basic/virt.h index dea39e4e763..8193d4a7608 100644 --- a/src/basic/virt.h +++ b/src/basic/virt.h @@ -65,6 +65,6 @@ Virtualization detect_virtualization(void); int running_in_userns(void); int running_in_chroot(void); -const char *virtualization_to_string(Virtualization v) _const_; +const char* virtualization_to_string(Virtualization v) _const_; Virtualization virtualization_from_string(const char *s) _pure_; bool has_cpu_with_flag(const char *flag); diff --git a/src/boot/bootctl-util.c b/src/boot/bootctl-util.c index 448e868a424..bc0b0d7c9c9 100644 --- a/src/boot/bootctl-util.c +++ b/src/boot/bootctl-util.c @@ -27,7 +27,7 @@ int sync_everything(void) { return r; } -const char *get_efi_arch(void) { +const char* get_efi_arch(void) { /* Detect EFI firmware architecture of the running system. On mixed mode systems, it could be 32-bit * while the kernel is running in 64-bit. */ diff --git a/src/boot/bootctl-util.h b/src/boot/bootctl-util.h index 6f2c1630de2..4abd4a303be 100644 --- a/src/boot/bootctl-util.h +++ b/src/boot/bootctl-util.h @@ -3,7 +3,7 @@ int sync_everything(void); -const char *get_efi_arch(void); +const char* get_efi_arch(void); int get_file_version(int fd, char **ret); diff --git a/src/boot/bootctl.h b/src/boot/bootctl.h index d488eac4e19..93f302ce307 100644 --- a/src/boot/bootctl.h +++ b/src/boot/bootctl.h @@ -38,7 +38,7 @@ extern bool arg_dry_run; extern ImagePolicy *arg_image_policy; extern bool arg_varlink; -static inline const char *arg_dollar_boot_path(void) { +static inline const char* arg_dollar_boot_path(void) { /* $BOOT shall be the XBOOTLDR partition if it exists, and otherwise the ESP */ return arg_xbootldr_path ?: arg_esp_path; } diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 34fd2a250c4..19028b810ba 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -780,7 +780,7 @@ static char *format_cgroup_memory_limit_comparison(Unit *u, const char *property return buf; } -const char *cgroup_device_permissions_to_string(CGroupDevicePermissions p) { +const char* cgroup_device_permissions_to_string(CGroupDevicePermissions p) { static const char *table[_CGROUP_DEVICE_PERMISSIONS_MAX] = { /* Lets simply define a table with every possible combination. As long as those are just 8 we * can get away with it. If this ever grows to more we need to revisit this logic though. */ @@ -2615,7 +2615,7 @@ void unit_invalidate_cgroup_members_masks(Unit *u) { unit_invalidate_cgroup_members_masks(slice); } -const char *unit_get_realized_cgroup_path(Unit *u, CGroupMask mask) { +const char* unit_get_realized_cgroup_path(Unit *u, CGroupMask mask) { /* Returns the realized cgroup path of the specified unit where all specified controllers are available. */ diff --git a/src/core/cgroup.h b/src/core/cgroup.h index 72fe275e8ca..1581a88cb76 100644 --- a/src/core/cgroup.h +++ b/src/core/cgroup.h @@ -437,7 +437,7 @@ void unit_invalidate_cgroup_members_masks(Unit *u); void unit_add_family_to_cgroup_realize_queue(Unit *u); -const char *unit_get_realized_cgroup_path(Unit *u, CGroupMask mask); +const char* unit_get_realized_cgroup_path(Unit *u, CGroupMask mask); int unit_default_cgroup_path(const Unit *u, char **ret); int unit_set_cgroup_path(Unit *u, const char *path); int unit_pick_cgroup_path(Unit *u); @@ -537,7 +537,7 @@ int cgroup_runtime_deserialize_one(Unit *u, const char *key, const char *value, const char* cgroup_pressure_watch_to_string(CGroupPressureWatch a) _const_; CGroupPressureWatch cgroup_pressure_watch_from_string(const char *s) _pure_; -const char *cgroup_device_permissions_to_string(CGroupDevicePermissions p) _const_; +const char* cgroup_device_permissions_to_string(CGroupDevicePermissions p) _const_; CGroupDevicePermissions cgroup_device_permissions_from_string(const char *s) _pure_; const char* cgroup_ip_accounting_metric_to_string(CGroupIPAccountingMetric m) _const_; diff --git a/src/core/execute.c b/src/core/execute.c index 9ba5a77975a..18396db113c 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -87,7 +87,7 @@ static bool is_terminal_output(ExecOutput o) { EXEC_OUTPUT_JOURNAL_AND_CONSOLE); } -const char *exec_context_tty_path(const ExecContext *context) { +const char* exec_context_tty_path(const ExecContext *context) { assert(context); if (context->stdio_as_fds) diff --git a/src/core/execute.h b/src/core/execute.h index ef8dadfe202..0414fbad229 100644 --- a/src/core/execute.h +++ b/src/core/execute.h @@ -525,7 +525,7 @@ void exec_context_revert_tty(ExecContext *c); int exec_context_get_clean_directories(ExecContext *c, char **prefix, ExecCleanMask mask, char ***ret); int exec_context_get_clean_mask(ExecContext *c, ExecCleanMask *ret); -const char *exec_context_tty_path(const ExecContext *context); +const char* exec_context_tty_path(const ExecContext *context); int exec_context_apply_tty_size(const ExecContext *context, int tty_fd, const char *tty_path); void exec_context_tty_reset(const ExecContext *context, const ExecParameters *p); diff --git a/src/core/kill.h b/src/core/kill.h index 69041c1c533..3add663d719 100644 --- a/src/core/kill.h +++ b/src/core/kill.h @@ -43,10 +43,10 @@ typedef enum KillWhom { void kill_context_init(KillContext *c); void kill_context_dump(KillContext *c, FILE *f, const char *prefix); -const char *kill_mode_to_string(KillMode k) _const_; +const char* kill_mode_to_string(KillMode k) _const_; KillMode kill_mode_from_string(const char *s) _pure_; -const char *kill_whom_to_string(KillWhom k) _const_; +const char* kill_whom_to_string(KillWhom k) _const_; KillWhom kill_whom_from_string(const char *s) _pure_; static inline int restart_kill_signal(const KillContext *c) { diff --git a/src/core/timer.h b/src/core/timer.h index 76d45b2ae1d..2624001c34b 100644 --- a/src/core/timer.h +++ b/src/core/timer.h @@ -79,7 +79,7 @@ void timer_free_values(Timer *t); extern const UnitVTable timer_vtable; extern const ActivationDetailsVTable activation_details_timer_vtable; -const char *timer_base_to_string(TimerBase i) _const_; +const char* timer_base_to_string(TimerBase i) _const_; TimerBase timer_base_from_string(const char *s) _pure_; char* timer_base_to_usec_string(TimerBase i); diff --git a/src/core/unit.c b/src/core/unit.c index 8823341f996..cb93277f3e6 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -3491,7 +3491,7 @@ int unit_set_default_slice(Unit *u) { return unit_set_slice(u, slice); } -const char *unit_slice_name(Unit *u) { +const char* unit_slice_name(Unit *u) { Unit *slice; assert(u); diff --git a/src/core/unit.h b/src/core/unit.h index a5202420206..419c72e7dfc 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -843,8 +843,8 @@ int unit_load(Unit *unit); int unit_set_slice(Unit *u, Unit *slice); int unit_set_default_slice(Unit *u); -const char *unit_description(Unit *u) _pure_; -const char *unit_status_string(Unit *u, char **combined); +const char* unit_description(Unit *u) _pure_; +const char* unit_status_string(Unit *u, char **combined); bool unit_has_name(const Unit *u, const char *name); @@ -906,7 +906,7 @@ void unit_reset_failed(Unit *u); Unit *unit_following(Unit *u); int unit_following_set(Unit *u, Set **s); -const char *unit_slice_name(Unit *u); +const char* unit_slice_name(Unit *u); bool unit_stop_pending(Unit *u) _pure_; bool unit_inactive_or_pending(Unit *u) _pure_; diff --git a/src/cryptsetup/cryptsetup-tokens/cryptsetup-token.h b/src/cryptsetup/cryptsetup-tokens/cryptsetup-token.h index 2a9d23f3e3e..effd9d887c4 100644 --- a/src/cryptsetup/cryptsetup-tokens/cryptsetup-token.h +++ b/src/cryptsetup/cryptsetup-tokens/cryptsetup-token.h @@ -3,7 +3,7 @@ /* for more information see libcryptsetup.h crypt-tokens section */ -const char *cryptsetup_token_version(void); +const char* cryptsetup_token_version(void); int cryptsetup_token_open(struct crypt_device *cd, int token, char **password, size_t *password_len, void *usrptr); diff --git a/src/home/home-util.c b/src/home/home-util.c index e949840152d..cb96a7ab4ed 100644 --- a/src/home/home-util.c +++ b/src/home/home-util.c @@ -137,10 +137,10 @@ int bus_message_append_secret(sd_bus_message *m, UserRecord *secret) { return sd_bus_message_append(m, "s", formatted); } -const char *home_record_dir(void) { +const char* home_record_dir(void) { return secure_getenv("SYSTEMD_HOME_RECORD_DIR") ?: "/var/lib/systemd/home/"; } -const char *home_system_blob_dir(void) { +const char* home_system_blob_dir(void) { return secure_getenv("SYSTEMD_HOME_SYSTEM_BLOB_DIR") ?: "/var/cache/systemd/home/"; } diff --git a/src/home/home-util.h b/src/home/home-util.h index 42131b9f41d..f8472cb7c86 100644 --- a/src/home/home-util.h +++ b/src/home/home-util.h @@ -44,5 +44,5 @@ int bus_message_append_secret(sd_bus_message *m, UserRecord *secret); * operations permit a *very* long timeout */ #define HOME_SLOW_BUS_CALL_TIMEOUT_USEC (2*USEC_PER_MINUTE) -const char *home_record_dir(void); -const char *home_system_blob_dir(void); +const char* home_record_dir(void); +const char* home_system_blob_dir(void); diff --git a/src/home/homed-home.h b/src/home/homed-home.h index 7d466cdd326..8c92e39fe5f 100644 --- a/src/home/homed-home.h +++ b/src/home/homed-home.h @@ -231,5 +231,5 @@ bool home_shall_rebalance(Home *h); bool home_is_busy(Home *h); -const char *home_state_to_string(HomeState state); +const char* home_state_to_string(HomeState state); HomeState home_state_from_string(const char *s); diff --git a/src/journal/journald-server.h b/src/journal/journald-server.h index 51389089961..f9405e18c79 100644 --- a/src/journal/journald-server.h +++ b/src/journal/journald-server.h @@ -219,12 +219,12 @@ CONFIG_PARSER_PROTOTYPE(config_parse_line_max); CONFIG_PARSER_PROTOTYPE(config_parse_compress); CONFIG_PARSER_PROTOTYPE(config_parse_forward_to_socket); -const char *storage_to_string(Storage s) _const_; +const char* storage_to_string(Storage s) _const_; Storage storage_from_string(const char *s) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_split_mode); -const char *split_mode_to_string(SplitMode s) _const_; +const char* split_mode_to_string(SplitMode s) _const_; SplitMode split_mode_from_string(const char *s) _pure_; int server_new(Server **ret); diff --git a/src/libsystemd-network/dhcp-client-internal.h b/src/libsystemd-network/dhcp-client-internal.h index 28ce80cbf22..247fd9d9120 100644 --- a/src/libsystemd-network/dhcp-client-internal.h +++ b/src/libsystemd-network/dhcp-client-internal.h @@ -22,7 +22,7 @@ typedef enum DHCPState { _DHCP_STATE_INVALID = -EINVAL, } DHCPState; -const char *dhcp_state_to_string(DHCPState s) _const_; +const char* dhcp_state_to_string(DHCPState s) _const_; typedef struct sd_dhcp_client sd_dhcp_client; diff --git a/src/libsystemd-network/dhcp-duid-internal.h b/src/libsystemd-network/dhcp-duid-internal.h index f8bc15c47ee..0d3d6b5cef6 100644 --- a/src/libsystemd-network/dhcp-duid-internal.h +++ b/src/libsystemd-network/dhcp-duid-internal.h @@ -73,7 +73,7 @@ static inline bool duid_data_size_is_valid(size_t size) { return size >= MIN_DUID_DATA_LEN && size <= MAX_DUID_DATA_LEN; } -const char *duid_type_to_string(DUIDType t) _const_; +const char* duid_type_to_string(DUIDType t) _const_; int dhcp_duid_to_string_internal(uint16_t type, const void *data, size_t data_size, char **ret); int dhcp_identifier_set_iaid( diff --git a/src/libsystemd-network/dhcp6-protocol.h b/src/libsystemd-network/dhcp6-protocol.h index ab75bad434a..39f5040f9d6 100644 --- a/src/libsystemd-network/dhcp6-protocol.h +++ b/src/libsystemd-network/dhcp6-protocol.h @@ -152,9 +152,9 @@ typedef enum DHCP6FQDNFlag { DHCP6_FQDN_FLAG_N = 1 << 2, } DHCP6FQDNFlag; -const char *dhcp6_state_to_string(DHCP6State s) _const_; -const char *dhcp6_message_type_to_string(DHCP6MessageType s) _const_; +const char* dhcp6_state_to_string(DHCP6State s) _const_; +const char* dhcp6_message_type_to_string(DHCP6MessageType s) _const_; DHCP6MessageType dhcp6_message_type_from_string(const char *s) _pure_; -const char *dhcp6_message_status_to_string(DHCP6Status s) _const_; +const char* dhcp6_message_status_to_string(DHCP6Status s) _const_; DHCP6Status dhcp6_message_status_from_string(const char *s) _pure_; int dhcp6_message_status_to_errno(DHCP6Status s); diff --git a/src/libsystemd/sd-bus/bus-internal.c b/src/libsystemd/sd-bus/bus-internal.c index a249b848ca7..2df7a5b2294 100644 --- a/src/libsystemd/sd-bus/bus-internal.c +++ b/src/libsystemd/sd-bus/bus-internal.c @@ -273,7 +273,7 @@ int bus_message_type_from_string(const char *s, uint8_t *u) { return 0; } -const char *bus_message_type_to_string(uint8_t u) { +const char* bus_message_type_to_string(uint8_t u) { if (u == SD_BUS_MESSAGE_SIGNAL) return "signal"; else if (u == SD_BUS_MESSAGE_METHOD_CALL) diff --git a/src/libsystemd/sd-bus/bus-internal.h b/src/libsystemd/sd-bus/bus-internal.h index e0f4746b7ed..e2cd1f49ed1 100644 --- a/src/libsystemd/sd-bus/bus-internal.h +++ b/src/libsystemd/sd-bus/bus-internal.h @@ -369,7 +369,7 @@ bool namespace_simple_pattern(const char *pattern, const char *value) _pure_; bool path_simple_pattern(const char *pattern, const char *value) _pure_; int bus_message_type_from_string(const char *s, uint8_t *u); -const char *bus_message_type_to_string(uint8_t u) _pure_; +const char* bus_message_type_to_string(uint8_t u) _pure_; #define error_name_is_valid interface_name_is_valid diff --git a/src/libsystemd/sd-device/device-private.h b/src/libsystemd/sd-device/device-private.h index 85e86099402..e0b1efe5068 100644 --- a/src/libsystemd/sd-device/device-private.h +++ b/src/libsystemd/sd-device/device-private.h @@ -76,5 +76,5 @@ int device_read_uevent_file(sd_device *device); int device_set_action(sd_device *device, sd_device_action_t a); sd_device_action_t device_action_from_string(const char *s) _pure_; -const char *device_action_to_string(sd_device_action_t a) _const_; +const char* device_action_to_string(sd_device_action_t a) _const_; void dump_device_action_table(void); diff --git a/src/libsystemd/sd-journal/audit-type.h b/src/libsystemd/sd-journal/audit-type.h index f2c489856c3..fffc58ad92a 100644 --- a/src/libsystemd/sd-journal/audit-type.h +++ b/src/libsystemd/sd-journal/audit-type.h @@ -6,7 +6,7 @@ #include "alloc-util.h" #include "macro.h" -const char *audit_type_to_string(int type); +const char* audit_type_to_string(int type); int audit_type_from_string(const char *s); /* This is inspired by DNS TYPEnnn formatting */ diff --git a/src/libsystemd/sd-json/sd-json.c b/src/libsystemd/sd-json/sd-json.c index f7b36af880b..5f9c5932059 100644 --- a/src/libsystemd/sd-json/sd-json.c +++ b/src/libsystemd/sd-json/sd-json.c @@ -903,7 +903,7 @@ _public_ void sd_json_variant_unref_many(sd_json_variant **array, size_t n) { free(array); } -_public_ const char *sd_json_variant_string(sd_json_variant *v) { +_public_ const char* sd_json_variant_string(sd_json_variant *v) { if (!v) return NULL; if (v == JSON_VARIANT_MAGIC_EMPTY_STRING) diff --git a/src/libudev/libudev.h b/src/libudev/libudev.h index aef4a55a8c6..553c381ff11 100644 --- a/src/libudev/libudev.h +++ b/src/libudev/libudev.h @@ -38,8 +38,8 @@ void udev_set_userdata(struct udev *udev, void *userdata); struct udev_list_entry; struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *list_entry); struct udev_list_entry *udev_list_entry_get_by_name(struct udev_list_entry *list_entry, const char *name); -const char *udev_list_entry_get_name(struct udev_list_entry *list_entry); -const char *udev_list_entry_get_value(struct udev_list_entry *list_entry); +const char* udev_list_entry_get_name(struct udev_list_entry *list_entry); +const char* udev_list_entry_get_value(struct udev_list_entry *list_entry); /** * udev_list_entry_foreach: * @list_entry: entry to store the current position @@ -71,26 +71,26 @@ struct udev_device *udev_device_get_parent(struct udev_device *udev_device); struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype); /* retrieve device properties */ -const char *udev_device_get_devpath(struct udev_device *udev_device); -const char *udev_device_get_subsystem(struct udev_device *udev_device); -const char *udev_device_get_devtype(struct udev_device *udev_device); -const char *udev_device_get_syspath(struct udev_device *udev_device); -const char *udev_device_get_sysname(struct udev_device *udev_device); -const char *udev_device_get_sysnum(struct udev_device *udev_device); -const char *udev_device_get_devnode(struct udev_device *udev_device); +const char* udev_device_get_devpath(struct udev_device *udev_device); +const char* udev_device_get_subsystem(struct udev_device *udev_device); +const char* udev_device_get_devtype(struct udev_device *udev_device); +const char* udev_device_get_syspath(struct udev_device *udev_device); +const char* udev_device_get_sysname(struct udev_device *udev_device); +const char* udev_device_get_sysnum(struct udev_device *udev_device); +const char* udev_device_get_devnode(struct udev_device *udev_device); int udev_device_get_is_initialized(struct udev_device *udev_device); struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device); struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device); struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device); struct udev_list_entry *udev_device_get_current_tags_list_entry(struct udev_device *udev_device); struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device); -const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key); -const char *udev_device_get_driver(struct udev_device *udev_device); +const char* udev_device_get_property_value(struct udev_device *udev_device, const char *key); +const char* udev_device_get_driver(struct udev_device *udev_device); dev_t udev_device_get_devnum(struct udev_device *udev_device); -const char *udev_device_get_action(struct udev_device *udev_device); +const char* udev_device_get_action(struct udev_device *udev_device); unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device); unsigned long long int udev_device_get_usec_since_initialized(struct udev_device *udev_device); -const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr); +const char* udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr); int udev_device_set_sysattr_value(struct udev_device *udev_device, const char *sysattr, const char *value); int udev_device_has_tag(struct udev_device *udev_device, const char *tag); int udev_device_has_current_tag(struct udev_device *udev_device, const char *tag); diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index 203665ca3c4..4e64b9ebefe 100644 --- a/src/login/logind-inhibit.c +++ b/src/login/logind-inhibit.c @@ -446,7 +446,7 @@ bool manager_is_inhibited( return inhibited; } -const char *inhibit_what_to_string(InhibitWhat w) { +const char* inhibit_what_to_string(InhibitWhat w) { static thread_local char buffer[STRLEN( "shutdown:" "sleep:" diff --git a/src/login/logind-inhibit.h b/src/login/logind-inhibit.h index 8f822ded04d..166e8f57ed7 100644 --- a/src/login/logind-inhibit.h +++ b/src/login/logind-inhibit.h @@ -72,8 +72,8 @@ static inline bool inhibit_what_is_valid(InhibitWhat w) { return w > 0 && w < _INHIBIT_WHAT_MAX; } -const char *inhibit_what_to_string(InhibitWhat k); +const char* inhibit_what_to_string(InhibitWhat k); int inhibit_what_from_string(const char *s); -const char *inhibit_mode_to_string(InhibitMode k); +const char* inhibit_mode_to_string(InhibitMode k); InhibitMode inhibit_mode_from_string(const char *s); diff --git a/src/login/logind-session.h b/src/login/logind-session.h index ab3fa4e0977..86ffc64bdaa 100644 --- a/src/login/logind-session.h +++ b/src/login/logind-session.h @@ -204,7 +204,7 @@ SessionType session_type_from_string(const char *s) _pure_; const char* session_class_to_string(SessionClass t) _const_; SessionClass session_class_from_string(const char *s) _pure_; -const char *kill_whom_to_string(KillWhom k) _const_; +const char* kill_whom_to_string(KillWhom k) _const_; KillWhom kill_whom_from_string(const char *s) _pure_; const char* tty_validity_to_string(TTYValidity t) _const_; diff --git a/src/machine/machine.h b/src/machine/machine.h index c01544a0be3..12551025c7d 100644 --- a/src/machine/machine.h +++ b/src/machine/machine.h @@ -95,7 +95,7 @@ MachineClass machine_class_from_string(const char *s) _pure_; const char* machine_state_to_string(MachineState t) _const_; MachineState machine_state_from_string(const char *s) _pure_; -const char *kill_whom_to_string(KillWhom k) _const_; +const char* kill_whom_to_string(KillWhom k) _const_; KillWhom kill_whom_from_string(const char *s) _pure_; int machine_openpt(Machine *m, int flags, char **ret_slave); diff --git a/src/network/netdev/bareudp.h b/src/network/netdev/bareudp.h index 8d8863cccc8..a8a33b3e4de 100644 --- a/src/network/netdev/bareudp.h +++ b/src/network/netdev/bareudp.h @@ -28,7 +28,7 @@ struct BareUDP { DEFINE_NETDEV_CAST(BAREUDP, BareUDP); extern const NetDevVTable bare_udp_vtable; -const char *bare_udp_protocol_to_string(BareUDPProtocol d) _const_; +const char* bare_udp_protocol_to_string(BareUDPProtocol d) _const_; BareUDPProtocol bare_udp_protocol_from_string(const char *d) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_bare_udp_iftype); diff --git a/src/network/netdev/fou-tunnel.h b/src/network/netdev/fou-tunnel.h index 576d82ed6c4..72cb315e5fc 100644 --- a/src/network/netdev/fou-tunnel.h +++ b/src/network/netdev/fou-tunnel.h @@ -34,7 +34,7 @@ typedef struct FouTunnel { DEFINE_NETDEV_CAST(FOU, FouTunnel); extern const NetDevVTable foutnl_vtable; -const char *fou_encap_type_to_string(FooOverUDPEncapType d) _const_; +const char* fou_encap_type_to_string(FooOverUDPEncapType d) _const_; FooOverUDPEncapType fou_encap_type_from_string(const char *d) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_fou_encap_type); diff --git a/src/network/netdev/geneve.h b/src/network/netdev/geneve.h index 3cbf694bba2..5fb441360de 100644 --- a/src/network/netdev/geneve.h +++ b/src/network/netdev/geneve.h @@ -44,7 +44,7 @@ struct Geneve { DEFINE_NETDEV_CAST(GENEVE, Geneve); extern const NetDevVTable geneve_vtable; -const char *geneve_df_to_string(GeneveDF d) _const_; +const char* geneve_df_to_string(GeneveDF d) _const_; GeneveDF geneve_df_from_string(const char *d) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_geneve_vni); diff --git a/src/network/netdev/netdev-util.h b/src/network/netdev/netdev-util.h index 02b07e3670b..7c8c397d6ce 100644 --- a/src/network/netdev/netdev-util.h +++ b/src/network/netdev/netdev-util.h @@ -16,7 +16,7 @@ typedef enum NetDevLocalAddressType { _NETDEV_LOCAL_ADDRESS_TYPE_INVALID = -EINVAL, } NetDevLocalAddressType; -const char *netdev_local_address_type_to_string(NetDevLocalAddressType t) _const_; +const char* netdev_local_address_type_to_string(NetDevLocalAddressType t) _const_; NetDevLocalAddressType netdev_local_address_type_from_string(const char *s) _pure_; int link_get_local_address( diff --git a/src/network/netdev/netdev.h b/src/network/netdev/netdev.h index cb8cc8c6a9d..3bfecda6d89 100644 --- a/src/network/netdev/netdev.h +++ b/src/network/netdev/netdev.h @@ -212,7 +212,7 @@ int netdev_generate_hw_addr(NetDev *netdev, Link *link, const char *name, int link_request_stacked_netdev(Link *link, NetDev *netdev); -const char *netdev_kind_to_string(NetDevKind d) _const_; +const char* netdev_kind_to_string(NetDevKind d) _const_; NetDevKind netdev_kind_from_string(const char *d) _pure_; static inline NetDevCreateType netdev_get_create_type(NetDev *netdev) { diff --git a/src/network/netdev/tunnel.h b/src/network/netdev/tunnel.h index 713f2fbf376..cf26cfad98e 100644 --- a/src/network/netdev/tunnel.h +++ b/src/network/netdev/tunnel.h @@ -123,7 +123,7 @@ extern const NetDevVTable ip6gretap_vtable; extern const NetDevVTable ip6tnl_vtable; extern const NetDevVTable erspan_vtable; -const char *ip6tnl_mode_to_string(Ip6TnlMode d) _const_; +const char* ip6tnl_mode_to_string(Ip6TnlMode d) _const_; Ip6TnlMode ip6tnl_mode_from_string(const char *d) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_ip6tnl_mode); diff --git a/src/network/netdev/vxlan.h b/src/network/netdev/vxlan.h index 141ac4db4df..29874942bc5 100644 --- a/src/network/netdev/vxlan.h +++ b/src/network/netdev/vxlan.h @@ -66,7 +66,7 @@ struct VxLan { DEFINE_NETDEV_CAST(VXLAN, VxLan); extern const NetDevVTable vxlan_vtable; -const char *df_to_string(VxLanDF d) _const_; +const char* df_to_string(VxLanDF d) _const_; VxLanDF df_from_string(const char *d) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_vxlan_address); diff --git a/src/network/networkd-dhcp-common.h b/src/network/networkd-dhcp-common.h index 3390d7dcff1..194930a87c6 100644 --- a/src/network/networkd-dhcp-common.h +++ b/src/network/networkd-dhcp-common.h @@ -79,7 +79,7 @@ static inline bool in6_prefix_is_filtered(const struct in6_addr *prefix, uint8_t int link_get_captive_portal(Link *link, const char **ret); -const char *dhcp_option_data_type_to_string(DHCPOptionDataType d) _const_; +const char* dhcp_option_data_type_to_string(DHCPOptionDataType d) _const_; DHCPOptionDataType dhcp_option_data_type_from_string(const char *d) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_dhcp); diff --git a/src/network/networkd-link.h b/src/network/networkd-link.h index b1b2fe42db9..27bc299bc5f 100644 --- a/src/network/networkd-link.h +++ b/src/network/networkd-link.h @@ -260,7 +260,7 @@ int manager_udev_process_link(Manager *m, sd_device *device, sd_device_action_t int manager_rtnl_process_link(sd_netlink *rtnl, sd_netlink_message *message, Manager *m); int link_flags_to_string_alloc(uint32_t flags, char **ret); -const char *kernel_operstate_to_string(int t) _const_; +const char* kernel_operstate_to_string(int t) _const_; void link_required_operstate_for_online(Link *link, LinkOperationalStateRange *ret); AddressFamily link_required_family_for_online(Link *link); diff --git a/src/network/networkd-route-util.h b/src/network/networkd-route-util.h index eba823a2d0d..2df7faadc8e 100644 --- a/src/network/networkd-route-util.h +++ b/src/network/networkd-route-util.h @@ -39,7 +39,7 @@ int manager_address_is_reachable( Address **ret); int route_type_from_string(const char *s) _pure_; -const char *route_type_to_string(int t) _const_; +const char* route_type_to_string(int t) _const_; int route_scope_from_string(const char *s); int route_scope_to_string_alloc(int t, char **ret); diff --git a/src/network/networkd-routing-policy-rule.h b/src/network/networkd-routing-policy-rule.h index 42a575c493d..60524c00a0c 100644 --- a/src/network/networkd-routing-policy-rule.h +++ b/src/network/networkd-routing-policy-rule.h @@ -53,7 +53,7 @@ typedef struct RoutingPolicyRule { int32_t suppress_ifgroup; } RoutingPolicyRule; -const char *fr_act_type_full_to_string(int t) _const_; +const char* fr_act_type_full_to_string(int t) _const_; RoutingPolicyRule *routing_policy_rule_free(RoutingPolicyRule *rule); diff --git a/src/network/networkd-util.h b/src/network/networkd-util.h index c3b4586caea..3d31bcfb197 100644 --- a/src/network/networkd-util.h +++ b/src/network/networkd-util.h @@ -55,7 +55,7 @@ CONFIG_PARSER_PROTOTYPE(config_parse_link_local_address_family); CONFIG_PARSER_PROTOTYPE(config_parse_ip_masquerade); CONFIG_PARSER_PROTOTYPE(config_parse_mud_url); -const char *network_config_source_to_string(NetworkConfigSource s) _const_; +const char* network_config_source_to_string(NetworkConfigSource s) _const_; int network_config_state_to_string_alloc(NetworkConfigState s, char **ret); @@ -131,23 +131,23 @@ int network_config_state_to_string_alloc(NetworkConfigState s, char **ret); 0); \ } -const char *address_family_to_string(AddressFamily b) _const_; +const char* address_family_to_string(AddressFamily b) _const_; AddressFamily address_family_from_string(const char *s) _pure_; AddressFamily link_local_address_family_from_string(const char *s) _pure_; -const char *routing_policy_rule_address_family_to_string(AddressFamily b) _const_; +const char* routing_policy_rule_address_family_to_string(AddressFamily b) _const_; AddressFamily routing_policy_rule_address_family_from_string(const char *s) _pure_; -const char *nexthop_address_family_to_string(AddressFamily b) _const_; +const char* nexthop_address_family_to_string(AddressFamily b) _const_; AddressFamily nexthop_address_family_from_string(const char *s) _pure_; -const char *duplicate_address_detection_address_family_to_string(AddressFamily b) _const_; +const char* duplicate_address_detection_address_family_to_string(AddressFamily b) _const_; AddressFamily duplicate_address_detection_address_family_from_string(const char *s) _pure_; AddressFamily dhcp_deprecated_address_family_from_string(const char *s) _pure_; -const char *dhcp_lease_server_type_to_string(sd_dhcp_lease_server_type_t t) _const_; +const char* dhcp_lease_server_type_to_string(sd_dhcp_lease_server_type_t t) _const_; sd_dhcp_lease_server_type_t dhcp_lease_server_type_from_string(const char *s) _pure_; int log_link_message_full_errno(Link *link, sd_netlink_message *m, int level, int err, const char *msg); diff --git a/src/nspawn/nspawn-settings.h b/src/nspawn/nspawn-settings.h index 0bcb285f862..135b3dbb0a6 100644 --- a/src/nspawn/nspawn-settings.h +++ b/src/nspawn/nspawn-settings.h @@ -273,13 +273,13 @@ CONFIG_PARSER_PROTOTYPE(config_parse_userns_chown); CONFIG_PARSER_PROTOTYPE(config_parse_userns_ownership); CONFIG_PARSER_PROTOTYPE(config_parse_bind_user); -const char *resolv_conf_mode_to_string(ResolvConfMode a) _const_; +const char* resolv_conf_mode_to_string(ResolvConfMode a) _const_; ResolvConfMode resolv_conf_mode_from_string(const char *s) _pure_; -const char *timezone_mode_to_string(TimezoneMode a) _const_; +const char* timezone_mode_to_string(TimezoneMode a) _const_; TimezoneMode timezone_mode_from_string(const char *s) _pure_; -const char *user_namespace_ownership_to_string(UserNamespaceOwnership a) _const_; +const char* user_namespace_ownership_to_string(UserNamespaceOwnership a) _const_; UserNamespaceOwnership user_namespace_ownership_from_string(const char *s) _pure_; int parse_link_journal(const char *s, LinkJournal *ret_mode, bool *ret_try); diff --git a/src/portable/portable.h b/src/portable/portable.h index f5bb1902bd3..281b57e321d 100644 --- a/src/portable/portable.h +++ b/src/portable/portable.h @@ -80,8 +80,8 @@ int portable_get_profiles(char ***ret); void portable_changes_free(PortableChange *changes, size_t n_changes); -const char *portable_change_type_to_string(int t) _const_; +const char* portable_change_type_to_string(int t) _const_; int portable_change_type_from_string(const char *t) _pure_; -const char *portable_state_to_string(PortableState t) _const_; +const char* portable_state_to_string(PortableState t) _const_; PortableState portable_state_from_string(const char *t) _pure_; diff --git a/src/resolve/dns-type.c b/src/resolve/dns-type.c index 1af370d2393..197fb8a3611 100644 --- a/src/resolve/dns-type.c +++ b/src/resolve/dns-type.c @@ -220,7 +220,7 @@ int dns_type_to_af(uint16_t t) { } } -const char *dns_class_to_string(uint16_t class) { +const char* dns_class_to_string(uint16_t class) { switch (class) { diff --git a/src/resolve/dns-type.h b/src/resolve/dns-type.h index 404256c2f88..657526b4708 100644 --- a/src/resolve/dns-type.h +++ b/src/resolve/dns-type.h @@ -143,20 +143,20 @@ bool dns_class_is_pseudo(uint16_t class); bool dns_class_is_valid_rr(uint16_t class); /* TYPE?? follows http://tools.ietf.org/html/rfc3597#section-5 */ -const char *dns_type_to_string(int type); +const char* dns_type_to_string(int type); int dns_type_from_string(const char *s); -const char *dns_class_to_string(uint16_t class); +const char* dns_class_to_string(uint16_t class); int dns_class_from_string(const char *name); /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.2 */ -const char *tlsa_cert_usage_to_string(uint8_t cert_usage); +const char* tlsa_cert_usage_to_string(uint8_t cert_usage); /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.3 */ -const char *tlsa_selector_to_string(uint8_t selector); +const char* tlsa_selector_to_string(uint8_t selector); /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.4 */ -const char *tlsa_matching_type_to_string(uint8_t selector); +const char* tlsa_matching_type_to_string(uint8_t selector); /* https://tools.ietf.org/html/rfc6844#section-5.1 */ #define CAA_FLAG_CRITICAL (1u << 7) diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index e6267400532..67a83269e2a 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -2905,7 +2905,7 @@ static const char* const dns_rcode_table[_DNS_RCODE_MAX_DEFINED] = { }; DEFINE_STRING_TABLE_LOOKUP(dns_rcode, int); -const char *format_dns_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]) { +const char* format_dns_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]) { const char *p = dns_rcode_to_string(i); if (p) return p; @@ -2947,7 +2947,7 @@ static const char* const dns_ede_rcode_table[_DNS_EDE_RCODE_MAX_DEFINED] = { }; DEFINE_STRING_TABLE_LOOKUP_TO_STRING(dns_ede_rcode, int); -const char *format_dns_ede_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]) { +const char* format_dns_ede_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]) { const char *p = dns_ede_rcode_to_string(i); if (p) return p; @@ -2968,7 +2968,7 @@ static const char* const dns_svc_param_key_table[_DNS_SVC_PARAM_KEY_MAX_DEFINED] }; DEFINE_STRING_TABLE_LOOKUP_TO_STRING(dns_svc_param_key, int); -const char *format_dns_svc_param_key(uint16_t i, char buf[static DECIMAL_STR_MAX(uint16_t)+3]) { +const char* format_dns_svc_param_key(uint16_t i, char buf[static DECIMAL_STR_MAX(uint16_t)+3]) { const char *p = dns_svc_param_key_to_string(i); if (p) return p; diff --git a/src/resolve/resolved-dns-packet.h b/src/resolve/resolved-dns-packet.h index 393b7b2364a..8f5a08e3579 100644 --- a/src/resolve/resolved-dns-packet.h +++ b/src/resolve/resolved-dns-packet.h @@ -351,11 +351,11 @@ enum { const char* dns_rcode_to_string(int i) _const_; int dns_rcode_from_string(const char *s) _pure_; -const char *format_dns_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]); +const char* format_dns_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]); #define FORMAT_DNS_RCODE(i) format_dns_rcode(i, (char [DECIMAL_STR_MAX(int)]) {}) const char* dns_ede_rcode_to_string(int i) _const_; -const char *format_dns_ede_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]); +const char* format_dns_ede_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]); #define FORMAT_DNS_EDE_RCODE(i) format_dns_ede_rcode(i, (char [DECIMAL_STR_MAX(int)]) {}) const char* dns_protocol_to_string(DnsProtocol p) _const_; @@ -377,7 +377,7 @@ enum { }; const char* dns_svc_param_key_to_string(int i) _const_; -const char *format_dns_svc_param_key(uint16_t i, char buf[static DECIMAL_STR_MAX(uint16_t)+3]); +const char* format_dns_svc_param_key(uint16_t i, char buf[static DECIMAL_STR_MAX(uint16_t)+3]); #define FORMAT_DNS_SVC_PARAM_KEY(i) format_dns_svc_param_key(i, (char [DECIMAL_STR_MAX(uint16_t)+3]) {}) #define LLMNR_MULTICAST_IPV4_ADDRESS ((struct in_addr) { .s_addr = htobe32(224U << 24 | 252U) }) diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c index 14adb904bdf..ac60ee2798f 100644 --- a/src/resolve/resolved-dns-query.c +++ b/src/resolve/resolved-dns-query.c @@ -1282,7 +1282,7 @@ DnsQuestion* dns_query_question_for_protocol(DnsQuery *q, DnsProtocol protocol) } } -const char *dns_query_string(DnsQuery *q) { +const char* dns_query_string(DnsQuery *q) { const char *name; int r; diff --git a/src/resolve/resolved-dns-query.h b/src/resolve/resolved-dns-query.h index 29d7288981f..d3ec3d4d8d5 100644 --- a/src/resolve/resolved-dns-query.h +++ b/src/resolve/resolved-dns-query.h @@ -149,7 +149,7 @@ void dns_query_complete(DnsQuery *q, DnsTransactionState state); DnsQuestion* dns_query_question_for_protocol(DnsQuery *q, DnsProtocol protocol); -const char *dns_query_string(DnsQuery *q); +const char* dns_query_string(DnsQuery *q); DEFINE_TRIVIAL_CLEANUP_FUNC(DnsQuery*, dns_query_free); diff --git a/src/resolve/resolved-dns-question.c b/src/resolve/resolved-dns-question.c index 5754c851117..18e2fe2485f 100644 --- a/src/resolve/resolved-dns-question.c +++ b/src/resolve/resolved-dns-question.c @@ -309,7 +309,7 @@ int dns_question_cname_redirect(DnsQuestion *q, const DnsResourceRecord *cname, return 1; } -const char *dns_question_first_name(DnsQuestion *q) { +const char* dns_question_first_name(DnsQuestion *q) { if (!q) return NULL; diff --git a/src/resolve/resolved-dns-question.h b/src/resolve/resolved-dns-question.h index b7dc60c9c8b..a2fe219886c 100644 --- a/src/resolve/resolved-dns-question.h +++ b/src/resolve/resolved-dns-question.h @@ -45,7 +45,7 @@ int dns_question_cname_redirect(DnsQuestion *q, const DnsResourceRecord *cname, void dns_question_dump(DnsQuestion *q, FILE *f); -const char *dns_question_first_name(DnsQuestion *q); +const char* dns_question_first_name(DnsQuestion *q); static inline DnsResourceKey *dns_question_first_key(DnsQuestion *q) { return (q && q->n_keys > 0) ? q->items[0].key : NULL; diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c index a2e91962616..33ee644efd3 100644 --- a/src/resolve/resolved-dns-rr.c +++ b/src/resolve/resolved-dns-rr.c @@ -972,7 +972,7 @@ static char *format_svc_params(DnsSvcParam *first) { return strv_join(params, " "); } -const char *dns_resource_record_to_string(DnsResourceRecord *rr) { +const char* dns_resource_record_to_string(DnsResourceRecord *rr) { _cleanup_free_ char *s = NULL, *t = NULL; char k[DNS_RESOURCE_KEY_STRING_MAX]; int r; diff --git a/src/resolve/resolved-dns-server.c b/src/resolve/resolved-dns-server.c index c092bb11894..8abba8b0640 100644 --- a/src/resolve/resolved-dns-server.c +++ b/src/resolve/resolved-dns-server.c @@ -674,7 +674,7 @@ uint16_t dns_server_port(const DnsServer *s) { return 53; } -const char *dns_server_string(DnsServer *server) { +const char* dns_server_string(DnsServer *server) { assert(server); if (!server->server_string) @@ -683,7 +683,7 @@ const char *dns_server_string(DnsServer *server) { return server->server_string; } -const char *dns_server_string_full(DnsServer *server) { +const char* dns_server_string_full(DnsServer *server) { assert(server); if (!server->server_string_full) diff --git a/src/resolve/resolved-dns-server.h b/src/resolve/resolved-dns-server.h index 157c9085480..5e1d5698f67 100644 --- a/src/resolve/resolved-dns-server.h +++ b/src/resolve/resolved-dns-server.h @@ -140,8 +140,8 @@ DnsServerFeatureLevel dns_server_possible_feature_level(DnsServer *s); int dns_server_adjust_opt(DnsServer *server, DnsPacket *packet, DnsServerFeatureLevel level); -const char *dns_server_string(DnsServer *server); -const char *dns_server_string_full(DnsServer *server); +const char* dns_server_string(DnsServer *server); +const char* dns_server_string_full(DnsServer *server); int dns_server_ifindex(const DnsServer *s); uint16_t dns_server_port(const DnsServer *s); diff --git a/src/shared/bond-util.h b/src/shared/bond-util.h index 9e693b16adf..58be49788e8 100644 --- a/src/shared/bond-util.h +++ b/src/shared/bond-util.h @@ -81,26 +81,26 @@ typedef enum BondPrimaryReselect { _NETDEV_BOND_PRIMARY_RESELECT_INVALID = -EINVAL, } BondPrimaryReselect; -const char *bond_mode_to_string(BondMode d) _const_; +const char* bond_mode_to_string(BondMode d) _const_; BondMode bond_mode_from_string(const char *d) _pure_; -const char *bond_xmit_hash_policy_to_string(BondXmitHashPolicy d) _const_; +const char* bond_xmit_hash_policy_to_string(BondXmitHashPolicy d) _const_; BondXmitHashPolicy bond_xmit_hash_policy_from_string(const char *d) _pure_; -const char *bond_lacp_rate_to_string(BondLacpRate d) _const_; +const char* bond_lacp_rate_to_string(BondLacpRate d) _const_; BondLacpRate bond_lacp_rate_from_string(const char *d) _pure_; -const char *bond_fail_over_mac_to_string(BondFailOverMac d) _const_; +const char* bond_fail_over_mac_to_string(BondFailOverMac d) _const_; BondFailOverMac bond_fail_over_mac_from_string(const char *d) _pure_; -const char *bond_ad_select_to_string(BondAdSelect d) _const_; +const char* bond_ad_select_to_string(BondAdSelect d) _const_; BondAdSelect bond_ad_select_from_string(const char *d) _pure_; -const char *bond_arp_validate_to_string(BondArpValidate d) _const_; +const char* bond_arp_validate_to_string(BondArpValidate d) _const_; BondArpValidate bond_arp_validate_from_string(const char *d) _pure_; -const char *bond_arp_all_targets_to_string(BondArpAllTargets d) _const_; +const char* bond_arp_all_targets_to_string(BondArpAllTargets d) _const_; BondArpAllTargets bond_arp_all_targets_from_string(const char *d) _pure_; -const char *bond_primary_reselect_to_string(BondPrimaryReselect d) _const_; +const char* bond_primary_reselect_to_string(BondPrimaryReselect d) _const_; BondPrimaryReselect bond_primary_reselect_from_string(const char *d) _pure_; diff --git a/src/shared/bpf-program.h b/src/shared/bpf-program.h index 0e0b666df6f..904f2b941f5 100644 --- a/src/shared/bpf-program.h +++ b/src/shared/bpf-program.h @@ -60,6 +60,6 @@ int bpf_map_update_element(int fd, const void *key, void *value); int bpf_map_lookup_element(int fd, const void *key, void *value); int bpf_cgroup_attach_type_from_string(const char *str) _pure_; -const char *bpf_cgroup_attach_type_to_string(int attach_type) _const_; +const char* bpf_cgroup_attach_type_to_string(int attach_type) _const_; DEFINE_TRIVIAL_CLEANUP_FUNC(BPFProgram*, bpf_program_free); diff --git a/src/shared/bridge-util.h b/src/shared/bridge-util.h index a60891c8f06..fcc4d9ada5c 100644 --- a/src/shared/bridge-util.h +++ b/src/shared/bridge-util.h @@ -16,5 +16,5 @@ typedef enum BridgeState { _NETDEV_BRIDGE_STATE_INVALID = -EINVAL, } BridgeState; -const char *bridge_state_to_string(BridgeState d) _const_; +const char* bridge_state_to_string(BridgeState d) _const_; BridgeState bridge_state_from_string(const char *d) _pure_; diff --git a/src/shared/cryptsetup-util.c b/src/shared/cryptsetup-util.c index a0d5331175b..026738b74c2 100644 --- a/src/shared/cryptsetup-util.c +++ b/src/shared/cryptsetup-util.c @@ -77,7 +77,7 @@ DLSYM_PROTOTYPE(crypt_volume_key_keyring) = NULL; /* Do this only on new enough compilers that actually support the "symver" attribute. Given this is a debug * feature, let's simply not bother on older compilers */ #if BUILD_MODE_DEVELOPER && defined(__has_attribute) && __has_attribute(symver) -const char *my_crypt_token_external_path(void); /* prototype for our own implementation */ +const char* my_crypt_token_external_path(void); /* prototype for our own implementation */ /* We use the "symver" attribute to mark this implementation as the default implementation, and drop the * SD_SHARED namespace we by default attach to our symbols via a version script. */ diff --git a/src/shared/cryptsetup-util.h b/src/shared/cryptsetup-util.h index 84949dc5f65..86ac022f303 100644 --- a/src/shared/cryptsetup-util.h +++ b/src/shared/cryptsetup-util.h @@ -113,7 +113,7 @@ int dlopen_cryptsetup(void); int cryptsetup_get_keyslot_from_token(sd_json_variant *v); -static inline const char *mangle_none(const char *s) { +static inline const char* mangle_none(const char *s) { /* A helper that turns cryptsetup/integritysetup/veritysetup "options" strings into NULL if they are effectively empty */ return isempty(s) || STR_IN_SET(s, "-", "none") ? NULL : s; } diff --git a/src/shared/discover-image.h b/src/shared/discover-image.h index bd4bb6f034e..e14ef9dcb55 100644 --- a/src/shared/discover-image.h +++ b/src/shared/discover-image.h @@ -119,7 +119,7 @@ static inline bool IMAGE_IS_HOST(const struct Image *i) { int image_to_json(const struct Image *i, sd_json_variant **ret); -const char *image_root_to_string(ImageClass c) _const_; +const char* image_root_to_string(ImageClass c) _const_; extern const struct hash_ops image_hash_ops; diff --git a/src/shared/dissect-image.h b/src/shared/dissect-image.h index e31fd54f844..02aa2d5734b 100644 --- a/src/shared/dissect-image.h +++ b/src/shared/dissect-image.h @@ -235,7 +235,7 @@ int probe_sector_size_prefer_ioctl(int fd, uint32_t *ret); int partition_pick_mount_options(PartitionDesignator d, const char *fstype, bool rw, bool discard, char **ret_options, unsigned long *ret_ms_flags); -static inline const char *dissected_partition_fstype(const DissectedPartition *m) { +static inline const char* dissected_partition_fstype(const DissectedPartition *m) { assert(m); return m->decrypted_node ? m->decrypted_fstype : m->fstype; diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h index 5303cd75046..d431b4452ce 100644 --- a/src/shared/ethtool-util.h +++ b/src/shared/ethtool-util.h @@ -181,17 +181,17 @@ int ethtool_set_channels(int *ethtool_fd, const char *ifname, const netdev_chann int ethtool_set_flow_control(int *fd, const char *ifname, int rx, int tx, int autoneg); int ethtool_set_nic_coalesce_settings(int *ethtool_fd, const char *ifname, const netdev_coalesce_param *coalesce); -const char *duplex_to_string(Duplex d) _const_; +const char* duplex_to_string(Duplex d) _const_; Duplex duplex_from_string(const char *d) _pure_; int wol_options_to_string_alloc(uint32_t opts, char **ret); -const char *port_to_string(NetDevPort port) _const_; +const char* port_to_string(NetDevPort port) _const_; NetDevPort port_from_string(const char *port) _pure_; -const char *mdi_to_string(int mdi) _const_; +const char* mdi_to_string(int mdi) _const_; -const char *ethtool_link_mode_bit_to_string(enum ethtool_link_mode_bit_indices val) _const_; +const char* ethtool_link_mode_bit_to_string(enum ethtool_link_mode_bit_indices val) _const_; enum ethtool_link_mode_bit_indices ethtool_link_mode_bit_from_string(const char *str) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_duplex); diff --git a/src/shared/firewall-util-private.h b/src/shared/firewall-util-private.h index 38c8dfced5f..2e9a2317110 100644 --- a/src/shared/firewall-util-private.h +++ b/src/shared/firewall-util-private.h @@ -24,7 +24,7 @@ struct FirewallContext { sd_netlink *nfnl; }; -const char *firewall_backend_to_string(FirewallBackend b) _const_; +const char* firewall_backend_to_string(FirewallBackend b) _const_; int fw_nftables_init(FirewallContext *ctx); int fw_nftables_init_full(FirewallContext *ctx, bool init_tables); diff --git a/src/shared/firewall-util.h b/src/shared/firewall-util.h index 25ba0d4b3b4..5b3fda8732a 100644 --- a/src/shared/firewall-util.h +++ b/src/shared/firewall-util.h @@ -60,10 +60,10 @@ typedef struct NFTSetContext { void nft_set_context_clear(NFTSetContext *s); int nft_set_context_dup(const NFTSetContext *src, NFTSetContext *dst); -const char *nfproto_to_string(int i) _const_; +const char* nfproto_to_string(int i) _const_; int nfproto_from_string(const char *s) _pure_; -const char *nft_set_source_to_string(int i) _const_; +const char* nft_set_source_to_string(int i) _const_; int nft_set_source_from_string(const char *s) _pure_; int nft_set_element_modify_iprange( diff --git a/src/shared/geneve-util.h b/src/shared/geneve-util.h index acd0e1a1a26..96a1eeaf6aa 100644 --- a/src/shared/geneve-util.h +++ b/src/shared/geneve-util.h @@ -13,5 +13,5 @@ typedef enum GeneveDF { _NETDEV_GENEVE_DF_INVALID = -EINVAL, } GeneveDF; -const char *geneve_df_to_string(GeneveDF d) _const_; +const char* geneve_df_to_string(GeneveDF d) _const_; GeneveDF geneve_df_from_string(const char *d) _pure_; diff --git a/src/shared/gpt.c b/src/shared/gpt.c index d639463c24f..d80ee16f2e8 100644 --- a/src/shared/gpt.c +++ b/src/shared/gpt.c @@ -199,7 +199,7 @@ static const GptPartitionType *gpt_partition_type_find_by_uuid(sd_id128_t id) { return NULL; } -const char *gpt_partition_type_uuid_to_string(sd_id128_t id) { +const char* gpt_partition_type_uuid_to_string(sd_id128_t id) { const GptPartitionType *pt; pt = gpt_partition_type_find_by_uuid(id); @@ -209,7 +209,7 @@ const char *gpt_partition_type_uuid_to_string(sd_id128_t id) { return pt->name; } -const char *gpt_partition_type_uuid_to_string_harder( +const char* gpt_partition_type_uuid_to_string_harder( sd_id128_t id, char buffer[static SD_ID128_UUID_STRING_MAX]) { @@ -296,7 +296,7 @@ GptPartitionType gpt_partition_type_from_uuid(sd_id128_t id) { }; } -const char *gpt_partition_type_mountpoint_nulstr(GptPartitionType type) { +const char* gpt_partition_type_mountpoint_nulstr(GptPartitionType type) { return partition_mountpoint_to_string(type.designator); } diff --git a/src/shared/gpt.h b/src/shared/gpt.h index 21976e5311f..411749900fa 100644 --- a/src/shared/gpt.h +++ b/src/shared/gpt.h @@ -41,8 +41,8 @@ PartitionDesignator partition_verity_sig_to_data(PartitionDesignator d); const char* partition_designator_to_string(PartitionDesignator d) _const_; PartitionDesignator partition_designator_from_string(const char *name) _pure_; -const char *gpt_partition_type_uuid_to_string(sd_id128_t id); -const char *gpt_partition_type_uuid_to_string_harder( +const char* gpt_partition_type_uuid_to_string(sd_id128_t id); +const char* gpt_partition_type_uuid_to_string_harder( sd_id128_t id, char buffer[static SD_ID128_UUID_STRING_MAX]); @@ -67,7 +67,7 @@ int gpt_partition_type_from_string(const char *s, GptPartitionType *ret); GptPartitionType gpt_partition_type_override_architecture(GptPartitionType type, Architecture arch); -const char *gpt_partition_type_mountpoint_nulstr(GptPartitionType type); +const char* gpt_partition_type_mountpoint_nulstr(GptPartitionType type); bool gpt_partition_type_knows_read_only(GptPartitionType type); bool gpt_partition_type_knows_growfs(GptPartitionType type); diff --git a/src/shared/group-record.c b/src/shared/group-record.c index 47a4655a69f..a297272fabf 100644 --- a/src/shared/group-record.c +++ b/src/shared/group-record.c @@ -267,7 +267,7 @@ int group_record_build(GroupRecord **ret, ...) { return 0; } -const char *group_record_group_name_and_realm(GroupRecord *h) { +const char* group_record_group_name_and_realm(GroupRecord *h) { assert(h); /* Return the pre-initialized joined string if it is defined */ diff --git a/src/shared/group-record.h b/src/shared/group-record.h index 5b33abac211..054849b4098 100644 --- a/src/shared/group-record.h +++ b/src/shared/group-record.h @@ -43,5 +43,5 @@ int group_record_load(GroupRecord *h, sd_json_variant *v, UserRecordLoadFlags fl int group_record_build(GroupRecord **ret, ...); int group_record_clone(GroupRecord *g, UserRecordLoadFlags flags, GroupRecord **ret); -const char *group_record_group_name_and_realm(GroupRecord *h); +const char* group_record_group_name_and_realm(GroupRecord *h); UserDisposition group_record_disposition(GroupRecord *h); diff --git a/src/shared/install.h b/src/shared/install.h index fdd3f363542..56e4d0f742c 100644 --- a/src/shared/install.h +++ b/src/shared/install.h @@ -237,17 +237,17 @@ typedef enum PresetAction { _PRESET_ACTION_ERRNO_MAX = -ERRNO_MAX, /* Ensure this type covers the whole negative errno range */ } PresetAction; -const char *preset_action_past_tense_to_string(PresetAction action); +const char* preset_action_past_tense_to_string(PresetAction action); void unit_file_presets_done(UnitFilePresets *p); PresetAction unit_file_query_preset(RuntimeScope scope, const char *root_dir, const char *name, UnitFilePresets *cached); -const char *unit_file_state_to_string(UnitFileState s) _const_; +const char* unit_file_state_to_string(UnitFileState s) _const_; UnitFileState unit_file_state_from_string(const char *s) _pure_; /* from_string conversion is unreliable because of the overlap between -EPERM and -1 for error. */ -const char *install_change_type_to_string(InstallChangeType t) _const_; +const char* install_change_type_to_string(InstallChangeType t) _const_; InstallChangeType install_change_type_from_string(const char *s) _pure_; -const char *unit_file_preset_mode_to_string(UnitFilePresetMode m) _const_; +const char* unit_file_preset_mode_to_string(UnitFilePresetMode m) _const_; UnitFilePresetMode unit_file_preset_mode_from_string(const char *s) _pure_; diff --git a/src/shared/ip-protocol-list.c b/src/shared/ip-protocol-list.c index 14155b679ab..923d60abba2 100644 --- a/src/shared/ip-protocol-list.c +++ b/src/shared/ip-protocol-list.c @@ -14,7 +14,7 @@ static const struct ip_protocol_name* lookup_ip_protocol(register const char *st #include "ip-protocol-from-name.h" #include "ip-protocol-to-name.h" -const char *ip_protocol_to_name(int id) { +const char* ip_protocol_to_name(int id) { if (id < 0) return NULL; @@ -73,7 +73,7 @@ int parse_ip_protocol_full(const char *s, bool relaxed) { return p; } -const char *ip_protocol_to_tcp_udp(int id) { +const char* ip_protocol_to_tcp_udp(int id) { return IN_SET(id, IPPROTO_TCP, IPPROTO_UDP) ? ip_protocol_to_name(id) : NULL; } diff --git a/src/shared/ip-protocol-list.h b/src/shared/ip-protocol-list.h index a0875ef234c..b8715701320 100644 --- a/src/shared/ip-protocol-list.h +++ b/src/shared/ip-protocol-list.h @@ -3,12 +3,12 @@ #include -const char *ip_protocol_to_name(int id); +const char* ip_protocol_to_name(int id); int ip_protocol_from_name(const char *name); int parse_ip_protocol_full(const char *s, bool relaxed); static inline int parse_ip_protocol(const char *s) { return parse_ip_protocol_full(s, false); } -const char *ip_protocol_to_tcp_udp(int id); +const char* ip_protocol_to_tcp_udp(int id); int ip_protocol_from_tcp_udp(const char *ip_protocol); diff --git a/src/shared/ipvlan-util.h b/src/shared/ipvlan-util.h index a475b37572f..d1bf1afe7b9 100644 --- a/src/shared/ipvlan-util.h +++ b/src/shared/ipvlan-util.h @@ -22,8 +22,8 @@ typedef enum IPVlanFlags { _NETDEV_IPVLAN_FLAGS_INVALID = -EINVAL, } IPVlanFlags; -const char *ipvlan_mode_to_string(IPVlanMode d) _const_; +const char* ipvlan_mode_to_string(IPVlanMode d) _const_; IPVlanMode ipvlan_mode_from_string(const char *d) _pure_; -const char *ipvlan_flags_to_string(IPVlanFlags d) _const_; +const char* ipvlan_flags_to_string(IPVlanFlags d) _const_; IPVlanFlags ipvlan_flags_from_string(const char *d) _pure_; diff --git a/src/shared/macvlan-util.h b/src/shared/macvlan-util.h index 0705ecb6d86..b61630b789d 100644 --- a/src/shared/macvlan-util.h +++ b/src/shared/macvlan-util.h @@ -13,5 +13,5 @@ typedef enum MacVlanMode { _NETDEV_MACVLAN_MODE_INVALID = -EINVAL, } MacVlanMode; -const char *macvlan_mode_to_string(MacVlanMode d) _const_; +const char* macvlan_mode_to_string(MacVlanMode d) _const_; MacVlanMode macvlan_mode_from_string(const char *d) _pure_; diff --git a/src/shared/netif-naming-scheme.h b/src/shared/netif-naming-scheme.h index 62afdc514a9..27461f4ce99 100644 --- a/src/shared/netif-naming-scheme.h +++ b/src/shared/netif-naming-scheme.h @@ -92,10 +92,10 @@ typedef enum NamePolicy { _NAMEPOLICY_INVALID = -EINVAL, } NamePolicy; -const char *name_policy_to_string(NamePolicy p) _const_; +const char* name_policy_to_string(NamePolicy p) _const_; NamePolicy name_policy_from_string(const char *p) _pure_; -const char *alternative_names_policy_to_string(NamePolicy p) _const_; +const char* alternative_names_policy_to_string(NamePolicy p) _const_; NamePolicy alternative_names_policy_from_string(const char *p) _pure_; int device_get_sysattr_int_filtered(sd_device *device, const char *sysattr, int *ret_value); diff --git a/src/shared/netif-util.c b/src/shared/netif-util.c index 8adc2c89c81..978ce42341c 100644 --- a/src/shared/netif-util.c +++ b/src/shared/netif-util.c @@ -51,7 +51,7 @@ int net_get_type_string(sd_device *device, uint16_t iftype, char **ret) { return 0; } -const char *net_get_persistent_name(sd_device *device) { +const char* net_get_persistent_name(sd_device *device) { assert(device); /* fetch some persistent data unique (on this machine) to this device */ diff --git a/src/shared/netif-util.h b/src/shared/netif-util.h index 02c531e2712..1fe0de9c30f 100644 --- a/src/shared/netif-util.h +++ b/src/shared/netif-util.h @@ -11,7 +11,7 @@ bool netif_has_carrier(uint8_t operstate, unsigned flags); int net_get_type_string(sd_device *device, uint16_t iftype, char **ret); -const char *net_get_persistent_name(sd_device *device); +const char* net_get_persistent_name(sd_device *device); int net_get_unique_predictable_data(sd_device *device, bool use_sysname, uint64_t *ret); int net_get_unique_predictable_data_from_name(const char *name, const sd_id128_t *key, uint64_t *ret); int net_verify_hardware_address( diff --git a/src/shared/nsflags.c b/src/shared/nsflags.c index d4cee069dd6..f7f1995a875 100644 --- a/src/shared/nsflags.c +++ b/src/shared/nsflags.c @@ -58,7 +58,7 @@ int namespace_flags_to_string(unsigned long flags, char **ret) { return 0; } -const char *namespace_single_flag_to_string(unsigned long flag) { +const char* namespace_single_flag_to_string(unsigned long flag) { for (unsigned i = 0; namespace_info[i].proc_name; i++) if (namespace_info[i].clone_flag == flag) return namespace_info[i].proc_name; diff --git a/src/shared/nsflags.h b/src/shared/nsflags.h index b59740c0095..c4ff82df6ce 100644 --- a/src/shared/nsflags.h +++ b/src/shared/nsflags.h @@ -20,4 +20,4 @@ int namespace_flags_from_string(const char *name, unsigned long *ret); int namespace_flags_to_string(unsigned long flags, char **ret); -const char *namespace_single_flag_to_string(unsigned long flag); +const char* namespace_single_flag_to_string(unsigned long flag); diff --git a/src/shared/pretty-print.h b/src/shared/pretty-print.h index c166054919f..9eb16119059 100644 --- a/src/shared/pretty-print.h +++ b/src/shared/pretty-print.h @@ -31,13 +31,13 @@ int conf_files_cat(const char *root, const char *name, CatFlags flags); #define RED_CROSS_MARK_MAX (STRLEN(ANSI_HIGHLIGHT_RED) + STRLEN("✗") + STRLEN(ANSI_NORMAL) + 1) #define GREEN_CHECK_MARK_MAX (STRLEN(ANSI_HIGHLIGHT_GREEN) + STRLEN("✓") + STRLEN(ANSI_NORMAL) + 1) -static inline const char *red_cross_mark_internal(char buffer[static RED_CROSS_MARK_MAX]) { +static inline const char* red_cross_mark_internal(char buffer[static RED_CROSS_MARK_MAX]) { assert(buffer); assert_se(stpcpy(stpcpy(stpcpy(buffer, ansi_highlight_red()), special_glyph(SPECIAL_GLYPH_CROSS_MARK)), ansi_normal()) < buffer + RED_CROSS_MARK_MAX); return buffer; } -static inline const char *green_check_mark_internal(char buffer[static GREEN_CHECK_MARK_MAX]) { +static inline const char* green_check_mark_internal(char buffer[static GREEN_CHECK_MARK_MAX]) { assert(buffer); assert_se(stpcpy(stpcpy(stpcpy(buffer, ansi_highlight_green()), special_glyph(SPECIAL_GLYPH_CHECK_MARK)), ansi_normal()) < buffer + GREEN_CHECK_MARK_MAX); return buffer; diff --git a/src/shared/seccomp-util.h b/src/shared/seccomp-util.h index 7583357e8af..fbf85556690 100644 --- a/src/shared/seccomp-util.h +++ b/src/shared/seccomp-util.h @@ -173,7 +173,7 @@ static inline int seccomp_parse_errno_or_action(const char *p) { return parse_errno(p); } -static inline const char *seccomp_errno_or_action_to_string(int num) { +static inline const char* seccomp_errno_or_action_to_string(int num) { if (num == SECCOMP_ERROR_NUMBER_KILL) return "kill"; return errno_to_name(num); diff --git a/src/shared/socket-netlink.c b/src/shared/socket-netlink.c index a126d5d73b1..2580c84eadf 100644 --- a/src/shared/socket-netlink.c +++ b/src/shared/socket-netlink.c @@ -397,7 +397,7 @@ int in_addr_full_new_from_string(const char *s, struct in_addr_full **ret) { return in_addr_full_new(family, &a, port, ifindex, server_name, ret); } -const char *in_addr_full_to_string(struct in_addr_full *a) { +const char* in_addr_full_to_string(struct in_addr_full *a) { assert(a); if (!a->cached_server_string) diff --git a/src/shared/socket-netlink.h b/src/shared/socket-netlink.h index 2c06fbe3a7d..a6edb4c4bd3 100644 --- a/src/shared/socket-netlink.h +++ b/src/shared/socket-netlink.h @@ -41,6 +41,6 @@ struct in_addr_full *in_addr_full_free(struct in_addr_full *a); DEFINE_TRIVIAL_CLEANUP_FUNC(struct in_addr_full*, in_addr_full_free); int in_addr_full_new(int family, const union in_addr_union *a, uint16_t port, int ifindex, const char *server_name, struct in_addr_full **ret); int in_addr_full_new_from_string(const char *s, struct in_addr_full **ret); -const char *in_addr_full_to_string(struct in_addr_full *a); +const char* in_addr_full_to_string(struct in_addr_full *a); int netns_get_nsid(int netnsfd, uint32_t *ret); diff --git a/src/shared/tests.c b/src/shared/tests.c index 9169513e09c..e62795cb771 100644 --- a/src/shared/tests.c +++ b/src/shared/tests.c @@ -309,7 +309,7 @@ int enter_cgroup_root(char **ret_cgroup) { return enter_cgroup(ret_cgroup, false); } -const char *ci_environment(void) { +const char* ci_environment(void) { /* We return a string because we might want to provide multiple bits of information later on: not * just the general CI environment type, but also whether we're sanitizing or not, etc. The caller is * expected to use strstr on the returned value. */ diff --git a/src/shared/tests.h b/src/shared/tests.h index 09fdfd6b75c..820c3f70b74 100644 --- a/src/shared/tests.h +++ b/src/shared/tests.h @@ -95,7 +95,7 @@ bool can_memlock(void); } /* Provide a convenient way to check if we're running in CI. */ -const char *ci_environment(void); +const char* ci_environment(void); typedef struct TestFunc { union f { diff --git a/src/shared/tpm2-event-log.c b/src/shared/tpm2-event-log.c index 2e238468ae9..2d79b2332ba 100644 --- a/src/shared/tpm2-event-log.c +++ b/src/shared/tpm2-event-log.c @@ -55,7 +55,7 @@ static int tpm2_log_event_type_info_cmp(const tpm2_log_event_type_info *a, const return CMP(ASSERT_PTR(a)->event_type, ASSERT_PTR(b)->event_type); } -const char *tpm2_log_event_type_to_string(uint32_t type) { +const char* tpm2_log_event_type_to_string(uint32_t type) { tpm2_log_event_type_info *found, key = { .event_type = type, diff --git a/src/shared/tpm2-event-log.h b/src/shared/tpm2-event-log.h index 916b805bc2c..a33448fb858 100644 --- a/src/shared/tpm2-event-log.h +++ b/src/shared/tpm2-event-log.h @@ -55,7 +55,7 @@ #define LOAD_OPTIONS_EVENT_TAG_ID UINT32_C(0x8F3B22ED) #endif -const char *tpm2_log_event_type_to_string(uint32_t type) _const_; +const char* tpm2_log_event_type_to_string(uint32_t type) _const_; #if HAVE_TPM2 diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c index e60f1208dc3..d51e380f80d 100644 --- a/src/shared/tpm2-util.c +++ b/src/shared/tpm2-util.c @@ -6223,11 +6223,11 @@ static const char* tpm2_userspace_event_type_table[_TPM2_USERSPACE_EVENT_TYPE_MA DEFINE_STRING_TABLE_LOOKUP(tpm2_userspace_event_type, Tpm2UserspaceEventType); -const char *tpm2_userspace_log_path(void) { +const char* tpm2_userspace_log_path(void) { return secure_getenv("SYSTEMD_MEASURE_LOG_USERSPACE") ?: "/run/log/systemd/tpm2-measure.log"; } -const char *tpm2_firmware_log_path(void) { +const char* tpm2_firmware_log_path(void) { return secure_getenv("SYSTEMD_MEASURE_LOG_FIRMWARE") ?: "/sys/kernel/security/tpm0/binary_bios_measurements"; } @@ -7595,7 +7595,7 @@ int tpm2_hash_alg_to_size(uint16_t alg) { } } -const char *tpm2_hash_alg_to_string(uint16_t alg) { +const char* tpm2_hash_alg_to_string(uint16_t alg) { switch (alg) { case TPM2_ALG_SHA1: return "sha1"; @@ -7623,7 +7623,7 @@ int tpm2_hash_alg_from_string(const char *alg) { return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Unknown hash algorithm name '%s'", alg); } -const char *tpm2_asym_alg_to_string(uint16_t alg) { +const char* tpm2_asym_alg_to_string(uint16_t alg) { switch (alg) { case TPM2_ALG_ECC: return "ecc"; @@ -7643,7 +7643,7 @@ int tpm2_asym_alg_from_string(const char *alg) { return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Unknown asymmetric algorithm name '%s'", alg); } -const char *tpm2_sym_alg_to_string(uint16_t alg) { +const char* tpm2_sym_alg_to_string(uint16_t alg) { switch (alg) { #if HAVE_TPM2 case TPM2_ALG_AES: @@ -7663,7 +7663,7 @@ int tpm2_sym_alg_from_string(const char *alg) { return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Unknown symmetric algorithm name '%s'", alg); } -const char *tpm2_sym_mode_to_string(uint16_t mode) { +const char* tpm2_sym_mode_to_string(uint16_t mode) { switch (mode) { #if HAVE_TPM2 case TPM2_ALG_CTR: diff --git a/src/shared/tpm2-util.h b/src/shared/tpm2-util.h index 8d5aac09b2e..da1ef9e20cc 100644 --- a/src/shared/tpm2-util.h +++ b/src/shared/tpm2-util.h @@ -144,8 +144,8 @@ int tpm2_get_good_pcr_banks(Tpm2Context *c, uint32_t pcr_mask, TPMI_ALG_HASH **r int tpm2_get_good_pcr_banks_strv(Tpm2Context *c, uint32_t pcr_mask, char ***ret); int tpm2_get_best_pcr_bank(Tpm2Context *c, uint32_t pcr_mask, TPMI_ALG_HASH *ret); -const char *tpm2_userspace_log_path(void); -const char *tpm2_firmware_log_path(void); +const char* tpm2_userspace_log_path(void); +const char* tpm2_firmware_log_path(void); typedef enum Tpm2UserspaceEventType { TPM2_EVENT_PHASE, @@ -426,16 +426,16 @@ int tpm2_parse_luks2_json(sd_json_variant *v, int *ret_keyslot, uint32_t *ret_ha int tpm2_hash_alg_to_size(uint16_t alg); -const char *tpm2_hash_alg_to_string(uint16_t alg) _const_; +const char* tpm2_hash_alg_to_string(uint16_t alg) _const_; int tpm2_hash_alg_from_string(const char *alg) _pure_; -const char *tpm2_asym_alg_to_string(uint16_t alg) _const_; +const char* tpm2_asym_alg_to_string(uint16_t alg) _const_; int tpm2_asym_alg_from_string(const char *alg) _pure_; -const char *tpm2_sym_alg_to_string(uint16_t alg) _const_; +const char* tpm2_sym_alg_to_string(uint16_t alg) _const_; int tpm2_sym_alg_from_string(const char *alg) _pure_; -const char *tpm2_sym_mode_to_string(uint16_t mode) _const_; +const char* tpm2_sym_mode_to_string(uint16_t mode) _const_; int tpm2_sym_mode_from_string(const char *mode) _pure_; char *tpm2_pcr_mask_to_string(uint32_t mask); @@ -483,7 +483,7 @@ enum { }; int tpm2_pcr_index_from_string(const char *s) _pure_; -const char *tpm2_pcr_index_to_string(int pcr) _const_; +const char* tpm2_pcr_index_to_string(int pcr) _const_; /* The first and last NV index handle that is not registered to any company, as per TCG's "Registry of * Reserved TPM 2.0 Handles and Localities", section 2.2.2. */ diff --git a/src/shared/user-record-show.c b/src/shared/user-record-show.c index 23a41534ba5..45ef48bab67 100644 --- a/src/shared/user-record-show.c +++ b/src/shared/user-record-show.c @@ -17,7 +17,7 @@ #include "user-util.h" #include "userdb.h" -const char *user_record_state_color(const char *state) { +const char* user_record_state_color(const char *state) { if (STR_IN_SET(state, "unfixated", "absent")) return ansi_grey(); else if (streq(state, "active")) diff --git a/src/shared/user-record-show.h b/src/shared/user-record-show.h index dcef065d923..777c555a907 100644 --- a/src/shared/user-record-show.h +++ b/src/shared/user-record-show.h @@ -4,7 +4,7 @@ #include "user-record.h" #include "group-record.h" -const char *user_record_state_color(const char *state); +const char* user_record_state_color(const char *state); void user_record_show(UserRecord *hr, bool show_full_group_info); void group_record_show(GroupRecord *gr, bool show_full_user_info); diff --git a/src/shared/user-record.c b/src/shared/user-record.c index 262109b68a5..e1cbdbd5dc2 100644 --- a/src/shared/user-record.c +++ b/src/shared/user-record.c @@ -1757,7 +1757,7 @@ int user_record_build(UserRecord **ret, ...) { return 0; } -const char *user_record_user_name_and_realm(UserRecord *h) { +const char* user_record_user_name_and_realm(UserRecord *h) { assert(h); /* Return the pre-initialized joined string if it is defined */ @@ -1778,13 +1778,13 @@ UserStorage user_record_storage(UserRecord *h) { return USER_CLASSIC; } -const char *user_record_file_system_type(UserRecord *h) { +const char* user_record_file_system_type(UserRecord *h) { assert(h); return h->file_system_type ?: "btrfs"; } -const char *user_record_skeleton_directory(UserRecord *h) { +const char* user_record_skeleton_directory(UserRecord *h) { assert(h); return h->skeleton_directory ?: "/etc/skel"; @@ -1820,7 +1820,7 @@ const char* user_record_home_directory(UserRecord *h) { return user_record_home_directory_real(h); } -const char *user_record_image_path(UserRecord *h) { +const char* user_record_image_path(UserRecord *h) { assert(h); if (h->image_path) @@ -1833,7 +1833,7 @@ const char *user_record_image_path(UserRecord *h) { user_record_home_directory_real(h) : NULL; } -const char *user_record_cifs_user_name(UserRecord *h) { +const char* user_record_cifs_user_name(UserRecord *h) { assert(h); return h->cifs_user_name ?: h->user_name; @@ -1862,7 +1862,7 @@ static const char *user_record_shell_real(UserRecord *h) { return NOLOGIN; } -const char *user_record_shell(UserRecord *h) { +const char* user_record_shell(UserRecord *h) { const char *shell; assert(h); @@ -1877,7 +1877,7 @@ const char *user_record_shell(UserRecord *h) { return shell; } -const char *user_record_real_name(UserRecord *h) { +const char* user_record_real_name(UserRecord *h) { assert(h); return h->real_name ?: h->user_name; @@ -1925,13 +1925,13 @@ bool user_record_luks_offline_discard(UserRecord *h) { return true; } -const char *user_record_luks_cipher(UserRecord *h) { +const char* user_record_luks_cipher(UserRecord *h) { assert(h); return h->luks_cipher ?: "aes"; } -const char *user_record_luks_cipher_mode(UserRecord *h) { +const char* user_record_luks_cipher_mode(UserRecord *h) { assert(h); return h->luks_cipher_mode ?: "xts-plain64"; @@ -2007,7 +2007,7 @@ uint64_t user_record_luks_sector_size(UserRecord *h) { return CLAMP(UINT64_C(1) << (63 - __builtin_clzl(h->luks_sector_size)), 512U, 4096U); } -const char *user_record_luks_pbkdf_hash_algorithm(UserRecord *h) { +const char* user_record_luks_pbkdf_hash_algorithm(UserRecord *h) { assert(h); return h->luks_pbkdf_hash_algorithm ?: "sha512"; diff --git a/src/shared/user-record.h b/src/shared/user-record.h index 14a71e009ab..7cbf9371c6f 100644 --- a/src/shared/user-record.h +++ b/src/shared/user-record.h @@ -395,21 +395,21 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(UserRecord*, user_record_unref); int user_record_load(UserRecord *h, sd_json_variant *v, UserRecordLoadFlags flags); int user_record_build(UserRecord **ret, ...); -const char *user_record_user_name_and_realm(UserRecord *h); +const char* user_record_user_name_and_realm(UserRecord *h); UserStorage user_record_storage(UserRecord *h); -const char *user_record_file_system_type(UserRecord *h); -const char *user_record_skeleton_directory(UserRecord *h); +const char* user_record_file_system_type(UserRecord *h); +const char* user_record_skeleton_directory(UserRecord *h); mode_t user_record_access_mode(UserRecord *h); -const char *user_record_home_directory(UserRecord *h); -const char *user_record_image_path(UserRecord *h); +const char* user_record_home_directory(UserRecord *h); +const char* user_record_image_path(UserRecord *h); unsigned long user_record_mount_flags(UserRecord *h); -const char *user_record_cifs_user_name(UserRecord *h); -const char *user_record_shell(UserRecord *h); -const char *user_record_real_name(UserRecord *h); +const char* user_record_cifs_user_name(UserRecord *h); +const char* user_record_shell(UserRecord *h); +const char* user_record_real_name(UserRecord *h); bool user_record_luks_discard(UserRecord *h); bool user_record_luks_offline_discard(UserRecord *h); -const char *user_record_luks_cipher(UserRecord *h); -const char *user_record_luks_cipher_mode(UserRecord *h); +const char* user_record_luks_cipher(UserRecord *h); +const char* user_record_luks_cipher_mode(UserRecord *h); uint64_t user_record_luks_volume_key_size(UserRecord *h); const char* user_record_luks_pbkdf_type(UserRecord *h); uint64_t user_record_luks_pbkdf_force_iterations(UserRecord *h); @@ -417,7 +417,7 @@ usec_t user_record_luks_pbkdf_time_cost_usec(UserRecord *h); uint64_t user_record_luks_pbkdf_memory_cost(UserRecord *h); uint64_t user_record_luks_pbkdf_parallel_threads(UserRecord *h); uint64_t user_record_luks_sector_size(UserRecord *h); -const char *user_record_luks_pbkdf_hash_algorithm(UserRecord *h); +const char* user_record_luks_pbkdf_hash_algorithm(UserRecord *h); gid_t user_record_gid(UserRecord *h); UserDisposition user_record_disposition(UserRecord *h); int user_record_removable(UserRecord *h); diff --git a/src/shared/watchdog.c b/src/shared/watchdog.c index 810c5b5206a..edf20edcf96 100644 --- a/src/shared/watchdog.c +++ b/src/shared/watchdog.c @@ -361,7 +361,7 @@ close_and_fail: return r; } -const char *watchdog_get_device(void) { +const char* watchdog_get_device(void) { return watchdog_device; } diff --git a/src/shared/watchdog.h b/src/shared/watchdog.h index a490183fa12..bf9212a8650 100644 --- a/src/shared/watchdog.h +++ b/src/shared/watchdog.h @@ -5,7 +5,7 @@ #include "time-util.h" -const char *watchdog_get_device(void); +const char* watchdog_get_device(void); usec_t watchdog_get_last_ping(clockid_t clock); int watchdog_set_device(const char *path); diff --git a/src/shared/wifi-util.h b/src/shared/wifi-util.h index a762fbcd462..b71df933b77 100644 --- a/src/shared/wifi-util.h +++ b/src/shared/wifi-util.h @@ -11,6 +11,6 @@ int wifi_get_interface(sd_netlink *genl, int ifindex, enum nl80211_iftype *ret_iftype, char **ret_ssid); int wifi_get_station(sd_netlink *genl, int ifindex, struct ether_addr *ret_bssid); -const char *nl80211_iftype_to_string(enum nl80211_iftype iftype) _const_; +const char* nl80211_iftype_to_string(enum nl80211_iftype iftype) _const_; enum nl80211_iftype nl80211_iftype_from_string(const char *s) _pure_; -const char *nl80211_cmd_to_string(int cmd) _const_; +const char* nl80211_cmd_to_string(int cmd) _const_; diff --git a/src/systemd/sd-device.h b/src/systemd/sd-device.h index b67ec0f34dc..d9af181c8a1 100644 --- a/src/systemd/sd-device.h +++ b/src/systemd/sd-device.h @@ -90,16 +90,16 @@ int sd_device_get_is_initialized(sd_device *device); int sd_device_get_usec_initialized(sd_device *device, uint64_t *ret); int sd_device_get_usec_since_initialized(sd_device *device, uint64_t *ret); -const char *sd_device_get_tag_first(sd_device *device); -const char *sd_device_get_tag_next(sd_device *device); -const char *sd_device_get_current_tag_first(sd_device *device); -const char *sd_device_get_current_tag_next(sd_device *device); -const char *sd_device_get_devlink_first(sd_device *device); -const char *sd_device_get_devlink_next(sd_device *device); -const char *sd_device_get_property_first(sd_device *device, const char **value); -const char *sd_device_get_property_next(sd_device *device, const char **value); -const char *sd_device_get_sysattr_first(sd_device *device); -const char *sd_device_get_sysattr_next(sd_device *device); +const char* sd_device_get_tag_first(sd_device *device); +const char* sd_device_get_tag_next(sd_device *device); +const char* sd_device_get_current_tag_first(sd_device *device); +const char* sd_device_get_current_tag_next(sd_device *device); +const char* sd_device_get_devlink_first(sd_device *device); +const char* sd_device_get_devlink_next(sd_device *device); +const char* sd_device_get_property_first(sd_device *device, const char **value); +const char* sd_device_get_property_next(sd_device *device, const char **value); +const char* sd_device_get_sysattr_first(sd_device *device); +const char* sd_device_get_sysattr_next(sd_device *device); sd_device *sd_device_get_child_first(sd_device *device, const char **ret_suffix); sd_device *sd_device_get_child_next(sd_device *device, const char **ret_suffix); diff --git a/src/sysupdate/sysupdate-resource.h b/src/sysupdate/sysupdate-resource.h index 51f74cfcb39..76795db0d80 100644 --- a/src/sysupdate/sysupdate-resource.h +++ b/src/sysupdate/sysupdate-resource.h @@ -105,7 +105,7 @@ Instance* resource_find_instance(Resource *rr, const char *version); int resource_resolve_path(Resource *rr, const char *root, const char *node); ResourceType resource_type_from_string(const char *s) _pure_; -const char *resource_type_to_string(ResourceType t) _const_; +const char* resource_type_to_string(ResourceType t) _const_; PathRelativeTo path_relative_to_from_string(const char *s) _pure_; -const char *path_relative_to_to_string(PathRelativeTo r) _const_; +const char* path_relative_to_to_string(PathRelativeTo r) _const_; diff --git a/src/sysupdate/sysupdate-update-set.c b/src/sysupdate/sysupdate-update-set.c index 6d6051d15a5..f5a800429fb 100644 --- a/src/sysupdate/sysupdate-update-set.c +++ b/src/sysupdate/sysupdate-update-set.c @@ -28,7 +28,7 @@ int update_set_cmp(UpdateSet *const*a, UpdateSet *const*b) { return -strverscmp_improved((*a)->version, (*b)->version); } -const char *update_set_flags_to_color(UpdateSetFlags flags) { +const char* update_set_flags_to_color(UpdateSetFlags flags) { if (flags == 0 || (flags & UPDATE_OBSOLETE)) return (flags & UPDATE_NEWEST) ? ansi_highlight_grey() : ansi_grey(); @@ -45,7 +45,7 @@ const char *update_set_flags_to_color(UpdateSetFlags flags) { return NULL; } -const char *update_set_flags_to_glyph(UpdateSetFlags flags) { +const char* update_set_flags_to_glyph(UpdateSetFlags flags) { if (flags == 0 || (flags & UPDATE_OBSOLETE)) return special_glyph(SPECIAL_GLYPH_MULTIPLICATION_SIGN); diff --git a/src/sysupdate/sysupdate-update-set.h b/src/sysupdate/sysupdate-update-set.h index 5dd94bce41f..981535aedff 100644 --- a/src/sysupdate/sysupdate-update-set.h +++ b/src/sysupdate/sysupdate-update-set.h @@ -28,5 +28,5 @@ UpdateSet *update_set_free(UpdateSet *us); int update_set_cmp(UpdateSet *const*a, UpdateSet *const*b); -const char *update_set_flags_to_color(UpdateSetFlags flags); -const char *update_set_flags_to_glyph(UpdateSetFlags flags); +const char* update_set_flags_to_color(UpdateSetFlags flags); +const char* update_set_flags_to_glyph(UpdateSetFlags flags); diff --git a/src/udev/net/link-config.h b/src/udev/net/link-config.h index 103343f5a51..3152bec72af 100644 --- a/src/udev/net/link-config.h +++ b/src/udev/net/link-config.h @@ -109,7 +109,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_free); int link_get_config(LinkConfigContext *ctx, Link *link); int link_apply_config(LinkConfigContext *ctx, sd_netlink **rtnl, Link *link, EventMode mode); -const char *mac_address_policy_to_string(MACAddressPolicy p) _const_; +const char* mac_address_policy_to_string(MACAddressPolicy p) _const_; MACAddressPolicy mac_address_policy_from_string(const char *p) _pure_; /* gperf lookup function */ diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c index 1a1cb3734d0..69401aa2e0a 100644 --- a/src/udev/udev-builtin.c +++ b/src/udev/udev-builtin.c @@ -67,7 +67,7 @@ void udev_builtin_list(void) { fprintf(stderr, " %-14s %s\n", builtins[i]->name, builtins[i]->help); } -const char *udev_builtin_name(UdevBuiltinCommand cmd) { +const char* udev_builtin_name(UdevBuiltinCommand cmd) { assert(cmd >= 0 && cmd < _UDEV_BUILTIN_MAX); if (!builtins[cmd]) diff --git a/src/udev/udev-builtin.h b/src/udev/udev-builtin.h index 0d82bebf23a..b4ddba095ae 100644 --- a/src/udev/udev-builtin.h +++ b/src/udev/udev-builtin.h @@ -77,7 +77,7 @@ extern const UdevBuiltin udev_builtin_uaccess; void udev_builtin_init(void); void udev_builtin_exit(void); UdevBuiltinCommand udev_builtin_lookup(const char *command); -const char *udev_builtin_name(UdevBuiltinCommand cmd); +const char* udev_builtin_name(UdevBuiltinCommand cmd); bool udev_builtin_run_once(UdevBuiltinCommand cmd); int udev_builtin_run(UdevEvent *event, UdevBuiltinCommand cmd, const char *command); void udev_builtin_list(void); diff --git a/src/udev/udev-rules.h b/src/udev/udev-rules.h index 9d19c8099c5..ceb454da8d6 100644 --- a/src/udev/udev-rules.h +++ b/src/udev/udev-rules.h @@ -43,4 +43,4 @@ int udev_rules_apply_to_event(UdevRules *rules, UdevEvent *event); int udev_rules_apply_static_dev_perms(UdevRules *rules); ResolveNameTiming resolve_name_timing_from_string(const char *s) _pure_; -const char *resolve_name_timing_to_string(ResolveNameTiming i) _const_; +const char* resolve_name_timing_to_string(ResolveNameTiming i) _const_; diff --git a/src/vmspawn/vmspawn-settings.h b/src/vmspawn/vmspawn-settings.h index 5446c20911c..0902dbb245b 100644 --- a/src/vmspawn/vmspawn-settings.h +++ b/src/vmspawn/vmspawn-settings.h @@ -24,5 +24,5 @@ typedef enum SettingsMask { _SETTING_FORCE_ENUM_WIDTH = UINT64_MAX } SettingsMask; -const char *console_mode_to_string(ConsoleMode m) _const_; +const char* console_mode_to_string(ConsoleMode m) _const_; ConsoleMode console_mode_from_string(const char *s) _pure_; diff --git a/src/vmspawn/vmspawn-util.h b/src/vmspawn/vmspawn-util.h index fed0996891f..6a77b46e2e6 100644 --- a/src/vmspawn/vmspawn-util.h +++ b/src/vmspawn/vmspawn-util.h @@ -52,11 +52,11 @@ typedef struct OvmfConfig { bool supports_sb; } OvmfConfig; -static inline const char *ovmf_config_format(const OvmfConfig *c) { +static inline const char* ovmf_config_format(const OvmfConfig *c) { return ASSERT_PTR(c)->format ?: "raw"; } -static inline const char *ovmf_config_vars_format(const OvmfConfig *c) { +static inline const char* ovmf_config_vars_format(const OvmfConfig *c) { return ASSERT_PTR(c)->vars_format ?: "raw"; }