From 33f947e18d8f89465cdfa54b19892121e976645c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 2 Sep 2015 18:38:45 +0200 Subject: [PATCH] (menu_cbs_ok.c) Cleanups --- menu/cbs/menu_cbs_ok.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 53015ec666..8509fe4668 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -291,8 +291,9 @@ static int action_ok_shader_pass_load(const char *path, const char *menu_path = NULL; menu_handle_t *menu = menu_driver_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); + if (!menu || !menu_list) - return -1; + goto error; (void)menu_path; (void)menu_list; @@ -310,9 +311,10 @@ static int action_ok_shader_pass_load(const char *path, menu_list_flush_stack(menu_list, menu_hash_to_str(MENU_LABEL_SHADER_OPTIONS), 0); return 0; -#else - return -1; #endif + +error: + return -1; } #ifdef HAVE_SHADER_MANAGER @@ -815,7 +817,7 @@ static int action_ok_shader_preset_load(const char *path, menu_handle_t *menu = menu_driver_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); if (!menu || !menu_list) - return -1; + goto error; (void)shader_path; (void)menu_path; @@ -832,9 +834,10 @@ static int action_ok_shader_preset_load(const char *path, menu_list_flush_stack(menu_list, menu_hash_to_str(MENU_LABEL_SHADER_OPTIONS), 0); return 0; -#else - return -1; #endif + +error: + return -1; } static int action_ok_cheat(const char *path, @@ -1648,14 +1651,13 @@ static int action_ok_file_load_or_resume(const char *path, if (!strcmp(menu->deferred_path, global->path.fullpath)) return generic_action_ok_command(EVENT_CMD_RESUME); - else - { - strlcpy(global->path.fullpath, - menu->deferred_path, sizeof(global->path.fullpath)); - event_command(EVENT_CMD_LOAD_CORE); - rarch_main_set_state(RARCH_ACTION_STATE_LOAD_CONTENT); - return -1; - } + + strlcpy(global->path.fullpath, + menu->deferred_path, sizeof(global->path.fullpath)); + event_command(EVENT_CMD_LOAD_CORE); + rarch_main_set_state(RARCH_ACTION_STATE_LOAD_CONTENT); + + return -1; } static int action_ok_shader_apply_changes(const char *path,