[vlc-devel] commit: variables: when the variable already exist, check the type only ( integer, ( Rémi Duraffort )

git version control git at videolan.org
Fri Jul 24 08:40:40 CEST 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Jul 24 07:46:48 2009 +0200| [83f9323eae1e296532046e7697ed638b9fca6561] | committer: Rémi Duraffort 

variables: when the variable already exist, check the type only (integer,
float, ...), so remove all the flags before the check.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=83f9323eae1e296532046e7697ed638b9fca6561
---

 src/misc/variables.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/misc/variables.c b/src/misc/variables.c
index 1f382ea..4d9ae4a 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -193,15 +193,15 @@ int __var_Create( vlc_object_t *p_this, const char *psz_name, int i_type )
     if( i_new >= 0 )
     {
         /* If the types differ, variable creation failed. */
-        if( (i_type & ~(VLC_VAR_DOINHERIT|VLC_VAR_ISCOMMAND)) != p_priv->p_vars[i_new].i_type )
+        if( (i_type & VLC_VAR_TYPE) != (p_priv->p_vars[i_new].i_type & VLC_VAR_TYPE) )
         {
             vlc_mutex_unlock( &p_priv->var_lock );
             return VLC_EBADVAR;
         }
 
         p_priv->p_vars[i_new].i_usage++;
-        if( i_type & VLC_VAR_ISCOMMAND )
-            p_priv->p_vars[i_new].i_type |= VLC_VAR_ISCOMMAND;
+        p_priv->p_vars[i_new].i_type |= ( i_type & VLC_VAR_ISCOMMAND );
+        p_priv->p_vars[i_new].i_type |= ( i_type & VLC_VAR_HASCHOICE );
         vlc_mutex_unlock( &p_priv->var_lock );
         return VLC_SUCCESS;
     }




More information about the vlc-devel mailing list