#include "libvlc.h"
-#include "vlc_interface.h"
#include <assert.h>
/*****************************************************************************
int i_new;
variable_t *p_var;
static vlc_list_t dummy_null_list = {0, NULL, NULL};
+
+ assert( p_this );
+
vlc_object_internals_t *p_priv = vlc_internals( p_this );
vlc_mutex_lock( &p_priv->var_lock );
if( i_new >= 0 )
{
/* If the types differ, variable creation failed. */
- if( (i_type & VLC_VAR_TYPE) != (p_priv->p_vars[i_new].i_type & VLC_VAR_TYPE) )
+ if( (i_type & VLC_VAR_CLASS) != (p_priv->p_vars[i_new].i_type & VLC_VAR_CLASS) )
{
msg_Err( p_this, "Variable '%s' (0x%04x) already exist but with a different type (0x%04x)",
psz_name, p_priv->p_vars[i_new].i_type, i_type );
{
int i_var, i;
variable_t *p_var;
+
+ assert( p_this );
+
vlc_object_internals_t *p_priv = vlc_internals( p_this );
vlc_mutex_lock( &p_priv->var_lock );
}
/* Free callbacks if needed */
- if( p_var->p_entries )
- {
- free( p_var->p_entries );
- }
+ free( p_var->p_entries );
free( p_var->psz_name );
free( p_var->psz_text );
int i_var, i;
variable_t *p_var;
vlc_value_t oldval;
+
+ assert( p_this );
+
vlc_object_internals_t *p_priv = vlc_internals( p_this );
vlc_mutex_lock( &p_priv->var_lock );
int i_ret = VLC_SUCCESS;
variable_t *p_var;
vlc_value_t oldval;
+
+ assert( p_this );
+
vlc_object_internals_t *p_priv = vlc_internals( p_this );
vlc_mutex_lock( &p_priv->var_lock );
int __var_Type( vlc_object_t *p_this, const char *psz_name )
{
int i_var, i_type;
+
+ assert( p_this );
+
vlc_object_internals_t *p_priv = vlc_internals( p_this );
vlc_mutex_lock( &p_priv->var_lock );
int i_ret = VLC_SUCCESS;
variable_t *p_var;
vlc_value_t oldval;
+
+ assert( p_this );
+
vlc_object_internals_t *p_priv = vlc_internals( p_this );
vlc_mutex_lock( &p_priv->var_lock );
}
p_var = &p_priv->p_vars[i_var];
- assert( (p_var->i_type & VLC_VAR_CLASS) == 0 || expected_type == 0 ||
+ assert( expected_type == 0 ||
(p_var->i_type & VLC_VAR_CLASS) == expected_type );
/* Duplicate data if needed */
int var_GetChecked( vlc_object_t *p_this, const char *psz_name,
int expected_type, vlc_value_t *p_val )
{
+ assert( p_this );
+
vlc_object_internals_t *p_priv = vlc_internals( p_this );
int i_var, err = VLC_SUCCESS;
{
variable_t *p_var = &p_priv->p_vars[i_var];
- assert( (p_var->i_type & VLC_VAR_CLASS) == 0 || expected_type == 0 ||
+ assert( expected_type == 0 ||
(p_var->i_type & VLC_VAR_CLASS) == expected_type );
/* Really get the variable */
int i_var;
variable_t *p_var;
callback_entry_t entry;
+
+ assert( p_this );
+
vlc_object_internals_t *p_priv = vlc_internals( p_this );
entry.pf_callback = pf_callback;
{
int i_entry, i_var;
variable_t *p_var;
+#ifndef NDEBUG
+ bool b_found_similar = false;
+#endif
+
+ assert( p_this );
+
vlc_object_internals_t *p_priv = vlc_internals( p_this );
vlc_mutex_lock( &p_priv->var_lock );
}
#ifndef NDEBUG
else if( p_var->p_entries[i_entry].pf_callback == pf_callback )
- {
- msg_Warn( p_this, "Calling var_DelCallback for '%s' with the same "
- "function but not the same data.", psz_name );
- }
+ b_found_similar = true;
#endif
}
if( i_entry < 0 )
{
+#ifndef NDEBUG
+ if( b_found_similar )
+ fprintf( stderr, "Calling var_DelCallback for '%s' with the same "
+ "function but not the same data.", psz_name );
+ assert( 0 );
+#endif
vlc_mutex_unlock( &p_priv->var_lock );
return VLC_EGENERIC;
}
int i_var;
int i_ret = VLC_SUCCESS;
variable_t *p_var;
+
+ assert( p_this );
+
vlc_object_internals_t *p_priv = vlc_internals( p_this );
vlc_mutex_lock( &p_priv->var_lock );
goto cleanup;
}
- var_Set( p_obj, psz_name, val );
+ __var_Set( p_obj, psz_name, val );
/* If that's a list, remove all elements allocated */
if( i_type == VLC_VAR_LIST )
*****************************************************************************/
static int GetUnused( vlc_object_t *p_this, const char *psz_name )
{
+ assert( p_this );
+
vlc_object_internals_t *p_priv = vlc_internals( p_this );
while( true )
int i_var;
int i_entries = (*pp_var)->i_entries;
callback_entry_t *p_entries = (*pp_var)->p_entries;
+
+ assert( p_this );
+
vlc_object_internals_t *p_priv = vlc_internals( p_this );
(*pp_var)->b_incallback = true;