@@ -115,11 +115,11 @@ void MasterTrainer::ReadTrainingSamples(const char* page_name,
115
115
const FEATURE_DEFS_STRUCT& feature_defs,
116
116
bool verification) {
117
117
char buffer[2048 ];
118
- int int_feature_type = ShortNameToFeatureType (feature_defs, kIntFeatureType );
119
- int micro_feature_type = ShortNameToFeatureType (feature_defs,
118
+ const int int_feature_type = ShortNameToFeatureType (feature_defs, kIntFeatureType );
119
+ const int micro_feature_type = ShortNameToFeatureType (feature_defs,
120
120
kMicroFeatureType );
121
- int cn_feature_type = ShortNameToFeatureType (feature_defs, kCNFeatureType );
122
- int geo_feature_type = ShortNameToFeatureType (feature_defs, kGeoFeatureType );
121
+ const int cn_feature_type = ShortNameToFeatureType (feature_defs, kCNFeatureType );
122
+ const int geo_feature_type = ShortNameToFeatureType (feature_defs, kGeoFeatureType );
123
123
124
124
FILE* fp = Efopen (page_name, " rb" );
125
125
if (fp == nullptr ) {
@@ -174,7 +174,7 @@ void MasterTrainer::AddSample(bool verification, const char* unichar,
174
174
if (flat_shapes_.FindShape (prev_unichar_id_, sample->font_id ()) < 0 )
175
175
flat_shapes_.AddShape (prev_unichar_id_, sample->font_id ());
176
176
} else {
177
- int junk_id = junk_samples_.AddSample (unichar, sample);
177
+ const int junk_id = junk_samples_.AddSample (unichar, sample);
178
178
if (prev_unichar_id_ >= 0 ) {
179
179
CHAR_FRAGMENT* frag = CHAR_FRAGMENT::parse_from_string (unichar);
180
180
if (frag != nullptr && frag->is_natural ()) {
@@ -247,7 +247,7 @@ void MasterTrainer::PreTrainingSetup() {
247
247
// together until they get to a leaf node classifier.
248
248
void MasterTrainer::SetupMasterShapes () {
249
249
tprintf (" Building master shape table\n " );
250
- int num_fonts = samples_.NumFonts ();
250
+ const int num_fonts = samples_.NumFonts ();
251
251
252
252
ShapeTable char_shapes_begin_fragment (samples_.unicharset ());
253
253
ShapeTable char_shapes_end_fragment (samples_.unicharset ());
0 commit comments