remove -w build option
This commit is contained in:
parent
ed84111382
commit
c51a69e4dc
|
@ -21,7 +21,7 @@ AUX_SOURCE_DIRECTORY(zstd/dictBuilder SRC8)
|
||||||
# archive
|
# archive
|
||||||
ADD_LIBRARY(SZ STATIC ${SRC1} ${SRC2} ${SRC3} ${SRC4} ${SRC5} ${SRC6} ${SRC7} ${SRC8})
|
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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,6 @@ unsigned char numberOfLeadingZeros_Int(int i);
|
||||||
unsigned char numberOfLeadingZeros_Long(long i);
|
unsigned char numberOfLeadingZeros_Long(long i);
|
||||||
unsigned char getLeadingNumbers_Int(int v1, int v2);
|
unsigned char getLeadingNumbers_Int(int v1, int v2);
|
||||||
unsigned char getLeadingNumbers_Long(long v1, long 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);
|
float bytesToFloat(unsigned char* bytes);
|
||||||
void floatToBytes(unsigned char *b, float num);
|
void floatToBytes(unsigned char *b, float num);
|
||||||
double bytesToDouble(unsigned char* bytes);
|
double bytesToDouble(unsigned char* bytes);
|
||||||
|
|
|
@ -8,9 +8,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include "sz.h"
|
#include "sz.h"
|
||||||
#include "zlib.h"
|
#include "zlib.h"
|
||||||
|
|
||||||
|
|
||||||
inline unsigned short bytesToUInt16_bigEndian(unsigned char* bytes)
|
inline unsigned short bytesToUInt16_bigEndian(unsigned char* bytes)
|
||||||
{
|
{
|
||||||
int temp = 0;
|
int temp = 0;
|
||||||
|
@ -397,37 +399,8 @@ unsigned char getLeadingNumbers_Long(long v1, long v2)
|
||||||
return (unsigned char)numberOfLeadingZeros_Long(v);
|
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
|
//the byte to input is in the big-endian format
|
||||||
inline float bytesToFloat(unsigned char* bytes)
|
inline float bytesToFloat(unsigned char* bytes)
|
||||||
|
|
|
@ -13,8 +13,9 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <sz.h>
|
#include <string.h>
|
||||||
#include <CompressElement.h>
|
#include "sz.h"
|
||||||
|
#include "CompressElement.h"
|
||||||
|
|
||||||
|
|
||||||
inline short computeGroupNum_float(float value)
|
inline short computeGroupNum_float(float value)
|
||||||
|
|
|
@ -206,10 +206,7 @@ void convertTDPStoBytes_float(TightDataPointStorageF* tdps, unsigned char* bytes
|
||||||
unsigned char exactLengthBytes[8];
|
unsigned char exactLengthBytes[8];
|
||||||
unsigned char exactMidBytesLength[8];
|
unsigned char exactMidBytesLength[8];
|
||||||
unsigned char realPrecisionBytes[8];
|
unsigned char realPrecisionBytes[8];
|
||||||
|
|
||||||
unsigned char medianValueBytes[4];
|
unsigned char medianValueBytes[4];
|
||||||
|
|
||||||
unsigned char segment_sizeBytes[8];
|
|
||||||
unsigned char max_quant_intervals_Bytes[4];
|
unsigned char max_quant_intervals_Bytes[4];
|
||||||
|
|
||||||
// 1 version
|
// 1 version
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#include <sz.h>
|
#include <sz.h>
|
||||||
|
|
||||||
|
@ -221,7 +222,7 @@ unsigned long zlib_compress5(unsigned char* data, unsigned long dataLength, unsi
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
size_t p_size = 0, av_in = 0;
|
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
|
//*compressBytes = (unsigned char*)malloc(sizeof(unsigned char)*estCmpLen); // comment by tickduan no need malloc
|
||||||
unsigned char* out = compressBytes;
|
unsigned char* out = compressBytes;
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,6 @@ inline void compressSingleFloatValue(FloatValueCompressElement *vce, float oriVa
|
||||||
if(ignBitCount<0)
|
if(ignBitCount<0)
|
||||||
ignBitCount = 0;
|
ignBitCount = 0;
|
||||||
|
|
||||||
int tmp_int = diffVal.ivalue;
|
|
||||||
intToBytes_bigEndian(vce->curBytes, diffVal.ivalue);
|
intToBytes_bigEndian(vce->curBytes, diffVal.ivalue);
|
||||||
|
|
||||||
// truncate diff value tail bit with ignBitCount
|
// truncate diff value tail bit with ignBitCount
|
||||||
|
|
|
@ -659,7 +659,7 @@ dictionary * iniparser_load(const char * ininame)
|
||||||
char line [ASCIILINESZ+1] ;
|
char line [ASCIILINESZ+1] ;
|
||||||
char section [ASCIILINESZ+1] ;
|
char section [ASCIILINESZ+1] ;
|
||||||
char key [ASCIILINESZ+1] ;
|
char key [ASCIILINESZ+1] ;
|
||||||
char tmp [ASCIILINESZ+1] ;
|
char tmp [2*ASCIILINESZ+2] ;
|
||||||
char val [ASCIILINESZ+1] ;
|
char val [ASCIILINESZ+1] ;
|
||||||
|
|
||||||
int last=0 ;
|
int last=0 ;
|
||||||
|
|
|
@ -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 SZ_compress_args(int dataType, void *data, size_t r1, unsigned char* outData, sz_params* params)
|
||||||
{
|
{
|
||||||
size_t outSize = 0;
|
size_t outSize = 0;
|
||||||
int status;
|
|
||||||
if(dataType==SZ_FLOAT)
|
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)
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include "szd_double.h"
|
#include "szd_double.h"
|
||||||
#include "zlib.h"
|
#include "zlib.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
#include "sz_stats.h"
|
|
||||||
|
|
||||||
unsigned char* SZ_skip_compress_double(double* data, size_t dataLength, size_t* outSize)
|
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,
|
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)
|
size_t dataLength, double realPrecision, size_t *outSize, double valueRangeSize, double medianValue_d)
|
||||||
{
|
{
|
||||||
char compressionType = 0;
|
|
||||||
TightDataPointStorageD* tdps = NULL;
|
TightDataPointStorageD* tdps = NULL;
|
||||||
tdps = SZ_compress_double_1D_MDQ(oriData, dataLength, realPrecision, valueRangeSize, medianValue_d);
|
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;
|
int status = SZ_SUCCESS;
|
||||||
size_t dataLength = r1;
|
size_t dataLength = r1;
|
||||||
|
|
||||||
|
|
||||||
double valueRangeSize = 0, medianValue = 0;
|
double valueRangeSize = 0, medianValue = 0;
|
||||||
|
|
||||||
bool positive = true;
|
|
||||||
double nearZero = 0.0;
|
|
||||||
|
|
||||||
// check at least elements count
|
// check at least elements count
|
||||||
if(dataLength <= MIN_NUM_OF_ELEMENTS)
|
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;
|
return SZ_LITTER_ELEMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -306,14 +306,11 @@ int SZ_compress_args_float(float *oriData, size_t r1, unsigned char* newByteData
|
||||||
// check at least elements count
|
// check at least elements count
|
||||||
if(dataLength <= MIN_NUM_OF_ELEMENTS)
|
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;
|
return SZ_LITTER_ELEMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
float valueRangeSize = 0, medianValue = 0;
|
float valueRangeSize = 0, medianValue = 0;
|
||||||
unsigned char * signs = NULL;
|
|
||||||
bool positive = true;
|
|
||||||
float nearZero = 0.0;
|
|
||||||
float min = 0;
|
float min = 0;
|
||||||
|
|
||||||
min = computeRangeSize_float(oriData, dataLength, &valueRangeSize, &medianValue);
|
min = computeRangeSize_float(oriData, dataLength, &valueRangeSize, &medianValue);
|
||||||
|
|
|
@ -67,7 +67,6 @@ int SZ_decompress_args_double(double* newData, size_t r1, unsigned char* cmpByte
|
||||||
return SZ_FORMAT_ERR;
|
return SZ_FORMAT_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dim = r1;
|
|
||||||
int doubleSize = sizeof(double);
|
int doubleSize = sizeof(double);
|
||||||
if(tdps->isLossless)
|
if(tdps->isLossless)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,7 @@ int tdszCompress(int type, const char * input, const int nelements, const char *
|
||||||
// check valid
|
// check valid
|
||||||
sz_params comp_params = *confparams_cpr;
|
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;
|
return (int)outSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue