Some warns cleanups - I think this is still not warns clean on the alpha.
This commit is contained in:
parent
57a4972d78
commit
6215f63b5e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87305
@ -44,6 +44,7 @@ static const char rcsid[] =
|
|||||||
int
|
int
|
||||||
foldit(chunk, col, max)
|
foldit(chunk, col, max)
|
||||||
char *chunk;
|
char *chunk;
|
||||||
|
int col, max;
|
||||||
{
|
{
|
||||||
register char *cp;
|
register char *cp;
|
||||||
|
|
||||||
@ -60,7 +61,7 @@ foldit(chunk, col, max)
|
|||||||
col = 0;
|
col = 0;
|
||||||
break;
|
break;
|
||||||
case '\t':
|
case '\t':
|
||||||
col = col + 8 &~ 07;
|
col = (col + 8) &~ 07;
|
||||||
break;
|
break;
|
||||||
case '\b':
|
case '\b':
|
||||||
col = col ? col - 1 : 0;
|
col = col ? col - 1 : 0;
|
||||||
|
@ -54,12 +54,13 @@ static const char rcsid[] =
|
|||||||
|
|
||||||
int eflags, fold, foldwidth=80, none, markeol, debug;
|
int eflags, fold, foldwidth=80, none, markeol, debug;
|
||||||
|
|
||||||
void process __P((FILE *, char *filename));
|
void process __P((FILE *));
|
||||||
static void usage __P((void));
|
static void usage __P((void));
|
||||||
extern int foldit __P((char *, int, int));
|
extern int foldit __P((char *, int, int));
|
||||||
|
|
||||||
int
|
int
|
||||||
main(argc, argv)
|
main(argc, argv)
|
||||||
|
int argc;
|
||||||
char *argv[];
|
char *argv[];
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -115,13 +116,13 @@ main(argc, argv)
|
|||||||
if (*argv)
|
if (*argv)
|
||||||
while (*argv) {
|
while (*argv) {
|
||||||
if ((fp=fopen(*argv, "r")) != NULL)
|
if ((fp=fopen(*argv, "r")) != NULL)
|
||||||
process(fp, *argv);
|
process(fp);
|
||||||
else
|
else
|
||||||
warn("%s", *argv);
|
warn("%s", *argv);
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
process(stdin, "<stdin>");
|
process(stdin);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,12 +139,12 @@ usage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
process(fp, filename)
|
process(fp)
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char *filename;
|
|
||||||
{
|
{
|
||||||
static int col = 0;
|
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;
|
register int c, rachar;
|
||||||
char buff[5];
|
char buff[5];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user