From 007f127a61ea058ca010b85883072bdefe0234c0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 11 Oct 2025 19:12:55 -0500 Subject: all: Simplify mp_int_t/mp_uint_t definition. Assuming proper C99 language support, we can select "the int type as big as a pointer" (most of the time) or "the 64-bit int type" (nanboxing with REPR_D), and then define everything else automatically. This simplifies port configuration files. And the types can still be overridden if needed. Signed-off-by: Jeff Epler --- py/runtime_utils.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'py/runtime_utils.c') diff --git a/py/runtime_utils.c b/py/runtime_utils.c index 50526b210..3b0ae279a 100644 --- a/py/runtime_utils.c +++ b/py/runtime_utils.c @@ -77,10 +77,6 @@ bool mp_mul_ll_overflow(long long int x, long long int y, long long int *res) { return overflow; } -#define MP_UINT_MAX (~(mp_uint_t)0) -#define MP_INT_MAX ((mp_int_t)(MP_UINT_MAX >> 1)) -#define MP_INT_MIN (-MP_INT_MAX - 1) - bool mp_mul_mp_int_t_overflow(mp_int_t x, mp_int_t y, mp_int_t *res) { // Check for multiply overflow; see CERT INT32-C if (x > 0) { // x is positive -- cgit v1.2.3