menu_entries_get_last_stack - don't pass enum_idx to it if we

aren't going to use it
This commit is contained in:
twinaphex 2019-05-18 19:25:35 +02:00
parent 6af0b8c693
commit 59c502d0f4
6 changed files with 12 additions and 24 deletions

View File

@ -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:

View File

@ -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);
}

View File

@ -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));

View File

@ -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';

View File

@ -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,

View File

@ -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)
{