[PPL-devel] [GIT] ppl/ppl(master): Avoided functional cast. Detected by ECLAIR service castexpr.

Abramo Bagnara abramo.bagnara at gmail.com
Tue Feb 21 17:33:26 CET 2012


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

Author: Abramo Bagnara <abramo.bagnara at gmail.com>
Date:   Tue Feb 21 17:28:31 2012 +0100

Avoided functional cast. Detected by ECLAIR service castexpr.

---

 src/checked_int.inlines.hh |    8 ++++----
 src/ppl-config.cc.in       |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/checked_int.inlines.hh b/src/checked_int.inlines.hh
index ffcc55a..c8e3c3a 100644
--- a/src/checked_int.inlines.hh
+++ b/src/checked_int.inlines.hh
@@ -364,7 +364,7 @@ assign_signed_int_signed_int(To& to, const From from, Rounding_Dir dir) {
 		PPL_GT_SILENT(from, From(Extended_Int<To_Policy, To>::max))))
       return set_pos_overflow_int<To_Policy>(to, dir);
   }
-  to = To(from);
+  to = static_cast<To>(from);
   return V_EQ;
 }
 
@@ -376,7 +376,7 @@ assign_signed_int_unsigned_int(To& to, const From from, Rounding_Dir dir) {
 		from > From(Extended_Int<To_Policy, To>::max)))
       return set_pos_overflow_int<To_Policy>(to, dir);
   }
-  to = To(from);
+  to = static_cast<To>(from);
   return V_EQ;
 }
 
@@ -390,7 +390,7 @@ assign_unsigned_int_signed_int(To& to, const From from, Rounding_Dir dir) {
 		from > From(Extended_Int<To_Policy, To>::max)))
       return set_pos_overflow_int<To_Policy>(to, dir);
   }
-  to = To(from);
+  to = static_cast<To>(from);
   return V_EQ;
 }
 
@@ -404,7 +404,7 @@ assign_unsigned_int_unsigned_int(To& to, const From from, Rounding_Dir dir) {
 		PPL_GT_SILENT(from, From(Extended_Int<To_Policy, To>::max))))
       return set_pos_overflow_int<To_Policy>(to, dir);
   }
-  to = To(from);
+  to = static_cast<To>(from);
   return V_EQ;
 }
 
diff --git a/src/ppl-config.cc.in b/src/ppl-config.cc.in
index f8c5481..b494a1f 100644
--- a/src/ppl-config.cc.in
+++ b/src/ppl-config.cc.in
@@ -619,16 +619,16 @@ main(int argc, char* argv[]) try {
     portray("VERSION", PPL_VERSION);
 
   if (required_version_major)
-    portray("VERSION_MAJOR", long(PPL_VERSION_MAJOR));
+    portray("VERSION_MAJOR", static_cast<long>(PPL_VERSION_MAJOR));
 
   if (required_version_minor)
-    portray("VERSION_MINOR", long(PPL_VERSION_MINOR));
+    portray("VERSION_MINOR", static_cast<long>(PPL_VERSION_MINOR));
 
   if (required_version_revision)
-    portray("VERSION_REVISION", long(PPL_VERSION_REVISION));
+    portray("VERSION_REVISION", static_cast<long>(PPL_VERSION_REVISION));
 
   if (required_version_beta)
-    portray("VERSION_BETA", long(PPL_VERSION_BETA));
+    portray("VERSION_BETA", static_cast<long>(PPL_VERSION_BETA));
 
   if (required_banner)
     portray("BANNER", PPL::banner());




More information about the PPL-devel mailing list