[PPL-devel] [GIT] ppl/ppl(master): Avoid implicit conversion changing signedness.

Enea Zaffanella zaffanella at cs.unipr.it
Fri Feb 24 15:21:30 CET 2012


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

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Fri Feb 24 15:21:04 2012 +0100

Avoid implicit conversion changing signedness.
Detected by ECLAIR service utypflag.

---

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

diff --git a/src/checked_float.inlines.hh b/src/checked_float.inlines.hh
index 192926e..ae6373f 100644
--- a/src/checked_float.inlines.hh
+++ b/src/checked_float.inlines.hh
@@ -881,7 +881,8 @@ assign_float_mpq(T& to, const mpq_class& from, Rounding_Dir dir) {
   }
   unsigned int needed_bits = Float<T>::Binary::MANTISSA_BITS + 1;
   if (exponent < Float<T>::Binary::EXPONENT_MIN)
-    needed_bits -= Float<T>::Binary::EXPONENT_MIN - exponent;
+    needed_bits -= static_cast<unsigned int>(Float<T>::Binary::EXPONENT_MIN
+                                             - exponent);
   mpz_t mantissa;
   mpz_init(mantissa);
   long shift = static_cast<long>(needed_bits) - exponent;




More information about the PPL-devel mailing list