From c51a69e4dc26fe5e40054596c8fb9d402ecacdff Mon Sep 17 00:00:00 2001 From: tickduan <417921451@qq.com> Date: Thu, 8 Jul 2021 11:17:39 +0800 Subject: [PATCH] remove -w build option --- deps/SZ/CMakeLists.txt | 2 +- deps/SZ/sz/include/ByteToolkit.h | 4 ---- deps/SZ/sz/src/ByteToolkit.c | 31 ++----------------------- deps/SZ/sz/src/CompressElement.c | 5 ++-- deps/SZ/sz/src/TightDataPointStorageF.c | 3 --- deps/SZ/sz/src/callZlib.c | 3 ++- deps/SZ/sz/src/dataCompression.c | 1 - deps/SZ/sz/src/iniparser.c | 2 +- deps/SZ/sz/src/sz.c | 5 ++-- deps/SZ/sz/src/sz_double.c | 8 +------ deps/SZ/sz/src/sz_float.c | 5 +--- deps/SZ/sz/src/szd_double.c | 1 - deps/SZ/sz/src/td_sz.c | 2 +- 13 files changed, 14 insertions(+), 58 deletions(-) diff --git a/deps/SZ/CMakeLists.txt b/deps/SZ/CMakeLists.txt index 06afefda65..72c8ef9b84 100644 --- a/deps/SZ/CMakeLists.txt +++ b/deps/SZ/CMakeLists.txt @@ -21,7 +21,7 @@ AUX_SOURCE_DIRECTORY(zstd/dictBuilder SRC8) # archive ADD_LIBRARY(SZ STATIC ${SRC1} ${SRC2} ${SRC3} ${SRC4} ${SRC5} ${SRC6} ${SRC7} ${SRC8}) -SET_TARGET_PROPERTIES(SZ PROPERTIES COMPILE_FLAGS -w) +#SET_TARGET_PROPERTIES(SZ PROPERTIES COMPILE_FLAGS -w) diff --git a/deps/SZ/sz/include/ByteToolkit.h b/deps/SZ/sz/include/ByteToolkit.h index e88bf020f5..c6a3dffdbb 100644 --- a/deps/SZ/sz/include/ByteToolkit.h +++ b/deps/SZ/sz/include/ByteToolkit.h @@ -45,10 +45,6 @@ unsigned char numberOfLeadingZeros_Int(int i); unsigned char numberOfLeadingZeros_Long(long i); unsigned char getLeadingNumbers_Int(int v1, int v2); unsigned char getLeadingNumbers_Long(long v1, long v2); -short bytesToShort(unsigned char* bytes); -void shortToBytes(unsigned char* b, short value); -int bytesToInt(unsigned char* bytes); -long bytesToLong(unsigned char* bytes); float bytesToFloat(unsigned char* bytes); void floatToBytes(unsigned char *b, float num); double bytesToDouble(unsigned char* bytes); diff --git a/deps/SZ/sz/src/ByteToolkit.c b/deps/SZ/sz/src/ByteToolkit.c index 24041efeab..a58eaa2a9f 100644 --- a/deps/SZ/sz/src/ByteToolkit.c +++ b/deps/SZ/sz/src/ByteToolkit.c @@ -8,9 +8,11 @@ */ #include +#include #include "sz.h" #include "zlib.h" + inline unsigned short bytesToUInt16_bigEndian(unsigned char* bytes) { int temp = 0; @@ -397,37 +399,8 @@ unsigned char getLeadingNumbers_Long(long v1, long v2) return (unsigned char)numberOfLeadingZeros_Long(v); } -/** - * By default, the endian type is OS endian type. - * */ -short bytesToShort(unsigned char* bytes) -{ - lint16 buf; - memcpy(buf.byte, bytes, 2); - - return buf.svalue; -} -void shortToBytes(unsigned char* b, short value) -{ - lint16 buf; - buf.svalue = value; - memcpy(b, buf.byte, 2); -} -int bytesToInt(unsigned char* bytes) -{ - lfloat buf; - memcpy(buf.byte, bytes, 4); - return buf.ivalue; -} - -long bytesToLong(unsigned char* bytes) -{ - ldouble buf; - memcpy(buf.byte, bytes, 8); - return buf.lvalue; -} //the byte to input is in the big-endian format inline float bytesToFloat(unsigned char* bytes) diff --git a/deps/SZ/sz/src/CompressElement.c b/deps/SZ/sz/src/CompressElement.c index c941ded46d..2b50f7c79d 100644 --- a/deps/SZ/sz/src/CompressElement.c +++ b/deps/SZ/sz/src/CompressElement.c @@ -13,8 +13,9 @@ #include #include #include -#include -#include +#include +#include "sz.h" +#include "CompressElement.h" inline short computeGroupNum_float(float value) diff --git a/deps/SZ/sz/src/TightDataPointStorageF.c b/deps/SZ/sz/src/TightDataPointStorageF.c index 8d65d24cfd..6abf345370 100644 --- a/deps/SZ/sz/src/TightDataPointStorageF.c +++ b/deps/SZ/sz/src/TightDataPointStorageF.c @@ -206,10 +206,7 @@ void convertTDPStoBytes_float(TightDataPointStorageF* tdps, unsigned char* bytes unsigned char exactLengthBytes[8]; unsigned char exactMidBytesLength[8]; unsigned char realPrecisionBytes[8]; - unsigned char medianValueBytes[4]; - - unsigned char segment_sizeBytes[8]; unsigned char max_quant_intervals_Bytes[4]; // 1 version diff --git a/deps/SZ/sz/src/callZlib.c b/deps/SZ/sz/src/callZlib.c index 842bd11ac3..f38d4c9c08 100644 --- a/deps/SZ/sz/src/callZlib.c +++ b/deps/SZ/sz/src/callZlib.c @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -221,7 +222,7 @@ unsigned long zlib_compress5(unsigned char* data, unsigned long dataLength, unsi return ret; size_t p_size = 0, av_in = 0; - uLong estCmpLen = deflateBound(&strm, dataLength); + deflateBound(&strm, dataLength); //*compressBytes = (unsigned char*)malloc(sizeof(unsigned char)*estCmpLen); // comment by tickduan no need malloc unsigned char* out = compressBytes; diff --git a/deps/SZ/sz/src/dataCompression.c b/deps/SZ/sz/src/dataCompression.c index 237a3315c1..64d89e1e5c 100644 --- a/deps/SZ/sz/src/dataCompression.c +++ b/deps/SZ/sz/src/dataCompression.c @@ -207,7 +207,6 @@ inline void compressSingleFloatValue(FloatValueCompressElement *vce, float oriVa if(ignBitCount<0) ignBitCount = 0; - int tmp_int = diffVal.ivalue; intToBytes_bigEndian(vce->curBytes, diffVal.ivalue); // truncate diff value tail bit with ignBitCount diff --git a/deps/SZ/sz/src/iniparser.c b/deps/SZ/sz/src/iniparser.c index b076ed1d0f..3d5b8dcda0 100644 --- a/deps/SZ/sz/src/iniparser.c +++ b/deps/SZ/sz/src/iniparser.c @@ -659,7 +659,7 @@ dictionary * iniparser_load(const char * ininame) char line [ASCIILINESZ+1] ; char section [ASCIILINESZ+1] ; char key [ASCIILINESZ+1] ; - char tmp [ASCIILINESZ+1] ; + char tmp [2*ASCIILINESZ+2] ; char val [ASCIILINESZ+1] ; int last=0 ; diff --git a/deps/SZ/sz/src/sz.c b/deps/SZ/sz/src/sz.c index 442bf8ad55..92fd7c27cf 100644 --- a/deps/SZ/sz/src/sz.c +++ b/deps/SZ/sz/src/sz.c @@ -90,14 +90,13 @@ int SZ_Init_Params(sz_params *params) size_t SZ_compress_args(int dataType, void *data, size_t r1, unsigned char* outData, sz_params* params) { size_t outSize = 0; - int status; if(dataType==SZ_FLOAT) { - status = SZ_compress_args_float((float *)data, r1, outData, &outSize, params); + SZ_compress_args_float((float *)data, r1, outData, &outSize, params); } else if(dataType==SZ_DOUBLE) { - status = SZ_compress_args_double((double *)data, r1, outData, &outSize, params); + SZ_compress_args_double((double *)data, r1, outData, &outSize, params); } else { diff --git a/deps/SZ/sz/src/sz_double.c b/deps/SZ/sz/src/sz_double.c index 1413c9ce30..2a41f529fa 100644 --- a/deps/SZ/sz/src/sz_double.c +++ b/deps/SZ/sz/src/sz_double.c @@ -22,7 +22,6 @@ #include "szd_double.h" #include "zlib.h" #include "utility.h" -#include "sz_stats.h" unsigned char* SZ_skip_compress_double(double* data, size_t dataLength, size_t* outSize) { @@ -253,7 +252,6 @@ void SZ_compress_args_double_StoreOriData(double* oriData, size_t dataLength, un bool SZ_compress_args_double_NoCkRngeNoGzip_1D(unsigned char* newByteData, double *oriData, size_t dataLength, double realPrecision, size_t *outSize, double valueRangeSize, double medianValue_d) { - char compressionType = 0; TightDataPointStorageD* tdps = NULL; tdps = SZ_compress_double_1D_MDQ(oriData, dataLength, realPrecision, valueRangeSize, medianValue_d); @@ -301,16 +299,12 @@ int SZ_compress_args_double(double *oriData, size_t r1, unsigned char* newByteDa int status = SZ_SUCCESS; size_t dataLength = r1; - double valueRangeSize = 0, medianValue = 0; - - bool positive = true; - double nearZero = 0.0; // check at least elements count if(dataLength <= MIN_NUM_OF_ELEMENTS) { - printf("error, double input elements count=%d less than %d, so need not do compress.\n", dataLength, MIN_NUM_OF_ELEMENTS); + printf("error, double input elements count=%ld less than %d, so need not do compress.\n", dataLength, MIN_NUM_OF_ELEMENTS); return SZ_LITTER_ELEMENT; } diff --git a/deps/SZ/sz/src/sz_float.c b/deps/SZ/sz/src/sz_float.c index 7ca45335d6..22ac8377d2 100644 --- a/deps/SZ/sz/src/sz_float.c +++ b/deps/SZ/sz/src/sz_float.c @@ -306,14 +306,11 @@ int SZ_compress_args_float(float *oriData, size_t r1, unsigned char* newByteData // check at least elements count if(dataLength <= MIN_NUM_OF_ELEMENTS) { - printf("error, input elements count=%d less than %d, so need not do compress.\n", dataLength, MIN_NUM_OF_ELEMENTS); + printf("error, input elements count=%ld less than %d, so need not do compress.\n", dataLength, MIN_NUM_OF_ELEMENTS); return SZ_LITTER_ELEMENT; } float valueRangeSize = 0, medianValue = 0; - unsigned char * signs = NULL; - bool positive = true; - float nearZero = 0.0; float min = 0; min = computeRangeSize_float(oriData, dataLength, &valueRangeSize, &medianValue); diff --git a/deps/SZ/sz/src/szd_double.c b/deps/SZ/sz/src/szd_double.c index d3df89de77..93ef42e418 100644 --- a/deps/SZ/sz/src/szd_double.c +++ b/deps/SZ/sz/src/szd_double.c @@ -67,7 +67,6 @@ int SZ_decompress_args_double(double* newData, size_t r1, unsigned char* cmpByte return SZ_FORMAT_ERR; } - int dim = r1; int doubleSize = sizeof(double); if(tdps->isLossless) { diff --git a/deps/SZ/sz/src/td_sz.c b/deps/SZ/sz/src/td_sz.c index c04c4aed6f..dde5512b1d 100644 --- a/deps/SZ/sz/src/td_sz.c +++ b/deps/SZ/sz/src/td_sz.c @@ -43,7 +43,7 @@ int tdszCompress(int type, const char * input, const int nelements, const char * // check valid sz_params comp_params = *confparams_cpr; - size_t outSize = SZ_compress_args(type, input, (size_t)nelements, (unsigned char*)output, &comp_params); + size_t outSize = SZ_compress_args(type, (void*)input, (size_t)nelements, (unsigned char*)output, &comp_params); return (int)outSize; } -- GitLab