summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2010-06-27 20:28:56 +0000
committerschwarze <schwarze@openbsd.org>2010-06-27 20:28:56 +0000
commit082fae39c6c50f6399b9e4167d1e6a386bcd5504 (patch)
tree52a0f1a4a0dc4c06c2242f557c28a66c97d4eb3c
parentdont have duplicate xxx @ scsibus lines (even if commented). (diff)
downloadwireguard-openbsd-082fae39c6c50f6399b9e4167d1e6a386bcd5504.tar.xz
wireguard-openbsd-082fae39c6c50f6399b9e4167d1e6a386bcd5504.zip
Remove "pt" from struct roffsu, as CSS (the only reason it was there) is
unclear about which units accept floats/integers, which leads me to assume that it handles either and rounds as appropriate. from kristaps@
-rw-r--r--usr.bin/mandoc/html.c12
-rw-r--r--usr.bin/mandoc/out.c4
-rw-r--r--usr.bin/mandoc/out.h9
3 files changed, 10 insertions, 15 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c
index 44660aa60c0..b348afccba7 100644
--- a/usr.bin/mandoc/html.c
+++ b/usr.bin/mandoc/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.10 2010/06/08 00:11:47 schwarze Exp $ */
+/* $Id: html.c,v 1.11 2010/06/27 20:28:56 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -714,11 +714,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);
}
diff --git a/usr.bin/mandoc/out.c b/usr.bin/mandoc/out.c
index b0899288e25..f79643f6964 100644
--- a/usr.bin/mandoc/out.c
+++ b/usr.bin/mandoc/out.c
@@ -1,4 +1,4 @@
-/* $Id: out.c,v 1.4 2010/04/07 23:15:05 schwarze Exp $ */
+/* $Id: out.c,v 1.5 2010/06/27 20:28:56 schwarze Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -135,8 +135,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);
}
diff --git a/usr.bin/mandoc/out.h b/usr.bin/mandoc/out.h
index dee3d3c8017..b32f8c7a93f 100644
--- a/usr.bin/mandoc/out.h
+++ b/usr.bin/mandoc/out.h
@@ -1,4 +1,4 @@
-/* $Id: out.h,v 1.4 2010/04/07 23:15:05 schwarze Exp $ */
+/* $Id: out.h,v 1.5 2010/06/27 20:28:56 schwarze Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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 *,