aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff_validate.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
commit7a6eb8920bdea2ecc151b308352b2a98699b2350 (patch)
tree9860a766930f3997c413b0f0aecd6ba815b80f25 /roff_validate.c
parent0ef6626fcc16277d2fefb32e1830dfba3df5defd (diff)
downloadmandoc-7a6eb8920bdea2ecc151b308352b2a98699b2350.tar.gz
mandoc-7a6eb8920bdea2ecc151b308352b2a98699b2350.tar.zst
mandoc-7a6eb8920bdea2ecc151b308352b2a98699b2350.zip
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 'roff_validate.c')
-rw-r--r--roff_validate.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/roff_validate.c b/roff_validate.c
index 3a53022a..5593dd8a 100644
--- a/roff_validate.c
+++ b/roff_validate.c
@@ -1,4 +1,4 @@
-/* $Id: roff_validate.c,v 1.13 2018/12/14 01:18:26 schwarze Exp $ */
+/* $Id: roff_validate.c,v 1.14 2018/12/14 05:18:03 schwarze Exp $ */
/*
* Copyright (c) 2010, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -64,12 +64,12 @@ roff_valid_br(ROFF_VALID_ARGS)
struct roff_node *np;
if (n->child != NULL)
- mandoc_vmsg(MANDOCERR_ARG_SKIP, man->parse,
+ mandoc_msg(MANDOCERR_ARG_SKIP,
n->line, n->pos, "br %s", n->child->string);
if (n->next != NULL && n->next->type == ROFFT_TEXT &&
*n->next->string == ' ') {
- mandoc_msg(MANDOCERR_PAR_SKIP, man->parse, n->line, n->pos,
+ mandoc_msg(MANDOCERR_PAR_SKIP, n->line, n->pos,
"br before text line with leading blank");
roff_node_delete(man, n);
return;
@@ -82,7 +82,7 @@ roff_valid_br(ROFF_VALID_ARGS)
case ROFF_br:
case ROFF_sp:
case MDOC_Pp:
- mandoc_vmsg(MANDOCERR_PAR_SKIP, man->parse,
+ mandoc_msg(MANDOCERR_PAR_SKIP,
n->line, n->pos, "br after %s", roff_name[np->tok]);
roff_node_delete(man, n);
break;
@@ -128,8 +128,7 @@ roff_valid_ft(ROFF_VALID_ARGS)
break;
}
- mandoc_vmsg(MANDOCERR_FT_BAD, man->parse,
- n->line, n->pos, "ft %s", cp);
+ mandoc_msg(MANDOCERR_FT_BAD, n->line, n->pos, "ft %s", cp);
roff_node_delete(man, n);
}
@@ -139,7 +138,7 @@ roff_valid_sp(ROFF_VALID_ARGS)
struct roff_node *np;
if (n->child != NULL && n->child->next != NULL)
- mandoc_vmsg(MANDOCERR_ARG_EXCESS, man->parse,
+ mandoc_msg(MANDOCERR_ARG_EXCESS,
n->child->next->line, n->child->next->pos,
"sp ... %s", n->child->next->string);
@@ -148,12 +147,12 @@ roff_valid_sp(ROFF_VALID_ARGS)
switch (np->tok) {
case ROFF_br:
- mandoc_msg(MANDOCERR_PAR_SKIP, man->parse,
+ mandoc_msg(MANDOCERR_PAR_SKIP,
np->line, np->pos, "br before sp");
roff_node_delete(man, np);
break;
case MDOC_Pp:
- mandoc_msg(MANDOCERR_PAR_SKIP, man->parse,
+ mandoc_msg(MANDOCERR_PAR_SKIP,
n->line, n->pos, "sp after Pp");
roff_node_delete(man, n);
break;