From bb6c08b6c424a3ed78901df643c8c08c3ea48835 Mon Sep 17 00:00:00 2001 From: will Date: Sun, 28 Jan 2001 00:34:29 +0000 Subject: BDECFLAGS: constify; use proper types. Add $FreeBSD$, clean up #ifndef lint. Reviewed by: markm --- usr.bin/cut/cut.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'usr.bin/cut/cut.c') diff --git a/usr.bin/cut/cut.c b/usr.bin/cut/cut.c index 1dfd3b0..89000d5 100644 --- a/usr.bin/cut/cut.c +++ b/usr.bin/cut/cut.c @@ -32,16 +32,18 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ + * */ #ifndef lint static const char copyright[] = "@(#) Copyright (c) 1989, 1993\n\ The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint static const char sccsid[] = "@(#)cut.c 8.3 (Berkeley) 5/4/95"; +static const char rcsid[] = + "$FreeBSD$"; #endif /* not lint */ #include @@ -60,8 +62,8 @@ int dflag; int fflag; int sflag; -void c_cut __P((FILE *, char *)); -void f_cut __P((FILE *, char *)); +void c_cut __P((FILE *, const char *)); +void f_cut __P((FILE *, const char *)); void get_list __P((char *)); int main __P((int, char **)); static void usage __P((void)); @@ -72,7 +74,7 @@ main(argc, argv) char *argv[]; { FILE *fp; - void (*fcn) __P((FILE *, char *)) = NULL; + void (*fcn) __P((FILE *, const char *)) = NULL; int ch; fcn = NULL; @@ -129,7 +131,7 @@ main(argc, argv) exit(0); } -int autostart, autostop, maxval; +size_t autostart, autostop, maxval; char positions[_POSIX2_LINE_MAX + 1]; @@ -137,7 +139,7 @@ void get_list(list) char *list; { - int setautostart, start, stop; + size_t setautostart, start, stop; char *pos; char *p; @@ -194,10 +196,11 @@ get_list(list) void c_cut(fp, fname) FILE *fp; - char *fname; + const char *fname; { int ch, col; char *pos; + fname = NULL; ch = 0; for (;;) { @@ -224,7 +227,7 @@ c_cut(fp, fname) void f_cut(fp, fname) FILE *fp; - char *fname; + const char *fname; { int ch, field, isdelim; char *pos, *p, sep; -- cgit v1.1