diff --git a/deps/SZ/sz/src/CompressElement.c b/deps/SZ/sz/src/CompressElement.c index 50660989f489710baac310534d49c55bdd221ca1..b71ff9638eae603dd1ccad6e9f49a5c8add1ab0e 100644 --- a/deps/SZ/sz/src/CompressElement.c +++ b/deps/SZ/sz/src/CompressElement.c @@ -19,7 +19,7 @@ #include "CompressElement.h" -inline short computeGroupNum_float(float value) +INLINE short computeGroupNum_float(float value) { short expo = getExponent_float(value); if(expo < 0) @@ -27,7 +27,7 @@ inline short computeGroupNum_float(float value) return expo; } -inline short computeGroupNum_double(double value) +INLINE short computeGroupNum_double(double value) { short expo = getExponent_double(value); if(expo < 0) @@ -40,35 +40,35 @@ inline short computeGroupNum_double(double value) * @param last3CmprsData buffer * @param value the value to be added to the buffer * */ -inline void listAdd_double(double last3CmprsData[3], double value) +INLINE void listAdd_double(double last3CmprsData[3], double value) { last3CmprsData[2] = last3CmprsData[1]; last3CmprsData[1] = last3CmprsData[0]; last3CmprsData[0] = value; } -inline void listAdd_float(float last3CmprsData[3], float value) +INLINE void listAdd_float(float last3CmprsData[3], float value) { last3CmprsData[2] = last3CmprsData[1]; last3CmprsData[1] = last3CmprsData[0]; last3CmprsData[0] = value; } -inline void listAdd_int(int64_t last3CmprsData[3], int64_t value) +INLINE void listAdd_int(int64_t last3CmprsData[3], int64_t value) { last3CmprsData[2] = last3CmprsData[1]; last3CmprsData[1] = last3CmprsData[0]; last3CmprsData[0] = value; } -inline void listAdd_int32(int32_t last3CmprsData[3], int32_t value) +INLINE void listAdd_int32(int32_t last3CmprsData[3], int32_t value) { last3CmprsData[2] = last3CmprsData[1]; last3CmprsData[1] = last3CmprsData[0]; last3CmprsData[0] = value; } -inline void listAdd_float_group(float *groups, int *flags, char groupNum, float oriValue, float decValue, char* curGroupID) +INLINE void listAdd_float_group(float *groups, int *flags, char groupNum, float oriValue, float decValue, char* curGroupID) { if(groupNum>=0) { @@ -88,7 +88,7 @@ inline void listAdd_float_group(float *groups, int *flags, char groupNum, float *curGroupID = -(groupNum+2); //-[-1,0,1,2,3,....,16] is mapped to [-1,-2,....,-18] } -inline void listAdd_double_group(double *groups, int *flags, char groupNum, double oriValue, double decValue, char* curGroupID) +INLINE void listAdd_double_group(double *groups, int *flags, char groupNum, double oriValue, double decValue, char* curGroupID) { if(groupNum>=0) { @@ -112,7 +112,7 @@ inline void listAdd_double_group(double *groups, int *flags, char groupNum, doub * Determine whether the prediction value minErr is valid. * * */ -inline int validPrediction_double(double minErr, double precision) +INLINE int validPrediction_double(double minErr, double precision) { if(minErr<=precision) return 1; @@ -120,7 +120,7 @@ inline int validPrediction_double(double minErr, double precision) return 0; } -inline int validPrediction_float(float minErr, float precision) +INLINE int validPrediction_float(float minErr, float precision) { if(minErr<=precision) return 1; @@ -204,7 +204,7 @@ void updateLossyCompElement_Double(unsigned char* curBytes, unsigned char* preBy lce->residualMidBits = resiBits; } -inline void updateLossyCompElement_Float(unsigned char* diffBytes, unsigned char* preDiffBytes, +INLINE void updateLossyCompElement_Float(unsigned char* diffBytes, unsigned char* preDiffBytes, int reqBytesLength, int resiBitsLength, LossyCompressionElement *lce) { int resiIndex, intMidBytes_Length = 0; diff --git a/deps/SZ/sz/src/DynamicByteArray.c b/deps/SZ/sz/src/DynamicByteArray.c index 64b7d5c7b4a59bd7682b912ce0eca0bdc5c50241..40fa5548ba9008700dbaa129f978e81813c2e10a 100644 --- a/deps/SZ/sz/src/DynamicByteArray.c +++ b/deps/SZ/sz/src/DynamicByteArray.c @@ -11,6 +11,7 @@ #include #include #include "DynamicByteArray.h" +#include "sz.h" void new_DBA(DynamicByteArray **dba, size_t cap) { *dba = (DynamicByteArray *)malloc(sizeof(DynamicByteArray)); @@ -35,7 +36,7 @@ void free_DBA(DynamicByteArray *dba) free(dba); } -inline unsigned char getDBA_Data(DynamicByteArray *dba, size_t pos) +INLINE unsigned char getDBA_Data(DynamicByteArray *dba, size_t pos) { if(pos>=dba->size) { @@ -45,7 +46,7 @@ inline unsigned char getDBA_Data(DynamicByteArray *dba, size_t pos) return dba->array[pos]; } -inline void addDBA_Data(DynamicByteArray *dba, unsigned char value) +INLINE void addDBA_Data(DynamicByteArray *dba, unsigned char value) { if(dba->size==dba->capacity) { @@ -56,7 +57,7 @@ inline void addDBA_Data(DynamicByteArray *dba, unsigned char value) dba->size ++; } -inline void memcpyDBA_Data(DynamicByteArray *dba, unsigned char* data, size_t length) +INLINE void memcpyDBA_Data(DynamicByteArray *dba, unsigned char* data, size_t length) { if(dba->size + length > dba->capacity) { diff --git a/deps/SZ/sz/src/DynamicIntArray.c b/deps/SZ/sz/src/DynamicIntArray.c index 347e3a18080b53b0ce10890728f61262ddeee1b2..d9e7a2a89aa1b57358fc7c8ca2aa20b301e9040f 100644 --- a/deps/SZ/sz/src/DynamicIntArray.c +++ b/deps/SZ/sz/src/DynamicIntArray.c @@ -11,6 +11,7 @@ #include #include #include "DynamicIntArray.h" +#include "sz.h" void new_DIA(DynamicIntArray **dia, size_t cap) { *dia = (DynamicIntArray *)malloc(sizeof(DynamicIntArray)); @@ -45,7 +46,7 @@ int getDIA_Data(DynamicIntArray *dia, size_t pos) return dia->array[pos]; } -inline void addDIA_Data(DynamicIntArray *dia, int value) +INLINE void addDIA_Data(DynamicIntArray *dia, int value) { if(dia->size==dia->capacity) { diff --git a/deps/SZ/sz/src/TypeManager.c b/deps/SZ/sz/src/TypeManager.c index dcdda19f75d28b063208b7301f02d896344e64b5..6c2e0a838ca5fbcb1c42c920408711434401122b 100644 --- a/deps/SZ/sz/src/TypeManager.c +++ b/deps/SZ/sz/src/TypeManager.c @@ -151,7 +151,7 @@ size_t convertIntArray2ByteArray_fast_2b(unsigned char* timeStepType, size_t tim return byteLength; } -inline int getLeftMovingSteps(size_t k, unsigned char resiBitLength) +INLINE int getLeftMovingSteps(size_t k, unsigned char resiBitLength) { return 8 - k%8 - resiBitLength; } diff --git a/deps/SZ/sz/src/dataCompression.c b/deps/SZ/sz/src/dataCompression.c index 3c32878bb4b3bb9274fc8c75daa02e8332a3a5a4..6aa13487740e7e5627b05b8ea7b1ca150c068b80 100644 --- a/deps/SZ/sz/src/dataCompression.c +++ b/deps/SZ/sz/src/dataCompression.c @@ -177,14 +177,14 @@ void symTransform_8bytes(unsigned char data[8]) data[4] = tmp; } -inline void symTransform_2bytes(unsigned char data[2]) +INLINE void symTransform_2bytes(unsigned char data[2]) { unsigned char tmp = data[0]; data[0] = data[1]; data[1] = tmp; } -inline void symTransform_4bytes(unsigned char data[4]) +INLINE void symTransform_4bytes(unsigned char data[4]) { unsigned char tmp = data[0]; data[0] = data[3]; @@ -195,7 +195,7 @@ inline void symTransform_4bytes(unsigned char data[4]) data[2] = tmp; } -inline void compressSingleFloatValue(FloatValueCompressElement *vce, float oriValue, float precision, float medianValue, +INLINE void compressSingleFloatValue(FloatValueCompressElement *vce, float oriValue, float precision, float medianValue, int reqLength, int reqBytesLength, int resiBitsLength) { lfloat diffVal; @@ -255,7 +255,7 @@ int compIdenticalLeadingBytesCount_double(unsigned char* preBytes, unsigned char return n; } -inline int compIdenticalLeadingBytesCount_float(unsigned char* preBytes, unsigned char* curBytes) +INLINE int compIdenticalLeadingBytesCount_float(unsigned char* preBytes, unsigned char* curBytes) { int i, n = 0; for(i=0;i<4;i++) @@ -268,7 +268,7 @@ inline int compIdenticalLeadingBytesCount_float(unsigned char* preBytes, unsigne } //TODO double-check the correctness... -inline void addExactData(DynamicByteArray *exactMidByteArray, DynamicIntArray *exactLeadNumArray, +INLINE void addExactData(DynamicByteArray *exactMidByteArray, DynamicIntArray *exactLeadNumArray, DynamicIntArray *resiBitArray, LossyCompressionElement *lce) { int i; diff --git a/deps/SZ/sz/src/sz.c b/deps/SZ/sz/src/sz.c index 4d3b0adbbe23ac755e0d5eaeef649ff03919e433..9c88da1526d3d6dc91f2c4f3c26766164e5bf7c5 100644 --- a/deps/SZ/sz/src/sz.c +++ b/deps/SZ/sz/src/sz.c @@ -163,18 +163,8 @@ void SZ_Finalize() #ifdef WINDOWS #include +int gettimeofday(struct timeval *tv, struct timezone *tz); -int gettimeofday(struct timeval *tv, struct timezone *tz) { - time_t t; - t = time(NULL); - SYSTEMTIME st; - GetLocalTime(&st); - - tv->tv_sec = (long)t; - tv->tv_usec = st.wMilliseconds * 1000; - - return 0; -} #else #include #endif diff --git a/deps/SZ/sz/src/sz_double.c b/deps/SZ/sz/src/sz_double.c index e04c6f020505de1fa3063d59ec0c8a8a36ee142b..91ed43184935e61f810ec6047d0bf2f1aaa12067 100644 --- a/deps/SZ/sz/src/sz_double.c +++ b/deps/SZ/sz/src/sz_double.c @@ -30,7 +30,7 @@ unsigned char* SZ_skip_compress_double(double* data, size_t dataLength, size_t* return out; } -inline void computeReqLength_double(double realPrecision, short radExpo, int* reqLength, double* medianValue) +INLINE void computeReqLength_double(double realPrecision, short radExpo, int* reqLength, double* medianValue) { short reqExpo = getPrecisionReqLength_double(realPrecision); *reqLength = 12+radExpo - reqExpo; //radExpo-reqExpo == reqMantiLength