From 4c41cadf22f0894b0f9144cb0d41196333f792a6 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 4 Sep 2015 16:55:26 +0200 Subject: [PATCH] Have menu_common_load_content return int --- menu/cbs/menu_cbs_ok.c | 23 ++++++----------------- menu/menu.c | 6 +++--- menu/menu.h | 2 +- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index b2832610e4..3b9b2f3de3 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -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); diff --git a/menu/menu.c b/menu/menu.c index 2ffc1dc6bf..33705a92d0 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -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; } /** diff --git a/menu/menu.h b/menu/menu.h index dfefa79044..f0ee90901b 100644 --- a/menu/menu.h +++ b/menu/menu.h @@ -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);