aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term_ps.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-08-16 12:23:51 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-08-16 12:23:51 +0000
commit50efd1a131ba6735764a598cbd4df530c5412ba2 (patch)
tree5f76c6e0781c94f9a159bb1c0d7c4d7e98b04712 /term_ps.c
parent02fb47bad2bdd5a32792cbfcbd3f5133b723d322 (diff)
downloadmandoc-50efd1a131ba6735764a598cbd4df530c5412ba2.tar.gz
mandoc-50efd1a131ba6735764a598cbd4df530c5412ba2.tar.zst
mandoc-50efd1a131ba6735764a598cbd4df530c5412ba2.zip
Fixed mingw compatibility where the "z" printf() modifier isn't
recognised. It's easier to make these u_int than to jump through hoops for a special formatter.
Diffstat (limited to 'term_ps.c')
-rw-r--r--term_ps.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/term_ps.c b/term_ps.c
index 44e492a2..f3ab1b4c 100644
--- a/term_ps.c
+++ b/term_ps.c
@@ -1,4 +1,4 @@
-/* $Id: term_ps.c,v 1.51 2011/05/17 14:38:34 kristaps Exp $ */
+/* $Id: term_ps.c,v 1.52 2011/08/16 12:23:51 kristaps Exp $ */
/*
* Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -429,7 +429,8 @@ static struct termp *
pspdf_alloc(char *outopts)
{
struct termp *p;
- size_t pagex, pagey, marginx, marginy, lineheight;
+ unsigned int pagex, pagey;
+ size_t marginx, marginy, lineheight;
const char *toks[2];
const char *pp;
char *v;
@@ -485,7 +486,7 @@ pspdf_alloc(char *outopts)
} else if (0 == strcasecmp(pp, "legal")) {
pagex = 216;
pagey = 356;
- } else if (2 != sscanf(pp, "%zux%zu", &pagex, &pagey))
+ } else if (2 != sscanf(pp, "%ux%u", &pagex, &pagey))
fprintf(stderr, "%s: Unknown paper\n", pp);
} else if (NULL == pp)
pp = "letter";
@@ -513,8 +514,8 @@ pspdf_alloc(char *outopts)
lineheight = PNT2AFM(p, ((double)p->ps->scale * 1.4));
- p->ps->width = pagex;
- p->ps->height = pagey;
+ p->ps->width = (size_t)pagex;
+ p->ps->height = (size_t)pagey;
p->ps->header = pagey - (marginy / 2) - (lineheight / 2);
p->ps->top = pagey - marginy;
p->ps->footer = (marginy / 2) - (lineheight / 2);