summaryrefslogtreecommitdiffstats
path: root/usr.bin/vis
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2001-12-03 21:40:07 +0000
committerdwmalone <dwmalone@FreeBSD.org>2001-12-03 21:40:07 +0000
commit2d98aab133596940cfc6395d8b72109fdea6cdc2 (patch)
treecd00828524dc37ab2e6ebd1a53b20a72027b0d34 /usr.bin/vis
parent56460a2eb0941ab9a88942ea6241105379db4fb9 (diff)
downloadFreeBSD-src-2d98aab133596940cfc6395d8b72109fdea6cdc2.zip
FreeBSD-src-2d98aab133596940cfc6395d8b72109fdea6cdc2.tar.gz
Some warns cleanups - I think this is still not warns clean on the alpha.
Diffstat (limited to 'usr.bin/vis')
-rw-r--r--usr.bin/vis/foldit.c3
-rw-r--r--usr.bin/vis/vis.c13
2 files changed, 9 insertions, 7 deletions
diff --git a/usr.bin/vis/foldit.c b/usr.bin/vis/foldit.c
index 6cf63f3..898e341 100644
--- a/usr.bin/vis/foldit.c
+++ b/usr.bin/vis/foldit.c
@@ -44,6 +44,7 @@ static const char rcsid[] =
int
foldit(chunk, col, max)
char *chunk;
+ int col, max;
{
register char *cp;
@@ -60,7 +61,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.c b/usr.bin/vis/vis.c
index 0ff6a21..740308e 100644
--- a/usr.bin/vis/vis.c
+++ b/usr.bin/vis/vis.c
@@ -54,12 +54,13 @@ static const char rcsid[] =
int eflags, fold, foldwidth=80, none, markeol, debug;
-void process __P((FILE *, char *filename));
+void process __P((FILE *));
static void usage __P((void));
extern int foldit __P((char *, int, int));
int
main(argc, argv)
+ int argc;
char *argv[];
{
FILE *fp;
@@ -115,13 +116,13 @@ main(argc, argv)
if (*argv)
while (*argv) {
if ((fp=fopen(*argv, "r")) != NULL)
- process(fp, *argv);
+ process(fp);
else
warn("%s", *argv);
argv++;
}
else
- process(stdin, "<stdin>");
+ process(stdin);
exit(0);
}
@@ -138,12 +139,12 @@ usage()
}
void
-process(fp, filename)
+process(fp)
FILE *fp;
- char *filename;
{
static int col = 0;
- register char *cp = "\0"+1; /* so *(cp-1) starts out != '\n' */
+ static char dummy[] = "\0";
+ register char *cp = dummy+1; /* so *(cp-1) starts out != '\n' */
register int c, rachar;
char buff[5];
OpenPOWER on IntegriCloud