diff options
-rw-r--r-- | html.c | 12 | ||||
-rw-r--r-- | out.c | 4 | ||||
-rw-r--r-- | out.h | 9 | ||||
-rw-r--r-- | term_ascii.c | 3 | ||||
-rw-r--r-- | term_ps.c | 3 |
5 files changed, 14 insertions, 17 deletions
@@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.102 2010/06/19 20:46:27 kristaps Exp $ */ +/* $Id: html.c,v 1.103 2010/06/25 19:50:23 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -718,11 +718,11 @@ bufcat_su(struct html *h, const char *p, const struct roffsu *su) break; } - if (su->pt) - buffmt(h, "%s: %f%s;", p, v, u); - else - /* LINTED */ - buffmt(h, "%s: %d%s;", p, (int)v, u); + /* + * XXX: the CSS spec isn't clear as to which types accept + * integer or real numbers, so we just make them all decimals. + */ + buffmt(h, "%s: %.2f%s;", p, v, u); } @@ -1,4 +1,4 @@ -/* $Id: out.c,v 1.16 2010/06/19 20:46:28 kristaps Exp $ */ +/* $Id: out.c,v 1.17 2010/06/25 19:50:23 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -139,8 +139,6 @@ a2roffsu(const char *src, struct roffsu *dst, enum roffscale def) if ((dst->scale = atof(buf)) < 0) dst->scale = 0; dst->unit = unit; - dst->pt = hasd; - return(1); } @@ -1,4 +1,4 @@ -/* $Id: out.h,v 1.11 2010/06/19 20:46:28 kristaps Exp $ */ +/* $Id: out.h,v 1.12 2010/06/25 19:50:23 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -53,7 +53,6 @@ enum roffdeco { struct roffsu { enum roffscale unit; double scale; - int pt; }; #define SCALE_INVERT(p) \ @@ -62,14 +61,12 @@ struct roffsu { #define SCALE_VS_INIT(p, v) \ do { (p)->unit = SCALE_VS; \ - (p)->scale = (v); \ - (p)->pt = 0; } \ + (p)->scale = (v); } \ while (/* CONSTCOND */ 0) #define SCALE_HS_INIT(p, v) \ do { (p)->unit = SCALE_BU; \ - (p)->scale = (v); \ - (p)->pt = 0; } \ + (p)->scale = (v); } \ while (/* CONSTCOND */ 0) int a2roffsu(const char *, diff --git a/term_ascii.c b/term_ascii.c index 5dbb196c..3ab625a2 100644 --- a/term_ascii.c +++ b/term_ascii.c @@ -1,4 +1,4 @@ -/* $Id: term_ascii.c,v 1.5 2010/06/25 18:53:14 kristaps Exp $ */ +/* $Id: term_ascii.c,v 1.6 2010/06/25 19:50:23 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -79,6 +79,7 @@ ascii_alloc(char *outopts) } +/* ARGSUSED */ static size_t ascii_width(const struct termp *p, char c) { @@ -1,4 +1,4 @@ -/* $Id: term_ps.c,v 1.11 2010/06/25 18:53:14 kristaps Exp $ */ +/* $Id: term_ps.c,v 1.12 2010/06/25 19:50:23 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -431,6 +431,7 @@ ps_setfont(struct termp *p, enum termfont f) } +/* ARGSUSED */ static size_t ps_width(const struct termp *p, char c) { |