Browse Source

py: Fix definition of sys.maxsize with mpz changes.

pull/852/head
Damien George 10 years ago
parent
commit
8002d5d2b9
  1. 6
      py/objint_mpz.c

6
py/objint_mpz.c

@ -45,16 +45,18 @@
#if MICROPY_PY_SYS_MAXSIZE #if MICROPY_PY_SYS_MAXSIZE
// Export value for sys.maxsize // Export value for sys.maxsize
#define DIG_MASK ((1 << MPZ_DIG_SIZE) - 1) #define DIG_MASK ((1L << MPZ_DIG_SIZE) - 1)
STATIC const mpz_dig_t maxsize_dig[MPZ_NUM_DIG_FOR_INT] = { STATIC const mpz_dig_t maxsize_dig[MPZ_NUM_DIG_FOR_INT] = {
(INT_MAX >> MPZ_DIG_SIZE * 0) & DIG_MASK, (INT_MAX >> MPZ_DIG_SIZE * 0) & DIG_MASK,
#if (INT_MAX >> MPZ_DIG_SIZE * 0) > DIG_MASK
(INT_MAX >> MPZ_DIG_SIZE * 1) & DIG_MASK, (INT_MAX >> MPZ_DIG_SIZE * 1) & DIG_MASK,
#if (INT_MAX >> MPZ_DIG_SIZE * 1) > DIG_MASK
(INT_MAX >> MPZ_DIG_SIZE * 2) & DIG_MASK, (INT_MAX >> MPZ_DIG_SIZE * 2) & DIG_MASK,
#if (INT_MAX >> MPZ_DIG_SIZE * 2) > DIG_MASK
(INT_MAX >> MPZ_DIG_SIZE * 3) & DIG_MASK, (INT_MAX >> MPZ_DIG_SIZE * 3) & DIG_MASK,
(INT_MAX >> MPZ_DIG_SIZE * 4) & DIG_MASK, (INT_MAX >> MPZ_DIG_SIZE * 4) & DIG_MASK,
// (INT_MAX >> MPZ_DIG_SIZE * 5) & DIG_MASK, // (INT_MAX >> MPZ_DIG_SIZE * 5) & DIG_MASK,
#endif #endif
#endif
}; };
const mp_obj_int_t mp_maxsize_obj = { const mp_obj_int_t mp_maxsize_obj = {
{&mp_type_int}, {&mp_type_int},

Loading…
Cancel
Save