From 25b979f243f0cd074dcfb91d0ecb7b3a2e07694b Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 20 Mar 2015 18:59:27 +0000 Subject: Update our printf to cope with various useful extensions. Ensure that %010d works. Ensure that we can output 64 bit values (%ll{d,u,x}). Ensure that we can output size_t and fz_off_t (%z{d,u,x} and %Z{d,u,x}). fz_off_t isn't defined yet (it will be introduced by a commit that depends on this one), so for now, we put a stub definition in printf.c that we will remove later. --- source/pdf/pdf-write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/pdf') diff --git a/source/pdf/pdf-write.c b/source/pdf/pdf-write.c index 5f815e03..358deb7e 100644 --- a/source/pdf/pdf-write.c +++ b/source/pdf/pdf-write.c @@ -1788,9 +1788,9 @@ static void writexrefsubsect(pdf_write_options *opts, int from, int to) for (num = from; num < to; num++) { if (opts->use_list[num]) - fprintf(opts->out, "%010d %05d n \n", opts->ofs_list[num], opts->gen_list[num]); + fprintf(opts->out, "%010Zd %05d n \n", opts->ofs_list[num], opts->gen_list[num]); else - fprintf(opts->out, "%010d %05d f \n", opts->ofs_list[num], opts->gen_list[num]); + fprintf(opts->out, "%010Zd %05d f \n", opts->ofs_list[num], opts->gen_list[num]); } } @@ -2011,7 +2011,7 @@ static void writexrefstream(fz_context *ctx, pdf_document *doc, pdf_write_option pdf_update_stream(ctx, doc, dict, fzbuf, 0); writeobject(ctx, doc, opts, num, 0, 0); - fprintf(opts->out, "startxref\n%d\n%%%%EOF\n", startxref); + fprintf(opts->out, "startxref\n%Zd\n%%%%EOF\n", startxref); } fz_always(ctx) { -- cgit v1.2.3