Skip to content

Commit f85b738

Browse files
Merge pull request libretro#18023 from schellingb/make_lists_static
Make a few large read-only arrays in menu code static
2 parents 26f6f72 + 771fc52 commit f85b738

File tree

6 files changed

+35
-35
lines changed

6 files changed

+35
-35
lines changed

menu/cbs/menu_cbs_deferred_push.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
670670
int (*cb)(menu_displaylist_info_t *info);
671671
} deferred_info_list_t;
672672

673-
const deferred_info_list_t info_list[] = {
673+
static const deferred_info_list_t info_list[] = {
674674
{MENU_ENUM_LABEL_DEFERRED_DUMP_DISC_LIST, deferred_push_dump_disk_list},
675675
#ifdef HAVE_LAKKA
676676
{MENU_ENUM_LABEL_DEFERRED_EJECT_DISC, deferred_push_eject_disc},

menu/cbs/menu_cbs_get_value.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,7 @@ static int menu_cbs_init_bind_get_string_representation_compare_type(
21232123
char *s2, size_t len2);
21242124
} info_range_list_t;
21252125

2126-
info_range_list_t info_list[] = {
2126+
static const info_range_list_t info_list[] = {
21272127
#ifdef HAVE_AUDIOMIXER
21282128
{
21292129
MENU_SETTINGS_AUDIO_MIXER_STREAM_BEGIN,

menu/cbs/menu_cbs_ok.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8998,7 +8998,7 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
89988998
size_t idx, size_t entry_idx);
89998999
} temp_ok_list_t;
90009000

9001-
temp_ok_list_t ok_list[] = {
9001+
static const temp_ok_list_t ok_list[] = {
90029002
{MENU_ENUM_LABEL_QUICK_MENU_START_RECORDING, action_ok_start_recording},
90039003
{MENU_ENUM_LABEL_QUICK_MENU_START_STREAMING, action_ok_start_streaming},
90049004
{MENU_ENUM_LABEL_QUICK_MENU_STOP_RECORDING, action_ok_stop_recording},
@@ -9380,7 +9380,7 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
93809380
size_t idx, size_t entry_idx);
93819381
} temp_ok_list_t;
93829382

9383-
temp_ok_list_t ok_list[] = {
9383+
static const temp_ok_list_t ok_list[] = {
93849384
{MENU_ENUM_LABEL_OPEN_ARCHIVE_DETECT_CORE, action_ok_open_archive_detect_core},
93859385
{MENU_ENUM_LABEL_OPEN_ARCHIVE, action_ok_open_archive},
93869386
{MENU_ENUM_LABEL_LOAD_ARCHIVE_DETECT_CORE, action_ok_load_archive_detect_core},

menu/cbs/menu_cbs_sublabel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,7 +2202,7 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
22022202
char *s, size_t len);
22032203
} info_range_list_t;
22042204

2205-
info_range_list_t info_list[] = {
2205+
static const info_range_list_t info_list[] = {
22062206
{
22072207
MENU_SETTINGS_INPUT_DESC_KBD_BEGIN,
22082208
MENU_SETTINGS_INPUT_DESC_KBD_END,
@@ -5797,7 +5797,7 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
57975797
} info_single_list_t;
57985798

57995799
/* Entries with %u player index placeholder. */
5800-
info_single_list_t info_list[] = {
5800+
static const info_single_list_t info_list[] = {
58015801
#if 0
58025802
{
58035803
MENU_ENUM_LABEL_INPUT_LIBRETRO_DEVICE,

menu/cbs/menu_cbs_title.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ static int action_get_title_group_settings(const char *path, const char *label,
908908
/* Note: MENU_ENUM_LABEL_HORIZONTAL_MENU *is* a playlist
909909
* tab, but its actual title is set elsewhere - so treat
910910
* it as a generic top-level item */
911-
title_info_list_t info_list[] = {
911+
static const title_info_list_t info_list[] = {
912912
{MENU_ENUM_LABEL_MAIN_MENU, MENU_ENUM_LABEL_VALUE_MAIN_MENU, false },
913913
{MENU_ENUM_LABEL_HISTORY_TAB, MENU_ENUM_LABEL_VALUE_HISTORY_TAB, true },
914914
{MENU_ENUM_LABEL_FAVORITES_TAB, MENU_ENUM_LABEL_VALUE_FAVORITES_TAB, true },
@@ -979,7 +979,7 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
979979
unsigned type, char *s, size_t len);
980980
} title_info_list_t;
981981

982-
title_info_list_t info_list[] = {
982+
static const title_info_list_t info_list[] = {
983983
{MENU_ENUM_LABEL_DEFERRED_REMAPPINGS_PORT_LIST, action_get_title_remap_port},
984984
{MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST, action_get_core_settings_list},
985985
{MENU_ENUM_LABEL_DEFERRED_CORE_INFORMATION_LIST, action_get_core_information_list},
@@ -1818,7 +1818,7 @@ int menu_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
18181818
unsigned type, char *s, size_t len);
18191819
} title_info_list_t;
18201820

1821-
title_info_list_t info_list[] = {
1821+
static const title_info_list_t info_list[] = {
18221822
#ifdef HAVE_AUDIOMIXER
18231823
{MENU_ENUM_LABEL_DEFERRED_MIXER_STREAM_SETTINGS_LIST, action_get_title_mixer_stream_actions},
18241824
#endif

menu/menu_displaylist.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ static unsigned menu_displaylist_parse_system_info(file_list_t *list)
22682268

22692269
/* Supports %s: yes/no */
22702270
{
2271-
struct menu_features_info
2271+
static const struct menu_features_info
22722272
{
22732273
bool enabled;
22742274
enum msg_hash_enums msg;
@@ -7391,7 +7391,7 @@ unsigned menu_displaylist_build_list(
73917391
break;
73927392
case DISPLAYLIST_INPUT_TURBO_FIRE_SETTINGS_LIST:
73937393
{
7394-
menu_displaylist_build_info_t build_list[] = {
7394+
static const menu_displaylist_build_info_t build_list[] = {
73957395
{MENU_ENUM_LABEL_INPUT_TURBO_ENABLE, PARSE_ONLY_BOOL},
73967396
{MENU_ENUM_LABEL_INPUT_TURBO_MODE, PARSE_ONLY_UINT},
73977397
{MENU_ENUM_LABEL_INPUT_TURBO_BIND, PARSE_ONLY_INT},
@@ -9195,7 +9195,7 @@ unsigned menu_displaylist_build_list(
91959195
#ifdef HAVE_CHEATS
91969196
{
91979197
char cheat_label[64];
9198-
menu_displaylist_build_info_t build_list[] = {
9198+
static const menu_displaylist_build_info_t build_list[] = {
91999199
{MENU_ENUM_LABEL_CHEAT_START_OR_RESTART, PARSE_ONLY_UINT },
92009200
{MENU_ENUM_LABEL_CHEAT_BIG_ENDIAN, PARSE_ONLY_BOOL },
92019201
{MENU_ENUM_LABEL_CHEAT_SEARCH_EXACT, PARSE_ONLY_UINT },
@@ -9298,7 +9298,7 @@ unsigned menu_displaylist_build_list(
92989298
}
92999299

93009300
{
9301-
menu_displaylist_build_info_t build_list[] = {
9301+
static const menu_displaylist_build_info_t build_list[] = {
93029302
{MENU_ENUM_LABEL_CHEAT_IDX, PARSE_ONLY_UINT },
93039303
{MENU_ENUM_LABEL_CHEAT_STATE, PARSE_ONLY_BOOL },
93049304
{MENU_ENUM_LABEL_CHEAT_DESC, PARSE_ONLY_STRING},
@@ -9323,7 +9323,7 @@ unsigned menu_displaylist_build_list(
93239323
}
93249324
else
93259325
{
9326-
menu_displaylist_build_info_t build_list[] = {
9326+
static const menu_displaylist_build_info_t build_list[] = {
93279327
{MENU_ENUM_LABEL_CHEAT_MEMORY_SEARCH_SIZE, PARSE_ONLY_UINT },
93289328
{MENU_ENUM_LABEL_CHEAT_TYPE, PARSE_ONLY_UINT },
93299329
{MENU_ENUM_LABEL_CHEAT_VALUE, PARSE_ONLY_UINT },
@@ -9428,7 +9428,7 @@ unsigned menu_displaylist_build_list(
94289428
break;
94299429
case DISPLAYLIST_ACCOUNTS_YOUTUBE_LIST:
94309430
{
9431-
menu_displaylist_build_info_t build_list[] = {
9431+
static const menu_displaylist_build_info_t build_list[] = {
94329432
{MENU_ENUM_LABEL_YOUTUBE_STREAM_KEY, PARSE_ONLY_STRING},
94339433
};
94349434

@@ -9693,7 +9693,7 @@ unsigned menu_displaylist_build_list(
96939693
break;
96949694
case DISPLAYLIST_MIDI_SETTINGS_LIST:
96959695
{
9696-
menu_displaylist_build_info_t build_list[] = {
9696+
static const menu_displaylist_build_info_t build_list[] = {
96979697
{MENU_ENUM_LABEL_MIDI_OUTPUT, PARSE_ONLY_STRING},
96989698
{MENU_ENUM_LABEL_MIDI_INPUT, PARSE_ONLY_STRING},
96999699
{MENU_ENUM_LABEL_MIDI_VOLUME, PARSE_ONLY_UINT },
@@ -10147,7 +10147,7 @@ unsigned menu_displaylist_build_list(
1014710147
break;
1014810148
case DISPLAYLIST_CRT_SWITCHRES_SETTINGS_LIST:
1014910149
{
10150-
menu_displaylist_build_info_t build_list[] = {
10150+
static const menu_displaylist_build_info_t build_list[] = {
1015110151
{MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION, PARSE_ONLY_UINT},
1015210152
{MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_SUPER, PARSE_ONLY_UINT},
1015310153
{MENU_ENUM_LABEL_CRT_SWITCH_X_AXIS_CENTERING, PARSE_ONLY_INT },
@@ -10169,7 +10169,7 @@ unsigned menu_displaylist_build_list(
1016910169
#ifdef HAVE_LAKKA
1017010170
case DISPLAYLIST_LAKKA_SERVICES_LIST:
1017110171
{
10172-
menu_displaylist_build_info_t build_list[] = {
10172+
static const menu_displaylist_build_info_t build_list[] = {
1017310173
{MENU_ENUM_LABEL_SSH_ENABLE, PARSE_ONLY_BOOL},
1017410174
{MENU_ENUM_LABEL_SAMBA_ENABLE, PARSE_ONLY_BOOL},
1017510175
{MENU_ENUM_LABEL_BLUETOOTH_ENABLE, PARSE_ONLY_BOOL},
@@ -10190,7 +10190,7 @@ unsigned menu_displaylist_build_list(
1019010190
#ifdef HAVE_LAKKA_SWITCH
1019110191
case DISPLAYLIST_LAKKA_SWITCH_OPTIONS_LIST:
1019210192
{
10193-
menu_displaylist_build_info_t build_list[] = {
10193+
static const menu_displaylist_build_info_t build_list[] = {
1019410194
{MENU_ENUM_LABEL_SWITCH_OC_ENABLE, PARSE_ONLY_BOOL},
1019510195
{MENU_ENUM_LABEL_SWITCH_CEC_ENABLE, PARSE_ONLY_BOOL},
1019610196
{MENU_ENUM_LABEL_BLUETOOTH_ERTM_DISABLE, PARSE_ONLY_BOOL},
@@ -10276,7 +10276,7 @@ unsigned menu_displaylist_build_list(
1027610276
break;
1027710277
case DISPLAYLIST_MENU_FILE_BROWSER_SETTINGS_LIST:
1027810278
{
10279-
menu_displaylist_build_info_t build_list[] = {
10279+
static const menu_displaylist_build_info_t build_list[] = {
1028010280
{MENU_ENUM_LABEL_RGUI_BROWSER_DIRECTORY, PARSE_ONLY_DIR},
1028110281
{MENU_ENUM_LABEL_CACHE_DIRECTORY, PARSE_ONLY_DIR},
1028210282
{MENU_ENUM_LABEL_SHOW_HIDDEN_FILES, PARSE_ONLY_BOOL},
@@ -10299,7 +10299,7 @@ unsigned menu_displaylist_build_list(
1029910299
break;
1030010300
case DISPLAYLIST_ACCOUNTS_LIST:
1030110301
{
10302-
menu_displaylist_build_info_t build_list[] = {
10302+
static const menu_displaylist_build_info_t build_list[] = {
1030310303
{MENU_ENUM_LABEL_ACCOUNTS_RETRO_ACHIEVEMENTS, PARSE_ACTION},
1030410304
{MENU_ENUM_LABEL_ACCOUNTS_YOUTUBE, PARSE_ACTION},
1030510305
{MENU_ENUM_LABEL_ACCOUNTS_TWITCH, PARSE_ACTION},
@@ -10317,7 +10317,7 @@ unsigned menu_displaylist_build_list(
1031710317
break;
1031810318
case DISPLAYLIST_ACCOUNTS_CHEEVOS_LIST:
1031910319
{
10320-
menu_displaylist_build_info_t build_list[] = {
10320+
static const menu_displaylist_build_info_t build_list[] = {
1032110321
{MENU_ENUM_LABEL_CHEEVOS_USERNAME, PARSE_ONLY_STRING},
1032210322
{MENU_ENUM_LABEL_CHEEVOS_PASSWORD, PARSE_ONLY_STRING},
1032310323
};
@@ -10916,7 +10916,7 @@ unsigned menu_displaylist_build_list(
1091610916
}
1091710917
case DISPLAYLIST_PRIVACY_SETTINGS_LIST:
1091810918
{
10919-
menu_displaylist_build_info_t build_list[] = {
10919+
static const menu_displaylist_build_info_t build_list[] = {
1092010920
{MENU_ENUM_LABEL_CAMERA_ALLOW, PARSE_ONLY_BOOL},
1092110921
{MENU_ENUM_LABEL_DISCORD_ALLOW, PARSE_ONLY_BOOL},
1092210922
{MENU_ENUM_LABEL_LOCATION_ALLOW, PARSE_ONLY_BOOL},
@@ -11192,7 +11192,7 @@ unsigned menu_displaylist_build_list(
1119211192
break;
1119311193
case DISPLAYLIST_POWER_MANAGEMENT_SETTINGS_LIST:
1119411194
{
11195-
menu_displaylist_build_info_t build_list[] = {
11195+
static const menu_displaylist_build_info_t build_list[] = {
1119611196
{MENU_ENUM_LABEL_FASTFORWARD_FRAMESKIP, PARSE_ONLY_BOOL},
1119711197
{MENU_ENUM_LABEL_SUSTAINED_PERFORMANCE_MODE, PARSE_ONLY_BOOL},
1119811198
{MENU_ENUM_LABEL_CPU_PERFPOWER, PARSE_ACTION},
@@ -11226,7 +11226,7 @@ unsigned menu_displaylist_build_list(
1122611226
case DISPLAYLIST_ONSCREEN_DISPLAY_SETTINGS_LIST:
1122711227
{
1122811228
/* Not used */
11229-
menu_displaylist_build_info_t build_list[] = {
11229+
static const menu_displaylist_build_info_t build_list[] = {
1123011230
{MENU_ENUM_LABEL_ONSCREEN_NOTIFICATIONS_SETTINGS, PARSE_ACTION},
1123111231
#if defined(HAVE_OVERLAY)
1123211232
{MENU_ENUM_LABEL_ONSCREEN_OVERLAY_SETTINGS, PARSE_ACTION},
@@ -11244,7 +11244,7 @@ unsigned menu_displaylist_build_list(
1124411244
break;
1124511245
case DISPLAYLIST_USER_SETTINGS_LIST:
1124611246
{
11247-
menu_displaylist_build_info_t build_list[] = {
11247+
static const menu_displaylist_build_info_t build_list[] = {
1124811248
{MENU_ENUM_LABEL_PRIVACY_SETTINGS, PARSE_ACTION},
1124911249
{MENU_ENUM_LABEL_ACCOUNTS_LIST, PARSE_ACTION},
1125011250
{MENU_ENUM_LABEL_NETPLAY_NICKNAME, PARSE_ONLY_STRING},
@@ -11261,7 +11261,7 @@ unsigned menu_displaylist_build_list(
1126111261
break;
1126211262
case DISPLAYLIST_UPDATER_SETTINGS_LIST:
1126311263
{
11264-
menu_displaylist_build_info_t build_list[] = {
11264+
static const menu_displaylist_build_info_t build_list[] = {
1126511265
{MENU_ENUM_LABEL_CORE_UPDATER_BUILDBOT_URL, PARSE_ONLY_STRING},
1126611266
{MENU_ENUM_LABEL_BUILDBOT_ASSETS_URL, PARSE_ONLY_STRING},
1126711267
{MENU_ENUM_LABEL_CORE_UPDATER_AUTO_EXTRACT_ARCHIVE, PARSE_ONLY_BOOL},
@@ -11281,7 +11281,7 @@ unsigned menu_displaylist_build_list(
1128111281
break;
1128211282
case DISPLAYLIST_MENU_SOUNDS_LIST:
1128311283
{
11284-
menu_displaylist_build_info_t build_list[] = {
11284+
static const menu_displaylist_build_info_t build_list[] = {
1128511285
{MENU_ENUM_LABEL_AUDIO_ENABLE_MENU, PARSE_ONLY_BOOL},
1128611286
{MENU_ENUM_LABEL_MENU_SOUND_OK, PARSE_ONLY_BOOL},
1128711287
{MENU_ENUM_LABEL_MENU_SOUND_CANCEL, PARSE_ONLY_BOOL},
@@ -11301,7 +11301,7 @@ unsigned menu_displaylist_build_list(
1130111301
break;
1130211302
case DISPLAYLIST_SETTINGS_VIEWS_SETTINGS_LIST:
1130311303
{
11304-
menu_displaylist_build_info_t build_list[] = {
11304+
static const menu_displaylist_build_info_t build_list[] = {
1130511305
{MENU_ENUM_LABEL_SETTINGS_SHOW_USER_INTERFACE, PARSE_ONLY_BOOL},
1130611306
{MENU_ENUM_LABEL_SETTINGS_SHOW_ONSCREEN_DISPLAY, PARSE_ONLY_BOOL},
1130711307
{MENU_ENUM_LABEL_SETTINGS_SHOW_FILE_BROWSER, PARSE_ONLY_BOOL},
@@ -11346,7 +11346,7 @@ unsigned menu_displaylist_build_list(
1134611346
break;
1134711347
case DISPLAYLIST_QUICK_MENU_VIEWS_SETTINGS_LIST:
1134811348
{
11349-
menu_displaylist_build_info_t build_list[] = {
11349+
static const menu_displaylist_build_info_t build_list[] = {
1135011350
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_RESUME_CONTENT, PARSE_ONLY_BOOL},
1135111351
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_RESTART_CONTENT, PARSE_ONLY_BOOL},
1135211352
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_CLOSE_CONTENT, PARSE_ONLY_BOOL},
@@ -11409,7 +11409,7 @@ unsigned menu_displaylist_build_list(
1140911409
#endif
1141011410

1141111411
{
11412-
menu_displaylist_build_info_t build_list[] = {
11412+
static const menu_displaylist_build_info_t build_list[] = {
1141311413
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_SET_CORE_ASSOCIATION, PARSE_ONLY_BOOL},
1141411414
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_RESET_CORE_ASSOCIATION, PARSE_ONLY_BOOL},
1141511415
#ifdef HAVE_NETWORKING
@@ -11430,7 +11430,7 @@ unsigned menu_displaylist_build_list(
1143011430
break;
1143111431
case DISPLAYLIST_CORE_SETTINGS_LIST:
1143211432
{
11433-
menu_displaylist_build_info_t build_list[] = {
11433+
static const menu_displaylist_build_info_t build_list[] = {
1143411434
{MENU_ENUM_LABEL_CORE_INFO_CACHE_ENABLE, PARSE_ONLY_BOOL},
1143511435
{MENU_ENUM_LABEL_CORE_INFO_SAVESTATE_BYPASS, PARSE_ONLY_BOOL},
1143611436
{MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE, PARSE_ONLY_BOOL},
@@ -11472,7 +11472,7 @@ unsigned menu_displaylist_build_list(
1147211472
break;
1147311473
case DISPLAYLIST_CONFIGURATION_SETTINGS_LIST:
1147411474
{
11475-
menu_displaylist_build_info_t build_list[] = {
11475+
static const menu_displaylist_build_info_t build_list[] = {
1147611476
{MENU_ENUM_LABEL_CONFIG_SAVE_ON_EXIT, PARSE_ONLY_BOOL},
1147711477
{MENU_ENUM_LABEL_REMAP_SAVE_ON_EXIT, PARSE_ONLY_BOOL},
1147811478
{MENU_ENUM_LABEL_GAME_SPECIFIC_OPTIONS, PARSE_ONLY_BOOL},
@@ -11493,7 +11493,7 @@ unsigned menu_displaylist_build_list(
1149311493
break;
1149411494
case DISPLAYLIST_DIRECTORY_SETTINGS_LIST:
1149511495
{
11496-
menu_displaylist_build_info_t build_list[] = {
11496+
static const menu_displaylist_build_info_t build_list[] = {
1149711497
{MENU_ENUM_LABEL_RGUI_BROWSER_DIRECTORY, PARSE_ONLY_DIR},
1149811498
{MENU_ENUM_LABEL_CACHE_DIRECTORY, PARSE_ONLY_DIR},
1149911499
{MENU_ENUM_LABEL_SYSTEM_DIRECTORY, PARSE_ONLY_DIR},
@@ -11547,7 +11547,7 @@ unsigned menu_displaylist_build_list(
1154711547
break;
1154811548
case DISPLAYLIST_DRIVER_SETTINGS_LIST:
1154911549
{
11550-
menu_displaylist_build_info_t build_list[] = {
11550+
static const menu_displaylist_build_info_t build_list[] = {
1155111551
{MENU_ENUM_LABEL_MENU_DRIVER, PARSE_ONLY_STRING_OPTIONS},
1155211552
{MENU_ENUM_LABEL_VIDEO_DRIVER, PARSE_ONLY_STRING_OPTIONS},
1155311553
{MENU_ENUM_LABEL_AUDIO_DRIVER, PARSE_ONLY_STRING_OPTIONS},

0 commit comments

Comments
 (0)