From db2f54041461e09dc0cb833fa999def85fa2bf73 Mon Sep 17 00:00:00 2001 From: inikep Date: Fri, 3 Jun 2016 12:56:56 +0200 Subject: [PATCH] added defaultCustomNULL --- lib/common/zstd_internal.h | 3 ++- lib/compress/zbuff_compress.c | 3 +-- lib/compress/zstd_compress.c | 3 +-- lib/decompress/zbuff_decompress.c | 3 +-- lib/decompress/zstd_decompress.c | 3 +-- programs/zbufftest.c | 3 +-- zlibWrapper/Makefile | 4 ++-- 7 files changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/common/zstd_internal.h b/lib/common/zstd_internal.h index 230ce79f..b56030ba 100644 --- a/lib/common/zstd_internal.h +++ b/lib/common/zstd_internal.h @@ -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 */ diff --git a/lib/compress/zbuff_compress.c b/lib/compress/zbuff_compress.c index 6e40d3c0..0ec27ad7 100644 --- a/lib/compress/zbuff_compress.c +++ b/lib/compress/zbuff_compress.c @@ -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) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 9de86a6b..93caee0d 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -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) diff --git a/lib/decompress/zbuff_decompress.c b/lib/decompress/zbuff_decompress.c index c4321498..4dfb2ada 100644 --- a/lib/decompress/zbuff_decompress.c +++ b/lib/decompress/zbuff_decompress.c @@ -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) diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c index 461741d9..d4426bcc 100644 --- a/lib/decompress/zstd_decompress.c +++ b/lib/decompress/zstd_decompress.c @@ -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); } diff --git a/programs/zbufftest.c b/programs/zbufftest.c index 38711981..37a94179 100644 --- a/programs/zbufftest.c +++ b/programs/zbufftest.c @@ -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