diff --git a/deps/SZ/CMakeLists.txt b/deps/SZ/CMakeLists.txt index 06afefda6532310943bcb3e6000f736da013dce6..72c8ef9b84b9eada517deda64827ec39ce52acc6 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 e88bf020f56c92c36777e58b199f9f0450e3461b..c6a3dffdbb203d08fa107eddb18dff49df65aeca 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 24041efeab51036d74ab049a9afc72f934cd8c2c..a58eaa2a9f9d7e70b6df360968bd77053777ab87 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 c941ded46da0e3865c97315ab84563a2fc22600a..2b50f7c79d35eb3bb2552e97cbb113ad03aedcd4 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 8d65d24cfd746253dbb44a9a230bc82775d68566..6abf345370a07c4984df660aae63cdd7b1f11d08 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 842bd11ac3eb3e99f8751491ef6c2405ee30e4a4..f38d4c9c0824e6ee86e5d1bdb75401e2d67fee63 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 237a3315c1b56435154cee3efd9f01946b6919e3..64d89e1e5cbc8c86adecb206c6e8f4ea089e419a 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 b076ed1d0f885b419c170eff5924614cd9239350..3d5b8dcda0bcfe53f01e358d5edf40dc1dcab3b9 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 442bf8ad55653732874e8fedfd177b957cca81bc..92fd7c27cf79c6608b035cde702fad6bfac1c48d 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 1413c9ce306920cb4afd1875a94ad0cd24ec38c0..2a41f529fad7636a3e45b9e005cacee66d8f9d97 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 7ca45335d6ae37bc26d5b606eb7cf37f39ea0963..22ac8377d298e3f60873db598c80765b9f826675 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 d3df89de77e4d6d6f0d6c1cc6668de7d49d1ac66..93ef42e418550b49c8dd423065bbeb553921b9b9 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 c04c4aed6f43d9f4b2aa62465cb792c85a1c03c6..dde5512b1d31e4791d996c94858c00667059bd7c 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; }