Commit 6e9fba8c authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf

lib/media_list_path: narrow scope of iteration variables

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 66f97910
......@@ -38,8 +38,7 @@ static inline void libvlc_media_list_path_dump( const libvlc_media_list_path_t p
return;
}
int i;
for(i = 0; path[i] != -1; i++)
for(int i = 0; path[i] != -1; i++)
printf("%s%d", i > 0 ? "/" : "", path[i]);
printf("\n");
}
......@@ -118,9 +117,9 @@ static inline libvlc_media_list_path_t libvlc_media_list_path_copy( const libvlc
static libvlc_media_list_path_t
get_path_rec( const libvlc_media_list_path_t path, libvlc_media_list_t * p_current_mlist, libvlc_media_t * p_searched_md )
{
int i, count;
count = libvlc_media_list_count( p_current_mlist );
for( i = 0; i < count; i++ )
int count = libvlc_media_list_count( p_current_mlist );
for( int i = 0; i < count; i++ )
{
libvlc_media_t * p_md = libvlc_media_list_item_at_index( p_current_mlist, i );
......@@ -163,11 +162,10 @@ static libvlc_media_t *
libvlc_media_list_item_at_path( libvlc_media_list_t * p_mlist, const libvlc_media_list_path_t path )
{
libvlc_media_list_t * p_current_mlist = p_mlist;
libvlc_media_t * p_md = NULL;
int i;
for( i = 0; path[i] != -1; i++ )
for( int i = 0; path[i] != -1; i++ )
{
p_md = libvlc_media_list_item_at_index( p_current_mlist, path[i] );
libvlc_media_t* p_md = libvlc_media_list_item_at_index( p_current_mlist, path[i] );
if( p_current_mlist != p_mlist )
libvlc_media_list_release( p_current_mlist );
......@@ -196,9 +194,8 @@ static libvlc_media_list_t *
libvlc_media_list_parentlist_at_path( libvlc_media_list_t * p_mlist, const libvlc_media_list_path_t path )
{
libvlc_media_list_t * p_current_mlist = p_mlist;
libvlc_media_t * p_md = NULL;
int i;
for( i = 0; path[i] != -1; i++ )
for( int i = 0; path[i] != -1; i++ )
{
if( p_current_mlist != p_mlist )
libvlc_media_list_release( p_current_mlist );
......@@ -209,7 +206,7 @@ libvlc_media_list_parentlist_at_path( libvlc_media_list_t * p_mlist, const libvl
return p_current_mlist;
}
p_md = libvlc_media_list_item_at_index( p_current_mlist, path[i] );
libvlc_media_t* p_md = libvlc_media_list_item_at_index( p_current_mlist, path[i] );
p_current_mlist = libvlc_media_subitems( p_md );
libvlc_media_release( p_md );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment