From 209c1df599f18477a0afc827ab7846bae1653bbe Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Fri, 8 Jan 2021 18:49:21 +0100 Subject: [PATCH] Fix some format strings Signed-off-by: Stefan Weil --- src/ccstruct/werd.cpp | 2 +- src/ccutil/tessdatamanager.cpp | 4 ++-- src/classify/shapetable.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ccstruct/werd.cpp b/src/ccstruct/werd.cpp index 353f7e7b..d56ce961 100644 --- a/src/ccstruct/werd.cpp +++ b/src/ccstruct/werd.cpp @@ -257,7 +257,7 @@ void WERD::copy_on(WERD* other) { void WERD::print() { tprintf("Blanks= %d\n", blanks); bounding_box().print(); - tprintf("Flags = %d = 0%o\n", flags.to_ulong(), flags.to_ulong()); + tprintf("Flags = %lu = 0%lo\n", flags.to_ulong(), flags.to_ulong()); tprintf(" W_SEGMENTED = %s\n", flags[W_SEGMENTED] ? "TRUE" : "FALSE"); tprintf(" W_ITALIC = %s\n", flags[W_ITALIC] ? "TRUE" : "FALSE"); tprintf(" W_BOL = %s\n", flags[W_BOL] ? "TRUE" : "FALSE"); diff --git a/src/ccutil/tessdatamanager.cpp b/src/ccutil/tessdatamanager.cpp index f8c40c78..4adf113e 100644 --- a/src/ccutil/tessdatamanager.cpp +++ b/src/ccutil/tessdatamanager.cpp @@ -197,10 +197,10 @@ void TessdataManager::Clear() { // Prints a directory of contents. void TessdataManager::Directory() const { tprintf("Version string:%s\n", VersionString().c_str()); - int offset = TESSDATA_NUM_ENTRIES * sizeof(int64_t); + auto offset = TESSDATA_NUM_ENTRIES * sizeof(int64_t); for (unsigned i = 0; i < TESSDATA_NUM_ENTRIES; ++i) { if (!entries_[i].empty()) { - tprintf("%d:%s:size=%d, offset=%d\n", i, kTessdataFileSuffixes[i], + tprintf("%u:%s:size=%zu, offset=%zu\n", i, kTessdataFileSuffixes[i], entries_[i].size(), offset); offset += entries_[i].size(); } diff --git a/src/classify/shapetable.h b/src/classify/shapetable.h index 8ff62a1d..5a551401 100644 --- a/src/classify/shapetable.h +++ b/src/classify/shapetable.h @@ -46,8 +46,8 @@ struct UnicharRating { // Print debug info. void Print() const { - tprintf("Unichar-id=%d, rating=%g, adapted=%d, config=%d, misses=%d," - " %d fonts\n", unichar_id, rating, adapted, config, feature_misses, + tprintf("Unichar-id=%d, rating=%g, adapted=%d, config=%d, misses=%u," + " %zu fonts\n", unichar_id, rating, adapted, config, feature_misses, fonts.size()); }