Commit a6a101effacbdf88b5879af2f63b7e5dbc4a05b9

Guillem Jover 2014-11-04T05:33:26

Use ANSI C prototypes

diff --git a/src/heapsort.c b/src/heapsort.c
index 7e345c7..72dbcbc 100644
--- a/src/heapsort.c
+++ b/src/heapsort.c
@@ -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;
diff --git a/src/inet_net_pton.c b/src/inet_net_pton.c
index 8d33156..28c55ba 100644
--- a/src/inet_net_pton.c
+++ b/src/inet_net_pton.c
@@ -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",
diff --git a/src/merge.c b/src/merge.c
index e1078e7..470352a 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -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;
diff --git a/src/nlist.c b/src/nlist.c
index 6c9be51..3f2c0f8 100644
--- a/src/nlist.c
+++ b/src/nlist.c
@@ -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;
 
diff --git a/src/strmode.c b/src/strmode.c
index 97136e6..8d825ae 100644
--- a/src/strmode.c
+++ b/src/strmode.c
@@ -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) {