Merge pull request #367 from Chocobo1/fallthrough

Fix gcc7 Wimplicit-fallthrough warnings
This commit is contained in:
Yann Collet 2017-06-18 23:55:45 -07:00 committed by GitHub
commit 1525fd1f52
3 changed files with 6 additions and 5 deletions

View File

@ -1096,7 +1096,7 @@ size_t LZ4F_decompress(LZ4F_dctx* dctxPtr,
if (srcEnd-srcPtr == 0) return minFHSize; /* 0-size input */ if (srcEnd-srcPtr == 0) return minFHSize; /* 0-size input */
dctxPtr->tmpInTarget = minFHSize; /* minimum to attempt decode */ dctxPtr->tmpInTarget = minFHSize; /* minimum to attempt decode */
dctxPtr->dStage = dstage_storeHeader; dctxPtr->dStage = dstage_storeHeader;
/* pass-through */ /* fall-through */
case dstage_storeHeader: case dstage_storeHeader:
{ size_t sizeToCopy = dctxPtr->tmpInTarget - dctxPtr->tmpInSize; { size_t sizeToCopy = dctxPtr->tmpInTarget - dctxPtr->tmpInSize;
@ -1138,7 +1138,7 @@ size_t LZ4F_decompress(LZ4F_dctx* dctxPtr,
dctxPtr->tmpOutSize = 0; dctxPtr->tmpOutSize = 0;
dctxPtr->dStage = dstage_getCBlockSize; dctxPtr->dStage = dstage_getCBlockSize;
/* pass-through */ /* fall-through */
case dstage_getCBlockSize: case dstage_getCBlockSize:
if ((size_t)(srcEnd - srcPtr) >= BHSize) { if ((size_t)(srcEnd - srcPtr) >= BHSize) {
@ -1236,8 +1236,8 @@ size_t LZ4F_decompress(LZ4F_dctx* dctxPtr,
} }
selectedIn = dctxPtr->tmpIn; selectedIn = dctxPtr->tmpIn;
dctxPtr->dStage = dstage_decodeCBlock; dctxPtr->dStage = dstage_decodeCBlock;
/* pass-through */
} }
/* fall-through */
case dstage_decodeCBlock: case dstage_decodeCBlock:
if ((size_t)(dstEnd-dstPtr) < dctxPtr->maxBlockSize) /* not enough place into dst : decode into tmpOut */ if ((size_t)(dstEnd-dstPtr) < dctxPtr->maxBlockSize) /* not enough place into dst : decode into tmpOut */

View File

@ -555,7 +555,7 @@ static int LZ4HC_compress_generic (
return LZ4HC_compress_optimal(ctx, src, dst, *srcSizePtr, dstCapacity, limit, 128, 0); return LZ4HC_compress_optimal(ctx, src, dst, *srcSizePtr, dstCapacity, limit, 128, 0);
default: default:
cLevel = 12; cLevel = 12;
/* pass-through */ /* fall-through */
case 12: case 12:
ctx->searchNum = LZ4HC_getSearchNum(cLevel); ctx->searchNum = LZ4HC_getSearchNum(cLevel);
return LZ4HC_compress_optimal(ctx, src, dst, *srcSizePtr, dstCapacity, limit, LZ4_OPT_NUM, 1); return LZ4HC_compress_optimal(ctx, src, dst, *srcSizePtr, dstCapacity, limit, LZ4_OPT_NUM, 1);

View File

@ -469,8 +469,9 @@ int main(int argc, const char** argv)
#ifdef UTIL_HAS_CREATEFILELIST #ifdef UTIL_HAS_CREATEFILELIST
/* recursive */ /* recursive */
case 'r': recursive=1; /* without break */ case 'r': recursive=1;
#endif #endif
/* fall-through */
/* Treat non-option args as input files. See https://code.google.com/p/lz4/issues/detail?id=151 */ /* Treat non-option args as input files. See https://code.google.com/p/lz4/issues/detail?id=151 */
case 'm': multiple_inputs=1; case 'm': multiple_inputs=1;
break; break;