Browse Source

compat: tfind: fix prototype

Use prototype from tsearch(3), fixes the following warning when
targetin Android arm API 17.

../../src/misc/variables.c:154:32: warning: passing 'void **' to
parameter of type 'const void **' discards qualifiers in nested
pointer types [-Wincompatible-pointer-types-discards-qualifiers]

    pp_var = tfind( &psz_name, &priv->var_root, varcmp );
                               ^~~~~~~~~~~~~~~
pull/108/head
Alexandre Janniaux 6 years ago
parent
commit
e1c1eac150
  1. 2
      compat/tfind.c
  2. 2
      include/vlc_fixups.h

2
compat/tfind.c

@ -132,7 +132,7 @@ tdestroy(vrootp, freefct)
void *
tfind(vkey, vrootp, compar)
const void *vkey; /* key to be found */
const void **vrootp; /* address of the tree root */
void * const *vrootp; /* address of the tree root */
int (*compar) (const void *, const void *);
{
node_t * const *rootp = (node_t * const*)vrootp;

2
include/vlc_fixups.h

@ -497,7 +497,7 @@ typedef enum {
} VISIT;
void *tsearch( const void *key, void **rootp, int(*cmp)(const void *, const void *) );
void *tfind( const void *key, const void **rootp, int(*cmp)(const void *, const void *) );
void *tfind( const void *key, void * const *rootp, int(*cmp)(const void *, const void *) );
void *tdelete( const void *key, void **rootp, int(*cmp)(const void *, const void *) );
void twalk( const void *root, void(*action)(const void *nodep, VISIT which, int depth) );
void *lfind( const void *key, const void *base, size_t *nmemb,

Loading…
Cancel
Save