From 08e6a88a97f8a472a8e89aa1ea49b6b8669ff595 Mon Sep 17 00:00:00 2001 From: ds77 Date: Tue, 14 Feb 2017 00:14:24 +0100 Subject: [PATCH 1/4] avoid empty translation unit warning without #pragma --- lib/common/threading.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/common/threading.c b/lib/common/threading.c index b56e594b2..32d58796a 100644 --- a/lib/common/threading.c +++ b/lib/common/threading.c @@ -15,10 +15,11 @@ * This file will hold wrapper for systems, which do not support pthreads */ -/* ====== Compiler specifics ====== */ -#if defined(_MSC_VER) -# pragma warning(disable : 4206) /* disable: C4206: translation unit is empty (when ZSTD_MULTITHREAD is not defined) */ -#endif +/* When ZSTD_MULTITHREAD is not defined, this file would become an empty translation unit. +* Include some ISO C header code to prevent this and portably avoid related warnings. +* (Visual C++: C4206 / GCC: -Wpedantic / Clang: -Wempty-translation-unit) +*/ +#include #if defined(ZSTD_MULTITHREAD) && defined(_WIN32) From 58af614ef27c84efb5b6e1685bebfe38f8e9493e Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Mon, 13 Feb 2017 18:32:12 -0800 Subject: [PATCH 2/4] push version and NEWS to v1.1.4 --- NEWS | 7 +++++++ lib/zstd.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 24860c957..09f1d010d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ +v1.1.4 +cli : new : advanced comnmand --priority=rt, by Przemyslaw Skibinski +cli : fix : write on sparse-enabled file systems in 32-bits mode, by @ds77 +API : new : ZSTD_getFrameCompressedSize(), ZSTD_getFrameContentSize(), ZSTD_findDecompressedSize(), by Sean Purcell +API : change : ZSTD_compress*() with srcSize==0 create an empty-frame of known size, by Sean Purcell +doc : new : educational decoder, by Sean Purcell + v1.1.3 cli : zstd can decompress .gz files (can be disabled with `make zstd-nogz` or `make HAVE_ZLIB=0`) cli : new : experimental target `make zstdmt`, with multi-threading support diff --git a/lib/zstd.h b/lib/zstd.h index e2f752ddc..a71867837 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -56,7 +56,7 @@ extern "C" { /*------ Version ------*/ #define ZSTD_VERSION_MAJOR 1 #define ZSTD_VERSION_MINOR 1 -#define ZSTD_VERSION_RELEASE 3 +#define ZSTD_VERSION_RELEASE 4 #define ZSTD_LIB_VERSION ZSTD_VERSION_MAJOR.ZSTD_VERSION_MINOR.ZSTD_VERSION_RELEASE #define ZSTD_QUOTE(str) #str From 2bb6fc2a944d30d0ec3ec18d3db0fc462cf06ccf Mon Sep 17 00:00:00 2001 From: zefanxu2 Date: Mon, 13 Feb 2017 21:12:59 -0600 Subject: [PATCH 3/4] fix memory leak --- examples/simple_compression.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/simple_compression.c b/examples/simple_compression.c index deb0bbfc4..2aab48f47 100644 --- a/examples/simple_compression.c +++ b/examples/simple_compression.c @@ -127,6 +127,6 @@ int main(int argc, const char** argv) const char* const outFilename = createOutFilename_orDie(inFilename); compress_orDie(inFilename, outFilename); - + free(outFilename); return 0; } From c09d16ba8c9328c8c6d0955b291470caabff0d83 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Tue, 14 Feb 2017 10:45:19 -0800 Subject: [PATCH 4/4] preset behavior for gzip, gunzip and gzcat when zstd is called through a link named gzip, gunzip or gzcat, provides the same behavior as the related program. gzip compresses using --format=gz both gzip and gunzip enable --rm by default --- NEWS | 5 +++-- programs/zstdcli.c | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 09f1d010d..a710da8b9 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,9 @@ v1.1.4 -cli : new : advanced comnmand --priority=rt, by Przemyslaw Skibinski +cli : new : can compress in *.gz format, using --format=gzip command, by Przemyslaw Skibinski +cli : new : advanced benchmark command --priority=rt cli : fix : write on sparse-enabled file systems in 32-bits mode, by @ds77 API : new : ZSTD_getFrameCompressedSize(), ZSTD_getFrameContentSize(), ZSTD_findDecompressedSize(), by Sean Purcell -API : change : ZSTD_compress*() with srcSize==0 create an empty-frame of known size, by Sean Purcell +API : change : ZSTD_compress*() with srcSize==0 create an empty-frame of known size doc : new : educational decoder, by Sean Purcell v1.1.3 diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 33c0cd8d5..588111913 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -51,8 +51,11 @@ #define GZ_EXTENSION ".gz" #define ZSTD_EXTENSION ".zst" -#define ZSTD_CAT "zstdcat" #define ZSTD_UNZSTD "unzstd" +#define ZSTD_CAT "zstdcat" +#define ZSTD_GZ "gzip" +#define ZSTD_GUNZIP "gunzip" +#define ZSTD_GZCAT "gzcat" #define KB *(1 <<10) #define MB *(1 <<20) @@ -319,6 +322,9 @@ int main(int argCount, const char* argv[]) /* preset behaviors */ if (!strcmp(programName, ZSTD_UNZSTD)) operation=zom_decompress; if (!strcmp(programName, ZSTD_CAT)) { operation=zom_decompress; forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; displayLevel=1; } + if (!strcmp(programName, ZSTD_GZ)) { suffix = GZ_EXTENSION; FIO_setCompressionType(FIO_gzipCompression); FIO_setRemoveSrcFile(1); } /* behave like gzip */ + if (!strcmp(programName, ZSTD_GUNZIP)) { operation=zom_decompress; FIO_setRemoveSrcFile(1); } /* behave like gunzip */ + if (!strcmp(programName, ZSTD_GZCAT)) { operation=zom_decompress; forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; displayLevel=1; } /* behave like gzcat */ memset(&compressionParams, 0, sizeof(compressionParams)); /* command switches */