[vlc-devel] [PATCH 11/13] access: dtv: fix undeclared lfind
Rémi Denis-Courmont
remi at remlab.net
Tue Oct 2 11:59:44 CEST 2018
No way. We are not replacing proper function calls with a hand-coding.
Le 2 octobre 2018 12:14:34 GMT+03:00, Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> a écrit :
>Fixes android NDK 17 build
>---
> modules/access/dtv/access.c | 20 ++++++--------------
> 1 file changed, 6 insertions(+), 14 deletions(-)
>
>diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
>index 5c341420ae..040a6350f2 100644
>--- a/modules/access/dtv/access.c
>+++ b/modules/access/dtv/access.c
>@@ -29,9 +29,6 @@
> #include <vlc_input.h>
> #include <vlc_plugin.h>
> #include <vlc_dialog.h>
>-#ifdef HAVE_SEARCH_H
>-#include <search.h>
>-#endif
>
> #include "dtv/dtv.h"
>
>@@ -656,11 +653,6 @@ static uint32_t var_InheritCodeRate (vlc_object_t
>*obj, const char *varname)
> return VLC_FEC_AUTO;
> }
>
>-static int modcmp (const void *a, const void *b)
>-{
>- return strcasecmp (a, *(const char *const *)b);
>-}
>-
>static const char *var_InheritModulation (vlc_object_t *obj, const char
>*var)
> {
> char *mod = var_InheritString (obj, var);
>@@ -668,12 +660,12 @@ static const char *var_InheritModulation
>(vlc_object_t *obj, const char *var)
> return "";
>
> size_t n = sizeof (modulation_vlc) / sizeof (modulation_vlc[0]);
>- const char *const *p = lfind (mod, modulation_vlc, &n, sizeof
>(mod), modcmp);
>- if (p != NULL)
>- {
>- free (mod);
>- return *p;
>- }
>+ for (int i = 0; i < n; ++i)
>+ if (!strcasecmp(modulation_vlc[i], mod))
>+ {
>+ free (mod);
>+ return modulation_vlc[i];
>+ }
>
> /* Backward compatibility with VLC < 1.2 */
> const char *str;
>--
>2.19.0
>
>_______________________________________________
>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/20181002/5ed5e654/attachment.html>
More information about the vlc-devel
mailing list