summaryrefslogtreecommitdiffstats
path: root/man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-12-14 05:18:02 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-12-14 05:18:02 +0000
commite3863b1460cd9598ecb57705c9b22c2f2c552953 (patch)
treef839c62a271e1da0a9086b6adf22cb9ca99eb7e6 /man.c
parent62de322fe3ae3638668739b266e3332e94b5acb3 (diff)
downloadmandoc-e3863b1460cd9598ecb57705c9b22c2f2c552953.tar.gz
Almost mechanical diff to remove the "struct mparse *" argument
from mandoc_msg(), where it is no longer used. While here, rename mandoc_vmsg() to mandoc_msg() and retire the old version: There is really no point in having another function merely to save "%s" in a few places. Minus 140 lines of code.
Diffstat (limited to 'man.c')
-rw-r--r--man.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/man.c b/man.c
index acd3da20..34a479c2 100644
--- a/man.c
+++ b/man.c
@@ -122,8 +122,7 @@ man_ptext(struct roff_man *man, int line, char *buf, int offs)
if (buf[i] == '\0') {
if (man->flags & (MAN_ELINE | MAN_BLINE)) {
- mandoc_msg(MANDOCERR_BLK_BLANK, man->parse,
- line, 0, NULL);
+ mandoc_msg(MANDOCERR_BLK_BLANK, line, 0, NULL);
return 1;
}
if (man->last->tok == MAN_SH || man->last->tok == MAN_SS)
@@ -148,8 +147,7 @@ man_ptext(struct roff_man *man, int line, char *buf, int offs)
if (' ' == buf[i - 1] || '\t' == buf[i - 1]) {
if (i > 1 && '\\' != buf[i - 2])
- mandoc_msg(MANDOCERR_SPACE_EOL, man->parse,
- line, i - 1, NULL);
+ mandoc_msg(MANDOCERR_SPACE_EOL, line, i - 1, NULL);
for (--i; i && ' ' == buf[i]; i--)
/* Spin back to non-space. */ ;
@@ -194,8 +192,7 @@ man_pmacro(struct roff_man *man, int ln, char *buf, int offs)
if (sz > 0 && sz < 4)
tok = roffhash_find(man->manmac, buf + ppos, sz);
if (tok == TOKEN_NONE) {
- mandoc_msg(MANDOCERR_MACRO, man->parse,
- ln, ppos, buf + ppos - 1);
+ mandoc_msg(MANDOCERR_MACRO, ln, ppos, "%s", buf + ppos - 1);
return 1;
}
@@ -225,8 +222,7 @@ man_pmacro(struct roff_man *man, int ln, char *buf, int offs)
*/
if (buf[offs] == '\0' && buf[offs - 1] == ' ')
- mandoc_msg(MANDOCERR_SPACE_EOL, man->parse,
- ln, offs - 1, NULL);
+ mandoc_msg(MANDOCERR_SPACE_EOL, ln, offs - 1, NULL);
/*
* Some macros break next-line scopes; otherwise, remember
@@ -299,9 +295,8 @@ man_breakscope(struct roff_man *man, int tok)
== MAN_NSCOPED)
n = n->parent;
- mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse,
- n->line, n->pos, "%s breaks %s",
- roff_name[tok], roff_name[n->tok]);
+ mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos,
+ "%s breaks %s", roff_name[tok], roff_name[n->tok]);
roff_node_delete(man, n);
man->flags &= ~MAN_ELINE;
@@ -341,9 +336,8 @@ man_breakscope(struct roff_man *man, int tok)
assert(n->type == ROFFT_BLOCK);
assert(man_macro(n->tok)->flags & MAN_BSCOPED);
- mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse,
- n->line, n->pos, "%s breaks %s",
- roff_name[tok], roff_name[n->tok]);
+ mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos,
+ "%s breaks %s", roff_name[tok], roff_name[n->tok]);
roff_node_delete(man, n);
man->flags &= ~MAN_BLINE;
@@ -358,16 +352,14 @@ man_state(struct roff_man *man, struct roff_node *n)
case MAN_nf:
case MAN_EX:
if (man->flags & MAN_LITERAL && ! (n->flags & NODE_VALID))
- mandoc_msg(MANDOCERR_NF_SKIP, man->parse,
- n->line, n->pos, "nf");
+ mandoc_msg(MANDOCERR_NF_SKIP, n->line, n->pos, "nf");
man->flags |= MAN_LITERAL;
break;
case MAN_fi:
case MAN_EE:
if ( ! (man->flags & MAN_LITERAL) &&
! (n->flags & NODE_VALID))
- mandoc_msg(MANDOCERR_FI_SKIP, man->parse,
- n->line, n->pos, "fi");
+ mandoc_msg(MANDOCERR_FI_SKIP, n->line, n->pos, "fi");
man->flags &= ~MAN_LITERAL;
break;
default: