]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed minor scan-build warnings 1336/head
authorYann Collet <cyan@fb.com>
Mon, 24 Sep 2018 07:52:19 +0000 (00:52 -0700)
committerYann Collet <cyan@fb.com>
Mon, 24 Sep 2018 07:52:19 +0000 (00:52 -0700)
programs/fileio.c
programs/zstdcli.c

index e08920ba8f0a92557621366cfb99e27760a13557..01944a3a058b9e813a2ddd47787fc1079df3e362 100644 (file)
@@ -1673,6 +1673,7 @@ static int FIO_decompressSrcFile(dRess_t ress, const char* dstFileName, const ch
 
     srcFile = FIO_openSrcFile(srcFileName);
     if (srcFile==NULL) return 1;
+    ress.srcBufferLoaded = 0;
 
     result = FIO_decompressFrames(ress, srcFile, dstFileName, srcFileName);
 
index 3d4548a4b703b0472d517c06903af642d6c67820..24e05d83af3981cefc41af7e687d7df5c2ac5145 100644 (file)
@@ -484,8 +484,6 @@ int main(int argCount, const char* argv[])
 
     /* init */
     (void)recursive; (void)cLevelLast;    /* not used when ZSTD_NOBENCH set */
-    (void)dictCLevel; (void)dictSelect; (void)dictID;  (void)maxDictSize; /* not used when ZSTD_NODICT set */
-    (void)ultra; (void)cLevel; (void)ldmFlag; /* not used when ZSTD_NOCOMPRESS set */
     (void)memLimit;   /* not used when ZSTD_NODECOMPRESS set */
     if (filenameTable==NULL) { DISPLAY("zstd: %s \n", strerror(errno)); exit(1); }
     filenameTable[0] = stdinmark;
@@ -956,6 +954,10 @@ int main(int argCount, const char* argv[])
             dictParams.zParams = zParams;
             operationResult = DiB_trainFromFiles(outFileName, maxDictSize, filenameTable, filenameIdx, blockSize, &dictParams, NULL, NULL, 0);
         }
+#else
+        (void)dictCLevel; (void)dictSelect; (void)dictID;  (void)maxDictSize; /* not used when ZSTD_NODICT set */
+        DISPLAYLEVEL(1, "training mode not available \n");
+        operationResult = 1;
 #endif
         goto _end;
     }
@@ -1014,7 +1016,7 @@ int main(int argCount, const char* argv[])
         else
           operationResult = FIO_compressMultipleFilenames(filenameTable, filenameIdx, outFileName, suffix, dictFileName, cLevel, &compressionParams);
 #else
-        (void)suffix;
+        (void)suffix; (void)ultra; (void)cLevel; (void)ldmFlag; /* not used when ZSTD_NOCOMPRESS set */
         DISPLAY("Compression not supported\n");
 #endif
     } else {  /* decompression or test */