diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2021-07-14 14:38:38 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-09-19 19:06:01 +1000 |
commit | 662b9761b37b054f08fe2f7c00d0fce3a418d0b0 (patch) | |
tree | 3ab168faeb26685d511bf47caa21d2eabdd86c69 /py/objsingleton.c | |
parent | cdb880789f61ee037cc7905ad75a7a9201d12ba5 (diff) |
all: Make all mp_obj_type_t defs use MP_DEFINE_CONST_OBJ_TYPE.
In preparation for upcoming rework of mp_obj_type_t layout.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/objsingleton.c')
-rw-r--r-- | py/objsingleton.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/py/objsingleton.c b/py/objsingleton.c index 2b896305c..4a099657d 100644 --- a/py/objsingleton.c +++ b/py/objsingleton.c @@ -43,12 +43,11 @@ STATIC void singleton_print(const mp_print_t *print, mp_obj_t self_in, mp_print_ mp_printf(print, "%q", self->name); } -const mp_obj_type_t mp_type_singleton = { - { &mp_type_type }, - .name = MP_QSTR_, - .print = singleton_print, - .unary_op = mp_generic_unary_op, -}; +MP_DEFINE_CONST_OBJ_TYPE( + mp_type_singleton, MP_QSTR_, MP_TYPE_FLAG_NONE, MP_TYPE_NULL_MAKE_NEW, + print, singleton_print, + unary_op, mp_generic_unary_op + ); const mp_obj_singleton_t mp_const_ellipsis_obj = {{&mp_type_singleton}, MP_QSTR_Ellipsis}; #if MICROPY_PY_BUILTINS_NOTIMPLEMENTED |