mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-23 21:21:19 +00:00
(menu) Get rid of name_hash
This commit is contained in:
parent
78406bef69
commit
366a1d58f8
@ -821,22 +821,19 @@ int menu_action_handle_setting(rarch_setting_t *setting,
|
||||
static rarch_setting_t *menu_setting_find_internal(rarch_setting_t *setting,
|
||||
const char *label)
|
||||
{
|
||||
uint32_t needle = msg_hash_calculate(label);
|
||||
rarch_setting_t **list = &setting;
|
||||
|
||||
for (; setting_get_type(setting) != ST_NONE; (*list = *list + 1))
|
||||
{
|
||||
if ( (needle == setting->name_hash)
|
||||
&& (setting_get_type(setting) <= ST_GROUP))
|
||||
{
|
||||
const char *name = setting->name;
|
||||
const char *short_description = setting->short_description;
|
||||
/* make sure this isn't a collision */
|
||||
if (!string_is_equal(label, name))
|
||||
continue;
|
||||
const char *name = setting->name;
|
||||
const char *short_description = setting->short_description;
|
||||
|
||||
if (
|
||||
string_is_equal(label, name) &&
|
||||
(setting_get_type(setting) <= ST_GROUP))
|
||||
{
|
||||
if (string_is_empty(short_description))
|
||||
return NULL;
|
||||
break;
|
||||
|
||||
if (setting->read_handler)
|
||||
setting->read_handler(setting);
|
||||
@ -7811,7 +7808,6 @@ static void menu_setting_terminate_last(rarch_setting_t *list, unsigned pos)
|
||||
(*&list)[pos].type = ST_NONE;
|
||||
(*&list)[pos].size = 0;
|
||||
(*&list)[pos].name = NULL;
|
||||
(*&list)[pos].name_hash = 0;
|
||||
(*&list)[pos].short_description = NULL;
|
||||
(*&list)[pos].group = NULL;
|
||||
(*&list)[pos].subgroup = NULL;
|
||||
|
@ -618,7 +618,6 @@ static rarch_setting_t setting_action_setting(const char* name,
|
||||
result.size = 0;
|
||||
|
||||
result.name = name;
|
||||
result.name_hash = 0;
|
||||
result.short_description = short_description;
|
||||
result.group = group;
|
||||
result.subgroup = subgroup;
|
||||
@ -681,7 +680,6 @@ static rarch_setting_t setting_group_setting(enum setting_type type, const char*
|
||||
result.size = 0;
|
||||
|
||||
result.name = name;
|
||||
result.name_hash = 0;
|
||||
result.short_description = name;
|
||||
result.group = NULL;
|
||||
result.subgroup = NULL;
|
||||
@ -755,7 +753,6 @@ static rarch_setting_t setting_float_setting(const char* name,
|
||||
result.size = sizeof(float);
|
||||
|
||||
result.name = name;
|
||||
result.name_hash = 0;
|
||||
result.short_description = short_description;
|
||||
result.group = group;
|
||||
result.subgroup = subgroup;
|
||||
@ -832,7 +829,6 @@ static rarch_setting_t setting_uint_setting(const char* name,
|
||||
result.size = sizeof(unsigned int);
|
||||
|
||||
result.name = name;
|
||||
result.name_hash = 0;
|
||||
result.short_description = short_description;
|
||||
result.group = group;
|
||||
result.subgroup = subgroup;
|
||||
@ -909,7 +905,6 @@ static rarch_setting_t setting_hex_setting(const char* name,
|
||||
result.size = sizeof(unsigned int);
|
||||
|
||||
result.name = name;
|
||||
result.name_hash = 0;
|
||||
result.short_description = short_description;
|
||||
result.group = group;
|
||||
result.subgroup = subgroup;
|
||||
@ -987,7 +982,6 @@ static rarch_setting_t setting_bind_setting(const char* name,
|
||||
result.size = 0;
|
||||
|
||||
result.name = name;
|
||||
result.name_hash = 0;
|
||||
result.short_description = short_description;
|
||||
result.group = group;
|
||||
result.subgroup = subgroup;
|
||||
@ -1147,7 +1141,6 @@ static rarch_setting_t setting_string_setting(enum setting_type type,
|
||||
result.size = size;
|
||||
|
||||
result.name = name;
|
||||
result.name_hash = 0;
|
||||
result.short_description = short_description;
|
||||
result.group = group;
|
||||
result.subgroup = subgroup;
|
||||
@ -1269,7 +1262,6 @@ static rarch_setting_t setting_subgroup_setting(enum setting_type type,
|
||||
result.size = 0;
|
||||
|
||||
result.name = name;
|
||||
result.name_hash = 0;
|
||||
result.short_description = name;
|
||||
result.group = parent_name;
|
||||
result.parent_group = parent_group;
|
||||
@ -1344,7 +1336,6 @@ static rarch_setting_t setting_bool_setting(const char* name,
|
||||
result.size = sizeof(bool);
|
||||
|
||||
result.name = name;
|
||||
result.name_hash = name ? msg_hash_calculate(name) : 0;
|
||||
result.short_description = short_description;
|
||||
result.group = group;
|
||||
result.subgroup = subgroup;
|
||||
@ -1423,7 +1414,6 @@ static rarch_setting_t setting_int_setting(const char* name,
|
||||
result.size = sizeof(int);
|
||||
|
||||
result.name = name;
|
||||
result.name_hash = name ? msg_hash_calculate(name) : 0;
|
||||
result.short_description = short_description;
|
||||
result.group = group;
|
||||
result.subgroup = subgroup;
|
||||
@ -1493,8 +1483,6 @@ bool CONFIG_BOOL_ALT(
|
||||
|
||||
if (!settings_list_append(list, list_info))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
if (flags != SD_FLAG_NONE)
|
||||
settings_data_list_current_add_flags(list, list_info, flags);
|
||||
@ -1529,8 +1517,6 @@ bool CONFIG_BOOL(
|
||||
|
||||
if (!settings_list_append(list, list_info))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
if (flags != SD_FLAG_NONE)
|
||||
settings_data_list_current_add_flags(list, list_info, flags);
|
||||
@ -1564,8 +1550,6 @@ bool CONFIG_INT(
|
||||
false);
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@ -1593,8 +1577,6 @@ bool CONFIG_UINT_ALT(
|
||||
true);
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
return true;
|
||||
}
|
||||
@ -1621,8 +1603,6 @@ bool CONFIG_UINT(
|
||||
false);
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@ -1651,8 +1631,6 @@ bool CONFIG_FLOAT(
|
||||
false);
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@ -1684,8 +1662,6 @@ bool CONFIG_PATH(
|
||||
false);
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_EMPTY);
|
||||
#ifdef HAVE_MENU
|
||||
@ -1718,8 +1694,6 @@ bool CONFIG_DIR(
|
||||
false);
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
settings_data_list_current_add_flags(
|
||||
list,
|
||||
@ -1753,8 +1727,6 @@ bool CONFIG_STRING(
|
||||
change_handler, read_handler, false);
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
#ifdef HAVE_MENU
|
||||
menu_settings_list_current_add_enum_idx(list, list_info, name_enum_idx);
|
||||
@ -1784,8 +1756,6 @@ bool CONFIG_STRING_OPTIONS(
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@ -1818,8 +1788,6 @@ bool CONFIG_HEX(
|
||||
change_handler, read_handler, false);
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@ -1849,8 +1817,6 @@ bool CONFIG_BIND(
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
/* Request name and short description to be freed later */
|
||||
settings_data_list_current_add_free_flags(list, list_info, SD_FREE_FLAG_NAME | SD_FREE_FLAG_SHORT);
|
||||
@ -1876,8 +1842,6 @@ bool CONFIG_BIND_ALT(
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
/* Request name and short description to be freed later */
|
||||
settings_data_list_current_add_free_flags(list, list_info, SD_FREE_FLAG_NAME | SD_FREE_FLAG_SHORT);
|
||||
@ -1899,8 +1863,6 @@ bool CONFIG_ACTION_ALT(
|
||||
|
||||
if (!settings_list_append(list, list_info))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
return true;
|
||||
}
|
||||
@ -1923,8 +1885,6 @@ bool CONFIG_ACTION(
|
||||
|
||||
if (!settings_list_append(list, list_info))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@ -1944,8 +1904,6 @@ bool START_GROUP(rarch_setting_t **list, rarch_setting_info_t *list_info,
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
return true;
|
||||
}
|
||||
@ -1956,8 +1914,6 @@ bool END_GROUP(rarch_setting_t **list, rarch_setting_info_t *list_info,
|
||||
rarch_setting_t value = setting_group_setting (ST_END_GROUP, 0, parent_group);
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
return true;
|
||||
}
|
||||
@ -1975,8 +1931,6 @@ bool START_SUB_GROUP(rarch_setting_t **list,
|
||||
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
return true;
|
||||
}
|
||||
@ -1989,8 +1943,6 @@ bool END_SUB_GROUP(
|
||||
rarch_setting_t value = setting_group_setting (ST_END_SUB_GROUP, 0, parent_group);
|
||||
if (!(settings_list_append(list, list_info)))
|
||||
return false;
|
||||
if (value.name)
|
||||
value.name_hash = msg_hash_calculate(value.name);
|
||||
(*list)[list_info->index++] = value;
|
||||
return true;
|
||||
}
|
||||
|
@ -104,7 +104,6 @@ struct rarch_setting
|
||||
|
||||
unsigned bind_type;
|
||||
uint32_t size;
|
||||
uint32_t name_hash;
|
||||
|
||||
float step;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user