Skip to content

Commit

Permalink
Per #1716, committing the same bugfix to the main_v9.1 branch for inc…
Browse files Browse the repository at this point in the history
…lusion in the 9.1.3 bugfix release.
  • Loading branch information
JohnHalleyGotway committed Mar 18, 2021
1 parent 8a3ee59 commit cd3a8fc
Showing 1 changed file with 40 additions and 38 deletions.
78 changes: 40 additions & 38 deletions met/src/basic/vx_config/my_config_scanner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ static bool replace_env(ConcatString &);

static bool is_fort_thresh_no_spaces();

static bool is_simple_perc_thresh();

static int do_simple_perc_thresh();


Expand Down Expand Up @@ -370,6 +372,8 @@ if ( is_float_v2() ) { if ( do_float() ) return ( token(FLOAT) ); }

if ( is_fort_thresh_no_spaces() ) { return ( do_fort_thresh() ); }

if ( is_simple_perc_thresh() ) { return ( do_simple_perc_thresh() ); }

int t;

if ( is_id() ) { t = do_id(); return ( token(t) ); }
Expand Down Expand Up @@ -533,7 +537,6 @@ if ( is_lhs ) { strncpy(configlval.text, configtext, max_id_length); return (

if ( strcmp(configtext, "print" ) == 0 ) { return ( PRINT ); }


//
// boolean?
//
Expand All @@ -554,17 +557,13 @@ for (j=0; j<n_fort_thresh_strings; ++j) {

}





//
// builtin ?
//

int index;

if ( (! is_lhs) && is_builtin((string)configtext, index) ) { configlval.index = index; return ( BUILTIN ); }
if ( (! is_lhs) && is_builtin((string)configtext, index) ) { configlval.index = index; return ( BUILTIN ); }

//
// local variable ? // ie, in argument list
Expand All @@ -580,11 +579,6 @@ const DictionaryEntry * e = dict_stack->lookup(configtext);

if ( e && (e->is_number()) && (! is_lhs) ) {

// cout << "=================== id = \"" << configtext << "\" is_lhs = " << (is_lhs ? "true" : "false") << "\n";

// cout << "do_id() -> \n";
// e->dump(cout);

if ( e->type() == IntegerType ) {

set_int(configlval.nval, e->i_value());
Expand Down Expand Up @@ -613,28 +607,20 @@ if ( e && (! is_lhs) && (e->type() == UserFunctionType) ) {

}


///////////////////////////////////////////////////////////////////////





//
// fortran threshold without spaces? (example: "le150")
//

if ( (strncmp(configtext, "lt", 2) == 0) && is_number(configtext + 2, max_id_length - 2) ) { return ( do_fort_thresh() ); }

for (j=0; j<n_fort_thresh_strings; ++j) {

if ( (strncmp(configtext, fort_thresh_string[j], 2) == 0)
&& (is_number(configtext + 2, max_id_length - 2))
) { configlval.cval = thresh_lt; return ( do_fort_thresh() ); }
&& (is_number(configtext + 2, max_id_length - 2)) )
{ configlval.cval = thresh_lt; return ( do_fort_thresh() ); }

}


//
// simple percentile threshold? (example: "SOP50")
//
Expand All @@ -649,11 +635,8 @@ for (j=0; j<n_perc_thresh_infos; ++j) {

}



///////////////////////////////////////////////////////////////////////


//
// nope
//
Expand Down Expand Up @@ -863,7 +846,6 @@ while ( 1 ) {

c1 = c2;

// c2 = nextchar();
c2 = fgetc(configin);

}
Expand Down Expand Up @@ -891,7 +873,6 @@ while ( 1 ) {

if ( feof (configin) ) break;

// c = nextchar();
c = fgetc(configin);

if ( (c == eof) || (c == '\n') ) break;
Expand Down Expand Up @@ -1435,7 +1416,38 @@ int j;

for (j=0; j<n_fort_thresh_strings; ++j) {

if ( (strncmp(configtext, fort_thresh_string[j], 2) == 0) && (is_number(configtext + 2, max_id_length - 2)) ) return ( true );
if ( (strncmp(configtext, fort_thresh_string[j], 2) == 0)
&& (is_number(configtext + 2, max_id_length - 2)) )
{ return ( true ); }

}


return ( false );

}


////////////////////////////////////////////////////////////////////////


bool is_simple_perc_thresh()

{

int j, k;

//
// simple percentile threshold? (example: "SOP50.0")
//

for (j=0; j<n_perc_thresh_infos; ++j) {

k = perc_thresh_info[j].short_name_length;

if ( (strncmp(configtext, perc_thresh_info[j].short_name, k) == 0)
&& (is_number(configtext + k, max_id_length - k)) )
{ return ( do_simple_perc_thresh() ); }

}

Expand Down Expand Up @@ -1472,7 +1484,6 @@ for (j=0; j<n_perc_thresh_infos; ++j) {

}


if ( index < 0 ) {

mlog << Error << "\ndo_simple_perc_thresh() -> "
Expand All @@ -1482,11 +1493,8 @@ if ( index < 0 ) {

}


configlval.pc_info.perc_index = index;
// configlval.pc_info.is_simple = true;
configlval.pc_info.value = value;
// configlval.pc_info.value2 = bad_data_double;;
configlval.pc_info.value = value;


return ( SIMPLE_PERC_THRESH );
Expand All @@ -1495,9 +1503,3 @@ return ( SIMPLE_PERC_THRESH );


////////////////////////////////////////////////////////////////////////






0 comments on commit cd3a8fc

Please sign in to comment.