From e47ae4abdbbba521869d326defb43fbbfa7e11ad Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Fri, 3 Apr 2026 18:57:24 -0700 Subject: [PATCH] Clean up debug sign conversions in deflate check_match calls. Cast match_len/prev_length to int at check_match call sites to avoid implicit unsigned-to-signed conversion warnings. Upstream: https://github.com/madler/zlib/commit/f4f34491 --- deflate_p.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deflate_p.h b/deflate_p.h index ba9c1eb9f..a69476a93 100644 --- a/deflate_p.h +++ b/deflate_p.h @@ -19,21 +19,21 @@ /* =========================================================================== * Check that the match at match_start is indeed a match. */ -static inline void check_match(deflate_state *s, uint32_t start, uint32_t match, int length) { +static inline void check_match(deflate_state *s, uint32_t start, uint32_t match, uint32_t length) { /* check that the match length is valid*/ if (length < STD_MIN_MATCH || length > STD_MAX_MATCH) { - fprintf(stderr, " start %u, match %u, length %d\n", start, match, length); + fprintf(stderr, " start %u, match %u, length %u\n", start, match, length); z_error("invalid match length"); } /* check that the match isn't at the same position as the start string */ if (match == start) { - fprintf(stderr, " start %u, match %u, length %d\n", start, match, length); + fprintf(stderr, " start %u, match %u, length %u\n", start, match, length); z_error("invalid match position"); } /* check that the match is indeed a match */ if (memcmp(s->window + match, s->window + start, length) != 0) { int32_t i = 0; - fprintf(stderr, " start %u, match %u, length %d\n", start, match, length); + fprintf(stderr, " start %u, match %u, length %u\n", start, match, length); do { fprintf(stderr, " %03d: match [%02x] start [%02x]\n", i++, s->window[match++], s->window[start++]); @@ -41,7 +41,7 @@ static inline void check_match(deflate_state *s, uint32_t start, uint32_t match, z_error("invalid match"); } if (z_verbose > 1) { - fprintf(stderr, "\\[%u,%d]", start-match, length); + fprintf(stderr, "\\[%u,%u]", start-match, length); do { putc(s->window[start++], stderr); } while (--length != 0); -- 2.47.3