[PPL-devel] [GIT] ppl/ppl(master): Avoid implicit floating-integral conversions.

Roberto Bagnara bagnara at cs.unipr.it
Thu Aug 16 12:04:00 CEST 2012


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

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Thu Aug 16 12:02:41 2012 +0200

Avoid implicit floating-integral conversions.
Detected by ECLAIR service utypflag.

---

 src/checked_float.inlines.hh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/checked_float.inlines.hh b/src/checked_float.inlines.hh
index 30c9088..8f537f5 100644
--- a/src/checked_float.inlines.hh
+++ b/src/checked_float.inlines.hh
@@ -1009,11 +1009,11 @@ assign_mpq_numeric_float(mpq_class& to, const long double from) {
   int exp;
   long double n = std::frexp(from, &exp);
   bool neg = false;
-  if (n < 0) {
+  if (n < 0.0L) {
     neg = true;
     n = -n;
   }
-  const long double mult = static_cast<long double>(ULONG_MAX) + 1;
+  const long double mult = static_cast<long double>(ULONG_MAX) + 1.0L;
   const unsigned int bits = sizeof(unsigned long) * CHAR_BIT;
   while (true) {
     n *= mult;




More information about the PPL-devel mailing list