From a4ec7fa7b7863e870d3b2ea8d2173083ae95ee95 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 19 Jun 2017 13:09:36 +0800 Subject: Fix gcc7 Wimplicit-fallthrough warnings For the default Wimplicit-fallthrough=3 level, the comment should start with "fall*" --- lib/lz4frame.c | 6 +++--- lib/lz4hc.c | 2 +- programs/lz4cli.c | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/lz4frame.c b/lib/lz4frame.c index fb37789..994cc8b 100644 --- a/lib/lz4frame.c +++ b/lib/lz4frame.c @@ -1096,7 +1096,7 @@ size_t LZ4F_decompress(LZ4F_dctx* dctxPtr, if (srcEnd-srcPtr == 0) return minFHSize; /* 0-size input */ dctxPtr->tmpInTarget = minFHSize; /* minimum to attempt decode */ dctxPtr->dStage = dstage_storeHeader; - /* pass-through */ + /* fall-through */ case dstage_storeHeader: { size_t sizeToCopy = dctxPtr->tmpInTarget - dctxPtr->tmpInSize; @@ -1138,7 +1138,7 @@ size_t LZ4F_decompress(LZ4F_dctx* dctxPtr, dctxPtr->tmpOutSize = 0; dctxPtr->dStage = dstage_getCBlockSize; - /* pass-through */ + /* fall-through */ case dstage_getCBlockSize: if ((size_t)(srcEnd - srcPtr) >= BHSize) { @@ -1236,8 +1236,8 @@ size_t LZ4F_decompress(LZ4F_dctx* dctxPtr, } selectedIn = dctxPtr->tmpIn; dctxPtr->dStage = dstage_decodeCBlock; - /* pass-through */ } + /* fall-through */ case dstage_decodeCBlock: if ((size_t)(dstEnd-dstPtr) < dctxPtr->maxBlockSize) /* not enough place into dst : decode into tmpOut */ diff --git a/lib/lz4hc.c b/lib/lz4hc.c index a423aea..ca9c2e6 100644 --- a/lib/lz4hc.c +++ b/lib/lz4hc.c @@ -555,7 +555,7 @@ static int LZ4HC_compress_generic ( return LZ4HC_compress_optimal(ctx, src, dst, *srcSizePtr, dstCapacity, limit, 128, 0); default: cLevel = 12; - /* pass-through */ + /* fall-through */ case 12: ctx->searchNum = LZ4HC_getSearchNum(cLevel); return LZ4HC_compress_optimal(ctx, src, dst, *srcSizePtr, dstCapacity, limit, LZ4_OPT_NUM, 1); diff --git a/programs/lz4cli.c b/programs/lz4cli.c index f3583ef..55f3133 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -469,8 +469,9 @@ int main(int argc, const char** argv) #ifdef UTIL_HAS_CREATEFILELIST /* recursive */ - case 'r': recursive=1; /* without break */ + case 'r': recursive=1; #endif + /* fall-through */ /* Treat non-option args as input files. See https://code.google.com/p/lz4/issues/detail?id=151 */ case 'm': multiple_inputs=1; break; -- cgit v0.12