[vlc-commits] compat: lfind: fix warnings

Alexandre Janniaux git at videolan.org
Thu Feb 20 10:09:51 CET 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Wed Feb 19 00:24:13 2020 +0100| [a2e2cf0ab0768109dd5f72d1aeeee241b1b13185] | committer: Thomas Guillem

compat: lfind: fix warnings

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

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

 compat/lfind.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compat/lfind.c b/compat/lfind.c
index d62b2cfd9b..d66029f9dc 100644
--- a/compat/lfind.c
+++ b/compat/lfind.c
@@ -9,11 +9,11 @@
 void *lfind(const void *key, const void *base, size_t *nmemb,
             size_t size, int(*cmp)(const void *, const void *))
 {
-    for (int i = 0; i < *nmemb; ++i)
+    for (size_t i = 0; i < *nmemb; ++i)
     {
-        const void *elem = base + i * size;
+        const void *elem = (const char*)base + i * size;
         if (!cmp(key, elem))
-            return elem;
+            return (void*)elem;
     }
     return NULL;
 }



More information about the vlc-commits mailing list