Skip to content

Commit

Permalink
Revert "zstd: fix fall-through warnings"
Browse files Browse the repository at this point in the history
This reverts commit f164cc4.
  • Loading branch information
xanmod committed Oct 7, 2021
1 parent 1d25d60 commit 2b7ec33
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions lib/zstd/common/bitstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,22 +274,22 @@ MEM_STATIC size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, si
switch(srcSize)
{
case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
fallthrough;
/* fall-through */

case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
fallthrough;
/* fall-through */

case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
fallthrough;
/* fall-through */

case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24;
fallthrough;
/* fall-through */

case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16;
fallthrough;
/* fall-through */

case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8;
fallthrough;
/* fall-through */

default: break;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/zstd/compress/huf_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,13 @@ HUF_compress1X_usingCTable_internal_body(void* dst, size_t dstSize,
{
case 3 : HUF_encodeSymbol(&bitC, ip[n+ 2], CTable);
HUF_FLUSHBITS_2(&bitC);
fallthrough;
/* fall-through */
case 2 : HUF_encodeSymbol(&bitC, ip[n+ 1], CTable);
HUF_FLUSHBITS_1(&bitC);
fallthrough;
/* fall-through */
case 1 : HUF_encodeSymbol(&bitC, ip[n+ 0], CTable);
HUF_FLUSHBITS(&bitC);
fallthrough;
/* fall-through */
case 0 : /* fall-through */
default: break;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/zstd/compress/zstd_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -4213,7 +4213,7 @@ static size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs,
zcs->outBuffFlushedSize = 0;
zcs->streamStage = zcss_flush; /* pass-through to flush stage */
}
fallthrough;
/* fall-through */
case zcss_flush:
DEBUGLOG(5, "flush stage");
assert(zcs->appliedParams.outBufferMode == ZSTD_bm_buffered);
Expand Down
6 changes: 3 additions & 3 deletions lib/zstd/decompress/zstd_decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB
zds->legacyVersion = 0;
zds->hostageByte = 0;
zds->expectedOutBuffer = *output;
fallthrough;
/* fall-through */

case zdss_loadHeader :
DEBUGLOG(5, "stage zdss_loadHeader (srcSize : %u)", (U32)(iend - ip));
Expand Down Expand Up @@ -1946,7 +1946,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB
zds->outBuffSize = neededOutBuffSize;
} } }
zds->streamStage = zdss_read;
fallthrough;
/* fall-through */

case zdss_read:
DEBUGLOG(5, "stage zdss_read");
Expand All @@ -1965,7 +1965,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB
} }
if (ip==iend) { someMoreWork = 0; break; } /* no more input */
zds->streamStage = zdss_load;
fallthrough;
/* fall-through */

case zdss_load:
{ size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds);
Expand Down
2 changes: 1 addition & 1 deletion lib/zstd/decompress/zstd_decompress_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,
case set_repeat:
DEBUGLOG(5, "set_repeat flag : re-using stats from previous compressed literals block");
RETURN_ERROR_IF(dctx->litEntropy==0, dictionary_corrupted, "");
fallthrough;
/* fall-through */

case set_compressed:
RETURN_ERROR_IF(srcSize < 5, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for case 3");
Expand Down

0 comments on commit 2b7ec33

Please sign in to comment.