summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-12-05 19:31:38 +0000
committered <ed@FreeBSD.org>2009-12-05 19:31:38 +0000
commit06fcc20479dbea7b80fde60d667c7455ca58c451 (patch)
tree7888f1fc2bd55cbcf966048d3b4db70a78bdb2b3
parente912442e98904e4d3d77ac344f9a353688ca3e9f (diff)
downloadFreeBSD-src-06fcc20479dbea7b80fde60d667c7455ca58c451.zip
FreeBSD-src-06fcc20479dbea7b80fde60d667c7455ca58c451.tar.gz
Fix many "function declaration isn't a prototype" warnings in libc.
I've only fixed code that seems to be written by `us'. There are still many warnings like this present in resolv/, rpc/, stdtime/ and yp/.
-rw-r--r--lib/libc/gen/getttyent.c26
-rw-r--r--lib/libc/gen/nlist.c3
-rw-r--r--lib/libc/gen/pause.c2
-rw-r--r--lib/libc/gen/raise.c3
-rw-r--r--lib/libc/gen/sleep.c3
-rw-r--r--lib/libc/gen/timezone.c10
-rw-r--r--lib/libc/gen/usleep.c3
-rw-r--r--lib/libc/gmon/gmon.c2
-rw-r--r--lib/libc/stdio/findfp.c2
-rw-r--r--lib/libc/stdio/funopen.c10
-rw-r--r--lib/libc/stdlib/system.c3
-rw-r--r--lib/libc/sys/__error.c2
12 files changed, 27 insertions, 42 deletions
diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c
index 9152626..99d9821 100644
--- a/lib/libc/gen/getttyent.c
+++ b/lib/libc/gen/getttyent.c
@@ -55,8 +55,7 @@ static char *skip(char *);
static char *value(char *);
struct ttyent *
-getttynam(tty)
- const char *tty;
+getttynam(const char *tty)
{
struct ttyent *t;
@@ -71,7 +70,7 @@ getttynam(tty)
}
struct ttyent *
-getttyent()
+getttyent(void)
{
static struct ttyent tty;
static char devpts_name[] = "pts/4294967295";
@@ -178,8 +177,7 @@ getttyent()
* the next field.
*/
static char *
-skip(p)
- char *p;
+skip(char *p)
{
char *t;
int c, q;
@@ -212,15 +210,14 @@ skip(p)
}
static char *
-value(p)
- char *p;
+value(char *p)
{
return ((p = index(p, '=')) ? ++p : NULL);
}
int
-setttyent()
+setttyent(void)
{
DIR *devpts_dir;
@@ -254,7 +251,7 @@ setttyent()
}
int
-endttyent()
+endttyent(void)
{
int rval;
@@ -272,9 +269,7 @@ endttyent()
}
static int
-isttystat(tty, flag)
- const char *tty;
- int flag;
+isttystat(const char *tty, int flag)
{
struct ttyent *t;
@@ -283,15 +278,14 @@ isttystat(tty, flag)
int
-isdialuptty(tty)
- const char *tty;
+isdialuptty(const char *tty)
{
return isttystat(tty, TTY_DIALUP);
}
-int isnettty(tty)
- const char *tty;
+int
+isnettty(const char *tty)
{
return isttystat(tty, TTY_NETWORK);
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index 690e0b0..1361af3 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -209,8 +209,7 @@ static void elf_sym_to_nlist(struct nlist *, Elf_Sym *, Elf_Shdr *, int);
* as such its use should be restricted.
*/
int
-__elf_is_okay__(ehdr)
- Elf_Ehdr *ehdr;
+__elf_is_okay__(Elf_Ehdr *ehdr)
{
int retval = 0;
/*
diff --git a/lib/libc/gen/pause.c b/lib/libc/gen/pause.c
index 86d3643..00bf833 100644
--- a/lib/libc/gen/pause.c
+++ b/lib/libc/gen/pause.c
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
* Backwards compatible pause.
*/
int
-__pause()
+__pause(void)
{
return sigpause(sigblock(0L));
}
diff --git a/lib/libc/gen/raise.c b/lib/libc/gen/raise.c
index 12bd31f..b3d0aae 100644
--- a/lib/libc/gen/raise.c
+++ b/lib/libc/gen/raise.c
@@ -40,8 +40,7 @@ __weak_reference(__raise, raise);
__weak_reference(__raise, _raise);
int
-__raise(s)
- int s;
+__raise(int s)
{
return(kill(getpid(), s));
}
diff --git a/lib/libc/gen/sleep.c b/lib/libc/gen/sleep.c
index cdf5828..b807c2d 100644
--- a/lib/libc/gen/sleep.c
+++ b/lib/libc/gen/sleep.c
@@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
unsigned int
-__sleep(seconds)
- unsigned int seconds;
+__sleep(unsigned int seconds)
{
struct timespec time_to_sleep;
struct timespec time_remaining;
diff --git a/lib/libc/gen/timezone.c b/lib/libc/gen/timezone.c
index c59ae6b..5f0fa66 100644
--- a/lib/libc/gen/timezone.c
+++ b/lib/libc/gen/timezone.c
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#define TZ_MAX_CHARS 255
-char *_tztab();
+char *_tztab(int, int);
/*
* timezone --
@@ -53,9 +53,7 @@ char *_tztab();
static char czone[TZ_MAX_CHARS]; /* space for zone name */
char *
-timezone(zone, dst)
- int zone,
- dst;
+timezone(int zone, int dst)
{
char *beg,
*end;
@@ -106,9 +104,7 @@ static struct zone {
* STANDARD LIBRARY.
*/
char *
-_tztab(zone,dst)
- int zone;
- int dst;
+_tztab(int zone, int dst)
{
struct zone *zp;
char sign;
diff --git a/lib/libc/gen/usleep.c b/lib/libc/gen/usleep.c
index 0454665..7d6559b 100644
--- a/lib/libc/gen/usleep.c
+++ b/lib/libc/gen/usleep.c
@@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
int
-__usleep(useconds)
- useconds_t useconds;
+__usleep(useconds_t useconds)
{
struct timespec time_to_sleep;
diff --git a/lib/libc/gmon/gmon.c b/lib/libc/gmon/gmon.c
index dd85eec..fe769e8 100644
--- a/lib/libc/gmon/gmon.c
+++ b/lib/libc/gmon/gmon.c
@@ -132,7 +132,7 @@ monstartup(lowpc, highpc)
}
void
-_mcleanup()
+_mcleanup(void)
{
int fd;
int fromindex;
diff --git a/lib/libc/stdio/findfp.c b/lib/libc/stdio/findfp.c
index 586e15c..5bc4af7 100644
--- a/lib/libc/stdio/findfp.c
+++ b/lib/libc/stdio/findfp.c
@@ -168,7 +168,7 @@ __warn_references(f_prealloc,
"warning: this program uses f_prealloc(), which is not recommended.");
void
-f_prealloc()
+f_prealloc(void)
{
struct glue *g;
int n;
diff --git a/lib/libc/stdio/funopen.c b/lib/libc/stdio/funopen.c
index 9535340..573589f 100644
--- a/lib/libc/stdio/funopen.c
+++ b/lib/libc/stdio/funopen.c
@@ -42,11 +42,11 @@ __FBSDID("$FreeBSD$");
#include "local.h"
FILE *
-funopen(cookie, readfn, writefn, seekfn, closefn)
- const void *cookie;
- int (*readfn)(), (*writefn)();
- fpos_t (*seekfn)(void *cookie, fpos_t off, int whence);
- int (*closefn)();
+funopen(const void *cookie,
+ int (*readfn)(void *, char *, int),
+ int (*writefn)(void *, const char *, int),
+ fpos_t (*seekfn)(void *, fpos_t, int),
+ int (*closefn)(void *))
{
FILE *fp;
int flags;
diff --git a/lib/libc/stdlib/system.c b/lib/libc/stdlib/system.c
index 08de630..4f47edf 100644
--- a/lib/libc/stdlib/system.c
+++ b/lib/libc/stdlib/system.c
@@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
int
-__system(command)
- const char *command;
+__system(const char *command)
{
pid_t pid, savedpid;
int pstat;
diff --git a/lib/libc/sys/__error.c b/lib/libc/sys/__error.c
index d7b5529..c3f59f8 100644
--- a/lib/libc/sys/__error.c
+++ b/lib/libc/sys/__error.c
@@ -39,7 +39,7 @@ extern int errno;
__weak_reference(__error_unthreaded, __error);
int *
-__error_unthreaded()
+__error_unthreaded(void)
{
return(&errno);
}
OpenPOWER on IntegriCloud