diff options
-rw-r--r-- | mdoc.h | 61 | ||||
-rw-r--r-- | mdoc_argv.c | 6 | ||||
-rw-r--r-- | mdoc_validate.c | 4 |
3 files changed, 37 insertions, 34 deletions
@@ -155,35 +155,36 @@ enum mdoct { /* What follows is a list of ALL possible macro arguments. */ -/* FIXME: make this into an enum. */ -#define MDOC_Split 0 -#define MDOC_Nosplit 1 -#define MDOC_Ragged 2 -#define MDOC_Unfilled 3 -#define MDOC_Literal 4 -#define MDOC_File 5 -#define MDOC_Offset 6 -#define MDOC_Bullet 7 -#define MDOC_Dash 8 -#define MDOC_Hyphen 9 -#define MDOC_Item 10 -#define MDOC_Enum 11 -#define MDOC_Tag 12 -#define MDOC_Diag 13 -#define MDOC_Hang 14 -#define MDOC_Ohang 15 -#define MDOC_Inset 16 -#define MDOC_Column 17 -#define MDOC_Width 18 -#define MDOC_Compact 19 -#define MDOC_Std 20 -#define MDOC_Filled 21 -#define MDOC_Words 22 -#define MDOC_Emphasis 23 -#define MDOC_Symbolic 24 -#define MDOC_Nested 25 -#define MDOC_Centred 26 -#define MDOC_ARG_MAX 27 +enum mdocargt { + MDOC_Split, + MDOC_Nosplit, + MDOC_Ragged, + MDOC_Unfilled, + MDOC_Literal, + MDOC_File, + MDOC_Offset, + MDOC_Bullet, + MDOC_Dash, + MDOC_Hyphen, + MDOC_Item, + MDOC_Enum, + MDOC_Tag, + MDOC_Diag, + MDOC_Hang, + MDOC_Ohang, + MDOC_Inset, + MDOC_Column, + MDOC_Width, + MDOC_Compact, + MDOC_Std, + MDOC_Filled, + MDOC_Words, + MDOC_Emphasis, + MDOC_Symbolic, + MDOC_Nested, + MDOC_Centred, + MDOC_ARG_MAX +}; /* Type of a syntax node. */ enum mdoc_type { @@ -236,7 +237,7 @@ struct mdoc_meta { /* An argument to a macro (multiple values = `It -column'). */ struct mdoc_argv { - int arg; + enum mdocargt arg; int line; int pos; size_t sz; diff --git a/mdoc_argv.c b/mdoc_argv.c index 748c7d59..e24ac739 100644 --- a/mdoc_argv.c +++ b/mdoc_argv.c @@ -45,7 +45,7 @@ #define MULTI_STEP 5 -static int argv_a2arg(enum mdoct, const char *); +static enum mdocargt argv_a2arg(enum mdoct, const char *); static enum margserr args(struct mdoc *, int, int *, char *, int, char **); static int argv(struct mdoc *, int, @@ -313,7 +313,7 @@ mdoc_argv_free(struct mdoc_arg *p) void mdoc_argn_free(struct mdoc_arg *p, int iarg) { - struct mdoc_argv *arg = &p->argv[iarg]; + struct mdoc_argv *arg = &p->argv[iarg]; /* FIXME: decl/assign */ int j; if (arg->sz && arg->value) { @@ -583,7 +583,7 @@ args(struct mdoc *m, int line, int *pos, } -static int +static enum mdocargt argv_a2arg(enum mdoct tok, const char *p) { diff --git a/mdoc_validate.c b/mdoc_validate.c index cc00a1ae..958399af 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -624,6 +624,8 @@ pre_bl(PRE_ARGS) if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_IGNARGV)) return(0); break; + default: + continue; } /* Check: duplicate auxiliary arguments. */ @@ -946,7 +948,7 @@ static int post_bf(POST_ARGS) { struct mdoc_node *np; - int arg; + enum mdocargt arg; /* * Unlike other data pointers, these are "housed" by the HEAD |