From 5c9eb1408819f22e0d38e16a9b6d8fdcd3178923 Mon Sep 17 00:00:00 2001 From: Howard Soh Date: Thu, 14 Mar 2024 20:14:03 +0000 Subject: [PATCH] #2673 Reduced scope of local variables --- src/libcode/vx_afm/afm.cc | 70 +++++--------- src/libcode/vx_afm/afm_keywords.cc | 4 +- src/libcode/vx_afm/afm_line.cc | 7 +- src/libcode/vx_analysis_util/stat_job.cc | 111 +++++++++++----------- src/libcode/vx_analysis_util/stat_line.cc | 9 +- 5 files changed, 86 insertions(+), 115 deletions(-) diff --git a/src/libcode/vx_afm/afm.cc b/src/libcode/vx_afm/afm.cc index 28b15563d6..6162601f6b 100644 --- a/src/libcode/vx_afm/afm.cc +++ b/src/libcode/vx_afm/afm.cc @@ -487,9 +487,7 @@ if ( m.linfo ) { linfo = new LigatureInfo [m.n_ligatures]; - int j; - - for (j=0; j<(m.n_ligatures); ++j) { + for (int j=0; j<(m.n_ligatures); ++j) { linfo[j] = m.linfo[j]; @@ -531,9 +529,7 @@ out << prefix << "bbox ...\n"; bbox.dump(out, depth + 1); -int j; - -for (j=0; j 0 ) { cm = new AfmCharMetrics [n_cms]; - for (j=0; j 0 ) { compinfo = new AfmCompositeInfo [n_composites]; - for (j=0; j 0 ) { kpx = new KPX [n_kern_pairs]; - for (j=0; j 0 ) { out << prefix << "Composites ... \n"; - for (j=0; j 0 ) { out << prefix << "Kern Pairs ... \n"; - for (j=0; j> line ) { // patch ligatures // -for (j=0; j 0 ) { c.linfo = new LigatureInfo [n_liginfos]; - for (j=0; j 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; i::const_iterator thr_it = column_thresh_map.begin(); thr_it != column_thresh_map.end(); thr_it++) { - for(i=0; isecond.n(); i++) { + for(int i=0; isecond.n(); i++) { js << "-column_thresh " << thr_it->first << " " << thr_it->second[i].get_str() << " "; } } @@ -2622,7 +2622,7 @@ ConcatString STATAnalysisJob::get_jobstring() const { for(map::const_iterator str_it = column_str_inc_map.begin(); str_it != column_str_inc_map.end(); str_it++) { - for(i=0; isecond.n(); i++) { + for(int i=0; isecond.n(); i++) { js << "-column_str " << str_it->first << " " << str_it->second[i] << " "; } } @@ -2631,20 +2631,20 @@ ConcatString STATAnalysisJob::get_jobstring() const { for(map::const_iterator str_it = column_str_exc_map.begin(); str_it != column_str_exc_map.end(); str_it++) { - for(i=0; isecond.n(); i++) { + for(int i=0; isecond.n(); i++) { js << "-column_str_exc " << str_it->first << " " << str_it->second[i] << " "; } } // by_column if(by_column.n() > 0) { - for(i=0; i 0) { - for(i=0; i 0) { - for(i=0; iis_var_length() ) { // Search for matching header column // -offset = HdrLine->col_offset(col_str, dim); +int offset = HdrLine->col_offset(col_str, dim); // // If not found, check extra header columns @@ -419,7 +419,6 @@ const char * STATLine::get_item(const char *col_str, bool check_na) const { -int offset = bad_data_int; int dim = bad_data_int; // @@ -434,7 +433,7 @@ if ( HdrLine->is_var_length() ) { // Search for matching header column // -offset = HdrLine->col_offset(col_str, dim); +int offset = HdrLine->col_offset(col_str, dim); // // If not found, check extra header columns