Use C89 function definitions

This commit is contained in:
matt 2012-03-20 18:42:28 +00:00
parent 299c989a28
commit da4f7877a7
12 changed files with 47 additions and 79 deletions

View File

@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94";
#else
__RCSID("$NetBSD: ar_io.c,v 1.53 2011/08/31 16:24:54 plunky Exp $");
__RCSID("$NetBSD: ar_io.c,v 1.54 2012/03/20 18:42:28 matt Exp $");
#endif
#endif /* not lint */
@ -1613,12 +1613,7 @@ ar_start_gzip(int fd, const char *gzp, int wr)
}
static const char *
timefmt(buf, size, sz, tm, unitstr)
char *buf;
size_t size;
off_t sz;
time_t tm;
const char *unitstr;
timefmt(char *buf, size_t size, off_t sz, time_t tm, const char *unitstr)
{
(void)snprintf(buf, size, "%lu secs (" OFFT_F " %s/sec)",
(unsigned long)tm, (OFFT_T)(sz / tm), unitstr);
@ -1626,10 +1621,7 @@ timefmt(buf, size, sz, tm, unitstr)
}
static const char *
sizefmt(buf, size, sz)
char *buf;
size_t size;
off_t sz;
sizefmt(char *buf, size_t size, off_t sz)
{
(void)snprintf(buf, size, OFFT_F " bytes", (OFFT_T)sz);
return buf;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ftree.c,v 1.40 2009/02/14 08:10:06 lukem Exp $ */
/* $NetBSD: ftree.c,v 1.41 2012/03/20 18:42:28 matt Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@ -71,7 +71,7 @@
#if 0
static char sccsid[] = "@(#)ftree.c 8.2 (Berkeley) 4/18/94";
#else
__RCSID("$NetBSD: ftree.c,v 1.40 2009/02/14 08:10:06 lukem Exp $");
__RCSID("$NetBSD: ftree.c,v 1.41 2012/03/20 18:42:28 matt Exp $");
#endif
#endif /* not lint */
@ -135,7 +135,7 @@ static int ftree_arg(void);
*/
int
ftree_start()
ftree_start(void)
{
#ifndef SMALL

View File

@ -1,4 +1,4 @@
/* $NetBSD: options.c,v 1.112 2011/08/31 16:24:54 plunky Exp $ */
/* $NetBSD: options.c,v 1.113 2012/03/20 18:42:28 matt Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#else
__RCSID("$NetBSD: options.c,v 1.112 2011/08/31 16:24:54 plunky Exp $");
__RCSID("$NetBSD: options.c,v 1.113 2012/03/20 18:42:28 matt Exp $");
#endif
#endif /* not lint */
@ -1379,8 +1379,7 @@ tar_options(int argc, char **argv)
}
int
mkpath(path)
char *path;
mkpath(char *path)
{
char *slash;
int done = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tar.c,v 1.68 2011/11/03 21:59:45 christos Exp $ */
/* $NetBSD: tar.c,v 1.69 2012/03/20 18:42:28 matt Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94";
#else
__RCSID("$NetBSD: tar.c,v 1.68 2011/11/03 21:59:45 christos Exp $");
__RCSID("$NetBSD: tar.c,v 1.69 2012/03/20 18:42:28 matt Exp $");
#endif
#endif /* not lint */
@ -1366,8 +1366,7 @@ tar_gnutar_exclude_one(const char *line, size_t len)
* named files.
*/
int
tar_gnutar_minus_minus_exclude(path)
const char *path;
tar_gnutar_minus_minus_exclude(const char *path)
{
size_t len = strlen(path);
@ -1378,8 +1377,7 @@ tar_gnutar_minus_minus_exclude(path)
}
int
tar_gnutar_X_compat(path)
const char *path;
tar_gnutar_X_compat(const char *path)
{
char *line;
FILE *fp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: print.c,v 1.119 2012/02/13 12:55:28 wiz Exp $ */
/* $NetBSD: print.c,v 1.120 2012/03/20 18:42:28 matt Exp $ */
/*
* Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@ -63,7 +63,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
__RCSID("$NetBSD: print.c,v 1.119 2012/02/13 12:55:28 wiz Exp $");
__RCSID("$NetBSD: print.c,v 1.120 2012/03/20 18:42:28 matt Exp $");
#endif
#endif /* not lint */
@ -1067,8 +1067,7 @@ cputime(void *arg, VARENT *ve, int mode)
}
double
getpcpu(k)
const struct kinfo_proc2 *k;
getpcpu(const struct kinfo_proc2 *k)
{
static int failure;
@ -1101,8 +1100,7 @@ pcpu(void *arg, VARENT *ve, int mode)
}
double
getpmem(k)
const struct kinfo_proc2 *k;
getpmem(const struct kinfo_proc2 *k)
{
static int failure;
double fracmem;
@ -1169,10 +1167,7 @@ tsize(void *arg, VARENT *ve, int mode)
* structures.
*/
static void
printval(bp, v, mode)
void *bp;
VAR *v;
int mode;
printval(void *bp, VAR *v, int mode)
{
static char ofmt[32] = "%";
int width, vok, fmtlen;

View File

@ -1,5 +1,5 @@
%{
/* $NetBSD: arith.y,v 1.21 2011/08/29 14:50:27 joerg Exp $ */
/* $NetBSD: arith.y,v 1.22 2012/03/20 18:42:29 matt Exp $ */
/*-
* Copyright (c) 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)arith.y 8.3 (Berkeley) 5/4/95";
#else
__RCSID("$NetBSD: arith.y,v 1.21 2011/08/29 14:50:27 joerg Exp $");
__RCSID("$NetBSD: arith.y,v 1.22 2012/03/20 18:42:29 matt Exp $");
#endif
#endif /* not lint */
@ -123,8 +123,7 @@ expr: ARITH_LPAREN expr ARITH_RPAREN { $$ = $2; }
;
%%
intmax_t
arith(s)
const char *s;
arith(const char *s)
{
intmax_t result;
@ -144,9 +143,7 @@ arith(s)
* The exp(1) builtin.
*/
int
expcmd(argc, argv)
int argc;
char **argv;
expcmd(int argc, char **argv)
{
const char *p;
char *concat;

View File

@ -1,5 +1,5 @@
%{
/* $NetBSD: arith_lex.l,v 1.15 2009/10/29 14:21:40 christos Exp $ */
/* $NetBSD: arith_lex.l,v 1.16 2012/03/20 18:42:29 matt Exp $ */
/*-
* Copyright (c) 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)arith_lex.l 8.3 (Berkeley) 5/4/95";
#else
__RCSID("$NetBSD: arith_lex.l,v 1.15 2009/10/29 14:21:40 christos Exp $");
__RCSID("$NetBSD: arith_lex.l,v 1.16 2012/03/20 18:42:29 matt Exp $");
#endif
#endif /* not lint */
@ -96,7 +96,7 @@ extern const char *arith_buf, *arith_startbuf;
%%
void
arith_lex_reset() {
arith_lex_reset(void) {
#ifdef YY_NEW_FILE
YY_NEW_FILE;
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec.c,v 1.42 2008/10/16 15:31:05 dholland Exp $ */
/* $NetBSD: exec.c,v 1.43 2012/03/20 18:42:29 matt Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95";
#else
__RCSID("$NetBSD: exec.c,v 1.42 2008/10/16 15:31:05 dholland Exp $");
__RCSID("$NetBSD: exec.c,v 1.43 2012/03/20 18:42:29 matt Exp $");
#endif
#endif /* not lint */
@ -624,8 +624,7 @@ success:
*/
int
(*find_builtin(name))(int, char **)
char *name;
(*find_builtin(char *name))(int, char **)
{
const struct builtincmd *bp;
@ -637,8 +636,7 @@ int
}
int
(*find_splbltin(name))(int, char **)
char *name;
(*find_splbltin(char *name))(int, char **)
{
const struct builtincmd *bp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: histedit.c,v 1.44 2011/07/12 16:40:41 joerg Exp $ */
/* $NetBSD: histedit.c,v 1.45 2012/03/20 18:42:29 matt Exp $ */
/*-
* Copyright (c) 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
#else
__RCSID("$NetBSD: histedit.c,v 1.44 2011/07/12 16:40:41 joerg Exp $");
__RCSID("$NetBSD: histedit.c,v 1.45 2012/03/20 18:42:29 matt Exp $");
#endif
#endif /* not lint */
@ -199,9 +199,7 @@ setterm(const char *term)
}
int
inputrc(argc, argv)
int argc;
char **argv;
inputrc(int argc, char **argv)
{
if (argc != 2) {
out2str("usage: inputrc file\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: nodes.c.pat,v 1.12 2004/06/15 22:57:27 dsl Exp $ */
/* $NetBSD: nodes.c.pat,v 1.13 2012/03/20 18:42:29 matt Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -67,8 +67,7 @@ STATIC char *nodesavestr(char *);
*/
union node *
copyfunc(n)
union node *n;
copyfunc(union node *n)
{
if (n == NULL)
return NULL;
@ -83,8 +82,7 @@ copyfunc(n)
STATIC void
calcsize(n)
union node *n;
calcsize(union node *n)
{
%CALCSIZE
}
@ -92,8 +90,7 @@ calcsize(n)
STATIC void
sizenodelist(lp)
struct nodelist *lp;
sizenodelist(struct nodelist *lp)
{
while (lp) {
funcblocksize += SHELL_ALIGN(sizeof(struct nodelist));
@ -105,8 +102,7 @@ sizenodelist(lp)
STATIC union node *
copynode(n)
union node *n;
copynode(union node *n)
{
union node *new;
@ -116,8 +112,7 @@ copynode(n)
STATIC struct nodelist *
copynodelist(lp)
struct nodelist *lp;
copynodelist(struct nodelist *lp)
{
struct nodelist *start;
struct nodelist **lpp;
@ -138,8 +133,7 @@ copynodelist(lp)
STATIC char *
nodesavestr(s)
char *s;
nodesavestr(char *s)
{
register char *p = s;
register char *q = funcstring;
@ -158,8 +152,7 @@ nodesavestr(s)
*/
void
freefunc(n)
union node *n;
freefunc(union node *n)
{
if (n)
ckfree(n);

View File

@ -1,4 +1,4 @@
/* $NetBSD: options.c,v 1.42 2011/06/18 21:18:46 christos Exp $ */
/* $NetBSD: options.c,v 1.43 2012/03/20 18:42:29 matt Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 5/4/95";
#else
__RCSID("$NetBSD: options.c,v 1.42 2011/06/18 21:18:46 christos Exp $");
__RCSID("$NetBSD: options.c,v 1.43 2012/03/20 18:42:29 matt Exp $");
#endif
#endif /* not lint */
@ -372,8 +372,7 @@ setcmd(int argc, char **argv)
void
getoptsreset(value)
const char *value;
getoptsreset(const char *value)
{
if (number(value) == 1) {
shellparam.optnext = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: redir.c,v 1.32 2011/08/31 16:24:55 plunky Exp $ */
/* $NetBSD: redir.c,v 1.33 2012/03/20 18:42:29 matt Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)redir.c 8.2 (Berkeley) 5/4/95";
#else
__RCSID("$NetBSD: redir.c,v 1.32 2011/08/31 16:24:55 plunky Exp $");
__RCSID("$NetBSD: redir.c,v 1.33 2012/03/20 18:42:29 matt Exp $");
#endif
#endif /* not lint */
@ -340,7 +340,7 @@ SHELLPROC {
/* Return true if fd 0 has already been redirected at least once. */
int
fd0_redirected_p () {
fd0_redirected_p (void) {
return fd0_redirected != 0;
}
@ -349,8 +349,7 @@ fd0_redirected_p () {
*/
void
clearredir(vforked)
int vforked;
clearredir(int vforked)
{
struct redirtab *rp;
int i;