summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-03-24 03:46:02 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-03-24 03:46:02 +0000
commit0cbe61642c46c73e81d998bc81f574b30674e3cb (patch)
treee818613aa743a9450108453106b2ef21835b5de4
parent34499b8564d56a778ba364385e208a4f51fe3e04 (diff)
downloadmandoc-0cbe61642c46c73e81d998bc81f574b30674e3cb.tar.gz
mandoc-0cbe61642c46c73e81d998bc81f574b30674e3cb.tar.zst
mandoc-0cbe61642c46c73e81d998bc81f574b30674e3cb.zip
enum-ised rew_* return values (type-safety).
Removed ignoring of MAN_Vb argument (symmetry). Removed superfluous utsname inclusion.
-rw-r--r--man_action.c4
-rw-r--r--man_macro.c27
2 files changed, 13 insertions, 18 deletions
diff --git a/man_action.c b/man_action.c
index 7e3cde24..c4a8cd4c 100644
--- a/man_action.c
+++ b/man_action.c
@@ -1,4 +1,4 @@
-/* $Id: man_action.c,v 1.27 2010/03/23 11:30:48 kristaps Exp $ */
+/* $Id: man_action.c,v 1.28 2010/03/24 03:46:02 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -18,8 +18,6 @@
#include "config.h"
#endif
-#include <sys/utsname.h>
-
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/man_macro.c b/man_macro.c
index d67fdb3f..70c1ab55 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -1,4 +1,4 @@
-/* $Id: man_macro.c,v 1.33 2010/03/23 21:50:43 kristaps Exp $ */
+/* $Id: man_macro.c,v 1.34 2010/03/24 03:46:02 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -25,9 +25,11 @@
#include "libman.h"
-#define REW_REWIND (0) /* See rew_scope(). */
-#define REW_NOHALT (1) /* See rew_scope(). */
-#define REW_HALT (2) /* See rew_scope(). */
+enum rew {
+ REW_REWIND,
+ REW_NOHALT,
+ REW_HALT,
+};
static int in_line_eoln(MACRO_PROT_ARGS);
static int blk_imp(MACRO_PROT_ARGS);
@@ -35,9 +37,9 @@ static int blk_close(MACRO_PROT_ARGS);
static int rew_scope(enum man_type,
struct man *, enum mant);
-static int rew_dohalt(enum mant, enum man_type,
+static enum rew rew_dohalt(enum mant, enum man_type,
const struct man_node *);
-static int rew_block(enum mant, enum man_type,
+static enum rew rew_block(enum mant, enum man_type,
const struct man_node *);
const struct man_macro __man_macros[MAN_MAX] = {
@@ -104,7 +106,7 @@ man_unscope(struct man *m, const struct man_node *n)
}
-static int
+static enum rew
rew_block(enum mant ntok, enum man_type type, const struct man_node *n)
{
@@ -120,10 +122,10 @@ rew_block(enum mant ntok, enum man_type type, const struct man_node *n)
* section (all less sections), and scoped to subsections (all less
* sections and subsections).
*/
-static int
+static enum rew
rew_dohalt(enum mant tok, enum man_type type, const struct man_node *n)
{
- int c;
+ enum rew c;
if (MAN_ROOT == n->type)
return(REW_HALT);
@@ -179,7 +181,7 @@ static int
rew_scope(enum man_type type, struct man *m, enum mant tok)
{
struct man_node *n;
- int c;
+ enum rew c;
/* LINTED */
for (n = m->last; n; n = n->parent) {
@@ -319,11 +321,6 @@ in_line_eoln(MACRO_PROT_ARGS)
return(0);
if (0 == w)
break;
-
- /* XXX ignore Vb arguments for now */
- if (MAN_Vb == tok)
- continue;
-
if ( ! man_word_alloc(m, line, la, p))
return(0);
}