[vlc-devel] [PATCH] interface/dialog: fix iteration variable type compared to vlc_array_count

Filip Roséen filip at atch.se
Mon Feb 20 15:15:04 CET 2017


Following the changes introduced by 7ecd927, the affected lines would
result in a warning due to signed vs unsigned integer comparision.
---
 src/interface/dialog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/interface/dialog.c b/src/interface/dialog.c
index 10e515db40..d174de15ed 100644
--- a/src/interface/dialog.c
+++ b/src/interface/dialog.c
@@ -169,7 +169,7 @@ libvlc_InternalDialogInit(libvlc_int_t *p_libvlc)
 static int
 dialog_get_idx_locked(vlc_dialog_provider *p_provider, vlc_dialog_id *p_id)
 {
-    for (int i = 0; i < vlc_array_count(&p_provider->dialog_array); ++i)
+    for (size_t i = 0; i < vlc_array_count(&p_provider->dialog_array); ++i)
     {
         if (p_id == vlc_array_item_at_index(&p_provider->dialog_array, i))
             return i;
@@ -231,7 +231,7 @@ dialog_remove_locked(vlc_dialog_provider *p_provider, vlc_dialog_id *p_id)
 static void
 dialog_clear_all_locked(vlc_dialog_provider *p_provider)
 {
-    for (int i = 0; i < vlc_array_count(&p_provider->dialog_array); ++i)
+    for (size_t i = 0; i < vlc_array_count(&p_provider->dialog_array); ++i)
     {
         vlc_dialog_id *p_id =
             vlc_array_item_at_index(&p_provider->dialog_array, i);
-- 
2.11.1



More information about the vlc-devel mailing list