summaryrefslogtreecommitdiffstats
path: root/tbl_opts.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 /tbl_opts.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 'tbl_opts.c')
-rw-r--r--tbl_opts.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/tbl_opts.c b/tbl_opts.c
index 3e0f11d5..6c552aad 100644
--- a/tbl_opts.c
+++ b/tbl_opts.c
@@ -81,7 +81,7 @@ arg(struct tbl_node *tbl, int ln, const char *p, int *pos, int key)
switch (key) {
case KEY_DELIM:
- mandoc_vmsg(MANDOCERR_TBLOPT_EQN, tbl->parse,
+ mandoc_msg(MANDOCERR_TBLOPT_EQN,
ln, *pos, "%.*s", len, p + *pos);
want = 2;
break;
@@ -103,12 +103,11 @@ arg(struct tbl_node *tbl, int ln, const char *p, int *pos, int key)
}
if (len == 0)
- mandoc_msg(MANDOCERR_TBLOPT_NOARG,
- tbl->parse, ln, *pos, keys[key].name);
+ mandoc_msg(MANDOCERR_TBLOPT_NOARG, ln, *pos,
+ "%s", keys[key].name);
else if (want && len != want)
- mandoc_vmsg(MANDOCERR_TBLOPT_ARGSZ,
- tbl->parse, ln, *pos, "%s want %d have %d",
- keys[key].name, want, len);
+ mandoc_msg(MANDOCERR_TBLOPT_ARGSZ, ln, *pos,
+ "%s want %d have %d", keys[key].name, want, len);
*pos += len;
if (p[*pos] == ')')
@@ -142,8 +141,8 @@ tbl_option(struct tbl_node *tbl, int ln, const char *p, int *offs)
len++;
if (len == 0) {
- mandoc_vmsg(MANDOCERR_TBLOPT_ALPHA,
- tbl->parse, ln, pos, "%c", p[pos]);
+ mandoc_msg(MANDOCERR_TBLOPT_ALPHA,
+ ln, pos, "%c", p[pos]);
pos++;
continue;
}
@@ -157,7 +156,7 @@ tbl_option(struct tbl_node *tbl, int ln, const char *p, int *offs)
i++;
if (i == KEY_MAXKEYS) {
- mandoc_vmsg(MANDOCERR_TBLOPT_BAD, tbl->parse,
+ mandoc_msg(MANDOCERR_TBLOPT_BAD,
ln, pos, "%.*s", len, p + pos);
pos += len;
continue;