From c4585f51e1879dba09462098517aec738f246342 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Tue, 8 Feb 2011 07:40:23 +0000 Subject: Put tbl_alloc function right into the addspan() one, as this is the only place that it's called. --- man.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'man.c') diff --git a/man.c b/man.c index 1a6807ef..3a217af3 100644 --- a/man.c +++ b/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.99 2011/02/06 22:05:20 kristaps Exp $ */ +/* $Id: man.c,v 1.100 2011/02/08 07:40:23 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -48,8 +48,6 @@ static struct man_node *man_node_alloc(struct man *, int, int, enum man_type, enum mant); static int man_node_append(struct man *, struct man_node *); -static int man_span_alloc(struct man *, - const struct tbl_span *); static void man_node_free(struct man_node *); static void man_node_unlink(struct man *, struct man_node *); @@ -300,21 +298,6 @@ man_block_alloc(struct man *m, int line, int pos, enum mant tok) return(1); } -static int -man_span_alloc(struct man *m, const struct tbl_span *span) -{ - struct man_node *n; - - n = man_node_alloc(m, span->line, 0, MAN_TBL, MAN_MAX); - n->span = span; - - if ( ! man_node_append(m, n)) - return(0); - - m->next = MAN_NEXT_SIBLING; - return(1); -} - int man_word_alloc(struct man *m, int line, int pos, const char *word) { @@ -367,10 +350,17 @@ man_node_delete(struct man *m, struct man_node *p) int man_addspan(struct man *m, const struct tbl_span *sp) { + struct man_node *n; assert( ! (MAN_HALT & m->flags)); - if ( ! man_span_alloc(m, sp)) + + n = man_node_alloc(m, sp->line, 0, MAN_TBL, MAN_MAX); + n->span = sp; + + if ( ! man_node_append(m, n)) return(0); + + m->next = MAN_NEXT_SIBLING; return(man_descope(m, sp->line, 0)); } -- cgit v1.2.3