[vlc-devel] commit: variables: ( Rémi Duraffort )

git version control git at videolan.org
Fri Jul 31 13:49:00 CEST 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Jul 31 13:47:19 2009 +0200| [fc43e13f0710d1c48d00983d77d87117756323a9] | committer: Rémi Duraffort 

variables:
 * print a warning when var_DelCallback can't find the callback because the
   data doesn't match
 * these warning are only for debug builds.

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

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

diff --git a/src/misc/variables.c b/src/misc/variables.c
index 4a20354..74e99f8 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -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 )




More information about the vlc-devel mailing list