[python] upgrade to micropython 1.12

This commit is contained in:
Émilie Feral
2020-04-06 14:57:17 +02:00
committed by LeaNumworks
parent 010fb1894f
commit 7df8c2935a
83 changed files with 3516 additions and 1284 deletions

View File

@@ -70,9 +70,9 @@ STATIC mp_uint_t stringio_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *er
STATIC void stringio_copy_on_write(mp_obj_stringio_t *o) {
const void *buf = o->vstr->buf;
o->vstr->buf = m_new(char, o->vstr->len);
memcpy(o->vstr->buf, buf, o->vstr->len);
o->vstr->fixed_buf = false;
o->ref_obj = MP_OBJ_NULL;
memcpy(o->vstr->buf, buf, o->vstr->len);
}
STATIC mp_uint_t stringio_write(mp_obj_t o_in, const void *buf, mp_uint_t size, int *errcode) {
@@ -244,12 +244,6 @@ STATIC const mp_stream_p_t stringio_stream_p = {
.is_text = true,
};
STATIC const mp_stream_p_t bytesio_stream_p = {
.read = stringio_read,
.write = stringio_write,
.ioctl = stringio_ioctl,
};
const mp_obj_type_t mp_type_stringio = {
{ &mp_type_type },
.name = MP_QSTR_StringIO,
@@ -262,6 +256,12 @@ const mp_obj_type_t mp_type_stringio = {
};
#if MICROPY_PY_IO_BYTESIO
STATIC const mp_stream_p_t bytesio_stream_p = {
.read = stringio_read,
.write = stringio_write,
.ioctl = stringio_ioctl,
};
const mp_obj_type_t mp_type_bytesio = {
{ &mp_type_type },
.name = MP_QSTR_BytesIO,