[PPL-devel] [GIT] ppl/ppl(products): Revert "Uniformed code and get rid of a warning."

Abramo Bagnara abramo.bagnara at gmail.com
Mon Apr 5 16:58:56 CEST 2010


Module: ppl/ppl
Branch: products
Commit: 77feabbd9e3c40b7a765ba82a3f6e9082af2b78f
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=77feabbd9e3c40b7a765ba82a3f6e9082af2b78f

Author: Abramo Bagnara <abramo.bagnara at gmail.com>
Date:   Mon Apr  5 16:58:39 2010 +0200

Revert "Uniformed code and get rid of a warning."

This reverts commit 5bdc9854986308b794925967fff6995acd5bbb85.

---

 src/checked_int.inlines.hh |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/checked_int.inlines.hh b/src/checked_int.inlines.hh
index f55416c..ab82f95 100644
--- a/src/checked_int.inlines.hh
+++ b/src/checked_int.inlines.hh
@@ -1383,12 +1383,16 @@ add_mul_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
   case 0:
     return add<To_Policy, To_Policy, To_Policy>(to, to, z, dir);
   case -1:
-    if (to <= 0)
-      return set_neg_overflow_int<To_Policy>(to, dir);
+    if (to <= 0) {
+      to = z;
+      return r;
+    }
     return assign_nan<To_Policy>(to, V_UNKNOWN_NEG_OVERFLOW);
   case 1:
-    if (to >= 0)
-      return set_pos_overflow_int<To_Policy>(to, dir);
+    if (to >= 0) {
+      to = z;
+      return r;
+    }
     return assign_nan<To_Policy>(to, V_UNKNOWN_POS_OVERFLOW);
   default:
     PPL_ASSERT(false);
@@ -1407,11 +1411,11 @@ sub_mul_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
   case -1:
     if (to >= 0)
       return set_pos_overflow_int<To_Policy>(to, dir);
-    return assign_nan<To_Policy>(to, V_UNKNOWN_NEG_OVERFLOW);
+    return V_UNKNOWN_NEG_OVERFLOW;
   case 1:
     if (to <= 0)
       return set_neg_overflow_int<To_Policy>(to, dir);
-    return assign_nan<To_Policy>(to, V_UNKNOWN_POS_OVERFLOW);
+    return V_UNKNOWN_POS_OVERFLOW;
   default:
     PPL_ASSERT(false);
     return V_NAN;




More information about the PPL-devel mailing list