Skip to content

Commit b391ab8

Browse files
committed
wordrec: Replace TRUE, FALSE by true, false
Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent cbb5e72 commit b391ab8

File tree

5 files changed

+23
-24
lines changed

5 files changed

+23
-24
lines changed

src/wordrec/chop.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ EDGEPT *Wordrec::pick_close_point(EDGEPT *critical_point,
121121
int found_better;
122122

123123
do {
124-
found_better = FALSE;
124+
found_better = false;
125125

126126
this_distance = edgept_dist (critical_point, vertical_point);
127127
if (this_distance <= *best_dist) {
@@ -133,12 +133,12 @@ EDGEPT *Wordrec::pick_close_point(EDGEPT *critical_point,
133133
*best_dist = this_distance;
134134
best_point = vertical_point;
135135
if (chop_vertical_creep)
136-
found_better = TRUE;
136+
found_better = true;
137137
}
138138
}
139139
vertical_point = vertical_point->next;
140140
}
141-
while (found_better == TRUE);
141+
while (found_better == true);
142142

143143
return (best_point);
144144
}

src/wordrec/chopper.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "blobs.h" // for TPOINT, TBLOB, EDGEPT, TESSLINE, divisible_blob
2626
#include "callcpp.h" // for Red
2727
#include "dict.h" // for Dict
28-
#include "host.h" // for FALSE, TRUE
2928
#include "lm_pain_points.h" // for LMPainPoints
3029
#include "lm_state.h" // for BestChoiceBundle
3130
#include "matrix.h" // for MATRIX
@@ -90,8 +89,8 @@ static int any_shared_split_points(const GenericVector<SEAM*>& seams, SEAM *seam
9089

9190
length = seams.size();
9291
for (index = 0; index < length; index++)
93-
if (seam->SharesPosition(*seams[index])) return TRUE;
94-
return FALSE;
92+
if (seam->SharesPosition(*seams[index])) return true;
93+
return false;
9594
}
9695

9796
/**

src/wordrec/outlines.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
/**********************************************************************
4040
* same_point
4141
*
42-
* Return TRUE if the point values are the same. The parameters must
42+
* Return true if the point values are the same. The parameters must
4343
* be of type POINT.
4444
**********************************************************************/
4545
#define same_point(p1,p2) \
@@ -86,7 +86,7 @@
8686
/**********************************************************************
8787
* is_exterior_point
8888
*
89-
* Return TRUE if the point supplied is an exterior projection from the
89+
* Return true if the point supplied is an exterior projection from the
9090
* outline.
9191
**********************************************************************/
9292

@@ -99,7 +99,7 @@
9999
/**********************************************************************
100100
* is_equal
101101
*
102-
* Return TRUE if the POINTs are equal.
102+
* Return true if the POINTs are equal.
103103
**********************************************************************/
104104

105105
#define is_equal(p1,p2) \
@@ -108,7 +108,7 @@
108108
/**********************************************************************
109109
* is_on_line
110110
*
111-
* Return TRUE if the point is on the line segment between the two end
111+
* Return true if the point is on the line segment between the two end
112112
* points. The two end points are included as part of the line. The
113113
* parameters must be of type POINT.
114114
**********************************************************************/
@@ -120,8 +120,8 @@
120120
/**********************************************************************
121121
* within_range
122122
*
123-
* Return TRUE if the first number is in between the second two numbers.
124-
* Return FALSE otherwise.
123+
* Return true if the first number is in between the second two numbers.
124+
* Return false otherwise.
125125
**********************************************************************/
126126

127127
#define within_range(x,x0,x1) \

src/wordrec/wordrec.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ Wordrec::Wordrec() :
4646
namespace tesseract {
4747
Wordrec::Wordrec() :
4848
// control parameters
49-
BOOL_MEMBER(merge_fragments_in_matrix, TRUE,
49+
BOOL_MEMBER(merge_fragments_in_matrix, true,
5050
"Merge the fragments in the ratings matrix and delete them"
5151
" after merging", params()),
52-
BOOL_MEMBER(wordrec_no_block, FALSE, "Don't output block information",
52+
BOOL_MEMBER(wordrec_no_block, false, "Don't output block information",
5353
params()),
54-
BOOL_MEMBER(wordrec_enable_assoc, TRUE, "Associator Enable",
54+
BOOL_MEMBER(wordrec_enable_assoc, true, "Associator Enable",
5555
params()),
56-
BOOL_MEMBER(force_word_assoc, FALSE,
56+
BOOL_MEMBER(force_word_assoc, false,
5757
"force associator to run regardless of what enable_assoc is."
5858
" This is used for CJK where component grouping is necessary.",
5959
CCUtil::params()),
6060
double_MEMBER(wordrec_worst_state, 1.0, "Worst segmentation state",
6161
params()),
62-
BOOL_MEMBER(fragments_guide_chopper, FALSE,
62+
BOOL_MEMBER(fragments_guide_chopper, false,
6363
"Use information from fragments to guide chopping process",
6464
params()),
6565
INT_MEMBER(repair_unchopped_blobs, 1, "Fix blobs that aren't chopped",
@@ -106,7 +106,7 @@ Wordrec::Wordrec() :
106106
params()),
107107
INT_MEMBER(segment_adjust_debug, 0, "Segmentation adjustment debug",
108108
params()),
109-
BOOL_MEMBER(assume_fixed_pitch_char_segment, FALSE,
109+
BOOL_MEMBER(assume_fixed_pitch_char_segment, false,
110110
"include fixed-pitch heuristics in char segmentation",
111111
params()),
112112
INT_MEMBER(wordrec_debug_level, 0,

src/wordrec/wordrec.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,16 @@ ELISTIZEH(FRAGMENT)
192192
class Wordrec : public Classify {
193193
public:
194194
// config parameters *******************************************************
195-
BOOL_VAR_H(merge_fragments_in_matrix, TRUE,
195+
BOOL_VAR_H(merge_fragments_in_matrix, true,
196196
"Merge the fragments in the ratings matrix and delete them "
197197
"after merging");
198-
BOOL_VAR_H(wordrec_no_block, FALSE, "Don't output block information");
199-
BOOL_VAR_H(wordrec_enable_assoc, TRUE, "Associator Enable");
200-
BOOL_VAR_H(force_word_assoc, FALSE,
198+
BOOL_VAR_H(wordrec_no_block, false, "Don't output block information");
199+
BOOL_VAR_H(wordrec_enable_assoc, true, "Associator Enable");
200+
BOOL_VAR_H(force_word_assoc, false,
201201
"force associator to run regardless of what enable_assoc is."
202202
"This is used for CJK where component grouping is necessary.");
203203
double_VAR_H(wordrec_worst_state, 1, "Worst segmentation state");
204-
BOOL_VAR_H(fragments_guide_chopper, FALSE,
204+
BOOL_VAR_H(fragments_guide_chopper, false,
205205
"Use information from fragments to guide chopping process");
206206
INT_VAR_H(repair_unchopped_blobs, 1, "Fix blobs that aren't chopped");
207207
double_VAR_H(tessedit_certainty_threshold, -2.25, "Good blob limit");
@@ -226,7 +226,7 @@ class Wordrec : public Classify {
226226
double_VAR_H(chop_good_split, 50.0, "Good split limit");
227227
INT_VAR_H(chop_x_y_weight, 3, "X / Y length weight");
228228
INT_VAR_H(segment_adjust_debug, 0, "Segmentation adjustment debug");
229-
BOOL_VAR_H(assume_fixed_pitch_char_segment, FALSE,
229+
BOOL_VAR_H(assume_fixed_pitch_char_segment, false,
230230
"include fixed-pitch heuristics in char segmentation");
231231
INT_VAR_H(wordrec_debug_level, 0, "Debug level for wordrec");
232232
INT_VAR_H(wordrec_max_join_chunks, 4,

0 commit comments

Comments
 (0)