summaryrefslogtreecommitdiffstats
path: root/eqn.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-10-25 14:35:37 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-10-25 14:35:37 +0000
commit7b96ff8a068bfd465f5368284af0ef9bdd35797a (patch)
tree564893946a11db66d93277f3c1cf4d62ba6d5a2d /eqn.c
parentdd148a56f3f3e29132148b8f2bace859b7590d34 (diff)
downloadmandoc-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.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/eqn.c b/eqn.c
index 19bd6910..2e77c484 100644
--- a/eqn.c
+++ b/eqn.c
@@ -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);