[PPL-devel] [GIT] ppl/ppl(master): Prefer explicit test against zero.

Enea Zaffanella zaffanella at cs.unipr.it
Sat Feb 25 11:33:41 CET 2012


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

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Sat Feb 25 11:17:06 2012 +0100

Prefer explicit test against zero.
Detected by ECLAIR service utypflag.

---

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

diff --git a/src/checked_mpz.inlines.hh b/src/checked_mpz.inlines.hh
index 9b2c324..9b795d4 100644
--- a/src/checked_mpz.inlines.hh
+++ b/src/checked_mpz.inlines.hh
@@ -499,7 +499,7 @@ div_2exp_mpz(mpz_class& to, const mpz_class& x, unsigned int exp,
     PPL_ASSERT(round_up(dir));
     mpz_cdiv_q_2exp(to.get_mpz_t(), n, exp);
     if (round_strict_relation(dir))
-      return mpz_divisible_2exp_p(n, exp) ? V_EQ : V_LT;
+      return (mpz_divisible_2exp_p(n, exp) != 0) ? V_EQ : V_LT;
     return V_LE;
   }
 }




More information about the PPL-devel mailing list