Skip to content

Commit 08e25d4

Browse files
committed
textord/cjkpitch: Fix mismatch between format string and argument
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]>
1 parent 2cc7839 commit 08e25d4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/textord/cjkpitch.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -682,8 +682,8 @@ void FPRow::DebugOutputResult(int row_index) {
682682
real_row_->space_size, real_row_->space_threshold,
683683
real_row_->xheight);
684684

685-
for (size_t i = 0; i < num_chars(); i++) {
686-
tprintf("Char %d: is_final=%d is_good=%d num_blobs=%d: ",
685+
for (unsigned i = 0; i < num_chars(); i++) {
686+
tprintf("Char %u: is_final=%d is_good=%d num_blobs=%d: ",
687687
i, is_final(i), is_good(i), character(i)->num_blobs());
688688
box(i).print();
689689
}
@@ -1078,7 +1078,7 @@ void compute_fixed_pitch_cjk(ICOORD page_tr,
10781078
return;
10791079
}
10801080

1081-
size_t iteration = 0;
1081+
unsigned iteration = 0;
10821082
do {
10831083
analyzer.MergeFragments();
10841084
analyzer.FinalizeLargeChars();
@@ -1087,7 +1087,7 @@ void compute_fixed_pitch_cjk(ICOORD page_tr,
10871087
} while (analyzer.Pass2Analyze() && iteration < analyzer.max_iteration());
10881088

10891089
if (textord_debug_pitch_test) {
1090-
tprintf("compute_fixed_pitch_cjk finished after %d iteration (limit=%d)\n",
1090+
tprintf("compute_fixed_pitch_cjk finished after %u iteration (limit=%u)\n",
10911091
iteration, analyzer.max_iteration());
10921092
}
10931093

0 commit comments

Comments
 (0)