From 66a116deca70fb0b44c841d8f5b47ea993340085 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 16 Jun 2016 00:29:14 +0200 Subject: [PATCH] Use menu_hash_to_str_enum --- menu/cbs/menu_cbs_title.c | 46 +++++++++++++++++++-------------------- menu/menu_entries.c | 2 +- menu/menu_input.c | 8 +++---- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/menu/cbs/menu_cbs_title.c b/menu/cbs/menu_cbs_title.c index deefe73d2a..57493eda64 100644 --- a/menu/cbs/menu_cbs_title.c +++ b/menu/cbs/menu_cbs_title.c @@ -330,161 +330,161 @@ static int action_get_core_information_list(const char *path, const char *label, static int action_get_core_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_CORE_LIST), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_CORE_LIST), len); return 0; } static int action_get_online_updater_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_ONLINE_UPDATER), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER), len); return 0; } static int action_get_online_thumbnails_updater_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_THUMBNAILS_UPDATER_LIST), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_THUMBNAILS_UPDATER_LIST), len); return 0; } static int action_get_core_updater_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_CORE_UPDATER_LIST), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_LIST), len); return 0; } static int action_get_add_content_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_ADD_CONTENT_LIST), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_ADD_CONTENT_LIST), len); return 0; } static int action_get_core_options_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_CORE_OPTIONS), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_CORE_OPTIONS), len); return 0; } static int action_get_load_recent_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_LOAD_CONTENT_HISTORY), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_HISTORY), len); return 0; } static int action_get_quick_menu_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_CONTENT_SETTINGS), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_CONTENT_SETTINGS), len); return 0; } static int action_get_input_remapping_options_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_CORE_INPUT_REMAPPING_OPTIONS), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_CORE_INPUT_REMAPPING_OPTIONS), len); return 0; } static int action_get_shader_options_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_SHADER_OPTIONS), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_SHADER_OPTIONS), len); return 0; } static int action_get_disk_options_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_DISK_OPTIONS), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_DISK_OPTIONS), len); return 0; } static int action_get_frontend_counters_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_FRONTEND_COUNTERS), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_FRONTEND_COUNTERS), len); return 0; } static int action_get_core_counters_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_CORE_COUNTERS), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_CORE_COUNTERS), len); return 0; } static int action_get_playlist_settings_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_PLAYLIST_SETTINGS), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_PLAYLIST_SETTINGS), len); return 0; } static int action_get_input_hotkey_binds_settings_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_INPUT_HOTKEY_BINDS), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_INPUT_HOTKEY_BINDS), len); return 0; } static int action_get_input_settings_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_INPUT_SETTINGS), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_INPUT_SETTINGS), len); return 0; } static int action_get_core_cheat_options_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_CORE_CHEAT_OPTIONS), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_CORE_CHEAT_OPTIONS), len); return 0; } static int action_get_load_content_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_LOAD_CONTENT_LIST), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST), len); return 0; } static int action_get_cursor_manager_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_CURSOR_MANAGER), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_CURSOR_MANAGER), len); return 0; } static int action_get_database_manager_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_DATABASE_MANAGER), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_DATABASE_MANAGER), len); return 0; } static int action_get_system_information_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_SYSTEM_INFORMATION), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_SYSTEM_INFORMATION), len); return 0; } static int action_get_network_information_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_NETWORK_INFORMATION), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_NETWORK_INFORMATION), len); return 0; } static int action_get_settings_list(const char *path, const char *label, unsigned menu_type, char *s, size_t len) { - sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_SETTINGS), len); + sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_SETTINGS), len); return 0; } diff --git a/menu/menu_entries.c b/menu/menu_entries.c index 1f52edd5f2..5f47f200ad 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -456,7 +456,7 @@ int menu_entries_get_core_title(char *s, size_t len) if (string_is_empty(core_name) && info) core_name = info->info.library_name; if (string_is_empty(core_name)) - core_name = menu_hash_to_str(MENU_VALUE_NO_CORE); + core_name = menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_NO_CORE); if (!core_version && info) core_version = info->info.library_version; diff --git a/menu/menu_input.c b/menu/menu_input.c index 30abcaadfd..83cb74803a 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -281,7 +281,7 @@ static int menu_input_key_bind_set_mode_common( info.type = MENU_SETTINGS_CUSTOM_BIND_KEYBOARD; info.directory_ptr = selection; strlcpy(info.label, - menu_hash_to_str(MENU_LABEL_CUSTOM_BIND), sizeof(info.label)); + menu_hash_to_str_enum(MENU_ENUM_LABEL_CUSTOM_BIND), sizeof(info.label)); if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info)) menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info); @@ -296,7 +296,7 @@ static int menu_input_key_bind_set_mode_common( info.type = MENU_SETTINGS_CUSTOM_BIND_KEYBOARD; info.directory_ptr = selection; strlcpy(info.label, - menu_hash_to_str(MENU_LABEL_CUSTOM_BIND_ALL), + menu_hash_to_str_enum(MENU_ENUM_LABEL_CUSTOM_BIND_ALL), sizeof(info.label)); if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info)) @@ -561,7 +561,7 @@ static bool menu_input_key_bind_iterate(char *s, size_t len) input_config_bind_map_get_desc( menu_input->binds.begin - MENU_SETTINGS_BIND_BEGIN), timeout, - menu_hash_to_str(MENU_VALUE_SECONDS)); + menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_SECONDS)); /* binds.begin is updated in keyboard_press callback. */ if (menu_input->binds.begin > menu_input->binds.last) @@ -658,7 +658,7 @@ bool menu_input_ctl(enum menu_input_ctl_state state, void *data) return false; menu_input->keyboard.display = true; - menu_input_keyboard_label = menu_hash_to_str(MENU_VALUE_SEARCH); + menu_input_keyboard_label = menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_SEARCH); menu_input_keyboard_buffer = input_keyboard_start_line(menu, menu_input_search_cb); }