summaryrefslogtreecommitdiff
path: root/py/modstruct.c
diff options
context:
space:
mode:
authorMark <56205165+gamblor21@users.noreply.github.com>2021-03-15 20:00:13 -0500
committerGitHub <noreply@github.com>2021-03-15 20:00:13 -0500
commite326d7ca800ce7101ddce001320c5349ee5ddeb6 (patch)
tree000a06790af7a8d27e9ba9fc27e10015815e1509 /py/modstruct.c
parent307d2a99febbf6cdff824131dddc2ef938f5ea13 (diff)
parentf7a988b9b307141611b07f6dc9da5b26e982c154 (diff)
Merge branch 'main' into rp_dp_parallel
Diffstat (limited to 'py/modstruct.c')
-rw-r--r--py/modstruct.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/py/modstruct.c b/py/modstruct.c
index 7675de275..1c5319608 100644
--- a/py/modstruct.c
+++ b/py/modstruct.c
@@ -186,11 +186,11 @@ STATIC void struct_pack_into_internal(mp_obj_t fmt_in, byte *p, size_t n_args, c
size_t size;
size_t count = calc_size_items(mp_obj_str_get_str(fmt_in), &size);
if (count != n_args) {
-#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
+ #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
mp_raise_ValueError(NULL);
-#else
+ #else
mp_raise_ValueError_varg(translate("pack expected %d items for packing (got %d)"), count, n_args);
-#endif
+ #endif
}
const char *fmt = mp_obj_str_get_str(fmt_in);
char fmt_type = get_fmt_type(&fmt);
@@ -229,7 +229,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);
@@ -275,7 +275,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