(libz) Clang does not like this at all - warning: possible misuse of comma operator here [-Wcomma]

This commit is contained in:
twinaphex 2021-08-12 19:00:59 +02:00
parent 5b3942eae7
commit e9e6607fc9
2 changed files with 13 additions and 5 deletions

6
deps/libz/deflate.c vendored
View File

@ -1511,7 +1511,8 @@ static uInt longest_match(deflate_state *s, IPos cur_match)
* are always equal when the other bytes match, given that
* the hash keys are equal and that HASH_BITS >= 8.
*/
scan += 2, match++;
scan += 2;
match++;
Assert(*scan == *match, "match[2]?");
/* We check for insufficient lookahead only every 8th comparison;
@ -1585,7 +1586,8 @@ static uInt longest_match(s, cur_match)
* are always equal when the other bytes match, given that
* the hash keys are equal and that HASH_BITS >= 8.
*/
scan += 2, match += 2;
scan += 2;
match += 2;
Assert(*scan == *match, "match[2]?");
/* We check for insufficient lookahead only every 8th comparison;

12
deps/libz/trees.c vendored
View File

@ -262,7 +262,11 @@ static void gen_bitlen(deflate_state *s, tree_desc *desc)
for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
n = s->heap[h];
bits = tree[tree[n].Dad].Len + 1;
if (bits > max_length) bits = max_length, overflow++;
if (bits > max_length)
{
bits = max_length;
overflow++;
}
tree[n].Len = (ush)bits;
/* We overwrite tree[n].Dad which is no longer needed */
@ -373,7 +377,8 @@ static void build_tree(deflate_state *s, tree_desc *desc)
* heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
* heap[0] is not used.
*/
s->heap_len = 0, s->heap_max = HEAP_SIZE;
s->heap_len = 0;
s->heap_max = HEAP_SIZE;
for (n = 0; n < elems; n++) {
if (tree[n].Freq != 0) {
@ -856,7 +861,8 @@ void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf, ulg stored_len,
register unsigned res = 0;
do {
res |= codes & 1;
codes >>= 1, res <<= 1;
codes >>= 1;
res <<= 1;
} while (--len > 0);
return res >> 1;
}