Fix compiler warnings

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2023-12-08 21:36:56 +01:00
parent 04c330907d
commit 061e386125
2 changed files with 5 additions and 8 deletions

View File

@ -283,10 +283,8 @@ void Textord::row_spacing_stats(TO_ROW *row, GAPMAP *gapmap, int16_t block_idx,
int16_t gap_width;
int16_t real_space_threshold = 0;
int16_t max = 0;
int16_t index;
int16_t large_gap_count = 0;
bool suspected_table;
int32_t max_max_nonspace; // upper bound
bool good_block_space_estimate = block_space_gap_width > 0;
int32_t end_of_row;
int32_t row_length = 0;
@ -479,11 +477,12 @@ number of samples can be taken as certain kerns.
below the threshold.
*/
max_max_nonspace = int32_t((row->space_threshold + row->kern_size) / 2);
// upper bound
int32_t max_max_nonspace = int32_t((row->space_threshold + row->kern_size) / 2);
// default
row->max_nonspace = max_max_nonspace;
for (index = 0; index <= max_max_nonspace; index++) {
for (int32_t index = 0; index <= max_max_nonspace; index++) {
if (all_gap_stats.pile_count(index) > max) {
max = all_gap_stats.pile_count(index);
}

View File

@ -211,13 +211,11 @@ void vertical_cunderline_projection( // project outlines
ICOORD pos; // current point
ICOORD step; // edge step
int16_t lower_y, upper_y; // region limits
int32_t length; // of outline
int16_t stepindex; // current step
C_OUTLINE_IT out_it = outline->child();
pos = outline->start_pos();
length = outline->pathlength();
for (stepindex = 0; stepindex < length; stepindex++) {
int16_t length = outline->pathlength();
for (int16_t stepindex = 0; stepindex < length; stepindex++) {
step = outline->step(stepindex);
if (step.x() > 0) {
lower_y = static_cast<int16_t>(floor(baseline->y(pos.x()) + baseline_offset + 0.5));