compatible windows os
This commit is contained in:
parent
ddcd211f1b
commit
9b720e072a
|
@ -26,8 +26,7 @@ short getExponent_float(float value);
|
|||
short getPrecisionReqLength_float(float precision);
|
||||
short getExponent_double(double value);
|
||||
short getPrecisionReqLength_double(double precision);
|
||||
unsigned char numberOfLeadingZeros_Int(int i);
|
||||
unsigned char numberOfLeadingZeros_Long(long i);
|
||||
|
||||
float bytesToFloat(unsigned char* bytes);
|
||||
void floatToBytes(unsigned char *b, float num);
|
||||
double bytesToDouble(unsigned char* bytes);
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
New types
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/time.h> /* For gettimeofday(), in microseconds */
|
||||
#include <time.h> /* For time(), in seconds */
|
||||
#include "pub.h"
|
||||
#include "CompressElement.h"
|
||||
|
|
|
@ -138,7 +138,7 @@ int SZ_ReadConf(const char* sz_cfgFile) {
|
|||
|
||||
|
||||
// default option
|
||||
if(sz_cfgFile == NULL || access(sz_cfgFile, F_OK) != 0)
|
||||
if(sz_cfgFile == NULL)
|
||||
{
|
||||
dataEndianType = LITTLE_ENDIAN_DATA;
|
||||
setDefaulParams(exe_params, confparams_cpr);
|
||||
|
@ -146,12 +146,6 @@ int SZ_ReadConf(const char* sz_cfgFile) {
|
|||
return SZ_SUCCESS;
|
||||
}
|
||||
|
||||
if (access(sz_cfgFile, F_OK) != 0)
|
||||
{
|
||||
printf("[SZ] Configuration file NOT accessible.\n");
|
||||
return SZ_FAILED;
|
||||
}
|
||||
|
||||
//printf("[SZ] Reading SZ configuration file (%s) ...\n", sz_cfgFile);
|
||||
ini = iniparser_load(sz_cfgFile);
|
||||
if (ini == NULL)
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "sz.h"
|
||||
#include "DynamicByteArray.h"
|
||||
#include "DynamicIntArray.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/** Maximum value size for integers and doubles. */
|
||||
#define MAXVALSZ 1024
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "sz.h"
|
||||
#include "CompressElement.h"
|
||||
#include "DynamicByteArray.h"
|
||||
|
@ -21,6 +20,7 @@
|
|||
#include "conf.h"
|
||||
#include "utility.h"
|
||||
|
||||
|
||||
//#include "CurveFillingCompressStorage.h"
|
||||
|
||||
unsigned char versionNumber = DATA_FROMAT_VER1;
|
||||
|
@ -170,14 +170,27 @@ void modulePath(char *buf, int size)
|
|||
pos[1]=0;
|
||||
}
|
||||
|
||||
#ifdef WINDOWS
|
||||
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 <sys/time.h>
|
||||
#endif
|
||||
|
||||
struct timeval startTime;
|
||||
struct timeval endTime; /* Start and end times */
|
||||
struct timeval costStart; /*only used for recording the cost*/
|
||||
double totalCost = 0;
|
||||
|
||||
|
||||
|
||||
void cost_start()
|
||||
{
|
||||
totalCost = 0;
|
||||
|
@ -201,3 +214,4 @@ void show_rate(int in_len, int out_len)
|
|||
float rate=100*(float)out_len/(float)in_len;
|
||||
printf(" in_len=%d out_len=%d compress rate=%.4f%%\n", in_len, out_len, rate);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
#include "sz.h"
|
||||
#include "CompressElement.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
#include "sz.h"
|
||||
#include "CompressElement.h"
|
||||
|
|
Loading…
Reference in New Issue