make more like NetBSD one -- now compiles w/o warnings
This commit is contained in:
22
lsearch.c
22
lsearch.c
@@ -50,35 +50,33 @@ static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93";
|
|||||||
#include "emul/search.h"
|
#include "emul/search.h"
|
||||||
|
|
||||||
|
|
||||||
static VOID *linear_base __P((const VOID *, VOID *, size_t *, size_t,
|
typedef int (*cmp_fn_t) __P((const VOID *, const VOID *));
|
||||||
int (*)(const VOID *, const VOID *), int));
|
static VOID *linear_base __P((const VOID *, const VOID *, size_t *, size_t,
|
||||||
|
cmp_fn_t, int));
|
||||||
|
|
||||||
VOID *
|
VOID *
|
||||||
lsearch(key, base, nelp, width, compar)
|
lsearch(key, base, nelp, width, compar)
|
||||||
const VOID *key;
|
const VOID *key, *base;
|
||||||
VOID *base;
|
|
||||||
size_t *nelp, width;
|
size_t *nelp, width;
|
||||||
int (*compar) __P((const VOID *, const VOID *));
|
cmp_fn_t compar;
|
||||||
{
|
{
|
||||||
return(linear_base(key, base, nelp, width, compar, 1));
|
return(linear_base(key, base, nelp, width, compar, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID *
|
VOID *
|
||||||
lfind(key, base, nelp, width, compar)
|
lfind(key, base, nelp, width, compar)
|
||||||
const VOID *key;
|
const VOID *key, *base;
|
||||||
const VOID *base;
|
|
||||||
size_t *nelp, width;
|
size_t *nelp, width;
|
||||||
int (*compar) __P((const VOID *, const VOID *));
|
cmp_fn_t compar;
|
||||||
{
|
{
|
||||||
return(linear_base(key, base, nelp, width, compar, 0));
|
return(linear_base(key, base, nelp, width, compar, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID *
|
static VOID *
|
||||||
linear_base(key, base, nelp, width, compar, add_flag)
|
linear_base(key, base, nelp, width, compar, add_flag)
|
||||||
const VOID *key;
|
const VOID *key, *base;
|
||||||
VOID *base;
|
|
||||||
size_t *nelp, width;
|
size_t *nelp, width;
|
||||||
int (*compar) __P((const VOID *, const VOID *));
|
cmp_fn_t compar;
|
||||||
int add_flag;
|
int add_flag;
|
||||||
{
|
{
|
||||||
/* strict ANSI does not allow pointer arithmetic on void *'s */
|
/* strict ANSI does not allow pointer arithmetic on void *'s */
|
||||||
@@ -101,6 +99,6 @@ linear_base(key, base, nelp, width, compar, add_flag)
|
|||||||
* manual.
|
* manual.
|
||||||
*/
|
*/
|
||||||
++*nelp;
|
++*nelp;
|
||||||
(void) memcpy(end, key, width);
|
(void) memcpy((VOID *)end, key, width);
|
||||||
return((VOID *) end);
|
return((VOID *) end);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user