summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-09-18 20:07:12 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-10-02 08:20:10 -0400
commit5b0506e9de356f915138711b62f3e414a8c1b2bb (patch)
tree7d42f57c5133d14efe35b05fa42b54bcfa962350 /apps/debug_menu.c
parent420fb1163c526cdbfba4b131b8c33824f401cd15 (diff)
downloadrockbox-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/debug_menu.c')
-rw-r--r--apps/debug_menu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index f510597ad2..9c911eea4d 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -1247,7 +1247,8 @@ static int disk_callback(int btn, struct gui_synclist *lists)
1247 int *cardnum = (int*)lists->data; 1247 int *cardnum = (int*)lists->data;
1248 unsigned char card_name[6]; 1248 unsigned char card_name[6];
1249 unsigned char pbuf[32]; 1249 unsigned char pbuf[32];
1250 char *title = lists->title; 1250 /* Casting away const is safe; the buffer is defined as non-const. */
1251 char *title = (char *)lists->title;
1251 static const unsigned char i_vmin[] = { 0, 1, 5, 10, 25, 35, 60, 100 }; 1252 static const unsigned char i_vmin[] = { 0, 1, 5, 10, 25, 35, 60, 100 };
1252 static const unsigned char i_vmax[] = { 1, 5, 10, 25, 35, 45, 80, 200 }; 1253 static const unsigned char i_vmax[] = { 1, 5, 10, 25, 35, 45, 80, 200 };
1253 static const unsigned char * const kbit_units[] = { "kBit/s", "MBit/s", "GBit/s" }; 1254 static const unsigned char * const kbit_units[] = { "kBit/s", "MBit/s", "GBit/s" };