[vlc-commits] demux/mpc: remove redundant casts

Filip Roséen git at videolan.org
Mon Mar 20 14:36:51 CET 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Mon Mar 20 14:26:52 2017 +0100| [cbe4aeae24293d60f7ace3cf7934bd514d862ad1] | committer: Hugo Beauzée-Luyssen

demux/mpc: remove redundant casts

The type yield by "va_arg( args, T )" is already guaranteed to be T,
there's no need for the explicit extra cast.

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 modules/demux/mpc.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/demux/mpc.c b/modules/demux/mpc.c
index eb70726..75ea342 100644
--- a/modules/demux/mpc.c
+++ b/modules/demux/mpc.c
@@ -321,12 +321,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return vlc_stream_vaControl( p_demux->s, i_query, args );
 
         case DEMUX_HAS_UNSUPPORTED_META:
-            pb_bool = (bool*)va_arg( args, bool* );
+            pb_bool = va_arg( args, bool* );
             *pb_bool = true;
             return VLC_SUCCESS;
 
         case DEMUX_GET_LENGTH:
-            pi64 = (int64_t*)va_arg( args, int64_t * );
+            pi64 = va_arg( args, int64_t * );
 #ifndef HAVE_MPC_MPCDEC_H
             *pi64 = CLOCK_FREQ * p_sys->info.pcm_samples /
                         p_sys->info.sample_freq;
@@ -338,7 +338,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_POSITION:
-            pf = (double*)va_arg( args, double * );
+            pf = va_arg( args, double * );
 #ifndef HAVE_MPC_MPCDEC_H
             if( p_sys->info.pcm_samples > 0 )
                 *pf = (double) p_sys->i_position /
@@ -353,13 +353,13 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = (int64_t*)va_arg( args, int64_t * );
+            pi64 = va_arg( args, int64_t * );
             *pi64 = CLOCK_FREQ * p_sys->i_position /
                         p_sys->info.sample_freq;
             return VLC_SUCCESS;
 
         case DEMUX_SET_POSITION:
-            f = (double)va_arg( args, double );
+            f = va_arg( args, double );
 #ifndef HAVE_MPC_MPCDEC_H
             i64 = (int64_t)(f * p_sys->info.pcm_samples);
             if( mpc_decoder_seek_sample( &p_sys->decoder, i64 ) )
@@ -375,7 +375,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_EGENERIC;
 
         case DEMUX_SET_TIME:
-            i64 = (int64_t)va_arg( args, int64_t );
+            i64 = va_arg( args, int64_t );
 #ifndef HAVE_MPC_MPCDEC_H
             if( mpc_decoder_seek_sample( &p_sys->decoder, i64 ) )
 #else



More information about the vlc-commits mailing list