From 589f74a138ab93e81b858ebb9a8218a19d5a2017 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 23 Mar 2011 12:40:04 +0000 Subject: First, make -man ARGS_EOLN et al. be an enum. Second, remove ARGS_ERROR, as it is never returned by man_args(). Then clean up invocations of man_args() to only check for ARGS_EOLN. --- man_macro.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'man_macro.c') diff --git a/man_macro.c b/man_macro.c index 273f48d0..744167bc 100644 --- a/man_macro.c +++ b/man_macro.c @@ -1,4 +1,4 @@ -/* $Id: man_macro.c,v 1.58 2011/03/22 14:33:05 kristaps Exp $ */ +/* $Id: man_macro.c,v 1.59 2011/03/23 12:40:04 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -296,7 +296,7 @@ blk_close(MACRO_PROT_ARGS) int blk_exp(MACRO_PROT_ARGS) { - int w, la; + int la; char *p; /* @@ -317,13 +317,8 @@ blk_exp(MACRO_PROT_ARGS) for (;;) { la = *pos; - w = man_args(m, line, pos, buf, &p); - - if (-1 == w) - return(0); - if (0 == w) + if (ARGS_EOLN == man_args(m, line, pos, buf, &p)) break; - if ( ! man_word_alloc(m, line, la, p)) return(0); } @@ -348,7 +343,7 @@ blk_exp(MACRO_PROT_ARGS) int blk_imp(MACRO_PROT_ARGS) { - int w, la; + int la; char *p; struct man_node *n; @@ -372,13 +367,8 @@ blk_imp(MACRO_PROT_ARGS) for (;;) { la = *pos; - w = man_args(m, line, pos, buf, &p); - - if (-1 == w) - return(0); - if (0 == w) + if (ARGS_EOLN == man_args(m, line, pos, buf, &p)) break; - if ( ! man_word_alloc(m, line, la, p)) return(0); } @@ -406,7 +396,7 @@ blk_imp(MACRO_PROT_ARGS) int in_line_eoln(MACRO_PROT_ARGS) { - int w, la; + int la; char *p; struct man_node *n; @@ -417,11 +407,7 @@ in_line_eoln(MACRO_PROT_ARGS) for (;;) { la = *pos; - w = man_args(m, line, pos, buf, &p); - - if (-1 == w) - return(0); - if (0 == w) + if (ARGS_EOLN == man_args(m, line, pos, buf, &p)) break; if ( ! man_word_alloc(m, line, la, p)) return(0); -- cgit v1.2.3