From dc64ccfb2556e7f2a9aee7e120bd83b4a31bf9dc Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 15 Jan 2022 17:35:44 -0800 Subject: [PATCH] deflate_decompress: remove len_t typedef Solaris already defines 'len_t' in , which causes a build error. This typedef isn't important, so just remove it and use u8 directly. Fixes https://github.com/ebiggers/libdeflate/issues/159 --- lib/deflate_decompress.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/deflate_decompress.c b/lib/deflate_decompress.c index 8b756fa..6138206 100644 --- a/lib/deflate_decompress.c +++ b/lib/deflate_decompress.c @@ -98,11 +98,6 @@ #define LITLEN_ENOUGH 1334 /* enough 288 10 15 */ #define OFFSET_ENOUGH 402 /* enough 32 8 15 */ -/* - * Type for codeword lengths. - */ -typedef u8 len_t; - /* * The main DEFLATE decompressor structure. Since this implementation only * supports full buffer decompression, this structure does not store the entire @@ -121,12 +116,12 @@ struct libdeflate_decompressor { */ union { - len_t precode_lens[DEFLATE_NUM_PRECODE_SYMS]; + u8 precode_lens[DEFLATE_NUM_PRECODE_SYMS]; struct { - len_t lens[DEFLATE_NUM_LITLEN_SYMS + - DEFLATE_NUM_OFFSET_SYMS + - DEFLATE_MAX_LENS_OVERRUN]; + u8 lens[DEFLATE_NUM_LITLEN_SYMS + + DEFLATE_NUM_OFFSET_SYMS + + DEFLATE_MAX_LENS_OVERRUN]; u32 precode_decode_table[PRECODE_ENOUGH]; } l; @@ -556,7 +551,7 @@ static const u32 offset_decode_results[DEFLATE_NUM_OFFSET_SYMS] = { */ static bool build_decode_table(u32 decode_table[], - const len_t lens[], + const u8 lens[], const unsigned num_syms, const u32 decode_results[], const unsigned table_bits,