diff --git a/man/org.freedesktop.login1.xml b/man/org.freedesktop.login1.xml index aacaa1b952..d9b9b0e1b3 100644 --- a/man/org.freedesktop.login1.xml +++ b/man/org.freedesktop.login1.xml @@ -113,7 +113,7 @@ node /org/freedesktop/login1 { LockSessions(); UnlockSessions(); KillSession(in s session_id, - in s who, + in s whom, in i signal_number); KillUser(in u uid, in i signal_number); @@ -1140,7 +1140,7 @@ node /org/freedesktop/login1/session/1 { Unlock(); SetIdleHint(in b idle); SetLockedHint(in b locked); - Kill(in s who, + Kill(in s whom, in i signal_number); TakeControl(in b force); ReleaseControl(); diff --git a/man/org.freedesktop.machine1.xml b/man/org.freedesktop.machine1.xml index 8abef00e53..ce39f2d904 100644 --- a/man/org.freedesktop.machine1.xml +++ b/man/org.freedesktop.machine1.xml @@ -465,7 +465,7 @@ node /org/freedesktop/machine1/machine/rawhide { interface org.freedesktop.machine1.Machine { methods: Terminate(); - Kill(in s who, + Kill(in s whom, in i signal); GetAddresses(out a(iay) addresses); GetSSHInfo(out s ssh_address, diff --git a/meson.build b/meson.build index 82350df5b4..dd335c1244 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 a9ab891e20..91a20b2e0c 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 9592b9ed3c..e17762a35c 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 788f3abc37..26aa9f405e 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 33f5694abd..0fd75a0436 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/bus-label.c b/src/basic/bus-label.c index d33fc92290..6371a9dba0 100644 --- a/src/basic/bus-label.c +++ b/src/basic/bus-label.c @@ -7,7 +7,7 @@ #include "hexdecoct.h" #include "macro.h" -char *bus_label_escape(const char *s) { +char* bus_label_escape(const char *s) { char *r, *t; const char *f; @@ -42,7 +42,7 @@ char *bus_label_escape(const char *s) { return r; } -char *bus_label_unescape_n(const char *f, size_t l) { +char* bus_label_unescape_n(const char *f, size_t l) { char *r, *t; size_t i; diff --git a/src/basic/bus-label.h b/src/basic/bus-label.h index 446daba7f2..7630eff295 100644 --- a/src/basic/bus-label.h +++ b/src/basic/bus-label.h @@ -6,9 +6,9 @@ #include "string-util.h" -char *bus_label_escape(const char *s); -char *bus_label_unescape_n(const char *f, size_t l); +char* bus_label_escape(const char *s); +char* bus_label_unescape_n(const char *f, size_t l); -static inline char *bus_label_unescape(const char *f) { +static inline char* bus_label_unescape(const char *f) { return bus_label_unescape_n(f, strlen_ptr(f)); } diff --git a/src/basic/cap-list.c b/src/basic/cap-list.c index 80d48c142e..b4fe75a37e 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 3028197b56..95b03c48dd 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/cgroup-util.c b/src/basic/cgroup-util.c index 553ee6075a..65fbd09159 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -1691,7 +1691,7 @@ int cg_escape(const char *p, char **ret) { return 0; } -char *cg_unescape(const char *p) { +char* cg_unescape(const char *p) { assert(p); /* The return value of this function (unlike cg_escape()) diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h index a8871785b6..84009b47c1 100644 --- a/src/basic/cgroup-util.h +++ b/src/basic/cgroup-util.h @@ -298,7 +298,7 @@ int cg_path_decode_unit(const char *cgroup, char **ret_unit); bool cg_needs_escape(const char *p); int cg_escape(const char *p, char **ret); -char *cg_unescape(const char *p) _pure_; +char* cg_unescape(const char *p) _pure_; bool cg_controller_is_valid(const char *p); diff --git a/src/basic/confidential-virt.h b/src/basic/confidential-virt.h index c02f3b2321..ed74994837 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/env-util.c b/src/basic/env-util.c index 2bd532caa1..3e385e5ee4 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -552,7 +552,7 @@ char* strv_env_get_n(char * const *l, const char *name, size_t k, ReplaceEnvFlag return NULL; } -char *strv_env_pairs_get(char **l, const char *name) { +char* strv_env_pairs_get(char **l, const char *name) { char *result = NULL; assert(name); diff --git a/src/basic/env-util.h b/src/basic/env-util.h index 6610ca8ca1..5f20f1d69c 100644 --- a/src/basic/env-util.h +++ b/src/basic/env-util.h @@ -59,7 +59,7 @@ static inline char* strv_env_get(char * const *x, const char *n) { return strv_env_get_n(x, n, SIZE_MAX, 0); } -char *strv_env_pairs_get(char **l, const char *name) _pure_; +char* strv_env_pairs_get(char **l, const char *name) _pure_; int getenv_bool(const char *p); int secure_getenv_bool(const char *p); diff --git a/src/basic/errno-list.c b/src/basic/errno-list.c index 2aeb38c438..ba0f7c1628 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 082b833e49..81c193df12 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/ether-addr-util.c b/src/basic/ether-addr-util.c index 4bf91f690f..11336572cd 100644 --- a/src/basic/ether-addr-util.c +++ b/src/basic/ether-addr-util.c @@ -11,7 +11,7 @@ #include "macro.h" #include "string-util.h" -char *hw_addr_to_string_full( +char* hw_addr_to_string_full( const struct hw_addr_data *addr, HardwareAddressToStringFlags flags, char buffer[static HW_ADDR_TO_STRING_MAX]) { diff --git a/src/basic/ether-addr-util.h b/src/basic/ether-addr-util.h index 187e4ef583..8ebf9c031d 100644 --- a/src/basic/ether-addr-util.h +++ b/src/basic/ether-addr-util.h @@ -36,11 +36,11 @@ typedef enum HardwareAddressToStringFlags { } HardwareAddressToStringFlags; #define HW_ADDR_TO_STRING_MAX (3*HW_ADDR_MAX_SIZE) -char *hw_addr_to_string_full( +char* hw_addr_to_string_full( const struct hw_addr_data *addr, HardwareAddressToStringFlags flags, char buffer[static HW_ADDR_TO_STRING_MAX]); -static inline char *hw_addr_to_string(const struct hw_addr_data *addr, char buffer[static HW_ADDR_TO_STRING_MAX]) { +static inline char* hw_addr_to_string(const struct hw_addr_data *addr, char buffer[static HW_ADDR_TO_STRING_MAX]) { return hw_addr_to_string_full(addr, 0, buffer); } diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c index 298477ed0d..d5e733293c 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"; @@ -1104,7 +1104,7 @@ const char *accmode_to_string(int flags) { } } -char *format_proc_pid_fd_path(char buf[static PROC_PID_FD_PATH_MAX], pid_t pid, int fd) { +char* format_proc_pid_fd_path(char buf[static PROC_PID_FD_PATH_MAX], pid_t pid, int fd) { assert(buf); assert(fd >= 0); assert(pid >= 0); diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h index a047c3a3f4..3a56d2cbbf 100644 --- a/src/basic/fd-util.h +++ b/src/basic/fd-util.h @@ -141,7 +141,7 @@ int fds_are_same_mount(int fd1, int fd2); #define PROC_FD_PATH_MAX \ (STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)) -static inline char *format_proc_fd_path(char buf[static PROC_FD_PATH_MAX], int fd) { +static inline char* format_proc_fd_path(char buf[static PROC_FD_PATH_MAX], int fd) { assert(buf); assert(fd >= 0); assert_se(snprintf_ok(buf, PROC_FD_PATH_MAX, "/proc/self/fd/%i", fd)); @@ -155,7 +155,7 @@ static inline char *format_proc_fd_path(char buf[static PROC_FD_PATH_MAX], int f #define PROC_PID_FD_PATH_MAX \ (STRLEN("/proc//fd/") + DECIMAL_STR_MAX(pid_t) + DECIMAL_STR_MAX(int)) -char *format_proc_pid_fd_path(char buf[static PROC_PID_FD_PATH_MAX], pid_t pid, int fd); +char* format_proc_pid_fd_path(char buf[static PROC_PID_FD_PATH_MAX], pid_t pid, int fd); /* Kinda the same as FORMAT_PROC_FD_PATH(), but goes by PID rather than "self" symlink */ #define FORMAT_PROC_PID_FD_PATH(pid, fd) \ @@ -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 7d34e4e9ad..aff1791c1d 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 f9edbc1f29..4e6c6c47fc 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/format-util.c b/src/basic/format-util.c index 445fecc8ca..7098bf6a99 100644 --- a/src/basic/format-util.c +++ b/src/basic/format-util.c @@ -37,7 +37,7 @@ int format_ifname_full_alloc(int ifindex, FormatIfnameFlag flag, char **ret) { return strdup_to(ret, buf); } -char *format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) { +char* format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) { typedef struct { const char *suffix; uint64_t factor; diff --git a/src/basic/format-util.h b/src/basic/format-util.h index ba7cff6a8b..4a030b7557 100644 --- a/src/basic/format-util.h +++ b/src/basic/format-util.h @@ -81,7 +81,7 @@ static inline int format_ifname_alloc(int ifindex, char **ret) { return format_ifname_full_alloc(ifindex, 0, ret); } -static inline char *_format_ifname_full(int ifindex, FormatIfnameFlag flag, char buf[static IF_NAMESIZE]) { +static inline char* _format_ifname_full(int ifindex, FormatIfnameFlag flag, char buf[static IF_NAMESIZE]) { (void) format_ifname_full(ifindex, flag, buf); return buf; } @@ -97,10 +97,10 @@ typedef enum { #define FORMAT_BYTES_MAX 16U -char *format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) _warn_unused_result_; +char* format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) _warn_unused_result_; _warn_unused_result_ -static inline char *format_bytes(char *buf, size_t l, uint64_t t) { +static inline char* format_bytes(char *buf, size_t l, uint64_t t) { return format_bytes_full(buf, l, t, FORMAT_BYTES_USE_IEC | FORMAT_BYTES_BELOW_POINT | FORMAT_BYTES_TRAILING_B); } diff --git a/src/basic/glyph-util.c b/src/basic/glyph-util.c index d37be3234a..68fd3971ad 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 db8dbbff26..9b5c3a8d22 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/hexdecoct.c b/src/basic/hexdecoct.c index 4cb67d94a4..c474b60776 100644 --- a/src/basic/hexdecoct.c +++ b/src/basic/hexdecoct.c @@ -55,7 +55,7 @@ int unhexchar(char c) { return -EINVAL; } -char *hexmem(const void *p, size_t l) { +char* hexmem(const void *p, size_t l) { const uint8_t *x; char *r, *z; @@ -188,7 +188,7 @@ int unbase32hexchar(char c) { return -EINVAL; } -char *base32hexmem(const void *p, size_t l, bool padding) { +char* base32hexmem(const void *p, size_t l, bool padding) { char *r, *z; const uint8_t *x; size_t len; diff --git a/src/basic/hexdecoct.h b/src/basic/hexdecoct.h index 0a10af3e16..d160ca28c9 100644 --- a/src/basic/hexdecoct.h +++ b/src/basic/hexdecoct.h @@ -17,7 +17,7 @@ int undecchar(char c) _const_; char hexchar(int x) _const_; int unhexchar(char c) _const_; -char *hexmem(const void *p, size_t l); +char* hexmem(const void *p, size_t l); int unhexmem_full(const char *p, size_t l, bool secure, void **ret_data, size_t *ret_size); static inline int unhexmem(const char *p, void **ret_data, size_t *ret_size) { return unhexmem_full(p, SIZE_MAX, false, ret_data, ret_size); @@ -30,7 +30,7 @@ char base64char(int x) _const_; char urlsafe_base64char(int x) _const_; int unbase64char(char c) _const_; -char *base32hexmem(const void *p, size_t l, bool padding); +char* base32hexmem(const void *p, size_t l, bool padding); int unbase32hexmem(const char *p, size_t l, bool padding, void **mem, size_t *len); ssize_t base64mem_full(const void *p, size_t l, size_t line_break, char **ret); diff --git a/src/basic/log.c b/src/basic/log.c index 13ad19a051..50b405b843 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 726f035cfc..0597bd1e84 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 03e56f6cab..de15ac73ca 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 e5f21780f8..90a1343e0c 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 0d26d189d1..0da4e9d079 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 f6a12a3fb1..071c9080b7 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 792b8ff2cb..8b5c8fbf3c 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/proc-cmdline.c b/src/basic/proc-cmdline.c index ce1ba3a1ea..5dad0e50d4 100644 --- a/src/basic/proc-cmdline.c +++ b/src/basic/proc-cmdline.c @@ -253,7 +253,7 @@ static bool relaxed_equal_char(char a, char b) { (a == '-' && b == '_'); } -char *proc_cmdline_key_startswith(const char *s, const char *prefix) { +char* proc_cmdline_key_startswith(const char *s, const char *prefix) { assert(s); assert(prefix); diff --git a/src/basic/proc-cmdline.h b/src/basic/proc-cmdline.h index 9502fb8d43..7359d5c275 100644 --- a/src/basic/proc-cmdline.h +++ b/src/basic/proc-cmdline.h @@ -28,7 +28,7 @@ int proc_cmdline_get_bool(const char *key, ProcCmdlineFlags flags, bool *ret); int proc_cmdline_get_key_many_internal(ProcCmdlineFlags flags, ...); #define proc_cmdline_get_key_many(flags, ...) proc_cmdline_get_key_many_internal(flags, __VA_ARGS__, NULL) -char *proc_cmdline_key_startswith(const char *s, const char *prefix); +char* proc_cmdline_key_startswith(const char *s, const char *prefix); bool proc_cmdline_key_streq(const char *x, const char *y); /* A little helper call, to be used in proc_cmdline_parse_t callbacks */ diff --git a/src/basic/process-util.h b/src/basic/process-util.h index cbcb91b6eb..59732a8676 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/replace-var.c b/src/basic/replace-var.c index 01c26ce74c..4813ac3d2b 100644 --- a/src/basic/replace-var.c +++ b/src/basic/replace-var.c @@ -36,7 +36,7 @@ static int get_variable(const char *b, char **r) { return 1; } -char *replace_var(const char *text, char *(*lookup)(const char *variable, void *userdata), void *userdata) { +char* replace_var(const char *text, char *(*lookup)(const char *variable, void *userdata), void *userdata) { char *r, *t; const char *f; size_t l; diff --git a/src/basic/replace-var.h b/src/basic/replace-var.h index 644d9dfce4..8b9b2aa5ba 100644 --- a/src/basic/replace-var.h +++ b/src/basic/replace-var.h @@ -1,4 +1,4 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -char *replace_var(const char *text, char *(*lookup)(const char *variable, void *userdata), void *userdata); +char* replace_var(const char *text, char *(*lookup)(const char *variable, void *userdata), void *userdata); diff --git a/src/basic/rlimit-util.h b/src/basic/rlimit-util.h index afc1a1f262..b5f9989487 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 6553e4c199..ba900fed1e 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 27d094b7bd..bb04351d4b 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 8826fbeb7b..80579a59f3 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 d1d90df786..639443d02b 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.c b/src/basic/string-util.c index 274a3f3a04..1715d62a39 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -46,7 +46,7 @@ char* first_word(const char *s, const char *word) { return (char*) nw; } -char *strnappend(const char *s, const char *suffix, size_t b) { +char* strnappend(const char *s, const char *suffix, size_t b) { size_t a; char *r; @@ -77,7 +77,7 @@ char *strnappend(const char *s, const char *suffix, size_t b) { return r; } -char *strjoin_real(const char *x, ...) { +char* strjoin_real(const char *x, ...) { va_list ap; size_t l = 1; char *r, *p; @@ -109,7 +109,7 @@ char *strjoin_real(const char *x, ...) { return r; } -char *strstrip(char *s) { +char* strstrip(char *s) { if (!s) return NULL; @@ -118,7 +118,7 @@ char *strstrip(char *s) { return delete_trailing_chars(skip_leading_chars(s, WHITESPACE), WHITESPACE); } -char *delete_chars(char *s, const char *bad) { +char* delete_chars(char *s, const char *bad) { char *f, *t; /* Drops all specified bad characters, regardless where in the string */ @@ -141,7 +141,7 @@ char *delete_chars(char *s, const char *bad) { return s; } -char *delete_trailing_chars(char *s, const char *bad) { +char* delete_trailing_chars(char *s, const char *bad) { char *c = s; /* Drops all specified bad characters, at the end of the string */ @@ -161,7 +161,7 @@ char *delete_trailing_chars(char *s, const char *bad) { return s; } -char *truncate_nl_full(char *s, size_t *ret_len) { +char* truncate_nl_full(char *s, size_t *ret_len) { size_t n; assert(s); @@ -189,7 +189,7 @@ char ascii_toupper(char x) { return x; } -char *ascii_strlower(char *t) { +char* ascii_strlower(char *t) { assert(t); for (char *p = t; *p; p++) @@ -198,7 +198,7 @@ char *ascii_strlower(char *t) { return t; } -char *ascii_strupper(char *t) { +char* ascii_strupper(char *t) { assert(t); for (char *p = t; *p; p++) @@ -207,7 +207,7 @@ char *ascii_strupper(char *t) { return t; } -char *ascii_strlower_n(char *t, size_t n) { +char* ascii_strlower_n(char *t, size_t n) { if (n <= 0) return t; @@ -389,7 +389,7 @@ static char *ascii_ellipsize_mem(const char *s, size_t old_length, size_t new_le return t; } -char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent) { +char* ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent) { size_t x, k, len, len2; const char *i, *j; int r; @@ -524,7 +524,7 @@ char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigne return e; } -char *cellescape(char *buf, size_t len, const char *s) { +char* cellescape(char *buf, size_t len, const char *s) { /* Escape and ellipsize s into buffer buf of size len. Only non-control ASCII * characters are copied as they are, everything else is escaped. The result * is different then if escaping and ellipsization was performed in two @@ -630,7 +630,7 @@ int strgrowpad0(char **s, size_t l) { return 0; } -char *strreplace(const char *text, const char *old_string, const char *new_string) { +char* strreplace(const char *text, const char *old_string, const char *new_string) { size_t l, old_len, new_len; char *t, *ret = NULL; const char *f; @@ -692,7 +692,7 @@ static void advance_offsets( shift[1] += size; } -char *strip_tab_ansi(char **ibuf, size_t *_isz, size_t highlight[2]) { +char* strip_tab_ansi(char **ibuf, size_t *_isz, size_t highlight[2]) { const char *begin = NULL; enum { STATE_OTHER, @@ -824,7 +824,7 @@ char *strip_tab_ansi(char **ibuf, size_t *_isz, size_t highlight[2]) { return *ibuf; } -char *strextend_with_separator_internal(char **x, const char *separator, ...) { +char* strextend_with_separator_internal(char **x, const char *separator, ...) { size_t f, l, l_separator; bool need_separator; char *nr, *p; @@ -980,7 +980,7 @@ oom: return -ENOMEM; } -char *strextendn(char **x, const char *s, size_t l) { +char* strextendn(char **x, const char *s, size_t l) { assert(x); assert(s || l == 0); @@ -1007,7 +1007,7 @@ char *strextendn(char **x, const char *s, size_t l) { return *x; } -char *strrep(const char *s, unsigned n) { +char* strrep(const char *s, unsigned n) { char *r, *p; size_t l; @@ -1288,7 +1288,7 @@ bool streq_skip_trailing_chars(const char *s1, const char *s2, const char *ok) { return in_charset(s1, ok) && in_charset(s2, ok); } -char *string_replace_char(char *str, char old_char, char new_char) { +char* string_replace_char(char *str, char old_char, char new_char) { assert(str); assert(old_char != '\0'); assert(new_char != '\0'); @@ -1358,14 +1358,14 @@ size_t strspn_from_end(const char *str, const char *accept) { return n; } -char *strdupspn(const char *a, const char *accept) { +char* strdupspn(const char *a, const char *accept) { if (isempty(a) || isempty(accept)) return strdup(""); return strndup(a, strspn(a, accept)); } -char *strdupcspn(const char *a, const char *reject) { +char* strdupcspn(const char *a, const char *reject) { if (isempty(a)) return strdup(""); if (isempty(reject)) @@ -1374,7 +1374,7 @@ char *strdupcspn(const char *a, const char *reject) { return strndup(a, strcspn(a, reject)); } -char *find_line_startswith(const char *haystack, const char *needle) { +char* find_line_startswith(const char *haystack, const char *needle) { char *p; assert(haystack); @@ -1485,7 +1485,7 @@ ssize_t strlevenshtein(const char *x, const char *y) { return t1[yl]; } -char *strrstr(const char *haystack, const char *needle) { +char* strrstr(const char *haystack, const char *needle) { /* Like strstr() but returns the last rather than the first occurrence of "needle" in "haystack". */ if (!haystack || !needle) diff --git a/src/basic/string-util.h b/src/basic/string-util.h index b5da8bea05..eb1cd2d9e9 100644 --- a/src/basic/string-util.h +++ b/src/basic/string-util.h @@ -33,7 +33,7 @@ static inline char* strstr_ptr(const char *haystack, const char *needle) { return strstr(haystack, needle); } -static inline char *strstrafter(const char *haystack, const char *needle) { +static inline char* strstrafter(const char *haystack, const char *needle) { char *p; /* Returns NULL if not found, or pointer to first character after needle if found */ @@ -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) \ @@ -104,11 +104,11 @@ static inline const char *empty_or_dash_to_null(const char *p) { (typeof(p)) (empty_or_dash(_p) ? NULL : _p); \ }) -char *first_word(const char *s, const char *word) _pure_; +char* first_word(const char *s, const char *word) _pure_; -char *strnappend(const char *s, const char *suffix, size_t length); +char* strnappend(const char *s, const char *suffix, size_t length); -char *strjoin_real(const char *x, ...) _sentinel_; +char* strjoin_real(const char *x, ...) _sentinel_; #define strjoin(a, ...) strjoin_real((a), __VA_ARGS__, NULL) #define strjoina(a, ...) \ @@ -126,11 +126,11 @@ char *strjoin_real(const char *x, ...) _sentinel_; _d_; \ }) -char *strstrip(char *s); -char *delete_chars(char *s, const char *bad); -char *delete_trailing_chars(char *s, const char *bad); -char *truncate_nl_full(char *s, size_t *ret_len); -static inline char *truncate_nl(char *s) { +char* strstrip(char *s); +char* delete_chars(char *s, const char *bad); +char* delete_trailing_chars(char *s, const char *bad); +char* truncate_nl_full(char *s, size_t *ret_len); +static inline char* truncate_nl(char *s) { return truncate_nl_full(s, NULL); } @@ -145,11 +145,11 @@ static inline char* skip_leading_chars(const char *s, const char *bad) { } char ascii_tolower(char x); -char *ascii_strlower(char *s); -char *ascii_strlower_n(char *s, size_t n); +char* ascii_strlower(char *s); +char* ascii_strlower_n(char *s, size_t n); char ascii_toupper(char x); -char *ascii_strupper(char *s); +char* ascii_strupper(char *s); int ascii_strcasecmp_n(const char *a, const char *b, size_t n); int ascii_strcasecmp_nn(const char *a, size_t n, const char *b, size_t m); @@ -172,12 +172,12 @@ static inline bool char_is_cc(char p) { } bool string_has_cc(const char *p, const char *ok) _pure_; -char *ellipsize_mem(const char *s, size_t old_length_bytes, size_t new_length_columns, unsigned percent); -static inline char *ellipsize(const char *s, size_t length, unsigned percent) { +char* ellipsize_mem(const char *s, size_t old_length_bytes, size_t new_length_columns, unsigned percent); +static inline char* ellipsize(const char *s, size_t length, unsigned percent) { return ellipsize_mem(s, strlen(s), length, percent); } -char *cellescape(char *buf, size_t len, const char *s); +char* cellescape(char *buf, size_t len, const char *s); /* This limit is arbitrary, enough to give some idea what the string contains */ #define CELLESCAPE_DEFAULT_LENGTH 64 @@ -186,20 +186,20 @@ char* strshorten(char *s, size_t l); int strgrowpad0(char **s, size_t l); -char *strreplace(const char *text, const char *old_string, const char *new_string); +char* strreplace(const char *text, const char *old_string, const char *new_string); -char *strip_tab_ansi(char **ibuf, size_t *_isz, size_t highlight[2]); +char* strip_tab_ansi(char **ibuf, size_t *_isz, size_t highlight[2]); -char *strextend_with_separator_internal(char **x, const char *separator, ...) _sentinel_; +char* strextend_with_separator_internal(char **x, const char *separator, ...) _sentinel_; #define strextend_with_separator(x, separator, ...) strextend_with_separator_internal(x, separator, __VA_ARGS__, NULL) #define strextend(x, ...) strextend_with_separator_internal(x, NULL, __VA_ARGS__, NULL) -char *strextendn(char **x, const char *s, size_t l); +char* strextendn(char **x, const char *s, size_t l); int strextendf_with_separator(char **x, const char *separator, const char *format, ...) _printf_(3,4); #define strextendf(x, ...) strextendf_with_separator(x, NULL, __VA_ARGS__) -char *strrep(const char *s, unsigned n); +char* strrep(const char *s, unsigned n); #define strrepa(s, n) \ ({ \ @@ -285,7 +285,7 @@ static inline int string_contains_word(const char *string, const char *separator bool streq_skip_trailing_chars(const char *s1, const char *s2, const char *ok); -char *string_replace_char(char *str, char old_char, char new_char); +char* string_replace_char(char *str, char old_char, char new_char); typedef enum MakeCStringMode { MAKE_CSTRING_REFUSE_TRAILING_NUL, @@ -299,10 +299,10 @@ int make_cstring(const char *s, size_t n, MakeCStringMode mode, char **ret); size_t strspn_from_end(const char *str, const char *accept); -char *strdupspn(const char *a, const char *accept); -char *strdupcspn(const char *a, const char *reject); +char* strdupspn(const char *a, const char *accept); +char* strdupcspn(const char *a, const char *reject); -char *find_line_startswith(const char *haystack, const char *needle); +char* find_line_startswith(const char *haystack, const char *needle); bool version_is_valid(const char *s); @@ -310,4 +310,4 @@ bool version_is_valid_versionspec(const char *s); ssize_t strlevenshtein(const char *x, const char *y); -char *strrstr(const char *haystack, const char *needle); +char* strrstr(const char *haystack, const char *needle); diff --git a/src/basic/sysctl-util.c b/src/basic/sysctl-util.c index 9a1933f579..b284c9ccd2 100644 --- a/src/basic/sysctl-util.c +++ b/src/basic/sysctl-util.c @@ -15,7 +15,7 @@ #include "string-util.h" #include "sysctl-util.h" -char *sysctl_normalize(char *s) { +char* sysctl_normalize(char *s) { char *n; n = strpbrk(s, "/."); diff --git a/src/basic/sysctl-util.h b/src/basic/sysctl-util.h index 7192e8c0b0..2bf5491703 100644 --- a/src/basic/sysctl-util.h +++ b/src/basic/sysctl-util.h @@ -8,7 +8,7 @@ #include "stdio-util.h" #include "string-util.h" -char *sysctl_normalize(char *s); +char* sysctl_normalize(char *s); int sysctl_read(const char *property, char **value); int sysctl_write(const char *property, const char *value); int sysctl_writef(const char *property, const char *format, ...) _printf_(2, 3); diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index dda592089c..787ae7abac 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 ecfe574451..0c1c6373bc 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/time-util.c b/src/basic/time-util.c index cd35e8a73c..ed6fdc3e49 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -312,7 +312,7 @@ struct timeval *timeval_store(struct timeval *tv, usec_t u) { return tv; } -char *format_timestamp_style( +char* format_timestamp_style( char *buf, size_t l, usec_t t, diff --git a/src/basic/unit-def.c b/src/basic/unit-def.c index d03363bd37..6ffdcd37c8 100644 --- a/src/basic/unit-def.c +++ b/src/basic/unit-def.c @@ -6,7 +6,7 @@ #include "unit-def.h" #include "unit-name.h" -char *unit_dbus_path_from_name(const char *name) { +char* unit_dbus_path_from_name(const char *name) { _cleanup_free_ char *e = NULL; assert(name); @@ -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 8e73e286da..cf74c9de2f 100644 --- a/src/basic/unit-def.h +++ b/src/basic/unit-def.h @@ -280,28 +280,28 @@ typedef enum NotifyAccess { _NOTIFY_ACCESS_INVALID = -EINVAL, } NotifyAccess; -char *unit_dbus_path_from_name(const char *name); +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/unit-name.c b/src/basic/unit-name.c index 4e2f77c03d..43c15213ef 100644 --- a/src/basic/unit-name.c +++ b/src/basic/unit-name.c @@ -331,7 +331,7 @@ static char *do_escape(const char *f, char *t) { return t; } -char *unit_name_escape(const char *f) { +char* unit_name_escape(const char *f) { char *r, *t; assert(f); diff --git a/src/basic/unit-name.h b/src/basic/unit-name.h index fa7295e250..44354541c4 100644 --- a/src/basic/unit-name.h +++ b/src/basic/unit-name.h @@ -35,7 +35,7 @@ int unit_name_change_suffix(const char *n, const char *suffix, char **ret); int unit_name_build(const char *prefix, const char *instance, const char *suffix, char **ret); int unit_name_build_from_type(const char *prefix, const char *instance, UnitType type, char **ret); -char *unit_name_escape(const char *f); +char* unit_name_escape(const char *f); int unit_name_unescape(const char *f, char **ret); int unit_name_path_escape(const char *f, char **ret); int unit_name_path_unescape(const char *f, char **ret); diff --git a/src/basic/utf8.c b/src/basic/utf8.c index 68b7c31aec..0d904e53af 100644 --- a/src/basic/utf8.c +++ b/src/basic/utf8.c @@ -153,7 +153,7 @@ char* utf8_is_valid_n(const char *str, size_t len_bytes) { return (char*) str; } -char *utf8_escape_invalid(const char *str) { +char* utf8_escape_invalid(const char *str) { char *p, *s; assert(str); @@ -195,7 +195,7 @@ int utf8_char_console_width(const char *str) { return unichar_iswide(c) ? 2 : 1; } -char *utf8_escape_non_printable_full(const char *str, size_t console_width, bool force_ellipsis) { +char* utf8_escape_non_printable_full(const char *str, size_t console_width, bool force_ellipsis) { char *p, *s, *prev_s; size_t n = 0; /* estimated print width */ @@ -359,7 +359,7 @@ size_t utf8_encode_unichar(char *out_utf8, char32_t g) { return 0; } -char *utf16_to_utf8(const char16_t *s, size_t length /* bytes! */) { +char* utf16_to_utf8(const char16_t *s, size_t length /* bytes! */) { const uint8_t *f; char *r, *t; diff --git a/src/basic/utf8.h b/src/basic/utf8.h index de45fcba5b..8a5e884a0a 100644 --- a/src/basic/utf8.h +++ b/src/basic/utf8.h @@ -29,16 +29,16 @@ int utf8_to_ascii(const char *str, char replacement_char, char **ret); bool utf8_is_printable_newline(const char* str, size_t length, bool allow_newline) _pure_; #define utf8_is_printable(str, length) utf8_is_printable_newline(str, length, true) -char *utf8_escape_invalid(const char *s); -char *utf8_escape_non_printable_full(const char *str, size_t console_width, bool force_ellipsis); -static inline char *utf8_escape_non_printable(const char *str) { +char* utf8_escape_invalid(const char *s); +char* utf8_escape_non_printable_full(const char *str, size_t console_width, bool force_ellipsis); +static inline char* utf8_escape_non_printable(const char *str) { return utf8_escape_non_printable_full(str, SIZE_MAX, false); } size_t utf8_encode_unichar(char *out_utf8, char32_t g); size_t utf16_encode_unichar(char16_t *out, char32_t c); -char *utf16_to_utf8(const char16_t *s, size_t length /* bytes! */); +char* utf16_to_utf8(const char16_t *s, size_t length /* bytes! */); char16_t *utf8_to_utf16(const char *s, size_t length); size_t char16_strlen(const char16_t *s); /* returns the number of 16-bit words in the string (not bytes!) */ diff --git a/src/basic/virt.h b/src/basic/virt.h index dea39e4e76..8193d4a760 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 448e868a42..bc0b0d7c9c 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 6f2c1630de..4abd4a303b 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 d488eac4e1..93f302ce30 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/boot/efi/efi-string.c b/src/boot/efi/efi-string.c index 3bdb80216a..63481461a5 100644 --- a/src/boot/efi/efi-string.c +++ b/src/boot/efi/efi-string.c @@ -212,7 +212,7 @@ char16_t *xstrn8_to_16(const char *str8, size_t n) { return str16; } -char *startswith8(const char *s, const char *prefix) { +char* startswith8(const char *s, const char *prefix) { size_t l; assert(prefix); @@ -412,7 +412,7 @@ bool parse_boolean(const char *v, bool *ret) { return false; } -char *line_get_key_value(char *s, const char *sep, size_t *pos, char **ret_key, char **ret_value) { +char* line_get_key_value(char *s, const char *sep, size_t *pos, char **ret_key, char **ret_value) { char *line, *value; size_t linelen; diff --git a/src/boot/efi/efi-string.h b/src/boot/efi/efi-string.h index 9ac919f421..c7c49a07aa 100644 --- a/src/boot/efi/efi-string.h +++ b/src/boot/efi/efi-string.h @@ -79,16 +79,16 @@ static inline bool strcaseeq16(const char16_t *s1, const char16_t *s2) { return strcasecmp16(s1, s2) == 0; } -char *strcpy8(char * restrict dest, const char * restrict src); +char* strcpy8(char * restrict dest, const char * restrict src); char16_t *strcpy16(char16_t * restrict dest, const char16_t * restrict src); -char *strchr8(const char *s, char c); +char* strchr8(const char *s, char c); char16_t *strchr16(const char16_t *s, char16_t c); -char *xstrndup8(const char *s, size_t n); +char* xstrndup8(const char *s, size_t n); char16_t *xstrndup16(const char16_t *s, size_t n); -static inline char *xstrdup8(const char *s) { +static inline char* xstrdup8(const char *s) { return xstrndup8(s, SIZE_MAX); } @@ -101,7 +101,7 @@ static inline char16_t *xstr8_to_16(const char *str8) { return xstrn8_to_16(str8, strlen8(str8)); } -char *startswith8(const char *s, const char *prefix); +char* startswith8(const char *s, const char *prefix); bool efi_fnmatch(const char16_t *pattern, const char16_t *haystack); @@ -110,7 +110,7 @@ bool parse_number16(const char16_t *s, uint64_t *ret_u, const char16_t **ret_tai bool parse_boolean(const char *v, bool *ret); -char *line_get_key_value(char *s, const char *sep, size_t *pos, char **ret_key, char **ret_value); +char* line_get_key_value(char *s, const char *sep, size_t *pos, char **ret_key, char **ret_value); char16_t *hexdump(const void *data, size_t size); diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 34fd2a250c..19028b810b 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 72fe275e8c..1581a88cb7 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/dbus-unit.c b/src/core/dbus-unit.c index ecc502c273..707644d2f9 100644 --- a/src/core/dbus-unit.c +++ b/src/core/dbus-unit.c @@ -504,9 +504,9 @@ int bus_unit_method_enqueue_job(sd_bus_message *message, void *userdata, sd_bus_ int bus_unit_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *error) { Unit *u = ASSERT_PTR(userdata); int32_t value = 0; - const char *swho; + const char *swhom; int32_t signo; - KillWho who; + KillWhom whom; int r, code; assert(message); @@ -515,7 +515,7 @@ int bus_unit_method_kill(sd_bus_message *message, void *userdata, sd_bus_error * if (r < 0) return r; - r = sd_bus_message_read(message, "si", &swho, &signo); + r = sd_bus_message_read(message, "si", &swhom, &signo); if (r < 0) return r; @@ -528,12 +528,12 @@ int bus_unit_method_kill(sd_bus_message *message, void *userdata, sd_bus_error * } else code = SI_USER; - if (isempty(swho)) - who = KILL_ALL; + if (isempty(swhom)) + whom = KILL_ALL; else { - who = kill_who_from_string(swho); - if (who < 0) - return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid who argument: %s", swho); + whom = kill_whom_from_string(swhom); + if (whom < 0) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid whom argument: %s", swhom); } if (!SIGNAL_VALID(signo)) @@ -554,7 +554,7 @@ int bus_unit_method_kill(sd_bus_message *message, void *userdata, sd_bus_error * if (r == 0) return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */ - r = unit_kill(u, who, signo, code, value, error); + r = unit_kill(u, whom, signo, code, value, error); if (r < 0) return r; diff --git a/src/core/execute.c b/src/core/execute.c index 9ba5a77975..18396db113 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 ef8dadfe20..0414fbad22 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/job.c b/src/core/job.c index fb32223e18..a877f9f06f 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -1197,7 +1197,7 @@ void job_add_to_dbus_queue(Job *j) { j->in_dbus_queue = true; } -char *job_dbus_path(Job *j) { +char* job_dbus_path(Job *j) { char *p; assert(j); diff --git a/src/core/job.h b/src/core/job.h index 8318b524b4..8e8d6ff08f 100644 --- a/src/core/job.h +++ b/src/core/job.h @@ -218,7 +218,7 @@ int job_start_timer(Job *j, bool job_running); int job_run_and_invalidate(Job *j); int job_finish_and_invalidate(Job *j, JobResult result, bool recursive, bool already); -char *job_dbus_path(Job *j); +char* job_dbus_path(Job *j); void job_shutdown_magic(Job *j); diff --git a/src/core/kill.c b/src/core/kill.c index c8b581d05d..a93132ccd8 100644 --- a/src/core/kill.c +++ b/src/core/kill.c @@ -44,7 +44,7 @@ static const char* const kill_mode_table[_KILL_MODE_MAX] = { DEFINE_STRING_TABLE_LOOKUP(kill_mode, KillMode); -static const char* const kill_who_table[_KILL_WHO_MAX] = { +static const char* const kill_whom_table[_KILL_WHOM_MAX] = { [KILL_MAIN] = "main", [KILL_CONTROL] = "control", [KILL_ALL] = "all", @@ -53,4 +53,4 @@ static const char* const kill_who_table[_KILL_WHO_MAX] = { [KILL_ALL_FAIL] = "all-fail", }; -DEFINE_STRING_TABLE_LOOKUP(kill_who, KillWho); +DEFINE_STRING_TABLE_LOOKUP(kill_whom, KillWhom); diff --git a/src/core/kill.h b/src/core/kill.h index dbf884d152..3add663d71 100644 --- a/src/core/kill.h +++ b/src/core/kill.h @@ -28,26 +28,26 @@ struct KillContext { bool send_sighup; }; -typedef enum KillWho { - /* Kill who is a property of an operation */ +typedef enum KillWhom { + /* Kill whom is a property of an operation */ KILL_MAIN, KILL_CONTROL, KILL_ALL, KILL_MAIN_FAIL, KILL_CONTROL_FAIL, KILL_ALL_FAIL, - _KILL_WHO_MAX, - _KILL_WHO_INVALID = -EINVAL, -} KillWho; + _KILL_WHOM_MAX, + _KILL_WHOM_INVALID = -EINVAL, +} 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_who_to_string(KillWho k) _const_; -KillWho kill_who_from_string(const char *s) _pure_; +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) { if (c->restart_kill_signal != 0) diff --git a/src/core/socket.c b/src/core/socket.c index 63c4c1a7aa..400edeb86b 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -3410,7 +3410,7 @@ static int socket_get_timeout(Unit *u, usec_t *timeout) { return 1; } -char *socket_fdname(Socket *s) { +char* socket_fdname(Socket *s) { assert(s); /* Returns the name to use for $LISTEN_NAMES. If the user diff --git a/src/core/socket.h b/src/core/socket.h index 5e3929c5fa..55afee6122 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -186,7 +186,7 @@ int socket_port_to_address(const SocketPort *s, char **ret); int socket_load_service_unit(Socket *s, int cfd, Unit **ret); -char *socket_fdname(Socket *s); +char* socket_fdname(Socket *s); extern const UnitVTable socket_vtable; diff --git a/src/core/timer.h b/src/core/timer.h index 76d45b2ae1..2624001c34 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 ac91af187a..e8b32e862d 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -3337,7 +3337,7 @@ int set_unit_path(const char *p) { return RET_NERRNO(setenv("SYSTEMD_UNIT_PATH", p, 1)); } -char *unit_dbus_path(Unit *u) { +char* unit_dbus_path(Unit *u) { assert(u); if (!u->id) @@ -3346,7 +3346,7 @@ char *unit_dbus_path(Unit *u) { return unit_dbus_path_from_name(u->id); } -char *unit_dbus_path_invocation_id(Unit *u) { +char* unit_dbus_path_invocation_id(Unit *u) { assert(u); if (sd_id128_is_null(u->invocation_id)) @@ -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); @@ -4011,7 +4011,7 @@ static int unit_kill_one( int unit_kill( Unit *u, - KillWho who, + KillWhom whom, int signo, int code, int value, @@ -4026,8 +4026,8 @@ int unit_kill( * stop a service ourselves. */ assert(u); - assert(who >= 0); - assert(who < _KILL_WHO_MAX); + assert(whom >= 0); + assert(whom < _KILL_WHOM_MAX); assert(SIGNAL_VALID(signo)); assert(IN_SET(code, SI_USER, SI_QUEUE)); @@ -4037,27 +4037,27 @@ int unit_kill( if (!UNIT_HAS_CGROUP_CONTEXT(u) && !main_pid && !control_pid) return sd_bus_error_setf(ret_error, SD_BUS_ERROR_NOT_SUPPORTED, "Unit type does not support process killing."); - if (IN_SET(who, KILL_MAIN, KILL_MAIN_FAIL)) { + if (IN_SET(whom, KILL_MAIN, KILL_MAIN_FAIL)) { if (!main_pid) return sd_bus_error_setf(ret_error, BUS_ERROR_NO_SUCH_PROCESS, "%s units have no main processes", unit_type_to_string(u->type)); if (!pidref_is_set(main_pid)) return sd_bus_error_set_const(ret_error, BUS_ERROR_NO_SUCH_PROCESS, "No main process to kill"); } - if (IN_SET(who, KILL_CONTROL, KILL_CONTROL_FAIL)) { + if (IN_SET(whom, KILL_CONTROL, KILL_CONTROL_FAIL)) { if (!control_pid) return sd_bus_error_setf(ret_error, BUS_ERROR_NO_SUCH_PROCESS, "%s units have no control processes", unit_type_to_string(u->type)); if (!pidref_is_set(control_pid)) return sd_bus_error_set_const(ret_error, BUS_ERROR_NO_SUCH_PROCESS, "No control process to kill"); } - if (IN_SET(who, KILL_CONTROL, KILL_CONTROL_FAIL, KILL_ALL, KILL_ALL_FAIL)) { + if (IN_SET(whom, KILL_CONTROL, KILL_CONTROL_FAIL, KILL_ALL, KILL_ALL_FAIL)) { r = unit_kill_one(u, control_pid, "control", signo, code, value, ret_error); RET_GATHER(ret, r); killed = killed || r > 0; } - if (IN_SET(who, KILL_MAIN, KILL_MAIN_FAIL, KILL_ALL, KILL_ALL_FAIL)) { + if (IN_SET(whom, KILL_MAIN, KILL_MAIN_FAIL, KILL_ALL, KILL_ALL_FAIL)) { r = unit_kill_one(u, main_pid, "main", signo, code, value, ret >= 0 ? ret_error : NULL); RET_GATHER(ret, r); killed = killed || r > 0; @@ -4066,7 +4066,7 @@ int unit_kill( /* Note: if we shall enqueue rather than kill we won't do this via the cgroup mechanism, since it * doesn't really make much sense (and given that enqueued values are a relatively expensive * resource, and we shouldn't allow us to be subjects for such allocation sprees) */ - if (IN_SET(who, KILL_ALL, KILL_ALL_FAIL) && code == SI_USER) { + if (IN_SET(whom, KILL_ALL, KILL_ALL_FAIL) && code == SI_USER) { CGroupRuntime *crt = unit_get_cgroup_runtime(u); if (crt && crt->cgroup_path) { @@ -4098,7 +4098,7 @@ int unit_kill( } /* If the "fail" versions of the operation are requested, then complain if the set of processes we killed is empty */ - if (ret >= 0 && !killed && IN_SET(who, KILL_ALL_FAIL, KILL_CONTROL_FAIL, KILL_MAIN_FAIL)) + if (ret >= 0 && !killed && IN_SET(whom, KILL_ALL_FAIL, KILL_CONTROL_FAIL, KILL_MAIN_FAIL)) return sd_bus_error_set_const(ret_error, BUS_ERROR_NO_SUCH_PROCESS, "No matching processes to kill"); return ret; diff --git a/src/core/unit.h b/src/core/unit.h index b0ffbbcebe..042ec3b3ea 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); @@ -862,7 +862,7 @@ int unit_start(Unit *u, ActivationDetails *details); int unit_stop(Unit *u); int unit_reload(Unit *u); -int unit_kill(Unit *u, KillWho w, int signo, int code, int value, sd_bus_error *ret_error); +int unit_kill(Unit *u, KillWhom w, int signo, int code, int value, sd_bus_error *ret_error); void unit_notify_cgroup_oom(Unit *u, bool managed_oom); @@ -886,8 +886,8 @@ bool unit_job_is_applicable(Unit *u, JobType j); int set_unit_path(const char *p); -char *unit_dbus_path(Unit *u); -char *unit_dbus_path_invocation_id(Unit *u); +char* unit_dbus_path(Unit *u); +char* unit_dbus_path_invocation_id(Unit *u); int unit_load_related_unit(Unit *u, const char *type, Unit **_found); @@ -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 2a9d23f3e3..effd9d887c 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 e949840152..cb96a7ab4e 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 42131b9f41..f8472cb7c8 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 7d466cdd32..8c92e39fe5 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 5138908996..f9405e18c7 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 28ce80cbf2..247fd9d912 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 f8bc15c47e..0d3d6b5cef 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 ab75bad434..39f5040f9d 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 a249b848ca..56f9373af1 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) @@ -286,7 +286,7 @@ const char *bus_message_type_to_string(uint8_t u) { return NULL; } -char *bus_address_escape(const char *v) { +char* bus_address_escape(const char *v) { const char *a; char *r, *b; diff --git a/src/libsystemd/sd-bus/bus-internal.h b/src/libsystemd/sd-bus/bus-internal.h index e0f4746b7e..0d99d2d654 100644 --- a/src/libsystemd/sd-bus/bus-internal.h +++ b/src/libsystemd/sd-bus/bus-internal.h @@ -360,7 +360,7 @@ bool service_name_is_valid(const char *p) _pure_; bool member_name_is_valid(const char *p) _pure_; bool object_path_is_valid(const char *p) _pure_; -char *object_path_startswith(const char *a, const char *b) _pure_; +char* object_path_startswith(const char *a, const char *b) _pure_; bool namespace_complex_pattern(const char *pattern, const char *value) _pure_; bool path_complex_pattern(const char *pattern, const char *value) _pure_; @@ -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 @@ -385,7 +385,7 @@ int bus_rqueue_make_room(sd_bus *bus); bool bus_origin_changed(sd_bus *bus); -char *bus_address_escape(const char *v); +char* bus_address_escape(const char *v); int bus_attach_io_events(sd_bus *b); int bus_attach_inotify_event(sd_bus *b); diff --git a/src/libsystemd/sd-bus/bus-match.c b/src/libsystemd/sd-bus/bus-match.c index 606304d833..5434156ccd 100644 --- a/src/libsystemd/sd-bus/bus-match.c +++ b/src/libsystemd/sd-bus/bus-match.c @@ -823,7 +823,7 @@ int bus_match_parse( return 0; } -char *bus_match_to_string(struct bus_match_component *components, size_t n_components) { +char* bus_match_to_string(struct bus_match_component *components, size_t n_components) { _cleanup_(memstream_done) MemStream m = {}; FILE *f; int r; diff --git a/src/libsystemd/sd-bus/bus-match.h b/src/libsystemd/sd-bus/bus-match.h index ccb6aae58f..138123c70b 100644 --- a/src/libsystemd/sd-bus/bus-match.h +++ b/src/libsystemd/sd-bus/bus-match.h @@ -77,6 +77,6 @@ enum bus_match_node_type bus_match_node_type_from_string(const char *k, size_t n int bus_match_parse(const char *match, struct bus_match_component **ret_components, size_t *ret_n_components); void bus_match_parse_free(struct bus_match_component *components, size_t n_components); -char *bus_match_to_string(struct bus_match_component *components, size_t n_components); +char* bus_match_to_string(struct bus_match_component *components, size_t n_components); enum bus_match_scope bus_match_get_scope(const struct bus_match_component *components, size_t n_components); diff --git a/src/libsystemd/sd-device/device-private.h b/src/libsystemd/sd-device/device-private.h index 85e8609940..e0b1efe506 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 f2c489856c..fffc58ad92 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-journal/journal-internal.h b/src/libsystemd/sd-journal/journal-internal.h index b95080c527..e96b88a0c9 100644 --- a/src/libsystemd/sd-journal/journal-internal.h +++ b/src/libsystemd/sd-journal/journal-internal.h @@ -136,7 +136,7 @@ struct sd_journal { Hashmap *errors; }; -char *journal_make_match_string(sd_journal *j); +char* journal_make_match_string(sd_journal *j); void journal_print_header(sd_journal *j); int journal_get_directories(sd_journal *j, char ***ret); diff --git a/src/libsystemd/sd-journal/sd-journal.c b/src/libsystemd/sd-journal/sd-journal.c index 0aa37260b6..b08e3f923d 100644 --- a/src/libsystemd/sd-journal/sd-journal.c +++ b/src/libsystemd/sd-journal/sd-journal.c @@ -431,7 +431,7 @@ static char *match_make_string(Match *m) { return TAKE_PTR(p); } -char *journal_make_match_string(sd_journal *j) { +char* journal_make_match_string(sd_journal *j) { assert(j); return match_make_string(j->level0); diff --git a/src/libsystemd/sd-json/sd-json.c b/src/libsystemd/sd-json/sd-json.c index f7b36af880..5f9c593205 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 aef4a55a8c..553c381ff1 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-dbus.c b/src/login/logind-dbus.c index a657b6ece3..277561300c 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -3807,7 +3807,7 @@ static const sd_bus_vtable manager_vtable[] = { method_lock_sessions, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD_WITH_ARGS("KillSession", - SD_BUS_ARGS("s", session_id, "s", who, "i", signal_number), + SD_BUS_ARGS("s", session_id, "s", whom, "i", signal_number), SD_BUS_NO_RESULT, method_kill_session, SD_BUS_VTABLE_UNPRIVILEGED), @@ -4473,7 +4473,7 @@ int manager_abandon_scope(Manager *manager, const char *scope, sd_bus_error *ret return 1; } -int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo, sd_bus_error *error) { +int manager_kill_unit(Manager *manager, const char *unit, KillWhom whom, int signo, sd_bus_error *error) { assert(manager); assert(unit); assert(SIGNAL_VALID(signo)); @@ -4486,7 +4486,7 @@ int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo NULL, "ssi", unit, - who == KILL_LEADER ? "main" : "all", + whom == KILL_LEADER ? "main" : "all", signo); } diff --git a/src/login/logind-dbus.h b/src/login/logind-dbus.h index 8459d048b8..ebb75abaf3 100644 --- a/src/login/logind-dbus.h +++ b/src/login/logind-dbus.h @@ -40,7 +40,7 @@ int manager_start_scope( int manager_start_unit(Manager *manager, const char *unit, sd_bus_error *error, char **ret_job); int manager_stop_unit(Manager *manager, const char *unit, const char *job_mode, sd_bus_error *error, char **ret_job); int manager_abandon_scope(Manager *manager, const char *scope, sd_bus_error *error); -int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo, sd_bus_error *error); +int manager_kill_unit(Manager *manager, const char *unit, KillWhom whom, int signo, sd_bus_error *error); int manager_unit_is_active(Manager *manager, const char *unit, sd_bus_error *error); int manager_job_is_active(Manager *manager, const char *path, sd_bus_error *error); diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index 203665ca3c..4e64b9ebef 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 8f822ded04..166e8f57ed 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-seat-dbus.c b/src/login/logind-seat-dbus.c index 0a395c6509..380990c05d 100644 --- a/src/login/logind-seat-dbus.c +++ b/src/login/logind-seat-dbus.c @@ -282,7 +282,7 @@ static int seat_object_find(sd_bus *bus, const char *path, const char *interface return 1; } -char *seat_bus_path(Seat *s) { +char* seat_bus_path(Seat *s) { _cleanup_free_ char *t = NULL; assert(s); diff --git a/src/login/logind-seat-dbus.h b/src/login/logind-seat-dbus.h index 258db91d40..f4bd78e24b 100644 --- a/src/login/logind-seat-dbus.h +++ b/src/login/logind-seat-dbus.h @@ -8,7 +8,7 @@ extern const BusObjectImplementation seat_object; -char *seat_bus_path(Seat *s); +char* seat_bus_path(Seat *s); int seat_send_signal(Seat *s, bool new_seat); int seat_send_changed(Seat *s, const char *properties, ...) _sentinel_; diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c index f20ef4f309..ff4e60017d 100644 --- a/src/login/logind-session-dbus.c +++ b/src/login/logind-session-dbus.c @@ -291,23 +291,23 @@ static int method_set_locked_hint(sd_bus_message *message, void *userdata, sd_bu int bus_session_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *error) { Session *s = ASSERT_PTR(userdata); - const char *swho; + const char *swhom; int32_t signo; - KillWho who; + KillWhom whom; int r; assert(message); - r = sd_bus_message_read(message, "si", &swho, &signo); + r = sd_bus_message_read(message, "si", &swhom, &signo); if (r < 0) return r; - if (isempty(swho)) - who = KILL_ALL; + if (isempty(swhom)) + whom = KILL_ALL; else { - who = kill_who_from_string(swho); - if (who < 0) - return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid kill parameter '%s'", swho); + whom = kill_whom_from_string(swhom); + if (whom < 0) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid kill parameter '%s'", swhom); } if (!SIGNAL_VALID(signo)) @@ -326,7 +326,7 @@ int bus_session_method_kill(sd_bus_message *message, void *userdata, sd_bus_erro if (r == 0) return 1; /* Will call us back */ - r = session_kill(s, who, signo); + r = session_kill(s, whom, signo); if (r < 0) return r; @@ -713,7 +713,7 @@ static int session_object_find(sd_bus *bus, const char *path, const char *interf return 1; } -char *session_bus_path(Session *s) { +char* session_bus_path(Session *s) { _cleanup_free_ char *t = NULL; assert(s); @@ -1016,7 +1016,7 @@ static const sd_bus_vtable session_vtable[] = { method_set_locked_hint, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD_WITH_ARGS("Kill", - SD_BUS_ARGS("s", who, "i", signal_number), + SD_BUS_ARGS("s", whom, "i", signal_number), SD_BUS_NO_RESULT, bus_session_method_kill, SD_BUS_VTABLE_UNPRIVILEGED), diff --git a/src/login/logind-session-dbus.h b/src/login/logind-session-dbus.h index a026562938..37a107ec33 100644 --- a/src/login/logind-session-dbus.h +++ b/src/login/logind-session-dbus.h @@ -8,7 +8,7 @@ extern const BusObjectImplementation session_object; -char *session_bus_path(Session *s); +char* session_bus_path(Session *s); int session_send_signal(Session *s, bool new_session); int session_send_changed(Session *s, const char *properties, ...) _sentinel_; diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 55d8b237b3..bb77a20b5f 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -1384,13 +1384,13 @@ SessionState session_get_state(Session *s) { return SESSION_ONLINE; } -int session_kill(Session *s, KillWho who, int signo) { +int session_kill(Session *s, KillWhom whom, int signo) { assert(s); if (!s->scope) return -ESRCH; - return manager_kill_unit(s->manager, s->scope, who, signo, NULL); + return manager_kill_unit(s->manager, s->scope, whom, signo, NULL); } static int session_open_vt(Session *s, bool reopen) { @@ -1665,12 +1665,12 @@ static const char* const session_class_table[_SESSION_CLASS_MAX] = { DEFINE_STRING_TABLE_LOOKUP(session_class, SessionClass); -static const char* const kill_who_table[_KILL_WHO_MAX] = { +static const char* const kill_whom_table[_KILL_WHOM_MAX] = { [KILL_LEADER] = "leader", [KILL_ALL] = "all", }; -DEFINE_STRING_TABLE_LOOKUP(kill_who, KillWho); +DEFINE_STRING_TABLE_LOOKUP(kill_whom, KillWhom); static const char* const tty_validity_table[_TTY_VALIDITY_MAX] = { [TTY_FROM_PAM] = "from-pam", diff --git a/src/login/logind-session.h b/src/login/logind-session.h index c187bcd779..86ffc64bda 100644 --- a/src/login/logind-session.h +++ b/src/login/logind-session.h @@ -2,7 +2,7 @@ #pragma once typedef struct Session Session; -typedef enum KillWho KillWho; +typedef enum KillWhom KillWhom; #include "list.h" #include "login-util.h" @@ -77,11 +77,11 @@ typedef enum SessionType { #define SESSION_TYPE_IS_GRAPHICAL(type) IN_SET(type, SESSION_X11, SESSION_WAYLAND, SESSION_MIR) -enum KillWho { +enum KillWhom { KILL_LEADER, KILL_ALL, - _KILL_WHO_MAX, - _KILL_WHO_INVALID = -EINVAL, + _KILL_WHOM_MAX, + _KILL_WHOM_INVALID = -EINVAL, }; typedef enum TTYValidity { @@ -191,7 +191,7 @@ int session_finalize(Session *s); int session_release(Session *s); int session_save(Session *s); int session_load(Session *s); -int session_kill(Session *s, KillWho who, int signo); +int session_kill(Session *s, KillWhom whom, int signo); SessionState session_get_state(Session *u); @@ -204,8 +204,8 @@ 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_who_to_string(KillWho k) _const_; -KillWho kill_who_from_string(const char *s) _pure_; +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_; TTYValidity tty_validity_from_string(const char *s) _pure_; diff --git a/src/login/logind-user-dbus.c b/src/login/logind-user-dbus.c index ba83dc5d1a..a211953932 100644 --- a/src/login/logind-user-dbus.c +++ b/src/login/logind-user-dbus.c @@ -289,7 +289,7 @@ static int user_object_find(sd_bus *bus, const char *path, const char *interface return 1; } -char *user_bus_path(User *u) { +char* user_bus_path(User *u) { char *s; assert(u); diff --git a/src/login/logind-user-dbus.h b/src/login/logind-user-dbus.h index d2f24ced63..ba530bede2 100644 --- a/src/login/logind-user-dbus.h +++ b/src/login/logind-user-dbus.h @@ -7,7 +7,7 @@ extern const BusObjectImplementation user_object; -char *user_bus_path(User *s); +char* user_bus_path(User *s); int user_send_signal(User *u, bool new_user); int user_send_changed(User *u, const char *properties, ...) _sentinel_; diff --git a/src/login/test-login-tables.c b/src/login/test-login-tables.c index 1278af7504..9be781ce2d 100644 --- a/src/login/test-login-tables.c +++ b/src/login/test-login-tables.c @@ -25,7 +25,7 @@ int main(int argc, char **argv) { test_table(handle_action, HANDLE_ACTION); test_table(inhibit_mode, INHIBIT_MODE); - test_table(kill_who, KILL_WHO); + test_table(kill_whom, KILL_WHOM); test_table(session_class, SESSION_CLASS); test_table(session_state, SESSION_STATE); test_table(session_type, SESSION_TYPE); diff --git a/src/machine/image-dbus.c b/src/machine/image-dbus.c index d8068cdfcd..78c05ff502 100644 --- a/src/machine/image-dbus.c +++ b/src/machine/image-dbus.c @@ -461,7 +461,7 @@ static int image_object_find(sd_bus *bus, const char *path, const char *interfac return 1; } -char *image_bus_path(const char *name) { +char* image_bus_path(const char *name) { _cleanup_free_ char *e = NULL; assert(name); diff --git a/src/machine/image-dbus.h b/src/machine/image-dbus.h index 0c4fab1b0a..c0d56b2eb4 100644 --- a/src/machine/image-dbus.h +++ b/src/machine/image-dbus.h @@ -8,7 +8,7 @@ extern const BusObjectImplementation image_object; int manager_acquire_image(Manager *m, const char *name, Image **ret); -char *image_bus_path(const char *name); +char* image_bus_path(const char *name); int bus_image_method_remove(sd_bus_message *message, void *userdata, sd_bus_error *error); int bus_image_method_rename(sd_bus_message *message, void *userdata, sd_bus_error *error); diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c index a4f04c0b86..86bd557b21 100644 --- a/src/machine/machine-dbus.c +++ b/src/machine/machine-dbus.c @@ -123,7 +123,7 @@ int bus_machine_method_kill(sd_bus_message *message, void *userdata, sd_bus_erro Machine *m = ASSERT_PTR(userdata); const char *swho; int32_t signo; - KillWho who; + KillWhom whom; int r; assert(message); @@ -133,10 +133,10 @@ int bus_machine_method_kill(sd_bus_message *message, void *userdata, sd_bus_erro return r; if (isempty(swho)) - who = KILL_ALL; + whom = KILL_ALL; else { - who = kill_who_from_string(swho); - if (who < 0) + whom = kill_whom_from_string(swho); + if (whom < 0) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid kill parameter '%s'", swho); } @@ -160,7 +160,7 @@ int bus_machine_method_kill(sd_bus_message *message, void *userdata, sd_bus_erro if (r == 0) return 1; /* Will call us back */ - r = machine_kill(m, who, signo); + r = machine_kill(m, whom, signo); if (r < 0) return r; @@ -1231,7 +1231,7 @@ static int machine_object_find(sd_bus *bus, const char *path, const char *interf return 1; } -char *machine_bus_path(Machine *m) { +char* machine_bus_path(Machine *m) { _cleanup_free_ char *e = NULL; assert(m); @@ -1293,7 +1293,7 @@ static const sd_bus_vtable machine_vtable[] = { bus_machine_method_terminate, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD_WITH_ARGS("Kill", - SD_BUS_ARGS("s", who, "i", signal), + SD_BUS_ARGS("s", whom, "i", signal), SD_BUS_NO_RESULT, bus_machine_method_kill, SD_BUS_VTABLE_UNPRIVILEGED), diff --git a/src/machine/machine-dbus.h b/src/machine/machine-dbus.h index fccad71d12..fc9ec68087 100644 --- a/src/machine/machine-dbus.h +++ b/src/machine/machine-dbus.h @@ -13,7 +13,7 @@ typedef enum { extern const BusObjectImplementation machine_object; -char *machine_bus_path(Machine *s); +char* machine_bus_path(Machine *s); int bus_machine_method_unregister(sd_bus_message *message, void *userdata, sd_bus_error *error); int bus_machine_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error); diff --git a/src/machine/machine.c b/src/machine/machine.c index 0eb9a55e5f..1ef2be27ab 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -609,7 +609,7 @@ MachineState machine_get_state(Machine *s) { return MACHINE_RUNNING; } -int machine_kill(Machine *m, KillWho who, int signo) { +int machine_kill(Machine *m, KillWhom whom, int signo) { assert(m); if (!IN_SET(m->class, MACHINE_VM, MACHINE_CONTAINER)) @@ -618,7 +618,7 @@ int machine_kill(Machine *m, KillWho who, int signo) { if (!m->unit) return -ESRCH; - if (who == KILL_LEADER) /* If we shall simply kill the leader, do so directly */ + if (whom == KILL_LEADER) /* If we shall simply kill the leader, do so directly */ return pidref_kill(&m->leader, signo); /* Otherwise, make PID 1 do it for us, for the entire cgroup */ @@ -920,9 +920,9 @@ static const char* const machine_state_table[_MACHINE_STATE_MAX] = { DEFINE_STRING_TABLE_LOOKUP(machine_state, MachineState); -static const char* const kill_who_table[_KILL_WHO_MAX] = { +static const char* const kill_whom_table[_KILL_WHOM_MAX] = { [KILL_LEADER] = "leader", [KILL_ALL] = "all" }; -DEFINE_STRING_TABLE_LOOKUP(kill_who, KillWho); +DEFINE_STRING_TABLE_LOOKUP(kill_whom, KillWhom); diff --git a/src/machine/machine.h b/src/machine/machine.h index f8146fb55b..12551025c7 100644 --- a/src/machine/machine.h +++ b/src/machine/machine.h @@ -2,7 +2,7 @@ #pragma once typedef struct Machine Machine; -typedef enum KillWho KillWho; +typedef enum KillWhom KillWhom; #include "list.h" #include "machined.h" @@ -26,11 +26,11 @@ typedef enum MachineClass { _MACHINE_CLASS_INVALID = -EINVAL, } MachineClass; -enum KillWho { +enum KillWhom { KILL_LEADER, KILL_ALL, - _KILL_WHO_MAX, - _KILL_WHO_INVALID = -EINVAL, + _KILL_WHOM_MAX, + _KILL_WHOM_INVALID = -EINVAL, }; struct Machine { @@ -81,7 +81,7 @@ int machine_stop(Machine *m); int machine_finalize(Machine *m); int machine_save(Machine *m); int machine_load(Machine *m); -int machine_kill(Machine *m, KillWho who, int signo); +int machine_kill(Machine *m, KillWhom whom, int signo); DEFINE_TRIVIAL_CLEANUP_FUNC(Machine*, machine_free); @@ -95,8 +95,8 @@ 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_who_to_string(KillWho k) _const_; -KillWho kill_who_from_string(const char *s) _pure_; +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); int machine_open_terminal(Machine *m, const char *path, int mode); diff --git a/src/machine/test-machine-tables.c b/src/machine/test-machine-tables.c index 32c5e0e80d..d0b73358bf 100644 --- a/src/machine/test-machine-tables.c +++ b/src/machine/test-machine-tables.c @@ -7,7 +7,7 @@ int main(int argc, char **argv) { test_setup_logging(LOG_DEBUG); - test_table(kill_who, KILL_WHO); + test_table(kill_whom, KILL_WHOM); test_table(machine_class, MACHINE_CLASS); test_table(machine_state, MACHINE_STATE); diff --git a/src/network/netdev/bareudp.h b/src/network/netdev/bareudp.h index 8d8863cccc..a8a33b3e4d 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 576d82ed6c..72cb315e5f 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 3cbf694bba..5fb441360d 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 02b07e3670..7c8c397d6c 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 cb8cc8c6a9..3bfecda6d8 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 713f2fbf37..cf26cfad98 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 141ac4db4d..29874942bc 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 3390d7dcff..194930a87c 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-bus.c b/src/network/networkd-link-bus.c index f5b8dc726b..84ed42987c 100644 --- a/src/network/networkd-link-bus.c +++ b/src/network/networkd-link-bus.c @@ -802,7 +802,7 @@ static const sd_bus_vtable link_vtable[] = { SD_BUS_VTABLE_END }; -char *link_bus_path(Link *link) { +char* link_bus_path(Link *link) { _cleanup_free_ char *ifindex = NULL; char *p; int r; diff --git a/src/network/networkd-link-bus.h b/src/network/networkd-link-bus.h index 924d9976b5..bb12db92ee 100644 --- a/src/network/networkd-link-bus.h +++ b/src/network/networkd-link-bus.h @@ -10,7 +10,7 @@ typedef struct Link Link; extern const BusObjectImplementation link_object; -char *link_bus_path(Link *link); +char* link_bus_path(Link *link); int link_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error); int link_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error); int link_send_changed_strv(Link *link, char **properties); diff --git a/src/network/networkd-link.h b/src/network/networkd-link.h index b1b2fe42db..27bc299bc5 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 eba823a2d0..2df7faadc8 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 42a575c493..60524c00a0 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 c3b4586cae..3d31bcfb19 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 0bcb285f86..135b3dbb0a 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 f5bb1902bd..281b57e321 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 1af370d239..197fb8a361 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 404256c2f8..657526b470 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 e626740053..67a83269e2 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 393b7b2364..8f5a08e357 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 14adb904bd..ac60ee2798 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 29d7288981..d3ec3d4d8d 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 5754c85111..18e2fe2485 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 b7dc60c9c8..a2fe219886 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 a2e9196261..33ee644efd 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 c092bb1189..8abba8b064 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 157c908548..5e1d5698f6 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/resolve/resolved-link-bus.c b/src/resolve/resolved-link-bus.c index 656bdd9d8e..f5a3b0e36b 100644 --- a/src/resolve/resolved-link-bus.c +++ b/src/resolve/resolved-link-bus.c @@ -800,7 +800,7 @@ static int link_object_find(sd_bus *bus, const char *path, const char *interface return 1; } -char *link_bus_path(const Link *link) { +char* link_bus_path(const Link *link) { char *p, ifindex[DECIMAL_STR_MAX(link->ifindex)]; int r; diff --git a/src/resolve/resolved-link-bus.h b/src/resolve/resolved-link-bus.h index b882df5c40..a450c51e56 100644 --- a/src/resolve/resolved-link-bus.h +++ b/src/resolve/resolved-link-bus.h @@ -8,7 +8,7 @@ extern const BusObjectImplementation link_object; -char *link_bus_path(const Link *link); +char* link_bus_path(const Link *link); int bus_link_method_set_dns_servers(sd_bus_message *message, void *userdata, sd_bus_error *error); int bus_link_method_set_dns_servers_ex(sd_bus_message *message, void *userdata, sd_bus_error *error); diff --git a/src/shared/bond-util.h b/src/shared/bond-util.h index 9e693b16ad..58be49788e 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 0e0b666df6..904f2b941f 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 a60891c8f0..fcc4d9ada5 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/cpu-set-util.c b/src/shared/cpu-set-util.c index 1112de1333..711e94ef45 100644 --- a/src/shared/cpu-set-util.c +++ b/src/shared/cpu-set-util.c @@ -40,7 +40,7 @@ char* cpu_set_to_string(const CPUSet *a) { return TAKE_PTR(str) ?: strdup(""); } -char *cpu_set_to_range_string(const CPUSet *set) { +char* cpu_set_to_range_string(const CPUSet *set) { unsigned range_start = 0, range_end; _cleanup_free_ char *str = NULL; bool in_range = false; diff --git a/src/shared/cpu-set-util.h b/src/shared/cpu-set-util.h index 618fe1b0a3..2c477d8a01 100644 --- a/src/shared/cpu-set-util.h +++ b/src/shared/cpu-set-util.h @@ -26,7 +26,7 @@ int cpu_set_add_all(CPUSet *a, const CPUSet *b); int cpu_set_add(CPUSet *a, unsigned cpu); char* cpu_set_to_string(const CPUSet *a); -char *cpu_set_to_range_string(const CPUSet *a); +char* cpu_set_to_range_string(const CPUSet *a); char* cpu_set_to_mask_string(const CPUSet *a); int cpu_set_realloc(CPUSet *cpu_set, unsigned ncpus); diff --git a/src/shared/cryptsetup-util.c b/src/shared/cryptsetup-util.c index a0d5331175..026738b74c 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 84949dc5f6..86ac022f30 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 bd4bb6f034..e14ef9dcb5 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 e31fd54f84..02aa2d5734 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 5303cd7504..d431b4452c 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 38c8dfced5..2e9a231711 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 25ba0d4b3b..5b3fda8732 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/fstab-util.c b/src/shared/fstab-util.c index 60ceff50e5..d6a256c4a7 100644 --- a/src/shared/fstab-util.c +++ b/src/shared/fstab-util.c @@ -346,7 +346,7 @@ static char *tag_to_udev_node(const char *tagvalue, const char *by) { return strjoin("/dev/disk/by-", by, "/", t); } -char *fstab_node_to_udev_node(const char *p) { +char* fstab_node_to_udev_node(const char *p) { const char *q; assert(p); diff --git a/src/shared/fstab-util.h b/src/shared/fstab-util.h index 040f07670f..42ecafbdb8 100644 --- a/src/shared/fstab-util.h +++ b/src/shared/fstab-util.h @@ -49,7 +49,7 @@ static inline bool fstab_test_yes_no_option(const char *opts, const char *yes_no } int fstab_find_pri(const char *opts, int *ret); -char *fstab_node_to_udev_node(const char *p); +char* fstab_node_to_udev_node(const char *p); static inline const char* fstab_path(void) { return secure_getenv("SYSTEMD_FSTAB") ?: "/etc/fstab"; diff --git a/src/shared/geneve-util.h b/src/shared/geneve-util.h index acd0e1a1a2..96a1eeaf6a 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 d639463c24..d80ee16f2e 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 21976e5311..411749900f 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 47a4655a69..a297272fab 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 5b33abac21..054849b409 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 fdd3f36354..56e4d0f742 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 14155b679a..923d60abba 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 a0875ef234..b871570132 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 a475b37572..d1bf1afe7b 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 0705ecb6d8..b61630b789 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 62afdc514a..27461f4ce9 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 8adc2c89c8..978ce42341 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 02c531e271..1fe0de9c30 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 d4cee069dd..f7f1995a87 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 b59740c009..c4ff82df6c 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/pkcs11-util.c b/src/shared/pkcs11-util.c index d8408dae04..2775fa9268 100644 --- a/src/shared/pkcs11-util.c +++ b/src/shared/pkcs11-util.c @@ -201,7 +201,7 @@ CK_RV pkcs11_get_slot_list_malloc( return CKR_BUFFER_TOO_SMALL; } -char *pkcs11_token_label(const CK_TOKEN_INFO *token_info) { +char* pkcs11_token_label(const CK_TOKEN_INFO *token_info) { char *t; /* The label is not NUL terminated and likely padded with spaces, let's make a copy here, so that we @@ -214,7 +214,7 @@ char *pkcs11_token_label(const CK_TOKEN_INFO *token_info) { return t; } -char *pkcs11_token_manufacturer_id(const CK_TOKEN_INFO *token_info) { +char* pkcs11_token_manufacturer_id(const CK_TOKEN_INFO *token_info) { char *t; t = strndup((char*) token_info->manufacturerID, sizeof(token_info->manufacturerID)); @@ -225,7 +225,7 @@ char *pkcs11_token_manufacturer_id(const CK_TOKEN_INFO *token_info) { return t; } -char *pkcs11_token_model(const CK_TOKEN_INFO *token_info) { +char* pkcs11_token_model(const CK_TOKEN_INFO *token_info) { char *t; t = strndup((char*) token_info->model, sizeof(token_info->model)); diff --git a/src/shared/pkcs11-util.h b/src/shared/pkcs11-util.h index 30b9ac6864..000a127c97 100644 --- a/src/shared/pkcs11-util.h +++ b/src/shared/pkcs11-util.h @@ -48,9 +48,9 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(CK_FUNCTION_LIST**, sym_p11_kit_modules_finaliz CK_RV pkcs11_get_slot_list_malloc(CK_FUNCTION_LIST *m, CK_SLOT_ID **ret_slotids, CK_ULONG *ret_n_slotids); -char *pkcs11_token_label(const CK_TOKEN_INFO *token_info); -char *pkcs11_token_manufacturer_id(const CK_TOKEN_INFO *token_info); -char *pkcs11_token_model(const CK_TOKEN_INFO *token_info); +char* pkcs11_token_label(const CK_TOKEN_INFO *token_info); +char* pkcs11_token_manufacturer_id(const CK_TOKEN_INFO *token_info); +char* pkcs11_token_model(const CK_TOKEN_INFO *token_info); int pkcs11_token_login_by_pin(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, const CK_TOKEN_INFO *token_info, const char *token_label, const void *pin, size_t pin_size); int pkcs11_token_login(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, CK_SLOT_ID slotid, const CK_TOKEN_INFO *token_info, const char *friendly_name, const char *icon_name, const char *key_name, const char *credential_name, usec_t until, AskPasswordFlags ask_password_flags, char **ret_used_pin); diff --git a/src/shared/pretty-print.h b/src/shared/pretty-print.h index c166054919..9eb1611905 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 7583357e8a..fbf8555669 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 a126d5d73b..2580c84ead 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 2c06fbe3a7..a6edb4c4bd 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 9169513e09..e62795cb77 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 09fdfd6b75..820c3f70b7 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 2e238468ae..2d79b2332b 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 916b805bc2..a33448fb85 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 e60f1208dc..c4a35a9667 100644 --- a/src/shared/tpm2-util.c +++ b/src/shared/tpm2-util.c @@ -1458,7 +1458,7 @@ void tpm2_tpms_pcr_selection_move(TPMS_PCR_SELECTION *a, TPMS_PCR_SELECTION *b) FOREACH_TPMS_PCR_SELECTION_IN_TPML_PCR_SELECTION(tpms, tpml) \ FOREACH_PCR_IN_TPMS_PCR_SELECTION(pcr, tpms) -char *tpm2_tpms_pcr_selection_to_string(const TPMS_PCR_SELECTION *s) { +char* tpm2_tpms_pcr_selection_to_string(const TPMS_PCR_SELECTION *s) { assert(s); const char *algstr = strna(tpm2_hash_alg_to_string(s->hash)); @@ -1648,7 +1648,7 @@ void tpm2_tpml_pcr_selection_sub(TPML_PCR_SELECTION *a, const TPML_PCR_SELECTION tpm2_tpml_pcr_selection_sub_tpms_pcr_selection(a, selection_b); } -char *tpm2_tpml_pcr_selection_to_string(const TPML_PCR_SELECTION *l) { +char* tpm2_tpml_pcr_selection_to_string(const TPML_PCR_SELECTION *l) { assert(l); _cleanup_free_ char *banks = NULL; @@ -1942,7 +1942,7 @@ int tpm2_pcr_value_from_string(const char *arg, Tpm2PCRValue *ret_pcr_value) { /* Return a string for the PCR value. The format is described in tpm2_pcr_value_from_string(). Note that if * the hash algorithm is not recognized, neither hash name nor hash digest value is included in the * string. This does not check for validity. */ -char *tpm2_pcr_value_to_string(const Tpm2PCRValue *pcr_value) { +char* tpm2_pcr_value_to_string(const Tpm2PCRValue *pcr_value) { _cleanup_free_ char *index = NULL, *value = NULL; if (asprintf(&index, "%u", pcr_value->index) < 0) @@ -1999,7 +1999,7 @@ int tpm2_pcr_values_from_string(const char *arg, Tpm2PCRValue **ret_pcr_values, /* Return a string representing the array of PCR values. The format is as described in * tpm2_pcr_values_from_string(). This does not check for validity. */ -char *tpm2_pcr_values_to_string(const Tpm2PCRValue *pcr_values, size_t n_pcr_values) { +char* tpm2_pcr_values_to_string(const Tpm2PCRValue *pcr_values, size_t n_pcr_values) { _cleanup_free_ char *s = NULL; FOREACH_ARRAY(v, pcr_values, n_pcr_values) { @@ -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"; } @@ -7277,7 +7277,7 @@ int tpm2_hmac_key_from_pin(Tpm2Context *c, const Tpm2Handle *session, const TPM2 } #endif -char *tpm2_pcr_mask_to_string(uint32_t mask) { +char* tpm2_pcr_mask_to_string(uint32_t mask) { _cleanup_free_ char *s = NULL; FOREACH_PCR_IN_MASK(n, mask) @@ -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 8d5aac09b2..3a8565bac5 100644 --- a/src/shared/tpm2-util.h +++ b/src/shared/tpm2-util.h @@ -110,14 +110,14 @@ bool tpm2_pcr_value_valid(const Tpm2PCRValue *pcr_value); bool tpm2_pcr_values_has_any_values(const Tpm2PCRValue *pcr_values, size_t n_pcr_values); bool tpm2_pcr_values_has_all_values(const Tpm2PCRValue *pcr_values, size_t n_pcr_values); int tpm2_pcr_value_from_string(const char *arg, Tpm2PCRValue *ret_pcr_value); -char *tpm2_pcr_value_to_string(const Tpm2PCRValue *pcr_value); +char* tpm2_pcr_value_to_string(const Tpm2PCRValue *pcr_value); bool tpm2_pcr_values_valid(const Tpm2PCRValue *pcr_values, size_t n_pcr_values); void tpm2_sort_pcr_values(Tpm2PCRValue *pcr_values, size_t n_pcr_values); int tpm2_pcr_values_from_mask(uint32_t mask, TPMI_ALG_HASH hash, Tpm2PCRValue **ret_pcr_values, size_t *ret_n_pcr_values); int tpm2_pcr_values_to_mask(const Tpm2PCRValue *pcr_values, size_t n_pcr_values, TPMI_ALG_HASH hash, uint32_t *ret_mask); int tpm2_pcr_values_from_string(const char *arg, Tpm2PCRValue **ret_pcr_values, size_t *ret_n_pcr_values); -char *tpm2_pcr_values_to_string(const Tpm2PCRValue *pcr_values, size_t n_pcr_values); +char* tpm2_pcr_values_to_string(const Tpm2PCRValue *pcr_values, size_t n_pcr_values); int tpm2_pcr_values_hash_count(const Tpm2PCRValue *pcr_values, size_t n_pcr_values, size_t *ret_count); int tpm2_tpml_pcr_selection_from_pcr_values(const Tpm2PCRValue *pcr_values, size_t n_pcr_values, TPML_PCR_SELECTION *ret_selection, TPM2B_DIGEST **ret_values, size_t *ret_n_values); @@ -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, @@ -169,7 +169,7 @@ void tpm2_tpms_pcr_selection_sub_mask(TPMS_PCR_SELECTION *s, uint32_t mask); void tpm2_tpms_pcr_selection_add(TPMS_PCR_SELECTION *a, const TPMS_PCR_SELECTION *b); void tpm2_tpms_pcr_selection_sub(TPMS_PCR_SELECTION *a, const TPMS_PCR_SELECTION *b); void tpm2_tpms_pcr_selection_move(TPMS_PCR_SELECTION *a, TPMS_PCR_SELECTION *b); -char *tpm2_tpms_pcr_selection_to_string(const TPMS_PCR_SELECTION *s); +char* tpm2_tpms_pcr_selection_to_string(const TPMS_PCR_SELECTION *s); size_t tpm2_tpms_pcr_selection_weight(const TPMS_PCR_SELECTION *s); #define tpm2_tpms_pcr_selection_is_empty(s) (tpm2_tpms_pcr_selection_weight(s) == 0) @@ -182,7 +182,7 @@ void tpm2_tpml_pcr_selection_add_tpms_pcr_selection(TPML_PCR_SELECTION *l, const void tpm2_tpml_pcr_selection_sub_tpms_pcr_selection(TPML_PCR_SELECTION *l, const TPMS_PCR_SELECTION *s); void tpm2_tpml_pcr_selection_add(TPML_PCR_SELECTION *a, const TPML_PCR_SELECTION *b); void tpm2_tpml_pcr_selection_sub(TPML_PCR_SELECTION *a, const TPML_PCR_SELECTION *b); -char *tpm2_tpml_pcr_selection_to_string(const TPML_PCR_SELECTION *l); +char* tpm2_tpml_pcr_selection_to_string(const TPML_PCR_SELECTION *l); size_t tpm2_tpml_pcr_selection_weight(const TPML_PCR_SELECTION *l); #define tpm2_tpml_pcr_selection_is_empty(l) (tpm2_tpml_pcr_selection_weight(l) == 0) @@ -426,19 +426,19 @@ 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); +char* tpm2_pcr_mask_to_string(uint32_t mask); extern const uint16_t tpm2_hash_algorithms[]; @@ -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 23a41534ba..45ef48bab6 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 dcef065d92..777c555a90 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 262109b68a..e1cbdbd5dc 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 14a71e009a..7cbf9371c6 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 810c5b5206..edf20edcf9 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 a490183fa1..bf9212a865 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 a762fbcd46..b71df933b7 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 b67ec0f34d..d9af181c8a 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/systemd/sd-id128.h b/src/systemd/sd-id128.h index a9210526b6..7573991c20 100644 --- a/src/systemd/sd-id128.h +++ b/src/systemd/sd-id128.h @@ -37,8 +37,8 @@ union sd_id128 { #define SD_ID128_STRING_MAX 33U #define SD_ID128_UUID_STRING_MAX 37U -char *sd_id128_to_string(sd_id128_t id, char s[_SD_ARRAY_STATIC SD_ID128_STRING_MAX]); -char *sd_id128_to_uuid_string(sd_id128_t id, char s[_SD_ARRAY_STATIC SD_ID128_UUID_STRING_MAX]); +char* sd_id128_to_string(sd_id128_t id, char s[_SD_ARRAY_STATIC SD_ID128_STRING_MAX]); +char* sd_id128_to_uuid_string(sd_id128_t id, char s[_SD_ARRAY_STATIC SD_ID128_UUID_STRING_MAX]); int sd_id128_from_string(const char *s, sd_id128_t *ret); #define SD_ID128_TO_STRING(id) sd_id128_to_string((id), (char[SD_ID128_STRING_MAX]) {}) diff --git a/src/sysupdate/sysupdate-resource.h b/src/sysupdate/sysupdate-resource.h index 51f74cfcb3..76795db0d8 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 6d6051d15a..f5a800429f 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 5dd94bce41..981535aedf 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/test/test-tables.c b/src/test/test-tables.c index 8abfba550c..142ddc4832 100644 --- a/src/test/test-tables.c +++ b/src/test/test-tables.c @@ -71,7 +71,7 @@ int main(int argc, char **argv) { test_table(job_state, JOB_STATE); test_table(job_type, JOB_TYPE); test_table(kill_mode, KILL_MODE); - test_table(kill_who, KILL_WHO); + test_table(kill_whom, KILL_WHOM); test_table(locale_variable, VARIABLE_LC); test_table(log_target, LOG_TARGET); test_table(managed_oom_mode, MANAGED_OOM_MODE); diff --git a/src/udev/net/link-config.h b/src/udev/net/link-config.h index 103343f5a5..3152bec72a 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 1a1cb3734d..69401aa2e0 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 0d82bebf23..b4ddba095a 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 9d19c8099c..ceb454da8d 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 5446c20911..0902dbb245 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 fed0996891..6a77b46e2e 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"; } diff --git a/src/xdg-autostart-generator/xdg-autostart-service.c b/src/xdg-autostart-generator/xdg-autostart-service.c index 480d1009c3..f008556749 100644 --- a/src/xdg-autostart-generator/xdg-autostart-service.c +++ b/src/xdg-autostart-generator/xdg-autostart-service.c @@ -45,7 +45,7 @@ XdgAutostartService* xdg_autostart_service_free(XdgAutostartService *s) { return mfree(s); } -char *xdg_autostart_service_translate_name(const char *name) { +char* xdg_autostart_service_translate_name(const char *name) { _cleanup_free_ char *c = NULL, *escaped = NULL; char *res; diff --git a/src/xdg-autostart-generator/xdg-autostart-service.h b/src/xdg-autostart-generator/xdg-autostart-service.h index 61a4a7304d..15a29da1be 100644 --- a/src/xdg-autostart-generator/xdg-autostart-service.h +++ b/src/xdg-autostart-generator/xdg-autostart-service.h @@ -29,7 +29,7 @@ typedef struct XdgAutostartService { XdgAutostartService * xdg_autostart_service_free(XdgAutostartService *s); DEFINE_TRIVIAL_CLEANUP_FUNC(XdgAutostartService*, xdg_autostart_service_free); -char *xdg_autostart_service_translate_name(const char *name); +char* xdg_autostart_service_translate_name(const char *name); int xdg_autostart_format_exec_start(const char *exec, char **ret_exec_start); XdgAutostartService *xdg_autostart_service_parse_desktop(const char *path);