diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-14 05:18:02 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-14 05:18:02 +0000 |
commit | e3863b1460cd9598ecb57705c9b22c2f2c552953 (patch) | |
tree | f839c62a271e1da0a9086b6adf22cb9ca99eb7e6 /mandoc.c | |
parent | 62de322fe3ae3638668739b266e3332e94b5acb3 (diff) | |
download | mandoc-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 'mandoc.c')
-rw-r--r-- | mandoc.c | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -467,7 +467,7 @@ mandoc_getarg(struct mparse *parse, char **cpp, int ln, int *pos) /* Quoted argument without a closing quote. */ if (1 == quoted) - mandoc_msg(MANDOCERR_ARG_QUOTE, parse, ln, *pos, NULL); + mandoc_msg(MANDOCERR_ARG_QUOTE, ln, *pos, NULL); /* NUL-terminate this argument and move to the next one. */ if (pairs) @@ -481,7 +481,7 @@ mandoc_getarg(struct mparse *parse, char **cpp, int ln, int *pos) *cpp = cp; if ('\0' == *cp && (white || ' ' == cp[-1])) - mandoc_msg(MANDOCERR_SPACE_EOL, parse, ln, *pos, NULL); + mandoc_msg(MANDOCERR_SPACE_EOL, ln, *pos, NULL); return start; } @@ -562,7 +562,7 @@ mandoc_normdate(struct roff_man *man, char *in, int ln, int pos) /* No date specified: use today's date. */ if (in == NULL || *in == '\0' || strcmp(in, "$" "Mdocdate$") == 0) { - mandoc_msg(MANDOCERR_DATE_MISSING, man->parse, ln, pos, NULL); + mandoc_msg(MANDOCERR_DATE_MISSING, ln, pos, NULL); return time2a(time(NULL)); } @@ -572,23 +572,20 @@ mandoc_normdate(struct roff_man *man, char *in, int ln, int pos) a2time(&t, "%b %d, %Y", in)) { cp = time2a(t); if (t > time(NULL) + 86400) - mandoc_msg(MANDOCERR_DATE_FUTURE, man->parse, - ln, pos, cp); + mandoc_msg(MANDOCERR_DATE_FUTURE, ln, pos, "%s", cp); else if (*in != '$' && strcmp(in, cp) != 0) - mandoc_msg(MANDOCERR_DATE_NORM, man->parse, - ln, pos, cp); + mandoc_msg(MANDOCERR_DATE_NORM, ln, pos, "%s", cp); return cp; } /* In man(7), do not warn about the legacy format. */ if (a2time(&t, "%Y-%m-%d", in) == 0) - mandoc_msg(MANDOCERR_DATE_BAD, man->parse, ln, pos, in); + mandoc_msg(MANDOCERR_DATE_BAD, ln, pos, "%s", in); else if (t > time(NULL) + 86400) - mandoc_msg(MANDOCERR_DATE_FUTURE, man->parse, ln, pos, in); + mandoc_msg(MANDOCERR_DATE_FUTURE, ln, pos, "%s", in); else if (man->macroset == MACROSET_MDOC) - mandoc_vmsg(MANDOCERR_DATE_LEGACY, man->parse, - ln, pos, "Dd %s", in); + mandoc_msg(MANDOCERR_DATE_LEGACY, ln, pos, "Dd %s", in); /* Use any non-mdoc(7) date verbatim. */ |