Date: Sat, 5 Dec 2009 19:31:38 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r200150 - in head/lib/libc: gen gmon stdio stdlib sys Message-ID: <200912051931.nB5JVcHl097444@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Sat Dec 5 19:31:38 2009 New Revision: 200150 URL: http://svn.freebsd.org/changeset/base/200150 Log: 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/. Modified: head/lib/libc/gen/getttyent.c head/lib/libc/gen/nlist.c head/lib/libc/gen/pause.c head/lib/libc/gen/raise.c head/lib/libc/gen/sleep.c head/lib/libc/gen/timezone.c head/lib/libc/gen/usleep.c head/lib/libc/gmon/gmon.c head/lib/libc/stdio/findfp.c head/lib/libc/stdio/funopen.c head/lib/libc/stdlib/system.c head/lib/libc/sys/__error.c Modified: head/lib/libc/gen/getttyent.c ============================================================================== --- head/lib/libc/gen/getttyent.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/getttyent.c Sat Dec 5 19:31:38 2009 (r200150) @@ -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); Modified: head/lib/libc/gen/nlist.c ============================================================================== --- head/lib/libc/gen/nlist.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/nlist.c Sat Dec 5 19:31:38 2009 (r200150) @@ -209,8 +209,7 @@ static void elf_sym_to_nlist(struct nlis * as such its use should be restricted. */ int -__elf_is_okay__(ehdr) - Elf_Ehdr *ehdr; +__elf_is_okay__(Elf_Ehdr *ehdr) { int retval = 0; /* Modified: head/lib/libc/gen/pause.c ============================================================================== --- head/lib/libc/gen/pause.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/pause.c Sat Dec 5 19:31:38 2009 (r200150) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); * Backwards compatible pause. */ int -__pause() +__pause(void) { return sigpause(sigblock(0L)); } Modified: head/lib/libc/gen/raise.c ============================================================================== --- head/lib/libc/gen/raise.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/raise.c Sat Dec 5 19:31:38 2009 (r200150) @@ -40,8 +40,7 @@ __weak_reference(__raise, raise); __weak_reference(__raise, _raise); int -__raise(s) - int s; +__raise(int s) { return(kill(getpid(), s)); } Modified: head/lib/libc/gen/sleep.c ============================================================================== --- head/lib/libc/gen/sleep.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/sleep.c Sat Dec 5 19:31:38 2009 (r200150) @@ -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; Modified: head/lib/libc/gen/timezone.c ============================================================================== --- head/lib/libc/gen/timezone.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/timezone.c Sat Dec 5 19:31:38 2009 (r200150) @@ -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; Modified: head/lib/libc/gen/usleep.c ============================================================================== --- head/lib/libc/gen/usleep.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/usleep.c Sat Dec 5 19:31:38 2009 (r200150) @@ -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; Modified: head/lib/libc/gmon/gmon.c ============================================================================== --- head/lib/libc/gmon/gmon.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gmon/gmon.c Sat Dec 5 19:31:38 2009 (r200150) @@ -132,7 +132,7 @@ monstartup(lowpc, highpc) } void -_mcleanup() +_mcleanup(void) { int fd; int fromindex; Modified: head/lib/libc/stdio/findfp.c ============================================================================== --- head/lib/libc/stdio/findfp.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/stdio/findfp.c Sat Dec 5 19:31:38 2009 (r200150) @@ -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; Modified: head/lib/libc/stdio/funopen.c ============================================================================== --- head/lib/libc/stdio/funopen.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/stdio/funopen.c Sat Dec 5 19:31:38 2009 (r200150) @@ -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; Modified: head/lib/libc/stdlib/system.c ============================================================================== --- head/lib/libc/stdlib/system.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/stdlib/system.c Sat Dec 5 19:31:38 2009 (r200150) @@ -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; Modified: head/lib/libc/sys/__error.c ============================================================================== --- head/lib/libc/sys/__error.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/sys/__error.c Sat Dec 5 19:31:38 2009 (r200150) @@ -39,7 +39,7 @@ extern int errno; __weak_reference(__error_unthreaded, __error); int * -__error_unthreaded() +__error_unthreaded(void) { return(&errno); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912051931.nB5JVcHl097444>