Use menu_hash_to_str_enum

This commit is contained in:
twinaphex 2016-06-15 23:39:20 +02:00
parent db679a85f3
commit e92d240f08
6 changed files with 36 additions and 36 deletions

View File

@ -578,12 +578,12 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
menu_file_list_cbs_t *cbs, menu_file_list_cbs_t *cbs,
const char *label, uint32_t label_hash) const char *label, uint32_t label_hash)
{ {
if (strstr(label, menu_hash_to_str(MENU_LABEL_DEFERRED_RDB_ENTRY_DETAIL))) if (strstr(label, menu_hash_to_str_enum(MENU_ENUM_LABEL_DEFERRED_RDB_ENTRY_DETAIL)))
{ {
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_rdb_entry_detail); BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_rdb_entry_detail);
} }
else if (strstr(label, else if (strstr(label,
menu_hash_to_str(MENU_LABEL_DEFERRED_RPL_ENTRY_ACTIONS))) menu_hash_to_str_enum(MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS)))
{ {
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_rpl_entry_actions); BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_rpl_entry_actions);
} }

View File

@ -96,7 +96,7 @@ static void menu_action_setting_disp_set_label_configurations(
fill_pathname_base(s, global->path.config, fill_pathname_base(s, global->path.config,
len); len);
else else
strlcpy(s, menu_hash_to_str(MENU_VALUE_DIRECTORY_DEFAULT), len); strlcpy(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_DIRECTORY_DEFAULT), len);
} }
static void menu_action_setting_disp_set_label_shader_filter_pass( static void menu_action_setting_disp_set_label_shader_filter_pass(
@ -130,15 +130,15 @@ static void menu_action_setting_disp_set_label_shader_filter_pass(
switch (shader->pass[pass].filter) switch (shader->pass[pass].filter)
{ {
case 0: case 0:
strlcpy(s, menu_hash_to_str(MENU_VALUE_DONT_CARE), strlcpy(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_DONT_CARE),
len); len);
break; break;
case 1: case 1:
strlcpy(s, menu_hash_to_str(MENU_VALUE_LINEAR), strlcpy(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_LINEAR),
len); len);
break; break;
case 2: case 2:
strlcpy(s, menu_hash_to_str(MENU_VALUE_NEAREST), strlcpy(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_NEAREST),
len); len);
break; break;
} }
@ -159,7 +159,7 @@ static void menu_action_setting_disp_set_label_filter(
*s = '\0'; *s = '\0';
*w = 19; *w = 19;
strlcpy(s2, path, len2); strlcpy(s2, path, len2);
strlcpy(s, menu_hash_to_str(MENU_VALUE_NOT_AVAILABLE), len); strlcpy(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), len);
if (settings && *settings->path.softfilter_plugin) if (settings && *settings->path.softfilter_plugin)
fill_short_pathname_representation(s, fill_short_pathname_representation(s,
@ -240,7 +240,7 @@ static void menu_action_setting_disp_set_label_shader_pass(
*s = '\0'; *s = '\0';
*w = 19; *w = 19;
strlcpy(s2, path, len2); strlcpy(s2, path, len2);
strlcpy(s, menu_hash_to_str(MENU_VALUE_NOT_AVAILABLE), len); strlcpy(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), len);
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL) #if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
menu_driver_ctl(RARCH_MENU_CTL_SHADER_GET, menu_driver_ctl(RARCH_MENU_CTL_SHADER_GET,
@ -273,9 +273,9 @@ static void menu_action_setting_disp_set_label_shader_default_filter(
return; return;
if (settings->video.smooth) if (settings->video.smooth)
strlcpy(s, menu_hash_to_str(MENU_VALUE_LINEAR), len); strlcpy(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_LINEAR), len);
else else
strlcpy(s, menu_hash_to_str(MENU_VALUE_NEAREST), len); strlcpy(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_NEAREST), len);
} }
static void menu_action_setting_disp_set_label_shader_parameter( static void menu_action_setting_disp_set_label_shader_parameter(
@ -377,7 +377,7 @@ static void menu_action_setting_disp_set_label_shader_scale_pass(
scale_value = shader->pass[pass].fbo.scale_x; scale_value = shader->pass[pass].fbo.scale_x;
if (!scale_value) if (!scale_value)
strlcpy(s, menu_hash_to_str(MENU_VALUE_DONT_CARE), len); strlcpy(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_DONT_CARE), len);
else else
snprintf(s, len, "%ux", scale_value); snprintf(s, len, "%ux", scale_value);
#endif #endif
@ -475,10 +475,10 @@ static void menu_action_setting_disp_set_label_cheat(
snprintf(s, len, "%s : (%s)", snprintf(s, len, "%s : (%s)",
(cheat_manager_get_code(cheat_index) != NULL) (cheat_manager_get_code(cheat_index) != NULL)
? cheat_manager_get_code(cheat_index) : ? cheat_manager_get_code(cheat_index) :
menu_hash_to_str(MENU_VALUE_NOT_AVAILABLE), menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE),
cheat_manager_get_code_state(cheat_index) ? cheat_manager_get_code_state(cheat_index) ?
menu_hash_to_str(MENU_VALUE_ON) : menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_ON) :
menu_hash_to_str(MENU_VALUE_OFF) menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_OFF)
); );
*w = 19; *w = 19;
strlcpy(s2, path, len2); strlcpy(s2, path, len2);
@ -800,7 +800,7 @@ static void menu_action_setting_disp_set_label_menu_disk_index(
current = control->get_image_index(); current = control->get_image_index();
if (current >= images) if (current >= images)
strlcpy(s, menu_hash_to_str(MENU_VALUE_NO_DISK), len); strlcpy(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_NO_DISK), len);
else else
snprintf(s, len, "%u", current + 1); snprintf(s, len, "%u", current + 1);
} }
@ -868,7 +868,7 @@ static void menu_action_setting_disp_set_label_menu_video_resolution(
snprintf(s, len, "%ux%u", width, height); snprintf(s, len, "%ux%u", width, height);
} }
else else
strlcpy(s, menu_hash_to_str(MENU_VALUE_NOT_AVAILABLE), len); strlcpy(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), len);
} }
static void menu_action_setting_generic_disp_set_label( static void menu_action_setting_generic_disp_set_label(

View File

@ -38,7 +38,7 @@ static int action_info_default(unsigned type, const char *label)
info.list = menu_stack; info.list = menu_stack;
info.directory_ptr = selection; info.directory_ptr = selection;
strlcpy(info.label, strlcpy(info.label,
menu_hash_to_str(MENU_LABEL_INFO_SCREEN), menu_hash_to_str_enum(MENU_ENUM_LABEL_INFO_SCREEN),
sizeof(info.label)); sizeof(info.label));
if (!menu_displaylist_ctl(DISPLAYLIST_HELP, &info)) if (!menu_displaylist_ctl(DISPLAYLIST_HELP, &info))

View File

@ -249,7 +249,7 @@ static int action_left_shader_filter_default(unsigned type, const char *label,
bool wraparound) bool wraparound)
{ {
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
rarch_setting_t *setting = menu_setting_find(menu_hash_to_str(MENU_LABEL_VIDEO_SMOOTH)); rarch_setting_t *setting = menu_setting_find(menu_hash_to_str_enum(MENU_ENUM_LABEL_VIDEO_SMOOTH));
if (!setting) if (!setting)
return menu_cbs_exit(); return menu_cbs_exit();
return menu_action_handle_setting(setting, return menu_action_handle_setting(setting,

View File

@ -273,7 +273,7 @@ static int action_right_shader_filter_default(unsigned type, const char *label,
bool wraparound) bool wraparound)
{ {
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
rarch_setting_t *setting = menu_setting_find(menu_hash_to_str(MENU_LABEL_VIDEO_SMOOTH)); rarch_setting_t *setting = menu_setting_find(menu_hash_to_str_enum(MENU_ENUM_LABEL_VIDEO_SMOOTH));
if (!setting) if (!setting)
return menu_cbs_exit(); return menu_cbs_exit();
return menu_action_handle_setting(setting, menu_setting_get_type(setting), MENU_ACTION_RIGHT, return menu_action_handle_setting(setting, menu_setting_get_type(setting), MENU_ACTION_RIGHT,

View File

@ -74,7 +74,7 @@ static int action_get_title_remap_file_load(const char *path, const char *label,
static int action_get_title_help(const char *path, const char *label, static int action_get_title_help(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
strlcpy(s, menu_hash_to_str(MENU_LABEL_VALUE_HELP_LIST), len); strlcpy(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_HELP_LIST), len);
return 0; return 0;
} }
@ -87,7 +87,7 @@ static int action_get_title_overlay(const char *path, const char *label,
static int action_get_title_video_filter(const char *path, const char *label, static int action_get_title_video_filter(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
return fill_title(s, menu_hash_to_str(MENU_LABEL_VALUE_VIDEO_FILTER), path, len); return fill_title(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER), path, len);
} }
static int action_get_title_cheat_directory(const char *path, const char *label, static int action_get_title_cheat_directory(const char *path, const char *label,
@ -99,19 +99,19 @@ static int action_get_title_cheat_directory(const char *path, const char *label,
static int action_get_title_core_directory(const char *path, const char *label, static int action_get_title_core_directory(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
return fill_title(s, menu_hash_to_str(MENU_LABEL_VALUE_LIBRETRO_DIR_PATH), path, len); return fill_title(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_LIBRETRO_DIR_PATH), path, len);
} }
static int action_get_title_core_info_directory(const char *path, const char *label, static int action_get_title_core_info_directory(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
return fill_title(s, menu_hash_to_str(MENU_LABEL_VALUE_LIBRETRO_INFO_PATH), path, len); return fill_title(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_LIBRETRO_INFO_PATH), path, len);
} }
static int action_get_title_audio_filter(const char *path, const char *label, static int action_get_title_audio_filter(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
return fill_title(s, menu_hash_to_str(MENU_LABEL_VALUE_AUDIO_FILTER_DIR), path, len); return fill_title(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_AUDIO_FILTER_DIR), path, len);
} }
static int action_get_title_font_path(const char *path, const char *label, static int action_get_title_font_path(const char *path, const char *label,
@ -302,28 +302,28 @@ static int action_get_title_group_settings(const char *path, const char *label,
static int action_get_user_accounts_cheevos_list(const char *path, const char *label, static int action_get_user_accounts_cheevos_list(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_ACCOUNTS_RETRO_ACHIEVEMENTS), len); sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_ACCOUNTS_RETRO_ACHIEVEMENTS), len);
return 0; return 0;
} }
static int action_get_download_core_content_list(const char *path, const char *label, static int action_get_download_core_content_list(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_DOWNLOAD_CORE_CONTENT), len); sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_DOWNLOAD_CORE_CONTENT), len);
return 0; return 0;
} }
static int action_get_user_accounts_list(const char *path, const char *label, static int action_get_user_accounts_list(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_ACCOUNTS_LIST), len); sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_ACCOUNTS_LIST), len);
return 0; return 0;
} }
static int action_get_core_information_list(const char *path, const char *label, static int action_get_core_information_list(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_CORE_INFORMATION), len); sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_CORE_INFORMATION), len);
return 0; return 0;
} }
@ -491,7 +491,7 @@ static int action_get_settings_list(const char *path, const char *label,
static int action_get_title_information_list(const char *path, const char *label, static int action_get_title_information_list(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
sanitize_to_string(s, menu_hash_to_str(MENU_LABEL_VALUE_INFORMATION_LIST), len); sanitize_to_string(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_INFORMATION_LIST), len);
return 0; return 0;
} }
@ -601,31 +601,31 @@ static int action_get_title_recording_output_directory(const char *path, const c
static int action_get_title_video_shader_directory(const char *path, const char *label, static int action_get_title_video_shader_directory(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
return fill_title(s, menu_hash_to_str(MENU_LABEL_VALUE_VIDEO_SHADER_DIR), path, len); return fill_title(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_DIR), path, len);
} }
static int action_get_title_audio_filter_directory(const char *path, const char *label, static int action_get_title_audio_filter_directory(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
return fill_title(s, menu_hash_to_str(MENU_LABEL_VALUE_AUDIO_FILTER_DIR), path, len); return fill_title(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_AUDIO_FILTER_DIR), path, len);
} }
static int action_get_title_video_filter_directory(const char *path, const char *label, static int action_get_title_video_filter_directory(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
return fill_title(s, menu_hash_to_str(MENU_LABEL_VALUE_VIDEO_FILTER_DIR), path, len); return fill_title(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER_DIR), path, len);
} }
static int action_get_title_savefile_directory(const char *path, const char *label, static int action_get_title_savefile_directory(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
return fill_title(s, menu_hash_to_str(MENU_LABEL_VALUE_SAVEFILE_DIRECTORY), path, len); return fill_title(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_SAVEFILE_DIRECTORY), path, len);
} }
static int action_get_title_overlay_directory(const char *path, const char *label, static int action_get_title_overlay_directory(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
return fill_title(s, menu_hash_to_str(MENU_LABEL_VALUE_OVERLAY_DIRECTORY), path, len); return fill_title(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_OVERLAY_DIRECTORY), path, len);
} }
static int action_get_title_system_directory(const char *path, const char *label, static int action_get_title_system_directory(const char *path, const char *label,
@ -637,13 +637,13 @@ static int action_get_title_system_directory(const char *path, const char *label
static int action_get_title_assets_directory(const char *path, const char *label, static int action_get_title_assets_directory(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
return fill_title(s, menu_hash_to_str(MENU_LABEL_VALUE_ASSETS_DIRECTORY), path, len); return fill_title(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_ASSETS_DIRECTORY), path, len);
} }
static int action_get_title_extraction_directory(const char *path, const char *label, static int action_get_title_extraction_directory(const char *path, const char *label,
unsigned menu_type, char *s, size_t len) unsigned menu_type, char *s, size_t len)
{ {
return fill_title(s, menu_hash_to_str(MENU_LABEL_VALUE_CACHE_DIRECTORY), path, len); return fill_title(s, menu_hash_to_str_enum(MENU_ENUM_LABEL_VALUE_CACHE_DIRECTORY), path, len);
} }
static int action_get_title_menu(const char *path, const char *label, static int action_get_title_menu(const char *path, const char *label,