diff --git a/Projects/32L4P5GDISCOVERY/Demonstrations/Watermark/lib/zlib-1.2.8/crc32.c b/Projects/32L4P5GDISCOVERY/Demonstrations/Watermark/lib/zlib-1.2.8/crc32.c index 730565e88..5ac41a21a 100644 --- a/Projects/32L4P5GDISCOVERY/Demonstrations/Watermark/lib/zlib-1.2.8/crc32.c +++ b/Projects/32L4P5GDISCOVERY/Demonstrations/Watermark/lib/zlib-1.2.8/crc32.c @@ -285,7 +285,7 @@ local unsigned long crc32_little(crc, buf, len) } /* ========================================================================= */ -#define DOBIG4 c ^= *++buf4; \ +#define DOBIG4 c ^= *buf4++; \ c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24] #define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 @@ -307,7 +307,6 @@ local unsigned long crc32_big(crc, buf, len) } buf4 = (const z_crc_t FAR *)(const void FAR *)buf; - buf4--; while (len >= 32) { DOBIG32; len -= 32; @@ -316,7 +315,6 @@ local unsigned long crc32_big(crc, buf, len) DOBIG4; len -= 4; } - buf4++; buf = (const unsigned char FAR *)buf4; if (len) do { diff --git a/Projects/32L4P5GDISCOVERY/Demonstrations/Watermark/lib/zlib-1.2.8/inftrees.c b/Projects/32L4P5GDISCOVERY/Demonstrations/Watermark/lib/zlib-1.2.8/inftrees.c index ec4b4ce67..c4fee9f6b 100644 --- a/Projects/32L4P5GDISCOVERY/Demonstrations/Watermark/lib/zlib-1.2.8/inftrees.c +++ b/Projects/32L4P5GDISCOVERY/Demonstrations/Watermark/lib/zlib-1.2.8/inftrees.c @@ -58,7 +58,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, unsigne code FAR *next; /* next available space in table */ const unsigned short FAR *base; /* base value table to use */ const unsigned short FAR *extra; /* extra bits table to use */ - int end; /* use base and extra for symbol > end */ + unsigned match; /* use base and extra for symbol >= match */ unsigned short count[MAXBITS+1]; /* number of codes of each length */ unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ static const unsigned short lbase[31] = { /* Length codes 257..285 base */ @@ -185,19 +185,17 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, unsigne switch (type) { case CODES: base = extra = work; /* dummy value--not used */ - end = 19; + match = 20; break; case LENS: base = lbase; - base -= 257; extra = lext; - extra -= 257; - end = 256; + match = 257; break; default: /* DISTS */ base = dbase; extra = dext; - end = -1; + match = 0; } /* initialize state for loop */ @@ -220,14 +218,13 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, unsigne for (;;) { /* create table entry */ here.bits = (unsigned char)(len - drop); - if ((int)(work[sym]) < end) { + if (work[sym] + 1 < match) { here.op = (unsigned char)0; here.val = work[sym]; } - else if ((int)(work[sym]) > end) { - here.op = (unsigned char)(extra[work[sym]]); - here.val = base[work[sym]]; - } + else if (work[sym] >= match) { + here.op = (unsigned char)(extra[work[sym] - match]); + here.val = base[work[sym] - match]; else { here.op = (unsigned char)(32 + 64); /* end of block */ here.val = 0;