aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term_ps.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-07-21 08:24:39 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-07-21 08:24:39 +0000
commit8b85d55ace96243bd451848b3954a433f584c00c (patch)
tree30255cbf855362e22550c3aedc841bd5ee888f4c /term_ps.c
parent28f89d13b7d6b04d99517c6e31655ddfbd3ea541 (diff)
downloadmandoc-8b85d55ace96243bd451848b3954a433f584c00c.tar.gz
mandoc-8b85d55ace96243bd451848b3954a433f584c00c.tar.zst
mandoc-8b85d55ace96243bd451848b3954a433f584c00c.zip
The "wx" value is quite small, so use a u_short instead of a size_t.
Diffstat (limited to 'term_ps.c')
-rw-r--r--term_ps.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/term_ps.c b/term_ps.c
index 5f68507b..b28f711e 100644
--- a/term_ps.c
+++ b/term_ps.c
@@ -1,4 +1,4 @@
-/* $Id: term_ps.c,v 1.35 2010/07/20 10:56:03 kristaps Exp $ */
+/* $Id: term_ps.c,v 1.36 2010/07/21 08:24:39 kristaps Exp $ */
/*
* Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -42,7 +42,7 @@
((double)(x) / (1000.0 / (double)(p)->engine.ps.scale))
struct glyph {
- size_t wx; /* WX in AFM */
+ unsigned short wx; /* WX in AFM */
};
struct font {
@@ -708,13 +708,13 @@ ps_pletter(struct termp *p, int c)
if (c <= 32 || (c - 32 > MAXCHAR)) {
ps_putchar(p, ' ');
- p->engine.ps.pscol += fonts[f].gly[0].wx;
+ p->engine.ps.pscol += (size_t)fonts[f].gly[0].wx;
return;
}
ps_putchar(p, (char)c);
c -= 32;
- p->engine.ps.pscol += fonts[f].gly[c].wx;
+ p->engine.ps.pscol += (size_t)fonts[f].gly[c].wx;
}
@@ -901,10 +901,10 @@ ps_width(const struct termp *p, char c)
{
if (c <= 32 || c - 32 >= MAXCHAR)
- return(fonts[(int)TERMFONT_NONE].gly[0].wx);
+ return((size_t)fonts[(int)TERMFONT_NONE].gly[0].wx);
c -= 32;
- return(fonts[(int)TERMFONT_NONE].gly[(int)c].wx);
+ return((size_t)fonts[(int)TERMFONT_NONE].gly[(int)c].wx);
}
@@ -932,14 +932,14 @@ ps_hspan(const struct termp *p, const struct roffsu *su)
r = PNT2AFM(p, su->scale * 100);
break;
case (SCALE_EM):
- r = su->scale *
+ r = su->scale *
fonts[(int)TERMFONT_NONE].gly[109 - 32].wx;
break;
case (SCALE_MM):
r = PNT2AFM(p, su->scale * 2.834);
break;
case (SCALE_EN):
- r = su->scale *
+ r = su->scale *
fonts[(int)TERMFONT_NONE].gly[110 - 32].wx;
break;
case (SCALE_VS):