diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-09-18 20:07:12 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-10-02 08:20:10 -0400 |
commit | 5b0506e9de356f915138711b62f3e414a8c1b2bb (patch) | |
tree | 7d42f57c5133d14efe35b05fa42b54bcfa962350 /apps/gui/list.h | |
parent | 420fb1163c526cdbfba4b131b8c33824f401cd15 (diff) | |
download | rockbox-5b0506e9de356f915138711b62f3e414a8c1b2bb.tar.gz rockbox-5b0506e9de356f915138711b62f3e414a8c1b2bb.zip |
gui: Constify list title text
Use const char* pointers for list titles. Only one debug menu
actually modifies the title, and in that case it's legal to
cast away const because the title points to a known mutable
buffer on the stack.
Change-Id: Idb8ab307b9a6ec23a93d8420c5e19fafd9f59c30
Diffstat (limited to 'apps/gui/list.h')
-rw-r--r-- | apps/gui/list.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/gui/list.h b/apps/gui/list.h index 4dc83a1b27..2df33b7541 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -96,7 +96,7 @@ struct list_putlineinfo_t { | |||
96 | struct viewport *vp; | 96 | struct viewport *vp; |
97 | struct line_desc *linedes; | 97 | struct line_desc *linedes; |
98 | struct gui_synclist * list; | 98 | struct gui_synclist * list; |
99 | char *dsp_text; | 99 | const char *dsp_text; |
100 | 100 | ||
101 | bool is_selected; | 101 | bool is_selected; |
102 | bool is_title; | 102 | bool is_title; |
@@ -185,7 +185,7 @@ struct gui_synclist | |||
185 | /* The data that will be passed to the callback function YOU implement */ | 185 | /* The data that will be passed to the callback function YOU implement */ |
186 | void * data; | 186 | void * data; |
187 | /* The optional title, set to NULL for none */ | 187 | /* The optional title, set to NULL for none */ |
188 | char * title; | 188 | const char * title; |
189 | /* Optional title icon */ | 189 | /* Optional title icon */ |
190 | enum themable_icons title_icon; | 190 | enum themable_icons title_icon; |
191 | 191 | ||
@@ -233,7 +233,7 @@ extern void gui_synclist_select_item(struct gui_synclist * lists, | |||
233 | extern void gui_synclist_add_item(struct gui_synclist * lists); | 233 | extern void gui_synclist_add_item(struct gui_synclist * lists); |
234 | extern void gui_synclist_del_item(struct gui_synclist * lists); | 234 | extern void gui_synclist_del_item(struct gui_synclist * lists); |
235 | extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll); | 235 | extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll); |
236 | extern void gui_synclist_set_title(struct gui_synclist * lists, char * title, | 236 | extern void gui_synclist_set_title(struct gui_synclist * lists, const char * title, |
237 | enum themable_icons icon); | 237 | enum themable_icons icon); |
238 | extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists, | 238 | extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists, |
239 | bool hide); | 239 | bool hide); |
@@ -301,7 +301,7 @@ extern bool list_do_action(int context, int timeout, | |||
301 | **/ | 301 | **/ |
302 | 302 | ||
303 | struct simplelist_info { | 303 | struct simplelist_info { |
304 | char *title; /* title to show on the list */ | 304 | const char *title; /* title to show on the list */ |
305 | int count; /* number of items in the list, each item is selection_size high */ | 305 | int count; /* number of items in the list, each item is selection_size high */ |
306 | int selection_size; /* list selection size, usually 1 */ | 306 | int selection_size; /* list selection size, usually 1 */ |
307 | bool hide_selection; | 307 | bool hide_selection; |