[PPL-devel] [GIT] ppl/ppl(master): Removed several redundant explicit casts.

Enea Zaffanella zaffanella at cs.unipr.it
Fri Sep 30 16:07:35 CEST 2011


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

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Thu Sep 29 18:07:38 2011 +0200

Removed several redundant explicit casts.
Detected by ECLAIR service castexpr.

---

 src/checked.inlines.hh |    5 +----
 src/intervals.defs.hh  |   10 ++++------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/checked.inlines.hh b/src/checked.inlines.hh
index 62657e3..e8742a2 100644
--- a/src/checked.inlines.hh
+++ b/src/checked.inlines.hh
@@ -566,10 +566,7 @@ Enable_If<(!Safe_Conversion<T1, T2>::value
            && (!C_Integer<T1>::value || !C_Integer<T2>::value)), bool>::type
 le(const T1& x, const T2& y) {
   PPL_DIRTY_TEMP(T1, tmp);
-  Result r
-    = assign_r(tmp,
-               y,
-               static_cast<Rounding_Dir>(ROUND_UP | ROUND_STRICT_RELATION));
+  Result r = assign_r(tmp, y, (ROUND_UP | ROUND_STRICT_RELATION));
   if (!result_representable(r))
     return true;
   switch (result_relation(r)) {
diff --git a/src/intervals.defs.hh b/src/intervals.defs.hh
index a0fbc9f..16a828d 100644
--- a/src/intervals.defs.hh
+++ b/src/intervals.defs.hh
@@ -173,7 +173,7 @@ public:
     case V_LGE:
       return r;
     case V_LE:
-      r = assign_r(to, c.value(), static_cast<Rounding_Dir>(ROUND_UP | ROUND_STRICT_RELATION));
+      r = assign_r(to, c.value(), (ROUND_UP | ROUND_STRICT_RELATION));
       r = result_relation_class(r);
       if (r == V_EQ)
 	return V_LE;
@@ -196,7 +196,7 @@ public:
       }
       break;
     case V_GE:
-      r = assign_r(to, c.value(), static_cast<Rounding_Dir>(ROUND_DOWN | ROUND_STRICT_RELATION));
+      r = assign_r(to, c.value(), (ROUND_DOWN | ROUND_STRICT_RELATION));
       r = result_relation_class(r);
       if (r == V_EQ)
 	return V_GE;
@@ -297,8 +297,7 @@ public:
     switch (rel) {
     case V_LT:
       if (is_integer(to)) {
-	rel = sub_assign_r(to, to, T(1),
-			   static_cast<Rounding_Dir>(ROUND_UP | ROUND_STRICT_RELATION));
+	rel = sub_assign_r(to, to, T(1), (ROUND_UP | ROUND_STRICT_RELATION));
 	rel = result_relation_class(rel);
 	return rel == V_EQ ? V_LE : rel;
       }
@@ -310,8 +309,7 @@ public:
       return V_LE;
     case V_GT:
       if (is_integer(to)) {
-	rel = add_assign_r(to, to, T(1),
-			   static_cast<Rounding_Dir>(ROUND_DOWN | ROUND_STRICT_RELATION));
+	rel = add_assign_r(to, to, T(1), (ROUND_DOWN | ROUND_STRICT_RELATION));
 	rel = result_relation_class(rel);
 	return rel == V_EQ ? V_GE : rel;
       }




More information about the PPL-devel mailing list