Remove source settings

This commit is contained in:
twinaphex 2016-03-24 19:55:33 +01:00
parent f23b42b437
commit d3f0ca76bc

View File

@ -115,16 +115,6 @@ struct rarch_setting
struct
{
union
{
bool boolean;
int integer;
unsigned int unsigned_integer;
float fraction;
char string[PATH_MAX_LENGTH];
struct retro_keybind keybind;
} source;
union
{
bool *boolean;
@ -813,7 +803,7 @@ static int setting_string_action_left_driver(void *data,
return -1;
drv.label = setting->name;
drv.s = setting->value.source.string;
drv.s = setting->value.target.string;
drv.len = setting->size;
if (!driver_ctl(RARCH_DRIVER_CTL_FIND_PREV, &drv))
@ -835,7 +825,7 @@ static int setting_string_action_right_driver(void *data,
return -1;
drv.label = setting->name;
drv.s = setting->value.source.string;
drv.s = setting->value.target.string;
drv.len = setting->size;
if (!driver_ctl(RARCH_DRIVER_CTL_FIND_NEXT, &drv))
@ -845,7 +835,7 @@ static int setting_string_action_right_driver(void *data,
if (settings && settings->menu.navigation.wraparound.setting_enable)
{
drv.label = setting->name;
drv.s = setting->value.source.string;
drv.s = setting->value.target.string;
drv.len = setting->size;
driver_ctl(RARCH_DRIVER_CTL_FIND_FIRST, &drv);
}
@ -934,7 +924,7 @@ static void setting_get_string_representation_st_path(void *data,
rarch_setting_t *setting = (rarch_setting_t*)data;
if (setting)
fill_short_pathname_representation(s, setting->value.source.string, len);
fill_short_pathname_representation(s, setting->value.target.string, len);
}
static void setting_get_string_representation_st_string(void *data,
@ -943,7 +933,7 @@ static void setting_get_string_representation_st_string(void *data,
rarch_setting_t *setting = (rarch_setting_t*)data;
if (setting)
strlcpy(s, setting->value.source.string, len);
strlcpy(s, setting->value.target.string, len);
}
static void setting_get_string_representation_st_bind(void *data,
@ -1191,7 +1181,7 @@ static void setting_reset_setting(rarch_setting_t* setting)
if (menu_setting_get_type(setting) == ST_STRING)
menu_setting_set_with_string_representation(setting, setting->default_value.string);
else
fill_pathname_expand_special(setting->value.source.string,
fill_pathname_expand_special(setting->value.target.string,
setting->default_value.string, setting->size);
}
break;
@ -2095,7 +2085,7 @@ int menu_setting_set_with_string_representation(rarch_setting_t* setting,
case ST_STRING:
case ST_STRING_OPTIONS:
case ST_ACTION:
strlcpy(setting->value.source.string, value, setting->size);
strlcpy(setting->value.target.string, value, setting->size);
break;
case ST_BOOL:
if (string_is_equal(value, "true"))
@ -2298,7 +2288,7 @@ static int setting_string_action_start_generic(void *data)
if (!setting)
return -1;
setting->value.source.string[0] = '\0';
setting->value.target.string[0] = '\0';
return 0;
}
@ -2843,19 +2833,6 @@ void general_write_handler(void *data)
if (!setting)
return;
switch (menu_setting_get_type(setting))
{
case ST_PATH:
case ST_DIR:
case ST_STRING:
case ST_STRING_OPTIONS:
case ST_ACTION:
strlcpy(setting->value.target.string, setting->value.source.string, setting->size);
break;
default:
break;
}
if (setting->cmd_trigger.idx != EVENT_CMD_NONE)
{
if (flags & SD_FLAG_EXIT)
@ -3002,7 +2979,7 @@ void general_write_handler(void *data)
break;
case MENU_LABEL_NETPLAY_IP_ADDRESS:
#ifdef HAVE_NETPLAY
global->has_set.netplay_ip_address = (!string_is_empty(setting->value.source.string));
global->has_set.netplay_ip_address = (!string_is_empty(setting->value.target.string));
#endif
break;
case MENU_LABEL_NETPLAY_MODE:
@ -3646,10 +3623,6 @@ static bool setting_append_list(
general_read_handler,
general_write_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_IS_DRIVER);
strlcpy(
(*list)[list_info->index - 1].value.source.string,
(*list)[list_info->index - 1].value.target.string,
(*list)[list_info->index - 1].size);
(*list)[list_info->index - 1].action_left = setting_string_action_left_driver;
(*list)[list_info->index - 1].action_right = setting_string_action_right_driver;
@ -3667,10 +3640,6 @@ static bool setting_append_list(
general_read_handler,
general_write_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_IS_DRIVER);
strlcpy(
(*list)[list_info->index - 1].value.source.string,
(*list)[list_info->index - 1].value.target.string,
(*list)[list_info->index - 1].size);
(*list)[list_info->index - 1].action_left = setting_string_action_left_driver;
(*list)[list_info->index - 1].action_right = setting_string_action_right_driver;
@ -3688,10 +3657,6 @@ static bool setting_append_list(
general_read_handler,
general_write_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_IS_DRIVER);
strlcpy(
(*list)[list_info->index - 1].value.source.string,
(*list)[list_info->index - 1].value.target.string,
(*list)[list_info->index - 1].size);
(*list)[list_info->index - 1].action_left = setting_string_action_left_driver;
(*list)[list_info->index - 1].action_right = setting_string_action_right_driver;
@ -3709,10 +3674,6 @@ static bool setting_append_list(
general_read_handler,
general_write_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_IS_DRIVER);
strlcpy(
(*list)[list_info->index - 1].value.source.string,
(*list)[list_info->index - 1].value.target.string,
(*list)[list_info->index - 1].size);
(*list)[list_info->index - 1].action_left = setting_string_action_left_driver;
(*list)[list_info->index - 1].action_right = setting_string_action_right_driver;
@ -3730,10 +3691,6 @@ static bool setting_append_list(
general_read_handler,
general_write_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_IS_DRIVER);
strlcpy(
(*list)[list_info->index - 1].value.source.string,
(*list)[list_info->index - 1].value.target.string,
(*list)[list_info->index - 1].size);
(*list)[list_info->index - 1].action_left = setting_string_action_left_driver;
(*list)[list_info->index - 1].action_right = setting_string_action_right_driver;
@ -3751,10 +3708,6 @@ static bool setting_append_list(
general_read_handler,
general_write_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_IS_DRIVER);
strlcpy(
(*list)[list_info->index - 1].value.source.string,
(*list)[list_info->index - 1].value.target.string,
(*list)[list_info->index - 1].size);
(*list)[list_info->index - 1].action_left = setting_string_action_left_driver;
(*list)[list_info->index - 1].action_right = setting_string_action_right_driver;
@ -3772,10 +3725,6 @@ static bool setting_append_list(
general_read_handler,
general_write_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_IS_DRIVER);
strlcpy(
(*list)[list_info->index - 1].value.source.string,
(*list)[list_info->index - 1].value.target.string,
(*list)[list_info->index - 1].size);
(*list)[list_info->index - 1].action_left = setting_string_action_left_driver;
(*list)[list_info->index - 1].action_right = setting_string_action_right_driver;
@ -3793,10 +3742,6 @@ static bool setting_append_list(
general_read_handler,
general_write_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_IS_DRIVER);
strlcpy(
(*list)[list_info->index - 1].value.source.string,
(*list)[list_info->index - 1].value.target.string,
(*list)[list_info->index - 1].size);
(*list)[list_info->index - 1].action_left = setting_string_action_left_driver;
(*list)[list_info->index - 1].action_right = setting_string_action_right_driver;
@ -3814,10 +3759,6 @@ static bool setting_append_list(
general_read_handler,
general_write_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_IS_DRIVER);
strlcpy(
(*list)[list_info->index - 1].value.source.string,
(*list)[list_info->index - 1].value.target.string,
(*list)[list_info->index - 1].size);
(*list)[list_info->index - 1].action_left = setting_string_action_left_driver;
(*list)[list_info->index - 1].action_right = setting_string_action_right_driver;