]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
lib/compress: warning: this statement may fall through 695/head
authorJos Collin <jcollin@redhat.com>
Thu, 11 May 2017 07:47:20 +0000 (13:17 +0530)
committerJos Collin <jcollin@redhat.com>
Thu, 11 May 2017 07:47:26 +0000 (13:17 +0530)
The following warning appears during build.

../lib/compress/huf_compress.c: In function ‘HUF_compress1X_usingCTable’:
../lib/compress/huf_compress.c:444:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
     if (sizeof((stream)->bitContainer)*8 < HUF_TABLELOG_MAX*4+7) HUF_FLUSHBITS(stream)
        ^
../lib/compress/huf_compress.c:465:18: note: in expansion of macro ‘HUF_FLUSHBITS_2’
                  HUF_FLUSHBITS_2(&bitC);
                  ^~~~~~~~~~~~~~~
../lib/compress/huf_compress.c:466:9: note: here
         case 2 : HUF_encodeSymbol(&bitC, ip[n+ 1], CTable);

../lib/compress/zstd_compress.c: In function ‘ZSTD_compressStream_generic’:
../lib/compress/zstd_compress.c:3366:34: warning: this statement may fall through [-Wimplicit-fallthrough=]
                 zcs->streamStage = zcss_flush;   /* pass-through to flush stage */
                 ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
../lib/compress/zstd_compress.c:3369:9: note: here
         case zcss_flush:

Signed-off-by: Jos Collin <jcollin@redhat.com>
lib/compress/huf_compress.c
lib/compress/zstd_compress.c

index fe11aafb8f14013e7154b17bcac3f2dc337ab94b..7248c2513601c57813ff9519b2e362fdf1610e0a 100644 (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);
                  HUF_FLUSHBITS_2(&bitC);
+                /* fall-through */
         case 2 : HUF_encodeSymbol(&bitC, ip[n+ 1], CTable);
                  HUF_FLUSHBITS_1(&bitC);
+                /* fall-through */
         case 1 : HUF_encodeSymbol(&bitC, ip[n+ 0], CTable);
                  HUF_FLUSHBITS(&bitC);
-        case 0 :
-        default: ;
+                /* fall-through */
+        case 0 : /* fall-through */
+        default: break;
     }
 
     for (; n>0; n-=4) {  /* note : n&3==0 at this stage */
index cb15a5a2e088267c94711c54e115f732c75a21f2..edf4609f7847a29d15252d86a5d3515e1ec231dc 100644 (file)
@@ -3365,7 +3365,7 @@ static size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs,
                 zcs->outBuffFlushedSize = 0;
                 zcs->streamStage = zcss_flush;   /* pass-through to flush stage */
             }
-
+           /* fall-through */
         case zcss_flush:
             DEBUGLOG(5, "flush stage \n");
             {   size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize;