Merge pull request #695 from joscollin/wip-lib-compress-fallthrough-warn

lib/compress: warning: this statement may fall through
This commit is contained in:
Yann Collet 2017-05-11 10:44:27 -07:00 committed by GitHub
commit 4c1cfc0bb6
2 changed files with 6 additions and 3 deletions

View File

@ -463,12 +463,15 @@ size_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, si
{ {
case 3 : HUF_encodeSymbol(&bitC, ip[n+ 2], CTable); case 3 : HUF_encodeSymbol(&bitC, ip[n+ 2], CTable);
HUF_FLUSHBITS_2(&bitC); HUF_FLUSHBITS_2(&bitC);
/* fall-through */
case 2 : HUF_encodeSymbol(&bitC, ip[n+ 1], CTable); case 2 : HUF_encodeSymbol(&bitC, ip[n+ 1], CTable);
HUF_FLUSHBITS_1(&bitC); HUF_FLUSHBITS_1(&bitC);
/* fall-through */
case 1 : HUF_encodeSymbol(&bitC, ip[n+ 0], CTable); case 1 : HUF_encodeSymbol(&bitC, ip[n+ 0], CTable);
HUF_FLUSHBITS(&bitC); HUF_FLUSHBITS(&bitC);
case 0 : /* fall-through */
default: ; case 0 : /* fall-through */
default: break;
} }
for (; n>0; n-=4) { /* note : n&3==0 at this stage */ for (; n>0; n-=4) { /* note : n&3==0 at this stage */

View File

@ -3365,7 +3365,7 @@ static size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs,
zcs->outBuffFlushedSize = 0; zcs->outBuffFlushedSize = 0;
zcs->streamStage = zcss_flush; /* pass-through to flush stage */ zcs->streamStage = zcss_flush; /* pass-through to flush stage */
} }
/* fall-through */
case zcss_flush: case zcss_flush:
DEBUGLOG(5, "flush stage \n"); DEBUGLOG(5, "flush stage \n");
{ size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize; { size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize;