diff options
author | Olli Savia <ops@iki.fi> | 2010-12-29 08:54:20 +0000 |
---|---|---|
committer | Olli Savia <ops@iki.fi> | 2010-12-29 08:54:20 +0000 |
commit | 73f1ac165ba8b854ca88fdb6a8f9572e890a4ab0 (patch) | |
tree | 53bad7f4d4397e67145baa821637bd2823cfdf92 | |
parent | c84bfb363a11584110b397434cb1ce0927bf27ea (diff) | |
download | ATCD-73f1ac165ba8b854ca88fdb6a8f9572e890a4ab0.tar.gz |
ChangeLogTag: Wed Dec 29 08:53:31 UTC 2010 Olli Savia <ops@iki.fi>
-rw-r--r-- | TAO/ChangeLog | 5 | ||||
-rw-r--r-- | TAO/TAO_IDL/ast/ast_expression.cpp | 16 |
2 files changed, 14 insertions, 7 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 655edf3e2f9..ec157151a06 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,8 @@ +Wed Dec 29 08:53:31 UTC 2010 Olli Savia <ops@iki.fi> + + * TAO_IDL/ast/ast_expression.cpp: + Use ACE::is_equal() to compare floating point values. + Mon Dec 27 16:06:40 UTC 2010 Adam Mitz <mitza@ociweb.com> * orbsvcs/tests/Bug_3891_Regression/Bug_3891_Regression.mpc: diff --git a/TAO/TAO_IDL/ast/ast_expression.cpp b/TAO/TAO_IDL/ast/ast_expression.cpp index 1b0e777e906..2acb4256622 100644 --- a/TAO/TAO_IDL/ast/ast_expression.cpp +++ b/TAO/TAO_IDL/ast/ast_expression.cpp @@ -80,6 +80,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "nr_extern.h" #include "global_extern.h" +#include "ace/ACE.h" + // FUZZ: disable check_for_streams_include #include "ace/streams.h" @@ -1178,11 +1180,11 @@ coerce_value (AST_Expression::AST_ExprValue *ev, case AST_Expression::EV_bool: return ev; case AST_Expression::EV_float: - ev->u.bval = (ev->u.fval == 0.0) ? false : true; + ev->u.bval = ACE::is_equal (ev->u.fval, 0.0f) ? false : true; ev->et = AST_Expression::EV_bool; return ev; case AST_Expression::EV_double: - ev->u.bval = (ev->u.dval == 0.0) ? false : true; + ev->u.bval = ACE::is_equal (ev->u.dval, 0.0) ? false : true; ev->et = AST_Expression::EV_bool; return ev; case AST_Expression::EV_char: @@ -2006,7 +2008,7 @@ AST_Expression::eval_bin_op (AST_Expression::EvalKind ek) this->pd_v1->ev ()->u.dval * this->pd_v2->ev ()->u.dval; break; case EC_div: - if (this->pd_v2->ev ()->u.dval == 0.0) + if (ACE::is_equal (this->pd_v2->ev ()->u.dval, 0.0)) { return 0; } @@ -2908,9 +2910,9 @@ AST_Expression::operator== (AST_Expression *vc) case EV_ulong: return this->pd_ev->u.ulval == vc->ev()->u.ulval ? true : false; case EV_float: - return this->pd_ev->u.fval == vc->ev ()->u.fval ? true : false; + return ACE::is_equal (this->pd_ev->u.fval, vc->ev ()->u.fval) ? true : false; case EV_double: - return this->pd_ev->u.dval == vc->ev ()->u.dval ? true : false; + return ACE::is_equal (this->pd_ev->u.dval, vc->ev ()->u.dval) ? true : false; case EV_char: return this->pd_ev->u.cval == vc->ev ()->u.cval ? true : false; case EV_wchar: @@ -2999,9 +3001,9 @@ AST_Expression::compare (AST_Expression *vc) case EV_ulong: return this->pd_ev->u.ulval == vc->ev ()->u.ulval ? true : false; case EV_float: - return this->pd_ev->u.fval == vc->ev ()->u.fval ? true : false; + return ACE::is_equal (this->pd_ev->u.fval, vc->ev ()->u.fval) ? true : false; case EV_double: - return this->pd_ev->u.dval == vc->ev ()->u.dval ? true : false; + return ACE::is_equal (this->pd_ev->u.dval, vc->ev ()->u.dval) ? true : false; case EV_char: return this->pd_ev->u.cval == vc->ev ()->u.cval ? true : false; case EV_wchar: |