diff options
author | Damien George <damien.p.george@gmail.com> | 2014-07-03 13:25:24 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-07-03 13:25:24 +0100 |
commit | 40f3c026823f8951a2fa04e9c7fc93c75bc27bec (patch) | |
tree | c9c8210654c7114f00c5234a8481d9b5fbd28ce0 /py/builtin.c | |
parent | 065aba587571150074ea79483ffa72c0fe6bc8c8 (diff) | |
download | micropython-40f3c026823f8951a2fa04e9c7fc93c75bc27bec.tar.gz micropython-40f3c026823f8951a2fa04e9c7fc93c75bc27bec.zip |
Rename machine_(u)int_t to mp_(u)int_t.
See discussion in issue #50.
Diffstat (limited to 'py/builtin.c')
-rw-r--r-- | py/builtin.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/py/builtin.c b/py/builtin.c index f4bbe0e237..e723fad334 100644 --- a/py/builtin.c +++ b/py/builtin.c @@ -99,7 +99,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin___repl_print___obj, mp_builtin___repl_print mp_obj_t mp_builtin_abs(mp_obj_t o_in) { if (MP_OBJ_IS_SMALL_INT(o_in)) { - mp_small_int_t val = MP_OBJ_SMALL_INT_VALUE(o_in); + mp_int_t val = MP_OBJ_SMALL_INT_VALUE(o_in); if (val < 0) { val = -val; } @@ -173,7 +173,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin_callable_obj, mp_builtin_callable); STATIC mp_obj_t mp_builtin_chr(mp_obj_t o_in) { #if MICROPY_PY_BUILTINS_STR_UNICODE - machine_int_t c = mp_obj_get_int(o_in); + mp_int_t c = mp_obj_get_int(o_in); char str[4]; int len = 0; if (c < 0x80) { @@ -198,7 +198,7 @@ STATIC mp_obj_t mp_builtin_chr(mp_obj_t o_in) { } return mp_obj_new_str(str, len, true); #else - machine_int_t ord = mp_obj_get_int(o_in); + mp_int_t ord = mp_obj_get_int(o_in); if (0 <= ord && ord <= 0x10ffff) { char str[1] = {ord}; return mp_obj_new_str(str, 1, true); @@ -250,8 +250,8 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_dir_obj, 0, 1, mp_builtin_dir); STATIC mp_obj_t mp_builtin_divmod(mp_obj_t o1_in, mp_obj_t o2_in) { if (MP_OBJ_IS_SMALL_INT(o1_in) && MP_OBJ_IS_SMALL_INT(o2_in)) { - mp_small_int_t i1 = MP_OBJ_SMALL_INT_VALUE(o1_in); - mp_small_int_t i2 = MP_OBJ_SMALL_INT_VALUE(o2_in); + mp_int_t i1 = MP_OBJ_SMALL_INT_VALUE(o1_in); + mp_int_t i2 = MP_OBJ_SMALL_INT_VALUE(o2_in); mp_obj_t args[2]; args[0] = MP_OBJ_NEW_SMALL_INT(i1 / i2); args[1] = MP_OBJ_NEW_SMALL_INT(i1 % i2); @@ -372,11 +372,11 @@ STATIC mp_obj_t mp_builtin_ord(mp_obj_t o_in) { uint len; const char *str = mp_obj_str_get_data(o_in, &len); #if MICROPY_PY_BUILTINS_STR_UNICODE - machine_uint_t charlen = unichar_charlen(str, len); + mp_uint_t charlen = unichar_charlen(str, len); if (charlen == 1) { if (MP_OBJ_IS_STR(o_in) && UTF8_IS_NONASCII(*str)) { - machine_int_t ord = *str++ & 0x7F; - for (machine_int_t mask = 0x40; ord & mask; mask >>= 1) { + mp_int_t ord = *str++ & 0x7F; + for (mp_int_t mask = 0x40; ord & mask; mask >>= 1) { ord &= ~mask; } while (UTF8_IS_CONT(*str)) { @@ -478,7 +478,7 @@ STATIC mp_obj_t mp_builtin_sorted(uint n_args, const mp_obj_t *args, mp_map_t *k MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_sorted_obj, 1, mp_builtin_sorted); STATIC mp_obj_t mp_builtin_id(mp_obj_t o_in) { - return mp_obj_new_int((machine_int_t)o_in); + return mp_obj_new_int((mp_int_t)o_in); } MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin_id_obj, mp_builtin_id); |