[PPL-devel] [GIT] ppl/ppl(master): Let bitwise operators be applied to unsigned integer types.

Enea Zaffanella zaffanella at cs.unipr.it
Mon Feb 20 17:55:48 CET 2012


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

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Mon Feb 20 17:55:33 2012 +0100

Let bitwise operators be applied to unsigned integer types.
Detected by ECLAIR service utypflag.

---

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

diff --git a/src/Float.inlines.hh b/src/Float.inlines.hh
index fb2b78d..6d851db 100644
--- a/src/Float.inlines.hh
+++ b/src/Float.inlines.hh
@@ -470,7 +470,7 @@ is_less_precise_than(Floating_Point_Format f1, Floating_Point_Format f2) {
 inline unsigned int
 msb_position(unsigned long long v) {
   PPL_ASSERT(v != 0);
-  return __builtin_clzll(v) ^ (sizeof(v)*8 - 1);
+  return static_cast<unsigned>(__builtin_clzll(v)) ^ (sizeof(v)*8 - 1);
 }
 #else
 unsigned int




More information about the PPL-devel mailing list