Have menu_common_load_content return int

This commit is contained in:
twinaphex 2015-09-04 16:55:26 +02:00
parent 47936965e6
commit 4c41cadf22
3 changed files with 10 additions and 21 deletions

View File

@ -422,9 +422,7 @@ static int rarch_defer_core_wrapper(size_t idx, size_t entry_idx, const char *pa
{
case -1:
event_command(EVENT_CMD_LOAD_CORE);
menu_common_load_content(false, CORE_TYPE_PLAIN);
ret = -1;
break;
return menu_common_load_content(false, CORE_TYPE_PLAIN);
case 0:
ret = generic_action_ok_displaylist_push(path,
NULL, 0, idx, entry_idx, ACTION_OK_DL_DEFERRED_CORE_LIST);
@ -463,9 +461,7 @@ static int action_ok_file_load_detect_core(const char *path,
strlcpy(global->path.fullpath, detect_content_path, sizeof(global->path.fullpath));
strlcpy(settings->libretro, path, sizeof(settings->libretro));
event_command(EVENT_CMD_LOAD_CORE);
menu_common_load_content(false, CORE_TYPE_PLAIN);
return -1;
return menu_common_load_content(false, CORE_TYPE_PLAIN);
}
@ -858,9 +854,7 @@ static int action_ok_core_load_deferred(const char *path,
strlcpy(global->path.fullpath, menu->deferred_path,
sizeof(global->path.fullpath));
menu_common_load_content(false, CORE_TYPE_PLAIN);
return -1;
return menu_common_load_content(false, CORE_TYPE_PLAIN);
}
static int action_ok_database_manager_list_deferred(const char *path,
@ -904,9 +898,7 @@ static int action_ok_core_load(const char *path,
if (menu->load_no_content && settings->core.set_supports_no_game_enable)
{
*global->path.fullpath = '\0';
menu_common_load_content(false, CORE_TYPE_PLAIN);
return -1;
return menu_common_load_content(false, CORE_TYPE_PLAIN);
}
/* Core selection on non-console just updates directory listing.
@ -1055,9 +1047,7 @@ static int action_ok_file_load(const char *path,
fill_pathname_join(global->path.fullpath, menu_path_new, path,
sizeof(global->path.fullpath));
menu_common_load_content(true, CORE_TYPE_PLAIN);
return -1;
return menu_common_load_content(true, CORE_TYPE_PLAIN);
}
return 0;
@ -1690,8 +1680,7 @@ static int action_ok_load_archive_detect_core(const char *path,
{
case -1:
event_command(EVENT_CMD_LOAD_CORE);
menu_common_load_content(false, CORE_TYPE_PLAIN);
break;
return menu_common_load_content(false, CORE_TYPE_PLAIN);
case 0:
ret = generic_action_ok_displaylist_push(path, label, type,
selected, entry_idx, ACTION_OK_DL_DEFERRED_CORE_LIST);

View File

@ -149,12 +149,10 @@ void menu_common_push_content_settings(void)
menu_displaylist_push_list(&info, DISPLAYLIST_CONTENT_SETTINGS);
}
void menu_common_load_content(bool persist, enum rarch_core_type type)
int menu_common_load_content(bool persist, enum rarch_core_type type)
{
menu_display_t *disp = menu_display_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu_list)
return;
switch (type)
{
@ -178,6 +176,8 @@ void menu_common_load_content(bool persist, enum rarch_core_type type)
disp->msg_force = true;
menu_common_push_content_settings();
return -1;
}
/**

View File

@ -195,7 +195,7 @@ void menu_free(menu_handle_t *menu);
**/
bool menu_load_content(enum rarch_core_type type);
void menu_common_load_content(bool persist, enum rarch_core_type type);
int menu_common_load_content(bool persist, enum rarch_core_type type);
void menu_common_push_content_settings(void);