[vlc-devel] commit: Avoid useless variable lookup when non debugging ( Rémi Denis-Courmont )

git version control git at videolan.org
Mon Dec 29 10:34:39 CET 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Mon Dec 29 11:33:46 2008 +0200| [8cef977d6ec67b89dff4130c93568d4c1c716c34] | committer: Rémi Denis-Courmont 

Avoid useless variable lookup when non debugging

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

 include/vlc_variables.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/vlc_variables.h b/include/vlc_variables.h
index b43a44d..0e028af 100644
--- a/include/vlc_variables.h
+++ b/include/vlc_variables.h
@@ -192,6 +192,7 @@ VLC_EXPORT( int, __var_TriggerCallback, ( vlc_object_t *, const char * ) );
  * helpers functions
  *****************************************************************************/
 
+#ifndef NDEBUG
 /**
  * This function assert the variable is of the expected type or it
  * is not defined
@@ -202,6 +203,9 @@ static inline void __var_AssertType( vlc_object_t *p_obj, const char *psz_name,
     const int i_type = __var_Type( p_obj, psz_name ) & VLC_VAR_CLASS;
     assert( i_type == 0 || i_type == (i_expected&VLC_VAR_CLASS) );
 }
+#else
+# define __var_AssertType( o, n, e ) (void)(o, n, e)
+#endif
 
 /**
  * Set the value of an integer variable




More information about the vlc-devel mailing list