summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-07-12 19:05:53 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-07-12 19:05:53 +0000
commitc4075fc5e85a99e4ec24fd29539d9d633dae392f (patch)
treed06d3d7af78db98a8f5f9b2e3e3ea6ba70bc0f23 /usr.bin/mandoc
parent35b45cf211de27e6932252ed9c60e7a1f6887998 (diff)
sync to 1.7.23: third step to get rid of enum mdoc_warn:
mdoc_verr is not using enum mdoc_warn, so use it at a few more places
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r--usr.bin/mandoc/libmdoc.h5
-rw-r--r--usr.bin/mandoc/mdoc.c4
-rw-r--r--usr.bin/mandoc/mdoc_macro.c4
-rw-r--r--usr.bin/mandoc/mdoc_validate.c17
4 files changed, 16 insertions, 14 deletions
diff --git a/usr.bin/mandoc/libmdoc.h b/usr.bin/mandoc/libmdoc.h
index e452f28474c..41cc81523b7 100644
--- a/usr.bin/mandoc/libmdoc.h
+++ b/usr.bin/mandoc/libmdoc.h
@@ -1,4 +1,4 @@
-/* $Id: libmdoc.h,v 1.8 2009/07/12 18:35:57 schwarze Exp $ */
+/* $Id: libmdoc.h,v 1.9 2009/07/12 19:05:52 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -64,8 +64,6 @@ __BEGIN_DECLS
* When GCC2 is deprecated, most of these can be reverted to #define
* as mdoc_vXXX using __VA_ARGS__. Until then, use real functions.
*/
-int mdoc_verr(struct mdoc *, int, int,
- const char *, ...);
int mdoc_nerr(struct mdoc *, const struct mdoc_node *,
const char *, ...);
int mdoc_warn(struct mdoc *, enum mdoc_warn, const char *, ...);
@@ -74,6 +72,7 @@ int mdoc_pwarn(struct mdoc *, int, int,
enum mdoc_warn,const char *, ...);
int mdoc_perr(struct mdoc *, int, int, const char *, ...);
+int mdoc_verr(struct mdoc *, int, int, const char *, ...);
int mdoc_vwarn(struct mdoc *, int, int, const char *, ...);
int mdoc_macro(MACRO_PROT_ARGS);
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index fc6689b3962..d88e56d6546 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.12 2009/07/12 18:35:57 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.13 2009/07/12 19:05:52 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -648,7 +648,7 @@ static int
macrowarn(struct mdoc *m, int ln, const char *buf)
{
if ( ! (MDOC_IGN_MACRO & m->pflags))
- return(mdoc_perr(m, ln, 1,
+ return(mdoc_verr(m, ln, 1,
"unknown macro: %s%s",
buf, strlen(buf) > 3 ? "..." : ""));
return(mdoc_vwarn(m, ln, 1, "unknown macro: %s%s",
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c
index e4ed8315ace..4b657f1dddd 100644
--- a/usr.bin/mandoc/mdoc_macro.c
+++ b/usr.bin/mandoc/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.5 2009/07/12 18:35:57 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.6 2009/07/12 19:05:52 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -283,7 +283,7 @@ swarn(struct mdoc *mdoc, enum mdoc_type type,
}
if ( ! (MDOC_IGN_SCOPE & mdoc->pflags))
- return(mdoc_perr(mdoc, line, pos,
+ return(mdoc_verr(mdoc, line, pos,
"%s scope breaks %s scope of %s",
tt, t, n));
return(mdoc_vwarn(mdoc, line, pos,
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c
index e14dadd8c06..4849120dd55 100644
--- a/usr.bin/mandoc/mdoc_validate.c
+++ b/usr.bin/mandoc/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.16 2009/07/12 18:35:57 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.17 2009/07/12 19:05:52 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -534,7 +534,7 @@ err_count(struct mdoc *m, const char *k,
int want, const char *v, int has)
{
- return(mdoc_err(m,
+ return(mdoc_verr(m, m->last->line, m->last->pos,
"requires %s %s %d (has %d)", v, k, want, has));
}
@@ -740,7 +740,7 @@ check_parent(PRE_ARGS, int tok, enum mdoc_type t)
(t == n->parent->type))
return(1);
- return(mdoc_nerr(mdoc, n, "require parent %s",
+ return(mdoc_verr(mdoc, n->line, n->pos, "require parent %s",
MDOC_ROOT == t ? "<root>" : mdoc_macronames[tok]));
}
@@ -930,7 +930,8 @@ pre_an(PRE_ARGS)
if (NULL == n->args || 1 == n->args->argc)
return(1);
- return(mdoc_nerr(mdoc, n, "only one argument allowed"));
+ return(mdoc_verr(mdoc, n->line, n->pos,
+ "only one argument allowed"));
}
@@ -1203,8 +1204,9 @@ post_it(POST_ARGS)
i++;
if (i == cols)
break;
- return(mdoc_err(mdoc, "column mismatch (have "
- "%d, want %d)", i, cols));
+ return(mdoc_verr(mdoc, mdoc->last->line, mdoc->last->pos,
+ "column mismatch (have %d, want %d)",
+ i, cols));
default:
break;
}
@@ -1253,7 +1255,8 @@ post_bl(POST_ARGS)
if (MDOC_BLOCK == n->type)
if (MDOC_It == n->tok)
continue;
- return(mdoc_nerr(mdoc, n, "bad child of parent %s",
+ return(mdoc_verr(mdoc, n->line, n->pos,
+ "bad child of parent %s",
mdoc_macronames[mdoc->last->tok]));
}