Skip to content

Commit 6f580ba

Browse files
committed
Add miss changes to bool fixes.
1 parent a040bc2 commit 6f580ba

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

src/ccmain/docqual.cpp

+27-27
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ int16_t Tesseract::count_outline_errs(char c, int16_t outline_count) {
137137
}
138138

139139
void Tesseract::quality_based_rejection(PAGE_RES_IT &page_res_it,
140-
BOOL8 good_quality_doc) {
140+
bool good_quality_doc) {
141141
if ((tessedit_good_quality_unrej && good_quality_doc))
142142
unrej_good_quality_words(page_res_it);
143143
doc_and_block_rejection(page_res_it, good_quality_doc);
@@ -232,14 +232,14 @@ void Tesseract::unrej_good_quality_words( //unreject potential
232232

233233
void Tesseract::doc_and_block_rejection( //reject big chunks
234234
PAGE_RES_IT &page_res_it,
235-
BOOL8 good_quality_doc) {
235+
bool good_quality_doc) {
236236
int16_t block_no = 0;
237237
int16_t row_no = 0;
238238
BLOCK_RES *current_block;
239239
ROW_RES *current_row;
240240

241-
BOOL8 rej_word;
242-
BOOL8 prev_word_rejected;
241+
bool rej_word;
242+
bool prev_word_rejected;
243243
int16_t char_quality = 0;
244244
int16_t accepted_char_quality;
245245

@@ -273,7 +273,7 @@ void Tesseract::doc_and_block_rejection( //reject big chunks
273273
block_no, current_block->char_count,
274274
current_block->rej_count);
275275
}
276-
prev_word_rejected = FALSE;
276+
prev_word_rejected = false;
277277
while ((word = page_res_it.word()) != nullptr &&
278278
(page_res_it.block() == current_block)) {
279279
if (tessedit_preserve_blk_rej_perfect_wds) {
@@ -292,7 +292,7 @@ void Tesseract::doc_and_block_rejection( //reject big chunks
292292
rej_word = char_quality != word->reject_map.length();
293293
}
294294
} else {
295-
rej_word = TRUE;
295+
rej_word = true;
296296
}
297297
if (rej_word) {
298298
/*
@@ -339,7 +339,7 @@ void Tesseract::doc_and_block_rejection( //reject big chunks
339339
row_no, current_row->char_count,
340340
current_row->rej_count);
341341
}
342-
prev_word_rejected = FALSE;
342+
prev_word_rejected = false;
343343
while ((word = page_res_it.word()) != nullptr &&
344344
page_res_it.row () == current_row) {
345345
/* Preserve words on good docs unless they are mostly rejected*/
@@ -363,7 +363,7 @@ void Tesseract::doc_and_block_rejection( //reject big chunks
363363
rej_word = char_quality != word->reject_map.length();
364364
}
365365
} else {
366-
rej_word = TRUE;
366+
rej_word = true;
367367
}
368368
if (rej_word) {
369369
/*
@@ -419,8 +419,8 @@ void Tesseract::tilde_crunch(PAGE_RES_IT &page_res_it) {
419419
WERD_RES *word;
420420
GARBAGE_LEVEL garbage_level;
421421
PAGE_RES_IT copy_it;
422-
BOOL8 prev_potential_marked = FALSE;
423-
BOOL8 found_terrible_word = FALSE;
422+
bool prev_potential_marked = false;
423+
bool found_terrible_word = false;
424424
BOOL8 ok_dict_word;
425425

426426
page_res_it.restart_page();
@@ -439,13 +439,13 @@ void Tesseract::tilde_crunch(PAGE_RES_IT &page_res_it) {
439439
word->merge_tess_fails();
440440

441441
if (word->reject_map.accept_count () != 0) {
442-
found_terrible_word = FALSE;
442+
found_terrible_word = false;
443443
//Forget earlier potential crunches
444-
prev_potential_marked = FALSE;
444+
prev_potential_marked = false;
445445
}
446446
else {
447447
ok_dict_word = safe_dict_word(word);
448-
garbage_level = garbage_word (word, ok_dict_word);
448+
garbage_level = garbage_word(word, ok_dict_word);
449449

450450
if ((garbage_level != G_NEVER_CRUNCH) &&
451451
(terrible_word_crunch (word, garbage_level))) {
@@ -463,9 +463,9 @@ void Tesseract::tilde_crunch(PAGE_RES_IT &page_res_it) {
463463
copy_it.word ()->unlv_crunch_mode = CR_KEEP_SPACE;
464464
copy_it.forward ();
465465
}
466-
prev_potential_marked = FALSE;
466+
prev_potential_marked = false;
467467
}
468-
found_terrible_word = TRUE;
468+
found_terrible_word = true;
469469
}
470470
else if ((garbage_level != G_NEVER_CRUNCH) &&
471471
(potential_word_crunch (word,
@@ -479,17 +479,17 @@ void Tesseract::tilde_crunch(PAGE_RES_IT &page_res_it) {
479479
}
480480
else if (!prev_potential_marked) {
481481
copy_it = page_res_it;
482-
prev_potential_marked = TRUE;
482+
prev_potential_marked = true;
483483
if (crunch_debug > 1) {
484484
tprintf ("P3 CRUNCHING: \"%s\"\n",
485485
word->best_choice->unichar_string().string());
486486
}
487487
}
488488
}
489489
else {
490-
found_terrible_word = FALSE;
490+
found_terrible_word = false;
491491
//Forget earlier potential crunches
492-
prev_potential_marked = FALSE;
492+
prev_potential_marked = false;
493493
if (crunch_debug > 2) {
494494
tprintf ("NO CRUNCH: \"%s\"\n",
495495
word->best_choice->unichar_string().string());
@@ -546,7 +546,7 @@ BOOL8 Tesseract::potential_word_crunch(WERD_RES *word,
546546
int adjusted_len;
547547
const char *str = word->best_choice->unichar_string().string();
548548
const char *lengths = word->best_choice->unichar_lengths().string();
549-
BOOL8 word_crunchable;
549+
bool word_crunchable;
550550
int poor_indicator_count = 0;
551551

552552
word_crunchable = !crunch_leave_accept_strings ||
@@ -590,8 +590,8 @@ BOOL8 Tesseract::potential_word_crunch(WERD_RES *word,
590590
void Tesseract::tilde_delete(PAGE_RES_IT &page_res_it) {
591591
WERD_RES *word;
592592
PAGE_RES_IT copy_it;
593-
BOOL8 deleting_from_bol = FALSE;
594-
BOOL8 marked_delete_point = FALSE;
593+
bool deleting_from_bol = false;
594+
bool marked_delete_point = false;
595595
int16_t debug_delete_mode;
596596
CRUNCH_MODE delete_mode;
597597
int16_t x_debug_delete_mode;
@@ -610,7 +610,7 @@ void Tesseract::tilde_delete(PAGE_RES_IT &page_res_it) {
610610
word->best_choice->unichar_string().string());
611611
}
612612
word->unlv_crunch_mode = delete_mode;
613-
deleting_from_bol = TRUE;
613+
deleting_from_bol = true;
614614
} else if (word->word->flag(W_EOL)) {
615615
if (marked_delete_point) {
616616
while (copy_it.word() != word) {
@@ -631,20 +631,20 @@ void Tesseract::tilde_delete(PAGE_RES_IT &page_res_it) {
631631
word->best_choice->unichar_string().string());
632632
}
633633
word->unlv_crunch_mode = delete_mode;
634-
deleting_from_bol = FALSE;
635-
marked_delete_point = FALSE;
634+
deleting_from_bol = false;
635+
marked_delete_point = false;
636636
}
637637
else {
638638
if (!marked_delete_point) {
639639
copy_it = page_res_it;
640-
marked_delete_point = TRUE;
640+
marked_delete_point = true;
641641
}
642642
}
643643
}
644644
else {
645-
deleting_from_bol = FALSE;
645+
deleting_from_bol = false;
646646
//Forget earlier potential crunches
647-
marked_delete_point = FALSE;
647+
marked_delete_point = false;
648648
}
649649
/*
650650
The following step has been left till now as the tess fails are used to

src/ccmain/paramsd.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ STRING ParamContent::GetValue() const {
154154
void ParamContent::SetValue(const char* val) {
155155
// TODO (wanke) Test if the values actually are properly converted.
156156
// (Quickly visible impacts?)
157-
changed_ = TRUE;
157+
changed_ = true;
158158
if (param_type_ == VT_INTEGER) {
159159
iIt->set_value(atoi(val));
160160
} else if (param_type_ == VT_BOOLEAN) {

0 commit comments

Comments
 (0)