]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
initialization of strm->adler
authorinikep <inikep@gmail.com>
Fri, 23 Sep 2016 10:42:21 +0000 (12:42 +0200)
committerinikep <inikep@gmail.com>
Fri, 23 Sep 2016 10:42:21 +0000 (12:42 +0200)
Makefile
zlibWrapper/Makefile
zlibWrapper/examples/zwrapbench.c
zlibWrapper/zstd_zlibwrapper.c

index f355891ae3c0001f9bf981a5109c35410aa5558c..ac0c583f4b2ebb1157dbfd1e7a61c8b825592325 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ zstd:
        cp $(PRGDIR)/zstd .
 
 zlibwrapper:
-       $(MAKE) -C $(ZWRAPDIR) test test_zstd
+       $(MAKE) -C $(ZWRAPDIR) test
 
 test:
        $(MAKE) -C $(TESTDIR) $@
index 46671ea6ecb974e4df62d7495fd5df83e81824af..e595a046c3324e7fd0a6675ef1790d29a0db6c52 100644 (file)
@@ -30,31 +30,27 @@ RM = rm -f
 
 all: clean fitblk example example_d zwrapbench
 
-test: example fitblk
+test: example fitblk example_zstd fitblk_zstd zwrapbench
        ./example
+       ./example_zstd
        ./fitblk 10240 <../zstd_compression_format.md
        ./fitblk 40960 <../zstd_compression_format.md
+       ./fitblk_zstd 10240 <../zstd_compression_format.md
+       ./fitblk_zstd 40960 <../zstd_compression_format.md
        ./zwrapbench -qb1e5 ../zstd_compression_format.md
        ./zwrapbench -qb1e5B1K ../zstd_compression_format.md
 
 test_d: example_d
        ./example_d
 
-test_zstd: example_zstd fitblk_zstd zwrapbench
-       ./example_zstd
-       ./fitblk_zstd 10240 <../zstd_compression_format.md
-       ./fitblk_zstd 40960 <../zstd_compression_format.md
-       ./zwrapbench -qb1e5 ../zstd_compression_format.md
-       ./zwrapbench -qb1e5B1K ../zstd_compression_format.md
-
-valgrindTest: VALGRIND = valgrind --leak-check=full --error-exitcode=1
-valgrindTest: STATICLIB = $(IMPLIB)
+valgrindTest: VALGRIND = valgrind --track-origins=yes --leak-check=full --error-exitcode=1
+valgrindTest: STATICLIB = -lz $(ZSTDLIBDIR)/libzstd.so
 valgrindTest: clean example fitblk example_zstd fitblk_zstd zwrapbench
        @echo "\n ---- valgrind tests ----"
        $(VALGRIND) ./example
+       $(VALGRIND) ./example_zstd
        $(VALGRIND) ./fitblk 10240 <../zstd_compression_format.md
        $(VALGRIND) ./fitblk 40960 <../zstd_compression_format.md
-       $(VALGRIND) ./example_zstd
        $(VALGRIND) ./fitblk_zstd 10240 <../zstd_compression_format.md
        $(VALGRIND) ./fitblk_zstd 40960 <../zstd_compression_format.md
        $(VALGRIND) ./zwrapbench -qb1e5 ../zstd_compression_format.md
index f7ed821e3810405b90d2003cb31d2ff60bcae1d5..69f372d5d88264d278c526dbb2aefe8b4d26afcc 100644 (file)
@@ -560,7 +560,7 @@ static void BMK_benchCLevel(void* srcBuffer, size_t benchedSize,
     SET_HIGH_PRIORITY;
 
     if (g_displayLevel == 1 && !g_additionalParam)
-        DISPLAY("bench %s %s: input %u bytes, %u iterations, %u KB blocks\n", ZSTD_VERSION_STRING, ZSTD_GIT_COMMIT_STRING, (U32)benchedSize, g_nbIterations, (U32)(g_blockSize>>10));
+        DISPLAY("bench %s %s: input %u bytes, %u seconds, %u KB blocks\n", ZSTD_VERSION_STRING, ZSTD_GIT_COMMIT_STRING, (U32)benchedSize, g_nbIterations, (U32)(g_blockSize>>10));
 
     if (cLevelLast < cLevel) cLevelLast = cLevel;
 
index 2ad3ee0b741d055f0063c7c65259e492cf498df5..7a825899c6945d597fe62bd28ee48f7c2c24be10 100644 (file)
@@ -22,8 +22,8 @@
 #define ZSTD_HEADERSIZE             ZSTD_frameHeaderSize_min
 #define ZWRAP_DEFAULT_CLEVEL        5   /* Z_DEFAULT_COMPRESSION is translated to ZWRAP_DEFAULT_CLEVEL for zstd */
 
-#define LOG_WRAPPERC(...)   /*printf(__VA_ARGS__)*/ 
-#define LOG_WRAPPERD(...)   /*printf(__VA_ARGS__)*/
+#define LOG_WRAPPERC(...)   /* printf(__VA_ARGS__) */
+#define LOG_WRAPPERD(...)   /* printf(__VA_ARGS__) */
 
 
 #define FINISH_WITH_GZ_ERR(msg) { \
@@ -194,6 +194,7 @@ ZEXTERN int ZEXPORT z_deflateInit_ OF((z_streamp strm, int level,
     strm->state = (struct internal_state*) zwc; /* use state which in not used by user */
     strm->total_in = 0;
     strm->total_out = 0;
+    strm->adler = 0;
     return Z_OK;
 }
 
@@ -468,6 +469,7 @@ ZEXTERN int ZEXPORT z_inflateInit_ OF((z_streamp strm,
     strm->total_in = 0;
     strm->total_out = 0;
     strm->reserved = 1; /* mark as unknown steam */
+    strm->adler = 0;
     }
 
     return Z_OK;