aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit75b610f7273e99110015abd22311fcb909e0abd3 (patch)
tree1171b69288b6d8040fd7f78f35d9b239237219b3 /eqn.c
parentb862a185d00afc5c08a5353e6bc4633818b058cc (diff)
downloadmandoc-75b610f7273e99110015abd22311fcb909e0abd3.tar.gz
mandoc-75b610f7273e99110015abd22311fcb909e0abd3.tar.zst
mandoc-75b610f7273e99110015abd22311fcb909e0abd3.zip
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.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/eqn.c b/eqn.c
index e36df60a..31e674d0 100644
--- a/eqn.c
+++ b/eqn.c
@@ -1,4 +1,4 @@
-/* $Id: eqn.c,v 1.54 2014/10/16 01:11:20 schwarze Exp $ */
+/* $Id: eqn.c,v 1.55 2014/10/25 14:35:37 schwarze Exp $ */
/*
* Copyright (c) 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);