[vlc-devel] [PATCH] fix lfind errors on windows

Martell Malone martellmalone at gmail.com
Tue Nov 4 13:11:32 CET 2014


I also just realised there was a typo in the patch that would explain a
build error also
it had
size_t_n;
instead of
size_t n;

Updated

>From 6986255c94efb86291545e7ac504440c6d2e812c Mon Sep 17 00:00:00 2001
From: martell <martellmalone at gmail.com>
Date: Mon, 3 Nov 2014 12:38:27 +0000
Subject: [PATCH] lfind: msvcrt always use unsigned int* arg
---
 modules/access/dtv/access.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
index 95b1dd7..433e65d 100644
--- a/modules/access/dtv/access.c
+++ b/modules/access/dtv/access.c
@@ -727,8 +727,13 @@ static const char *var_InheritModulation (vlc_object_t
*obj, const char *var)
     char *mod = var_InheritString (obj, var);
     if (mod == NULL)
         return "";
-
-    size_t n = sizeof (modulation_vlc) / sizeof (modulation_vlc[0]);
+
+#ifdef __MINGW32__
+    unsigned int n;
+#else
+    size_t n;
+#endif
+    n = sizeof (modulation_vlc) / sizeof (modulation_vlc[0]);
     const char *const *p = lfind (mod, modulation_vlc, &n, sizeof (mod),
modcmp);
     if (p != NULL)
     {


On Tue, Nov 4, 2014 at 12:03 PM, Martell Malone <martellmalone at gmail.com>
wrote:

> My advice is to fix MingW and ignore the warning in the mean time.
>
>
> The issue here is there is nothing wrong with mingw-w64 as they link to
> msvcrt
> As defined here http://msdn.microsoft.com/en-us/library/a6xkkxfz.aspx
>
> On little endian we can just ignore the warning but depending in the
> strictness of the build / package system this is not an option.
> I'll CC this to Kai one of the maintainers of mingw-w64 and see whats
> possible on their end.
>
> I'm not fully sure but it may or may not be possible for them to change to
> size_t pointer.
> Ultimately this is the fault of some Microsoft architect who didn't care
> about x64 at the time msvcrt was created.
>
>
>
>
> On Mon, Nov 3, 2014 at 3:58 PM, Rémi Denis-Courmont <remi at remlab.net>
> wrote:
>
>> Le lundi 03 novembre 2014, 12:58:05 Martell Malone a écrit :
>> > Their advice is for vlc to make an exception when using lfind.
>>
>> My advice is to fix MingW and ignore the warning in the mean time.
>>
>> --
>> Rémi Denis-Courmont
>> http://www.remlab.net/
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20141104/74eef0c8/attachment.html>


More information about the vlc-devel mailing list