aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-07-04 21:59:30 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-07-04 21:59:30 +0000
commitc4cc3f2226e67300ea3cb40c67e4d619a5a9d45a (patch)
tree187d3a0be486e7895a24356d932133bb90e59241 /mdoc_html.c
parenta678be049e5af47b549a64dc1c273f0f0974bf0d (diff)
downloadmandoc-c4cc3f2226e67300ea3cb40c67e4d619a5a9d45a.tar.gz
mandoc-c4cc3f2226e67300ea3cb40c67e4d619a5a9d45a.tar.zst
mandoc-c4cc3f2226e67300ea3cb40c67e4d619a5a9d45a.zip
Cache column sizes and char pointer into mdoc_bl. Finally get rid of
the loops here and there to track down the MDOC_Column arguments.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index 9f63019d..d8bad8d0 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.92 2010/07/02 12:54:33 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.93 2010/07/04 21:59:30 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -1074,7 +1074,7 @@ mdoc_it_head_pre(MDOC_ARGS, enum mdoc_list type, struct roffsu *width)
static int
mdoc_it_pre(MDOC_ARGS)
{
- int i, wp, comp;
+ int i, comp;
const struct mdoc_node *bl, *nn;
struct roffsu width, offs;
enum mdoc_list type;
@@ -1116,16 +1116,6 @@ mdoc_it_pre(MDOC_ARGS)
if (bl->data.Bl->width)
a2width(bl->data.Bl->width, &width);
- wp = -1;
- for (i = 0; bl->args && i < (int)bl->args->argc; i++)
- switch (bl->args->argv[i].arg) {
- case (MDOC_Column):
- wp = i; /* Save for later. */
- break;
- default:
- break;
- }
-
/* Override width in some cases. */
switch (type) {
@@ -1149,8 +1139,8 @@ mdoc_it_pre(MDOC_ARGS)
for (i = 0; nn && nn != n; nn = nn->next)
if (MDOC_BODY == nn->type)
i++;
- if (i < (int)bl->args->argv[wp].sz)
- a2width(bl->args->argv[wp].value[i], &width);
+ if (i < (int)bl->data.Bl->ncols)
+ a2width(bl->data.Bl->cols[i], &width);
}
if (MDOC_HEAD == n->type)