mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-05-22 13:35:05 +02:00
Use ANSI C prototypes
This commit is contained in:
parent
32388fe59f
commit
a6a101effa
@ -130,10 +130,8 @@
|
|||||||
* only advantage over quicksort is that it requires little additional memory.
|
* only advantage over quicksort is that it requires little additional memory.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
heapsort(vbase, nmemb, size, compar)
|
heapsort(void *vbase, size_t nmemb, size_t size,
|
||||||
void *vbase;
|
int (*compar)(const void *, const void *))
|
||||||
size_t nmemb, size;
|
|
||||||
int (*compar)(const void *, const void *);
|
|
||||||
{
|
{
|
||||||
size_t cnt, i, j, l;
|
size_t cnt, i, j, l;
|
||||||
char tmp, *tmp1, *tmp2;
|
char tmp, *tmp1, *tmp2;
|
||||||
|
@ -55,11 +55,7 @@ static int inet_net_pton_ipv4(const char *src, u_char *dst, size_t size);
|
|||||||
* Paul Vixie (ISC), June 1996
|
* Paul Vixie (ISC), June 1996
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
inet_net_pton(af, src, dst, size)
|
inet_net_pton(int af, const char *src, void *dst, size_t size)
|
||||||
int af;
|
|
||||||
const char *src;
|
|
||||||
void *dst;
|
|
||||||
size_t size;
|
|
||||||
{
|
{
|
||||||
switch (af) {
|
switch (af) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
@ -87,10 +83,7 @@ inet_net_pton(af, src, dst, size)
|
|||||||
* Paul Vixie (ISC), June 1996
|
* Paul Vixie (ISC), June 1996
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
inet_net_pton_ipv4(src, dst, size)
|
inet_net_pton_ipv4(const char *src, u_char *dst, size_t size)
|
||||||
const char *src;
|
|
||||||
u_char *dst;
|
|
||||||
size_t size;
|
|
||||||
{
|
{
|
||||||
static const char
|
static const char
|
||||||
xdigits[] = "0123456789abcdef",
|
xdigits[] = "0123456789abcdef",
|
||||||
|
19
src/merge.c
19
src/merge.c
@ -95,11 +95,8 @@ static void insertionsort(u_char *, size_t, size_t,
|
|||||||
* Arguments are as for qsort.
|
* Arguments are as for qsort.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
mergesort(base, nmemb, size, cmp)
|
mergesort(void *base, size_t nmemb, size_t size,
|
||||||
void *base;
|
int (*cmp)(const void *, const void *))
|
||||||
size_t nmemb;
|
|
||||||
size_t size;
|
|
||||||
int (*cmp)(const void *, const void *);
|
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
int sense;
|
int sense;
|
||||||
@ -259,10 +256,8 @@ COPY: b = t;
|
|||||||
* is defined. Otherwise simple pairwise merging is used.)
|
* is defined. Otherwise simple pairwise merging is used.)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
setup(list1, list2, n, size, cmp)
|
setup(u_char *list1, u_char *list2, size_t n, size_t size,
|
||||||
size_t n, size;
|
int (*cmp)(const void *, const void *))
|
||||||
int (*cmp)(const void *, const void *);
|
|
||||||
u_char *list1, *list2;
|
|
||||||
{
|
{
|
||||||
int i, length, size2, tmp, sense;
|
int i, length, size2, tmp, sense;
|
||||||
u_char *f1, *f2, *s, *l2, *last, *p2;
|
u_char *f1, *f2, *s, *l2, *last, *p2;
|
||||||
@ -333,10 +328,8 @@ setup(list1, list2, n, size, cmp)
|
|||||||
* last 4 elements.
|
* last 4 elements.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
insertionsort(a, n, size, cmp)
|
insertionsort(u_char *a, size_t n, size_t size,
|
||||||
u_char *a;
|
int (*cmp)(const void *, const void *))
|
||||||
size_t n, size;
|
|
||||||
int (*cmp)(const void *, const void *);
|
|
||||||
{
|
{
|
||||||
u_char *ai, *s, *t, *u, tmp;
|
u_char *ai, *s, *t, *u, tmp;
|
||||||
int i;
|
int i;
|
||||||
|
25
src/nlist.c
25
src/nlist.c
@ -70,9 +70,7 @@ static int __elf_fdnlist(int, struct nlist *);
|
|||||||
int __fdnlist(int, struct nlist *);
|
int __fdnlist(int, struct nlist *);
|
||||||
|
|
||||||
int
|
int
|
||||||
nlist(name, list)
|
nlist(const char *name, struct nlist *list)
|
||||||
const char *name;
|
|
||||||
struct nlist *list;
|
|
||||||
{
|
{
|
||||||
int fd, n;
|
int fd, n;
|
||||||
|
|
||||||
@ -96,9 +94,7 @@ static struct nlist_handlers {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
__fdnlist(fd, list)
|
__fdnlist(int fd, struct nlist *list)
|
||||||
int fd;
|
|
||||||
struct nlist *list;
|
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
int n = -1;
|
int n = -1;
|
||||||
@ -115,9 +111,7 @@ __fdnlist(fd, list)
|
|||||||
|
|
||||||
#ifdef _NLIST_DO_AOUT
|
#ifdef _NLIST_DO_AOUT
|
||||||
static int
|
static int
|
||||||
__aout_fdnlist(fd, list)
|
__aout_fdnlist(int fd, struct nlist *list)
|
||||||
int fd;
|
|
||||||
struct nlist *list;
|
|
||||||
{
|
{
|
||||||
struct nlist *p, *symtab;
|
struct nlist *p, *symtab;
|
||||||
caddr_t strtab, a_out_mmap;
|
caddr_t strtab, a_out_mmap;
|
||||||
@ -220,8 +214,7 @@ static void elf_sym_to_nlist(struct nlist *, Elf_Sym *, Elf_Shdr *, int);
|
|||||||
* as such its use should be restricted.
|
* as such its use should be restricted.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
__elf_is_okay__(ehdr)
|
__elf_is_okay__(Elf_Ehdr *ehdr)
|
||||||
Elf_Ehdr *ehdr;
|
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
/*
|
/*
|
||||||
@ -244,9 +237,7 @@ __elf_is_okay__(ehdr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
__elf_fdnlist(fd, list)
|
__elf_fdnlist(int fd, struct nlist *list)
|
||||||
int fd;
|
|
||||||
struct nlist *list;
|
|
||||||
{
|
{
|
||||||
struct nlist *p;
|
struct nlist *p;
|
||||||
Elf_Off symoff = 0, symstroff = 0;
|
Elf_Off symoff = 0, symstroff = 0;
|
||||||
@ -386,11 +377,7 @@ __elf_fdnlist(fd, list)
|
|||||||
* n_value and n_type members.
|
* n_value and n_type members.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
elf_sym_to_nlist(nl, s, shdr, shnum)
|
elf_sym_to_nlist(struct nlist *nl, Elf_Sym *s, Elf_Shdr *shdr, int shnum)
|
||||||
struct nlist *nl;
|
|
||||||
Elf_Sym *s;
|
|
||||||
Elf_Shdr *shdr;
|
|
||||||
int shnum;
|
|
||||||
{
|
{
|
||||||
nl->n_value = s->st_value;
|
nl->n_value = s->st_value;
|
||||||
|
|
||||||
|
@ -37,9 +37,7 @@ static char sccsid[] = "@(#)strmode.c 8.3 (Berkeley) 8/15/94";
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
strmode(mode, p)
|
strmode(mode_t mode, char *p)
|
||||||
mode_t mode;
|
|
||||||
char *p;
|
|
||||||
{
|
{
|
||||||
/* print type */
|
/* print type */
|
||||||
switch (mode & S_IFMT) {
|
switch (mode & S_IFMT) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user