]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
changed default compression level to 3 (can be modified with macro ZSTDCLI_DEFAULT_CL...
authorYann Collet <yann.collet.73@gmail.com>
Wed, 13 Jul 2016 12:15:08 +0000 (14:15 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Wed, 13 Jul 2016 12:15:08 +0000 (14:15 +0200)
.gitignore
programs/fileio.c
programs/zstdcli.c

index 1816524015b220fde986da1d519bcde9c5b518f5..f8024e024d3829fe3862dc1d678a2df09f06a12c 100644 (file)
@@ -37,3 +37,6 @@ _zstdbench/
 
 # CMake
 projects/cmake/
+
+# Test artefacts
+tmp*
index 3eb8d881e68b421678fd21d44dd33688b884fa28..f805545b5ab050cb528f3040bd92ac3ca6691f4e 100644 (file)
@@ -330,7 +330,6 @@ static int FIO_compressFilename_internal(cRess_t ress,
     }   }
 
     /* Main compression loop */
-    readsize = 0;
     while (1) {
         /* Fill input Buffer */
         size_t const inSize = fread(ress.srcBuffer, (size_t)1, ress.srcBufferSize, srcFile);
@@ -338,8 +337,8 @@ static int FIO_compressFilename_internal(cRess_t ress,
         readsize += inSize;
         DISPLAYUPDATE(2, "\rRead : %u MB  ", (U32)(readsize>>20));
 
-        {   /* Compress using buffered streaming */
-            size_t usedInSize = inSize;
+        /* Compress using buffered streaming */
+        {   size_t usedInSize = inSize;
             size_t cSize = ress.dstBufferSize;
             { size_t const result = ZBUFF_compressContinue(ress.ctx, ress.dstBuffer, &cSize, ress.srcBuffer, &usedInSize);
               if (ZBUFF_isError(result)) EXM_THROW(23, "Compression error : %s ", ZBUFF_getErrorName(result)); }
@@ -366,8 +365,10 @@ static int FIO_compressFilename_internal(cRess_t ress,
     }
 
     /* Status */
+    { size_t const len = strlen(srcFileName);
+      if (len > 20) srcFileName += len-20; }
     DISPLAYLEVEL(2, "\r%79s\r", "");
-    DISPLAYLEVEL(2,"%-20.20s :%6.2f%%   (%6llu =>%6llu bytes, %s) \n", srcFileName,
+    DISPLAYLEVEL(2,"%-20.20s :%6.2f%%   (%6llu => %6llu bytes, %s) \n", srcFileName,
         (double)compressedfilesize/readsize*100, (unsigned long long)readsize, (unsigned long long) compressedfilesize,
                  dstFileName);
 
index 24fc33b7d266f4dc40d22c7af16b18babe74d27c..6669f5a271c927682ebf14181155df8586ca78d3 100644 (file)
 */
 
 
+/*-************************************
+*  Tuning parameters
+**************************************/
+#ifndef ZSTDCLI_DEFAULT_CLEVEL
+#  define ZSTDCLI_DEFAULT_CLEVEL 3
+#endif
+
+
 /*-************************************
 *  Includes
 **************************************/
@@ -207,7 +215,7 @@ int main(int argCount, const char** argv)
         nextArgumentIsMaxDict=0,
         nextArgumentIsDictID=0,
         nextArgumentIsFile=0;
-    unsigned cLevel = 1;
+    unsigned cLevel = ZSTDCLI_DEFAULT_CLEVEL;
     unsigned cLevelLast = 1;
     unsigned recursive = 0;
     const char** filenameTable = (const char**)malloc(argCount * sizeof(const char*));   /* argCount >= 1 */
@@ -331,7 +339,7 @@ int main(int argCount, const char** argv)
                         /* test compressed file */
                     case 't': decode=1; outFileName=nulmark; argument++; break;
 
-                        /* dictionary name */
+                        /* destination file name */
                     case 'o': nextArgumentIsOutFileName=1; argument++; break;
 
                         /* recursive */