treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
This commit is contained in:
@@ -259,15 +259,15 @@ ZSTD_STATIC size_t BIT_initDStream(BIT_DStream_t *bitD, const void *srcBuffer, s
|
||||
bitD->bitContainer = *(const BYTE *)(bitD->start);
|
||||
switch (srcSize) {
|
||||
case 7: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[6]) << (sizeof(bitD->bitContainer) * 8 - 16);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 6: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[5]) << (sizeof(bitD->bitContainer) * 8 - 24);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 5: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[4]) << (sizeof(bitD->bitContainer) * 8 - 32);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 4: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[3]) << 24;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 3: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[2]) << 16;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 2: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[1]) << 8;
|
||||
default:;
|
||||
}
|
||||
|
@@ -3182,7 +3182,7 @@ static size_t ZSTD_compressStream_generic(ZSTD_CStream *zcs, void *dst, size_t *
|
||||
zcs->outBuffFlushedSize = 0;
|
||||
zcs->stage = zcss_flush; /* pass-through to flush stage */
|
||||
}
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
|
||||
case zcss_flush: {
|
||||
size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize;
|
||||
|
@@ -442,7 +442,7 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx *dctx, const void *src, size_t srcSize
|
||||
case set_repeat:
|
||||
if (dctx->litEntropy == 0)
|
||||
return ERROR(dictionary_corrupted);
|
||||
/* fall-through */
|
||||
fallthrough;
|
||||
case set_compressed:
|
||||
if (srcSize < 5)
|
||||
return ERROR(corruption_detected); /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for case 3 */
|
||||
@@ -1768,7 +1768,7 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, c
|
||||
return 0;
|
||||
}
|
||||
dctx->expected = 0; /* not necessary to copy more */
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
|
||||
case ZSTDds_decodeFrameHeader:
|
||||
memcpy(dctx->headerBuffer + ZSTD_frameHeaderSize_prefix, src, dctx->expected);
|
||||
@@ -2309,7 +2309,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB
|
||||
switch (zds->stage) {
|
||||
case zdss_init:
|
||||
ZSTD_resetDStream(zds); /* transparent reset on starting decoding a new frame */
|
||||
/* fall-through */
|
||||
fallthrough;
|
||||
|
||||
case zdss_loadHeader: {
|
||||
size_t const hSize = ZSTD_getFrameParams(&zds->fParams, zds->headerBuffer, zds->lhSize);
|
||||
@@ -2376,7 +2376,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB
|
||||
}
|
||||
zds->stage = zdss_read;
|
||||
}
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
|
||||
case zdss_read: {
|
||||
size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds->dctx);
|
||||
@@ -2405,7 +2405,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB
|
||||
zds->stage = zdss_load;
|
||||
/* pass-through */
|
||||
}
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
|
||||
case zdss_load: {
|
||||
size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds->dctx);
|
||||
@@ -2438,7 +2438,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB
|
||||
/* pass-through */
|
||||
}
|
||||
}
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
|
||||
case zdss_flush: {
|
||||
size_t const toFlushSize = zds->outEnd - zds->outStart;
|
||||
|
@@ -556,9 +556,9 @@ size_t HUF_compress1X_usingCTable(void *dst, size_t dstSize, const void *src, si
|
||||
n = srcSize & ~3; /* join to mod 4 */
|
||||
switch (srcSize & 3) {
|
||||
case 3: HUF_encodeSymbol(&bitC, ip[n + 2], CTable); HUF_FLUSHBITS_2(&bitC);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 2: HUF_encodeSymbol(&bitC, ip[n + 1], CTable); HUF_FLUSHBITS_1(&bitC);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 1: HUF_encodeSymbol(&bitC, ip[n + 0], CTable); HUF_FLUSHBITS(&bitC);
|
||||
case 0:
|
||||
default:;
|
||||
|
Reference in New Issue
Block a user