diff options
author | Damien George <damien.p.george@gmail.com> | 2019-12-16 15:40:05 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-12-27 22:51:17 +1100 |
commit | 09376f0e47b3ab4a5a2a3c2c768ff913e1835cc8 (patch) | |
tree | 4fd6399e318c977b3ddd20c13659f176b70f3f5b /py/objproperty.c | |
parent | f5eec903fa961135296e2656821450979e413248 (diff) |
py: Introduce MP_ROM_NONE macro for ROM to refer to None object.
This helps to prevent mistakes, and allows easily changing the ROM value of
None if needed.
Diffstat (limited to 'py/objproperty.c')
-rw-r--r-- | py/objproperty.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/objproperty.c b/py/objproperty.c index 49cb9ca1b..2a7844b60 100644 --- a/py/objproperty.c +++ b/py/objproperty.c @@ -39,10 +39,10 @@ typedef struct _mp_obj_property_t { STATIC mp_obj_t property_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { enum { ARG_fget, ARG_fset, ARG_fdel, ARG_doc }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} }, - { MP_QSTR_, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} }, - { MP_QSTR_, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} }, - { MP_QSTR_doc, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} }, + { MP_QSTR_, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE} }, + { MP_QSTR_, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE} }, + { MP_QSTR_, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE} }, + { MP_QSTR_doc, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE} }, }; mp_arg_val_t vals[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, args, MP_ARRAY_SIZE(allowed_args), allowed_args, vals); |