]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
added defaultCustomNULL
authorinikep <inikep@gmail.com>
Fri, 3 Jun 2016 10:56:56 +0000 (12:56 +0200)
committerinikep <inikep@gmail.com>
Fri, 3 Jun 2016 10:56:56 +0000 (12:56 +0200)
lib/common/zstd_internal.h
lib/compress/zbuff_compress.c
lib/compress/zstd_compress.c
lib/decompress/zbuff_decompress.c
lib/decompress/zstd_decompress.c
programs/zbufftest.c
zlibWrapper/Makefile

index 230ce79fcd7e3f3cd5405efe5de7519743b0e055..b56030ba5052072b99393b105447ea00ada493ef 100644 (file)
@@ -259,5 +259,6 @@ int ZSTD_isSkipFrame(ZSTD_DCtx* dctx);
 void* ZSTD_defaultAllocFunction(void* opaque, size_t size);
 void ZSTD_defaultFreeFunction(void* opaque, void* address);
 static ZSTD_customMem const defaultCustomMem = { ZSTD_defaultAllocFunction, ZSTD_defaultFreeFunction, NULL };
-
+static ZSTD_customMem const defaultCustomNULL = { NULL, NULL, NULL };
+    
 #endif   /* ZSTD_CCOMMON_H_MODULE */
index 6e40d3c0a68bce6d1f189bf920a046a4a28ee0fc..0ec27ad707943cfe49bfbeb14cf959213ab3249b 100644 (file)
@@ -100,8 +100,7 @@ struct ZBUFF_CCtx_s {
 
 ZBUFF_CCtx* ZBUFF_createCCtx(void)
 {
-    ZSTD_customMem const customMem = { NULL, NULL, NULL };
-    return ZBUFF_createCCtx_advanced(customMem);
+    return ZBUFF_createCCtx_advanced(defaultCustomNULL);
 }
 
 ZBUFF_CCtx* ZBUFF_createCCtx_advanced(ZSTD_customMem customMem)
index 9de86a6be2adcc425e52302ab972adcd36b82b27..93caee0d7d67e53639d86343983b15ad7a64e1fc 100644 (file)
@@ -122,8 +122,7 @@ struct ZSTD_CCtx_s
 
 ZSTD_CCtx* ZSTD_createCCtx(void)
 {
-    ZSTD_customMem const customMem = { NULL, NULL, NULL };
-    return ZSTD_createCCtx_advanced(customMem);
+    return ZSTD_createCCtx_advanced(defaultCustomNULL);
 }
 
 ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem)
index c4321498b366a660ccbaf17f91e72d2c885ce88d..4dfb2adae42df603ecffd6616f815c4197988525 100644 (file)
@@ -88,8 +88,7 @@ struct ZBUFF_DCtx_s {
 
 ZBUFF_DCtx* ZBUFF_createDCtx(void)
 {
-    ZSTD_customMem const customMem = { NULL, NULL, NULL };
-    return ZBUFF_createDCtx_advanced(customMem);
+    return ZBUFF_createDCtx_advanced(defaultCustomNULL);
 }
 
 ZBUFF_DCtx* ZBUFF_createDCtx_advanced(ZSTD_customMem customMem)
index 461741d9a08cbcaf527e6e4a7656f8257a248455..d4426bccab9eeba0f17dac4dbdea442cf38d809b 100644 (file)
@@ -172,8 +172,7 @@ ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem)
 
 ZSTD_DCtx* ZSTD_createDCtx(void)
 {
-    ZSTD_customMem const customMem = { NULL, NULL, NULL };
-    return ZSTD_createDCtx_advanced(customMem);
+    return ZSTD_createDCtx_advanced(defaultCustomNULL);
 }
 
 
index 387119815ed12dd9edf490c7e2b8139de9b29ea0..37a94179127f1019e4330c3ac5f09d03fef53b2f 100644 (file)
@@ -521,7 +521,6 @@ int main(int argc, const char** argv)
     U32 mainPause = 0;
     const char* programName = argv[0];
     ZSTD_customMem customMem = { ZBUFF_allocFunction, ZBUFF_freeFunction, NULL };
-    ZSTD_customMem customNULL = { NULL, NULL, NULL };
 
     /* Check command line */
     for(argNb=1; argNb<argc; argNb++) {
@@ -621,7 +620,7 @@ int main(int argc, const char** argv)
     if (nbTests<=0) nbTests=1;
 
     if (testNb==0) {
-        result = basicUnitTests(0, ((double)proba) / 100, customNULL);  /* constant seed for predictability */
+        result = basicUnitTests(0, ((double)proba) / 100, defaultCustomNULL);  /* constant seed for predictability */
         if (!result) {
             DISPLAYLEVEL(4, "Unit tests using customMem :\n")
             result = basicUnitTests(0, ((double)proba) / 100, customMem);  /* use custom memory allocation functions */
index edfcdf78fb20dc20bdf2a8c036bfb66ef5cbbd96..245c57d686517b43d3754bbc94cbe161b065a09a 100644 (file)
@@ -6,8 +6,8 @@
 
 
 # Paths to static and dynamic zlib and zstd libraries
-ifneq (,$(filter Windows%,$(OS)))
-ZLIBDIR = ../../zlib1.2.8
+# Use "make ZLIBDIR=path/to/zlib" to select a path to library
+ifdef ZLIBDIR
 STATICLIB = $(ZLIBDIR)/libz.a ../lib/libzstd.a
 IMPLIB    = $(ZLIBDIR)/libz.dll.a ../lib/libzstd.a
 else