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>
This commit is contained in:
committed by
Damien George
parent
cdb880789f
commit
662b9761b3
@@ -244,16 +244,17 @@ STATIC const mp_stream_p_t stringio_stream_p = {
|
||||
.is_text = true,
|
||||
};
|
||||
|
||||
const mp_obj_type_t mp_type_stringio = {
|
||||
{ &mp_type_type },
|
||||
.name = MP_QSTR_StringIO,
|
||||
.print = stringio_print,
|
||||
.make_new = stringio_make_new,
|
||||
.getiter = mp_identity_getiter,
|
||||
.iternext = mp_stream_unbuffered_iter,
|
||||
.protocol = &stringio_stream_p,
|
||||
.locals_dict = (mp_obj_dict_t *)&stringio_locals_dict,
|
||||
};
|
||||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_stringio,
|
||||
MP_QSTR_StringIO,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
stringio_make_new,
|
||||
print, stringio_print,
|
||||
getiter, mp_identity_getiter,
|
||||
iternext, mp_stream_unbuffered_iter,
|
||||
protocol, &stringio_stream_p,
|
||||
locals_dict, (mp_obj_dict_t *)&stringio_locals_dict
|
||||
);
|
||||
|
||||
#if MICROPY_PY_IO_BYTESIO
|
||||
STATIC const mp_stream_p_t bytesio_stream_p = {
|
||||
@@ -262,16 +263,17 @@ STATIC const mp_stream_p_t bytesio_stream_p = {
|
||||
.ioctl = stringio_ioctl,
|
||||
};
|
||||
|
||||
const mp_obj_type_t mp_type_bytesio = {
|
||||
{ &mp_type_type },
|
||||
.name = MP_QSTR_BytesIO,
|
||||
.print = stringio_print,
|
||||
.make_new = stringio_make_new,
|
||||
.getiter = mp_identity_getiter,
|
||||
.iternext = mp_stream_unbuffered_iter,
|
||||
.protocol = &bytesio_stream_p,
|
||||
.locals_dict = (mp_obj_dict_t *)&stringio_locals_dict,
|
||||
};
|
||||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_bytesio,
|
||||
MP_QSTR_BytesIO,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
stringio_make_new,
|
||||
print, stringio_print,
|
||||
getiter, mp_identity_getiter,
|
||||
iternext, mp_stream_unbuffered_iter,
|
||||
protocol, &bytesio_stream_p,
|
||||
locals_dict, (mp_obj_dict_t *)&stringio_locals_dict
|
||||
);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user