From 9a1276e0a26b9a42f4836658d9c22d101eb495a1 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Wed, 27 Nov 2024 14:47:32 +0100 Subject: [PATCH] shared/bootspec: mark _to_string funcs as _const_ Addresses https://github.com/systemd/systemd/pull/34959#discussion_r1860451777 --- src/shared/bootspec.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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); } -- 2.47.3