]> git.sesse.net Git - vlc/commitdiff
variables:
authorRémi Duraffort <ivoire@videolan.org>
Fri, 31 Jul 2009 11:47:19 +0000 (13:47 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Fri, 31 Jul 2009 11:48:40 +0000 (13:48 +0200)
 * print a warning when var_DelCallback can't find the callback because the
   data doesn't match
 * these warning are only for debug builds.

src/misc/variables.c

index 4a2035459d12e2267d14d293a8caae9bd5ce2358..74e99f89c7385888d975be50e05901a9d5aaa531 100644 (file)
@@ -835,9 +835,11 @@ int var_GetChecked( vlc_object_t *p_this, const char *psz_name,
         /* Really get the variable */
         *p_val = p_var->val;
 
+#ifndef NDEBUG
         /* Alert if the type is VLC_VAR_VOID */
         if( ( p_var->i_type & VLC_VAR_TYPE ) == VLC_VAR_VOID )
             msg_Warn( p_this, "Calling var_GetVoid on the void variable '%s' (0x%04x)", psz_name, p_var->i_type );
+#endif
 
         /* Duplicate value if needed */
         p_var->ops->pf_dup( p_val );
@@ -941,6 +943,13 @@ int __var_DelCallback( vlc_object_t *p_this, const char *psz_name,
         {
             break;
         }
+#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 );
+        }
+#endif
     }
 
     if( i_entry < 0 )