[PPL-devel] [GIT] ppl/ppl(master): Avoided a couple of "magic constants".

Roberto Bagnara bagnara at cs.unipr.it
Tue Aug 21 21:07:34 CEST 2012


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

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Tue Aug 21 21:05:46 2012 +0200

Avoided a couple of "magic constants".
Detected by ECLAIR service nomagicc.

---

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

diff --git a/src/Float_inlines.hh b/src/Float_inlines.hh
index 9c0f735..50670de 100644
--- a/src/Float_inlines.hh
+++ b/src/Float_inlines.hh
@@ -371,7 +371,7 @@ inline void
 float_intel_double_extended::build(bool negative,
                                    mpz_t mantissa, int exponent) {
 #if ULONG_MAX == 0xffffffffUL
-  mpz_export(&lsp, 0, -1, 8, 0, 0, mantissa);
+  mpz_export(&lsp, 0, -1, sizeof(lsp), 0, 0, mantissa);
 #else
   lsp = mpz_get_ui(mantissa);
 #endif
@@ -450,7 +450,7 @@ float_ieee754_quad::set_max(bool negative) {
 inline void
 float_ieee754_quad::build(bool negative, mpz_t mantissa, int exponent) {
   uint64_t parts[2];
-  mpz_export(parts, 0, -1, 8, 0, 0, mantissa);
+  mpz_export(parts, 0, -1, sizeof(parts[0]), 0, 0, mantissa);
   lsp = parts[0];
   msp = parts[1];
   msp &= ((static_cast<uint64_t>(1) << (MANTISSA_BITS - 64)) - 1);




More information about the PPL-devel mailing list