From 59c502d0f4de29a07745ce189cf7cac66d1243d0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 18 May 2019 19:25:35 +0200 Subject: [PATCH] menu_entries_get_last_stack - don't pass enum_idx to it if we aren't going to use it --- menu/cbs/menu_cbs_cancel.c | 5 ++--- menu/cbs/menu_cbs_ok.c | 11 ++++------- menu/cbs/menu_cbs_scan.c | 8 ++------ menu/drivers/menu_generic.c | 3 +-- menu/menu_displaylist.c | 3 +-- menu/menu_entries.c | 6 ++---- 6 files changed, 12 insertions(+), 24 deletions(-) diff --git a/menu/cbs/menu_cbs_cancel.c b/menu/cbs/menu_cbs_cancel.c index 0f4076b4fb..fdea0b5e4e 100644 --- a/menu/cbs/menu_cbs_cancel.c +++ b/menu/cbs/menu_cbs_cancel.c @@ -36,7 +36,6 @@ int action_cancel_pop_default(const char *path, { size_t new_selection_ptr; const char *menu_label = NULL; - enum msg_hash_enums enum_idx = MSG_UNKNOWN; settings_t *settings = config_get_ptr(); (void)path; @@ -47,7 +46,7 @@ int action_cancel_pop_default(const char *path, if (settings->bools.audio_enable_menu && settings->bools.audio_enable_menu_cancel) audio_driver_mixer_play_menu_sound(AUDIO_MIXER_SYSTEM_SLOT_CANCEL); - menu_entries_get_last_stack(NULL, &menu_label, NULL, &enum_idx, NULL); + menu_entries_get_last_stack(NULL, &menu_label, NULL, NULL, NULL); if (!string_is_empty(menu_label)) { @@ -118,7 +117,7 @@ static int menu_cbs_init_bind_cancel_compare_type( return 0; } - switch ( cbs->enum_idx ) + switch (cbs->enum_idx) { case MENU_ENUM_LABEL_CHEAT_IDX: diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index b49403cecc..cf89417358 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -296,7 +296,6 @@ int generic_action_ok_displaylist_push(const char *path, const char *info_label = NULL; const char *info_path = NULL; menu_handle_t *menu = NULL; - enum msg_hash_enums enum_idx = MSG_UNKNOWN; settings_t *settings = config_get_ptr(); file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); char *menu_driver = settings->arrays.menu_driver; @@ -314,7 +313,7 @@ int generic_action_ok_displaylist_push(const char *path, tmp[0] = parent_dir[0] = '\0'; - menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL); + menu_entries_get_last_stack(&menu_path, &menu_label, NULL, NULL, NULL); switch (action_type) { @@ -1122,7 +1121,6 @@ static void content_add_to_playlist(const char *path) static int file_load_with_detect_core_wrapper( enum msg_hash_enums enum_label_idx, - enum msg_hash_enums enum_idx, size_t idx, size_t entry_idx, const char *path, const char *label, unsigned type, bool is_carchive) @@ -1143,7 +1141,7 @@ static int file_load_with_detect_core_wrapper( new_core_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); new_core_path[0] = menu_path_new[0] = '\0'; - menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL); + menu_entries_get_last_stack(&menu_path, &menu_label, NULL, NULL, NULL); if (!string_is_empty(menu_path)) strlcpy(menu_path_new, menu_path, PATH_MAX_LENGTH * sizeof(char)); @@ -1239,7 +1237,7 @@ static int action_ok_file_load_with_detect_core_carchive( type = 0; label = NULL; - return file_load_with_detect_core_wrapper(MSG_UNKNOWN, + return file_load_with_detect_core_wrapper( MSG_UNKNOWN, idx, entry_idx, path, label, type, true); } @@ -1252,7 +1250,6 @@ static int action_ok_file_load_with_detect_core(const char *path, label = NULL; return file_load_with_detect_core_wrapper( - MSG_UNKNOWN, MSG_UNKNOWN, idx, entry_idx, path, label, type, false); } @@ -1265,7 +1262,7 @@ static int action_ok_file_load_with_detect_core_collection(const char *path, return file_load_with_detect_core_wrapper( MENU_ENUM_LABEL_COLLECTION, - MSG_UNKNOWN, idx, entry_idx, + idx, entry_idx, path, label, type, false); } diff --git a/menu/cbs/menu_cbs_scan.c b/menu/cbs/menu_cbs_scan.c index ae6ce51091..b16020dab0 100644 --- a/menu/cbs/menu_cbs_scan.c +++ b/menu/cbs/menu_cbs_scan.c @@ -51,14 +51,12 @@ int action_scan_file(const char *path, const char *label, unsigned type, size_t idx) { char fullpath[PATH_MAX_LENGTH]; - enum msg_hash_enums enum_idx = MSG_UNKNOWN; - const char *menu_label = NULL; const char *menu_path = NULL; settings_t *settings = config_get_ptr(); fullpath[0] = '\0'; - menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL); + menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL, NULL); fill_pathname_join(fullpath, menu_path, path, sizeof(fullpath)); @@ -76,14 +74,12 @@ int action_scan_directory(const char *path, const char *label, unsigned type, size_t idx) { char fullpath[PATH_MAX_LENGTH]; - enum msg_hash_enums enum_idx = MSG_UNKNOWN; - const char *menu_label = NULL; const char *menu_path = NULL; settings_t *settings = config_get_ptr(); fullpath[0] = '\0'; - menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL); + menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL, NULL); strlcpy(fullpath, menu_path, sizeof(fullpath)); diff --git a/menu/drivers/menu_generic.c b/menu/drivers/menu_generic.c index 5b3919167b..2e2f0080dd 100644 --- a/menu/drivers/menu_generic.c +++ b/menu/drivers/menu_generic.c @@ -71,13 +71,12 @@ int generic_menu_iterate(menu_handle_t *menu, void *userdata, enum menu_action a enum action_iterate_type iterate_type; unsigned file_type = 0; int ret = 0; - enum msg_hash_enums enum_idx = MSG_UNKNOWN; const char *label = NULL; if (!menu) return 0; - menu_entries_get_last_stack(NULL, &label, &file_type, &enum_idx, NULL); + menu_entries_get_last_stack(NULL, &label, &file_type, NULL, NULL); menu->menu_state_msg[0] = '\0'; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index bb960ae6ff..7a0e30addb 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -2891,9 +2891,8 @@ static void wifi_scan_callback(retro_task_t *task, const char *path = NULL; const char *label = NULL; unsigned menu_type = 0; - enum msg_hash_enums enum_idx = MSG_UNKNOWN; - menu_entries_get_last_stack(&path, &label, &menu_type, &enum_idx, NULL); + menu_entries_get_last_stack(&path, &label, &menu_type, NULL, NULL); /* Don't push the results if we left the wifi menu */ if (!string_is_equal(label, diff --git a/menu/menu_entries.c b/menu/menu_entries.c index 78232b4f86..b2a042dfa1 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -387,12 +387,11 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx, if (cbs) { const char *label = NULL; - enum msg_hash_enums enum_idx = MSG_UNKNOWN; entry->enum_idx = cbs->enum_idx; entry->checked = cbs->checked; - menu_entries_get_last_stack(NULL, &label, NULL, &enum_idx, NULL); + menu_entries_get_last_stack(NULL, &label, NULL, NULL, NULL); if (cbs->action_get_value && use_representation) { @@ -882,7 +881,6 @@ int menu_entries_get_title(char *s, size_t len) unsigned menu_type = 0; const char *path = NULL; const char *label = NULL; - enum msg_hash_enums enum_idx = MSG_UNKNOWN; const file_list_t *list = menu_entries_list ? menu_list_get(menu_entries_list, 0) : NULL; menu_file_list_cbs_t *cbs = list @@ -892,7 +890,7 @@ int menu_entries_get_title(char *s, size_t len) if (!cbs) return -1; - menu_entries_get_last_stack(&path, &label, &menu_type, &enum_idx, NULL); + menu_entries_get_last_stack(&path, &label, &menu_type, NULL, NULL); if (cbs && cbs->action_get_title) {