[vlc-commits] objects: fix NDEBUG-only warning

Rémi Denis-Courmont git at videolan.org
Wed Apr 24 18:08:56 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr 24 19:08:37 2013 +0300| [1632c6dd8d7ecb41e0e9f77854481b2dc1dc49f4] | committer: Rémi Denis-Courmont

objects: fix NDEBUG-only warning

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

 src/misc/objects.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/misc/objects.c b/src/misc/objects.c
index e276d84..49974c6 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -463,9 +463,12 @@ vlc_object_t *vlc_object_find_name( vlc_object_t *p_this, const char *psz_name )
 void * vlc_object_hold( vlc_object_t *p_this )
 {
     vlc_object_internals_t *internals = vlc_internals( p_this );
+#ifndef NDEBUG
     unsigned refs = atomic_fetch_add (&internals->refs, 1);
-
-    assert (refs > 0); /* Avoid obvious freed object uses */ (void) refs;
+    assert (refs > 0); /* Avoid obvious freed object uses */
+#else
+    atomic_fetch_add (&internals->refs, 1);
+#endif
     return p_this;
 }
 



More information about the vlc-commits mailing list