diff options
Diffstat (limited to 'py/objstringio.c')
-rw-r--r-- | py/objstringio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/py/objstringio.c b/py/objstringio.c index bffdf2cf79..70f0c68dd4 100644 --- a/py/objstringio.c +++ b/py/objstringio.c @@ -51,7 +51,7 @@ STATIC void stringio_print(void (*print)(void *env, const char *fmt, ...), void print(env, self->base.type == &mp_type_stringio ? "<io.StringIO 0x%x>" : "<io.BytesIO 0x%x>", self->vstr); } -STATIC mp_int_t stringio_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *errcode) { +STATIC mp_uint_t stringio_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *errcode) { mp_obj_stringio_t *o = o_in; mp_uint_t remaining = o->vstr->len - o->pos; if (size > remaining) { @@ -62,7 +62,7 @@ STATIC mp_int_t stringio_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *err return size; } -STATIC mp_int_t stringio_write(mp_obj_t o_in, const void *buf, mp_uint_t size, int *errcode) { +STATIC mp_uint_t stringio_write(mp_obj_t o_in, const void *buf, mp_uint_t size, int *errcode) { mp_obj_stringio_t *o = o_in; mp_uint_t remaining = o->vstr->alloc - o->pos; if (size > remaining) { @@ -137,12 +137,12 @@ STATIC MP_DEFINE_CONST_DICT(stringio_locals_dict, stringio_locals_dict_table); STATIC const mp_stream_p_t stringio_stream_p = { .read = stringio_read, .write = stringio_write, + .is_text = true, }; STATIC const mp_stream_p_t bytesio_stream_p = { .read = stringio_read, .write = stringio_write, - .is_bytes = true, }; const mp_obj_type_t mp_type_stringio = { |