mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
(Menu settings) Turn function static and some style nits
This commit is contained in:
parent
afc7f9ae12
commit
9ece732348
@ -567,7 +567,8 @@ void setting_get_string_representation_size_in_mb(rarch_setting_t *setting,
|
||||
(*setting->value.target.sizet)/(1024*1024));
|
||||
}
|
||||
|
||||
void setting_get_string_representation_uint_as_enum(rarch_setting_t *setting,
|
||||
static void setting_get_string_representation_uint_as_enum(
|
||||
rarch_setting_t *setting,
|
||||
char *s, size_t len)
|
||||
{
|
||||
if (setting)
|
||||
@ -604,7 +605,8 @@ static float recalc_step_based_on_length_of_action(rarch_setting_t *setting)
|
||||
return step < setting->step ? setting->step : step;
|
||||
}
|
||||
|
||||
int setting_uint_action_left_default(rarch_setting_t *setting, bool wraparound)
|
||||
int setting_uint_action_left_default(
|
||||
rarch_setting_t *setting, bool wraparound)
|
||||
{
|
||||
double min = 0.0f;
|
||||
bool overflowed = false;
|
||||
@ -618,11 +620,11 @@ int setting_uint_action_left_default(rarch_setting_t *setting, bool wraparound)
|
||||
(void)wraparound; /* TODO/FIXME - handle this */
|
||||
|
||||
step = recalc_step_based_on_length_of_action(setting);
|
||||
|
||||
overflowed = step > *setting->value.target.unsigned_integer;
|
||||
|
||||
if (!overflowed)
|
||||
*setting->value.target.unsigned_integer = *setting->value.target.unsigned_integer - step;
|
||||
*setting->value.target.unsigned_integer =
|
||||
*setting->value.target.unsigned_integer - step;
|
||||
|
||||
if (setting->enforce_minrange)
|
||||
{
|
||||
@ -642,7 +644,8 @@ int setting_uint_action_left_default(rarch_setting_t *setting, bool wraparound)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int setting_uint_action_right_default(rarch_setting_t *setting, bool wraparound)
|
||||
int setting_uint_action_right_default(
|
||||
rarch_setting_t *setting, bool wraparound)
|
||||
{
|
||||
double max = 0.0f;
|
||||
float step = 0.0f;
|
||||
@ -651,10 +654,8 @@ int setting_uint_action_right_default(rarch_setting_t *setting, bool wraparound)
|
||||
return -1;
|
||||
|
||||
max = setting->max;
|
||||
|
||||
(void)wraparound; /* TODO/FIXME - handle this */
|
||||
|
||||
step = recalc_step_based_on_length_of_action(setting) ;
|
||||
step =
|
||||
recalc_step_based_on_length_of_action(setting);
|
||||
|
||||
*setting->value.target.unsigned_integer =
|
||||
*setting->value.target.unsigned_integer + step;
|
||||
@ -677,7 +678,8 @@ int setting_uint_action_right_default(rarch_setting_t *setting, bool wraparound)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int setting_uint_action_right_with_refresh(rarch_setting_t *setting, bool wraparound)
|
||||
int setting_uint_action_right_with_refresh(
|
||||
rarch_setting_t *setting, bool wraparound)
|
||||
{
|
||||
int retval = setting_uint_action_right_default(setting, wraparound);
|
||||
bool refresh = false;
|
||||
@ -700,7 +702,8 @@ int setting_uint_action_left_with_refresh(rarch_setting_t *setting, bool wraparo
|
||||
|
||||
}
|
||||
|
||||
static int setting_size_action_left_default(rarch_setting_t *setting, bool wraparound)
|
||||
static int setting_size_action_left_default(
|
||||
rarch_setting_t *setting, bool wraparound)
|
||||
{
|
||||
double min = 0.0f;
|
||||
bool overflowed = false;
|
||||
@ -714,7 +717,6 @@ static int setting_size_action_left_default(rarch_setting_t *setting, bool wrapa
|
||||
(void)wraparound; /* TODO/FIXME - handle this */
|
||||
|
||||
step = recalc_step_based_on_length_of_action(setting);
|
||||
|
||||
overflowed = step > *setting->value.target.sizet;
|
||||
|
||||
if (!overflowed)
|
||||
@ -738,7 +740,8 @@ static int setting_size_action_left_default(rarch_setting_t *setting, bool wrapa
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int setting_size_action_right_default(rarch_setting_t *setting, bool wraparound)
|
||||
static int setting_size_action_right_default(
|
||||
rarch_setting_t *setting, bool wraparound)
|
||||
{
|
||||
double max = 0.0f;
|
||||
float step = 0.0f;
|
||||
@ -8004,7 +8007,8 @@ static bool setting_append_list(
|
||||
|
||||
config_uint_cbs(cheat_manager_state.working_cheat.handler, CHEAT_HANDLER,
|
||||
setting_uint_action_left_with_refresh,setting_uint_action_right_with_refresh,
|
||||
MENU_ENUM_LABEL_CHEAT_HANDLER_TYPE_EMU,&setting_get_string_representation_uint_as_enum,
|
||||
MENU_ENUM_LABEL_CHEAT_HANDLER_TYPE_EMU,
|
||||
&setting_get_string_representation_uint_as_enum,
|
||||
CHEAT_HANDLER_TYPE_EMU,CHEAT_HANDLER_TYPE_RETRO,1);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
|
||||
@ -8023,13 +8027,15 @@ static bool setting_append_list(
|
||||
|
||||
config_uint_cbs(cheat_manager_state.working_cheat.memory_search_size, CHEAT_MEMORY_SEARCH_SIZE,
|
||||
setting_uint_action_left_with_refresh,setting_uint_action_right_with_refresh,
|
||||
MENU_ENUM_LABEL_CHEAT_MEMORY_SIZE_1,&setting_get_string_representation_uint_as_enum,
|
||||
MENU_ENUM_LABEL_CHEAT_MEMORY_SIZE_1,
|
||||
&setting_get_string_representation_uint_as_enum,
|
||||
0,5,1);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
|
||||
config_uint_cbs(cheat_manager_state.working_cheat.cheat_type, CHEAT_TYPE,
|
||||
setting_uint_action_left_default,setting_uint_action_right_default,
|
||||
MENU_ENUM_LABEL_CHEAT_TYPE_DISABLED,&setting_get_string_representation_uint_as_enum,
|
||||
MENU_ENUM_LABEL_CHEAT_TYPE_DISABLED,
|
||||
&setting_get_string_representation_uint_as_enum,
|
||||
CHEAT_TYPE_DISABLED,CHEAT_TYPE_RUN_NEXT_IF_GT,1);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
|
||||
@ -8079,7 +8085,8 @@ static bool setting_append_list(
|
||||
|
||||
config_uint_cbs(cheat_manager_state.working_cheat.rumble_type, CHEAT_RUMBLE_TYPE,
|
||||
setting_uint_action_left_default,setting_uint_action_right_default,
|
||||
MENU_ENUM_LABEL_RUMBLE_TYPE_DISABLED,&setting_get_string_representation_uint_as_enum,
|
||||
MENU_ENUM_LABEL_RUMBLE_TYPE_DISABLED,
|
||||
&setting_get_string_representation_uint_as_enum,
|
||||
RUMBLE_TYPE_DISABLED,RUMBLE_TYPE_END_LIST-1,1);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
|
||||
@ -8090,7 +8097,8 @@ static bool setting_append_list(
|
||||
|
||||
config_uint_cbs(cheat_manager_state.working_cheat.rumble_port, CHEAT_RUMBLE_PORT,
|
||||
setting_uint_action_left_default,setting_uint_action_right_default,
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_0,&setting_get_string_representation_uint_as_enum,
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_0,
|
||||
&setting_get_string_representation_uint_as_enum,
|
||||
0,16,1);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
|
||||
@ -8128,7 +8136,8 @@ static bool setting_append_list(
|
||||
|
||||
config_uint_cbs(cheat_manager_state.search_bit_size, CHEAT_START_OR_RESTART,
|
||||
setting_uint_action_left_with_refresh,setting_uint_action_right_with_refresh,
|
||||
MENU_ENUM_LABEL_CHEAT_MEMORY_SIZE_1,&setting_get_string_representation_uint_as_enum,
|
||||
MENU_ENUM_LABEL_CHEAT_MEMORY_SIZE_1,
|
||||
&setting_get_string_representation_uint_as_enum,
|
||||
0,5,1);
|
||||
(*list)[list_info->index - 1].action_ok = &cheat_manager_initialize_memory;
|
||||
|
||||
|
@ -252,9 +252,6 @@ int setting_uint_action_right_with_refresh(rarch_setting_t *setting, bool wrapar
|
||||
|
||||
int setting_uint_action_left_with_refresh(rarch_setting_t *setting, bool wraparound) ;
|
||||
|
||||
void setting_get_string_representation_uint_as_enum(rarch_setting_t *setting,
|
||||
char *s, size_t len);
|
||||
|
||||
int setting_uint_action_left_default(rarch_setting_t *setting, bool wraparound);
|
||||
int setting_uint_action_right_default(rarch_setting_t *setting, bool wraparound);
|
||||
void setting_get_string_representation_uint(rarch_setting_t *setting, char *s, size_t len);
|
||||
|
Loading…
x
Reference in New Issue
Block a user