[vlc-commits] misc: remove unnecessary cast when using vlc_array_item_at_index

Filip Roséen git at videolan.org
Mon Oct 10 18:43:44 CEST 2016


vlc | branch: master | Filip Roséen <filip at atch.se> | Mon Oct 10 18:18:02 2016 +0200| [afbbfaad48d00b1e5989b8fcbf50980c4b472f36] | committer: Thomas Guillem

misc: remove unnecessary cast when using vlc_array_item_at_index

vlc_array_item_at_index returns a value of type pointer-to-void,
meaning that the pointer is implicitly convertible to the destination
type (there is no need for the explicit cast).

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/access_output/livehttp.c | 4 ++--
 modules/mux/asf.c                | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index 0d520d6..e79fb9f 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -614,7 +614,7 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t
             //scale to i_index_offset..numsegs + i_index_offset
             uint32_t index = i - i_firstseg + i_index_offset;
 
-            output_segment_t *segment = (output_segment_t *)vlc_array_item_at_index( p_sys->segments_t, index );
+            output_segment_t *segment = vlc_array_item_at_index( p_sys->segments_t, index );
             if( p_sys->key_uri &&
                 ( !psz_current_uri ||  strcmp( psz_current_uri, segment->psz_key_uri ) )
               )
@@ -714,7 +714,7 @@ static void closeCurrentSegment( sout_access_out_t *p_access, sout_access_out_sy
 {
     if ( p_sys->i_handle >= 0 )
     {
-        output_segment_t *segment = (output_segment_t *)vlc_array_item_at_index( p_sys->segments_t, vlc_array_count( p_sys->segments_t ) - 1 );
+        output_segment_t *segment = vlc_array_item_at_index( p_sys->segments_t, vlc_array_count( p_sys->segments_t ) - 1 );
 
         if( p_sys->key_uri )
         {
diff --git a/modules/mux/asf.c b/modules/mux/asf.c
index f4affbe..90a67e3 100644
--- a/modules/mux/asf.c
+++ b/modules/mux/asf.c
@@ -279,7 +279,7 @@ static void Close( vlc_object_t * p_this )
 
     for( int i = 0; i < vlc_array_count( p_sys->p_tracks ); i++ )
     {
-        asf_track_t *track = (asf_track_t *)vlc_array_item_at_index( p_sys->p_tracks, i );
+        asf_track_t *track = vlc_array_item_at_index( p_sys->p_tracks, i );
         free( track->p_extra );
         es_format_Clean( &track->fmt );
         free( track );



More information about the vlc-commits mailing list