aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-07-30 21:18:24 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-07-30 21:18:24 +0000
commit7932c52fa72df57459b3b6ec61250902a3494de1 (patch)
tree1e1455ee8c5a8c4314bb00167832fa849a37f061 /man.c
parent3df821d1852019b1d849d65ee50cbf551b92bbd6 (diff)
downloadmandoc-7932c52fa72df57459b3b6ec61250902a3494de1.tar.gz
mandoc-7932c52fa72df57459b3b6ec61250902a3494de1.tar.zst
mandoc-7932c52fa72df57459b3b6ec61250902a3494de1.zip
garbage collect three unused global flags; no functional change
Diffstat (limited to 'man.c')
-rw-r--r--man.c53
1 files changed, 8 insertions, 45 deletions
diff --git a/man.c b/man.c
index 0d3ca7e3..d61014e0 100644
--- a/man.c
+++ b/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.134 2014/07/30 20:06:36 schwarze Exp $ */
+/* $Id: man.c,v 1.135 2014/07/30 21:18:24 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -68,7 +68,6 @@ const struct man_node *
man_node(const struct man *man)
{
- assert( ! (MAN_HALT & man->flags));
return(man->first);
}
@@ -76,7 +75,6 @@ const struct man_meta *
man_meta(const struct man *man)
{
- assert( ! (MAN_HALT & man->flags));
return(&man->meta);
}
@@ -116,11 +114,7 @@ int
man_endparse(struct man *man)
{
- assert( ! (MAN_HALT & man->flags));
- if (man_macroend(man))
- return(1);
- man->flags |= MAN_HALT;
- return(0);
+ return(man_macroend(man));
}
int
@@ -129,8 +123,6 @@ man_parseln(struct man *man, int ln, char *buf, int offs)
man->flags |= MAN_NEWLINE;
- assert( ! (MAN_HALT & man->flags));
-
return (roff_getcontrol(man->roff, buf, &offs) ?
man_pmacro(man, ln, buf, offs) :
man_ptext(man, ln, buf, offs));
@@ -352,8 +344,6 @@ man_addeqn(struct man *man, const struct eqn *ep)
{
struct man_node *n;
- assert( ! (MAN_HALT & man->flags));
-
n = man_node_alloc(man, ep->ln, ep->pos, MAN_EQN, MAN_MAX);
n->eqn = ep;
@@ -369,8 +359,6 @@ man_addspan(struct man *man, const struct tbl_span *sp)
{
struct man_node *n;
- assert( ! (MAN_HALT & man->flags));
-
n = man_node_alloc(man, sp->line, 0, MAN_TBL, MAN_MAX);
n->span = sp;
@@ -590,7 +578,7 @@ man_pmacro(struct man *man, int ln, char *buf, int offs)
assert(man_macros[tok].fp);
if ( ! (*man_macros[tok].fp)(man, tok, ln, ppos, &offs, buf))
- goto err;
+ return(0);
/* In quick mode (for mandocdb), abort after the NAME section. */
@@ -602,46 +590,21 @@ man_pmacro(struct man *man, int ln, char *buf, int offs)
}
/*
- * We weren't in a block-line scope when entering the
- * above-parsed macro, so return.
- */
-
- if ( ! bline) {
- man->flags &= ~MAN_ILINE;
- return(1);
- }
-
- /*
- * If we're in a block scope, then allow this macro to slip by
- * without closing scope around it.
- */
-
- if (MAN_ILINE & man->flags) {
- man->flags &= ~MAN_ILINE;
- return(1);
- }
-
- /*
- * If we've opened a new next-line element scope, then return
- * now, as the next line will close out the block scope.
+ * If we are in a next-line scope for a block head,
+ * close it out now and switch to the body,
+ * unless the next-line scope is allowed to continue.
*/
- if (MAN_ELINE & man->flags)
+ if ( ! bline || man->flags & MAN_ELINE ||
+ man_macros[tok].flags & MAN_NSCOPED)
return(1);
- /* Close out the block scope opened in the prior line. */
-
assert(MAN_BLINE & man->flags);
man->flags &= ~MAN_BLINE;
if ( ! man_unscope(man, man->last->parent))
return(0);
return(man_body_alloc(man, ln, ppos, man->last->tok));
-
-err: /* Error out. */
-
- man->flags |= MAN_HALT;
- return(0);
}
/*