[vlc-devel] [PATCH 2/2] Fix unused parameter compilation warnings

Rémi Denis-Courmont remi at remlab.net
Fri Dec 12 15:58:46 CET 2014


Le dimanche 07 décembre 2014, 23:06:48 Eduardo Vieira a écrit :
> ---
>  lib/media_player.c               | 5 ++++-
>  modules/access/zip/zipaccess.c   | 1 +
>  modules/control/gestures.c       | 1 +
>  modules/control/netsync.c        | 2 +-
>  modules/demux/mp4/mp4.c          | 1 +
>  modules/lua/extension.c          | 1 +
>  modules/stream_filter/httplive.c | 2 ++
>  src/input/es_out_timeshift.c     | 1 +
>  src/misc/variables.c             | 2 ++
>  src/playlist/item.c              | 1 +
>  src/video_output/display.c       | 2 ++
>  11 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/media_player.c b/lib/media_player.c
> index 698f8d2..7ee2a5f 100644
> --- a/lib/media_player.c
> +++ b/lib/media_player.c
> @@ -257,7 +257,7 @@ input_event_changed( vlc_object_t * p_this, char const *
> psz_cmd, vlc_value_t oldval, vlc_value_t newval,
>                       void * p_userdata )
>  {
> -    VLC_UNUSED(oldval);
> +    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;
> @@ -1009,6 +1009,7 @@ void libvlc_media_player_set_nsobject(
> libvlc_media_player_t *p_mi,
> **************************************************************************/
> void * libvlc_media_player_get_nsobject( libvlc_media_player_t *p_mi ) {
> +    VLC_UNUSED(p_mi);
>      assert (p_mi != NULL);
>  #ifdef __APPLE__
>      return var_GetAddress (p_mi, "drawable-nsobject");

Well.. not really. The parameter should and is obviously used in some cases.

Ditto below.

> @@ -1035,6 +1036,7 @@ void libvlc_media_player_set_agl(
> libvlc_media_player_t *p_mi,
> **************************************************************************/
> uint32_t libvlc_media_player_get_agl( libvlc_media_player_t *p_mi ) {
> +    VLC_UNUSED(p_mi);
>      assert (p_mi != NULL);
>  #ifdef __APPLE__
>      return var_GetInteger (p_mi, "drawable-agl");
> @@ -1086,6 +1088,7 @@ void libvlc_media_player_set_hwnd(
> libvlc_media_player_t *p_mi,
> **************************************************************************/
> void *libvlc_media_player_get_hwnd( libvlc_media_player_t *p_mi ) {
> +    VLC_UNUSED(p_mi);
>      assert (p_mi != NULL);
>  #if defined (_WIN32) || defined (__OS2__)
>      return (void *)(uintptr_t)var_GetInteger (p_mi, "drawable-hwnd");
> diff --git a/modules/access/zip/zipaccess.c b/modules/access/zip/zipaccess.c
> index 24064a0..852226f 100644
> --- a/modules/access/zip/zipaccess.c
> +++ b/modules/access/zip/zipaccess.c
> @@ -372,6 +372,7 @@ static void* ZCALLBACK ZipIO_Open( void* opaque, const
> char* file, int mode ) {
>      assert(opaque != NULL);
>      assert(mode == (ZLIB_FILEFUNC_MODE_READ |
> ZLIB_FILEFUNC_MODE_EXISTING)); +    VLC_UNUSED( mode );
> 
>      access_t *p_access = (access_t*) opaque;
> 
> diff --git a/modules/control/gestures.c b/modules/control/gestures.c
> index 2b40fc4..e00e9e7 100644
> --- a/modules/control/gestures.c
> +++ b/modules/control/gestures.c
> @@ -504,6 +504,7 @@ static int PlaylistEvent( vlc_object_t *p_this, char
> const *psz_var, if( p_sys->p_input != NULL )
>      {
>          assert( p_sys->p_input == oldval.p_address );
> +        VLC_UNUSED( oldval );
>          var_DelCallback( p_sys->p_input, "intf-event", InputEvent, p_intf
> ); }
> 
> diff --git a/modules/control/netsync.c b/modules/control/netsync.c
> index 05b18b2..3a98b33 100644
> --- a/modules/control/netsync.c
> +++ b/modules/control/netsync.c
> @@ -275,7 +275,7 @@ static void *Slave(void *handle)
>  static int PlaylistEvent(vlc_object_t *object, char const *cmd,
>                           vlc_value_t oldval, vlc_value_t newval, void
> *data) {
> -    VLC_UNUSED(cmd); VLC_UNUSED(object);
> +    VLC_UNUSED(cmd); VLC_UNUSED(object); VLC_UNUSED(oldval);
>      intf_thread_t  *intf = data;
>      intf_sys_t     *sys = intf->p_sys;
>      input_thread_t *input = newval.p_address;
> diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
> index aecc247..a5eda1d 100644
> --- a/modules/demux/mp4/mp4.c
> +++ b/modules/demux/mp4/mp4.c
> @@ -3957,6 +3957,7 @@ static bool BoxExistsInRootTree( MP4_Box_t *p_root,
> uint32_t i_type, off_t i_pos if ( p_root->i_pos == i_pos )
>          {
>              assert( i_type == p_root->i_type );
> +            VLC_UNUSED( i_type );
>              break;
>          }
>          p_root = p_root->p_next;
> diff --git a/modules/lua/extension.c b/modules/lua/extension.c
> index 5958af1..da9c2be 100644
> --- a/modules/lua/extension.c
> +++ b/modules/lua/extension.c
> @@ -1169,6 +1169,7 @@ static void inputItemMetaChanged( const vlc_event_t
> *p_event, void *data )
>  {
>      assert( p_event && p_event->type == vlc_InputItemMetaChanged );
> +    VLC_UNUSED( p_event );
> 
>      extension_t *p_ext = ( extension_t* ) data;
>      assert( p_ext != NULL );
> diff --git a/modules/stream_filter/httplive.c
> b/modules/stream_filter/httplive.c index d66ee28..03c537e 100644
> --- a/modules/stream_filter/httplive.c
> +++ b/modules/stream_filter/httplive.c
> @@ -931,6 +931,7 @@ static int parse_Version(stream_t *s, hls_stream_t *hls,
> char *p_read) static int parse_EndList(stream_t *s, hls_stream_t *hls)
>  {
>      assert(hls);
> +    VLC_UNUSED( hls );
> 
>      s->p_sys->b_live = false;
>      msg_Dbg(s, "video on demand (vod) mode");
> @@ -940,6 +941,7 @@ static int parse_EndList(stream_t *s, hls_stream_t *hls)
> static int parse_Discontinuity(stream_t *s, hls_stream_t *hls, char
> *p_read) {
>      assert(hls);
> +    VLC_UNUSED( hls );
> 
>      /* FIXME: Do we need to act on discontinuity ?? */
>      msg_Dbg(s, "#EXT-X-DISCONTINUITY %s", p_read);
> diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
> index c12d73a..434ce36 100644
> --- a/src/input/es_out_timeshift.c
> +++ b/src/input/es_out_timeshift.c
> @@ -884,6 +884,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 04b3750..42ddbf4 100644
> --- a/src/misc/variables.c
> +++ b/src/misc/variables.c
> @@ -706,6 +706,7 @@ int var_SetChecked( vlc_object_t *p_this, const char
> *psz_name, assert( expected_type == 0 ||
>              (p_var->i_type & VLC_VAR_CLASS) == expected_type );
>      assert ((p_var->i_type & VLC_VAR_CLASS) != VLC_VAR_VOID);
> +    VLC_UNUSED( expected_type );
> 
>      WaitUnused( p_this, p_var );
> 
> @@ -763,6 +764,7 @@ int var_GetChecked( vlc_object_t *p_this, const char
> *psz_name, assert( expected_type == 0 ||
>                  (p_var->i_type & VLC_VAR_CLASS) == expected_type );
>          assert ((p_var->i_type & VLC_VAR_CLASS) != VLC_VAR_VOID);
> +        VLC_UNUSED( expected_type );
> 
>          /* Really get the variable */
>          *p_val = p_var->val;
> diff --git a/src/playlist/item.c b/src/playlist/item.c
> index e51637f..5aa6fe4 100644
> --- a/src/playlist/item.c
> +++ b/src/playlist/item.c
> @@ -814,6 +814,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/video_output/display.c b/src/video_output/display.c
> index ec77b12..a8d1389 100644
> --- a/src/video_output/display.c
> +++ b/src/video_output/display.c
> @@ -1405,6 +1405,7 @@ static void SplitterPrepare(vout_display_t *vd,
> 
>      picture_Hold(picture);
>      assert(!subpicture);
> +    VLC_UNUSED( subpicture );
> 
>      if (video_splitter_Filter(sys->splitter, sys->picture, picture)) {
>          for (int i = 0; i < sys->count; i++)
> @@ -1427,6 +1428,7 @@ 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);

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list