Commit 33b50a02 authored by Damien George's avatar Damien George
Browse files

Merge branch 'master' of github.com:micropython/micropython

parents c7a79284 78fde481
...@@ -58,6 +58,8 @@ int mp_binary_get_size(char struct_type, char val_type, mp_uint_t *palign) { ...@@ -58,6 +58,8 @@ int mp_binary_get_size(char struct_type, char val_type, mp_uint_t *palign) {
size = 4; break; size = 4; break;
case 'q': case 'Q': case 'q': case 'Q':
size = 8; break; size = 8; break;
case 'P': case 'O': case 'S':
size = sizeof(void*); break;
} }
break; break;
case '@': { case '@': {
......
...@@ -448,6 +448,10 @@ typedef double mp_float_t; ...@@ -448,6 +448,10 @@ typedef double mp_float_t;
#define MP_PLAT_FREE_EXEC(ptr, size) m_del(byte, ptr, size) #define MP_PLAT_FREE_EXEC(ptr, size) m_del(byte, ptr, size)
#endif #endif
#ifndef MP_SSIZE_MAX
#define MP_SSIZE_MAX SSIZE_MAX
#endif
// printf format spec to use for mp_int_t and friends // printf format spec to use for mp_int_t and friends
#ifndef INT_FMT #ifndef INT_FMT
#ifdef __LP64__ #ifdef __LP64__
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#if MICROPY_PY_SYS_MAXSIZE #if MICROPY_PY_SYS_MAXSIZE
// Export value for sys.maxsize // Export value for sys.maxsize
const mp_obj_int_t mp_maxsize_obj = {{&mp_type_int}, INT_MAX}; const mp_obj_int_t mp_maxsize_obj = {{&mp_type_int}, MP_SSIZE_MAX};
#endif #endif
mp_int_t mp_obj_int_hash(mp_obj_t self_in) { mp_int_t mp_obj_int_hash(mp_obj_t self_in) {
......
...@@ -47,14 +47,14 @@ ...@@ -47,14 +47,14 @@
// Export value for sys.maxsize // Export value for sys.maxsize
#define DIG_MASK ((1L << 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, (MP_SSIZE_MAX >> MPZ_DIG_SIZE * 0) & DIG_MASK,
#if (INT_MAX >> MPZ_DIG_SIZE * 0) > DIG_MASK #if (MP_SSIZE_MAX >> MPZ_DIG_SIZE * 0) > DIG_MASK
(INT_MAX >> MPZ_DIG_SIZE * 1) & DIG_MASK, (MP_SSIZE_MAX >> MPZ_DIG_SIZE * 1) & DIG_MASK,
#if (INT_MAX >> MPZ_DIG_SIZE * 1) > DIG_MASK #if (MP_SSIZE_MAX >> MPZ_DIG_SIZE * 1) > DIG_MASK
(INT_MAX >> MPZ_DIG_SIZE * 2) & DIG_MASK, (MP_SSIZE_MAX >> MPZ_DIG_SIZE * 2) & DIG_MASK,
(INT_MAX >> MPZ_DIG_SIZE * 3) & DIG_MASK, (MP_SSIZE_MAX >> MPZ_DIG_SIZE * 3) & DIG_MASK,
(INT_MAX >> MPZ_DIG_SIZE * 4) & DIG_MASK, (MP_SSIZE_MAX >> MPZ_DIG_SIZE * 4) & DIG_MASK,
// (INT_MAX >> MPZ_DIG_SIZE * 5) & DIG_MASK, // (MP_SSIZE_MAX >> MPZ_DIG_SIZE * 5) & DIG_MASK,
#endif #endif
#endif #endif
}; };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment