(menu_setting.c) Cleanups

This commit is contained in:
twinaphex 2015-06-06 10:44:19 +02:00
parent 3195ccc201
commit 27fd7ef2a2

View File

@ -826,12 +826,12 @@ static int setting_action_left_libretro_device_type(
current_idx = 0;
for (i = 0; i < types; i++)
{
if (current_device == devices[i])
{
if (current_device != devices[i])
continue;
current_idx = i;
break;
}
}
current_device = devices
[(current_idx + types - 1) % types];
@ -884,12 +884,12 @@ static int setting_action_right_libretro_device_type(
current_idx = 0;
for (i = 0; i < types; i++)
{
if (current_device == devices[i])
{
if (current_device != devices[i])
continue;
current_idx = i;
break;
}
}
current_device = devices
[(current_idx + 1) % types];
@ -1216,7 +1216,8 @@ static int setting_bool_action_ok_exit(void *data, unsigned action)
static int setting_action_ok_video_refresh_rate_auto(
void *data, unsigned action)
{
double video_refresh_rate, deviation = 0.0;
double video_refresh_rate = 0.0;
double deviation = 0.0;
unsigned sample_points = 0;
rarch_setting_t *setting = (rarch_setting_t*)data;
@ -1407,7 +1408,8 @@ static void setting_get_string_representation_st_bind(void *data,
return;
keybind = (const struct retro_keybind*)setting->value.keybind;
auto_bind = (const struct retro_keybind*)input_get_auto_bind(setting->index_offset, keybind->id);
auto_bind = (const struct retro_keybind*)
input_get_auto_bind(setting->index_offset, keybind->id);
input_get_bind_string(s, keybind, auto_bind, len);
}
@ -1534,11 +1536,8 @@ static void setting_get_string_representation_uint_analog_dpad_mode(void *data,
};
rarch_setting_t *setting = (rarch_setting_t*)data;
settings_t *settings = config_get_ptr();
if (!setting)
return;
(void)data;
if (setting)
strlcpy(s, modes[settings->input.analog_dpad_mode
[setting->index_offset] % ANALOG_DPAD_LAST],
len);
@ -1584,16 +1583,15 @@ static void setting_get_string_representation_uint_user_language(void *data,
static void setting_get_string_representation_uint_libretro_log_level(void *data,
char *s, size_t len)
{
rarch_setting_t *setting = (rarch_setting_t*)data;
if (!setting)
return;
static const char *modes[] = {
"0 (Debug)",
"1 (Info)",
"2 (Warning)",
"3 (Error)"
};
rarch_setting_t *setting = (rarch_setting_t*)data;
if (setting)
strlcpy(s, modes[*setting->value.unsigned_integer],
len);
}