Skip to content

Commit

Permalink
textord/cjkpitch: Fix mismatch between format string and argument
Browse files Browse the repository at this point in the history
size_t would require a different format string. Here an unsigned int
is sufficient in both cases, so use that.

This error was found by lgtm, see
https://lgtm.com/projects/g/tesseract-ocr/tesseract/.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Sep 3, 2018
1 parent 2cc7839 commit 08e25d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/textord/cjkpitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,8 @@ void FPRow::DebugOutputResult(int row_index) {
real_row_->space_size, real_row_->space_threshold,
real_row_->xheight);

for (size_t i = 0; i < num_chars(); i++) {
tprintf("Char %d: is_final=%d is_good=%d num_blobs=%d: ",
for (unsigned i = 0; i < num_chars(); i++) {
tprintf("Char %u: is_final=%d is_good=%d num_blobs=%d: ",
i, is_final(i), is_good(i), character(i)->num_blobs());
box(i).print();
}
Expand Down Expand Up @@ -1078,7 +1078,7 @@ void compute_fixed_pitch_cjk(ICOORD page_tr,
return;
}

size_t iteration = 0;
unsigned iteration = 0;
do {
analyzer.MergeFragments();
analyzer.FinalizeLargeChars();
Expand All @@ -1087,7 +1087,7 @@ void compute_fixed_pitch_cjk(ICOORD page_tr,
} while (analyzer.Pass2Analyze() && iteration < analyzer.max_iteration());

if (textord_debug_pitch_test) {
tprintf("compute_fixed_pitch_cjk finished after %d iteration (limit=%d)\n",
tprintf("compute_fixed_pitch_cjk finished after %u iteration (limit=%u)\n",
iteration, analyzer.max_iteration());
}

Expand Down

0 comments on commit 08e25d4

Please sign in to comment.