diff options
| author | Nathan Moinvaziri <nathan@nathanm.com> | 2026-02-10 19:57:32 -0800 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2026-02-17 17:29:13 +0100 |
| commit | 927c5a46a72cf058043a4b792ff20d8b50a9f1ab (patch) | |
| tree | f7d82152fc403bc6696092961e0e985e449cd8a6 | |
| parent | bc681ebfc422048760950c095fccf64a10dcaebf (diff) | |
| download | Project-Tick-927c5a46a72cf058043a4b792ff20d8b50a9f1ab.tar.gz Project-Tick-927c5a46a72cf058043a4b792ff20d8b50a9f1ab.zip | |
Change zng_tr_stored_block/zng_tr_flush_block buf param to unsigned char *
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: ddbe63c4b22e
| -rw-r--r-- | deflate.c | 2 | ||||
| -rw-r--r-- | deflate.h | 4 | ||||
| -rw-r--r-- | deflate_p.h | 2 | ||||
| -rw-r--r-- | deflate_stored.c | 4 | ||||
| -rw-r--r-- | trees.c | 6 |
5 files changed, 9 insertions, 9 deletions
@@ -1002,7 +1002,7 @@ int32_t Z_EXPORT PREFIX(deflate)(PREFIX3(stream) *strm, int32_t flush) { if (flush == Z_PARTIAL_FLUSH) { zng_tr_align(s); } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ - zng_tr_stored_block(s, (char*)0, 0L, 0); + zng_tr_stored_block(s, NULL, 0L, 0); /* For a full flush, this empty block will be recognized * as a special marker by inflate_sync(). */ @@ -405,10 +405,10 @@ void Z_INTERNAL slide_hash_c(deflate_state *s); /* in trees.c */ void Z_INTERNAL zng_tr_init(deflate_state *s); -void Z_INTERNAL zng_tr_flush_block(deflate_state *s, char *buf, uint32_t stored_len, int last); +void Z_INTERNAL zng_tr_flush_block(deflate_state *s, unsigned char *buf, uint32_t stored_len, int last); void Z_INTERNAL zng_tr_flush_bits(deflate_state *s); void Z_INTERNAL zng_tr_align(deflate_state *s); -void Z_INTERNAL zng_tr_stored_block(deflate_state *s, char *buf, uint32_t stored_len, int last); +void Z_INTERNAL zng_tr_stored_block(deflate_state *s, unsigned char *buf, uint32_t stored_len, int last); void Z_INTERNAL PREFIX(flush_pending)(PREFIX3(streamp) strm); #define d_code(dist) ((dist) < 256 ? zng_dist_code[dist] : zng_dist_code[256+((dist)>>7)]) /* Mapping from a distance to a distance code. dist is the distance - 1 and diff --git a/deflate_p.h b/deflate_p.h index f7aea7eec2..e9ca871760 100644 --- a/deflate_p.h +++ b/deflate_p.h @@ -172,7 +172,7 @@ Z_FORCEINLINE static unsigned read_buf(PREFIX3(stream) *strm, unsigned char *buf */ #define FLUSH_BLOCK_ONLY(s, last) { \ zng_tr_flush_block(s, (s->block_start >= 0 ? \ - (char *)&s->window[(unsigned)s->block_start] : \ + &s->window[(unsigned)s->block_start] : \ NULL), \ (uint32_t)((int)s->strstart - s->block_start), \ (last)); \ diff --git a/deflate_stored.c b/deflate_stored.c index b8665ac054..f912f631b2 100644 --- a/deflate_stored.c +++ b/deflate_stored.c @@ -66,7 +66,7 @@ Z_INTERNAL block_state deflate_stored(deflate_state *s, int flush) { * including any pending bits. This also updates the debugging counts. */ last = flush == Z_FINISH && len == left + s->strm->avail_in ? 1 : 0; - zng_tr_stored_block(s, (char *)0, 0L, last); + zng_tr_stored_block(s, NULL, 0L, last); /* Replace the lengths in the dummy stored block with len. */ s->pending -= 4; @@ -177,7 +177,7 @@ Z_INTERNAL block_state deflate_stored(deflate_state *s, int flush) { if (left >= min_block || ((left || flush == Z_FINISH) && flush != Z_NO_FLUSH && s->strm->avail_in == 0 && left <= have)) { len = MIN(left, have); last = flush == Z_FINISH && s->strm->avail_in == 0 && len == left ? 1 : 0; - zng_tr_stored_block(s, (char *)s->window + s->block_start, len, last); + zng_tr_stored_block(s, s->window + s->block_start, len, last); s->block_start += (int)len; PREFIX(flush_pending)(s->strm); } @@ -592,7 +592,7 @@ static void send_all_trees(deflate_state *s, int lcodes, int dcodes, int blcodes /* =========================================================================== * Send a stored block */ -void Z_INTERNAL zng_tr_stored_block(deflate_state *s, char *buf, uint32_t stored_len, int last) { +void Z_INTERNAL zng_tr_stored_block(deflate_state *s, unsigned char *buf, uint32_t stored_len, int last) { /* buf: input block */ /* stored_len: length of input block */ /* last: one if this is the last block for a file */ @@ -604,7 +604,7 @@ void Z_INTERNAL zng_tr_stored_block(deflate_state *s, char *buf, uint32_t stored cmpr_bits_add(s, 32); sent_bits_add(s, 32); if (stored_len) { - memcpy(s->pending_buf + s->pending, (unsigned char *)buf, stored_len); + memcpy(s->pending_buf + s->pending, buf, stored_len); s->pending += stored_len; cmpr_bits_add(s, stored_len << 3); sent_bits_add(s, stored_len << 3); @@ -625,7 +625,7 @@ void Z_INTERNAL zng_tr_align(deflate_state *s) { * Determine the best encoding for the current block: dynamic trees, static * trees or store, and write out the encoded block. */ -void Z_INTERNAL zng_tr_flush_block(deflate_state *s, char *buf, uint32_t stored_len, int last) { +void Z_INTERNAL zng_tr_flush_block(deflate_state *s, unsigned char *buf, uint32_t stored_len, int last) { /* buf: input block, or NULL if too old */ /* stored_len: length of input block */ /* last: one if this is the last block for a file */ |
