From 5de30567a1b8c81efff5e12d7ab7224e2cecefcb Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Wed, 10 May 2023 07:28:14 +0200 Subject: [PATCH] Get rid of MENU_ENTRIES_CTL_SETTINGS_GET --- menu/menu_driver.c | 8 -------- menu/menu_entries.h | 1 - menu/menu_setting.c | 16 ++++++++++------ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/menu/menu_driver.c b/menu/menu_driver.c index c14f6194e8..d4f1cf50b0 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -4393,14 +4393,6 @@ bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data) { case MENU_ENTRIES_CTL_NEEDS_REFRESH: return MENU_ENTRIES_NEEDS_REFRESH(menu_st); - case MENU_ENTRIES_CTL_SETTINGS_GET: - { - rarch_setting_t **settings = (rarch_setting_t**)data; - if (!settings) - return false; - *settings = menu_st->entries.list_settings; - } - break; case MENU_ENTRIES_CTL_SET_REFRESH: { bool *nonblocking = (bool*)data; diff --git a/menu/menu_entries.h b/menu/menu_entries.h index 662e2ee60f..e753ebc1aa 100644 --- a/menu/menu_entries.h +++ b/menu/menu_entries.h @@ -38,7 +38,6 @@ RETRO_BEGIN_DECLS enum menu_entries_ctl_state { MENU_ENTRIES_CTL_NONE = 0, - MENU_ENTRIES_CTL_SETTINGS_GET, MENU_ENTRIES_CTL_SET_REFRESH, MENU_ENTRIES_CTL_UNSET_REFRESH, MENU_ENTRIES_CTL_NEEDS_REFRESH, diff --git a/menu/menu_setting.c b/menu/menu_setting.c index bfbc5f3678..26d9dbfa4b 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -7108,13 +7108,15 @@ int menu_action_handle_setting(rarch_setting_t *setting, **/ rarch_setting_t *menu_setting_find(const char *label) { - rarch_setting_t *setting = NULL; - rarch_setting_t **list = &setting; + rarch_setting_t *setting = NULL; + rarch_setting_t **list = &setting; + struct menu_state *menu_st; if (!label) return NULL; - menu_entries_ctl(MENU_ENTRIES_CTL_SETTINGS_GET, &setting); + menu_st = menu_state_get_ptr(); + setting = menu_st->entries.list_settings; if (!setting) return NULL; @@ -7143,13 +7145,15 @@ rarch_setting_t *menu_setting_find(const char *label) rarch_setting_t *menu_setting_find_enum(enum msg_hash_enums enum_idx) { - rarch_setting_t *setting = NULL; - rarch_setting_t **list = &setting; + rarch_setting_t *setting = NULL; + rarch_setting_t **list = &setting; + struct menu_state *menu_st = NULL; if (enum_idx == 0) return NULL; - menu_entries_ctl(MENU_ENTRIES_CTL_SETTINGS_GET, &setting); + menu_st = menu_state_get_ptr(); + setting = menu_st->entries.list_settings; if (!setting) return NULL;