[vlc-devel] [PATCH] access: dtv: fix lfind call with different prototypes in mingw32
Rémi Denis-Courmont
remi at remlab.net
Fri Jul 12 09:14:58 CEST 2019
Hi,
size_t and unsigned should be the same on Win32, so I don't exactly see the point.
Of course, there *is* a problem on Win64, but either MingW should be fixed or a systematic work-around should be used,m (e.g. #define lfind lfind_size_t), otherwise the same bug will reoccur silently (only on 64-bits Windows) every time lfind() is used.
Le 12 juillet 2019 09:21:32 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>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
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel
--
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190712/9dfaeee0/attachment.html>
More information about the vlc-devel
mailing list