summaryrefslogtreecommitdiffstatshomepage
path: root/main.c
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
commitac6c3785a7352d497ec5cd8dc29e62ec7246f5ae (patch)
tree13ae94c18482fc55dd12d0cd13a73d7ecbf7df3c /main.c
parent9b6f1a259c31e9ed62d48a3b4892b9130152e5f0 (diff)
downloadmandoc-ac6c3785a7352d497ec5cd8dc29e62ec7246f5ae.tar.gz
mandoc-ac6c3785a7352d497ec5cd8dc29e62ec7246f5ae.tar.zst
mandoc-ac6c3785a7352d497ec5cd8dc29e62ec7246f5ae.zip
Cleaned out duplicate {mdoc,man}warn in main.c.
Diffstat (limited to 'main.c')
-rw-r--r--main.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/main.c b/main.c
index b2602c40..f97c1fc2 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.36 2009/07/06 09:34:29 kristaps Exp $ */
+/* $Id: main.c,v 1.37 2009/07/06 13:08:12 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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);
-}