diff options
author | Bruce Dawson <brucedawson@google.com> | 2014-11-18 09:55:38 -0800 |
---|---|---|
committer | Bruce Dawson <brucedawson@google.com> | 2014-11-18 09:55:38 -0800 |
commit | f4aceedd4da965e62df5340a8f06c36d5fc3bbc1 (patch) | |
tree | 6340f0254148444f316bb2cc8267d45f48abe3aa /samples | |
parent | cf19caadfa3e7e01d3412d83540e8492b52b31d7 (diff) | |
download | pdfium-f4aceedd4da965e62df5340a8f06c36d5fc3bbc1.tar.xz |
Fixing format strings to remove 'z' size specifier.
As of the 2013 version VC++ still doesn't support the 'z' size specifier. This makes portable printing of size_t types frustrating. The simplest general solution is to use %u and cast to unsigned. If there was any possibility of the numbers getting larger than 32-bit then we would need better alternatives, but there is not.
This was found through code inspection, through /analyze, and through pdfium_test print this non-helpful message:
Loaded, parsed and rendered zu pages.
Skipped zu bad pages.
I can confirm that the fix works on Windows and it should work identically on mac. This is a follow-on to change 02e6ca4c4f.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/738433003
Diffstat (limited to 'samples')
-rw-r--r-- | samples/pdfium_test.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc index 96788e0aef..3a6cdfa69e 100644 --- a/samples/pdfium_test.cc +++ b/samples/pdfium_test.cc @@ -16,6 +16,7 @@ #include "../fpdfsdk/include/fpdfformfill.h" #include "../fpdfsdk/include/fpdftext.h" #include "../fpdfsdk/include/fpdfview.h" +#include "../core/include/fxcrt/fx_system.h" #include "v8/include/v8.h" #ifdef _WIN32 @@ -359,8 +360,8 @@ void RenderPdf(const char* name, const char* pBuf, size_t len, FPDF_CloseDocument(doc); FPDFAvail_Destroy(pdf_avail); - printf("Loaded, parsed and rendered %zu pages.\n", rendered_pages); - printf("Skipped %zu bad pages.\n", bad_pages); + printf("Loaded, parsed and rendered %" PRIuS " pages.\n", rendered_pages); + printf("Skipped %" PRIuS " bad pages.\n", bad_pages); } int main(int argc, const char* argv[]) { |