diff options
Diffstat (limited to 'gcc/cobol/cdfval.h')
-rw-r--r-- | gcc/cobol/cdfval.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/cobol/cdfval.h b/gcc/cobol/cdfval.h index 1453f2a..634b5a2 100644 --- a/gcc/cobol/cdfval.h +++ b/gcc/cobol/cdfval.h @@ -43,7 +43,7 @@ struct cdfval_base_t { bool off; const char *string; int64_t number; - cdfval_base_t& operator()( const YDFLTYPE& loc ); + const cdfval_base_t& operator()( const YDFLTYPE& loc ); }; struct cdf_arg_t { @@ -79,7 +79,7 @@ struct cdfval_t : public cdfval_base_t { cdfval_base_t::string = NULL; cdfval_base_t::number = value; } - cdfval_t( int64_t value ) + cdfval_t( long value ) : lineno(yylineno), filename(cobol_filename()) { cdfval_base_t::off = false; @@ -93,6 +93,14 @@ struct cdfval_t : public cdfval_base_t { cdfval_base_t::string = NULL; cdfval_base_t::number = value; } + explicit cdfval_t( const REAL_VALUE_TYPE& r ) + : lineno(yylineno), filename(cobol_filename()) + { + cdfval_base_t::off = false; + cdfval_base_t::string = NULL; + HOST_WIDE_INT value = real_to_integer(&r); + cdfval_base_t::number = value; + } cdfval_t( const cdfval_base_t& value ) : lineno(yylineno), filename(cobol_filename()) { @@ -104,10 +112,10 @@ struct cdfval_t : public cdfval_base_t { int64_t as_number() const { assert(is_numeric()); return number; } }; -bool -cdf_value( const char name[], cdfval_t value ); - const cdfval_t * cdf_value( const char name[] ); +bool +cdf_value( const char name[], cdfval_t value ); + #endif |