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

variables: pass VLC_VAR_SETMINMAX parameters by value

parent 2a400391
......@@ -393,8 +393,8 @@ static vlc_v4l2_ctrl_t *ControlAddInteger (vlc_object_t *obj, int fd,
var_Change(obj, c->name, VLC_VAR_SETVALUE, &val);
}
var_Change (obj, c->name, VLC_VAR_SETMINMAX,
&(vlc_value_t){ .i_int = query->minimum },
&(vlc_value_t){ .i_int = query->maximum } );
(vlc_value_t){ .i_int = query->minimum },
(vlc_value_t){ .i_int = query->maximum } );
if (query->step != 1)
{
val.i_int = query->step;
......@@ -462,8 +462,8 @@ static vlc_v4l2_ctrl_t *ControlAddMenu (vlc_object_t *obj, int fd,
var_Change(obj, c->name, VLC_VAR_SETVALUE, &val);
}
var_Change (obj, c->name, VLC_VAR_SETMINMAX,
&(vlc_value_t){ .i_int = query->minimum },
&(vlc_value_t){ .i_int = query->maximum } );
(vlc_value_t){ .i_int = query->minimum },
(vlc_value_t){ .i_int = query->maximum } );
/* Import menu choices */
for (uint_fast32_t idx = query->minimum;
......@@ -621,8 +621,8 @@ static vlc_v4l2_ctrl_t *ControlAddBitMask (vlc_object_t *obj, int fd,
var_Change(obj, c->name, VLC_VAR_SETVALUE, &val);
}
var_Change (obj, c->name, VLC_VAR_SETMINMAX,
&(vlc_value_t){ .i_int = 0 },
&(vlc_value_t){ .i_int = (uint32_t)query->maximum } );
(vlc_value_t){ .i_int = 0 },
(vlc_value_t){ .i_int = (uint32_t)query->maximum } );
return c;
}
......@@ -654,8 +654,8 @@ static vlc_v4l2_ctrl_t *ControlAddIntMenu (vlc_object_t *obj, int fd,
var_Change(obj, c->name, VLC_VAR_SETVALUE, &val);
}
var_Change (obj, c->name, VLC_VAR_SETMINMAX,
&(vlc_value_t){ .i_int = query->minimum },
&(vlc_value_t){ .i_int = query->maximum } );
(vlc_value_t){ .i_int = query->minimum },
(vlc_value_t){ .i_int = query->maximum } );
/* Import menu choices */
for (uint_fast32_t idx = query->minimum;
......
......@@ -294,13 +294,13 @@ void config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
{
case CONFIG_ITEM_INTEGER:
var_Change( p_this, name, VLC_VAR_SETMINMAX,
&(vlc_value_t){ .i_int = p_conf->min.i },
&(vlc_value_t){ .i_int = p_conf->max.i } );
(vlc_value_t){ .i_int = p_conf->min.i },
(vlc_value_t){ .i_int = p_conf->max.i } );
break;
case CONFIG_ITEM_FLOAT:
var_Change( p_this, name, VLC_VAR_SETMINMAX,
&(vlc_value_t){ .f_float = p_conf->min.f },
&(vlc_value_t){ .f_float = p_conf->max.f } );
(vlc_value_t){ .f_float = p_conf->min.f },
(vlc_value_t){ .f_float = p_conf->max.f } );
break;
}
}
......
......@@ -219,16 +219,16 @@ int config_LoadCmdLine( vlc_object_t *p_this, int i_argc,
case CONFIG_ITEM_INTEGER:
var_Create( p_this, psz_name, VLC_VAR_INTEGER );
var_Change( p_this, psz_name, VLC_VAR_SETMINMAX,
&(vlc_value_t){ .i_int = p_conf->min.i },
&(vlc_value_t){ .i_int = p_conf->max.i } );
(vlc_value_t){ .i_int = p_conf->min.i },
(vlc_value_t){ .i_int = p_conf->max.i } );
var_SetInteger( p_this, psz_name,
strtoll(state.arg, NULL, 0));
break;
case CONFIG_ITEM_FLOAT:
var_Create( p_this, psz_name, VLC_VAR_FLOAT );
var_Change( p_this, psz_name, VLC_VAR_SETMINMAX,
&(vlc_value_t){ .f_float = p_conf->min.f },
&(vlc_value_t){ .f_float = p_conf->max.f } );
(vlc_value_t){ .f_float = p_conf->min.f },
(vlc_value_t){ .f_float = p_conf->max.f } );
var_SetFloat( p_this, psz_name, us_atof(state.arg) );
break;
case CONFIG_ITEM_BOOL:
......
......@@ -450,8 +450,8 @@ int (var_Change)(vlc_object_t *p_this, const char *psz_name, int i_action, ...)
break;
case VLC_VAR_SETMINMAX:
assert(p_var->ops->pf_free == FreeDummy);
p_var->min = *va_arg(ap, vlc_value_t *);
p_var->max = *va_arg(ap, vlc_value_t *);
p_var->min = va_arg(ap, vlc_value_t);
p_var->max = va_arg(ap, vlc_value_t);
break;
case VLC_VAR_SETSTEP:
assert(p_var->ops->pf_free == FreeDummy);
......
......@@ -290,8 +290,8 @@ static void test_limits( libvlc_int_t *p_libvlc )
assert( val.i_int == INT64_MAX );
var_Change( p_libvlc, "bla", VLC_VAR_SETMINMAX,
&(vlc_value_t){ .i_int = -1234 },
&(vlc_value_t){ .i_int = 12345 } );
(vlc_value_t){ .i_int = -1234 },
(vlc_value_t){ .i_int = 12345 } );
var_Change( p_libvlc, "bla", VLC_VAR_GETMIN, &val );
assert( val.i_int == -1234 );
......@@ -359,7 +359,7 @@ static void test_change( libvlc_int_t *p_libvlc )
step.i_int = 13;
var_Create( p_libvlc, "bla", VLC_VAR_INTEGER );
var_Change( p_libvlc, "bla", VLC_VAR_SETMINMAX, &min, &max );
var_Change( p_libvlc, "bla", VLC_VAR_SETMINMAX, min, max );
var_Change( p_libvlc, "bla", VLC_VAR_SETSTEP, &step );
var_SetInteger( p_libvlc, "bla", 13 );
......@@ -405,7 +405,7 @@ static void test_creation_and_type( libvlc_int_t *p_libvlc )
assert( var_Change( p_libvlc, "bla", VLC_VAR_GETMAX, &val ) != 0
|| val.i_int == INT64_MAX );
val.i_int = 4212;
var_Change( p_libvlc, "bla", VLC_VAR_SETMINMAX, &val, &val );
var_Change( p_libvlc, "bla", VLC_VAR_SETMINMAX, val, val );
assert( var_Change( p_libvlc, "bla", VLC_VAR_GETMIN, &val ) == 0
&& val.i_int == 4212 );
assert( var_Change( p_libvlc, "bla", VLC_VAR_GETMAX, &val ) == 0
......
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