source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Fixed mingw compatibility where the "z" printf() modifier isn't
Date: Tue, 16 Aug 2011 08:23:51 -0400 (EDT)	[thread overview]
Message-ID: <201108161223.p7GCNpZV028493@krisdoz.my.domain> (raw)

Log Message:
-----------
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.

Modified Files:
--------------
    mdocml:
        mdoc_validate.c
        term_ps.c

Revision Data
-------------
Index: mdoc_validate.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v
retrieving revision 1.173
retrieving revision 1.174
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.173 -r1.174
--- mdoc_validate.c
+++ mdoc_validate.c
@@ -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.
Index: term_ps.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term_ps.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -Lterm_ps.c -Lterm_ps.c -u -p -r1.51 -r1.52
--- term_ps.c
+++ term_ps.c
@@ -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);
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2011-08-16 12:23 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=201108161223.p7GCNpZV028493@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).