[vlc-devel] [PATCH] input: void cast variable to silence warning

Ian Chamberlain ian.h.chamberlain at gmail.com
Tue Mar 3 04:16:38 CET 2015


There was an unused variable warning for i_ret. This should silence the warnings with a portable nop.
---
 src/input/es_out.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/input/es_out.h b/src/input/es_out.h
index 56cefed..af55a22 100644
--- a/src/input/es_out.h
+++ b/src/input/es_out.h
@@ -25,6 +25,8 @@
 #ifndef LIBVLC_INPUT_ES_OUT_H
 #define LIBVLC_INPUT_ES_OUT_H 1
 
+#define UNUSED(x) ((void)(x))
+
 #include <vlc_common.h>
 
 enum es_out_mode_e
@@ -88,6 +90,7 @@ static inline void es_out_SetMode( es_out_t *p_out, int i_mode )
 {
     int i_ret = es_out_Control( p_out, ES_OUT_SET_MODE, i_mode );
     assert( !i_ret );
+    UNUSED(i_ret);
 }
 static inline mtime_t es_out_GetWakeup( es_out_t *p_out )
 {
@@ -95,6 +98,7 @@ static inline mtime_t es_out_GetWakeup( es_out_t *p_out )
     int i_ret = es_out_Control( p_out, ES_OUT_GET_WAKE_UP, &i_wu );
 
     assert( !i_ret );
+    UNUSED(i_ret);
     return i_wu;
 }
 static inline bool es_out_GetBuffering( es_out_t *p_out )
@@ -103,6 +107,7 @@ static inline bool es_out_GetBuffering( es_out_t *p_out )
     int i_ret = es_out_Control( p_out, ES_OUT_GET_BUFFERING, &b );
 
     assert( !i_ret );
+    UNUSED(i_ret);
     return b;
 }
 static inline bool es_out_GetEmpty( es_out_t *p_out )
@@ -111,12 +116,14 @@ static inline bool es_out_GetEmpty( es_out_t *p_out )
     int i_ret = es_out_Control( p_out, ES_OUT_GET_EMPTY, &b );
 
     assert( !i_ret );
+    UNUSED(i_ret);
     return b;
 }
 static inline void es_out_SetDelay( es_out_t *p_out, int i_cat, mtime_t i_delay )
 {
     int i_ret = es_out_Control( p_out, ES_OUT_SET_DELAY, i_cat, i_delay );
     assert( !i_ret );
+    UNUSED(i_ret);
 }
 static inline int es_out_SetRecordState( es_out_t *p_out, bool b_record )
 {
@@ -142,6 +149,7 @@ static inline void es_out_SetTimes( es_out_t *p_out, double f_position, mtime_t
 {
     int i_ret = es_out_Control( p_out, ES_OUT_SET_TIMES, f_position, i_time, i_length );
     assert( !i_ret );
+    UNUSED(i_ret);
 }
 static inline void es_out_SetJitter( es_out_t *p_out,
                                      mtime_t i_pts_delay, mtime_t i_pts_jitter, int i_cr_average )
@@ -149,6 +157,7 @@ static inline void es_out_SetJitter( es_out_t *p_out,
     int i_ret = es_out_Control( p_out, ES_OUT_SET_JITTER,
                                 i_pts_delay, i_pts_jitter, i_cr_average );
     assert( !i_ret );
+    UNUSED(i_ret);
 }
 static inline int es_out_GetEsObjects( es_out_t *p_out, int i_id,
                                        vlc_object_t **pp_decoder, vout_thread_t **pp_vout, audio_output_t **pp_aout )
@@ -160,12 +169,14 @@ static inline int es_out_GetGroupForced( es_out_t *p_out )
     int i_group;
     int i_ret = es_out_Control( p_out, ES_OUT_GET_GROUP_FORCED, &i_group );
     assert( !i_ret );
+    UNUSED(i_ret);
     return i_group;
 }
 static inline void es_out_Eos( es_out_t *p_out )
 {
     int i_ret = es_out_Control( p_out, ES_OUT_SET_EOS );
     assert( !i_ret );
+    UNUSED(i_ret);
 }
 
 es_out_t  *input_EsOutNew( input_thread_t *, int i_rate );
-- 
2.3.1




More information about the vlc-devel mailing list