summaryrefslogtreecommitdiff
path: root/extmod/moduzlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'extmod/moduzlib.c')
-rw-r--r--extmod/moduzlib.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/extmod/moduzlib.c b/extmod/moduzlib.c
index b344f9642..9c80f1632 100644
--- a/extmod/moduzlib.c
+++ b/extmod/moduzlib.c
@@ -31,9 +31,9 @@ typedef struct _mp_obj_decompio_t {
} mp_obj_decompio_t;
STATIC int read_src_stream(TINF_DATA *data) {
- byte *p = (void*)data;
+ byte *p = (void *)data;
p -= offsetof(mp_obj_decompio_t, decomp);
- mp_obj_decompio_t *self = (mp_obj_decompio_t*)p;
+ mp_obj_decompio_t *self = (mp_obj_decompio_t *)p;
const mp_stream_p_t *stream = mp_get_stream(self->src_stream);
int err;
@@ -73,7 +73,7 @@ STATIC mp_obj_t decompio_make_new(const mp_obj_type_t *type, size_t n_args, cons
} else if (dict_opt >= 0) {
dict_opt = uzlib_zlib_parse_header(&o->decomp);
if (dict_opt < 0) {
-header_error:
+ header_error:
mp_raise_ValueError(translate("compression header"));
}
dict_sz = 1 << dict_opt;
@@ -92,7 +92,7 @@ STATIC mp_uint_t decompio_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *er
}
o->decomp.dest = buf;
- o->decomp.dest_limit = (unsigned char*)buf+size;
+ o->decomp.dest_limit = (unsigned char *)buf + size;
int st = uzlib_uncompress_chksum(&o->decomp);
if (st == TINF_DONE) {
o->eof = true;
@@ -101,7 +101,7 @@ STATIC mp_uint_t decompio_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *er
*errcode = MP_EINVAL;
return MP_STREAM_ERROR;
}
- return o->decomp.dest - (byte*)buf;
+ return o->decomp.dest - (byte *)buf;
}
STATIC const mp_rom_map_elem_t decompio_locals_dict_table[] = {
@@ -122,7 +122,7 @@ STATIC const mp_obj_type_t decompio_type = {
.name = MP_QSTR_DecompIO,
.make_new = decompio_make_new,
.protocol = &decompio_stream_p,
- .locals_dict = (void*)&decompio_locals_dict,
+ .locals_dict = (void *)&decompio_locals_dict,
};
STATIC mp_obj_t mod_uzlib_decompress(size_t n_args, const mp_obj_t *args) {
@@ -138,7 +138,7 @@ STATIC mp_obj_t mod_uzlib_decompress(size_t n_args, const mp_obj_t *args) {
byte *dest_buf = m_new(byte, dest_buf_size);
decomp->dest = dest_buf;
- decomp->dest_limit = dest_buf+dest_buf_size;
+ decomp->dest_limit = dest_buf + dest_buf_size;
DEBUG_printf("uzlib: Initial out buffer: " UINT_FMT " bytes\n", decomp->destSize);
decomp->source = bufinfo.buf;
decomp->source_limit = (unsigned char *)bufinfo.buf + bufinfo.len;
@@ -173,7 +173,7 @@ STATIC mp_obj_t mod_uzlib_decompress(size_t n_args, const mp_obj_t *args) {
mp_uint_t final_sz = decomp->dest - dest_buf;
DEBUG_printf("uzlib: Resizing from " UINT_FMT " to final size: " UINT_FMT " bytes\n", dest_buf_size, final_sz);
- dest_buf = (byte*)m_renew(byte, dest_buf, dest_buf_size, final_sz);
+ dest_buf = (byte *)m_renew(byte, dest_buf, dest_buf_size, final_sz);
mp_obj_t res = mp_obj_new_bytearray_by_ref(final_sz, dest_buf);
m_del_obj(TINF_DATA, decomp);
return res;
@@ -193,7 +193,7 @@ STATIC MP_DEFINE_CONST_DICT(mp_module_uzlib_globals, mp_module_uzlib_globals_tab
const mp_obj_module_t mp_module_uzlib = {
.base = { &mp_type_module },
- .globals = (mp_obj_dict_t*)&mp_module_uzlib_globals,
+ .globals = (mp_obj_dict_t *)&mp_module_uzlib_globals,
};
// Source files #include'd here to make sure they're compiled in