From 54f2abbf64f40545f6071a556c791dc9528e2943 Mon Sep 17 00:00:00 2001 From: Howard Soh Date: Wed, 10 May 2023 03:29:36 -0600 Subject: [PATCH] #2521 Move #include statement to the top of the file and removed these useless parentheses. used nullptr --- src/basic/vx_config/builtin.cc | 122 ++++++----- src/basic/vx_config/celltype_to_string.cc | 56 ++--- src/basic/vx_config/config_util.cc | 250 +++++++++++----------- src/basic/vx_config/dictionary.cc | 233 ++++++++++---------- 4 files changed, 321 insertions(+), 340 deletions(-) diff --git a/src/basic/vx_config/builtin.cc b/src/basic/vx_config/builtin.cc index 37a0a26ed5..2d4c76446e 100644 --- a/src/basic/vx_config/builtin.cc +++ b/src/basic/vx_config/builtin.cc @@ -16,9 +16,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - - #include #include #include @@ -28,6 +25,9 @@ using namespace std; #include "builtin.h" +using namespace std; + + //////////////////////////////////////////////////////////////////////// @@ -75,54 +75,54 @@ static double my_C_to_F (double); const BuiltinInfo binfo[] = { - { "sin", 1, builtin_sin, 0, 0, sin, 0 }, - { "cos", 1, builtin_cos, 0, 0, cos, 0 }, - { "tan", 1, builtin_tan, 0, 0, tan, 0 }, + { "sin", 1, builtin_sin, nullptr, nullptr, sin, nullptr }, + { "cos", 1, builtin_cos, nullptr, nullptr, cos, nullptr }, + { "tan", 1, builtin_tan, nullptr, nullptr, tan, nullptr }, - { "sind", 1, builtin_sind, 0, 0, sin_deg, 0 }, - { "cosd", 1, builtin_cosd, 0, 0, cos_deg, 0 }, - { "tand", 1, builtin_tand, 0, 0, tan_deg, 0 }, + { "sind", 1, builtin_sind, nullptr, nullptr, sin_deg, nullptr }, + { "cosd", 1, builtin_cosd, nullptr, nullptr, cos_deg, nullptr }, + { "tand", 1, builtin_tand, nullptr, nullptr, tan_deg, nullptr }, - { "asin", 1, builtin_asin, 0, 0, asin, 0 }, - { "acos", 1, builtin_acos, 0, 0, acos, 0 }, - { "atan", 1, builtin_atan, 0, 0, atan, 0 }, + { "asin", 1, builtin_asin, nullptr, nullptr, asin, nullptr }, + { "acos", 1, builtin_acos, nullptr, nullptr, acos, nullptr }, + { "atan", 1, builtin_atan, nullptr, nullptr, atan, nullptr }, - { "asind", 1, builtin_sind, 0, 0, arc_sin_deg, 0 }, - { "acosd", 1, builtin_cosd, 0, 0, arc_cos_deg, 0 }, - { "atand", 1, builtin_tand, 0, 0, arc_tan_deg, 0 }, + { "asind", 1, builtin_sind, nullptr, nullptr, arc_sin_deg, nullptr }, + { "acosd", 1, builtin_cosd, nullptr, nullptr, arc_cos_deg, nullptr }, + { "atand", 1, builtin_tand, nullptr, nullptr, arc_tan_deg, nullptr }, - { "atan2", 2, builtin_atan2, 0, 0, 0, atan2 }, - { "atan2d", 2, builtin_atan2d, 0, 0, 0, atan2_deg }, + { "atan2", 2, builtin_atan2, nullptr, nullptr, nullptr, atan2 }, + { "atan2d", 2, builtin_atan2d, nullptr, nullptr, nullptr, atan2_deg }, - { "arg", 2, builtin_arg, 0, 0, 0, my_arg }, - { "argd", 2, builtin_argd, 0, 0, 0, my_arg_deg }, + { "arg", 2, builtin_arg, nullptr, nullptr, nullptr, my_arg }, + { "argd", 2, builtin_argd, nullptr, nullptr, nullptr, my_arg_deg }, - { "log", 1, builtin_log, 0, 0, log, 0 }, - { "exp", 1, builtin_exp, 0, 0, exp, 0 }, + { "log", 1, builtin_log, nullptr, nullptr, log, nullptr }, + { "exp", 1, builtin_exp, nullptr, nullptr, exp, nullptr }, - { "log10", 1, builtin_log10, 0, 0, log10, 0 }, - { "exp10", 1, builtin_exp10, 0, 0, my_exp10, 0 }, + { "log10", 1, builtin_log10, nullptr, nullptr, log10, nullptr }, + { "exp10", 1, builtin_exp10, nullptr, nullptr, my_exp10, nullptr }, - { "sqrt", 1, builtin_sqrt, 0, 0, sqrt, 0 }, + { "sqrt", 1, builtin_sqrt, nullptr, nullptr, sqrt, nullptr }, - { "abs", 1, builtin_abs, abs, 0, fabs, 0 }, + { "abs", 1, builtin_abs, abs, nullptr, fabs, nullptr }, - { "min", 2, builtin_min, 0, my_imin, 0, my_dmin }, - { "max", 2, builtin_max, 0, my_imax, 0, my_dmax }, + { "min", 2, builtin_min, nullptr, my_imin, nullptr, my_dmin }, + { "max", 2, builtin_max, nullptr, my_imax, nullptr, my_dmax }, - { "mod", 2, builtin_mod, 0, my_imod, 0, my_dmod }, + { "mod", 2, builtin_mod, nullptr, my_imod, nullptr, my_dmod }, - { "floor", 1, builtin_floor, 0, 0, floor, 0 }, - { "ceil", 1, builtin_ceil, 0, 0, ceil, 0 }, + { "floor", 1, builtin_floor, nullptr, nullptr, floor, nullptr }, + { "ceil", 1, builtin_ceil, nullptr, nullptr, ceil, nullptr }, - { "step", 1, builtin_step, my_istep, 0, my_dstep, 0 }, + { "step", 1, builtin_step, my_istep, nullptr, my_dstep, nullptr }, // Functions defined in ConfigConstants - // { "F_to_C", 1, builtin_F_to_C, 0, 0, my_F_to_C, 0 }, - // { "C_to_F", 1, builtin_C_to_F, 0, 0, my_C_to_F, 0 }, + // { "F_to_C", 1, builtin_F_to_C, nullptr, nullptr, my_F_to_C, nullptr }, + // { "C_to_F", 1, builtin_C_to_F, nullptr, nullptr, my_C_to_F, nullptr }, - { "nint", 1, builtin_nint, 0, 0, 0, 0 }, - { "sign", 1, builtin_sign, 0, 0, 0, 0 }, + { "nint", 1, builtin_nint, nullptr, nullptr, nullptr, nullptr }, + { "sign", 1, builtin_sign, nullptr, nullptr, nullptr, nullptr }, // @@ -156,7 +156,7 @@ double sin_deg(double degrees) { -return ( sin(degrees*rad_per_deg) ); +return sin(degrees*rad_per_deg); } @@ -168,7 +168,7 @@ double cos_deg(double degrees) { -return ( cos(degrees*rad_per_deg) ); +return cos(degrees*rad_per_deg); } @@ -180,7 +180,7 @@ double tan_deg(double degrees) { -return ( tan(degrees*rad_per_deg) ); +return tan(degrees*rad_per_deg); } @@ -192,7 +192,7 @@ double arc_sin_deg(double t) { -return ( deg_per_rad*asin(t) ); +return deg_per_rad*asin(t); } @@ -204,7 +204,7 @@ double arc_cos_deg(double t) { -return ( deg_per_rad*acos(t) ); +return deg_per_rad*acos(t); } @@ -216,7 +216,7 @@ double arc_tan_deg(double t) { -return ( deg_per_rad*atan(t) ); +return deg_per_rad*atan(t); } @@ -228,7 +228,7 @@ double atan2_deg(double y, double x) { -return ( deg_per_rad*atan2(y, x) ); +return deg_per_rad*atan2(y, x); } @@ -240,7 +240,7 @@ double my_arg(double x, double y) { -return ( atan2(y, x) ); +return atan2(y, x); } @@ -252,7 +252,7 @@ double my_arg_deg(double x, double y) { -return ( deg_per_rad*atan2(y, x) ); +return deg_per_rad*atan2(y, x); } @@ -264,7 +264,7 @@ double my_exp10(double t) { -return ( pow(10.0, t) ); +return pow(10.0, t); } @@ -352,7 +352,7 @@ double c; c = a - b*floor(a/b); -return ( c ); +return c; } @@ -373,7 +373,7 @@ a = (int) y; if ( fabs(a - y) > 0.3 ) ++a; -return ( a ); +return a; } @@ -385,12 +385,12 @@ int my_isign(int k) { -if ( k > 0 ) return ( 1 ); +if ( k > 0 ) return 1; -if ( k < 0 ) return ( -1 ); +if ( k < 0 ) return -1; -return ( 0 ); +return 0; } @@ -402,13 +402,13 @@ int my_dsign(double t) { -if ( t > 0.0 ) return ( 1 ); +if ( t > 0.0 ) return 1; -if ( t < 0.0 ) return ( -1 ); +if ( t < 0.0 ) return -1; -return ( 0 ); +return 0; } @@ -420,9 +420,9 @@ int my_istep(int i) { -if ( i >= 0 ) return ( 1 ); +if ( i >= 0 ) return 1; -return ( 0 ); +return 0; } @@ -434,9 +434,9 @@ double my_dstep(double x) { -if ( x >= 0.0 ) return ( 1.0 ); +if ( x >= 0.0 ) return 1.0; -return ( 0.0 ); +return 0.0; } @@ -485,18 +485,16 @@ bool is_builtin(const ConcatString text, int & index) { -int j; - index = -1; -for (j=0; j #include "celltype_to_string.h" +using namespace std; + + //////////////////////////////////////////////////////////////////////// @@ -39,7 +39,7 @@ ConcatString celltype_to_string(const CellType t) { -const char * s = (const char *) 0; +const char * s = (const char *) nullptr; switch ( t ) { @@ -73,7 +73,7 @@ switch ( t ) { } // switch -return ( ConcatString (s) ); +return ConcatString (s); } @@ -85,33 +85,33 @@ bool string_to_celltype(const char * text, CellType & t) { - if ( strcmp(text, "integer" ) == 0 ) { t = integer; return ( true ); } -else if ( strcmp(text, "floating_point" ) == 0 ) { t = floating_point; return ( true ); } -else if ( strcmp(text, "boolean" ) == 0 ) { t = boolean; return ( true ); } -else if ( strcmp(text, "cell_mark" ) == 0 ) { t = cell_mark; return ( true ); } -else if ( strcmp(text, "op_add" ) == 0 ) { t = op_add; return ( true ); } - -else if ( strcmp(text, "op_multiply" ) == 0 ) { t = op_multiply; return ( true ); } -else if ( strcmp(text, "op_divide" ) == 0 ) { t = op_divide; return ( true ); } -else if ( strcmp(text, "op_subtract" ) == 0 ) { t = op_subtract; return ( true ); } -else if ( strcmp(text, "op_power" ) == 0 ) { t = op_power; return ( true ); } -else if ( strcmp(text, "op_square" ) == 0 ) { t = op_square; return ( true ); } - -else if ( strcmp(text, "op_negate" ) == 0 ) { t = op_negate; return ( true ); } -else if ( strcmp(text, "op_store" ) == 0 ) { t = op_store; return ( true ); } -else if ( strcmp(text, "op_recall" ) == 0 ) { t = op_recall; return ( true ); } -else if ( strcmp(text, "identifier" ) == 0 ) { t = identifier; return ( true ); } -else if ( strcmp(text, "user_func" ) == 0 ) { t = user_func; return ( true ); } - -else if ( strcmp(text, "builtin_func" ) == 0 ) { t = builtin_func; return ( true ); } -else if ( strcmp(text, "local_var" ) == 0 ) { t = local_var; return ( true ); } -else if ( strcmp(text, "character_string") == 0 ) { t = character_string; return ( true ); } -else if ( strcmp(text, "no_cell_type" ) == 0 ) { t = no_cell_type; return ( true ); } + if ( strcmp(text, "integer" ) == 0 ) { t = integer; return true; } +else if ( strcmp(text, "floating_point" ) == 0 ) { t = floating_point; return true; } +else if ( strcmp(text, "boolean" ) == 0 ) { t = boolean; return true; } +else if ( strcmp(text, "cell_mark" ) == 0 ) { t = cell_mark; return true; } +else if ( strcmp(text, "op_add" ) == 0 ) { t = op_add; return true; } + +else if ( strcmp(text, "op_multiply" ) == 0 ) { t = op_multiply; return true; } +else if ( strcmp(text, "op_divide" ) == 0 ) { t = op_divide; return true; } +else if ( strcmp(text, "op_subtract" ) == 0 ) { t = op_subtract; return true; } +else if ( strcmp(text, "op_power" ) == 0 ) { t = op_power; return true; } +else if ( strcmp(text, "op_square" ) == 0 ) { t = op_square; return true; } + +else if ( strcmp(text, "op_negate" ) == 0 ) { t = op_negate; return true; } +else if ( strcmp(text, "op_store" ) == 0 ) { t = op_store; return true; } +else if ( strcmp(text, "op_recall" ) == 0 ) { t = op_recall; return true; } +else if ( strcmp(text, "identifier" ) == 0 ) { t = identifier; return true; } +else if ( strcmp(text, "user_func" ) == 0 ) { t = user_func; return true; } + +else if ( strcmp(text, "builtin_func" ) == 0 ) { t = builtin_func; return true; } +else if ( strcmp(text, "local_var" ) == 0 ) { t = local_var; return true; } +else if ( strcmp(text, "character_string") == 0 ) { t = character_string; return true; } +else if ( strcmp(text, "no_cell_type" ) == 0 ) { t = no_cell_type; return true; } // // nope // -return ( false ); +return false; } diff --git a/src/basic/vx_config/config_util.cc b/src/basic/vx_config/config_util.cc index 66475afdee..92477d4bd5 100644 --- a/src/basic/vx_config/config_util.cc +++ b/src/basic/vx_config/config_util.cc @@ -8,8 +8,6 @@ /////////////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -21,10 +19,12 @@ using namespace std; #include "GridTemplate.h" +using namespace std; + /////////////////////////////////////////////////////////////////////////////// static const double default_vld_thresh = 1.0; -static const char conf_key_prepbufr_map_bad[] = "obs_prefbufr_map"; // for backward compatibility +//static const char conf_key_prepbufr_map_bad[] = "obs_prefbufr_map"; // for backward compatibility /////////////////////////////////////////////////////////////////////////////// @@ -34,7 +34,7 @@ static MetConfig conf_const(replace_path(config_const_filename).c_str()); /////////////////////////////////////////////////////////////////////////////// GaussianInfo::GaussianInfo() -: weights(0) +: weights(nullptr) { clear(); } @@ -45,7 +45,7 @@ void GaussianInfo::clear() { weight_sum = 0.0; if (weights) { delete weights; - weights = (double *)0; + weights = (double *)nullptr; } max_r = weight_cnt = 0; radius = dx = bad_data_double; @@ -67,7 +67,8 @@ int GaussianInfo::compute_max_r() { /////////////////////////////////////////////////////////////////////////////// void GaussianInfo::compute() { - double weight, distance_sq; + double weight; + double distance_sq; const double g_sigma = radius / dx; const double g_sigma_sq = g_sigma * g_sigma; const double f_sigma_exp_divider = (2 * g_sigma_sq); @@ -89,7 +90,7 @@ void GaussianInfo::compute() { distance_sq = (double)idx_x*idx_x + idx_y*idx_y; if (distance_sq <= max_r_sq) { weight_cnt++; - weight = exp(-(distance_sq) / f_sigma_exp_divider) / f_sigma_divider; + weight = exp(-distance_sq / f_sigma_exp_divider) / f_sigma_divider; weight_sum += weight; } weights[index++] = weight; @@ -198,14 +199,12 @@ void RegridInfo::validate() { } // Check the Gaussian filter - if(method == InterpMthd_MaxGauss) { - if(gaussian.radius < gaussian.dx) { - mlog << Error << "\nRegridInfo::validate() -> " - << "The radius of influence (" << gaussian.radius - << ") is less than the delta distance (" << gaussian.dx - << ") for regridding method \"" << interpmthd_to_string(method) << "\".\n\n"; - exit(1); - } + if(method == InterpMthd_MaxGauss && gaussian.radius < gaussian.dx) { + mlog << Error << "\nRegridInfo::validate() -> " + << "The radius of influence (" << gaussian.radius + << ") is less than the delta distance (" << gaussian.dx + << ") for regridding method \"" << interpmthd_to_string(method) << "\".\n\n"; + exit(1); } // Check for equal number of censor thresholds and values @@ -260,7 +259,7 @@ ConcatString parse_conf_version(Dictionary *dict) { check_met_version(s.c_str()); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -295,13 +294,15 @@ ConcatString parse_conf_string(Dictionary *dict, const char *conf_key, } } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// StringArray parse_conf_string_array(Dictionary *dict, const char *conf_key, const char *caller) { - StringArray sa, cur, sid_sa; + StringArray sa; + StringArray cur; + StringArray sid_sa; if(!dict) { mlog << Error << "\n" << caller << "empty dictionary!\n\n"; exit(1); @@ -342,7 +343,7 @@ GrdFileType parse_conf_file_type(Dictionary *dict) { } } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -352,7 +353,7 @@ map parse_conf_output_flag(Dictionary *dict, map output_map; STATOutputType t = STATOutputType_None; ConcatString cs; - int i, v; + int v; if(!dict) { mlog << Error << "\nparse_conf_output_flag() -> " @@ -361,7 +362,7 @@ map parse_conf_output_flag(Dictionary *dict, } // Loop over the requested line types - for(i=0; i parse_conf_output_flag(Dictionary *dict, exit(1); } - return(output_map); + return output_map; } /////////////////////////////////////////////////////////////////////////////// map parse_conf_output_stats(Dictionary *dict) { - Dictionary *out_dict = (Dictionary *) 0; + Dictionary *out_dict = (Dictionary *) nullptr; map output_map; STATLineType line_type; StringArray sa; - int i; if(!dict) { mlog << Error << "\nparse_conf_output_stats() -> " @@ -418,7 +418,7 @@ map parse_conf_output_stats(Dictionary *dict) { out_dict = dict->lookup_dictionary(conf_key_output_stats); // Loop over the output flag dictionary entries - for(i=0; in_entries(); i++) { + for(int i=0; in_entries(); i++) { // Get the line type for the current entry line_type = string_to_statlinetype((*out_dict)[i]->name().c_str()); @@ -433,7 +433,7 @@ map parse_conf_output_stats(Dictionary *dict) { output_map[line_type].add(sa); } - return(output_map); + return output_map; } /////////////////////////////////////////////////////////////////////////////// @@ -444,10 +444,10 @@ map parse_conf_output_stats(Dictionary *dict) { /////////////////////////////////////////////////////////////////////////////// int parse_conf_n_vx(Dictionary *dict) { - int i, total; + int total = 0; StringArray lvl; - if(!dict) return(0); + if(!dict) return 0; // Check that this dictionary is an array if(!dict->is_array()) { @@ -457,7 +457,7 @@ int parse_conf_n_vx(Dictionary *dict) { } // Loop over the fields to be verified - for(i=0,total=0; in_entries(); i++) { + for(int i=0; in_entries(); i++) { // Get the level array, which may or may not be defined. // If defined, use its length. If not, use a length of 1. @@ -467,7 +467,7 @@ int parse_conf_n_vx(Dictionary *dict) { total += (lvl.n() > 0 ? lvl.n() : 1); } - return(total); + return total; } /////////////////////////////////////////////////////////////////////////////// @@ -480,7 +480,8 @@ Dictionary parse_conf_i_vx_dict(Dictionary *dict, int index) { Dictionary i_dict; DictionaryEntry entry; StringArray lvl; - int i, total, n_lvl; + int n_lvl; + int total; if(!dict) { mlog << Error << "\nparse_conf_i_vx_dict() -> " @@ -496,7 +497,7 @@ Dictionary parse_conf_i_vx_dict(Dictionary *dict, int index) { } // Loop over the fields to be verified - for(i=0,total=0; in_entries(); i++) { + for(int i=0,total=0; in_entries(); i++) { // Get the level array, which may or may not be defined. // If defined, use its length. If not, use a length of 1. @@ -520,7 +521,7 @@ Dictionary parse_conf_i_vx_dict(Dictionary *dict, int index) { } } // end for i - return(i_dict); + return i_dict; } /////////////////////////////////////////////////////////////////////////////// @@ -542,7 +543,7 @@ StringArray parse_conf_tc_model(Dictionary *dict, bool error_out) { } } - return(sa); + return sa; } /////////////////////////////////////////////////////////////////////////////// @@ -559,7 +560,7 @@ StringArray parse_conf_message_type(Dictionary *dict, bool error_out) { exit(1); } - return(sa); + return sa; } /////////////////////////////////////////////////////////////////////////////// @@ -567,13 +568,12 @@ StringArray parse_conf_message_type(Dictionary *dict, bool error_out) { StringArray parse_conf_sid_list(Dictionary *dict, const char *conf_key) { StringArray sa, cur, sid_sa; ConcatString mask_name; - int i; const char *method_name = "parse_conf_sid_list() -> "; sa = parse_conf_string_array(dict, conf_key, method_name); // Parse station ID's to exclude from each entry - for(i=0; i parse_conf_llpnt_mask(Dictionary *dict) { Dictionary *llpnt_dict; vector v; MaskLatLon m; - int i, n_entries; + int n_entries; if(!dict) { mlog << Error << "\nparse_conf_llpnt_mask() -> " @@ -748,7 +748,7 @@ vector parse_conf_llpnt_mask(Dictionary *dict) { } // Loop through the array entries - for(i=0; itype() == ArrayType) { @@ -766,7 +766,7 @@ vector parse_conf_llpnt_mask(Dictionary *dict) { v.push_back(m); } - return(v); + return v; } /////////////////////////////////////////////////////////////////////////////// @@ -791,7 +791,7 @@ StringArray parse_conf_obs_qty_inc(Dictionary *dict) { sa = parse_conf_string_array(dict, conf_key_obs_qty_inc, method_name); } - return(sa); + return sa; } /////////////////////////////////////////////////////////////////////////////// @@ -801,14 +801,13 @@ StringArray parse_conf_obs_qty_exc(Dictionary *dict) { StringArray sa = parse_conf_string_array(dict, conf_key_obs_qty_exc, method_name); - return(sa); + return sa; } /////////////////////////////////////////////////////////////////////////////// NumArray parse_conf_ci_alpha(Dictionary *dict) { NumArray na; - int i; if(!dict) { mlog << Error << "\nparse_conf_ci_alpha() -> " @@ -827,7 +826,7 @@ NumArray parse_conf_ci_alpha(Dictionary *dict) { } // Check that the values for alpha are between 0 and 1 - for(i=0; i= 1.0) { mlog << Error << "\nparse_conf_ci_alpha() -> " << "All confidence interval alpha values (" @@ -837,7 +836,7 @@ NumArray parse_conf_ci_alpha(Dictionary *dict) { } } - return(na); + return na; } /////////////////////////////////////////////////////////////////////////////// @@ -877,7 +876,7 @@ NumArray parse_conf_eclv_points(Dictionary *dict) { } } - return(na); + return na; } /////////////////////////////////////////////////////////////////////////////// @@ -970,7 +969,7 @@ TimeSummaryInfo parse_conf_time_summary(Dictionary *dict) { exit(1); } - return(info); + return info; } /////////////////////////////////////////////////////////////////////////////// @@ -979,7 +978,6 @@ void parse_add_conf_key_value_map( Dictionary *dict, const char *conf_key_map_name, map *m) { Dictionary *map_dict = (Dictionary *) 0; ConcatString key, val; - int i; if(!dict) { mlog << Error << "\nparse_conf_key_value_type_map() -> " @@ -991,7 +989,7 @@ void parse_add_conf_key_value_map( map_dict = dict->lookup_array(conf_key_map_name); // Loop through the array entries - for(i=0; in_entries(); i++) { + for(int i=0; in_entries(); i++) { // Lookup the key and value key = (*map_dict)[i]->dict_value()->lookup_string(conf_key_key); @@ -1016,7 +1014,6 @@ map parse_conf_key_value_map( Dictionary *map_dict = (Dictionary *) 0; map m; ConcatString key, val; - int i; const char *method_name = (0 != caller) ? caller : "parse_conf_key_value_map() -> "; if(!dict) { @@ -1028,7 +1025,7 @@ map parse_conf_key_value_map( map_dict = dict->lookup_array(conf_key_map_name); // Loop through the array entries - for(i=0; in_entries(); i++) { + for(int i=0; in_entries(); i++) { // Lookup the key and value key = (*map_dict)[i]->dict_value()->lookup_string(conf_key_key); @@ -1044,7 +1041,7 @@ map parse_conf_key_value_map( m.insert(pair(key, val)); } - return(m); + return m; } @@ -1108,8 +1105,7 @@ map parse_conf_obs_to_qc_map(Dictionary *dict) { map parse_conf_key_convert_map( Dictionary *dict, const char *conf_key_map_name, const char *caller) { - Dictionary *map_dict = (Dictionary *) 0; - int i, j; + Dictionary *map_dict = (Dictionary *) nullptr; StringArray sa; ConcatString key; UserFunc_1Arg fx; @@ -1125,7 +1121,7 @@ map parse_conf_key_convert_map( map_dict = dict->lookup_array(conf_key_map_name); // Loop through the array entries - for(i=0; in_entries(); i++) { + for(int i=0; in_entries(); i++) { // Lookup the key and convert function sa = (*map_dict)[i]->dict_value()->lookup_string_array(conf_key_key); @@ -1141,7 +1137,7 @@ map parse_conf_key_convert_map( } // Add map entry for each string - for(j=0; j parse_conf_key_convert_map( } // end for j } // end for i - return(m); + return m; } /////////////////////////////////////////////////////////////////////////////// @@ -1225,7 +1221,7 @@ BootInfo parse_conf_boot(Dictionary *dict) { // Conf: boot_seed info.seed = dict->lookup_string(conf_key_boot_seed); - return(info); + return info; } /////////////////////////////////////////////////////////////////////////////// @@ -1315,7 +1311,7 @@ RegridInfo parse_conf_regrid(Dictionary *dict, bool error_out) { // Validate the settings info.validate(); - return(info); + return info; } /////////////////////////////////////////////////////////////////////////////// @@ -1410,19 +1406,22 @@ bool InterpInfo::operator==(const InterpInfo &v) const { match = false; } - return(match); + return match; } /////////////////////////////////////////////////////////////////////////////// InterpInfo parse_conf_interp(Dictionary *dict, const char *conf_key) { - Dictionary *interp_dict = (Dictionary *) 0; - Dictionary *type_dict = (Dictionary *) 0; + Dictionary *interp_dict = (Dictionary *) nullptr; + Dictionary *type_dict = (Dictionary *) nullptr; InterpInfo info; - NumArray mthd_na, wdth_na; + NumArray mthd_na; + NumArray wdth_na; InterpMthd method; - int i, j, k, v, width, n_entries; + int v; + int width; + int n_entries; bool is_correct_type = false; if(!dict) { @@ -1495,7 +1494,8 @@ InterpInfo parse_conf_interp(Dictionary *dict, const char *conf_key) { } // Loop over the interpolation type dictionary entries - for(i=0, info.n_interp=0; itype() == ArrayType) { @@ -1508,7 +1508,7 @@ InterpInfo parse_conf_interp(Dictionary *dict, const char *conf_key) { } // Loop over the methods - for(j=0; j 1); - return(info); + return info; } /////////////////////////////////////////////////////////////////////////////// @@ -1723,7 +1723,8 @@ void NbrhdInfo::clear() { NbrhdInfo parse_conf_nbrhd(Dictionary *dict, const char *conf_key) { Dictionary *nbrhd_dict = (Dictionary *) 0; NbrhdInfo info; - int i, v; + int i; + int v; if(!dict) { mlog << Error << "\nparse_conf_nbrhd() -> " @@ -1806,7 +1807,7 @@ NbrhdInfo parse_conf_nbrhd(Dictionary *dict, const char *conf_key) { } } - return(info); + return info; } /////////////////////////////////////////////////////////////////////////////// @@ -1829,9 +1830,9 @@ HiRAInfo::HiRAInfo() { /////////////////////////////////////////////////////////////////////////////// HiRAInfo parse_conf_hira(Dictionary *dict) { - Dictionary *hira_dict = (Dictionary *) 0; + Dictionary *hira_dict = (Dictionary *) nullptr; HiRAInfo info; - int i,v; + int v; if(!dict) { mlog << Error << "\nparse_conf_hira() -> " @@ -1871,7 +1872,7 @@ HiRAInfo parse_conf_hira(Dictionary *dict) { } // Check for valid widths - for(i=0; i " @@ -1903,7 +1904,7 @@ HiRAInfo parse_conf_hira(Dictionary *dict) { // Conf: prob_cat_thresh info.prob_cat_ta = hira_dict->lookup_thresh_array(conf_key_prob_cat_thresh); - return(info); + return info; } /////////////////////////////////////////////////////////////////////////////// @@ -1932,7 +1933,7 @@ GridWeightType parse_conf_grid_weight_flag(Dictionary *dict) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -1966,7 +1967,7 @@ DuplicateType parse_conf_duplicate_flag(Dictionary *dict) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2000,7 +2001,7 @@ ObsSummary parse_conf_obs_summary(Dictionary *dict) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2025,7 +2026,7 @@ int parse_conf_percentile(Dictionary *dict) { exit(1); } - return(i); + return i; } /////////////////////////////////////////////////////////////////////////////// @@ -2055,7 +2056,7 @@ ConcatString parse_conf_tmp_dir(Dictionary *dict) { met_closedir(odir); } - return(tmp_dir_path); + return tmp_dir_path; } /////////////////////////////////////////////////////////////////////////////// @@ -2085,7 +2086,7 @@ GridDecompType parse_conf_grid_decomp_flag(Dictionary *dict) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2118,7 +2119,7 @@ WaveletType parse_conf_wavelet_type(Dictionary *dict) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2161,7 +2162,7 @@ PlotInfo parse_conf_plot_info(Dictionary *dict) { info.colorbar_flag = dict->lookup_bool(conf_key_colorbar_flag, false); if(!dict->last_lookup_status()) info.colorbar_flag = true; - return(info); + return info; } /////////////////////////////////////////////////////////////////////////////// @@ -2171,8 +2172,8 @@ map parse_conf_filter_attr_map( map m; SingleThresh st; StringArray sa; - ThreshArray ta, ta_entry; - int i; + ThreshArray ta; + ThreshArray ta_entry; if(!dict) { mlog << Error << "\nparse_conf_filter_attr_map() -> " @@ -2210,7 +2211,7 @@ map parse_conf_filter_attr_map( } // Process each array entry - for(i=0; i= 1) { @@ -2224,7 +2225,7 @@ map parse_conf_filter_attr_map( } } - return(m); + return m; } /////////////////////////////////////////////////////////////////////////////// @@ -2357,17 +2358,16 @@ InterpMthd int_to_interpmthd(int i) { exit(1); } - return(m); + return m; } /////////////////////////////////////////////////////////////////////////////// void check_mctc_thresh(const ThreshArray &ta) { - int i; // Check that the threshold values are monotonically increasing // and the threshold types are inequalities that remain the same - for(i=0; i ta[i+1].get_value() || ta[i].get_type() != ta[i+1].get_type() || @@ -2390,7 +2390,7 @@ void check_mctc_thresh(const ThreshArray &ta) { /////////////////////////////////////////////////////////////////////////////// const char * statlinetype_to_string(const STATLineType t) { - const char *s = (const char *) 0; + const char *s = (const char *) nullptr; switch(t) { case(stat_sl1l2): s = stat_sl1l2_str; break; @@ -2441,7 +2441,7 @@ const char * statlinetype_to_string(const STATLineType t) { default: s = stat_na_str; break; } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -2505,7 +2505,7 @@ STATLineType string_to_statlinetype(const char *s) { else t = no_stat_line_type; - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2524,7 +2524,7 @@ FieldType int_to_fieldtype(int v) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2545,7 +2545,7 @@ GridTemplateFactory::GridTemplates int_to_gridtemplate(int v) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2565,7 +2565,7 @@ ConcatString fieldtype_to_string(FieldType type) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -2584,7 +2584,7 @@ SetLogic int_to_setlogic(int v) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2613,7 +2613,7 @@ SetLogic string_to_setlogic(const char *s) { exit(1); } - return(t); + return t; } @@ -2634,7 +2634,7 @@ ConcatString setlogic_to_string(SetLogic type) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -2654,7 +2654,7 @@ ConcatString setlogic_to_abbr(SetLogic type) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -2674,7 +2674,7 @@ ConcatString setlogic_to_symbol(SetLogic type) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -2695,7 +2695,7 @@ SetLogic check_setlogic(SetLogic t1, SetLogic t2) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2714,7 +2714,7 @@ TrackType int_to_tracktype(int v) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2733,7 +2733,7 @@ TrackType string_to_tracktype(const char *s) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2753,7 +2753,7 @@ ConcatString tracktype_to_string(TrackType type) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -2769,7 +2769,7 @@ DiagType string_to_diagtype(const char *s) { else if(strcasecmp(s, ships_diag_dev_str) == 0) t = DiagType_SHIPS_Dev; else t = DiagType_None; - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2790,7 +2790,7 @@ ConcatString diagtype_to_string(DiagType type) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -2808,7 +2808,7 @@ Interp12Type int_to_interp12type(int v) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2826,7 +2826,7 @@ Interp12Type string_to_interp12type(const char *s) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2845,7 +2845,7 @@ ConcatString interp12type_to_string(Interp12Type type) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -2864,7 +2864,7 @@ MergeType int_to_mergetype(int v) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2884,7 +2884,7 @@ ConcatString mergetype_to_string(MergeType type) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -2910,7 +2910,7 @@ ConcatString obssummary_to_string(ObsSummary type, int perc_val) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -2929,7 +2929,7 @@ MatchType int_to_matchtype(int v) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2949,7 +2949,7 @@ ConcatString matchtype_to_string(MatchType type) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -2971,7 +2971,7 @@ DistType int_to_disttype(int v) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -2993,7 +2993,7 @@ DistType string_to_disttype(const char *s) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// @@ -3016,7 +3016,7 @@ ConcatString disttype_to_string(DistType type) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -3037,7 +3037,7 @@ ConcatString dist_to_string(DistType type, const NumArray &parm) { s << ")"; } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -3057,7 +3057,7 @@ ConcatString griddecomptype_to_string(GridDecompType type) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -3080,7 +3080,7 @@ ConcatString wavelettype_to_string(WaveletType type) { exit(1); } - return(s); + return s; } /////////////////////////////////////////////////////////////////////////////// @@ -3126,7 +3126,7 @@ NormalizeType parse_conf_normalize(Dictionary *dict) { exit(1); } - return(t); + return t; } /////////////////////////////////////////////////////////////////////////////// diff --git a/src/basic/vx_config/dictionary.cc b/src/basic/vx_config/dictionary.cc index ae93e52b60..a082cbdbd7 100644 --- a/src/basic/vx_config/dictionary.cc +++ b/src/basic/vx_config/dictionary.cc @@ -10,8 +10,6 @@ //////////////////////////////////////////////////////////////////////// -using namespace std; - #include #include #include @@ -28,6 +26,9 @@ using namespace std; #include "configobjecttype_to_string.h" +using namespace std; + + //////////////////////////////////////////////////////////////////////// @@ -93,11 +94,11 @@ DictionaryEntry & DictionaryEntry::operator=(const DictionaryEntry & entry) { -if ( this == &entry ) return ( * this ); +if ( this == &entry ) return *this; assign(entry); -return ( * this ); +return *this; } @@ -109,15 +110,15 @@ void DictionaryEntry::init_from_scratch() { -Text = (ConcatString *) 0; +Text = (ConcatString *) nullptr; -Dict = (Dictionary *) 0; +Dict = (Dictionary *) nullptr; -Thresh = (SingleThresh *) 0; +Thresh = (SingleThresh *) nullptr; -PWL = (PiecewiseLinear *) 0; +PWL = (PiecewiseLinear *) nullptr; -v = (IcodeVector *) 0; +v = (IcodeVector *) nullptr; Nargs = 0; @@ -141,15 +142,15 @@ Ival = 0; Dval = 0.0; Bval = false; -if ( Text ) { delete Text; Text = (ConcatString *) 0; } +if ( Text ) { delete Text; Text = (ConcatString *) nullptr; } -if ( Dict ) { delete Dict; Dict = (Dictionary *) 0; } +if ( Dict ) { delete Dict; Dict = (Dictionary *) nullptr; } -if ( Thresh ) { delete Thresh; Thresh = (SingleThresh *) 0; } +if ( Thresh ) { delete Thresh; Thresh = (SingleThresh *) nullptr; } -if ( PWL ) { delete PWL; PWL = (PiecewiseLinear *) 0; } +if ( PWL ) { delete PWL; PWL = (PiecewiseLinear *) nullptr; } -if ( v ) { delete v; v = (IcodeVector *) 0; } +if ( v ) { delete v; v = (IcodeVector *) nullptr; } Nargs = 0; @@ -710,7 +711,7 @@ if ( Type != IntegerType ) { } -return ( Ival ); +return Ival; } @@ -732,7 +733,7 @@ if ( Type != FloatType ) { } -return ( Dval ); +return Dval; } @@ -754,7 +755,7 @@ if ( Type != BooleanType ) { } -return ( Bval ); +return Bval; } @@ -785,7 +786,7 @@ const ConcatString DictionaryEntry::string_value() const } - return ( sub_text ); + return sub_text; } @@ -807,7 +808,7 @@ if ( Type != DictionaryType ) { } -return ( Dict ); +return Dict; } @@ -829,7 +830,7 @@ if ( Type != ArrayType ) { } -return ( Dict ); +return Dict; } @@ -851,7 +852,7 @@ if ( Type != ThresholdType ) { } -return ( Thresh ); +return Thresh; } @@ -873,7 +874,7 @@ if ( Type != PwlFunctionType ) { } -return ( PWL ); +return PWL; } @@ -931,11 +932,11 @@ Dictionary & Dictionary::operator=(const Dictionary & d) { -if ( this == &d ) return ( * this ); +if ( this == &d ) return *this; assign(d); -return ( * this ); +return *this; } @@ -947,9 +948,9 @@ void Dictionary::init_from_scratch() { -e = (DictionaryEntry **) 0; +e = (DictionaryEntry **) nullptr; -Parent = (Dictionary *) 0; +Parent = (Dictionary *) nullptr; Nentries = 0; @@ -972,15 +973,13 @@ void Dictionary::clear() if ( e ) { - int j; - - for (j=0; jdump_config_format(out, depth + 1); @@ -1116,21 +1111,21 @@ if ( Nalloc >= n ) return; n = dictionary_alloc_inc*((n + dictionary_alloc_inc - 1)/dictionary_alloc_inc); int j; -DictionaryEntry ** u = (DictionaryEntry **) 0; +DictionaryEntry ** u = (DictionaryEntry **) nullptr; u = new DictionaryEntry * [n]; -for (j=0; j= Nentries) ) { } -return ( e[n] ); +return e[n]; } @@ -1270,13 +1263,13 @@ if ( Nentries == 0 ) { LastLookupStatus = false; - return ( (const DictionaryEntry *) 0 ); + return (const DictionaryEntry *) nullptr; } int j; StringArray scope; ConcatString Name = name; -const DictionaryEntry * E = (const DictionaryEntry *) 0; +const DictionaryEntry * E = (const DictionaryEntry *) nullptr; Dictionary * D = this; @@ -1300,14 +1293,14 @@ for (j=0; j<(scope.n_elements() - 1); ++j) { LastLookupStatus = false; - return ( (const DictionaryEntry *) 0 ); + return (const DictionaryEntry *) nullptr; } if ( ! E->is_dictionary() ) { LastLookupStatus = false; - return ( (const DictionaryEntry *) 0 ); + return (const DictionaryEntry *) nullptr; } D = E->dict_value(); @@ -1326,7 +1319,7 @@ if ( E ) { LastLookupStatus = (E != 0); - return ( E ); + return E; } // @@ -1345,9 +1338,9 @@ if ( search_parent ) { // done // -LastLookupStatus = (E != 0); +LastLookupStatus = (E != nullptr); -return ( E ); +return E; } @@ -1363,18 +1356,16 @@ if ( Nentries == 0 ) { LastLookupStatus = false; - return ( (const DictionaryEntry *) 0 ); + return (const DictionaryEntry *) nullptr; } -int j; - -for (j=0; jName == name ) { LastLookupStatus = (e[j] != 0); - return ( e[j] ); + return e[j]; } } @@ -1383,7 +1374,7 @@ for (j=0; jtype(); @@ -1519,7 +1509,7 @@ if ( !Entry || !is_correct_type ) { } -return ( Entry->b_value() ); +return Entry->b_value(); } @@ -1564,11 +1554,11 @@ if ( !Entry || !is_correct_type ) { } - return ( bad_data_int ); + return bad_data_int; } -return ( Entry->i_value() ); +return Entry->i_value(); } @@ -1596,7 +1586,7 @@ if ( Entry ) { if ( Entry->type() == ThresholdType && Entry->thresh_value()->get_type() == thresh_na ) { - return ( bad_data_double ); + return bad_data_double; } } @@ -1630,7 +1620,7 @@ if ( !Entry || !is_correct_type ) { } - return ( bad_data_double ); + return bad_data_double; } @@ -1641,7 +1631,7 @@ if ( !Entry || !is_correct_type ) { if ( Entry->type() == FloatType ) v = Entry->d_value(); else if ( Entry->type() == IntegerType ) v = (double) Entry->i_value(); -return ( v ); +return v; } @@ -1657,7 +1647,7 @@ NumArray Dictionary::lookup_num_array(const char * name, { const DictionaryEntry * Entry = lookup(name, search_parent); -const Dictionary * Dict = (const Dictionary *) 0; +const Dictionary * Dict = (const Dictionary *) nullptr; ConfigObjectType Type = no_config_object_type; bool is_correct_type = false; NumArray array; @@ -1693,7 +1683,7 @@ if ( !Entry || !is_correct_type ) { } - return ( array ); + return array; } @@ -1705,7 +1695,7 @@ if ( Entry->type() == IntegerType ) { array.add( Entry->i_value() ); - return ( array ); + return array; } @@ -1717,7 +1707,7 @@ if ( Entry->type() == FloatType ) { array.add( Entry->d_value() ); - return ( array ); + return array; } @@ -1729,7 +1719,7 @@ if ( Entry->type() == BooleanType ) { array.add( Entry->b_value() ); - return ( array ); + return array; } @@ -1766,7 +1756,7 @@ for (int i=0; in_entries(); i++) { } -return ( array ); +return array; } @@ -1787,7 +1777,7 @@ NumArray num_array = lookup_num_array(name, error_out, print_warning, search_par for (int i=0; istring_value() ); +return Entry->string_value(); } @@ -1887,7 +1877,7 @@ if ( !Entry || !is_correct_type ) { } - return ( array ); + return array; } @@ -1899,7 +1889,7 @@ if ( Entry->type() == StringType ) { array.add( Entry->string_value() ); - return ( array ); + return array; } @@ -1938,7 +1928,7 @@ for (int i=0; in_entries(); i++) { } -return ( array ); +return array; } @@ -1988,11 +1978,11 @@ if ( !Entry || !is_correct_type ) { SingleThresh s; - return ( s ); + return s; } -return ( *(Entry->thresh_value()) ); +return *(Entry->thresh_value()); } @@ -2043,7 +2033,7 @@ if ( !Entry || !is_correct_type ) { } - return ( array ); + return array; } @@ -2055,7 +2045,7 @@ if ( Entry->type() == ThresholdType ) { array.add( *(Entry->thresh_value()) ); - return ( array ); + return array; } @@ -2095,7 +2085,7 @@ for (int i=0; in_entries(); i++) { } -return ( array ); +return array; } @@ -2142,11 +2132,11 @@ if ( !Entry || !is_correct_type ) { } - return ( (Dictionary *) 0 ); + return (Dictionary *) nullptr; } -return ( Entry->dict_value() ); +return Entry->dict_value(); } @@ -2191,11 +2181,11 @@ if ( !Entry || !is_correct_type ) { } - return ( (Dictionary *) 0 ); + return (Dictionary *) nullptr; } -return ( Entry->array_value() ); +return Entry->array_value(); } @@ -2217,11 +2207,11 @@ int Dictionary::lookup_seconds(const char * name, ConcatString cs = lookup_string(name, false, true, search_parent); if ( LastLookupStatus ) { - if ( cs.empty() ) return ( bad_data_int ); - else return ( timestring_to_sec( cs.c_str() ) ); + if ( cs.empty() ) return bad_data_int; + else return timestring_to_sec( cs.c_str() ); } -return ( lookup_int(name, error_out, print_warning, search_parent) ); +return lookup_int(name, error_out, print_warning, search_parent); } @@ -2239,11 +2229,9 @@ IntArray Dictionary::lookup_seconds_array(const char * name, StringArray sa = lookup_string_array(name, error_out, print_warning, search_parent); IntArray ia; -int j; +for (int j=0; jpwl_value() ); +return Entry->pwl_value(); } @@ -2437,7 +2423,7 @@ int j; for (j=0; jis_array() ); +return D[Nelements - 1]->is_array(); } @@ -2625,7 +2608,7 @@ const Dictionary * DictionaryStack::top() const if ( Nelements == 0 ) return ( (const Dictionary *) 0 ); -return ( D[Nelements - 1] ); +return D[Nelements - 1]; } @@ -2647,7 +2630,7 @@ if ( Nelements <= 1 ) { } -delete D[Nelements - 1]; D[Nelements - 1] = (Dictionary *) 0; +delete D[Nelements - 1]; D[Nelements - 1] = (Dictionary *) nullptr; --Nelements; @@ -2717,7 +2700,7 @@ entry.set_dict (name, *(D[Nelements - 1])); D[Nelements - 2]->store(entry); -delete D[Nelements - 1]; D[Nelements - 1] = (Dictionary *) 0; +delete D[Nelements - 1]; D[Nelements - 1] = (Dictionary *) nullptr; --Nelements; @@ -2757,7 +2740,7 @@ E.set_name(name); D[Nelements - 2]->store(E); -delete D[Nelements - 1]; D[Nelements - 1] = (Dictionary *) 0; +delete D[Nelements - 1]; D[Nelements - 1] = (Dictionary *) nullptr; --Nelements; @@ -2789,16 +2772,16 @@ const DictionaryEntry * DictionaryStack::lookup(const std::string name) const { -if ( Nelements == 0 ) return ( (const DictionaryEntry *) 0 ); +if ( Nelements == 0 ) return (const DictionaryEntry *) nullptr; int j; -const DictionaryEntry * E = (const DictionaryEntry *) 0; +const DictionaryEntry * E = (const DictionaryEntry *) nullptr; for (j=(Nelements - 1); j>=0; --j) { E = D[j]->lookup(name); - if ( E ) return ( E ); + if ( E ) return E; } @@ -2806,7 +2789,7 @@ for (j=(Nelements - 1); j>=0; --j) { // nope // -return ( (const DictionaryEntry *) 0 ); +return (const DictionaryEntry *) nullptr; } @@ -2830,7 +2813,7 @@ ConcatString config_prefix(int depth) int j; ConcatString s; -if ( depth == 0 ) { s << ' '; return ( s ); } +if ( depth == 0 ) { s << ' '; return s; } for (j=0; j