mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 01:08:15 +01:00
Update MicroPython from 1.12 to 1.17
This commit is contained in:
@@ -141,7 +141,7 @@ STATIC mp_obj_t struct_unpack_from(size_t n_args, const mp_obj_t *args) {
|
||||
// negative offsets are relative to the end of the buffer
|
||||
offset = bufinfo.len + offset;
|
||||
if (offset < 0) {
|
||||
mp_raise_ValueError("buffer too small");
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("buffer too small"));
|
||||
}
|
||||
}
|
||||
p += offset;
|
||||
@@ -150,7 +150,7 @@ STATIC mp_obj_t struct_unpack_from(size_t n_args, const mp_obj_t *args) {
|
||||
|
||||
// Check that the input buffer is big enough to unpack all the values
|
||||
if (p + total_sz > end_p) {
|
||||
mp_raise_ValueError("buffer too small");
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("buffer too small"));
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < num_items;) {
|
||||
@@ -217,7 +217,7 @@ STATIC mp_obj_t struct_pack(size_t n_args, const mp_obj_t *args) {
|
||||
mp_int_t size = MP_OBJ_SMALL_INT_VALUE(struct_calcsize(args[0]));
|
||||
vstr_t vstr;
|
||||
vstr_init_len(&vstr, size);
|
||||
byte *p = (byte*)vstr.buf;
|
||||
byte *p = (byte *)vstr.buf;
|
||||
memset(p, 0, size);
|
||||
struct_pack_into_internal(args[0], p, n_args - 1, &args[1]);
|
||||
return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);
|
||||
@@ -232,7 +232,7 @@ STATIC mp_obj_t struct_pack_into(size_t n_args, const mp_obj_t *args) {
|
||||
// negative offsets are relative to the end of the buffer
|
||||
offset = (mp_int_t)bufinfo.len + offset;
|
||||
if (offset < 0) {
|
||||
mp_raise_ValueError("buffer too small");
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("buffer too small"));
|
||||
}
|
||||
}
|
||||
byte *p = (byte *)bufinfo.buf;
|
||||
@@ -242,7 +242,7 @@ STATIC mp_obj_t struct_pack_into(size_t n_args, const mp_obj_t *args) {
|
||||
// Check that the output buffer is big enough to hold all the values
|
||||
mp_int_t sz = MP_OBJ_SMALL_INT_VALUE(struct_calcsize(args[0]));
|
||||
if (p + sz > end_p) {
|
||||
mp_raise_ValueError("buffer too small");
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("buffer too small"));
|
||||
}
|
||||
|
||||
struct_pack_into_internal(args[0], p, n_args - 3, &args[3]);
|
||||
@@ -263,7 +263,7 @@ STATIC MP_DEFINE_CONST_DICT(mp_module_struct_globals, mp_module_struct_globals_t
|
||||
|
||||
const mp_obj_module_t mp_module_ustruct = {
|
||||
.base = { &mp_type_module },
|
||||
.globals = (mp_obj_dict_t*)&mp_module_struct_globals,
|
||||
.globals = (mp_obj_dict_t *)&mp_module_struct_globals,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user