From 0f52d28300c441aaa663cc688e25b0720691d7b3 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sun, 13 Nov 2005 00:07:42 +0000 Subject: [PATCH] Cleanup: - Add $DragonFly$. - Ansify function definitions. - Remove (void) casts for discarded return values. - In function definitions, move the type on a line of its own. - Remove __P. --- lib/libc/gen/alarm.c | 5 +-- lib/libc/gen/arc4random.c | 4 +- lib/libc/gen/clock.c | 3 +- lib/libc/gen/confstr.c | 8 ++-- lib/libc/gen/dirname.c | 4 +- lib/libc/gen/disklabel.c | 7 ++- lib/libc/gen/disktab.c | 7 ++- lib/libc/gen/err.c | 31 +++----------- lib/libc/gen/exec.c | 21 ++++----- lib/libc/gen/fnmatch.c | 12 ++---- lib/libc/gen/fstab.c | 35 +++++++-------- lib/libc/gen/ftok.c | 6 +-- lib/libc/gen/fts.c | 14 +++--- lib/libc/gen/getbsize.c | 8 ++-- lib/libc/gen/getcap.c | 80 ++++++++++++++--------------------- lib/libc/gen/getdomainname.c | 6 +-- lib/libc/gen/gethostname.c | 5 +-- lib/libc/gen/getmntinfo.c | 6 +-- lib/libc/gen/getosreldate.c | 7 +-- lib/libc/gen/getpagesize.c | 3 +- lib/libc/gen/getpwent.c | 51 +++++++++------------- lib/libc/gen/getttyent.c | 30 ++++++------- lib/libc/gen/getusershell.c | 12 +++--- lib/libc/gen/glob.c | 16 +++---- lib/libc/gen/initgroups.c | 6 +-- lib/libc/gen/lockf.c | 7 +-- lib/libc/gen/msgctl.c | 11 ++--- lib/libc/gen/msgget.c | 10 ++--- lib/libc/gen/msgrcv.c | 13 ++---- lib/libc/gen/msgsnd.c | 12 ++---- lib/libc/gen/nice.c | 4 +- lib/libc/gen/opendir.c | 4 +- lib/libc/gen/popen.c | 34 +++++++-------- lib/libc/gen/psignal.c | 14 +++--- lib/libc/gen/pwcache.c | 10 ++--- lib/libc/gen/raise.c | 4 +- lib/libc/gen/readdir.c | 13 ++---- lib/libc/gen/readpassphrase.c | 44 +++++++++---------- lib/libc/gen/seekdir.c | 6 +-- lib/libc/gen/semconfig.c | 9 ++-- lib/libc/gen/semget.c | 11 ++--- lib/libc/gen/semop.c | 11 ++--- lib/libc/gen/setjmperr.c | 6 +-- lib/libc/gen/setmode.c | 35 ++++++--------- lib/libc/gen/setproctitle.c | 6 +-- lib/libc/gen/shmat.c | 9 +--- lib/libc/gen/shmctl.c | 9 +--- lib/libc/gen/shmdt.c | 7 +-- lib/libc/gen/shmget.c | 9 +--- lib/libc/gen/siginterrupt.c | 5 +-- lib/libc/gen/signal.c | 6 +-- lib/libc/gen/sigsetops.c | 20 +++------ lib/libc/gen/sleep.c | 5 +-- lib/libc/gen/stringlist.c | 15 +++---- lib/libc/gen/strtofflags.c | 9 ++-- lib/libc/gen/sysconf.c | 5 +-- lib/libc/gen/sysctl.c | 8 ++-- lib/libc/gen/syslog.c | 65 +++++++++++++--------------- lib/libc/gen/telldir.c | 14 +++--- lib/libc/gen/termios.c | 54 +++++++---------------- lib/libc/gen/time.c | 4 +- lib/libc/gen/times.c | 5 +-- lib/libc/gen/timezone.c | 14 +++--- lib/libc/gen/ttyname.c | 24 +++++------ lib/libc/gen/ttyslot.c | 4 +- lib/libc/gen/ualarm.c | 6 +-- lib/libc/gen/uname.c | 5 +-- lib/libc/gen/unvis.c | 14 ++---- lib/libc/gen/utime.c | 5 +-- lib/libc/gen/valloc.c | 4 +- lib/libc/gen/vis.c | 18 ++------ lib/libc/gen/wait.c | 5 +-- lib/libc/gen/wait3.c | 7 +-- 73 files changed, 382 insertions(+), 624 deletions(-) diff --git a/lib/libc/gen/alarm.c b/lib/libc/gen/alarm.c index a2e71a45b5..55cf9a97ed 100644 --- a/lib/libc/gen/alarm.c +++ b/lib/libc/gen/alarm.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)alarm.c 8.1 (Berkeley) 6/4/93 - * $DragonFly: src/lib/libc/gen/alarm.c,v 1.3 2004/06/06 15:05:55 hmp Exp $ + * $DragonFly: src/lib/libc/gen/alarm.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ */ /* @@ -41,8 +41,7 @@ #include unsigned int -alarm(secs) - unsigned int secs; +alarm(unsigned int secs) { struct itimerval it, oitv; struct itimerval *itp = ⁢ diff --git a/lib/libc/gen/arc4random.c b/lib/libc/gen/arc4random.c index d1f92a3845..b2f8f9036b 100644 --- a/lib/libc/gen/arc4random.c +++ b/lib/libc/gen/arc4random.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/lib/libc/gen/arc4random.c,v 1.4 2000/01/27 23:06:13 jasone Exp $ */ -/* $DragonFly: src/lib/libc/gen/arc4random.c,v 1.6 2005/04/26 10:16:16 joerg Exp $ */ +/* $DragonFly: src/lib/libc/gen/arc4random.c,v 1.7 2005/11/13 00:07:42 swildner Exp $ */ /* * Arc4 random number generator for OpenBSD. @@ -86,7 +86,7 @@ arc4_stir(struct arc4_stream *as) rdat.pid = getpid(); fd = _open("/dev/urandom", O_RDONLY, 0); if (fd >= 0) { - (void) _read(fd, rdat.rnd, sizeof(rdat.rnd)); + _read(fd, rdat.rnd, sizeof(rdat.rnd)); _close(fd); } /* fd < 0? Ah, what the heck. We'll just take whatever was on the diff --git a/lib/libc/gen/clock.c b/lib/libc/gen/clock.c index a048360c6f..4078f17736 100644 --- a/lib/libc/gen/clock.c +++ b/lib/libc/gen/clock.c @@ -31,6 +31,7 @@ * SUCH DAMAGE. * * @(#)clock.c 8.1 (Berkeley) 6/4/93 + * $DragonFly: src/lib/libc/gen/clock.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -45,7 +46,7 @@ + (r).tv_usec / (1000000 / CLOCKS_PER_SEC)) clock_t -clock() +clock(void) { struct rusage ru; diff --git a/lib/libc/gen/confstr.c b/lib/libc/gen/confstr.c index cf7336e83a..07f28b97c1 100644 --- a/lib/libc/gen/confstr.c +++ b/lib/libc/gen/confstr.c @@ -31,6 +31,7 @@ * SUCH DAMAGE. * * @(#)confstr.c 8.1 (Berkeley) 6/4/93 + * $DragonFly: src/lib/libc/gen/confstr.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -43,10 +44,7 @@ #include size_t -confstr(name, buf, len) - int name; - char *buf; - size_t len; +confstr(int name, char *buf, size_t len) { size_t tlen; int mib[2], sverrno; @@ -71,7 +69,7 @@ confstr(name, buf, len) * POSIX 1003.2 requires partial return of * the string -- that should be *real* useful. */ - (void)strncpy(buf, p, len - 1); + strncpy(buf, p, len - 1); buf[len - 1] = '\0'; free(p); } diff --git a/lib/libc/gen/dirname.c b/lib/libc/gen/dirname.c index 8a367ae588..f3aecc228d 100644 --- a/lib/libc/gen/dirname.c +++ b/lib/libc/gen/dirname.c @@ -26,7 +26,7 @@ * * $OpenBSD: dirname.c,v 1.4 1999/05/30 17:10:30 espie Exp $ * $FreeBSD: src/lib/libc/gen/dirname.c,v 1.7 2002/12/30 01:41:14 marcel Exp $ - * $DragonFly: src/lib/libc/gen/dirname.c,v 1.10 2005/09/18 16:09:45 asmodai Exp $ + * $DragonFly: src/lib/libc/gen/dirname.c,v 1.11 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -76,6 +76,6 @@ dirname(const char *path) errno = ENAMETOOLONG; return(NULL); } - (void)strlcpy(bname, path, endp - path + 2); + strlcpy(bname, path, endp - path + 2); return(bname); } diff --git a/lib/libc/gen/disklabel.c b/lib/libc/gen/disklabel.c index 88f5f10b13..d35929ee8c 100644 --- a/lib/libc/gen/disklabel.c +++ b/lib/libc/gen/disklabel.c @@ -32,7 +32,7 @@ * * @(#)disklabel.c 8.2 (Berkeley) 5/3/95 * $FreeBSD: src/lib/libc/gen/disklabel.c,v 1.9.2.1 2001/03/05 08:40:47 obrien Exp $ - * $DragonFly: src/lib/libc/gen/disklabel.c,v 1.6 2005/03/16 17:54:59 y0netan1 Exp $ + * $DragonFly: src/lib/libc/gen/disklabel.c,v 1.7 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -51,8 +51,7 @@ static int gettype (const char *, const char **); struct disklabel * -getdiskbyname(name) - const char *name; +getdiskbyname(const char *name) { static struct disklabel disk; struct disklabel *dp = &disk; @@ -144,7 +143,7 @@ getdiskbyname(name) } } dp->d_npartitions = max + 1 - 'a'; - (void)strcpy(psize, "dx"); + strcpy(psize, "dx"); dx = dp->d_drivedata; for (p = '0'; p < '0' + NDDATA; p++, dx++) { psize[1] = p; diff --git a/lib/libc/gen/disktab.c b/lib/libc/gen/disktab.c index 05291c1702..8b845b781f 100644 --- a/lib/libc/gen/disktab.c +++ b/lib/libc/gen/disktab.c @@ -32,7 +32,7 @@ * * @(#)disklabel.c 8.2 (Berkeley) 5/3/95 * $FreeBSD: src/lib/libc/gen/disklabel.c,v 1.9.2.1 2001/03/05 08:40:47 obrien Exp $ - * $DragonFly: src/lib/libc/gen/disktab.c,v 1.6 2005/03/16 17:54:59 y0netan1 Exp $ + * $DragonFly: src/lib/libc/gen/disktab.c,v 1.7 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -51,8 +51,7 @@ static int gettype (const char *, const char **); struct disklabel * -getdiskbyname(name) - const char *name; +getdiskbyname(const char *name) { static struct disklabel disk; struct disklabel *dp = &disk; @@ -144,7 +143,7 @@ getdiskbyname(name) } } dp->d_npartitions = max + 1 - 'a'; - (void)strcpy(psize, "dx"); + strcpy(psize, "dx"); dx = dp->d_drivedata; for (p = '0'; p < '0' + NDDATA; p++, dx++) { psize[1] = p; diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c index cd56ac2bf7..11acb1bfa4 100644 --- a/lib/libc/gen/err.c +++ b/lib/libc/gen/err.c @@ -32,7 +32,7 @@ * From: @(#)err.c 8.1 (Berkeley) 6/4/93 * * $FreeBSD: src/lib/libc/gen/err.c,v 1.6 1999/08/27 23:58:33 peter Exp $ - * $DragonFly: src/lib/libc/gen/err.c,v 1.3 2005/03/09 18:52:21 joerg Exp $ + * $DragonFly: src/lib/libc/gen/err.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -77,10 +77,7 @@ err(int eval, const char *fmt, ...) } void -verr(eval, fmt, ap) - int eval; - const char *fmt; - va_list ap; +verr(int eval, const char *fmt, va_list ap) { verrc(eval, errno, fmt, ap); } @@ -95,11 +92,7 @@ errc(int eval, int code, const char *fmt, ...) } void -verrc(eval, code, fmt, ap) - int eval; - int code; - const char *fmt; - va_list ap; +verrc(int eval, int code, const char *fmt, va_list ap) { if (err_file == 0) err_set_file((FILE *)0); @@ -124,10 +117,7 @@ errx(int eval, const char *fmt, ...) } void -verrx(eval, fmt, ap) - int eval; - const char *fmt; - va_list ap; +verrx(int eval, const char *fmt, va_list ap) { if (err_file == 0) err_set_file((FILE *)0); @@ -150,9 +140,7 @@ warn(const char *fmt, ...) } void -vwarn(fmt, ap) - const char *fmt; - va_list ap; +vwarn(const char *fmt, va_list ap) { vwarnc(errno, fmt, ap); } @@ -167,10 +155,7 @@ warnc(int code, const char *fmt, ...) } void -vwarnc(code, fmt, ap) - int code; - const char *fmt; - va_list ap; +vwarnc(int code, const char *fmt, va_list ap) { if (err_file == 0) err_set_file((FILE *)0); @@ -192,9 +177,7 @@ warnx(const char *fmt, ...) } void -vwarnx(fmt, ap) - const char *fmt; - va_list ap; +vwarnx(const char *fmt, va_list ap) { if (err_file == 0) err_set_file((FILE *)0); diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c index 22c615b0fe..ca1166e7d3 100644 --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/exec.c,v 1.15 2000/01/27 23:06:14 jasone Exp $ - * $DragonFly: src/lib/libc/gen/exec.c,v 1.6 2005/04/26 18:51:44 joerg Exp $ + * $DragonFly: src/lib/libc/gen/exec.c,v 1.7 2005/11/13 00:07:42 swildner Exp $ * * @(#)exec.c 8.1 (Berkeley) 6/4/93 * $FreeBSD: src/lib/libc/gen/exec.c,v 1.15 2000/01/27 23:06:14 jasone Exp $ @@ -135,18 +135,14 @@ execlp(const char *name, const char *arg, ...) } int -execv(name, argv) - const char *name; - char * const *argv; +execv(const char *name, char * const *argv) { - (void)_execve(name, argv, environ); + _execve(name, argv, environ); return (-1); } int -execvp(name, argv) - const char *name; - char * const *argv; +execvp(const char *name, char * const *argv) { const char **memp; int cnt; @@ -201,10 +197,9 @@ execvp(name, argv) * the user may execute the wrong program. */ if (lp + ln + 2 > sizeof(buf)) { - (void)_write(STDERR_FILENO, "execvp: ", 8); - (void)_write(STDERR_FILENO, p, lp); - (void)_write(STDERR_FILENO, ": path too long\n", - 16); + _write(STDERR_FILENO, "execvp: ", 8); + _write(STDERR_FILENO, p, lp); + _write(STDERR_FILENO, ": path too long\n", 16); continue; } bcopy(p, buf, lp); @@ -212,7 +207,7 @@ execvp(name, argv) bcopy(name, buf + lp + 1, ln); buf[lp + ln + 1] = '\0'; -retry: (void)_execve(bp, argv, environ); +retry: _execve(bp, argv, environ); switch(errno) { case E2BIG: goto done; diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c index ec89afd44d..33e3158247 100644 --- a/lib/libc/gen/fnmatch.c +++ b/lib/libc/gen/fnmatch.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)fnmatch.c 8.2 (Berkeley) 4/16/94 - * $DragonFly: src/lib/libc/gen/fnmatch.c,v 1.5 2005/04/26 18:53:17 joerg Exp $ + * $DragonFly: src/lib/libc/gen/fnmatch.c,v 1.6 2005/11/13 00:07:42 swildner Exp $ */ /* @@ -58,9 +58,7 @@ static int rangematch (const char *, char, int, char **); int -fnmatch(pattern, string, flags) - const char *pattern, *string; - int flags; +fnmatch(const char *pattern, const char *string, int flags) { const char *stringstart; char *newp; @@ -163,11 +161,7 @@ fnmatch(pattern, string, flags) } static int -rangematch(pattern, test, flags, newp) - const char *pattern; - char test; - int flags; - char **newp; +rangematch(const char *pattern, char test, int flags, char **newp) { int negate, ok; char c, c2; diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c index 6ad3086f1f..0ca594b23d 100644 --- a/lib/libc/gen/fstab.c +++ b/lib/libc/gen/fstab.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/fstab.c,v 1.8 2000/01/27 23:06:15 jasone Exp $ - * $DragonFly: src/lib/libc/gen/fstab.c,v 1.5 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/fstab.c,v 1.6 2005/11/13 00:07:42 swildner Exp $ * * @(#)fstab.c 8.1 (Berkeley) 6/4/93 * $FreeBSD: src/lib/libc/gen/fstab.c,v 1.8 2000/01/27 23:06:15 jasone Exp $ @@ -60,7 +60,7 @@ static void fixfsfile (void); static int fstabscan (void); static void -fixfsfile() +fixfsfile(void) { static char buf[sizeof(_PATH_DEV) + MNAMELEN]; struct stat sb; @@ -82,7 +82,7 @@ fixfsfile() } static int -fstabscan() +fstabscan(void) { char *cp, *p; #define MAXLINELENGTH 1024 @@ -189,7 +189,7 @@ bad: /* no way to distinguish between EOF and syntax error */ } struct fstab * -getfsent() +getfsent(void) { if ((!_fs_fp && !setfsent()) || !fstabscan()) return((struct fstab *)NULL); @@ -197,8 +197,7 @@ getfsent() } struct fstab * -getfsspec(name) - const char *name; +getfsspec(const char *name) { if (setfsent()) while (fstabscan()) @@ -208,8 +207,7 @@ getfsspec(name) } struct fstab * -getfsfile(name) - const char *name; +getfsfile(const char *name) { if (setfsent()) while (fstabscan()) @@ -219,7 +217,7 @@ getfsfile(name) } int -setfsent() +setfsent(void) { if (_fs_fp) { rewind(_fs_fp); @@ -235,27 +233,26 @@ setfsent() } void -endfsent() +endfsent(void) { if (_fs_fp) { - (void)fclose(_fs_fp); + fclose(_fs_fp); _fs_fp = NULL; } } static void -error(err) - int err; +error(int err) { char *p; char num[30]; - (void)_write(STDERR_FILENO, "fstab: ", 7); - (void)_write(STDERR_FILENO, _PATH_FSTAB, sizeof(_PATH_FSTAB) - 1); - (void)_write(STDERR_FILENO, ":", 1); + _write(STDERR_FILENO, "fstab: ", 7); + _write(STDERR_FILENO, _PATH_FSTAB, sizeof(_PATH_FSTAB) - 1); + _write(STDERR_FILENO, ":", 1); sprintf(num, "%d: ", LineNo); - (void)_write(STDERR_FILENO, num, strlen(num)); + _write(STDERR_FILENO, num, strlen(num)); p = strerror(err); - (void)_write(STDERR_FILENO, p, strlen(p)); - (void)_write(STDERR_FILENO, "\n", 1); + _write(STDERR_FILENO, p, strlen(p)); + _write(STDERR_FILENO, "\n", 1); } diff --git a/lib/libc/gen/ftok.c b/lib/libc/gen/ftok.c index 8c4f4bf65b..64a0474689 100644 --- a/lib/libc/gen/ftok.c +++ b/lib/libc/gen/ftok.c @@ -25,7 +25,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/ftok.c,v 1.5 1999/08/27 23:58:35 peter Exp $ - * $DragonFly: src/lib/libc/gen/ftok.c,v 1.2 2003/06/17 04:26:42 dillon Exp $ + * $DragonFly: src/lib/libc/gen/ftok.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -33,9 +33,7 @@ #include key_t -ftok(path, id) - const char *path; - char id; +ftok(const char *path, int id) { struct stat st; diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index 8f42c28cda..a09537b331 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -33,7 +33,7 @@ * $OpenBSD: fts.c,v 1.22 1999/10/03 19:22:22 millert Exp $ * * $FreeBSD: src/lib/libc/gen/fts.c,v 1.14.2.4 2001/06/01 22:00:34 kris Exp $ - * $DragonFly: src/lib/libc/gen/fts.c,v 1.6 2005/04/27 11:37:50 joerg Exp $ + * $DragonFly: src/lib/libc/gen/fts.c,v 1.7 2005/11/13 00:07:42 swildner Exp $ * * @(#)fts.c 8.6 (Berkeley) 8/14/94 * $FreeBSD: src/lib/libc/gen/fts.c,v 1.14.2.4 2001/06/01 22:00:34 kris Exp $ @@ -433,12 +433,12 @@ name: t = sp->fts_path + NAPPEND(p->fts_parent); } else if (p->fts_flags & FTS_SYMFOLLOW) { if (FCHDIR(sp, p->fts_symfd)) { saved_errno = errno; - (void)_close(p->fts_symfd); + _close(p->fts_symfd); errno = saved_errno; SET(FTS_STOP); return (NULL); } - (void)_close(p->fts_symfd); + _close(p->fts_symfd); } else if (!(p->fts_flags & FTS_DONTCHDIR) && fts_safe_changedir(sp, p->fts_parent, -1, "..")) { SET(FTS_STOP); @@ -601,8 +601,8 @@ fts_build(FTS *sp, int type) } #ifdef notdef - (void)printf("nlinks == %d (cur: %d)\n", nlinks, cur->fts_nlink); - (void)printf("NOSTAT %d PHYSICAL %d SEEDOT %d\n", + printf("nlinks == %d (cur: %d)\n", nlinks, cur->fts_nlink); + printf("NOSTAT %d PHYSICAL %d SEEDOT %d\n", ISSET(FTS_NOSTAT), ISSET(FTS_PHYSICAL), ISSET(FTS_SEEDOT)); #endif /* @@ -628,7 +628,7 @@ fts_build(FTS *sp, int type) cur->fts_flags |= FTS_DONTCHDIR; descend = 0; cderrno = errno; - (void)closedir(dirp); + closedir(dirp); dirp = NULL; } else descend = 1; @@ -1061,7 +1061,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, const char *path) bail: oerrno = errno; if (fd < 0) - (void)_close(newfd); + _close(newfd); errno = oerrno; return (ret); } diff --git a/lib/libc/gen/getbsize.c b/lib/libc/gen/getbsize.c index 22b2750e11..087f6f5f9d 100644 --- a/lib/libc/gen/getbsize.c +++ b/lib/libc/gen/getbsize.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)getbsize.c 8.1 (Berkeley) 6/4/93 - * $DragonFly: src/lib/libc/gen/getbsize.c,v 1.3 2005/04/27 12:10:24 joerg Exp $ + * $DragonFly: src/lib/libc/gen/getbsize.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -40,9 +40,7 @@ #include char * -getbsize(headerlenp, blocksizep) - int *headerlenp; - long *blocksizep; +getbsize(int *headerlenp, long *blocksizep) { static char header[20]; long n, max, mul, blocksize; @@ -99,7 +97,7 @@ underflow: warnx("minimum blocksize is 512"); } else blocksize = n = 512; - (void)snprintf(header, sizeof(header), "%ld%s-blocks", n, form); + snprintf(header, sizeof(header), "%ld%s-blocks", n, form); *headerlenp = strlen(header); *blocksizep = blocksize; return (header); diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c index f71fbf0f1c..a8844f1a21 100644 --- a/lib/libc/gen/getcap.c +++ b/lib/libc/gen/getcap.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/getcap.c,v 1.11.2.2 2001/01/15 06:48:09 gad Exp $ - * $DragonFly: src/lib/libc/gen/getcap.c,v 1.5 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/getcap.c,v 1.6 2005/11/13 00:07:42 swildner Exp $ * * @(#)getcap.c 8.3 (Berkeley) 3/25/94 */ @@ -78,8 +78,7 @@ static int nfcmp (char *, char *); * virtual database. 0 is returned on success, -1 on failure. */ int -cgetset(ent) - char *ent; +cgetset(char *ent) { if (ent == NULL) { if (toprec) @@ -94,7 +93,7 @@ cgetset(ent) return (-1); } gottoprec = 0; - (void)strcpy(toprec, ent); + strcpy(toprec, ent); return (0); } @@ -111,9 +110,7 @@ cgetset(ent) * return NULL. */ char * -cgetcap(buf, cap, type) - char *buf, *cap; - int type; +cgetcap(char *buf, char *cap, int type) { char *bp, *cp; @@ -163,8 +160,7 @@ cgetcap(buf, cap, type) * reference loop is detected. */ int -cgetent(buf, db_array, name) - char **buf, **db_array, *name; +cgetent(char **buf, char **db_array, char *name) { u_int dummy; @@ -190,10 +186,8 @@ cgetent(buf, db_array, name) * MAX_RECURSION. */ static int -getent(cap, len, db_array, fd, name, depth, nfield) - char **cap, **db_array, *name, *nfield; - u_int *len; - int fd, depth; +getent(char **cap, u_int *len, char **db_array, int fd, char *name, int depth, + char *nfield) { DB *capdbp; char *r_end, *rp, **db_p; @@ -217,7 +211,7 @@ getent(cap, len, db_array, fd, name, depth, nfield) errno = ENOMEM; return (-2); } - (void)strcpy(record, toprec); + strcpy(record, toprec); myfd = 0; db_p = db_array; rp = record + topreclen + 1; @@ -245,17 +239,17 @@ getent(cap, len, db_array, fd, name, depth, nfield) */ if (fd >= 0) { - (void)lseek(fd, (off_t)0, SEEK_SET); + lseek(fd, (off_t)0, SEEK_SET); myfd = 0; } else { - (void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p); + snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p); if ((capdbp = dbopen(pbuf, O_RDONLY, 0, DB_HASH, 0)) != NULL) { free(record); retval = cdbget(capdbp, &record, name); if (retval < 0) { /* no record available */ - (void)capdbp->close(capdbp); + capdbp->close(capdbp); return (retval); } /* save the data; close frees it */ @@ -308,7 +302,7 @@ getent(cap, len, db_array, fd, name, depth, nfield) n = _read(fd, buf, sizeof(buf)); if (n <= 0) { if (myfd) - (void)_close(fd); + _close(fd); if (n < 0) { free(record); return (-2); @@ -347,7 +341,7 @@ getent(cap, len, db_array, fd, name, depth, nfield) if (record == NULL) { errno = ENOMEM; if (myfd) - (void)_close(fd); + _close(fd); return (-2); } r_end = record + newsize; @@ -439,7 +433,7 @@ tc_exp: { /* an error */ if (iret < -1) { if (myfd) - (void)_close(fd); + _close(fd); free(record); return (iret); } @@ -489,7 +483,7 @@ tc_exp: { if (record == NULL) { errno = ENOMEM; if (myfd) - (void)_close(fd); + _close(fd); free(icap); return (-2); } @@ -521,7 +515,7 @@ tc_exp: { * return capability, length and success. */ if (myfd) - (void)_close(fd); + _close(fd); *len = rp - record - 1; /* don't count NUL */ if (r_end > rp) if ((record = @@ -537,9 +531,7 @@ tc_exp: { } static int -cdbget(capdbp, bp, name) - DB *capdbp; - char **bp, *name; +cdbget(DB *capdbp, char **bp, char *name) { DBT key, data; @@ -572,8 +564,7 @@ cdbget(capdbp, bp, name) * record buf, -1 if not. */ int -cgetmatch(buf, name) - char *buf, *name; +cgetmatch(char *buf, char *name) { char *np, *bp; @@ -614,10 +605,9 @@ cgetmatch(buf, name) int -cgetfirst(buf, db_array) - char **buf, **db_array; +cgetfirst(char **buf, char **db_array) { - (void)cgetclose(); + cgetclose(); return (cgetnext(buf, db_array)); } @@ -626,10 +616,10 @@ static int slash; static char **dbp; int -cgetclose() +cgetclose(void) { if (pfp != NULL) { - (void)fclose(pfp); + fclose(pfp); pfp = NULL; } dbp = NULL; @@ -644,9 +634,7 @@ cgetclose() * upon returning an entry with more remaining, and -1 if an error occurs. */ int -cgetnext(bp, db_array) - char **bp; - char **db_array; +cgetnext(char **bp, char **db_array) { size_t len; int done, hadreaderr, i, savederrno, status; @@ -657,7 +645,7 @@ cgetnext(bp, db_array) dbp = db_array; if (pfp == NULL && (pfp = fopen(*dbp, "r")) == NULL) { - (void)cgetclose(); + cgetclose(); return (-1); } for(;;) { @@ -678,11 +666,11 @@ cgetnext(bp, db_array) return (-1); } else { if (*++dbp == NULL) { - (void)cgetclose(); + cgetclose(); return (0); } else if ((pfp = fopen(*dbp, "r")) == NULL) { - (void)cgetclose(); + cgetclose(); return (-1); } else continue; @@ -767,7 +755,7 @@ cgetnext(bp, db_array) */ status = getent(bp, &dummy, db_array, -1, buf, 0, NULL); if (status == -2 || status == -3) - (void)cgetclose(); + cgetclose(); return (status + 1); } @@ -784,9 +772,7 @@ cgetnext(bp, db_array) * allocation failure). */ int -cgetstr(buf, cap, str) - char *buf, *cap; - char **str; +cgetstr(char *buf, char *cap, char **str) { u_int m_room; char *bp, *mp; @@ -913,8 +899,7 @@ cgetstr(buf, cap, str) * error was encountered (storage allocation failure). */ int -cgetustr(buf, cap, str) - char *buf, *cap, **str; +cgetustr(char *buf, char *cap, char **str) { u_int m_room; char *bp, *mp; @@ -982,9 +967,7 @@ cgetustr(buf, cap, str) * numeric capability couldn't be found. */ int -cgetnum(buf, cap, num) - char *buf, *cap; - long *num; +cgetnum(char *buf, char *cap, long *num) { long n; int base, digit; @@ -1046,8 +1029,7 @@ cgetnum(buf, cap, num) * Compare name field of record. */ static int -nfcmp(nf, rec) - char *nf, *rec; +nfcmp(char *nf, char *rec) { char *cp, tmp; int ret; diff --git a/lib/libc/gen/getdomainname.c b/lib/libc/gen/getdomainname.c index 8a2a3b3143..685e486f50 100644 --- a/lib/libc/gen/getdomainname.c +++ b/lib/libc/gen/getdomainname.c @@ -32,7 +32,7 @@ * * @(#)gethostname.c 8.1 (Berkeley) 6/4/93 * $FreeBSD: src/lib/libc/gen/getdomainname.c,v 1.6 1999/08/27 23:58:39 peter Exp $ - * $DragonFly: src/lib/libc/gen/getdomainname.c,v 1.2 2003/06/17 04:26:42 dillon Exp $ + * $DragonFly: src/lib/libc/gen/getdomainname.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -41,9 +41,7 @@ #include int -getdomainname(name, namelen) - char *name; - int namelen; +getdomainname(char *name, int namelen) { int mib[2]; size_t size; diff --git a/lib/libc/gen/gethostname.c b/lib/libc/gen/gethostname.c index 560c699d85..c3fe19b62d 100644 --- a/lib/libc/gen/gethostname.c +++ b/lib/libc/gen/gethostname.c @@ -31,15 +31,14 @@ * SUCH DAMAGE. * * @(#)gethostname.c 8.1 (Berkeley) 6/4/93 + * $DragonFly: src/lib/libc/gen/gethostname.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include #include int -gethostname(name, namelen) - char *name; - int namelen; +gethostname(char *name, int namelen) { int mib[2]; size_t size; diff --git a/lib/libc/gen/getmntinfo.c b/lib/libc/gen/getmntinfo.c index e763e13b13..901b1c38ab 100644 --- a/lib/libc/gen/getmntinfo.c +++ b/lib/libc/gen/getmntinfo.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)getmntinfo.c 8.1 (Berkeley) 6/4/93 - * $DragonFly: src/lib/libc/gen/getmntinfo.c,v 1.3 2005/02/02 06:14:51 dillon Exp $ + * $DragonFly: src/lib/libc/gen/getmntinfo.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -43,9 +43,7 @@ * Return information about mounted filesystems. */ int -getmntinfo(mntbufp, flags) - struct statfs **mntbufp; - int flags; +getmntinfo(struct statfs **mntbufp, int flags) { static struct statfs *mntbuf; static int mntsize; diff --git a/lib/libc/gen/getosreldate.c b/lib/libc/gen/getosreldate.c index 931b25e08a..230d00490a 100644 --- a/lib/libc/gen/getosreldate.c +++ b/lib/libc/gen/getosreldate.c @@ -32,19 +32,14 @@ * * @(#)gethostid.c 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/lib/libc/gen/getosreldate.c,v 1.4 1999/08/27 23:58:43 peter Exp $ - * $DragonFly: src/lib/libc/gen/getosreldate.c,v 1.2 2003/06/17 04:26:42 dillon Exp $ + * $DragonFly: src/lib/libc/gen/getosreldate.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include #include -#if __STDC__ int getosreldate(void) -#else -int -getosreldate() -#endif { int mib[2]; size_t size; diff --git a/lib/libc/gen/getpagesize.c b/lib/libc/gen/getpagesize.c index d8df22f156..e2883d3c2d 100644 --- a/lib/libc/gen/getpagesize.c +++ b/lib/libc/gen/getpagesize.c @@ -31,6 +31,7 @@ * SUCH DAMAGE. * * @(#)getpagesize.c 8.1 (Berkeley) 6/4/93 + * $DragonFly: src/lib/libc/gen/getpagesize.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -42,7 +43,7 @@ */ int -getpagesize() +getpagesize(void) { int mib[2]; static int value; diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 10069200f7..4a5ec4b921 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -32,7 +32,7 @@ * * @(#)getpwent.c 8.2 (Berkeley) 4/27/95 * $FreeBSD: src/lib/libc/gen/getpwent.c,v 1.53.2.2 2001/03/05 09:52:13 obrien Exp $ - * $DragonFly: src/lib/libc/gen/getpwent.c,v 1.5 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/getpwent.c,v 1.6 2005/11/13 00:07:42 swildner Exp $ */ #include "namespace.h" @@ -97,7 +97,7 @@ static int __hashpw(DBT *); static int __initdb(void); struct passwd * -getpwent() +getpwent(void) { DBT key; char bf[sizeof(_pw_keynum) + 1]; @@ -145,8 +145,7 @@ tryagain: } struct passwd * -getpwnam(name) - const char *name; +getpwnam(const char *name) { DBT key; int len, rval; @@ -185,8 +184,7 @@ getpwnam(name) } struct passwd * -getpwuid(uid) - uid_t uid; +getpwuid(uid_t uid) { DBT key; int keyuid, rval; @@ -226,8 +224,7 @@ getpwuid(uid) } int -setpassent(stayopen) - int stayopen; +setpassent(int stayopen) { _pw_keynum = 0; #ifdef YP @@ -240,25 +237,25 @@ setpassent(stayopen) } void -setpwent() +setpwent(void) { - (void)setpassent(0); + setpassent(0); } void -endpwent() +endpwent(void) { _pw_keynum = 0; #ifdef YP _pw_stepping_yp = 0; #endif if (_pw_db) { - (void)(_pw_db->close)(_pw_db); + (_pw_db->close)(_pw_db); _pw_db = (DB *)NULL; } #ifdef YP if (_ypcache) { - (void)(_ypcache->close)(_ypcache); + (_ypcache->close)(_ypcache); _ypcache = (DB *)NULL; _yp_exclusions = 0; } @@ -268,7 +265,7 @@ endpwent() } static int -__initdb() +__initdb(void) { static int warned; char *p; @@ -283,8 +280,7 @@ __initdb() } static int -__hashpw(key) - DBT *key; +__hashpw(DBT *key) { char *p, *t; static u_int max; @@ -324,7 +320,7 @@ __hashpw(key) #ifdef YP static void -_ypinitdb() +_ypinitdb(void) { DBT key, data; char buf[] = { _PW_KEYYPENABLED }; @@ -353,8 +349,7 @@ _ypinitdb() * See if a user is in the blackballed list. */ static inline int -lookup(name) - const char *name; +lookup(const char *name) { DBT key; @@ -375,8 +370,7 @@ lookup(name) * Store a blackballed user in an in-core hash database. */ static inline void -store(key) - const char *key; +store(const char *key) { DBT lkey; /* @@ -389,7 +383,7 @@ store(key) lkey.data = (char *)key; lkey.size = strlen(key); - (void)(_ypcache->put)(_ypcache, &lkey, &empty, R_NOOVERWRITE); + (_ypcache->put)(_ypcache, &lkey, &empty, R_NOOVERWRITE); } /* @@ -405,8 +399,7 @@ store(key) * later. */ static inline int -unwind(grp) - char *grp; +unwind(char *grp) { char *user, *host, *domain; static int latch = 0; @@ -488,9 +481,7 @@ again: * See if a user is a member of a particular group. */ static inline int -ingr(grp, name) - const char *grp; - const char *name; +ingr(const char *grp, const char *name) { struct group *gr; @@ -513,8 +504,7 @@ ingr(grp, name) * try searching regular groups with the same name. */ static inline int -verf(name) - const char *name; +verf(const char *name) { DBT key; char bf[sizeof(_pw_keynum) + 1]; @@ -577,8 +567,7 @@ again: } static char * -_get_adjunct_pw(name) - const char *name; +_get_adjunct_pw(const char *name) { static char adjunctbuf[YPMAXRECORD+2]; int rval; diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c index 1c707744a4..4f606e8bc7 100644 --- a/lib/libc/gen/getttyent.c +++ b/lib/libc/gen/getttyent.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/getttyent.c,v 1.11 1999/11/04 04:16:27 ache Exp $ - * $DragonFly: src/lib/libc/gen/getttyent.c,v 1.4 2004/06/06 15:05:55 hmp Exp $ + * $DragonFly: src/lib/libc/gen/getttyent.c,v 1.5 2005/11/13 00:07:42 swildner Exp $ * * @(#)getttyent.c 8.1 (Berkeley) 6/4/93 */ @@ -53,8 +53,7 @@ static char *skip (char *); static char *value (char *); struct ttyent * -getttynam(tty) - const char *tty; +getttynam(const char *tty) { struct ttyent *t; @@ -69,7 +68,7 @@ getttynam(tty) } struct ttyent * -getttyent() +getttyent(void) { static struct ttyent tty; char *p; @@ -86,7 +85,7 @@ getttyent() i = strlen(p); lbsize += MALLOCCHUNK; if ((p = realloc(line, lbsize)) == NULL) { - (void)endttyent(); + endttyent(); return (NULL); } line = p; @@ -163,8 +162,7 @@ getttyent() * the next field. */ static char * -skip(p) - char *p; +skip(char *p) { char *t; int c, q; @@ -197,15 +195,14 @@ skip(p) } static char * -value(p) - char *p; +value(char *p) { return ((p = index(p, '=')) ? ++p : NULL); } int -setttyent() +setttyent(void) { if (line == NULL) { @@ -222,7 +219,7 @@ setttyent() } int -endttyent() +endttyent(void) { int rval; @@ -239,9 +236,7 @@ endttyent() } static int -isttystat(tty, flag) - const char *tty; - int flag; +isttystat(const char *tty, int flag) { struct ttyent *t; @@ -250,15 +245,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/getusershell.c b/lib/libc/gen/getusershell.c index 5f930bbdca..6a6347ab46 100644 --- a/lib/libc/gen/getusershell.c +++ b/lib/libc/gen/getusershell.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/getusershell.c,v 1.3.2.1 2001/03/05 09:17:52 obrien Exp $ - * $DragonFly: src/lib/libc/gen/getusershell.c,v 1.3 2003/11/12 20:21:23 eirikn Exp $ + * $DragonFly: src/lib/libc/gen/getusershell.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ * * @(#)getusershell.c 8.1 (Berkeley) 6/4/93 * $FreeBSD: src/lib/libc/gen/getusershell.c,v 1.3.2.1 2001/03/05 09:17:52 obrien Exp $ @@ -93,7 +93,7 @@ setusershell(void) } static char ** -initshells() +initshells(void) { char **sp, *cp; FILE *fp; @@ -108,16 +108,16 @@ initshells() if ((fp = fopen(_PATH_SHELLS, "r")) == NULL) return (okshells); if (fstat(fileno(fp), &statb) == -1) { - (void)fclose(fp); + fclose(fp); return (okshells); } if ((strings = malloc((u_int)statb.st_size)) == NULL) { - (void)fclose(fp); + fclose(fp); return (okshells); } shells = calloc((unsigned)statb.st_size / 3, sizeof (char *)); if (shells == NULL) { - (void)fclose(fp); + fclose(fp); free(strings); strings = NULL; return (okshells); @@ -135,6 +135,6 @@ initshells() *cp++ = '\0'; } *sp = NULL; - (void)fclose(fp); + fclose(fp); return (shells); } diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c index 0fcd9e3c23..796ac44194 100644 --- a/lib/libc/gen/glob.c +++ b/lib/libc/gen/glob.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/glob.c,v 1.11.6.6 2002/09/18 14:13:31 mikeh Exp $ - * $DragonFly: src/lib/libc/gen/glob.c,v 1.4 2005/04/26 08:07:58 joerg Exp $ + * $DragonFly: src/lib/libc/gen/glob.c,v 1.5 2005/11/13 00:07:42 swildner Exp $ * * @(#)glob.c 8.3 (Berkeley) 10/13/93 * $FreeBSD: src/lib/libc/gen/glob.c,v 1.11.6.6 2002/09/18 14:13:31 mikeh Exp $ @@ -842,15 +842,15 @@ qprintf(const char *str, const Char *s) { const Char *p; - (void)printf("%s:\n", str); + printf("%s:\n", str); for (p = s; *p; p++) - (void)printf("%c", CHAR(*p)); - (void)printf("\n"); + printf("%c", CHAR(*p)); + printf("\n"); for (p = s; *p; p++) - (void)printf("%c", *p & M_PROTECT ? '"' : ' '); - (void)printf("\n"); + printf("%c", *p & M_PROTECT ? '"' : ' '); + printf("\n"); for (p = s; *p; p++) - (void)printf("%c", ismeta(*p) ? '_' : ' '); - (void)printf("\n"); + printf("%c", ismeta(*p) ? '_' : ' '); + printf("\n"); } #endif diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c index ab514cab8b..67b3b4d08c 100644 --- a/lib/libc/gen/initgroups.c +++ b/lib/libc/gen/initgroups.c @@ -32,7 +32,7 @@ * * @(#)initgroups.c 8.1 (Berkeley) 6/4/93 * $FreeBSD: src/lib/libc/gen/initgroups.c,v 1.3.8.1 2001/12/19 15:49:35 tobez Exp $ - * $DragonFly: src/lib/libc/gen/initgroups.c,v 1.4 2004/09/19 17:25:42 joerg Exp $ + * $DragonFly: src/lib/libc/gen/initgroups.c,v 1.5 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -42,9 +42,7 @@ #include int -initgroups(uname, agroup) - const char *uname; - int agroup; +initgroups(const char *uname, int agroup) { gid_t ngroups; /* diff --git a/lib/libc/gen/lockf.c b/lib/libc/gen/lockf.c index 38cb99b381..0f0ca3df46 100644 --- a/lib/libc/gen/lockf.c +++ b/lib/libc/gen/lockf.c @@ -36,7 +36,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/lockf.c,v 1.5 2000/01/27 23:06:17 jasone Exp $ - * $DragonFly: src/lib/libc/gen/lockf.c,v 1.3 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/lockf.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ */ #include "namespace.h" @@ -46,10 +46,7 @@ #include "un-namespace.h" int -lockf(filedes, function, size) - int filedes; - int function; - off_t size; +lockf(int filedes, int function, off_t size) { struct flock fl; int cmd; diff --git a/lib/libc/gen/msgctl.c b/lib/libc/gen/msgctl.c index 7b74c51e24..8a6269294f 100644 --- a/lib/libc/gen/msgctl.c +++ b/lib/libc/gen/msgctl.c @@ -1,15 +1,12 @@ +/* + * $DragonFly: src/lib/libc/gen/msgctl.c,v 1.2 2005/11/13 00:07:42 swildner Exp $ + */ + #include #include #include -#if __STDC__ int msgctl(int msqid, int cmd, struct msqid_ds *buf) -#else -int msgctl(msqid,cmd,buf) - int msqid; - int cmd; - caddr_t buf; -#endif { return (msgsys(0, msqid, cmd, buf)); } diff --git a/lib/libc/gen/msgget.c b/lib/libc/gen/msgget.c index 3e146b05cb..deb5c36db2 100644 --- a/lib/libc/gen/msgget.c +++ b/lib/libc/gen/msgget.c @@ -1,14 +1,12 @@ +/* + * $DragonFly: src/lib/libc/gen/msgget.c,v 1.2 2005/11/13 00:07:42 swildner Exp $ + */ + #include #include #include -#if __STDC__ int msgget(key_t key, int msgflg) -#else -int msgget(key,msgflg) - key_t key; - int msgflg; -#endif { return (msgsys(1, key, msgflg)); } diff --git a/lib/libc/gen/msgrcv.c b/lib/libc/gen/msgrcv.c index 5c1e387d14..2a273fcdbd 100644 --- a/lib/libc/gen/msgrcv.c +++ b/lib/libc/gen/msgrcv.c @@ -1,17 +1,12 @@ +/* + * $DragonFly: src/lib/libc/gen/msgrcv.c,v 1.2 2005/11/13 00:07:42 swildner Exp $ + */ + #include #include #include -#if __STDC__ int msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg) -#else -int msgrcv(msqid, msgp, msgsz, msgtyp, msgflg) - int msqid; - void *msgp; - size_t msgsz; - long msgtyp; - int msgflg; -#endif { return (msgsys(3, msqid, msgp, msgsz, msgtyp, msgflg)); } diff --git a/lib/libc/gen/msgsnd.c b/lib/libc/gen/msgsnd.c index a6209159ff..376976f985 100644 --- a/lib/libc/gen/msgsnd.c +++ b/lib/libc/gen/msgsnd.c @@ -1,16 +1,12 @@ +/* + * $DragonFly: src/lib/libc/gen/msgsnd.c,v 1.2 2005/11/13 00:07:42 swildner Exp $ + */ + #include #include #include -#if __STDC__ int msgsnd(int msqid, void *msgp, size_t msgsz, int msgflg) -#else -int msgsnd(msqid, msgp, msgsz, msgflg) - int msqid; - void *msgp; - size_t msgsz; - int msgflg; -#endif { return (msgsys(2, msqid, msgp, msgsz, msgflg)); } diff --git a/lib/libc/gen/nice.c b/lib/libc/gen/nice.c index 2ef4a4bc3f..ee4af4f623 100644 --- a/lib/libc/gen/nice.c +++ b/lib/libc/gen/nice.c @@ -31,6 +31,7 @@ * SUCH DAMAGE. * * @(#)nice.c 8.1 (Berkeley) 6/4/93 + * $DragonFly: src/lib/libc/gen/nice.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -43,8 +44,7 @@ * Backwards compatible nice. */ int -nice(incr) - int incr; +nice(int incr) { int prio; diff --git a/lib/libc/gen/opendir.c b/lib/libc/gen/opendir.c index cd6e62caac..f45eb2d25a 100644 --- a/lib/libc/gen/opendir.c +++ b/lib/libc/gen/opendir.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/opendir.c,v 1.10.2.1 2001/06/04 20:59:48 joerg Exp $ - * $DragonFly: src/lib/libc/gen/opendir.c,v 1.5 2005/04/26 17:56:43 joerg Exp $ + * $DragonFly: src/lib/libc/gen/opendir.c,v 1.6 2005/11/13 00:07:42 swildner Exp $ * * @(#)opendir.c 8.8 (Berkeley) 5/1/95 */ @@ -120,7 +120,7 @@ __opendir2(const char *name, int flags) fail: saved_errno = errno; free(dirp); - (void)_close(fd); + _close(fd); errno = saved_errno; return (NULL); } diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c index 319d9ce914..4cd82391a6 100644 --- a/lib/libc/gen/popen.c +++ b/lib/libc/gen/popen.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/popen.c,v 1.14 2000/01/27 23:06:19 jasone Exp $ - * $DragonFly: src/lib/libc/gen/popen.c,v 1.5 2005/04/26 08:37:24 joerg Exp $ + * $DragonFly: src/lib/libc/gen/popen.c,v 1.6 2005/11/13 00:07:42 swildner Exp $ * * @(#)popen.c 8.3 (Berkeley) 5/3/95 */ @@ -85,8 +85,8 @@ popen(const char *command, const char *type) return (NULL); if ((cur = malloc(sizeof(struct pid))) == NULL) { - (void)_close(pdes[0]); - (void)_close(pdes[1]); + _close(pdes[0]); + _close(pdes[1]); return (NULL); } @@ -97,8 +97,8 @@ popen(const char *command, const char *type) switch (pid = fork()) { case -1: /* Error. */ - (void)_close(pdes[0]); - (void)_close(pdes[1]); + _close(pdes[0]); + _close(pdes[1]); free(cur); return (NULL); /* NOTREACHED */ @@ -112,23 +112,23 @@ popen(const char *command, const char *type) * the compiler is free to corrupt all the local * variables. */ - (void)_close(pdes[0]); + _close(pdes[0]); if (pdes[1] != STDOUT_FILENO) { - (void)_dup2(pdes[1], STDOUT_FILENO); - (void)_close(pdes[1]); + _dup2(pdes[1], STDOUT_FILENO); + _close(pdes[1]); if (twoway) - (void)_dup2(STDOUT_FILENO, STDIN_FILENO); + _dup2(STDOUT_FILENO, STDIN_FILENO); } else if (twoway && (pdes[1] != STDIN_FILENO)) - (void)_dup2(pdes[1], STDIN_FILENO); + _dup2(pdes[1], STDIN_FILENO); } else { if (pdes[0] != STDIN_FILENO) { - (void)_dup2(pdes[0], STDIN_FILENO); - (void)_close(pdes[0]); + _dup2(pdes[0], STDIN_FILENO); + _close(pdes[0]); } - (void)_close(pdes[1]); + _close(pdes[1]); } for (p = pidlist; p; p = p->next) { - (void)_close(fileno(p->fp)); + _close(fileno(p->fp)); } _execve(_PATH_BSHELL, __DECONST(char * const *, argv), environ); _exit(127); @@ -138,10 +138,10 @@ popen(const char *command, const char *type) /* Parent; assume fdopen can't fail. */ if (*type == 'r') { iop = fdopen(pdes[0], type); - (void)_close(pdes[1]); + _close(pdes[1]); } else { iop = fdopen(pdes[1], type); - (void)_close(pdes[0]); + _close(pdes[0]); } /* Link into list of file descriptors. */ @@ -172,7 +172,7 @@ pclose(FILE *iop) if (cur == NULL) return (-1); - (void)fclose(iop); + fclose(iop); do { pid = _wait4(cur->pid, &pstat, 0, (struct rusage *)0); diff --git a/lib/libc/gen/psignal.c b/lib/libc/gen/psignal.c index d2a083bda1..21a451f14e 100644 --- a/lib/libc/gen/psignal.c +++ b/lib/libc/gen/psignal.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/psignal.c,v 1.5 2000/01/27 23:06:19 jasone Exp $ - * $DragonFly: src/lib/libc/gen/psignal.c,v 1.4 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/psignal.c,v 1.5 2005/11/13 00:07:42 swildner Exp $ * * @(#)psignal.c 8.1 (Berkeley) 6/4/93 */ @@ -47,9 +47,7 @@ #include "un-namespace.h" void -psignal(sig, s) - unsigned int sig; - const char *s; +psignal(unsigned int sig, const char *s) { const char *c; @@ -58,9 +56,9 @@ psignal(sig, s) else c = "Unknown signal"; if (s != NULL && *s != '\0') { - (void)_write(STDERR_FILENO, s, strlen(s)); - (void)_write(STDERR_FILENO, ": ", 2); + _write(STDERR_FILENO, s, strlen(s)); + _write(STDERR_FILENO, ": ", 2); } - (void)_write(STDERR_FILENO, c, strlen(c)); - (void)_write(STDERR_FILENO, "\n", 1); + _write(STDERR_FILENO, c, strlen(c)); + _write(STDERR_FILENO, "\n", 1); } diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c index ac7d3b82bd..1f35db45e6 100644 --- a/lib/libc/gen/pwcache.c +++ b/lib/libc/gen/pwcache.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)pwcache.c 8.1 (Berkeley) 6/4/93 - * $DragonFly: src/lib/libc/gen/pwcache.c,v 1.4 2005/04/26 08:45:19 joerg Exp $ + * $DragonFly: src/lib/libc/gen/pwcache.c,v 1.5 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -66,11 +66,11 @@ user_from_uid(uid_t uid, int nouser) cp->uid = uid; if (pw != NULL) { cp->found = 1; - (void)strncpy(cp->name, pw->pw_name, UT_NAMESIZE); + strncpy(cp->name, pw->pw_name, UT_NAMESIZE); cp->name[UT_NAMESIZE] = '\0'; } else { cp->found = 0; - (void)snprintf(cp->name, UT_NAMESIZE, "%u", uid); + snprintf(cp->name, UT_NAMESIZE, "%u", uid); if (nouser) return (NULL); } @@ -100,11 +100,11 @@ group_from_gid(gid_t gid, int nogroup) cp->gid = gid; if (gr != NULL) { cp->found = 1; - (void)strncpy(cp->name, gr->gr_name, UT_NAMESIZE); + strncpy(cp->name, gr->gr_name, UT_NAMESIZE); cp->name[UT_NAMESIZE] = '\0'; } else { cp->found = 0; - (void)snprintf(cp->name, UT_NAMESIZE, "%u", gid); + snprintf(cp->name, UT_NAMESIZE, "%u", gid); if (nogroup) return (NULL); } diff --git a/lib/libc/gen/raise.c b/lib/libc/gen/raise.c index ccdb7e103a..73098cc890 100644 --- a/lib/libc/gen/raise.c +++ b/lib/libc/gen/raise.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * * @(#)raise.c 8.1 (Berkeley) 6/4/93 + * $DragonFly: src/lib/libc/gen/raise.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include #include int -raise(s) - int s; +raise(int s) { return(kill(getpid(), s)); } diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c index 9a48e13db3..2fcf29e6ca 100644 --- a/lib/libc/gen/readdir.c +++ b/lib/libc/gen/readdir.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/readdir.c,v 1.5.2.4 2002/02/26 22:53:57 alfred Exp $ - * $DragonFly: src/lib/libc/gen/readdir.c,v 1.6 2005/08/27 20:23:05 joerg Exp $ + * $DragonFly: src/lib/libc/gen/readdir.c,v 1.7 2005/11/13 00:07:42 swildner Exp $ * * @(#)readdir.c 8.3 (Berkeley) 9/29/94 */ @@ -50,8 +50,7 @@ * get next entry in a directory. */ struct dirent * -_readdir_unlocked(dirp) - DIR *dirp; +_readdir_unlocked(DIR *dirp) { struct dirent *dp; @@ -80,8 +79,7 @@ _readdir_unlocked(dirp) } struct dirent * -readdir(dirp) - DIR *dirp; +readdir(DIR *dirp) { struct dirent *dp; @@ -95,10 +93,7 @@ readdir(dirp) } int -readdir_r(dirp, entry, result) - DIR *dirp; - struct dirent *entry; - struct dirent **result; +readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) { struct dirent *dp; int ret, saved_errno; diff --git a/lib/libc/gen/readpassphrase.c b/lib/libc/gen/readpassphrase.c index 395ee1a49d..a953f89d3c 100644 --- a/lib/libc/gen/readpassphrase.c +++ b/lib/libc/gen/readpassphrase.c @@ -28,7 +28,7 @@ * * $OpenBSD: readpassphrase.c,v 1.12 2001/12/15 05:41:00 millert Exp $ * $FreeBSD: src/lib/libc/gen/readpassphrase.c,v 1.6.2.2 2002/06/30 13:54:26 des Exp $ - * $DragonFly: src/lib/libc/gen/readpassphrase.c,v 1.3 2005/04/26 08:46:54 joerg Exp $ + * $DragonFly: src/lib/libc/gen/readpassphrase.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ */ #include "namespace.h" @@ -86,13 +86,13 @@ restart: sigemptyset(&sa.sa_mask); sa.sa_flags = 0; /* don't restart system calls */ sa.sa_handler = handler; - (void)_sigaction(SIGINT, &sa, &saveint); - (void)_sigaction(SIGHUP, &sa, &savehup); - (void)_sigaction(SIGQUIT, &sa, &savequit); - (void)_sigaction(SIGTERM, &sa, &saveterm); - (void)_sigaction(SIGTSTP, &sa, &savetstp); - (void)_sigaction(SIGTTIN, &sa, &savettin); - (void)_sigaction(SIGTTOU, &sa, &savettou); + _sigaction(SIGINT, &sa, &saveint); + _sigaction(SIGHUP, &sa, &savehup); + _sigaction(SIGQUIT, &sa, &savequit); + _sigaction(SIGTERM, &sa, &saveterm); + _sigaction(SIGTSTP, &sa, &savetstp); + _sigaction(SIGTTIN, &sa, &savettin); + _sigaction(SIGTTOU, &sa, &savettou); /* Turn off echo if possible. */ if (tcgetattr(input, &oterm) == 0) { @@ -101,13 +101,13 @@ restart: term.c_lflag &= ~(ECHO | ECHONL); if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) term.c_cc[VSTATUS] = _POSIX_VDISABLE; - (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term); + tcsetattr(input, TCSAFLUSH|TCSASOFT, &term); } else { memset(&term, 0, sizeof(term)); memset(&oterm, 0, sizeof(oterm)); } - (void)_write(output, prompt, strlen(prompt)); + _write(output, prompt, strlen(prompt)); end = buf + bufsiz - 1; for (p = buf; (nr = _read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r';) { if (p < end) { @@ -125,20 +125,20 @@ restart: *p = '\0'; save_errno = errno; if (!(term.c_lflag & ECHO)) - (void)_write(output, "\n", 1); + _write(output, "\n", 1); /* Restore old terminal settings and signals. */ if (memcmp(&term, &oterm, sizeof(term)) != 0) - (void)tcsetattr(input, TCSANOW|TCSASOFT, &oterm); - (void)_sigaction(SIGINT, &saveint, NULL); - (void)_sigaction(SIGHUP, &savehup, NULL); - (void)_sigaction(SIGQUIT, &savequit, NULL); - (void)_sigaction(SIGTERM, &saveterm, NULL); - (void)_sigaction(SIGTSTP, &savetstp, NULL); - (void)_sigaction(SIGTTIN, &savettin, NULL); - (void)_sigaction(SIGTTOU, &savettou, NULL); + tcsetattr(input, TCSANOW|TCSASOFT, &oterm); + _sigaction(SIGINT, &saveint, NULL); + _sigaction(SIGHUP, &savehup, NULL); + _sigaction(SIGQUIT, &savequit, NULL); + _sigaction(SIGTERM, &saveterm, NULL); + _sigaction(SIGTSTP, &savetstp, NULL); + _sigaction(SIGTTIN, &savettin, NULL); + _sigaction(SIGTTOU, &savettou, NULL); if (input != STDIN_FILENO) - (void)_close(input); + _close(input); /* * If we were interrupted by a signal, resend it to ourselves @@ -169,8 +169,8 @@ getpass(const char *prompt) return(buf); } -static void handler(int s) +static void +handler(int s) { - signo = s; } diff --git a/lib/libc/gen/seekdir.c b/lib/libc/gen/seekdir.c index 0d39deca0e..bd4f5d69c5 100644 --- a/lib/libc/gen/seekdir.c +++ b/lib/libc/gen/seekdir.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/seekdir.c,v 1.2.8.1 2001/03/05 09:52:13 obrien Exp $ - * $DragonFly: src/lib/libc/gen/seekdir.c,v 1.4 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/seekdir.c,v 1.5 2005/11/13 00:07:42 swildner Exp $ * * @(#)seekdir.c 8.1 (Berkeley) 6/4/93 */ @@ -51,9 +51,7 @@ extern void _seekdir ( DIR *, long ); * _seekdir is in telldir.c so that it can share opaque data structures. */ void -seekdir(dirp, loc) - DIR *dirp; - long loc; +seekdir(DIR *dirp, long loc) { if (__isthreaded) _pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock); diff --git a/lib/libc/gen/semconfig.c b/lib/libc/gen/semconfig.c index cf5399b6dd..6f5a3077b5 100644 --- a/lib/libc/gen/semconfig.c +++ b/lib/libc/gen/semconfig.c @@ -1,13 +1,12 @@ +/* + * $DragonFly: src/lib/libc/gen/semconfig.c,v 1.2 2005/11/13 00:07:42 swildner Exp $ + */ + #include #include #include -#if __STDC__ int semconfig(int cmd, int p1, int p2, int p3) -#else -int semconfig(cmd, p1, p2, p3) - int cmd, p1, p2, p3; -#endif { return (semsys(3, cmd, p1, p2, p3)); } diff --git a/lib/libc/gen/semget.c b/lib/libc/gen/semget.c index 81c6a86e43..f5271c1a2a 100644 --- a/lib/libc/gen/semget.c +++ b/lib/libc/gen/semget.c @@ -1,15 +1,12 @@ +/* + * $DragonFly: src/lib/libc/gen/semget.c,v 1.2 2005/11/13 00:07:42 swildner Exp $ + */ + #include #include #include -#if __STDC__ int semget(key_t key, int nsems, int semflg) -#else -int semget(key, nsems, semflg) - key_t key; - int nsems; - int semflg; -#endif { return (semsys(1, key, nsems, semflg)); } diff --git a/lib/libc/gen/semop.c b/lib/libc/gen/semop.c index 0b97c6aacb..41ca3ebdb1 100644 --- a/lib/libc/gen/semop.c +++ b/lib/libc/gen/semop.c @@ -1,15 +1,12 @@ +/* + * $DragonFly: src/lib/libc/gen/semop.c,v 1.2 2005/11/13 00:07:42 swildner Exp $ + */ + #include #include #include -#if __STDC__ int semop(int semid, struct sembuf *sops, unsigned nsops) -#else -int semop(semid, sops, nsops) - int semid; - struct sembuf *sops; - unsigned nsops; -#endif { return (semsys(2, semid, sops, nsops, 0)); } diff --git a/lib/libc/gen/setjmperr.c b/lib/libc/gen/setjmperr.c index dcbed2baba..c47eb3f985 100644 --- a/lib/libc/gen/setjmperr.c +++ b/lib/libc/gen/setjmperr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/setjmperr.c,v 1.3 2000/01/27 23:06:19 jasone Exp $ - * $DragonFly: src/lib/libc/gen/setjmperr.c,v 1.3 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/setjmperr.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ * * @(#)setjmperr.c 8.1 (Berkeley) 6/4/93 */ @@ -49,8 +49,8 @@ #include "un-namespace.h" void -longjmperror() +longjmperror(void) { #define ERRMSG "longjmp botch.\n" - (void)_write(STDERR_FILENO, ERRMSG, sizeof(ERRMSG) - 1); + _write(STDERR_FILENO, ERRMSG, sizeof(ERRMSG) - 1); } diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c index 08bfd034b0..0cf03cd949 100644 --- a/lib/libc/gen/setmode.c +++ b/lib/libc/gen/setmode.c @@ -35,7 +35,7 @@ * * @(#)setmode.c 8.2 (Berkeley) 3/25/94 * $FreeBSD: src/lib/libc/gen/setmode.c,v 1.5.2.1 2001/03/05 09:34:10 obrien Exp $ - * $DragonFly: src/lib/libc/gen/setmode.c,v 1.5 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/setmode.c,v 1.6 2005/11/13 00:07:42 swildner Exp $ */ #include "namespace.h" @@ -80,9 +80,7 @@ static void dumpmode (BITCMD *); * bits) followed by a '+' (set bits). */ mode_t -getmode(bbox, omode) - void *bbox; - mode_t omode; +getmode(void *bbox, mode_t omode) { BITCMD *set; mode_t clrval, newmode, value; @@ -143,7 +141,7 @@ common: if (set->cmd2 & CMD2_CLR) { case '\0': default: #ifdef SETMODE_DEBUG - (void)printf("getmode:%04o -> %04o\n", omode, newmode); + printf("getmode:%04o -> %04o\n", omode, newmode); #endif return (newmode); } @@ -165,8 +163,7 @@ common: if (set->cmd2 & CMD2_CLR) { #define STANDARD_BITS (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) void * -setmode(p) - char *p; +setmode(char *p) { int perm, who; char op; @@ -185,10 +182,10 @@ setmode(p) * as best we can. */ sigfillset(&sigset); - (void)_sigprocmask(SIG_BLOCK, &sigset, &sigoset); - (void)umask(mask = umask(0)); + _sigprocmask(SIG_BLOCK, &sigset, &sigoset); + umask(mask = umask(0)); mask = ~mask; - (void)_sigprocmask(SIG_SETMASK, &sigoset, NULL); + _sigprocmask(SIG_SETMASK, &sigoset, NULL); setlen = SET_LEN + 2; @@ -323,23 +320,19 @@ apply: if (!*p) } set->cmd = 0; #ifdef SETMODE_DEBUG - (void)printf("Before compress_mode()\n"); + printf("Before compress_mode()\n"); dumpmode(saveset); #endif compress_mode(saveset); #ifdef SETMODE_DEBUG - (void)printf("After compress_mode()\n"); + printf("After compress_mode()\n"); dumpmode(saveset); #endif return (saveset); } static BITCMD * -addcmd(set, op, who, oparg, mask) - BITCMD *set; - int oparg, who; - int op; - u_int mask; +addcmd(BITCMD *set, int op, int who, int oparg, u_int mask) { switch (op) { case '=': @@ -383,11 +376,10 @@ addcmd(set, op, who, oparg, mask) #ifdef SETMODE_DEBUG static void -dumpmode(set) - BITCMD *set; +dumpmode(BITCMD *set) { for (; set->cmd; ++set) - (void)printf("cmd: '%c' bits %04o%s%s%s%s%s%s\n", + printf("cmd: '%c' bits %04o%s%s%s%s%s%s\n", set->cmd, set->bits, set->cmd2 ? " cmd2:" : "", set->cmd2 & CMD2_CLR ? " CLR" : "", set->cmd2 & CMD2_SET ? " SET" : "", @@ -404,8 +396,7 @@ dumpmode(set) * compacted, but it's not worth the effort. */ static void -compress_mode(set) - BITCMD *set; +compress_mode(BITCMD *set) { BITCMD *nset; int setbits, clrbits, Xbits, op; diff --git a/lib/libc/gen/setproctitle.c b/lib/libc/gen/setproctitle.c index d8d2e9cdab..0c07977abd 100644 --- a/lib/libc/gen/setproctitle.c +++ b/lib/libc/gen/setproctitle.c @@ -15,7 +15,7 @@ * Peter Wemm. * * $FreeBSD: src/lib/libc/gen/setproctitle.c,v 1.12.2.2 2000/12/10 20:27:08 jdp Exp $ - * $DragonFly: src/lib/libc/gen/setproctitle.c,v 1.4 2005/03/09 18:52:21 joerg Exp $ + * $DragonFly: src/lib/libc/gen/setproctitle.c,v 1.5 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -82,12 +82,12 @@ setproctitle(const char *fmt, ...) len = 0; } else { /* print program name heading for grep */ - (void) snprintf(buf, sizeof(buf), "%s: ", getprogname()); + snprintf(buf, sizeof(buf), "%s: ", getprogname()); len = strlen(buf); } /* print the argument string */ - (void) vsnprintf(buf + len, sizeof(buf) - len, fmt, ap); + vsnprintf(buf + len, sizeof(buf) - len, fmt, ap); nargvp = nargv; nargc = 1; diff --git a/lib/libc/gen/shmat.c b/lib/libc/gen/shmat.c index 85c93e9b01..ed404b8435 100644 --- a/lib/libc/gen/shmat.c +++ b/lib/libc/gen/shmat.c @@ -1,20 +1,13 @@ /* * $FreeBSD: src/lib/libc/gen/shmat.c,v 1.4 1999/08/27 23:58:56 peter Exp $ - * $DragonFly: src/lib/libc/gen/shmat.c,v 1.2 2003/06/17 04:26:42 dillon Exp $ + * $DragonFly: src/lib/libc/gen/shmat.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include #include #include -#if __STDC__ void *shmat(int shmid, void *shmaddr, int shmflg) -#else -void *shmat(shmid, shmaddr, shmflg) - int shmid; - void *shmaddr; - int shmflg; -#endif { return ((void *)shmsys(0, shmid, shmaddr, shmflg)); } diff --git a/lib/libc/gen/shmctl.c b/lib/libc/gen/shmctl.c index df2b99a33a..a074792fca 100644 --- a/lib/libc/gen/shmctl.c +++ b/lib/libc/gen/shmctl.c @@ -1,20 +1,13 @@ /* * $FreeBSD: src/lib/libc/gen/shmctl.c,v 1.4 1999/08/27 23:58:57 peter Exp $ - * $DragonFly: src/lib/libc/gen/shmctl.c,v 1.2 2003/06/17 04:26:42 dillon Exp $ + * $DragonFly: src/lib/libc/gen/shmctl.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include #include #include -#if __STDC__ int shmctl(int shmid, int cmd, struct shmid_ds *buf) -#else -int shmctl(shmid, cmd, buf) - int shmid; - int cmd; - struct shmid_ds *buf; -#endif { return (shmsys(4, shmid, cmd, buf)); } diff --git a/lib/libc/gen/shmdt.c b/lib/libc/gen/shmdt.c index 0d6d297e1a..827f909a10 100644 --- a/lib/libc/gen/shmdt.c +++ b/lib/libc/gen/shmdt.c @@ -1,18 +1,13 @@ /* * $FreeBSD: src/lib/libc/gen/shmdt.c,v 1.4 1999/08/27 23:58:57 peter Exp $ - * $DragonFly: src/lib/libc/gen/shmdt.c,v 1.2 2003/06/17 04:26:42 dillon Exp $ + * $DragonFly: src/lib/libc/gen/shmdt.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include #include #include -#if __STDC__ int shmdt(void *shmaddr) -#else -int shmdt(shmaddr) - void *shmaddr; -#endif { return (shmsys(2, shmaddr)); } diff --git a/lib/libc/gen/shmget.c b/lib/libc/gen/shmget.c index ae04f769c2..099c34cbb4 100644 --- a/lib/libc/gen/shmget.c +++ b/lib/libc/gen/shmget.c @@ -1,20 +1,13 @@ /* * $FreeBSD: src/lib/libc/gen/shmget.c,v 1.4 1999/08/27 23:58:57 peter Exp $ - * $DragonFly: src/lib/libc/gen/shmget.c,v 1.2 2003/06/17 04:26:42 dillon Exp $ + * $DragonFly: src/lib/libc/gen/shmget.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include #include #include -#if __STDC__ int shmget(key_t key, int size, int shmflg) -#else -int shmget(key, size, shmflg) - key_t key; - int size; - int shmflg; -#endif { return (shmsys(3, key, size, shmflg)); } diff --git a/lib/libc/gen/siginterrupt.c b/lib/libc/gen/siginterrupt.c index 4b74f43719..a6ed2bba10 100644 --- a/lib/libc/gen/siginterrupt.c +++ b/lib/libc/gen/siginterrupt.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/siginterrupt.c,v 1.2.8.1 2001/03/05 09:34:53 obrien Exp $ - * $DragonFly: src/lib/libc/gen/siginterrupt.c,v 1.3 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/siginterrupt.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ * * @(#)siginterrupt.c 8.1 (Berkeley) 6/4/93 */ @@ -46,8 +46,7 @@ * after an instance of the indicated signal. */ int -siginterrupt(sig, flag) - int sig, flag; +siginterrupt(int sig, int flag) { extern sigset_t _sigintr; struct sigaction sa; diff --git a/lib/libc/gen/signal.c b/lib/libc/gen/signal.c index 1fd0016e88..8fba080b1e 100644 --- a/lib/libc/gen/signal.c +++ b/lib/libc/gen/signal.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/signal.c,v 1.1.1.1.14.1 2001/03/05 09:52:13 obrien Exp $ - * $DragonFly: src/lib/libc/gen/signal.c,v 1.3 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/signal.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ * * @(#)signal.c 8.1 (Berkeley) 6/4/93 */ @@ -47,9 +47,7 @@ sigset_t _sigintr; /* shared with siginterrupt */ sig_t -signal(s, a) - int s; - sig_t a; +signal(int s, sig_t a) { struct sigaction sa, osa; diff --git a/lib/libc/gen/sigsetops.c b/lib/libc/gen/sigsetops.c index 507604f428..1317798aa5 100644 --- a/lib/libc/gen/sigsetops.c +++ b/lib/libc/gen/sigsetops.c @@ -34,16 +34,14 @@ * * @(#)sigsetops.c 8.1 (Berkeley) 6/4/93 * $FreeBSD: src/lib/libc/gen/sigsetops.c,v 1.7 1999/10/02 19:37:14 marcel Exp $ - * $DragonFly: src/lib/libc/gen/sigsetops.c,v 1.2 2003/06/17 04:26:42 dillon Exp $ + * $DragonFly: src/lib/libc/gen/sigsetops.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include #include int -sigaddset(set, signo) - sigset_t *set; - int signo; +sigaddset(sigset_t *set, int signo) { if (signo <= 0 || signo > _SIG_MAXSIG) { @@ -55,9 +53,7 @@ sigaddset(set, signo) } int -sigdelset(set, signo) - sigset_t *set; - int signo; +sigdelset(sigset_t *set, int signo) { if (signo <= 0 || signo > _SIG_MAXSIG) { @@ -69,8 +65,7 @@ sigdelset(set, signo) } int -sigemptyset(set) - sigset_t *set; +sigemptyset(sigset_t *set) { int i; @@ -80,8 +75,7 @@ sigemptyset(set) } int -sigfillset(set) - sigset_t *set; +sigfillset(sigset_t *set) { int i; @@ -91,9 +85,7 @@ sigfillset(set) } int -sigismember(set, signo) - const sigset_t *set; - int signo; +sigismember(const sigset_t *set, int signo) { if (signo <= 0 || signo > _SIG_MAXSIG) { diff --git a/lib/libc/gen/sleep.c b/lib/libc/gen/sleep.c index 6d05dca8ce..19bbc5830e 100644 --- a/lib/libc/gen/sleep.c +++ b/lib/libc/gen/sleep.c @@ -32,7 +32,7 @@ * * @(#)sleep.c 8.1 (Berkeley) 6/4/93 * $FreeBSD: src/lib/libc/gen/sleep.c,v 1.28.2.1 2000/03/18 23:13:24 jasone Exp $ - * $DragonFly: src/lib/libc/gen/sleep.c,v 1.3 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/sleep.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ */ #include "namespace.h" @@ -43,8 +43,7 @@ #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/stringlist.c b/lib/libc/gen/stringlist.c index d8dcd1af69..64fd57accb 100644 --- a/lib/libc/gen/stringlist.c +++ b/lib/libc/gen/stringlist.c @@ -31,6 +31,7 @@ * SUCH DAMAGE. * * $NetBSD: stringlist.c,v 1.2 1997/01/17 07:26:20 lukem Exp $ + * $DragonFly: src/lib/libc/gen/stringlist.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -45,7 +46,7 @@ * sl_init(): Initialize a string list */ StringList * -sl_init() +sl_init(void) { StringList *sl = malloc(sizeof(StringList)); if (sl == NULL) @@ -64,9 +65,7 @@ sl_init() * sl_add(): Add an item to the string list */ void -sl_add(sl, name) - StringList *sl; - char *name; +sl_add(StringList *sl, char *name) { if (sl->sl_cur == sl->sl_max - 1) { sl->sl_max += _SL_CHUNKSIZE; @@ -82,9 +81,7 @@ sl_add(sl, name) * sl_free(): Free a stringlist */ void -sl_free(sl, all) - StringList *sl; - int all; +sl_free(StringList *sl, int all) { size_t i; @@ -104,9 +101,7 @@ sl_free(sl, all) * sl_find(): Find a name in the string list */ char * -sl_find(sl, name) - StringList *sl; - char *name; +sl_find(StringList *sl, char *name) { size_t i; diff --git a/lib/libc/gen/strtofflags.c b/lib/libc/gen/strtofflags.c index fb911ca2e4..456de06171 100644 --- a/lib/libc/gen/strtofflags.c +++ b/lib/libc/gen/strtofflags.c @@ -32,7 +32,7 @@ * * @(#)stat_flags.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/lib/libc/gen/strtofflags.c,v 1.18.2.1 2000/06/28 01:52:24 joe Exp $ - * $DragonFly: src/lib/libc/gen/strtofflags.c,v 1.2 2003/06/17 04:26:42 dillon Exp $ + * $DragonFly: src/lib/libc/gen/strtofflags.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -76,8 +76,7 @@ static struct { * are set, return the empty string. */ char * -fflagstostr(flags) - u_long flags; +fflagstostr(u_long flags) { char *string; char *sp, *dp; @@ -109,9 +108,7 @@ fflagstostr(flags) * to the offending token. */ int -strtofflags(stringp, setp, clrp) - char **stringp; - u_long *setp, *clrp; +strtofflags(char **stringp, u_long *setp, u_long *clrp) { char *string, *p; int i; diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index b888c582b2..876be4adb8 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)sysconf.c 8.2 (Berkeley) 3/20/94 - * $DragonFly: src/lib/libc/gen/sysconf.c,v 1.3 2004/11/09 17:52:45 joerg Exp $ + * $DragonFly: src/lib/libc/gen/sysconf.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -60,8 +60,7 @@ * less useful than returning up-to-date values, however. */ long -sysconf(name) - int name; +sysconf(int name) { struct rlimit rl; size_t len; diff --git a/lib/libc/gen/sysctl.c b/lib/libc/gen/sysctl.c index 081530b875..43d3174427 100644 --- a/lib/libc/gen/sysctl.c +++ b/lib/libc/gen/sysctl.c @@ -31,6 +31,7 @@ * SUCH DAMAGE. * * @(#)sysctl.c 8.2 (Berkeley) 1/4/94 + * $DragonFly: src/lib/libc/gen/sysctl.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -44,11 +45,8 @@ #include int -sysctl(name, namelen, oldp, oldlenp, newp, newlen) - int *name; - u_int namelen; - void *oldp, *newp; - size_t *oldlenp, newlen; +sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, + size_t newlen) { if (name[0] != CTL_USER) return (__sysctl(name, namelen, oldp, oldlenp, newp, newlen)); diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index 15f6cf1cc3..150844969f 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -32,7 +32,7 @@ * * @(#)syslog.c 8.5 (Berkeley) 4/29/95 * $FreeBSD: src/lib/libc/gen/syslog.c,v 1.21.2.3 2002/11/18 11:49:55 ru Exp $ - * $DragonFly: src/lib/libc/gen/syslog.c,v 1.7 2005/03/09 18:52:21 joerg Exp $ + * $DragonFly: src/lib/libc/gen/syslog.c,v 1.8 2005/11/13 00:07:42 swildner Exp $ */ #include "namespace.h" @@ -79,11 +79,10 @@ struct bufcookie { * XXX: Maybe one day, dynamically allocate it so that the line length * is `unlimited'. */ -static -int writehook(cookie, buf, len) - void *cookie; /* really [struct bufcookie *] */ - char *buf; /* characters to copy */ - int len; /* length to copy */ +static int +writehook(void *cookie, /* really [struct bufcookie *] */ + char *buf, /* characters to copy */ + int len) /* length to copy */ { struct bufcookie *h; /* private `handle' */ @@ -93,7 +92,7 @@ int writehook(cookie, buf, len) len = h->left; } if (len > 0) { - (void)memcpy(h->base, buf, len); /* `write' it. */ + memcpy(h->base, buf, len); /* `write' it. */ h->base += len; h->left -= len; } @@ -115,10 +114,7 @@ syslog(int pri, const char *fmt, ...) } void -vsyslog(pri, fmt, ap) - int pri; - const char *fmt; - va_list ap; +vsyslog(int pri, const char *fmt, va_list ap) { int cnt; char ch, *p; @@ -155,22 +151,22 @@ vsyslog(pri, fmt, ap) return; /* Build the message. */ - (void)time(&now); - (void)fprintf(fp, "<%d>", pri); - (void)fprintf(fp, "%.15s ", ctime_r(&now, timbuf) + 4); + time(&now); + fprintf(fp, "<%d>", pri); + fprintf(fp, "%.15s ", ctime_r(&now, timbuf) + 4); if (LogStat & LOG_PERROR) { /* Transfer to string buffer */ - (void)fflush(fp); + fflush(fp); stdp = tbuf + (sizeof(tbuf) - tbuf_cookie.left); } if (LogTag == NULL) LogTag = getprogname(); if (LogTag != NULL) - (void)fprintf(fp, "%s", LogTag); + fprintf(fp, "%s", LogTag); if (LogStat & LOG_PID) - (void)fprintf(fp, "[%d]", getpid()); + fprintf(fp, "[%d]", getpid()); if (LogTag != NULL) { - (void)fprintf(fp, ": "); + fprintf(fp, ": "); } /* Check to see if we can skip expanding the %m */ @@ -203,8 +199,8 @@ vsyslog(pri, fmt, ap) fmt = fmt_cpy; } - (void)vfprintf(fp, fmt, ap); - (void)fclose(fp); + vfprintf(fp, fmt, ap); + fclose(fp); cnt = sizeof(tbuf) - tbuf_cookie.left; @@ -218,7 +214,7 @@ vsyslog(pri, fmt, ap) ++v; v->iov_base = "\n"; v->iov_len = 1; - (void)_writev(STDERR_FILENO, iov, 2); + _writev(STDERR_FILENO, iov, 2); } /* Get connected, output the message to the local logger. */ @@ -253,12 +249,12 @@ vsyslog(pri, fmt, ap) ++v; v->iov_base = "\r\n"; v->iov_len = 2; - (void)_writev(fd, iov, 2); - (void)_close(fd); + _writev(fd, iov, 2); + _close(fd); } } static void -disconnectlog() +disconnectlog(void) { /* * If the user closed the FD and opened another in the same slot, @@ -273,19 +269,19 @@ disconnectlog() } static void -connectlog() +connectlog(void) { struct sockaddr_un SyslogAddr; /* AF_UNIX address of local logger */ if (LogFile == -1) { if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) return; - (void)_fcntl(LogFile, F_SETFD, 1); + _fcntl(LogFile, F_SETFD, 1); } if (LogFile != -1 && !connected) { SyslogAddr.sun_len = sizeof(SyslogAddr); SyslogAddr.sun_family = AF_UNIX; - (void)strncpy(SyslogAddr.sun_path, _PATH_LOG, + strncpy(SyslogAddr.sun_path, _PATH_LOG, sizeof SyslogAddr.sun_path); connected = _connect(LogFile, (struct sockaddr *)&SyslogAddr, sizeof(SyslogAddr)) != -1; @@ -295,7 +291,7 @@ connectlog() * Try the old "/dev/log" path, for backward * compatibility. */ - (void)strncpy(SyslogAddr.sun_path, _PATH_OLDLOG, + strncpy(SyslogAddr.sun_path, _PATH_OLDLOG, sizeof SyslogAddr.sun_path); connected = _connect(LogFile, (struct sockaddr *)&SyslogAddr, @@ -303,16 +299,14 @@ connectlog() } if (!connected) { - (void)_close(LogFile); + _close(LogFile); LogFile = -1; } } } void -openlog(ident, logstat, logfac) - const char *ident; - int logstat, logfac; +openlog(const char *ident, int logstat, int logfac) { if (ident != NULL) LogTag = ident; @@ -327,9 +321,9 @@ openlog(ident, logstat, logfac) } void -closelog() +closelog(void) { - (void)_close(LogFile); + _close(LogFile); LogFile = -1; LogTag = NULL; connected = 0; @@ -337,8 +331,7 @@ closelog() /* setlogmask -- set the log mask level */ int -setlogmask(pmask) - int pmask; +setlogmask(int pmask) { int omask; diff --git a/lib/libc/gen/telldir.c b/lib/libc/gen/telldir.c index 6e1f3c909b..506a3308bf 100644 --- a/lib/libc/gen/telldir.c +++ b/lib/libc/gen/telldir.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/telldir.c,v 1.4.12.1 2001/03/05 09:39:59 obrien Exp $ - * $DragonFly: src/lib/libc/gen/telldir.c,v 1.3 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/telldir.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ * * @(#)telldir.c 8.1 (Berkeley) 6/4/93 */ @@ -77,8 +77,7 @@ static struct ddloc *dd_hash[NDIRHASH]; /* Hash list heads for ddlocs */ * return a pointer into a directory */ long -telldir(dirp) - const DIR *dirp; +telldir(const DIR *dirp) { int index; struct ddloc *lp; @@ -104,9 +103,7 @@ telldir(dirp) * Only values returned by "telldir" should be passed to seekdir. */ void -_seekdir(dirp, loc) - DIR *dirp; - long loc; +_seekdir(DIR *dirp, long loc) { struct ddloc *lp; struct ddloc **prevlp; @@ -124,7 +121,7 @@ _seekdir(dirp, loc) return; if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) goto found; - (void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); + lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); dirp->dd_seek = lp->loc_seek; dirp->dd_loc = 0; while (dirp->dd_loc < lp->loc_loc) { @@ -143,8 +140,7 @@ found: * Reclaim memory for telldir cookies which weren't used. */ void -_reclaim_telldir(dirp) - DIR *dirp; +_reclaim_telldir(DIR *dirp) { struct ddloc *lp; struct ddloc **prevlp; diff --git a/lib/libc/gen/termios.c b/lib/libc/gen/termios.c index ba26742561..5fe9b6590f 100644 --- a/lib/libc/gen/termios.c +++ b/lib/libc/gen/termios.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/termios.c,v 1.9.2.1 2000/03/18 23:13:25 jasone Exp $ - * $DragonFly: src/lib/libc/gen/termios.c,v 1.3 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/termios.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ * * @(#)termios.c 8.2 (Berkeley) 2/21/94 */ @@ -48,18 +48,14 @@ #include "un-namespace.h" int -tcgetattr(fd, t) - int fd; - struct termios *t; +tcgetattr(int fd, struct termios *t) { return (_ioctl(fd, TIOCGETA, t)); } int -tcsetattr(fd, opt, t) - int fd, opt; - const struct termios *t; +tcsetattr(int fd, int opt, const struct termios *t) { struct termios localterm; @@ -82,13 +78,7 @@ tcsetattr(fd, opt, t) } int -#if __STDC__ tcsetpgrp(int fd, pid_t pgrp) -#else -tcsetpgrp(fd, pgrp) - int fd; - pid_t pgrp; -#endif { int s; @@ -97,8 +87,7 @@ tcsetpgrp(fd, pgrp) } pid_t -tcgetpgrp(fd) - int fd; +tcgetpgrp(int fd) { int s; @@ -109,25 +98,21 @@ tcgetpgrp(fd) } speed_t -cfgetospeed(t) - const struct termios *t; +cfgetospeed(const struct termios *t) { return (t->c_ospeed); } speed_t -cfgetispeed(t) - const struct termios *t; +cfgetispeed(const struct termios *t) { return (t->c_ispeed); } int -cfsetospeed(t, speed) - struct termios *t; - speed_t speed; +cfsetospeed(struct termios *t, speed_t speed) { t->c_ospeed = speed; @@ -135,9 +120,7 @@ cfsetospeed(t, speed) } int -cfsetispeed(t, speed) - struct termios *t; - speed_t speed; +cfsetispeed(struct termios *t, speed_t speed) { t->c_ispeed = speed; @@ -145,9 +128,7 @@ cfsetispeed(t, speed) } int -cfsetspeed(t, speed) - struct termios *t; - speed_t speed; +cfsetspeed(struct termios *t, speed_t speed) { t->c_ispeed = t->c_ospeed = speed; @@ -159,8 +140,7 @@ cfsetspeed(t, speed) * mode with no characters interpreted, 8-bit data path. */ void -cfmakeraw(t) - struct termios *t; +cfmakeraw(struct termios *t) { t->c_iflag &= ~(IMAXBEL|IXOFF|INPCK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IGNPAR); @@ -174,8 +154,7 @@ cfmakeraw(t) } int -tcsendbreak(fd, len) - int fd, len; +tcsendbreak(int fd, int len) { struct timeval sleepytime; @@ -183,15 +162,14 @@ tcsendbreak(fd, len) sleepytime.tv_usec = 400000; if (_ioctl(fd, TIOCSBRK, 0) == -1) return (-1); - (void)_select(0, 0, 0, 0, &sleepytime); + _select(0, 0, 0, 0, &sleepytime); if (_ioctl(fd, TIOCCBRK, 0) == -1) return (-1); return (0); } int -__tcdrain(fd) - int fd; +__tcdrain(int fd) { return (_ioctl(fd, TIOCDRAIN, 0)); } @@ -201,8 +179,7 @@ __weak_reference(__tcdrain, tcdrain); #endif int -tcflush(fd, which) - int fd, which; +tcflush(int fd, int which) { int com; @@ -224,8 +201,7 @@ tcflush(fd, which) } int -tcflow(fd, action) - int fd, action; +tcflow(int fd, int action) { struct termios term; u_char c; diff --git a/lib/libc/gen/time.c b/lib/libc/gen/time.c index 7242aa9ab4..b73d978420 100644 --- a/lib/libc/gen/time.c +++ b/lib/libc/gen/time.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * * @(#)time.c 8.1 (Berkeley) 6/4/93 + * $DragonFly: src/lib/libc/gen/time.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include #include time_t -time(t) - time_t *t; +time(time_t *t) { struct timeval tt; diff --git a/lib/libc/gen/times.c b/lib/libc/gen/times.c index d91bd2b82c..7c7518a6b8 100644 --- a/lib/libc/gen/times.c +++ b/lib/libc/gen/times.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)times.c 8.1 (Berkeley) 6/4/93 - * $DragonFly: src/lib/libc/gen/times.c,v 1.3 2004/06/06 15:05:55 hmp Exp $ + * $DragonFly: src/lib/libc/gen/times.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -46,8 +46,7 @@ #define CONVTCK(r) (r.tv_sec * CLK_TCK + r.tv_usec / (1000000 / CLK_TCK)) clock_t -times(tp) - struct tms *tp; +times(struct tms *tp) { struct rusage ru; struct timeval t; diff --git a/lib/libc/gen/timezone.c b/lib/libc/gen/timezone.c index 5a0020800b..56ed6fb805 100644 --- a/lib/libc/gen/timezone.c +++ b/lib/libc/gen/timezone.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)timezone.c 8.1 (Berkeley) 6/4/93 - * $DragonFly: src/lib/libc/gen/timezone.c,v 1.3 2004/06/06 15:05:55 hmp Exp $ + * $DragonFly: src/lib/libc/gen/timezone.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -54,9 +54,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; @@ -66,7 +64,7 @@ timezone(zone, dst) if (dst) return(++end); *end = '\0'; - (void)strncpy(czone,beg,sizeof(czone) - 1); + strncpy(czone,beg,sizeof(czone) - 1); czone[sizeof(czone) - 1] = '\0'; *end = ','; return(czone); @@ -107,9 +105,7 @@ static struct zone { * STANDARD LIBRARY. */ char * -_tztab(zone,dst) - int zone; - int dst; +_tztab(int zone, int dst) { struct zone *zp; char sign; @@ -128,7 +124,7 @@ _tztab(zone,dst) } else sign = '-'; - (void)snprintf(czone, sizeof(czone), + snprintf(czone, sizeof(czone), "GMT%c%d:%02d",sign,zone / 60,zone % 60); return(czone); } diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c index 6092103ff0..eda489962c 100644 --- a/lib/libc/gen/ttyname.c +++ b/lib/libc/gen/ttyname.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/ttyname.c,v 1.10.6.2 2002/10/15 19:46:46 fjoe Exp $ - * $DragonFly: src/lib/libc/gen/ttyname.c,v 1.12 2005/08/27 20:23:05 joerg Exp $ + * $DragonFly: src/lib/libc/gen/ttyname.c,v 1.13 2005/11/13 00:07:42 swildner Exp $ * * @(#)ttyname.c 8.2 (Berkeley) 1/27/94 */ @@ -55,7 +55,7 @@ #include "libc_private.h" static char static_buf[TTY_PATH_MAX] = _PATH_DEV; -static char *oldttyname __P((int, struct stat *)); +static char *oldttyname(int, struct stat *); static char *ttyname_threaded(int fd); static char *ttyname_unthreaded(int fd); @@ -63,7 +63,7 @@ static pthread_mutex_t ttyname_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_key_t ttyname_key; static int ttyname_init = 0; -char * +char * ttyname(int fd) { char *ret; @@ -75,7 +75,7 @@ ttyname(int fd) return (ret); } -char * +char * ttyname_r(int fd, char *buf, size_t len) { struct dirent *dirp; @@ -111,12 +111,12 @@ ttyname_r(int fd, char *buf, size_t len) rval = buf; break; } - (void) closedir(dp); + closedir(dp); } return (rval); } -char * +char * ttyname_threaded(int fd) { char *buf; @@ -176,18 +176,16 @@ ttyname_unthreaded(int fd) (sizeof(_PATH_DEV) + data.size - 1 < sizeof(static_buf))) { bcopy(data.data, static_buf + sizeof(_PATH_DEV) - 1, data.size); - (void)(db->close)(db); + (db->close)(db); return (static_buf); } - (void)(db->close)(db); + (db->close)(db); } return (oldttyname(fd, &sb)); } static char * -oldttyname(fd, sb) - int fd __unused; - struct stat *sb; +oldttyname(int fd __unused, struct stat *sb) { struct dirent *dirp; DIR *dp; @@ -206,9 +204,9 @@ oldttyname(fd, sb) if (stat(static_buf, &dsb) || sb->st_dev != dsb.st_dev || sb->st_ino != dsb.st_ino) continue; - (void)closedir(dp); + closedir(dp); return (static_buf); } - (void)closedir(dp); + closedir(dp); return (NULL); } diff --git a/lib/libc/gen/ttyslot.c b/lib/libc/gen/ttyslot.c index 23baea5502..439dbb00e8 100644 --- a/lib/libc/gen/ttyslot.c +++ b/lib/libc/gen/ttyslot.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ttyslot.c 8.1 (Berkeley) 6/4/93 - * $DragonFly: src/lib/libc/gen/ttyslot.c,v 1.3 2004/06/06 15:05:55 hmp Exp $ + * $DragonFly: src/lib/libc/gen/ttyslot.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -40,7 +40,7 @@ #include int -ttyslot() +ttyslot(void) { struct ttyent *ttyp; int slot; diff --git a/lib/libc/gen/ualarm.c b/lib/libc/gen/ualarm.c index eb769a7536..77e4615976 100644 --- a/lib/libc/gen/ualarm.c +++ b/lib/libc/gen/ualarm.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ualarm.c 8.1 (Berkeley) 6/4/93 - * $DragonFly: src/lib/libc/gen/ualarm.c,v 1.3 2004/06/06 15:05:55 hmp Exp $ + * $DragonFly: src/lib/libc/gen/ualarm.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -45,9 +45,7 @@ * every ``reload'' microseconds after the first signal. */ unsigned -ualarm(usecs, reload) - unsigned usecs; - unsigned reload; +ualarm(unsigned usecs, unsigned reload) { struct itimerval new, old; diff --git a/lib/libc/gen/uname.c b/lib/libc/gen/uname.c index a2f78a3b8a..c38c989d40 100644 --- a/lib/libc/gen/uname.c +++ b/lib/libc/gen/uname.c @@ -32,7 +32,7 @@ * * @(#)uname.c 8.1 (Berkeley) 1/4/94 * $FreeBSD: src/lib/libc/gen/uname.c,v 1.7 1999/08/27 23:59:06 peter Exp $ - * $DragonFly: src/lib/libc/gen/uname.c,v 1.2 2003/06/17 04:26:42 dillon Exp $ + * $DragonFly: src/lib/libc/gen/uname.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -41,8 +41,7 @@ #include int -uname(name) - struct utsname *name; +uname(struct utsname *name) { int mib[2], rval; size_t len; diff --git a/lib/libc/gen/unvis.c b/lib/libc/gen/unvis.c index 7453abaa86..05122d9864 100644 --- a/lib/libc/gen/unvis.c +++ b/lib/libc/gen/unvis.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/unvis.c,v 1.4.8.1 2000/08/17 08:25:54 jhb Exp $ - * $DragonFly: src/lib/libc/gen/unvis.c,v 1.3 2004/06/06 15:05:55 hmp Exp $ + * $DragonFly: src/lib/libc/gen/unvis.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ * * @(#)unvis.c 8.1 (Berkeley) 6/4/93 */ @@ -60,9 +60,7 @@ * unvis - decode characters previously encoded by vis */ int -unvis(cp, c, astate, flag) - char *cp; - int c, *astate, flag; +unvis(char *cp, int c, int *astate, int flag) { if (flag & UNVIS_END) { @@ -239,9 +237,7 @@ unvis(cp, c, astate, flag) */ int -strunvis(dst, src) - char *dst; - const char *src; +strunvis(char *dst, const char *src) { char c; char *start = dst; @@ -270,9 +266,7 @@ strunvis(dst, src) } int -strunvisx(dst, src, flag) - char *dst; - const char *src; +strunvisx(char *dst, const char *src, int flag) { char c; char *start = dst; diff --git a/lib/libc/gen/utime.c b/lib/libc/gen/utime.c index 76f77c0b53..d42da3dc72 100644 --- a/lib/libc/gen/utime.c +++ b/lib/libc/gen/utime.c @@ -31,6 +31,7 @@ * SUCH DAMAGE. * * @(#)utime.c 8.1 (Berkeley) 6/4/93 + * $DragonFly: src/lib/libc/gen/utime.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -38,9 +39,7 @@ #include int -utime(path, times) - const char *path; - const struct utimbuf *times; +utime(const char *path, const struct utimbuf *times) { struct timeval tv[2], *tvp; diff --git a/lib/libc/gen/valloc.c b/lib/libc/gen/valloc.c index 5f00719c7b..3a780e13b5 100644 --- a/lib/libc/gen/valloc.c +++ b/lib/libc/gen/valloc.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * * @(#)valloc.c 8.1 (Berkeley) 6/4/93 + * $DragonFly: src/lib/libc/gen/valloc.c,v 1.3 2005/11/13 00:07:42 swildner Exp $ */ #include #include void * -valloc(i) - size_t i; +valloc(size_t i) { long valsiz = getpagesize(), j; void *cp = malloc(i + (valsiz-1)); diff --git a/lib/libc/gen/vis.c b/lib/libc/gen/vis.c index b02b184fa6..fea3138a74 100644 --- a/lib/libc/gen/vis.c +++ b/lib/libc/gen/vis.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/vis.c,v 1.13 2003/10/30 12:41:50 phk Exp $ - * $DragonFly: src/lib/libc/gen/vis.c,v 1.5 2005/09/03 16:25:42 joerg Exp $ + * $DragonFly: src/lib/libc/gen/vis.c,v 1.6 2005/11/13 00:07:42 swildner Exp $ */ #include @@ -47,10 +47,7 @@ * vis - visually encode characters */ char * -vis(dst, c, flag, nextc) - char *dst; - int c, nextc; - int flag; +vis(char *dst, int c, int flag, int nextc) { c = (unsigned char)c; @@ -167,10 +164,7 @@ done: * This is useful for encoding a block of data. */ int -strvis(dst, src, flag) - char *dst; - const char *src; - int flag; +strvis(char *dst, const char *src, int flag) { char c; char *start; @@ -211,11 +205,7 @@ strnvis(char *dst, const char *src, size_t len, int flag) } int -strvisx(dst, src, len, flag) - char *dst; - const char *src; - size_t len; - int flag; +strvisx(char *dst, const char *src, size_t len, int flag) { int c; char *start; diff --git a/lib/libc/gen/wait.c b/lib/libc/gen/wait.c index 1c312afd0c..c5eca6e580 100644 --- a/lib/libc/gen/wait.c +++ b/lib/libc/gen/wait.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/wait.c,v 1.3.2.1 2000/03/18 23:13:25 jasone Exp $ - * $DragonFly: src/lib/libc/gen/wait.c,v 1.3 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/wait.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ * * @(#)wait.c 8.1 (Berkeley) 6/4/93 */ @@ -44,8 +44,7 @@ #include "un-namespace.h" pid_t -__wait(istat) - int *istat; +__wait(int *istat) { return (_wait4(WAIT_ANY, istat, 0, (struct rusage *)0)); } diff --git a/lib/libc/gen/wait3.c b/lib/libc/gen/wait3.c index f13edc5a32..1993d82eb5 100644 --- a/lib/libc/gen/wait3.c +++ b/lib/libc/gen/wait3.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/wait3.c,v 1.1.1.1.14.1 2001/03/05 09:52:13 obrien Exp $ - * $DragonFly: src/lib/libc/gen/wait3.c,v 1.3 2005/01/31 22:29:15 dillon Exp $ + * $DragonFly: src/lib/libc/gen/wait3.c,v 1.4 2005/11/13 00:07:42 swildner Exp $ * * @(#)wait3.c 8.1 (Berkeley) 6/4/93 */ @@ -44,10 +44,7 @@ #include "un-namespace.h" pid_t -wait3(istat, options, rup) - int *istat; - int options; - struct rusage *rup; +wait3(int *istat, int options, struct rusage *rup) { return (_wait4(WAIT_ANY, istat, options, rup)); } -- 2.41.0