From: Mike Yuan Date: Wed, 27 Nov 2024 13:47:32 +0000 (+0100) Subject: shared/bootspec: mark _to_string funcs as _const_ X-Git-Tag: v257-rc3~8^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F35381%2Fhead;p=thirdparty%2Fsystemd.git shared/bootspec: mark _to_string funcs as _const_ Addresses https://github.com/systemd/systemd/pull/34959#discussion_r1860451777 --- diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h index 6dda8549a1b..95675214b2a 100644 --- a/src/shared/bootspec.h +++ b/src/shared/bootspec.h @@ -98,11 +98,11 @@ typedef struct BootConfig { .selected_entry = -1, \ } -const char* boot_entry_type_to_string(BootEntryType); -const char* boot_entry_type_json_to_string(BootEntryType); +const char* boot_entry_type_to_string(BootEntryType) _const_; +const char* boot_entry_type_json_to_string(BootEntryType) _const_; -const char* boot_entry_source_to_string(BootEntrySource); -const char* boot_entry_source_json_to_string(BootEntrySource); +const char* boot_entry_source_to_string(BootEntrySource) _const_; +const char* boot_entry_source_json_to_string(BootEntrySource) _const_; BootEntry* boot_config_find_entry(BootConfig *config, const char *id); @@ -137,7 +137,6 @@ int boot_config_select_special_entries(BootConfig *config, bool skip_efivars); static inline const char* boot_entry_title(const BootEntry *entry) { assert(entry); - return ASSERT_PTR(entry->show_title ?: entry->title ?: entry->id); }