Fix alerts reported by LGTM

They were caused by recent commits which replaced GenericVector by std::vector.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2021-03-16 19:01:08 +01:00
parent 8cfaf7bf64
commit 223f356027
5 changed files with 7 additions and 7 deletions

View File

@ -634,7 +634,7 @@ void Tesseract::SearchForText(const std::vector<BLOB_CHOICE_LIST *> *choices, in
if (choices_pos + length == choices_length && text_index + 1 == target_text.size()) {
// This is a complete match. If the rating is good record a new best.
if (applybox_debug > 2) {
tprintf("Complete match, rating = %g, best=%g, seglength=%d, best=%d\n",
tprintf("Complete match, rating = %g, best=%g, seglength=%zu, best=%zu\n",
rating + choice_rating, *best_rating, segmentation->size(),
best_segmentation->size());
}

View File

@ -624,8 +624,8 @@ void EquationDetect::SplitCPHor(ColPartition *part, std::vector<ColPartition *>
// Make a copy of part, and reset parts_splitted.
ColPartition *right_part = part->CopyButDontOwnBlobs();
for (auto part : *parts_splitted) {
delete part;
for (auto data : *parts_splitted) {
delete data;
}
parts_splitted->clear();

View File

@ -74,7 +74,7 @@ static bool AcceptableRowArgs(int debug_level, int min_num_rows, const char *fun
const std::vector<RowScratchRegisters> *rows, int row_start,
int row_end) {
if (row_start < 0 || row_end > rows->size() || row_start > row_end) {
tprintf("Invalid arguments rows[%d, %d) while rows is of size %d.\n", row_start, row_end,
tprintf("Invalid arguments rows[%d, %d) while rows is of size %zu.\n", row_start, row_end,
rows->size());
return false;
}
@ -877,7 +877,7 @@ struct GeometricClassifierState {
if (debug_level >= 3) {
tprintf(
"Geometry: TabStop cluster tolerance = %d; "
"%d left tabs; %d right tabs\n",
"%zu left tabs; %zu right tabs\n",
tolerance, left_tabs.size(), right_tabs.size());
}
ltr = (*r)[r_start].ri_->ltr;

View File

@ -400,7 +400,7 @@ int Dict::def_letter_is_okay(void *void_dawg_args, const UNICHARSET &unicharset,
if (dawg_debug_level >= 3) {
tprintf(
"def_letter_is_okay: current unichar=%s word_end=%d"
" num active dawgs=%d\n",
" num active dawgs=%zu\n",
getUnicharset().debug_str(unichar_id).c_str(), word_end, dawg_args->active_dawgs->size());
}

View File

@ -629,7 +629,7 @@ bool BaselineBlock::ComputeLineSpacing() {
}
}
if (debug_level_ > 0) {
tprintf("Spacing %g, in %d rows, %d gaps fitted out of %d non-trivial\n", line_spacing_,
tprintf("Spacing %g, in %zu rows, %d gaps fitted out of %d non-trivial\n", line_spacing_,
row_positions.size(), fitting_gaps, non_trivial_gaps);
}
return fitting_gaps > non_trivial_gaps * kMinFittingLinespacings;