* mdocml: Remove "pt" from struct roffsu, as CSS (the only reason it was
@ 2010-06-25 19:50 kristaps
0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-06-25 19:50 UTC (permalink / raw)
To: source
Log Message:
-----------
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.
Modified Files:
--------------
mdocml:
html.c
out.c
out.h
term_ascii.c
term_ps.c
Revision Data
-------------
Index: out.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/out.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -Lout.c -Lout.c -u -p -r1.16 -r1.17
--- out.c
+++ out.c
@@ -139,8 +139,6 @@ a2roffsu(const char *src, struct roffsu
if ((dst->scale = atof(buf)) < 0)
dst->scale = 0;
dst->unit = unit;
- dst->pt = hasd;
-
return(1);
}
Index: term_ascii.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term_ascii.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -Lterm_ascii.c -Lterm_ascii.c -u -p -r1.5 -r1.6
--- term_ascii.c
+++ term_ascii.c
@@ -79,6 +79,7 @@ ascii_alloc(char *outopts)
}
+/* ARGSUSED */
static size_t
ascii_width(const struct termp *p, char c)
{
Index: html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -Lhtml.c -Lhtml.c -u -p -r1.102 -r1.103
--- html.c
+++ html.c
@@ -718,11 +718,11 @@ bufcat_su(struct html *h, const char *p,
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);
}
Index: out.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/out.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -Lout.h -Lout.h -u -p -r1.11 -r1.12
--- out.h
+++ out.h
@@ -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 *,
Index: term_ps.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term_ps.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -Lterm_ps.c -Lterm_ps.c -u -p -r1.11 -r1.12
--- term_ps.c
+++ term_ps.c
@@ -431,6 +431,7 @@ ps_setfont(struct termp *p, enum termfon
}
+/* ARGSUSED */
static size_t
ps_width(const struct termp *p, char c)
{
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-06-25 19:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-25 19:50 mdocml: Remove "pt" from struct roffsu, as CSS (the only reason it was kristaps
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).