[vlc-devel] [PATCH] access: dtv: fix lfind call with different prototypes in mingw32

Steve Lhomme robux4 at ycbcr.xyz
Fri Jul 12 08:21:32 CEST 2019


It expects an input 'unsigned int' instead of 'size_t' even though it's not
writing on the source.

Given there's no versioning on mingw32 we can't rely on such a header version
to do this trick or not
---
 modules/access/dtv/access.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
index 0a4b0ae3c1..ef70be324a 100644
--- a/modules/access/dtv/access.c
+++ b/modules/access/dtv/access.c
@@ -666,7 +666,12 @@ static const char *var_InheritModulation (vlc_object_t *obj, const char *var)
     if (mod == NULL)
         return "";
 
-    size_t n = sizeof (modulation_vlc) / sizeof (modulation_vlc[0]);
+#ifdef _WIN32
+    unsigned int n;
+#else /* !_WIN32 */
+    size_t n;
+#endif /* !_WIN32 */
+    n = sizeof (modulation_vlc) / sizeof (modulation_vlc[0]);
     const char *const *p = lfind (mod, modulation_vlc, &n, sizeof (mod), modcmp);
     if (p != NULL)
     {
-- 
2.17.1



More information about the vlc-devel mailing list