Skip to content

Commit

Permalink
Use a better name than just i.
Browse files Browse the repository at this point in the history
  • Loading branch information
XerTheSquirrel committed Dec 23, 2023
1 parent b6ee6d9 commit b150feb
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions menu/menu_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -9021,7 +9021,7 @@ static bool setting_append_list_input_player_options(
*/
static char buffer[MAX_USERS][13+2+1];
static char group_label[MAX_USERS][255];
unsigned i, j;
unsigned bindIndex, j;
rarch_setting_group_info_t group_info;
rarch_setting_group_info_t subgroup_info;
settings_t *settings = config_get_ptr();
Expand Down Expand Up @@ -9260,12 +9260,12 @@ static bool setting_append_list_input_player_options(
char name[NAME_MAX_LENGTH];
bool isExtraKey = (j >= RARCH_BIND_ID_EXTRA_BUTTON_START && j < RARCH_BIND_ID_EXTRA_BUTTON_END);
size_t _len = 0;
i = (j < RARCH_ANALOG_BIND_LIST_END)

bindIndex = (j < RARCH_ANALOG_BIND_LIST_END)
? input_config_bind_order[j]
: j;

if (!isExtraKey && input_config_bind_map_get_meta(i))
if (!isExtraKey && input_config_bind_map_get_meta(bindIndex))
continue;

name[0] = '\0';
Expand All @@ -9281,19 +9281,19 @@ static bool setting_append_list_input_player_options(

if (
settings->bools.input_descriptor_label_show
&& (i < RARCH_FIRST_META_KEY)
&& (bindIndex < RARCH_FIRST_META_KEY)
&& core_has_set_input_descriptor()
&& (i != RARCH_TURBO_ENABLE)
&& (bindIndex != RARCH_TURBO_ENABLE)
)
{
if (sys_info->input_desc_btn[user][i])
if (sys_info->input_desc_btn[user][bindIndex])
strlcpy(label + _len,
sys_info->input_desc_btn[user][i],
sys_info->input_desc_btn[user][bindIndex],
sizeof(label) - _len);
else
{
snprintf(label, sizeof(label), "%s (%s)",
input_config_bind_map_get_desc(i),
input_config_bind_map_get_desc(bindIndex),
value_na);

if (settings->bools.input_descriptor_hide_unbound)
Expand All @@ -9302,23 +9302,23 @@ static bool setting_append_list_input_player_options(
}
else
strlcpy(label + _len,
input_config_bind_map_get_desc(i),
input_config_bind_map_get_desc(bindIndex),
sizeof(label) - _len);

snprintf(name, sizeof(name), "p%u_%s", user + 1, input_config_bind_map_get_base(i));
snprintf(name, sizeof(name), "p%u_%s", user + 1, input_config_bind_map_get_base(bindIndex));

CONFIG_BIND_ALT(
list, list_info,
&input_config_binds[user][i],
&input_config_binds[user][bindIndex],
user + 1,
user,
strdup(name),
strdup(label),
&defaults[i],
&defaults[bindIndex],
&group_info,
&subgroup_info,
parent_group);
(*list)[list_info->index - 1].bind_type = i + MENU_SETTINGS_BIND_BEGIN;
(*list)[list_info->index - 1].bind_type = bindIndex + MENU_SETTINGS_BIND_BEGIN;
}
}

Expand Down

0 comments on commit b150feb

Please sign in to comment.