diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-10-25 14:35:37 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-10-25 14:35:37 +0000 |
commit | 7b96ff8a068bfd465f5368284af0ef9bdd35797a (patch) | |
tree | 564893946a11db66d93277f3c1cf4d62ba6d5a2d /eqn.c | |
parent | dd148a56f3f3e29132148b8f2bace859b7590d34 (diff) | |
download | mandoc-7b96ff8a068bfd465f5368284af0ef9bdd35797a.tar.gz |
Report arguments to .EQ as an error, and simplify the code:
* drop trivial wrapper function roff_openeqn()
* drop unused first arg of function eqn_alloc()
* drop usused member "name" of struct eqn_node
While here, sync to OpenBSD by killing some trailing blanks.
Diffstat (limited to 'eqn.c')
-rw-r--r-- | eqn.c | 17 |
1 files changed, 1 insertions, 16 deletions
@@ -36,8 +36,6 @@ #define EQN_NEST_MAX 128 /* maximum nesting of defines */ #define STRNEQ(p1, sz1, p2, sz2) \ ((sz1) == (sz2) && 0 == strncmp((p1), (p2), (sz1))) -#define EQNSTREQ(x, p, sz) \ - STRNEQ((x)->name, (x)->sz, (p), (sz)) enum eqn_tok { EQN_TOK_DYAD = 0, @@ -315,24 +313,12 @@ eqn_read(struct eqn_node **epp, int ln, } struct eqn_node * -eqn_alloc(const char *name, int pos, int line, struct mparse *parse) +eqn_alloc(int pos, int line, struct mparse *parse) { struct eqn_node *p; - size_t sz; - const char *end; p = mandoc_calloc(1, sizeof(struct eqn_node)); - if (name && '\0' != *name) { - sz = strlen(name); - assert(sz); - do { - sz--; - end = name + (int)sz; - } while (' ' == *end || '\t' == *end); - p->eqn.name = mandoc_strndup(name, sz + 1); - } - p->parse = parse; p->eqn.ln = line; p->eqn.pos = pos; @@ -1108,7 +1094,6 @@ eqn_free(struct eqn_node *p) free(p->defs[i].val); } - free(p->eqn.name); free(p->data); free(p->defs); free(p); |