diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-08-16 12:23:51 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-08-16 12:23:51 +0000 |
commit | 50efd1a131ba6735764a598cbd4df530c5412ba2 (patch) | |
tree | 5f76c6e0781c94f9a159bb1c0d7c4d7e98b04712 | |
parent | 02fb47bad2bdd5a32792cbfcbd3f5133b723d322 (diff) | |
download | mandoc-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.
-rw-r--r-- | mdoc_validate.c | 6 | ||||
-rw-r--r-- | term_ps.c | 11 |
2 files changed, 9 insertions, 8 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index 580dee18..4de6d29a 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.173 2011/08/10 14:07:23 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.174 2011/08/16 12:23:51 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -1395,7 +1395,7 @@ post_bl_block_width(POST_ARGS) assert(i < (int)n->args->argc); - snprintf(buf, NUMSIZ, "%zun", width); + snprintf(buf, NUMSIZ, "%un", (unsigned int)width); free(n->args->argv[i].value[0]); n->args->argv[i].value[0] = mandoc_strdup(buf); @@ -1445,7 +1445,7 @@ post_bl_block_tag(POST_ARGS) /* Defaults to ten ens. */ - snprintf(buf, NUMSIZ, "%zun", sz); + snprintf(buf, NUMSIZ, "%un", (unsigned int)sz); /* * We have to dynamically add this to the macro's argument list. @@ -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); |