summaryrefslogtreecommitdiff
path: root/usr.bin/vis
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-20 03:06:47 +0000
committerlukem <lukem@NetBSD.org>1997-10-20 03:06:47 +0000
commit3ad51f34e09eefe99e1ba9ddf1e78934c7227cc9 (patch)
tree85bcb4b2c0e14527aebb80a9cf2eaaf7f83009f5 /usr.bin/vis
parenteedec1993556055be95e345585a4e1e9bf79cd19 (diff)
WARNSify, deprecate register, getopt returns -1, fix .Nm usage
Diffstat (limited to 'usr.bin/vis')
-rw-r--r--usr.bin/vis/foldit.c11
-rw-r--r--usr.bin/vis/vis.110
-rw-r--r--usr.bin/vis/vis.c17
3 files changed, 21 insertions, 17 deletions
diff --git a/usr.bin/vis/foldit.c b/usr.bin/vis/foldit.c
index 625e3bbe99b..8ee11c197f2 100644
--- a/usr.bin/vis/foldit.c
+++ b/usr.bin/vis/foldit.c
@@ -1,4 +1,4 @@
-/* $NetBSD: foldit.c,v 1.4 1994/12/20 16:13:02 jtc Exp $ */
+/* $NetBSD: foldit.c,v 1.5 1997/10/20 03:06:47 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -33,21 +33,24 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)foldit.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$NetBSD: foldit.c,v 1.4 1994/12/20 16:13:02 jtc Exp $";
+__RCSID("$NetBSD: foldit.c,v 1.5 1997/10/20 03:06:47 lukem Exp $");
#endif /* not lint */
#include <stdio.h>
+int foldit __P((char *, int, int));
+
int
foldit(chunk, col, max)
char *chunk;
int col, max;
{
- register char *cp;
+ char *cp;
/*
* Keep track of column position. Insert hidden newline
@@ -62,7 +65,7 @@ again:
col = 0;
break;
case '\t':
- col = col + 8 &~ 07;
+ col = (col + 8) &~ 07;
break;
case '\b':
col = col ? col - 1 : 0;
diff --git a/usr.bin/vis/vis.1 b/usr.bin/vis/vis.1
index 7ed56eb6e25..1328abc7f69 100644
--- a/usr.bin/vis/vis.1
+++ b/usr.bin/vis/vis.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: vis.1,v 1.5 1994/11/17 07:56:00 jtc Exp $
+.\" $NetBSD: vis.1,v 1.6 1997/10/20 03:06:48 lukem Exp $
.\"
.\" Copyright (c) 1989, 1991, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@@ -40,12 +40,12 @@
.Nm vis
.Nd display non-printable characters in a visual format
.Sh SYNOPSIS
-.Nm vis
+.Nm
.Op Fl cbflnostw
.Op Fl F Ar foldwidth
.Op Ar file ...
.Sh DESCRIPTION
-.Nm Vis
+.Nm
is a filter for converting non-printable characters
into a visual representation. It differs from
.Ql cat -v
@@ -69,7 +69,7 @@ Request a format which displays a small subset of the
non-printable characters using C-style backslash sequences.
.It Fl F
Causes
-.Nm vis
+.Nm
to fold output lines to foldwidth columns (default 80), like
.Xr fold 1 ,
except
@@ -97,7 +97,7 @@ or
is selected. When combined with the
.Fl f
flag,
-.Nm vis
+.Nm
becomes like
an invertible version of the
.Xr fold 1
diff --git a/usr.bin/vis/vis.c b/usr.bin/vis/vis.c
index 822b744a4a6..3f5d551b19c 100644
--- a/usr.bin/vis/vis.c
+++ b/usr.bin/vis/vis.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vis.c,v 1.4 1994/12/20 16:13:03 jtc Exp $ */
+/* $NetBSD: vis.c,v 1.5 1997/10/20 03:06:48 lukem Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -33,17 +33,17 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
-static char copyright[] =
-"@(#) Copyright (c) 1989, 1993\n\
- The Regents of the University of California. All rights reserved.\n";
+__COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
+ The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)vis.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$NetBSD: vis.c,v 1.4 1994/12/20 16:13:03 jtc Exp $";
+__RCSID("$NetBSD: vis.c,v 1.5 1997/10/20 03:06:48 lukem Exp $");
#endif /* not lint */
#include <stdio.h>
@@ -56,6 +56,7 @@ static char rcsid[] = "$NetBSD: vis.c,v 1.4 1994/12/20 16:13:03 jtc Exp $";
int eflags, fold, foldwidth=80, none, markeol, debug;
int foldit __P((char *, int, int));
+int main __P((int, char **));
void process __P((FILE *, char *));
int
@@ -66,7 +67,7 @@ main(argc, argv)
FILE *fp;
int ch;
- while ((ch = getopt(argc, argv, "nwctsobfF:ld")) != EOF)
+ while ((ch = getopt(argc, argv, "nwctsobfF:ld")) != -1)
switch((char)ch) {
case 'n':
none++;
@@ -134,8 +135,8 @@ process(fp, filename)
char *filename;
{
static int col = 0;
- register char *cp = "\0"+1; /* so *(cp-1) starts out != '\n' */
- register int c, rachar;
+ char *cp = "\0"+1; /* so *(cp-1) starts out != '\n' */
+ int c, rachar;
char buff[5];
c = getc(fp);