mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
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
@@ -176,15 +176,17 @@ STATIC const mp_stream_p_t vfs_fat_fileio_stream_p = {
|
||||
.ioctl = file_obj_ioctl,
|
||||
};
|
||||
|
||||
const mp_obj_type_t mp_type_vfs_fat_fileio = {
|
||||
{ &mp_type_type },
|
||||
.name = MP_QSTR_FileIO,
|
||||
.print = file_obj_print,
|
||||
.getiter = mp_identity_getiter,
|
||||
.iternext = mp_stream_unbuffered_iter,
|
||||
.protocol = &vfs_fat_fileio_stream_p,
|
||||
.locals_dict = (mp_obj_dict_t *)&vfs_fat_rawfile_locals_dict,
|
||||
};
|
||||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_vfs_fat_fileio,
|
||||
MP_QSTR_FileIO,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, file_obj_print,
|
||||
getiter, mp_identity_getiter,
|
||||
iternext, mp_stream_unbuffered_iter,
|
||||
protocol, &vfs_fat_fileio_stream_p,
|
||||
locals_dict, (mp_obj_dict_t *)&vfs_fat_rawfile_locals_dict
|
||||
);
|
||||
|
||||
STATIC const mp_stream_p_t vfs_fat_textio_stream_p = {
|
||||
.read = file_obj_read,
|
||||
@@ -193,15 +195,17 @@ STATIC const mp_stream_p_t vfs_fat_textio_stream_p = {
|
||||
.is_text = true,
|
||||
};
|
||||
|
||||
const mp_obj_type_t mp_type_vfs_fat_textio = {
|
||||
{ &mp_type_type },
|
||||
.name = MP_QSTR_TextIOWrapper,
|
||||
.print = file_obj_print,
|
||||
.getiter = mp_identity_getiter,
|
||||
.iternext = mp_stream_unbuffered_iter,
|
||||
.protocol = &vfs_fat_textio_stream_p,
|
||||
.locals_dict = (mp_obj_dict_t *)&vfs_fat_rawfile_locals_dict,
|
||||
};
|
||||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_vfs_fat_textio,
|
||||
MP_QSTR_TextIOWrapper,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, file_obj_print,
|
||||
getiter, mp_identity_getiter,
|
||||
iternext, mp_stream_unbuffered_iter,
|
||||
protocol, &vfs_fat_textio_stream_p,
|
||||
locals_dict, (mp_obj_dict_t *)&vfs_fat_rawfile_locals_dict
|
||||
);
|
||||
|
||||
// Factory function for I/O stream classes
|
||||
STATIC mp_obj_t fat_vfs_open(mp_obj_t self_in, mp_obj_t path_in, mp_obj_t mode_in) {
|
||||
|
||||
Reference in New Issue
Block a user