Skip to content

Commit 02894b5

Browse files
committed
extmod: Update uzlib to 1.2.1.
Fixes for compiler warnings in pedantic mode.
1 parent d7194f1 commit 02894b5

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

extmod/uzlib/tinf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int TINFCC tinf_zlib_uncompress_dyn(TINF_DATA *d, unsigned int sourceLen);
7676

7777
/* high-level API */
7878

79-
void TINFCC tinf_init();
79+
void TINFCC tinf_init(void);
8080

8181
int TINFCC tinf_uncompress(void *dest, unsigned int *destLen,
8282
const void *source, unsigned int sourceLen);

extmod/uzlib/tinflate.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,8 @@ static int tinf_inflate_block_data(TINF_DATA *d, TINF_TREE *lt, TINF_TREE *dt)
341341

342342
} else {
343343

344-
int length, dist, offs;
345-
int i;
344+
unsigned int length, offs, i;
345+
int dist;
346346

347347
sym -= 257;
348348

@@ -363,7 +363,7 @@ static int tinf_inflate_block_data(TINF_DATA *d, TINF_TREE *lt, TINF_TREE *dt)
363363
/* copy match */
364364
for (i = 0; i < length; ++i)
365365
{
366-
d->dest[i] = d->dest[i - offs];
366+
d->dest[i] = d->dest[(int)(i - offs)];
367367
}
368368

369369
d->dest += length;
@@ -432,7 +432,7 @@ static int tinf_inflate_dynamic_block(TINF_DATA *d)
432432
* ---------------------- */
433433

434434
/* initialize global (static) data */
435-
void tinf_init()
435+
void tinf_init(void)
436436
{
437437
#ifdef RUNTIME_BITS_TABLES
438438
/* build extra bits and base tables */
@@ -449,6 +449,7 @@ void tinf_init()
449449
int tinf_uncompress(void *dest, unsigned int *destLen,
450450
const void *source, unsigned int sourceLen)
451451
{
452+
(void)sourceLen;
452453
TINF_DATA d;
453454
int res;
454455

0 commit comments

Comments
 (0)