summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-07-06 13:08:12 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-07-06 13:08:12 +0000
commit8bb2d440353dfd8ea31fc13961be17f653478d0b (patch)
treef91da772eb85f21ab42d4829291f507b6cbfc3e6
parent7a72fe65c7d5fe05324b8d227b387f2aa3cea747 (diff)
downloadmandoc-8bb2d440353dfd8ea31fc13961be17f653478d0b.tar.gz
Cleaned out duplicate {mdoc,man}warn in main.c.
-rw-r--r--main.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/main.c b/main.c
index d8eea987..74690e47 100644
--- a/main.c
+++ b/main.c
@@ -96,8 +96,7 @@ static int toptions(enum outt *, char *);
static int moptions(enum intt *, char *);
static int woptions(int *, char *);
static int merr(void *, int, int, const char *);
-static int manwarn(void *, int, int, const char *);
-static int mdocwarn(void *, int, int, const char *);
+static int mwarn(void *, int, int, const char *);
static int ffile(struct buf *, struct buf *,
const char *, struct curparse *);
static int fdesc(struct buf *, struct buf *,
@@ -225,7 +224,7 @@ man_init(struct curparse *curp)
struct man_cb mancb;
mancb.man_err = merr;
- mancb.man_warn = manwarn;
+ mancb.man_warn = mwarn;
/* Defaults from mandoc.1. */
@@ -253,7 +252,7 @@ mdoc_init(struct curparse *curp)
struct mdoc_cb mdoccb;
mdoccb.mdoc_err = merr;
- mdoccb.mdoc_warn = mdocwarn;
+ mdoccb.mdoc_warn = mwarn;
/* Defaults from mandoc.1. */
@@ -635,7 +634,7 @@ merr(void *arg, int line, int col, const char *msg)
static int
-mdocwarn(void *arg, int line, int col, const char *msg)
+mwarn(void *arg, int line, int col, const char *msg)
{
struct curparse *curp;
@@ -654,23 +653,3 @@ mdocwarn(void *arg, int line, int col, const char *msg)
return(0);
}
-
-static int
-manwarn(void *arg, int line, int col, const char *msg)
-{
- struct curparse *curp;
-
- curp = (struct curparse *)arg;
-
- if ( ! (curp->wflags & WARN_WALL))
- return(1);
-
- warnx("%s:%d: syntax warning: %s (column %d)",
- curp->file, line, msg, col);
-
- if ( ! (curp->wflags & WARN_WERR))
- return(1);
-
- warnx("considering warnings as errors");
- return(0);
-}