From d91e34d1304a6df1d86b73d8b5022091b1688e3d Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Tue, 26 May 2015 15:02:34 +0200 Subject: [PATCH] Use IMath functions directly instead of macros The isl_int_* macros refer to the integer functions as configured using the --with-int= switch. With the introduction of a second IMath-based integer configuration these macros become ambiguous. We call the IMath functions directly to avoid this ambiguity. Signed-off-by: Michael Kruse Signed-off-by: Sven Verdoolaege --- isl_imath.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/isl_imath.c b/isl_imath.c index fc8e70a6..cffd79a1 100644 --- a/isl_imath.c +++ b/isl_imath.c @@ -32,22 +32,24 @@ int isl_imath_fits_ulong_p(mp_int op) void isl_imath_addmul_ui(mp_int rop, mp_int op1, unsigned long op2) { - isl_int temp; - isl_int_init(temp); + mpz_t temp; + mp_int_init(&temp); - isl_int_set_ui(temp, op2); - isl_int_addmul(rop, op1, temp); + mp_int_set_uvalue(&temp, op2); + mp_int_mul(op1, &temp, &temp); + mp_int_add(rop, &temp, rop); - isl_int_clear(temp); + mp_int_clear(&temp); } void isl_imath_submul_ui(mp_int rop, mp_int op1, unsigned long op2) { - isl_int temp; - isl_int_init(temp); + mpz_t temp; + mp_int_init(&temp); - isl_int_set_ui(temp, op2); - isl_int_submul(rop, op1, temp); + mp_int_set_uvalue(&temp, op2); + mp_int_mul(op1, &temp, &temp); + mp_int_sub(rop, &temp, rop); - isl_int_clear(temp); + mp_int_clear(&temp); } -- 2.11.4.GIT