From 98509a70acc58c71464181c3564f9bfd9cc319ed Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Tue, 14 Feb 2017 09:23:32 +0100 Subject: [PATCH] fixed function name --- programs/fileio.c | 11 +++++------ programs/fileio.h | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/programs/fileio.c b/programs/fileio.c index b8066a7a..e905948b 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -121,8 +121,8 @@ static clock_t g_time = 0; /*-************************************* * Local Parameters - Not thread safe ***************************************/ -static FIO_compresionType_t g_compresionType = FIO_zstdCompression; -void FIO_setCompresionType(FIO_compresionType_t compresionType) { g_compresionType = compresionType; } +static FIO_compressionType_t g_compressionType = FIO_zstdCompression; +void FIO_setCompressionType(FIO_compressionType_t compressionType) { g_compressionType = compressionType; } static U32 g_overwrite = 0; void FIO_overwriteMode(void) { g_overwrite=1; } static U32 g_sparseFileSupport = 1; /* 0 : no sparse allowed; 1: auto (file yes, stdout no); 2: force sparse */ @@ -376,8 +376,8 @@ static unsigned long long FIO_compressGzFrame(cRess_t* ress, const char* srcFile strm.zfree = Z_NULL; strm.opaque = Z_NULL; - ret = deflateInit2(&strm, compressionLevel, Z_DEFLATED, 15 /* maxWindowLogSize */ + 16 /* gzip only */, 8, Z_DEFAULT_STRATEGY); - if (ret != Z_OK) EXM_THROW(71, "zstd: %s: deflateInit2 error %d \n", srcFileName, ret); /* see http://www.zlib.net/manual.html */ + ret = deflateInit2(&strm, compressionLevel, Z_DEFLATED, 15 /* maxWindowLogSize */ + 16 /* gzip only */, 8, Z_DEFAULT_STRATEGY); /* see http://www.zlib.net/manual.html */ + if (ret != Z_OK) EXM_THROW(71, "zstd: %s: deflateInit2 error %d \n", srcFileName, ret); strm.next_in = 0; strm.avail_in = Z_NULL; @@ -443,10 +443,9 @@ static int FIO_compressFilename_internal(cRess_t ress, U64 compressedfilesize = 0; U64 const fileSize = UTIL_getFileSize(srcFileName); - if (g_compresionType) { + if (g_compressionType) { #ifdef ZSTD_GZCOMPRESS compressedfilesize = FIO_compressGzFrame(&ress, srcFileName, fileSize, compressionLevel, &readsize); - // printf("g_compresionType=%d compressionLevel=%d compressedfilesize=%d\n", g_compresionType, compressionLevel, (int)compressedfilesize); #else (void)compressionLevel; EXM_THROW(20, "zstd: %s: file cannot be compressed as gzip (zstd compiled without ZSTD_GZCOMPRESS) -- ignored \n", srcFileName); diff --git a/programs/fileio.h b/programs/fileio.h index 2b627557..e828b385 100644 --- a/programs/fileio.h +++ b/programs/fileio.h @@ -34,13 +34,13 @@ extern "C" { /*-************************************* * Types ***************************************/ -typedef enum { FIO_zstdCompression, FIO_gzipCompression } FIO_compresionType_t; +typedef enum { FIO_zstdCompression, FIO_gzipCompression } FIO_compressionType_t; /*-************************************* * Parameters ***************************************/ -void FIO_setCompresionType(FIO_compresionType_t compresionType); +void FIO_setCompressionType(FIO_compressionType_t compressionType); void FIO_overwriteMode(void); void FIO_setNotificationLevel(unsigned level); void FIO_setSparseWrite(unsigned sparse); /**< 0: no sparse; 1: disable on stdout; 2: always enabled */