diff options
| author | Jeff Epler <jepler@unpythonic.net> | 2025-10-11 19:12:55 -0500 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-10-23 15:12:28 +1100 |
| commit | 007f127a61ea058ca010b85883072bdefe0234c0 (patch) | |
| tree | f39d63b4cdc67ff1374b4e774511e9bb07718c58 /py/runtime_utils.c | |
| parent | eac81de4e0a462dd8121f93b42271774ced3c85f (diff) | |
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 <jepler@unpythonic.net>
Diffstat (limited to 'py/runtime_utils.c')
| -rw-r--r-- | py/runtime_utils.c | 4 |
1 files changed, 0 insertions, 4 deletions
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 |
