Kill __P(), use ANSI function declarations, constify; WARNS=3.

This commit is contained in:
xtraeme 2005-02-17 17:35:47 +00:00
parent ee89c9ff79
commit 6dca62f25b
4 changed files with 25 additions and 34 deletions

View File

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.3 1995/03/26 20:51:24 glass Exp $
# $NetBSD: Makefile,v 1.4 2005/02/17 17:35:47 xtraeme Exp $
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= cut
WARNS= 3
.include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: cut.c,v 1.16 2003/08/07 11:13:32 agc Exp $ */
/* $NetBSD: cut.c,v 1.17 2005/02/17 17:35:47 xtraeme Exp $ */
/*
* Copyright (c) 1989, 1993
@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)cut.c 8.3 (Berkeley) 5/4/95";
#endif
__RCSID("$NetBSD: cut.c,v 1.16 2003/08/07 11:13:32 agc Exp $");
__RCSID("$NetBSD: cut.c,v 1.17 2005/02/17 17:35:47 xtraeme Exp $");
#endif /* not lint */
#include <ctype.h>
@ -61,19 +61,16 @@ int dflag;
int fflag;
int sflag;
void c_cut __P((FILE *, char *));
void f_cut __P((FILE *, char *));
void get_list __P((char *));
int main __P((int, char **));
void usage __P((void));
void c_cut(FILE *, const char *);
void f_cut(FILE *, const char *);
void get_list(char *);
void usage(void);
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
FILE *fp;
void (*fcn) __P((FILE *, char *));
void (*fcn)(FILE *, const char *);
int ch;
fcn = NULL;
@ -135,8 +132,7 @@ int autostart, autostop, maxval;
char positions[_POSIX2_LINE_MAX + 1];
void
get_list(list)
char *list;
get_list(char *list)
{
int setautostart, start, stop;
char *pos;
@ -193,9 +189,7 @@ get_list(list)
/* ARGSUSED */
void
c_cut(fp, fname)
FILE *fp;
char *fname;
c_cut(FILE *fp, const char *fname)
{
int ch, col;
char *pos;
@ -223,9 +217,7 @@ c_cut(fp, fname)
}
void
f_cut(fp, fname)
FILE *fp;
char *fname;
f_cut(FILE *fp, const char *fname)
{
int ch, field, isdelim;
char *pos, *p, sep;
@ -277,7 +269,7 @@ f_cut(fp, fname)
}
void
usage()
usage(void)
{
(void)fprintf(stderr, "usage:\tcut -b list [-n] [file ...]\n"
"\tcut -c list [file1 ...]\n"

View File

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.7 1995/09/28 06:24:35 perry Exp $
# $NetBSD: Makefile,v 1.8 2005/02/17 17:40:59 xtraeme Exp $
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= du
WARNS= 3
.include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: du.c,v 1.25 2004/06/13 11:30:10 dbj Exp $ */
/* $NetBSD: du.c,v 1.26 2005/02/17 17:40:59 xtraeme Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)du.c 8.5 (Berkeley) 5/4/95";
#else
__RCSID("$NetBSD: du.c,v 1.25 2004/06/13 11:30:10 dbj Exp $");
__RCSID("$NetBSD: du.c,v 1.26 2005/02/17 17:40:59 xtraeme Exp $");
#endif
#endif /* not lint */
@ -60,25 +60,22 @@ __RCSID("$NetBSD: du.c,v 1.25 2004/06/13 11:30:10 dbj Exp $");
#include <unistd.h>
#include <limits.h>
int linkchk __P((dev_t, ino_t));
int main __P((int, char **));
void prstat __P((const char *, int64_t));
void usage __P((void));
int linkchk(dev_t, ino_t);
void prstat(const char *, int64_t);
void usage(void);
int hflag;
long blocksize;
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
FTS *fts;
FTSENT *p;
int64_t totalblocks;
int ftsoptions, listdirs, listfiles;
int Hflag, Lflag, Pflag, aflag, ch, cflag, gkmflag, nflag, rval, sflag;
char *noargv[2];
const char *noargv[2];
Hflag = Lflag = Pflag = aflag = cflag = gkmflag = nflag = sflag = 0;
totalblocks = 0;
@ -169,7 +166,7 @@ main(argc, argv)
if (!*argv) {
noargv[0] = ".";
noargv[1] = NULL;
argv = noargv;
(const char *)argv = noargv;
}
if (!gkmflag)
@ -332,7 +329,7 @@ linkchk(dev_t dev, ino_t ino)
}
void
usage()
usage(void)
{
(void)fprintf(stderr,