summaryrefslogtreecommitdiff
path: root/gmpxx.h
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2013-02-17 23:51:51 +0100
committerMarc Glisse <marc.glisse@inria.fr>2013-02-17 23:51:51 +0100
commit33b49bce1500eb54e159634b11a581c12d50e850 (patch)
treeb972bdfd405d2ab16d91901f7914f30dcd625eb2 /gmpxx.h
parente656ea90ad71f15b929ee264008afedd531e71b1 (diff)
downloadgmp-33b49bce1500eb54e159634b11a581c12d50e850.tar.gz
Update some old uses of __GMPXX_CONSTANT to bring them in line with the new ones.
Diffstat (limited to 'gmpxx.h')
-rw-r--r--gmpxx.h43
1 files changed, 17 insertions, 26 deletions
diff --git a/gmpxx.h b/gmpxx.h
index 6d3f972e8..1ef44218f 100644
--- a/gmpxx.h
+++ b/gmpxx.h
@@ -497,16 +497,13 @@ struct __gmp_binary_multiplies
{ eval(z, w, l); }
static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
{
- if (__GMPXX_CONSTANT(l))
- {
- if (l >= 0)
- eval(z, w, static_cast<unsigned long>(l));
- else
+ if (__GMPXX_CONSTANT_TRUE(l >= 0))
+ eval(z, w, static_cast<unsigned long>(l));
+ else if (__GMPXX_CONSTANT_TRUE(l <= 0))
{
eval(z, w, -static_cast<unsigned long>(l));
mpz_neg(z, z);
}
- }
else
mpz_mul_si (z, w, l);
}
@@ -545,21 +542,18 @@ struct __gmp_binary_multiplies
{ eval(q, r, l); }
static void eval(mpq_ptr q, mpq_srcptr r, signed long int l)
{
- if (__GMPXX_CONSTANT(l))
- {
- if (l >= 0)
- eval(q, r, static_cast<unsigned long>(l));
- else
+ if (__GMPXX_CONSTANT_TRUE(l >= 0))
+ eval(q, r, static_cast<unsigned long>(l));
+ else if (__GMPXX_CONSTANT_TRUE(l <= 0))
{
eval(q, r, -static_cast<unsigned long>(l));
mpq_neg(q, q);
}
- }
else
- {
- __GMPXX_TMPQ_SI;
- mpq_mul (q, r, temp);
- }
+ {
+ __GMPXX_TMPQ_SI;
+ mpq_mul (q, r, temp);
+ }
}
static void eval(mpq_ptr q, signed long int l, mpq_srcptr r)
{ eval(q, r, l); }
@@ -688,21 +682,18 @@ struct __gmp_binary_divides
{ __GMPXX_TMPQ_UI; mpq_div (q, temp, r); }
static void eval(mpq_ptr q, mpq_srcptr r, signed long int l)
{
- if (__GMPXX_CONSTANT(l))
- {
- if (l >= 0)
- eval(q, r, static_cast<unsigned long>(l));
- else
+ if (__GMPXX_CONSTANT_TRUE(l >= 0))
+ eval(q, r, static_cast<unsigned long>(l));
+ else if (__GMPXX_CONSTANT_TRUE(l <= 0))
{
eval(q, r, -static_cast<unsigned long>(l));
mpq_neg(q, q);
}
- }
else
- {
- __GMPXX_TMPQ_SI;
- mpq_div (q, r, temp);
- }
+ {
+ __GMPXX_TMPQ_SI;
+ mpq_div (q, r, temp);
+ }
}
static void eval(mpq_ptr q, signed long int l, mpq_srcptr r)
{ __GMPXX_TMPQ_SI; mpq_div (q, temp, r); }