Commit eda425f0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Simplification, and no-ops removal

parent 1f9d8d6c
...@@ -520,32 +520,6 @@ int config_Duplicate( module_t *p_module, const module_config_t *p_orig, ...@@ -520,32 +520,6 @@ int config_Duplicate( module_t *p_module, const module_config_t *p_orig,
for( size_t i = 0; i < n ; i++ ) for( size_t i = 0; i < n ; i++ )
{ {
p_module->p_config[i] = p_orig[i]; p_module->p_config[i] = p_orig[i];
if (IsConfigIntegerType (p_module->p_config[i].i_type))
{
p_module->p_config[i].orig.i = p_orig[i].value.i;
p_module->p_config[i].saved.i = p_orig[i].value.i;
}
else
if (IsConfigFloatType (p_module->p_config[i].i_type))
{
p_module->p_config[i].orig.f = p_orig[i].value.f;
p_module->p_config[i].saved.f = p_orig[i].value.f;
}
else
if (IsConfigStringType (p_module->p_config[i].i_type))
{
p_module->p_config[i].value.psz = strdupnull (p_orig[i].value.psz);
p_module->p_config[i].orig.psz = strdupnull (p_orig[i].value.psz);
p_module->p_config[i].saved.psz = NULL;
}
p_module->p_config[i].psz_type = p_orig[i].psz_type;
p_module->p_config[i].psz_name = p_orig[i].psz_name;
p_module->p_config[i].psz_current = p_orig[i].psz_current;
p_module->p_config[i].psz_text = p_orig[i].psz_text;
p_module->p_config[i].psz_longtext = p_orig[i].psz_longtext;
p_module->p_config[i].p_lock = &p_module->object_lock; p_module->p_config[i].p_lock = &p_module->object_lock;
/* duplicate the string list */ /* duplicate the string list */
......
...@@ -198,12 +198,14 @@ int vlc_config_set (module_config_t *restrict item, vlc_config_t id, ...) ...@@ -198,12 +198,14 @@ int vlc_config_set (module_config_t *restrict item, vlc_config_t id, ...)
{ {
if (IsConfigIntegerType (item->i_type)) if (IsConfigIntegerType (item->i_type))
{ {
item->orig.i = item->saved.i =
item->value.i = va_arg (ap, int); item->value.i = va_arg (ap, int);
ret = 0; ret = 0;
} }
else else
if (IsConfigFloatType (item->i_type)) if (IsConfigFloatType (item->i_type))
{ {
item->orig.f = item->saved.f =
item->value.f = va_arg (ap, double); item->value.f = va_arg (ap, double);
ret = 0; ret = 0;
} }
...@@ -212,6 +214,8 @@ int vlc_config_set (module_config_t *restrict item, vlc_config_t id, ...) ...@@ -212,6 +214,8 @@ int vlc_config_set (module_config_t *restrict item, vlc_config_t id, ...)
{ {
const char *value = va_arg (ap, const char *); const char *value = va_arg (ap, const char *);
item->value.psz = value ? strdup (value) : NULL; item->value.psz = value ? strdup (value) : NULL;
item->orig.psz = value ? strdup (value) : NULL;
item->saved.psz = value ? strdup (value) : NULL;
ret = 0; ret = 0;
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment