[vlc-devel] [PATCH] Fixed unused variable and parameter warnings.

Maxim Bublis b at codemonkey.ru
Mon Nov 18 08:44:48 CET 2013


---
 lib/media.c                          | 1 +
 lib/media_player.c                   | 2 ++
 modules/access/zip/zipaccess.c       | 2 ++
 modules/access/zip/zipstream.c       | 1 +
 modules/gui/eject.c                  | 1 +
 modules/lua/demux.c                  | 1 +
 modules/lua/extension.c              | 1 +
 modules/misc/gnutls.c                | 1 +
 modules/stream_out/transcode/video.c | 1 +
 modules/text_renderer/freetype.c     | 3 ++-
 modules/video_chroma/copy.c          | 1 +
 src/input/es_out.c                   | 3 +++
 src/input/es_out.h                   | 9 +++++++++
 src/input/es_out_timeshift.c         | 1 +
 src/misc/variables.c                 | 2 ++
 src/network/udp.c                    | 1 +
 src/playlist/item.c                  | 1 +
 src/posix/filesystem.c               | 5 ++++-
 src/video_output/display.c           | 4 ++++
 19 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/lib/media.c b/lib/media.c
index 7acfb69..d3b9ff9 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -125,6 +125,7 @@ static void input_item_subitem_added( const vlc_event_t *p_event,
 static void input_item_subitemtree_added( const vlc_event_t * p_event,
                                           void * user_data )
 {
+    VLC_UNUSED( p_event );
     libvlc_media_t * p_md = user_data;
     libvlc_event_t event;
 
diff --git a/lib/media_player.c b/lib/media_player.c
index c23dd42..30bda56 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -217,6 +217,7 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
                      void * p_userdata )
 {
     VLC_UNUSED(oldval);
+    VLC_UNUSED(psz_cmd);
     input_thread_t * p_input = (input_thread_t *)p_this;
     libvlc_media_player_t * p_mi = p_userdata;
     libvlc_event_t event;
@@ -938,6 +939,7 @@ void *libvlc_media_player_get_hwnd( libvlc_media_player_t *p_mi )
 #if defined (_WIN32) || defined (__OS2__)
     return (void *)(uintptr_t)var_GetInteger (p_mi, "drawable-hwnd");
 #else
+    VLC_UNUSED(p_mi);
     return NULL;
 #endif
 }
diff --git a/modules/access/zip/zipaccess.c b/modules/access/zip/zipaccess.c
index bb7f1ed..19bd60a 100644
--- a/modules/access/zip/zipaccess.c
+++ b/modules/access/zip/zipaccess.c
@@ -370,6 +370,7 @@ static int OpenFileInZip( access_t *p_access )
  *****************************************************************************/
 static void* ZCALLBACK ZipIO_Open( void* opaque, const char* file, int mode )
 {
+    VLC_UNUSED( mode );
     assert(opaque != NULL);
     assert(mode == (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_EXISTING));
 
@@ -414,6 +415,7 @@ static uLong ZCALLBACK ZipIO_Write( void* opaque, void* stream,
     (void)opaque; (void)stream; (void)buf; (void)size;
     int zip_access_cannot_write_this_should_not_happen = 0;
     assert(zip_access_cannot_write_this_should_not_happen);
+    VLC_UNUSED( zip_access_cannot_write_this_should_not_happen );
     return 0;
 }
 
diff --git a/modules/access/zip/zipstream.c b/modules/access/zip/zipstream.c
index 85e93d4..cf40b6d 100644
--- a/modules/access/zip/zipstream.c
+++ b/modules/access/zip/zipstream.c
@@ -844,6 +844,7 @@ static uLong ZCALLBACK ZipIO_Write( void* opaque, void* stream,
     (void)opaque; (void)stream; (void)buf; (void)size;
     int ERROR_zip_cannot_write_this_should_not_happen = 0;
     assert( ERROR_zip_cannot_write_this_should_not_happen );
+    VLC_UNUSED( ERROR_zip_cannot_write_this_should_not_happen );
     return 0;
 }
 
diff --git a/modules/gui/eject.c b/modules/gui/eject.c
index 6a74bdb..e4109aa 100644
--- a/modules/gui/eject.c
+++ b/modules/gui/eject.c
@@ -174,6 +174,7 @@ static int intf_Eject( vlc_object_t *p_this, const char *psz_device )
     return VLC_SUCCESS;
 
 #else
+    VLC_UNUSED( psz_device );
     msg_Warn( p_this, "CD-Rom ejection unsupported on this platform" );
     return VLC_EGENERIC;
 #endif
diff --git a/modules/lua/demux.c b/modules/lua/demux.c
index a84fd66..030e428 100644
--- a/modules/lua/demux.c
+++ b/modules/lua/demux.c
@@ -81,6 +81,7 @@ static int vlclua_demux_read( lua_State *L )
         lua_pushlstring( L, (const char *)p_read, i_read );
         int i_seek = stream_Read( p_demux->s, NULL, i_read );
         assert( i_read == i_seek );
+        VLC_UNUSED( i_seek );
     }
     else
         lua_pushnil( L );
diff --git a/modules/lua/extension.c b/modules/lua/extension.c
index d6015ba..7cc0482 100644
--- a/modules/lua/extension.c
+++ b/modules/lua/extension.c
@@ -1153,6 +1153,7 @@ static int vlclua_extension_dialog_callback( vlc_object_t *p_this,
 static void inputItemMetaChanged( const vlc_event_t *p_event,
                                   void *data )
 {
+    VLC_UNUSED( p_event );
     assert( p_event && p_event->type == vlc_InputItemMetaChanged );
 
     extension_t *p_ext = ( extension_t* ) data;
diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c
index 4a6056a..43b0584 100644
--- a/modules/misc/gnutls.c
+++ b/modules/misc/gnutls.c
@@ -530,6 +530,7 @@ static int gnutls_ServerSessionOpen (vlc_tls_creds_t *crd, vlc_tls_t *session,
         gnutls_certificate_server_set_request (session->sys->session,
                                                GNUTLS_CERT_REQUIRE);
     assert (hostname == NULL);
+    VLC_UNUSED (hostname);
     return VLC_SUCCESS;
 }
 
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index ea4bfca..aaf49f7 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -653,6 +653,7 @@ void transcode_video_close( sout_stream_t *p_stream,
 
 static void OutputFrame( sout_stream_sys_t *p_sys, picture_t *p_pic, sout_stream_t *p_stream, sout_stream_id_t *id, block_t **out )
 {
+    VLC_UNUSED( p_stream );
 
     picture_t *p_pic2 = NULL;
     bool b_need_duplicate=false;
diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 2870aa3..62db1e7 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -2198,7 +2198,7 @@ static int Create( vlc_object_t *p_this )
     char          *psz_fontname = NULL;
     char          *psz_monofontfile   = NULL;
     char          *psz_monofontfamily = NULL;
-    int            i_error = 0, fontindex = 0, monofontindex = 0;
+    int            i_error = 0, fontindex = 0;
 
     /* Allocate structure */
     p_filter->p_sys = p_sys = malloc( sizeof(*p_sys) );
@@ -2278,6 +2278,7 @@ static int Create( vlc_object_t *p_this )
     p_sys->style.psz_fontname = psz_fontname;
 #ifdef HAVE_STYLES
 #ifdef HAVE_FONTCONFIG
+    int monofontindex = 0;
     FontConfig_BuildCache( p_filter );
 
     /* */
diff --git a/modules/video_chroma/copy.c b/modules/video_chroma/copy.c
index 5593d07..9eed17f 100644
--- a/modules/video_chroma/copy.c
+++ b/modules/video_chroma/copy.c
@@ -172,6 +172,7 @@ static void SSE_SplitUV(uint8_t *dstu, size_t dstu_pitch,
                         const uint8_t *src, size_t src_pitch,
                         unsigned width, unsigned height, unsigned cpu)
 {
+    VLC_UNUSED(cpu);
     const uint8_t shuffle[] = { 0, 2, 4, 6, 8, 10, 12, 14,
                                 1, 3, 5, 7, 9, 11, 13, 15 };
     const uint8_t mask[] = { 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00,
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 5da85ea..80e6646 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -2559,6 +2559,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
         const mtime_t i_date = (mtime_t) va_arg( args, mtime_t );
 
         assert( !b_source_paused == !b_paused );
+        VLC_UNUSED( b_source_paused );
         EsOutChangePause( out, b_paused, i_date );
 
         return VLC_SUCCESS;
@@ -2570,6 +2571,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
         const int i_rate = (int)va_arg( args, int );
 
         assert( i_src_rate == i_rate );
+        VLC_UNUSED( i_src_rate );
         EsOutChangeRate( out, i_rate );
 
         return VLC_SUCCESS;
@@ -2580,6 +2582,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
         const mtime_t i_date = (mtime_t)va_arg( args, mtime_t );
 
         assert( i_date == -1 );
+        VLC_UNUSED( i_date );
         EsOutChangePosition( out );
 
         return VLC_SUCCESS;
diff --git a/src/input/es_out.h b/src/input/es_out.h
index 56cefed..21ec606 100644
--- a/src/input/es_out.h
+++ b/src/input/es_out.h
@@ -88,6 +88,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 );
+    VLC_UNUSED( i_ret );
 }
 static inline mtime_t es_out_GetWakeup( es_out_t *p_out )
 {
@@ -95,6 +96,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 );
+    VLC_UNUSED( i_ret );
     return i_wu;
 }
 static inline bool es_out_GetBuffering( es_out_t *p_out )
@@ -103,6 +105,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 );
+    VLC_UNUSED( i_ret );
     return b;
 }
 static inline bool es_out_GetEmpty( es_out_t *p_out )
@@ -111,12 +114,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 );
+    VLC_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 );
+    VLC_UNUSED( i_ret );
 }
 static inline int es_out_SetRecordState( es_out_t *p_out, bool b_record )
 {
@@ -142,6 +147,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 );
+    VLC_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 +155,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 );
+    VLC_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 +167,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 );
+    VLC_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 );
+    VLC_UNUSED( i_ret );
 }
 
 es_out_t  *input_EsOutNew( input_thread_t *, int i_rate );
diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index 0864efb..e53e65e 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -886,6 +886,7 @@ static bool TsIsUnused( ts_thread_t *p_ts )
 }
 static int TsChangePause( ts_thread_t *p_ts, bool b_source_paused, bool b_paused, mtime_t i_date )
 {
+    VLC_UNUSED( b_source_paused );
     vlc_mutex_lock( &p_ts->lock );
 
     int i_ret;
diff --git a/src/misc/variables.c b/src/misc/variables.c
index e3d56b7..89d414a 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -703,6 +703,7 @@ int var_Type( vlc_object_t *p_this, const char *psz_name )
 int var_SetChecked( vlc_object_t *p_this, const char *psz_name,
                     int expected_type, vlc_value_t val )
 {
+    VLC_UNUSED( expected_type );
     int i_ret = VLC_SUCCESS;
     variable_t *p_var;
     vlc_value_t oldval;
@@ -766,6 +767,7 @@ int var_Set( vlc_object_t *p_this, const char *psz_name, vlc_value_t val )
 int var_GetChecked( vlc_object_t *p_this, const char *psz_name,
                     int expected_type, vlc_value_t *p_val )
 {
+    VLC_UNUSED( expected_type );
     assert( p_this );
 
     vlc_object_internals_t *p_priv = vlc_internals( p_this );
diff --git a/src/network/udp.c b/src/network/udp.c
index 9f281b6..5439018 100644
--- a/src/network/udp.c
+++ b/src/network/udp.c
@@ -377,6 +377,7 @@ net_SourceSubscribe (vlc_object_t *obj, int fd,
 int net_Subscribe (vlc_object_t *obj, int fd,
                    const struct sockaddr *grp, socklen_t grplen)
 {
+    VLC_UNUSED( grplen );
 /* MCAST_JOIN_GROUP was introduced to OS X in v10.7, but it doesn't work,
  * so ignore it to use the same code as on 10.5 or 10.6 */
 #if defined (MCAST_JOIN_GROUP) && !defined (__APPLE__)
diff --git a/src/playlist/item.c b/src/playlist/item.c
index e902063..3dcead6 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -815,6 +815,7 @@ int playlist_DeleteItem( playlist_t * p_playlist, playlist_item_t *p_item,
                         bool b_stop )
 {
     assert( b_stop );
+    VLC_UNUSED( b_stop );
     return playlist_NodeDelete( p_playlist, p_item, true, false );
 }
 
diff --git a/src/posix/filesystem.c b/src/posix/filesystem.c
index c5a8f88..246133b 100644
--- a/src/posix/filesystem.c
+++ b/src/posix/filesystem.c
@@ -103,9 +103,12 @@ int vlc_openat (int dir, const char *filename, int flags, ...)
     if (fd != -1)
         fcntl (fd, F_SETFD, FD_CLOEXEC);
 #else
+	VLC_UNUSED (dir);
+	VLC_UNUSED (filename);
+	VLC_UNUSED (mode);
+
     int fd = -1;
     errno = ENOSYS;
-    (void) mode;
 #endif
     return fd;
 }
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 33734f1..607ee63 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -59,6 +59,7 @@ static picture_t *VideoBufferNew(filter_t *filter)
     assert(vd->fmt.i_chroma == fmt->i_chroma &&
            vd->fmt.i_width  == fmt->i_width  &&
            vd->fmt.i_height == fmt->i_height);
+    VLC_UNUSED(fmt);
 
     picture_pool_t *pool = vout_display_Pool(vd, 3);
     if (!pool)
@@ -1436,6 +1437,7 @@ static void SplitterPrepare(vout_display_t *vd,
                             picture_t *picture,
                             subpicture_t *subpicture)
 {
+    VLC_UNUSED(subpicture);
     vout_display_sys_t *sys = vd->sys;
 
     picture_Hold(picture);
@@ -1462,6 +1464,8 @@ static void SplitterDisplay(vout_display_t *vd,
     vout_display_sys_t *sys = vd->sys;
 
     assert(!subpicture);
+    VLC_UNUSED(subpicture);
+
     for (int i = 0; i < sys->count; i++) {
         if (sys->picture[i])
             vout_display_Display(sys->display[i], sys->picture[i], NULL);
-- 
1.8.3.4 (Apple Git-47)




More information about the vlc-devel mailing list