diff options
author | Damien George <damien.p.george@gmail.com> | 2015-11-27 13:38:15 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-11-29 14:25:04 +0000 |
commit | cbf7674025814797f5c537d6d1c195efe58ccaaf (patch) | |
tree | 7c1e5d7956d3766dad4c194ab00024e2a954bcf9 /py/objint.c | |
parent | 94fe6e523d42ecc342c1f6a9734ed2edf232ddbd (diff) |
py: Add MP_ROM_* macros and mp_rom_* types and use them.
Diffstat (limited to 'py/objint.c')
-rw-r--r-- | py/objint.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/objint.c b/py/objint.c index dcc771ec2..8e9325960 100644 --- a/py/objint.c +++ b/py/objint.c @@ -392,7 +392,7 @@ STATIC mp_obj_t int_from_bytes(mp_uint_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(int_from_bytes_fun_obj, 2, 3, int_from_bytes); -STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(int_from_bytes_obj, (const mp_obj_t)&int_from_bytes_fun_obj); +STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(int_from_bytes_obj, MP_ROM_PTR(&int_from_bytes_fun_obj)); STATIC mp_obj_t int_to_bytes(mp_uint_t n_args, const mp_obj_t *args) { // TODO: Support byteorder param (assumes 'little') @@ -420,9 +420,9 @@ STATIC mp_obj_t int_to_bytes(mp_uint_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(int_to_bytes_obj, 2, 4, int_to_bytes); -STATIC const mp_map_elem_t int_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_from_bytes), (mp_obj_t)&int_from_bytes_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_to_bytes), (mp_obj_t)&int_to_bytes_obj }, +STATIC const mp_rom_map_elem_t int_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_from_bytes), MP_ROM_PTR(&int_from_bytes_obj) }, + { MP_ROM_QSTR(MP_QSTR_to_bytes), MP_ROM_PTR(&int_to_bytes_obj) }, }; STATIC MP_DEFINE_CONST_DICT(int_locals_dict, int_locals_dict_table); |