Commit a6a101ef authored by Guillem Jover's avatar Guillem Jover

Use ANSI C prototypes

parent 32388fe5
......@@ -130,10 +130,8 @@
* only advantage over quicksort is that it requires little additional memory.
*/
int
heapsort(vbase, nmemb, size, compar)
void *vbase;
size_t nmemb, size;
int (*compar)(const void *, const void *);
heapsort(void *vbase, size_t nmemb, size_t size,
int (*compar)(const void *, const void *))
{
size_t cnt, i, j, l;
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
*/
int
inet_net_pton(af, src, dst, size)
int af;
const char *src;
void *dst;
size_t size;
inet_net_pton(int af, const char *src, void *dst, size_t size)
{
switch (af) {
case AF_INET:
......@@ -87,10 +83,7 @@ inet_net_pton(af, src, dst, size)
* Paul Vixie (ISC), June 1996
*/
static int
inet_net_pton_ipv4(src, dst, size)
const char *src;
u_char *dst;
size_t size;
inet_net_pton_ipv4(const char *src, u_char *dst, size_t size)
{
static const char
xdigits[] = "0123456789abcdef",
......
......@@ -95,11 +95,8 @@ static void insertionsort(u_char *, size_t, size_t,
* Arguments are as for qsort.
*/
int
mergesort(base, nmemb, size, cmp)
void *base;
size_t nmemb;
size_t size;
int (*cmp)(const void *, const void *);
mergesort(void *base, size_t nmemb, size_t size,
int (*cmp)(const void *, const void *))
{
size_t i;
int sense;
......@@ -259,10 +256,8 @@ COPY: b = t;
* is defined. Otherwise simple pairwise merging is used.)
*/
void
setup(list1, list2, n, size, cmp)
size_t n, size;
int (*cmp)(const void *, const void *);
u_char *list1, *list2;
setup(u_char *list1, u_char *list2, size_t n, size_t size,
int (*cmp)(const void *, const void *))
{
int i, length, size2, tmp, sense;
u_char *f1, *f2, *s, *l2, *last, *p2;
......@@ -333,10 +328,8 @@ setup(list1, list2, n, size, cmp)
* last 4 elements.
*/
static void
insertionsort(a, n, size, cmp)
u_char *a;
size_t n, size;
int (*cmp)(const void *, const void *);
insertionsort(u_char *a, size_t n, size_t size,
int (*cmp)(const void *, const void *))
{
u_char *ai, *s, *t, *u, tmp;
int i;
......
......@@ -70,9 +70,7 @@ static int __elf_fdnlist(int, struct nlist *);
int __fdnlist(int, struct nlist *);
int
nlist(name, list)
const char *name;
struct nlist *list;
nlist(const char *name, struct nlist *list)
{
int fd, n;
......@@ -96,9 +94,7 @@ static struct nlist_handlers {
};
int
__fdnlist(fd, list)
int fd;
struct nlist *list;
__fdnlist(int fd, struct nlist *list)
{
size_t i;
int n = -1;
......@@ -115,9 +111,7 @@ __fdnlist(fd, list)
#ifdef _NLIST_DO_AOUT
static int
__aout_fdnlist(fd, list)
int fd;
struct nlist *list;
__aout_fdnlist(int fd, struct nlist *list)
{
struct nlist *p, *symtab;
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.
*/
static int
__elf_is_okay__(ehdr)
Elf_Ehdr *ehdr;
__elf_is_okay__(Elf_Ehdr *ehdr)
{
int retval = 0;
/*
......@@ -244,9 +237,7 @@ __elf_is_okay__(ehdr)
}
static int
__elf_fdnlist(fd, list)
int fd;
struct nlist *list;
__elf_fdnlist(int fd, struct nlist *list)
{
struct nlist *p;
Elf_Off symoff = 0, symstroff = 0;
......@@ -386,11 +377,7 @@ __elf_fdnlist(fd, list)
* n_value and n_type members.
*/
static void
elf_sym_to_nlist(nl, s, shdr, shnum)
struct nlist *nl;
Elf_Sym *s;
Elf_Shdr *shdr;
int shnum;
elf_sym_to_nlist(struct nlist *nl, Elf_Sym *s, Elf_Shdr *shdr, int shnum)
{
nl->n_value = s->st_value;
......
......@@ -37,9 +37,7 @@ static char sccsid[] = "@(#)strmode.c 8.3 (Berkeley) 8/15/94";
#include <string.h>
void
strmode(mode, p)
mode_t mode;
char *p;
strmode(mode_t mode, char *p)
{
/* print type */
switch (mode & S_IFMT) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment