Module Name: src
Committed By: matt
Date: Tue Mar 20 18:42:29 UTC 2012
Modified Files:
src/bin/pax: ar_io.c ftree.c options.c tar.c
src/bin/ps: print.c
src/bin/sh: arith.y arith_lex.l exec.c histedit.c nodes.c.pat options.c
redir.c
Log Message:
Use C89 function definitions
To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/bin/pax/ar_io.c
cvs rdiff -u -r1.40 -r1.41 src/bin/pax/ftree.c
cvs rdiff -u -r1.112 -r1.113 src/bin/pax/options.c
cvs rdiff -u -r1.68 -r1.69 src/bin/pax/tar.c
cvs rdiff -u -r1.119 -r1.120 src/bin/ps/print.c
cvs rdiff -u -r1.21 -r1.22 src/bin/sh/arith.y
cvs rdiff -u -r1.15 -r1.16 src/bin/sh/arith_lex.l
cvs rdiff -u -r1.42 -r1.43 src/bin/sh/exec.c src/bin/sh/options.c
cvs rdiff -u -r1.44 -r1.45 src/bin/sh/histedit.c
cvs rdiff -u -r1.12 -r1.13 src/bin/sh/nodes.c.pat
cvs rdiff -u -r1.32 -r1.33 src/bin/sh/redir.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/pax/ar_io.c
diff -u src/bin/pax/ar_io.c:1.53 src/bin/pax/ar_io.c:1.54
--- src/bin/pax/ar_io.c:1.53 Wed Aug 31 16:24:54 2011
+++ src/bin/pax/ar_io.c Tue Mar 20 18:42:28 2012
@@ -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, i
}
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;
Index: src/bin/pax/ftree.c
diff -u src/bin/pax/ftree.c:1.40 src/bin/pax/ftree.c:1.41
--- src/bin/pax/ftree.c:1.40 Sat Feb 14 08:10:06 2009
+++ src/bin/pax/ftree.c Tue Mar 20 18:42:28 2012
@@ -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
Index: src/bin/pax/options.c
diff -u src/bin/pax/options.c:1.112 src/bin/pax/options.c:1.113
--- src/bin/pax/options.c:1.112 Wed Aug 31 16:24:54 2011
+++ src/bin/pax/options.c Tue Mar 20 18:42:28 2012
@@ -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;
Index: src/bin/pax/tar.c
diff -u src/bin/pax/tar.c:1.68 src/bin/pax/tar.c:1.69
--- src/bin/pax/tar.c:1.68 Thu Nov 3 21:59:45 2011
+++ src/bin/pax/tar.c Tue Mar 20 18:42:28 2012
@@ -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,
* 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;
Index: src/bin/ps/print.c
diff -u src/bin/ps/print.c:1.119 src/bin/ps/print.c:1.120
--- src/bin/ps/print.c:1.119 Mon Feb 13 12:55:28 2012
+++ src/bin/ps/print.c Tue Mar 20 18:42:28 2012
@@ -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;
Index: src/bin/sh/arith.y
diff -u src/bin/sh/arith.y:1.21 src/bin/sh/arith.y:1.22
--- src/bin/sh/arith.y:1.21 Mon Aug 29 14:50:27 2011
+++ src/bin/sh/arith.y Tue Mar 20 18:42:29 2012
@@ -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 { $
;
%%
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;
Index: src/bin/sh/arith_lex.l
diff -u src/bin/sh/arith_lex.l:1.15 src/bin/sh/arith_lex.l:1.16
--- src/bin/sh/arith_lex.l:1.15 Thu Oct 29 14:21:40 2009
+++ src/bin/sh/arith_lex.l Tue Mar 20 18:42:29 2012
@@ -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_sta
%%
void
-arith_lex_reset() {
+arith_lex_reset(void) {
#ifdef YY_NEW_FILE
YY_NEW_FILE;
#endif
Index: src/bin/sh/exec.c
diff -u src/bin/sh/exec.c:1.42 src/bin/sh/exec.c:1.43
--- src/bin/sh/exec.c:1.42 Thu Oct 16 15:31:05 2008
+++ src/bin/sh/exec.c Tue Mar 20 18:42:29 2012
@@ -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;
Index: src/bin/sh/options.c
diff -u src/bin/sh/options.c:1.42 src/bin/sh/options.c:1.43
--- src/bin/sh/options.c:1.42 Sat Jun 18 21:18:46 2011
+++ src/bin/sh/options.c Tue Mar 20 18:42:29 2012
@@ -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;
Index: src/bin/sh/histedit.c
diff -u src/bin/sh/histedit.c:1.44 src/bin/sh/histedit.c:1.45
--- src/bin/sh/histedit.c:1.44 Tue Jul 12 16:40:41 2011
+++ src/bin/sh/histedit.c Tue Mar 20 18:42:29 2012
@@ -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");
Index: src/bin/sh/nodes.c.pat
diff -u src/bin/sh/nodes.c.pat:1.12 src/bin/sh/nodes.c.pat:1.13
--- src/bin/sh/nodes.c.pat:1.12 Tue Jun 15 22:57:27 2004
+++ src/bin/sh/nodes.c.pat Tue Mar 20 18:42:29 2012
@@ -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);
Index: src/bin/sh/redir.c
diff -u src/bin/sh/redir.c:1.32 src/bin/sh/redir.c:1.33
--- src/bin/sh/redir.c:1.32 Wed Aug 31 16:24:55 2011
+++ src/bin/sh/redir.c Tue Mar 20 18:42:29 2012
@@ -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;