From e371906dac0a97deabce1ed6a0b773617437d925 Mon Sep 17 00:00:00 2001 From: Michael Gran Date: Sun, 30 Mar 2025 19:05:51 -0700 Subject: [PATCH] Fix scm_to_mpz Another change of long to intptr_t in numbers.c * libguile/numbers.c (scm_to_mpz): long to intptr_t fix --- libguile/numbers.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libguile/numbers.c b/libguile/numbers.c index 5ad49104c..0ac67876f 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -6881,14 +6881,14 @@ scm_to_mpz (SCM val, mpz_t rop) #if SCM_LONG_BIT >= SCM_I_FIXNUM_BIT // Cast to long and directly pass to GMP. mpz_set_si (rop, (long)inum); -#elif (2 * SCM_LONG_BIT) > SCM_I_FIXNUM_BIT +#elif (2 * SCM_INTPTR_T_BIT) > SCM_I_FIXNUM_BIT scm_t_inum inum_abs = inum; if (inum < 0) inum_abs *= -1; - long high = inum_abs >> (SCM_LONG_BIT - 1); - long low = (long)(inum_abs & ((((scm_t_inum)1) << (SCM_LONG_BIT - 1)) - 1)); + intptr_t high = inum_abs >> (SCM_INTPTR_T_BIT - 1); + intptr_t low = (intptr_t)(inum_abs & ((((scm_t_inum)1) << (SCM_INTPTR_T_BIT - 1)) - 1)); mpz_set_si (rop, high); - mpz_mul_2exp (rop, rop, SCM_LONG_BIT - 1); + mpz_mul_2exp (rop, rop, SCM_INTPTR_T_BIT - 1); mpz_add_ui (rop, rop, low); if (inum < 0) mpz_neg (rop, rop);