Commit Graph

15 Commits

Author SHA1 Message Date
Mika Lindqvist
43b2703435 Fix shift overflow in inflate and send_code. 2025-02-08 21:43:51 +01:00
Hans Kristian Rosbach
839c4ec998 inttypes.h includes stdint.h, so only include one of them. 2021-12-19 15:40:19 +01:00
Nathan Moinvaziri
0af8678307 Fixed undefined behavior of isgraph when character is not in the range 0 through 0xFF inclusive. 2021-09-03 11:21:09 +02:00
Nathan Moinvaziri
857e4f1e04 Added Z_UNUSED define for ignore unused variables. 2021-06-18 09:16:44 +02:00
Hans Kristian Rosbach
cf9127a231 Separate MIN_MATCH into STD_MIN_MATCH and WANT_MIN_MATCH
Rename MAX_MATCH to STD_MAX_MATCH
2021-06-13 20:55:01 +02:00
Nathan Moinvaziri
7cffba4dd6 Rename ZLIB_INTERNAL to Z_INTERNAL for consistency. 2020-08-31 12:33:16 +02:00
Nathan Moinvaziri
899f0720ec Renamed trees_p.h to trees.h. 2020-08-27 19:19:30 +02:00
Ilya Leoshkevich
1d2504ddc4 send_bits_trace: placate -Wformat
value, which can be uint64_t, is printed using %llx, which, strictly
speaking, is not correct, and triggers -Wformat.

Since we don't really know what type value can have (send_bits_trace
is a macro), don't use <inttypes.h>, but rather cast it to long long.
Also cast length to int in order to prevent similar issues in the
future.
2020-08-23 10:07:07 +02:00
Josh Triplett
1a46fb9ee1 Fix testsuite warnings on Windows, using PRIu64
zlib-ng already counts on inttypes.h and stdint.h, so use those to avoid
printf-related warnings by casting integer fields whose size may vary to
uint64_t and printing them that way.
2020-08-20 12:05:55 +02:00
Nathan Moinvaziri
2473943ecc Cast distance code to uint64_t before shifting in zng_emit_dist. 2020-06-08 21:13:01 +02:00
Nathan Moinvaziri
1b054601f9 Fixed arithmetic overflow when emitting deflate header bits.
Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value.
      Results might not be an expected value.
2020-06-08 21:13:01 +02:00
Nathan Moinvaziri
78a9f84fd6 Fixed warning about bi_flush being defined but not used. #592
trees_emit.h:75:13: warning: ‘bi_flush’ defined but not used
2020-05-30 21:25:18 +02:00
Nathan Moinvaziri
6fb4e882a6 Fixed zero length stored block left open when using Z_SYNC_FLUSH. Moved toggling of block_open back to deflate_quick since zero length stored block doesn't emit end of block code. 2020-05-25 16:40:56 +02:00
Nathan Moinvaziri
600dcc3012 Use 64-bit bit buffer when emitting codes. 2020-05-24 14:06:57 +02:00
Nathan Moinvaziri
e3c858c2c7 Split tree emitting code into its own source header to be included by both trees.c and deflate_quick.c so that their functions can be statically linked for performance reasons. 2020-05-06 09:39:52 +02:00