From 05baa82fe3141f4174590ae790dcc828a73c6c3a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 22 Jan 2015 22:57:15 +0100 Subject: [PATCH] Refactor action_ok_load_state/action_ok_save_state --- menu/menu_entries_cbs.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/menu/menu_entries_cbs.c b/menu/menu_entries_cbs.c index 6e0b45c9b2..fde4dff45c 100644 --- a/menu/menu_entries_cbs.c +++ b/menu/menu_entries_cbs.c @@ -156,24 +156,6 @@ static void common_load_content(bool persist) } -static int action_ok_load_state(const char *path, - const char *label, unsigned type, size_t idx) -{ - rarch_main_command(RARCH_CMD_LOAD_STATE); - rarch_main_command(RARCH_CMD_RESUME); - - return 0; -} - - -static int action_ok_save_state(const char *path, - const char *label, unsigned type, size_t idx) -{ - rarch_main_command(RARCH_CMD_SAVE_STATE); - rarch_main_command(RARCH_CMD_RESUME); - - return 0; -} static int action_ok_playlist_entry(const char *path, @@ -829,6 +811,23 @@ static int generic_action_ok_command(unsigned cmd) return 0; } +static int action_ok_load_state(const char *path, + const char *label, unsigned type, size_t idx) +{ + if (generic_action_ok_command(RARCH_CMD_LOAD_STATE) == -1) + return -1; + return generic_action_ok_command(RARCH_CMD_RESUME); +} + + +static int action_ok_save_state(const char *path, + const char *label, unsigned type, size_t idx) +{ + if (generic_action_ok_command(RARCH_CMD_SAVE_STATE) == -1) + return -1; + return generic_action_ok_command(RARCH_CMD_RESUME); +} + static int action_ok_core_manager_list(const char *path, const char *label, unsigned type, size_t idx)