From c523980d99689e91bf0f66e4bc4c1b89c7ce6f01 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sat, 26 Oct 2019 18:34:04 +0200 Subject: [PATCH] zlib: enumeration values not explicitly handled in switch warning --- common/zlib/inflate.h | 4 ++++ common/zlib/inftrees.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/zlib/inflate.h b/common/zlib/inflate.h index f48620e08..f91e0aa78 100644 --- a/common/zlib/inflate.h +++ b/common/zlib/inflate.h @@ -19,6 +19,7 @@ /* Possible inflate modes between inflate() calls */ typedef enum { HEAD = 16180, /* i: waiting for magic header */ +#ifdef GUNZIP FLAGS, /* i: waiting for method and flags (gzip) */ TIME, /* i: waiting for modification time (gzip) */ OS, /* i: waiting for extra flags and operating system (gzip) */ @@ -27,6 +28,7 @@ typedef enum { NAME, /* i: waiting for end of file name (gzip) */ COMMENT, /* i: waiting for end of comment (gzip) */ HCRC, /* i: waiting for header crc (gzip) */ +#endif DICTID, /* i: waiting for dictionary check value */ DICT, /* waiting for inflateSetDictionary() call */ TYPE, /* i: waiting for type bits, including last-flag bit */ @@ -45,7 +47,9 @@ typedef enum { MATCH, /* o: waiting for output space to copy string */ LIT, /* o: waiting for output space to write literal */ CHECK, /* i: waiting for 32-bit check value */ +#ifdef GUNZIP LENGTH, /* i: waiting for 32-bit length (gzip) */ +#endif DONE, /* finished check, done -- remain here until reset */ BAD, /* got a data error -- remain here until reset */ MEM, /* got an inflate() memory error -- remain here until reset */ diff --git a/common/zlib/inftrees.c b/common/zlib/inftrees.c index 49672650c..3dae7e534 100644 --- a/common/zlib/inftrees.c +++ b/common/zlib/inftrees.c @@ -191,7 +191,8 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, extra = lext; match = 257; break; - default: /* DISTS */ + case DISTS: + default: base = dbase; extra = dext; match = 0;