From cd946dc30d695997c6bac60e8912bfbb283ca01e Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 5 Nov 2015 06:29:47 +0100 Subject: [PATCH] api: Fix printing of a size_t value size_t is not always the same as long, especially not for 64 bit Windows: api/pdfrenderer.cpp:549:31: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t {aka long long unsigned int}' [-Wformat=] size_t normally requires a format string "%zu", but this is unsupported by Visual Studio, so use a type cast. Signed-off-by: Stefan Weil --- api/pdfrenderer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/pdfrenderer.cpp b/api/pdfrenderer.cpp index 4f6afbe3..30c0b2ba 100644 --- a/api/pdfrenderer.cpp +++ b/api/pdfrenderer.cpp @@ -544,9 +544,9 @@ bool TessPDFRenderer::BeginDocumentHandler() { n = snprintf(buf, sizeof(buf), "5 0 obj\n" "<<\n" - " /Length %ld /Filter /FlateDecode\n" + " /Length %lu /Filter /FlateDecode\n" ">>\n" - "stream\n", len); + "stream\n", (unsigned long)len); if (n >= sizeof(buf)) { lept_free(comp); return false;