diff options
author | Damien George <damien.p.george@gmail.com> | 2014-05-28 14:07:21 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-05-28 14:07:21 +0100 |
commit | 503d6110338ab2d79e6c0f8f591a0ca6397717de (patch) | |
tree | bb57f7338aa07d248fb17cc6260d1f36c8bb8b86 /py/objint.c | |
parent | 1d567592b18ea9796515436754877aac3948bd29 (diff) | |
download | micropython-503d6110338ab2d79e6c0f8f591a0ca6397717de.tar.gz micropython-503d6110338ab2d79e6c0f8f591a0ca6397717de.zip |
py: Implement long int parsing in int(...).
Addresses issue #627.
Diffstat (limited to 'py/objint.c')
-rw-r--r-- | py/objint.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/py/objint.c b/py/objint.c index a3b3554008..328fb11e80 100644 --- a/py/objint.c +++ b/py/objint.c @@ -139,7 +139,7 @@ char *mp_obj_int_formatted(char **buf, int *buf_size, int *fmt_size, mp_const_ob } else if (MP_OBJ_IS_TYPE(self_in, &mp_type_int)) { // Not a small int. #if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_LONGLONG - mp_obj_int_t *self = self_in; + const mp_obj_int_t *self = self_in; // Get the value to format; mp_obj_get_int truncates to machine_int_t. num = self->val; #else @@ -225,7 +225,7 @@ mp_obj_t mp_obj_int_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { } // This is called only with strings whose value doesn't fit in SMALL_INT -mp_obj_t mp_obj_new_int_from_qstr(qstr qst) { +mp_obj_t mp_obj_new_int_from_str_len(const char **str, uint len, bool neg, uint base) { nlr_raise(mp_obj_new_exception_msg(&mp_type_OverflowError, "long int not supported in this build")); return mp_const_none; } @@ -254,7 +254,7 @@ mp_obj_t mp_obj_new_int(machine_int_t value) { return mp_const_none; } -machine_int_t mp_obj_int_get(mp_obj_t self_in) { +machine_int_t mp_obj_int_get(mp_const_obj_t self_in) { return MP_OBJ_SMALL_INT_VALUE(self_in); } |