[vlc-devel] commit: Put (void)val; here and there to tell gcc we used the variable. ( Sam Hocevar )

git version control git at videolan.org
Thu Mar 20 18:45:07 CET 2008


vlc | branch: master | Sam Hocevar <sam at zoy.org> | Thu Mar 20 16:59:11 2008 +0000| [cfc98288babeb803bbeb85198fbad529cb35b659]

Put (void)val; here and there to tell gcc we used the variable.

The spin_lock wrappers do not use the return value of the functions they
wrap, resulting in dozens of compiler warnings because they are inline
functions. There is no elegant solution to this, I hope using (void)val;
is the least shocking alternative.

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

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

diff --git a/include/vlc_threads_funcs.h b/include/vlc_threads_funcs.h
index 7add0dc..bf0566a 100644
--- a/include/vlc_threads_funcs.h
+++ b/include/vlc_threads_funcs.h
@@ -581,6 +581,7 @@ static inline void vlc_spin_lock (vlc_spinlock_t *spin)
 {
     int val = pthread_spin_lock (&spin->spin);
     assert (val == 0);
+    (void)val;
 }
 
 /**
@@ -590,6 +591,7 @@ static inline void vlc_spin_unlock (vlc_spinlock_t *spin)
 {
     int val = pthread_spin_unlock (&spin->spin);
     assert (val == 0);
+    (void)val;
 }
 
 /**
@@ -599,6 +601,7 @@ static inline void vlc_spin_destroy (vlc_spinlock_t *spin)
 {
     int val = pthread_spin_destroy (&spin->spin);
     assert (val == 0);
+    (void)val;
 }
 
 #elif defined( WIN32 )




More information about the vlc-devel mailing list