diff options
Diffstat (limited to 'src/basic')
34 files changed, 57 insertions, 57 deletions
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 <inttypes.h> #include <stddef.h> -const char *arphrd_to_name(int id); +const char* arphrd_to_name(int id); int arphrd_from_name(const char *name); size_t arphrd_to_hw_addr_len(uint16_t arphrd); diff --git a/src/basic/cap-list.c b/src/basic/cap-list.c index 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/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/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/fd-util.c b/src/basic/fd-util.c index 298477ed0d..b4d11fa462 100644 --- a/src/basic/fd-util.c +++ b/src/basic/fd-util.c @@ -1091,7 +1091,7 @@ int fds_are_same_mount(int fd1, int fd2) { return statx_mount_same(&st1.nsx, &st2.nsx); } -const char *accmode_to_string(int flags) { +const char* accmode_to_string(int flags) { switch (flags & O_ACCMODE) { case O_RDONLY: return "ro"; diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h index a047c3a3f4..4080b67a66 100644 --- a/src/basic/fd-util.h +++ b/src/basic/fd-util.h @@ -163,7 +163,7 @@ char *format_proc_pid_fd_path(char buf[static PROC_PID_FD_PATH_MAX], pid_t pid, int proc_fd_enoent_errno(void); -const char *accmode_to_string(int flags); +const char* accmode_to_string(int flags); /* Like ASSERT_PTR, but for fds */ #define ASSERT_FD(fd) \ diff --git a/src/basic/filesystems.c b/src/basic/filesystems.c index 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/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/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/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/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.h b/src/basic/string-util.h index b5da8bea05..63fcbe2337 100644 --- a/src/basic/string-util.h +++ b/src/basic/string-util.h @@ -49,7 +49,7 @@ static inline const char* strnull(const char *s) { return s ?: "(null)"; } -static inline const char *strna(const char *s) { +static inline const char* strna(const char *s) { return s ?: "n/a"; } @@ -81,11 +81,11 @@ static inline const char* enabled_disabled(bool b) { (typeof(p)) (isempty(_p) ? NULL : _p); \ }) -static inline const char *empty_to_na(const char *p) { +static inline const char* empty_to_na(const char *p) { return isempty(p) ? "n/a" : p; } -static inline const char *empty_to_dash(const char *str) { +static inline const char* empty_to_dash(const char *str) { return isempty(str) ? "-" : str; } @@ -95,7 +95,7 @@ static inline bool empty_or_dash(const char *str) { (str[0] == '-' && str[1] == 0); } -static inline const char *empty_or_dash_to_null(const char *p) { +static inline const char* empty_or_dash_to_null(const char *p) { return empty_or_dash(p) ? NULL : p; } #define empty_or_dash_to_null(p) \ diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index 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/unit-def.c b/src/basic/unit-def.c index d03363bd37..09d881b844 100644 --- a/src/basic/unit-def.c +++ b/src/basic/unit-def.c @@ -58,7 +58,7 @@ const char* unit_dbus_interface_from_type(UnitType t) { return table[t]; } -const char *unit_dbus_interface_from_name(const char *name) { +const char* unit_dbus_interface_from_name(const char *name) { UnitType t; t = unit_name_to_type(name); diff --git a/src/basic/unit-def.h b/src/basic/unit-def.h index 8e73e286da..b818b5ea26 100644 --- a/src/basic/unit-def.h +++ b/src/basic/unit-def.h @@ -284,24 +284,24 @@ char *unit_dbus_path_from_name(const char *name); int unit_name_from_dbus_path(const char *path, char **name); const char* unit_dbus_interface_from_type(UnitType t); -const char *unit_dbus_interface_from_name(const char *name); +const char* unit_dbus_interface_from_name(const char *name); -const char *unit_type_to_string(UnitType i) _const_; +const char* unit_type_to_string(UnitType i) _const_; UnitType unit_type_from_string(const char *s) _pure_; const char* unit_type_to_capitalized_string(UnitType t); -const char *unit_load_state_to_string(UnitLoadState i) _const_; +const char* unit_load_state_to_string(UnitLoadState i) _const_; UnitLoadState unit_load_state_from_string(const char *s) _pure_; -const char *unit_active_state_to_string(UnitActiveState i) _const_; +const char* unit_active_state_to_string(UnitActiveState i) _const_; UnitActiveState unit_active_state_from_string(const char *s) _pure_; -const char *freezer_state_to_string(FreezerState i) _const_; +const char* freezer_state_to_string(FreezerState i) _const_; FreezerState freezer_state_from_string(const char *s) _pure_; FreezerState freezer_state_finish(FreezerState i) _const_; -const char *unit_marker_to_string(UnitMarker m) _const_; +const char* unit_marker_to_string(UnitMarker m) _const_; UnitMarker unit_marker_from_string(const char *s) _pure_; const char* automount_state_to_string(AutomountState i) _const_; @@ -334,10 +334,10 @@ SwapState swap_state_from_string(const char *s) _pure_; const char* target_state_to_string(TargetState i) _const_; TargetState target_state_from_string(const char *s) _pure_; -const char *timer_state_to_string(TimerState i) _const_; +const char* timer_state_to_string(TimerState i) _const_; TimerState timer_state_from_string(const char *s) _pure_; -const char *unit_dependency_to_string(UnitDependency i) _const_; +const char* unit_dependency_to_string(UnitDependency i) _const_; UnitDependency unit_dependency_from_string(const char *s) _pure_; const char* notify_access_to_string(NotifyAccess i) _const_; diff --git a/src/basic/virt.h b/src/basic/virt.h index 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); |