From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Remove "pt" from struct roffsu, as CSS (the only reason it was
Date: Fri, 25 Jun 2010 15:50:23 -0400 (EDT) [thread overview]
Message-ID: <201006251950.o5PJoNC9011154@krisdoz.my.domain> (raw)
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
reply other threads:[~2010-06-25 19:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201006251950.o5PJoNC9011154@krisdoz.my.domain \
--to=kristaps@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).