diff options
author | Damien George <damien.p.george@gmail.com> | 2014-07-31 10:49:14 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-07-31 10:49:14 +0100 |
commit | bb4c6f35c627ab3487cdd6bafb4588cc633cd6a4 (patch) | |
tree | 6177f71ef43916008070e625f6eea0c7834f8c48 /py/objstr.c | |
parent | fa1ecda3fdaecd89b86bb63930a6521c8f63fe90 (diff) |
py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself.
Addresses issue #724.
Diffstat (limited to 'py/objstr.c')
-rw-r--r-- | py/objstr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/objstr.c b/py/objstr.c index 321340eea..6ec997f4b 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -370,7 +370,7 @@ STATIC mp_obj_t str_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { #endif const byte *p = str_index_to_ptr(type, self_data, self_len, index, false); if (type == &mp_type_bytes) { - return MP_OBJ_NEW_SMALL_INT((mp_int_t)*p); + return MP_OBJ_NEW_SMALL_INT(*p); } else { return mp_obj_new_str((char*)p, 1, true); } @@ -1917,7 +1917,7 @@ STATIC mp_obj_t bytes_it_iternext(mp_obj_t self_in) { mp_obj_str_it_t *self = self_in; GET_STR_DATA_LEN(self->str, str, len); if (self->cur < len) { - mp_obj_t o_out = MP_OBJ_NEW_SMALL_INT((mp_int_t)str[self->cur]); + mp_obj_t o_out = MP_OBJ_NEW_SMALL_INT(str[self->cur]); self->cur += 1; return o_out; } else { |