[vlc-commits] playlist/item: narrow scope of iteration variables

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


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

playlist/item: 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=06bb472feceb179c936d4b6d65ad1d1172cfc085
---

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

diff --git a/src/playlist/item.c b/src/playlist/item.c
index 24aad99..e5ac372 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -631,8 +631,7 @@ playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
                                                     playlist_item_t *p_root,
                                                     bool b_items_only )
 {
-    int i;
-    for( i = 0 ; i< p_root->i_children ; i++ )
+    for( int i = 0 ; i< p_root->i_children ; i++ )
     {
         if( ( b_items_only ? p_root->pp_children[i]->i_children == -1 : 1 ) &&
             p_root->pp_children[i]->p_input == p_item )
@@ -713,8 +712,7 @@ int playlist_TreeMoveMany( playlist_t *p_playlist,
 
     if ( p_node->i_children == -1 ) return VLC_EGENERIC;
 
-    int i;
-    for( i = 0; i < i_items; i++ )
+    for( int i = 0; i < i_items; i++ )
     {
         playlist_item_t *p_item = pp_items[i];
         int i_index = ItemIndex( p_item );
@@ -722,7 +720,7 @@ int playlist_TreeMoveMany( playlist_t *p_playlist,
         REMOVE_ELEM( p_parent->pp_children, p_parent->i_children, i_index );
         if ( p_parent == p_node && i_index < i_newpos ) i_newpos--;
     }
-    for( i = i_items - 1; i >= 0; i-- )
+    for( int i = i_items - 1; i >= 0; i-- )
     {
         playlist_item_t *p_item = pp_items[i];
         INSERT_ELEM( p_node->pp_children, p_node->i_children, i_newpos, p_item );



More information about the vlc-commits mailing list