[vlc-devel] [PATCH] compat: lfind: fix warnings
Alexandre Janniaux
ajanni at videolabs.io
Wed Feb 19 00:24:13 CET 2020
---
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;
}
--
2.25.0
More information about the vlc-devel
mailing list