From 5b0506e9de356f915138711b62f3e414a8c1b2bb Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sun, 18 Sep 2022 20:07:12 +0100 Subject: 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 --- apps/gui/list.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/gui/list.h') 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 { struct viewport *vp; struct line_desc *linedes; struct gui_synclist * list; - char *dsp_text; + const char *dsp_text; bool is_selected; bool is_title; @@ -185,7 +185,7 @@ struct gui_synclist /* The data that will be passed to the callback function YOU implement */ void * data; /* The optional title, set to NULL for none */ - char * title; + const char * title; /* Optional title icon */ enum themable_icons title_icon; @@ -233,7 +233,7 @@ extern void gui_synclist_select_item(struct gui_synclist * lists, extern void gui_synclist_add_item(struct gui_synclist * lists); extern void gui_synclist_del_item(struct gui_synclist * lists); extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll); -extern void gui_synclist_set_title(struct gui_synclist * lists, char * title, +extern void gui_synclist_set_title(struct gui_synclist * lists, const char * title, enum themable_icons icon); extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists, bool hide); @@ -301,7 +301,7 @@ extern bool list_do_action(int context, int timeout, **/ struct simplelist_info { - char *title; /* title to show on the list */ + const char *title; /* title to show on the list */ int count; /* number of items in the list, each item is selection_size high */ int selection_size; /* list selection size, usually 1 */ bool hide_selection; -- cgit v1.2.3