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

variables: remove redundant HASCHOICE flag in var_Create()

The core adds the flag automatically as needed.
parent 8583c1e6
......@@ -445,8 +445,7 @@ static vlc_v4l2_ctrl_t *ControlAddMenu (vlc_object_t *obj, int fd,
if (unlikely(c == NULL))
return NULL;
if (var_Create (obj, c->name, VLC_VAR_INTEGER | VLC_VAR_HASCHOICE
| VLC_VAR_ISCOMMAND))
if (var_Create (obj, c->name, VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND))
{
free (c);
return NULL;
......@@ -638,8 +637,7 @@ static vlc_v4l2_ctrl_t *ControlAddIntMenu (vlc_object_t *obj, int fd,
if (unlikely(c == NULL))
return NULL;
if (var_Create (obj, c->name, VLC_VAR_INTEGER | VLC_VAR_HASCHOICE
| VLC_VAR_ISCOMMAND))
if (var_Create (obj, c->name, VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND))
{
free (c);
return NULL;
......@@ -701,7 +699,7 @@ vlc_v4l2_ctrl_t *ControlsInit (vlc_object_t *obj, int fd)
{
/* A list of controls that can be modified at run-time is stored in the
* "controls" variable. The V4L2 controls dialog can be built from this. */
var_Create (obj, "controls", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE);
var_Create (obj, "controls", VLC_VAR_INTEGER);
static const ctrl_type_cb handlers[] =
{
......
......@@ -54,8 +54,7 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf )
vlc_value_t val, text;
// Create a variable to add items in wxwindows popup menu
var_Create( pIntf, "intf-skins", VLC_VAR_STRING |
VLC_VAR_HASCHOICE | VLC_VAR_ISCOMMAND );
var_Create( pIntf, "intf-skins", VLC_VAR_STRING | VLC_VAR_ISCOMMAND );
text.psz_string = _("Select skin");
var_Change( pIntf, "intf-skins", VLC_VAR_SETTEXT, &text, NULL );
......
......@@ -195,7 +195,7 @@ static int OpenPostproc( vlc_object_t *p_this )
p_filter->p_cfg );
var_Create( p_filter, FILTER_PREFIX "q", VLC_VAR_INTEGER |
VLC_VAR_HASCHOICE | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
text.psz_string = _("Post processing");
var_Change( p_filter, FILTER_PREFIX "q", VLC_VAR_SETTEXT, &text, NULL );
......
......@@ -66,8 +66,7 @@ int aout_DecNew( audio_output_t *p_aout,
return -1;
}
var_Create (p_aout, "stereo-mode",
VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | VLC_VAR_DOINHERIT);
var_Create (p_aout, "stereo-mode", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
vlc_value_t txt;
txt.psz_string = _("Stereo audio mode");
var_Change (p_aout, "stereo-mode", VLC_VAR_SETTEXT, &txt, NULL);
......
......@@ -232,7 +232,7 @@ audio_output_t *aout_New (vlc_object_t *parent)
char *str;
/* Visualizations */
var_Create (aout, "visual", VLC_VAR_STRING | VLC_VAR_HASCHOICE);
var_Create (aout, "visual", VLC_VAR_STRING);
text.psz_string = _("Visualizations");
var_Change (aout, "visual", VLC_VAR_SETTEXT, &text, NULL);
val.psz_string = (char *)"";
......
......@@ -151,14 +151,12 @@ void input_ControlVarInit ( input_thread_t *p_input )
var_Create( p_input, "time-offset", VLC_VAR_INTEGER ); /* relative */
/* Bookmark */
var_Create( p_input, "bookmark", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE |
VLC_VAR_ISCOMMAND );
var_Create( p_input, "bookmark", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
val.psz_string = _("Bookmark");
var_Change( p_input, "bookmark", VLC_VAR_SETTEXT, &val, NULL );
/* Program */
var_Create( p_input, "program", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE |
VLC_VAR_DOINHERIT );
var_Create( p_input, "program", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Get( p_input, "program", &val );
if( val.i_int <= 0 )
var_Change( p_input, "program", VLC_VAR_DELCHOICE, &val, NULL );
......@@ -171,12 +169,12 @@ void input_ControlVarInit ( input_thread_t *p_input )
var_Change( p_input, "programs", VLC_VAR_SETTEXT, &text, NULL );
/* Title */
var_Create( p_input, "title", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
var_Create( p_input, "title", VLC_VAR_INTEGER );
text.psz_string = _("Title");
var_Change( p_input, "title", VLC_VAR_SETTEXT, &text, NULL );
/* Chapter */
var_Create( p_input, "chapter", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
var_Create( p_input, "chapter", VLC_VAR_INTEGER );
text.psz_string = _("Chapter");
var_Change( p_input, "chapter", VLC_VAR_SETTEXT, &text, NULL );
......@@ -187,17 +185,17 @@ void input_ControlVarInit ( input_thread_t *p_input )
var_Create( p_input, "spu-delay", VLC_VAR_INTEGER );
/* Video ES */
var_Create( p_input, "video-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
var_Create( p_input, "video-es", VLC_VAR_INTEGER );
text.psz_string = _("Video Track");
var_Change( p_input, "video-es", VLC_VAR_SETTEXT, &text, NULL );
/* Audio ES */
var_Create( p_input, "audio-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
var_Create( p_input, "audio-es", VLC_VAR_INTEGER );
text.psz_string = _("Audio Track");
var_Change( p_input, "audio-es", VLC_VAR_SETTEXT, &text, NULL );
/* Spu ES */
var_Create( p_input, "spu-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
var_Create( p_input, "spu-es", VLC_VAR_INTEGER );
text.psz_string = _("Subtitle Track");
var_Change( p_input, "spu-es", VLC_VAR_SETTEXT, &text, NULL );
......@@ -304,8 +302,7 @@ void input_ControlVarNavigation( input_thread_t *p_input )
/* Add Navigation entries */
sprintf( title, "title %2u", i );
var_Destroy( p_input, title );
var_Create( p_input, title,
VLC_VAR_INTEGER|VLC_VAR_HASCHOICE|VLC_VAR_ISCOMMAND );
var_Create( p_input, title, VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
var_AddCallback( p_input, title,
NavigationCallback, (void *)(intptr_t)i );
......
......@@ -78,8 +78,7 @@ int intf_Create( playlist_t *playlist, const char *chain )
/* Variable used for interface spawning */
vlc_value_t val, text;
var_Create( p_intf, "intf-add", VLC_VAR_STRING |
VLC_VAR_HASCHOICE | VLC_VAR_ISCOMMAND );
var_Create( p_intf, "intf-add", VLC_VAR_STRING | VLC_VAR_ISCOMMAND );
text.psz_string = _("Add Interface");
var_Change( p_intf, "intf-add", VLC_VAR_SETTEXT, &text, NULL );
#if !defined(_WIN32) && defined(HAVE_ISATTY)
......
......@@ -375,7 +375,7 @@ int var_Create( vlc_object_t *p_this, const char *psz_name, int i_type )
{
assert (((i_type ^ p_oldvar->i_type) & VLC_VAR_CLASS) == 0);
p_oldvar->i_usage++;
p_oldvar->i_type |= i_type & (VLC_VAR_ISCOMMAND|VLC_VAR_HASCHOICE);
p_oldvar->i_type |= i_type & VLC_VAR_ISCOMMAND;
}
vlc_mutex_unlock( &p_priv->var_lock );
......
......@@ -173,7 +173,7 @@ void vout_InitInterlacingSupport(vout_thread_t *vout, bool is_interlaced)
/* Create the configuration variables */
/* */
var_Create(vout, "deinterlace", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT | VLC_VAR_HASCHOICE);
var_Create(vout, "deinterlace", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
int deinterlace_state = var_GetInteger(vout, "deinterlace");
text.psz_string = _("Deinterlace");
......@@ -189,7 +189,7 @@ void vout_InitInterlacingSupport(vout_thread_t *vout, bool is_interlaced)
}
var_AddCallback(vout, "deinterlace", DeinterlaceCallback, NULL);
/* */
var_Create(vout, "deinterlace-mode", VLC_VAR_STRING | VLC_VAR_DOINHERIT | VLC_VAR_HASCHOICE);
var_Create(vout, "deinterlace-mode", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
char *deinterlace_mode = var_GetNonEmptyString(vout, "deinterlace-mode");
text.psz_string = _("Deinterlace mode");
......
......@@ -324,8 +324,7 @@ static void test_limits( libvlc_int_t *p_libvlc )
static void test_choices( libvlc_int_t *p_libvlc )
{
vlc_value_t val, val2;
var_Create( p_libvlc, "bla", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE |
VLC_VAR_ISCOMMAND );
var_Create( p_libvlc, "bla", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
val.i_int = 1;
val2.psz_string = (char*)"one";
var_Change( p_libvlc, "bla", VLC_VAR_ADDCHOICE, &val, &val2 );
......@@ -429,9 +428,6 @@ static void test_creation_and_type( libvlc_int_t *p_libvlc )
assert( var_Create( p_libvlc, "bla", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND ) == VLC_SUCCESS );
assert( var_Type( p_libvlc, "bla" ) == (VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND) );
assert( var_Create( p_libvlc, "bla", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND | VLC_VAR_HASCHOICE ) == VLC_SUCCESS );
assert( var_Type( p_libvlc, "bla" ) == (VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND | VLC_VAR_HASCHOICE) );
var_Destroy( p_libvlc, "bla" );
var_Destroy( p_libvlc, "bla" );
var_Destroy( p_libvlc, "bla" );
......@@ -440,8 +436,6 @@ static void test_creation_and_type( libvlc_int_t *p_libvlc )
var_Create( p_libvlc, "bla", VLC_VAR_INTEGER );
assert( var_Create( p_libvlc, "bla", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND ) == VLC_SUCCESS );
assert( var_Type( p_libvlc, "bla" ) == (VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND) );
assert( var_Create( p_libvlc, "bla", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE ) == VLC_SUCCESS );
assert( var_Type( p_libvlc, "bla" ) == (VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND | VLC_VAR_HASCHOICE) );
var_Destroy( p_libvlc, "bla" );
var_Destroy( p_libvlc, "bla" );
......
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