=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc.c,v retrieving revision 1.36 retrieving revision 1.37 diff -c -r1.36 -r1.37 *** src/usr.bin/mandoc/mdoc.c 2010/03/25 02:02:28 1.36 --- src/usr.bin/mandoc/mdoc.c 2010/04/02 12:39:47 1.37 *************** *** 1,4 **** ! /* $Id: mdoc.c,v 1.36 2010/03/25 02:02:28 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: mdoc.c,v 1.37 2010/04/02 12:39:47 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * *************** *** 139,145 **** static void mdoc_free1(struct mdoc *); static void mdoc_alloc1(struct mdoc *); static struct mdoc_node *node_alloc(struct mdoc *, int, int, ! int, enum mdoc_type); static int node_append(struct mdoc *, struct mdoc_node *); static int parsetext(struct mdoc *, int, char *); --- 139,145 ---- static void mdoc_free1(struct mdoc *); 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 int parsetext(struct mdoc *, int, char *); *************** *** 337,345 **** int ! mdoc_macro(struct mdoc *m, int tok, int ln, int pp, int *pos, char *buf) { /* * If we're in the prologue, deny "body" macros. Similarly, if * we're in the body, deny prologue calls. --- 337,347 ---- int ! mdoc_macro(struct mdoc *m, enum mdoct tok, int ln, int pp, int *pos, char *buf) { + + assert(tok < MDOC_MAX); /* * If we're in the prologue, deny "body" macros. Similarly, if * we're in the body, deny prologue calls. *************** *** 420,427 **** static struct mdoc_node * ! node_alloc(struct mdoc *m, int line, ! int pos, int tok, enum mdoc_type type) { struct mdoc_node *p; --- 422,429 ---- static struct mdoc_node * ! node_alloc(struct mdoc *m, int line, int pos, ! enum mdoct tok, enum mdoc_type type) { struct mdoc_node *p; *************** *** 430,444 **** p->line = line; p->pos = pos; p->tok = tok; ! if (MDOC_TEXT != (p->type = type)) ! assert(p->tok >= 0); return(p); } int ! mdoc_tail_alloc(struct mdoc *m, int line, int pos, int tok) { struct mdoc_node *p; --- 432,445 ---- p->line = line; p->pos = pos; p->tok = tok; ! p->type = type; return(p); } int ! mdoc_tail_alloc(struct mdoc *m, int line, int pos, enum mdoct tok) { struct mdoc_node *p; *************** *** 451,457 **** int ! mdoc_head_alloc(struct mdoc *m, int line, int pos, int tok) { struct mdoc_node *p; --- 452,458 ---- int ! mdoc_head_alloc(struct mdoc *m, int line, int pos, enum mdoct tok) { struct mdoc_node *p; *************** *** 467,473 **** int ! mdoc_body_alloc(struct mdoc *m, int line, int pos, int tok) { struct mdoc_node *p; --- 468,474 ---- int ! mdoc_body_alloc(struct mdoc *m, int line, int pos, enum mdoct tok) { struct mdoc_node *p; *************** *** 481,487 **** int mdoc_block_alloc(struct mdoc *m, int line, int pos, ! int tok, struct mdoc_arg *args) { struct mdoc_node *p; --- 482,488 ---- int mdoc_block_alloc(struct mdoc *m, int line, int pos, ! enum mdoct tok, struct mdoc_arg *args) { struct mdoc_node *p; *************** *** 498,504 **** int mdoc_elem_alloc(struct mdoc *m, int line, int pos, ! int tok, struct mdoc_arg *args) { struct mdoc_node *p; --- 499,505 ---- int mdoc_elem_alloc(struct mdoc *m, int line, int pos, ! enum mdoct tok, struct mdoc_arg *args) { struct mdoc_node *p;