aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc.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 /mdoc.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 'mdoc.c')
-rw-r--r--mdoc.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/mdoc.c b/mdoc.c
index 9c170e6e..ac33e9f7 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.270 2018/12/04 02:53:51 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.271 2018/12/14 05:18:02 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -227,8 +227,7 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs)
*end = '\0';
if (ws)
- mandoc_msg(MANDOCERR_SPACE_EOL, mdoc->parse,
- line, (int)(ws-buf), NULL);
+ mandoc_msg(MANDOCERR_SPACE_EOL, line, (int)(ws - buf), NULL);
/*
* Blank lines are allowed in no-fill mode
@@ -252,8 +251,7 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs)
default:
break;
}
- mandoc_msg(MANDOCERR_FI_BLANK, mdoc->parse,
- line, (int)(c - buf), NULL);
+ mandoc_msg(MANDOCERR_FI_BLANK, line, (int)(c - buf), NULL);
roff_elem_alloc(mdoc, line, offs, ROFF_sp);
mdoc->last->flags |= NODE_VALID | NODE_ENDED;
mdoc->next = ROFF_NEXT_SIBLING;
@@ -293,8 +291,7 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs)
if (*c == ' ')
c++;
if (isupper((unsigned char)(*c)))
- mandoc_msg(MANDOCERR_EOS, mdoc->parse,
- line, (int)(c - buf), NULL);
+ mandoc_msg(MANDOCERR_EOS, line, (int)(c - buf), NULL);
}
return 1;
@@ -322,8 +319,7 @@ mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, int offs)
if (sz == 2 || sz == 3)
tok = roffhash_find(mdoc->mdocmac, buf + sv, sz);
if (tok == TOKEN_NONE) {
- mandoc_msg(MANDOCERR_MACRO, mdoc->parse,
- ln, sv, buf + sv - 1);
+ mandoc_msg(MANDOCERR_MACRO, ln, sv, "%s", buf + sv - 1);
return 1;
}
@@ -353,8 +349,7 @@ mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, int offs)
*/
if ('\0' == buf[offs] && ' ' == buf[offs - 1])
- mandoc_msg(MANDOCERR_SPACE_EOL, mdoc->parse,
- ln, offs - 1, NULL);
+ mandoc_msg(MANDOCERR_SPACE_EOL, ln, offs - 1, NULL);
/*
* If an initial macro or a list invocation, divert directly