From 7a6eb8920bdea2ecc151b308352b2a98699b2350 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 14 Dec 2018 05:18:02 +0000 Subject: 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. --- main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 55e06617..0acc9c3a 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.312 2018/12/14 01:18:25 schwarze Exp $ */ +/* $Id: main.c,v 1.313 2018/12/14 05:18:02 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014-2018 Ingo Schwarze @@ -889,7 +889,6 @@ check_xr(void) static struct manpaths paths; struct mansearch search; struct mandoc_xr *xr; - char *cp; size_t sz; if (paths.sz == 0) @@ -908,12 +907,12 @@ check_xr(void) if (fs_search(&search, &paths, 1, &xr->name, NULL, &sz)) continue; if (xr->count == 1) - mandoc_asprintf(&cp, "Xr %s %s", xr->name, xr->sec); + mandoc_msg(MANDOCERR_XR_BAD, xr->line, + xr->pos + 1, "Xr %s %s", xr->name, xr->sec); else - mandoc_asprintf(&cp, "Xr %s %s (%d times)", + mandoc_msg(MANDOCERR_XR_BAD, xr->line, + xr->pos + 1, "Xr %s %s (%d times)", xr->name, xr->sec, xr->count); - mandoc_msg(MANDOCERR_XR_BAD, NULL, xr->line, xr->pos + 1, cp); - free(cp); } } -- cgit v1.2.3-56-ge451