[vlc-devel] [PATCH] services_discovery/microdns: fix iteration variable type compared to vlc_array_count
Filip Roséen
filip at atch.se
Mon Feb 20 15:14:57 CET 2017
Following the changes introduced by 7ecd927, the affected lines would
result in a warning due to signed vs unsigned integer comparision.
---
modules/services_discovery/microdns.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/services_discovery/microdns.c b/modules/services_discovery/microdns.c
index 2e7f94079b..b68df771db 100644
--- a/modules/services_discovery/microdns.c
+++ b/modules/services_discovery/microdns.c
@@ -233,7 +233,7 @@ items_release( struct discovery_sys *p_sys, struct item *p_item )
static bool
items_exists( struct discovery_sys *p_sys, const char *psz_uri )
{
- for( int i = 0; i < vlc_array_count( &p_sys->items ); ++i )
+ for( size_t i = 0; i < vlc_array_count( &p_sys->items ); ++i )
{
struct item *p_item = vlc_array_item_at_index( &p_sys->items, i );
if( strcmp( p_item->psz_uri, psz_uri ) == 0 )
@@ -253,7 +253,7 @@ items_timeout( struct discovery_sys *p_sys, services_discovery_t *p_sd,
mtime_t i_now = mdate();
/* Remove items that are not seen since TIMEOUT */
- for( int i = 0; i < vlc_array_count( &p_sys->items ); ++i )
+ for( size_t i = 0; i < vlc_array_count( &p_sys->items ); ++i )
{
struct item *p_item = vlc_array_item_at_index( &p_sys->items, i );
if( i_now - p_item->i_last_seen > TIMEOUT )
@@ -271,7 +271,7 @@ items_timeout( struct discovery_sys *p_sys, services_discovery_t *p_sd,
static void
items_clear( struct discovery_sys *p_sys )
{
- for( int i = 0; i < vlc_array_count( &p_sys->items ); ++i )
+ for( size_t i = 0; i < vlc_array_count( &p_sys->items ); ++i )
{
struct item *p_item = vlc_array_item_at_index( &p_sys->items, i );
items_release( p_sys, p_item );
--
2.11.1
More information about the vlc-devel
mailing list