[vlc-commits] podcast: reduce scope of one variable

Rémi Denis-Courmont git at videolan.org
Sun Apr 9 16:29:12 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Apr  9 17:27:54 2017 +0300| [acccfe4a36cd774b6402b29e19c3158946c19173] | committer: Rémi Denis-Courmont

podcast: reduce scope of one variable

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

 modules/services_discovery/podcast.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/services_discovery/podcast.c b/modules/services_discovery/podcast.c
index f945193d75..313e92c3a2 100644
--- a/modules/services_discovery/podcast.c
+++ b/modules/services_discovery/podcast.c
@@ -173,7 +173,6 @@ static void Close( vlc_object_t *p_this )
     services_discovery_t *p_sd = ( services_discovery_t* )p_this;
     services_discovery_sys_t *p_sys = p_sd->p_sys;
     vlc_object_t *pl = p_sd->obj.parent;
-    int i;
 
     vlc_cancel (p_sys->thread);
     vlc_join (p_sys->thread, NULL);
@@ -183,7 +182,7 @@ static void Close( vlc_object_t *p_this )
     vlc_cond_destroy( &p_sys->wait );
     vlc_mutex_destroy( &p_sys->lock );
 
-    for( i = 0; i < p_sys->i_input; i++ )
+    for( int i = 0; i < p_sys->i_input; i++ )
     {
         input_thread_t *p_input = p_sd->p_sys->pp_input[i];
         if( !p_input )
@@ -195,11 +194,15 @@ static void Close( vlc_object_t *p_this )
         p_sd->p_sys->pp_input[i] = NULL;
     }
     free( p_sd->p_sys->pp_input );
-    for( i = 0; i < p_sys->i_urls; i++ ) free( p_sys->ppsz_urls[i] );
+
+    for( int i = 0; i < p_sys->i_urls; i++ )
+         free( p_sys->ppsz_urls[i] );
     free( p_sys->ppsz_urls );
-    for( i = 0; i < p_sys->i_items; i++ )
+
+    for( int i = 0; i < p_sys->i_items; i++ )
          input_item_Release( p_sys->pp_items[i] );
     free( p_sys->pp_items );
+
     free( p_sys->psz_request );
     free( p_sys );
 }



More information about the vlc-commits mailing list