=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc.c,v retrieving revision 1.118 retrieving revision 1.119 diff -u -r1.118 -r1.119 --- src/usr.bin/mandoc/mdoc.c 2014/11/19 03:07:43 1.118 +++ src/usr.bin/mandoc/mdoc.c 2014/11/28 01:05:40 1.119 @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc.c,v 1.118 2014/11/19 03:07:43 schwarze Exp $ */ +/* $OpenBSD: mdoc.c,v 1.119 2014/11/28 01:05:40 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze @@ -87,8 +87,7 @@ static void mdoc_alloc1(struct mdoc *); static struct mdoc_node *node_alloc(struct mdoc *, int, int, enum mdoct, enum mdoc_type); -static int node_append(struct mdoc *, - struct mdoc_node *); +static void node_append(struct mdoc *, struct mdoc_node *); static int mdoc_ptext(struct mdoc *, int, char *, int); static int mdoc_pmacro(struct mdoc *, int, char *, int); @@ -205,10 +204,7 @@ n->eqn = ep; if (ep->ln > mdoc->last->line) n->flags |= MDOC_LINE; - - if ( ! node_append(mdoc, n)) - return(0); - + node_append(mdoc, n); mdoc->next = MDOC_NEXT_SIBLING; return(1); } @@ -220,10 +216,7 @@ n = node_alloc(mdoc, sp->line, 0, MDOC_MAX, MDOC_TBL); n->span = sp; - - if ( ! node_append(mdoc, n)) - return(0); - + node_append(mdoc, n); mdoc->next = MDOC_NEXT_SIBLING; return(1); } @@ -283,7 +276,7 @@ } -static int +static void node_append(struct mdoc *mdoc, struct mdoc_node *p) { @@ -327,8 +320,7 @@ break; } - if ( ! mdoc_valid_pre(mdoc, p)) - return(0); + mdoc_valid_pre(mdoc, p); switch (p->type) { case MDOC_HEAD: @@ -355,14 +347,11 @@ case MDOC_TBL: /* FALLTHROUGH */ case MDOC_TEXT: - if ( ! mdoc_valid_post(mdoc)) - return(0); + mdoc_valid_post(mdoc); break; default: break; } - - return(1); } static struct mdoc_node * @@ -398,8 +387,7 @@ struct mdoc_node *p; p = node_alloc(mdoc, line, pos, tok, MDOC_TAIL); - if ( ! node_append(mdoc, p)) - return(0); + node_append(mdoc, p); mdoc->next = MDOC_NEXT_CHILD; return(1); } @@ -413,8 +401,7 @@ assert(mdoc->last); p = node_alloc(mdoc, line, pos, tok, MDOC_HEAD); - if ( ! node_append(mdoc, p)) - return(0); + node_append(mdoc, p); mdoc->next = MDOC_NEXT_CHILD; return(1); } @@ -425,8 +412,7 @@ struct mdoc_node *p; p = node_alloc(mdoc, line, pos, tok, MDOC_BODY); - if ( ! node_append(mdoc, p)) - return(0); + node_append(mdoc, p); mdoc->next = MDOC_NEXT_CHILD; return(1); } @@ -441,8 +427,7 @@ p->pending = body; p->norm = body->norm; p->end = end; - if ( ! node_append(mdoc, p)) - return(0); + node_append(mdoc, p); mdoc->next = MDOC_NEXT_SIBLING; return(1); } @@ -473,9 +458,7 @@ default: break; } - - if ( ! node_append(mdoc, p)) - return(0); + node_append(mdoc, p); mdoc->next = MDOC_NEXT_CHILD; return(1); } @@ -498,9 +481,7 @@ default: break; } - - if ( ! node_append(mdoc, p)) - return(0); + node_append(mdoc, p); mdoc->next = MDOC_NEXT_CHILD; return(1); } @@ -512,10 +493,7 @@ n = node_alloc(mdoc, line, pos, MDOC_MAX, MDOC_TEXT); n->string = roff_strdup(mdoc->roff, p); - - if ( ! node_append(mdoc, n)) - return(0); - + node_append(mdoc, n); mdoc->next = MDOC_NEXT_SIBLING; return(1); } @@ -604,7 +582,8 @@ { mdoc_node_unlink(mdoc, p); - return(node_append(mdoc, p)); + node_append(mdoc, p); + return(1); } /* @@ -702,7 +681,8 @@ mdoc->next = MDOC_NEXT_SIBLING; - return(mdoc_valid_post(mdoc)); + mdoc_valid_post(mdoc); + return(1); } if ( ! mdoc_word_alloc(mdoc, line, offs, buf+offs))