[vlc-commits] input/meta: narrow scope of iteration variables

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:17:55 2016 +0200| [ee4c0901e859c65446e244397ad9cc0fd3a6c1dd] | committer: Thomas Guillem

input/meta: narrow scope of iteration variables

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

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

 src/input/meta.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/input/meta.c b/src/input/meta.c
index 8353a5e..2102eed 100644
--- a/src/input/meta.c
+++ b/src/input/meta.c
@@ -109,8 +109,7 @@ static void vlc_meta_FreeExtraKey( void *p_data, void *p_obj )
 
 void vlc_meta_Delete( vlc_meta_t *m )
 {
-    int i;
-    for( i = 0; i < VLC_META_TYPE_COUNT ; i++ )
+    for( int i = 0; i < VLC_META_TYPE_COUNT ; i++ )
         free( m->ppsz_meta[i] );
     vlc_dictionary_clear( &m->extra_tags, vlc_meta_FreeExtraKey, NULL );
     free( m );
@@ -178,12 +177,11 @@ void vlc_meta_SetStatus( vlc_meta_t *m, int status )
 void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src )
 {
     char **ppsz_all_keys;
-    int i;
 
     if( !dst || !src )
         return;
 
-    for( i = 0; i < VLC_META_TYPE_COUNT; i++ )
+    for( int i = 0; i < VLC_META_TYPE_COUNT; i++ )
     {
         if( src->ppsz_meta[i] )
         {
@@ -194,7 +192,7 @@ void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src )
 
     /* XXX: If speed up are needed, it is possible */
     ppsz_all_keys = vlc_dictionary_all_keys( &src->extra_tags );
-    for( i = 0; ppsz_all_keys && ppsz_all_keys[i]; i++ )
+    for( int i = 0; ppsz_all_keys && ppsz_all_keys[i]; i++ )
     {
         /* Always try to remove the previous value */
         vlc_dictionary_remove_value_for_key( &dst->extra_tags, ppsz_all_keys[i], vlc_meta_FreeExtraKey, NULL );



More information about the vlc-commits mailing list