diff options
author | Paul Eggert <eggert@trombone> | 2022-06-27 13:16:28 -0500 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2022-06-28 22:42:11 -0500 |
commit | 85e0910e6ec2b81ff4b9232015a30b369aef8c0c (patch) | |
tree | 93fbc8b057058362b08c14c1c8b2a76fc037c7cb /inflate.c | |
parent | 83c65d124deba617ec0f5af9f2002b289ac18ba7 (diff) | |
download | gzip-85e0910e6ec2b81ff4b9232015a30b369aef8c0c.tar.gz |
gzip: match printf format to arg type
This pacifies gcc -Wformat -DDEBUG.
* bits.c (send_bits):
* deflate.c (check_match):
* inflate.c (huft_build, inflate_codes):
* trees.c (send_code, gen_codes, flush_block):
Use correct printf formats for signed vs unsigned integers.
Diffstat (limited to 'inflate.c')
-rw-r--r-- | inflate.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -310,8 +310,18 @@ int *m /* maximum lookup bits, returns actual */ memzero(c, sizeof(c)); p = b; i = n; do { - Tracecv(*p, (stderr, (n-i >= ' ' && n-i <= '~' ? "%c %d\n" : "0x%x %d\n"), - n-i, *p)); +#ifdef DEBUG + if (1 < verbose && *p) + { + if (' ' <= n - i && n - i <= '~') + { + char ch = n - i; + fprintf (stderr, "%c %u\n", ch, *p); + } + else + fprintf (stderr, "0x%x %u\n", n - i, *p); + } +#endif c[*p]++; /* assume all entries <= BMAX */ p++; /* Can't combine with above line (Solaris bug) */ } while (--i); @@ -572,7 +582,7 @@ inflate_codes(struct huft *tl, struct huft *td, int bl, int bd) NEEDBITS(e) d = w - t->v.n - ((unsigned)b & mask_bits[e]); DUMPBITS(e) - Tracevv((stderr,"\\[%d,%d]", w-d, n)); + Tracevv ((stderr, "\\[%u,%u]", w - d, n)); /* do the copy */ do { |