ANSIify function definitions to avoid a warning.
Minor constness changes.
This commit is contained in:
parent
77ae8ac713
commit
412f8d5a03
@ -65,11 +65,11 @@ __FBSDID("$FreeBSD$");
|
|||||||
void addcmd(char *);
|
void addcmd(char *);
|
||||||
void addmac(const char *);
|
void addmac(const char *);
|
||||||
int binsrch(const char *);
|
int binsrch(const char *);
|
||||||
void checkknown(char *);
|
void checkknown(const char *);
|
||||||
void chkcmd(char *, char *);
|
void chkcmd(const char *, const char *);
|
||||||
void complain(int);
|
void complain(int);
|
||||||
int eq(const char *, const char *);
|
int eq(const char *, const char *);
|
||||||
void nomatch(char *);
|
void nomatch(const char *);
|
||||||
void pe(int);
|
void pe(int);
|
||||||
void process(FILE *);
|
void process(FILE *);
|
||||||
void prop(int);
|
void prop(int);
|
||||||
@ -191,9 +191,7 @@ int ncmds; /* size of knowncmds */
|
|||||||
int slot; /* slot in knowncmds found by binsrch */
|
int slot; /* slot in knowncmds found by binsrch */
|
||||||
|
|
||||||
int
|
int
|
||||||
main(argc, argv)
|
main(int argc, char **argv)
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int i;
|
int i;
|
||||||
@ -271,7 +269,7 @@ char **argv;
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"usage: checknr [-a.xx.yy.xx.yy...] [-c.xx.xx.xx...] [-s] [-f] file\n");
|
"usage: checknr [-a.xx.yy.xx.yy...] [-c.xx.xx.xx...] [-s] [-f] file\n");
|
||||||
@ -279,8 +277,7 @@ usage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
process(f)
|
process(FILE *f)
|
||||||
FILE *f;
|
|
||||||
{
|
{
|
||||||
int i, n;
|
int i, n;
|
||||||
char mac[5]; /* The current macro or nroff command */
|
char mac[5]; /* The current macro or nroff command */
|
||||||
@ -377,8 +374,7 @@ FILE *f;
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
complain(i)
|
complain(int i)
|
||||||
int i;
|
|
||||||
{
|
{
|
||||||
pe(stk[i].lno);
|
pe(stk[i].lno);
|
||||||
printf("Unmatched ");
|
printf("Unmatched ");
|
||||||
@ -387,8 +383,7 @@ int i;
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
prop(i)
|
prop(int i)
|
||||||
int i;
|
|
||||||
{
|
{
|
||||||
if (stk[i].pl == 0)
|
if (stk[i].pl == 0)
|
||||||
printf(".%s", br[stk[i].opno].opbr);
|
printf(".%s", br[stk[i].opno].opbr);
|
||||||
@ -406,9 +401,7 @@ int i;
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
chkcmd(line, mac)
|
chkcmd(const char *line __unused, const char *mac)
|
||||||
char *line __unused;
|
|
||||||
char *mac;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -444,8 +437,7 @@ char *mac;
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nomatch(mac)
|
nomatch(const char *mac)
|
||||||
char *mac;
|
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@ -490,16 +482,14 @@ char *mac;
|
|||||||
|
|
||||||
/* eq: are two strings equal? */
|
/* eq: are two strings equal? */
|
||||||
int
|
int
|
||||||
eq(s1, s2)
|
eq(const char *s1, const char *s2)
|
||||||
const char *s1, *s2;
|
|
||||||
{
|
{
|
||||||
return (strcmp(s1, s2) == 0);
|
return (strcmp(s1, s2) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* print the first part of an error message, given the line number */
|
/* print the first part of an error message, given the line number */
|
||||||
void
|
void
|
||||||
pe(linen)
|
pe(int linen)
|
||||||
int linen;
|
|
||||||
{
|
{
|
||||||
if (nfiles > 1)
|
if (nfiles > 1)
|
||||||
printf("%s: ", cfilename);
|
printf("%s: ", cfilename);
|
||||||
@ -507,8 +497,7 @@ int linen;
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
checkknown(mac)
|
checkknown(const char *mac)
|
||||||
char *mac;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (eq(mac, "."))
|
if (eq(mac, "."))
|
||||||
@ -526,8 +515,7 @@ char *mac;
|
|||||||
* We have a .de xx line in "line". Add xx to the list of known commands.
|
* We have a .de xx line in "line". Add xx to the list of known commands.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
addcmd(line)
|
addcmd(char *line)
|
||||||
char *line;
|
|
||||||
{
|
{
|
||||||
char *mac;
|
char *mac;
|
||||||
|
|
||||||
@ -558,8 +546,7 @@ char *line;
|
|||||||
* nroff programs, and the register loop below is pretty fast.
|
* nroff programs, and the register loop below is pretty fast.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
addmac(mac)
|
addmac(const char *mac)
|
||||||
const char *mac;
|
|
||||||
{
|
{
|
||||||
const char **src, **dest, **loc;
|
const char **src, **dest, **loc;
|
||||||
|
|
||||||
@ -590,8 +577,7 @@ printf("after: %s %s %s %s %s, %d cmds\n", knowncmds[slot-2], knowncmds[slot-1],
|
|||||||
* If found, return the index. If not, return -1.
|
* If found, return the index. If not, return -1.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
binsrch(mac)
|
binsrch(const char *mac)
|
||||||
const char *mac;
|
|
||||||
{
|
{
|
||||||
const char *p; /* pointer to current cmd in list */
|
const char *p; /* pointer to current cmd in list */
|
||||||
int d; /* difference if any */
|
int d; /* difference if any */
|
||||||
|
Loading…
Reference in New Issue
Block a user