From fb8dd62f77d88808bbe342b72eca41e6ac0ec7e0 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Tue, 10 Feb 2026 18:24:49 -0800 Subject: Clean up the use of switch cases. --- inftrees.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'inftrees.c') diff --git a/inftrees.c b/inftrees.c index 6b6f8dc4..2a468717 100644 --- a/inftrees.c +++ b/inftrees.c @@ -57,9 +57,9 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, unsigned mask; /* mask for low root bits */ code here; /* table entry for duplication */ code FAR *next; /* next available space in table */ - const unsigned short FAR *base; /* base value table to use */ - const unsigned short FAR *extra; /* extra bits table to use */ - unsigned match; /* use base and extra for symbol >= match */ + const unsigned short FAR *base = NULL; /* base value table to use */ + const unsigned short FAR *extra = NULL; /* extra bits table to use */ + unsigned match = 0; /* use base and extra for symbol >= match */ unsigned short count[MAXBITS+1]; /* number of codes of each length */ unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ static const unsigned short lbase[31] = { /* Length codes 257..285 base */ @@ -185,7 +185,6 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, /* set up for code type */ switch (type) { case CODES: - base = extra = work; /* dummy value--not used */ match = 20; break; case LENS: @@ -193,10 +192,9 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, extra = lext; match = 257; break; - default: /* DISTS */ + case DISTS: base = dbase; extra = dext; - match = 0; } /* initialize state for loop */ -- cgit v1.2.3-55-g6feb