fix: define BUILDIN_CLZ_EX
This commit is contained in:
parent
378bf09612
commit
f947eb752a
|
@ -27,7 +27,7 @@ double cost_end(const char* tag);
|
||||||
//
|
//
|
||||||
// Init success return 1 else 0
|
// Init success return 1 else 0
|
||||||
//
|
//
|
||||||
void tdszInit(double fPrecision, double dPrecision, unsigned int maxIntervals, unsigned int intervals, int ifAdtFse, const char* compressor);
|
void tdszInit(float fPrecision, double dPrecision, unsigned int maxIntervals, unsigned int intervals, int ifAdtFse, const char* compressor);
|
||||||
|
|
||||||
//
|
//
|
||||||
// compress interface to tdengine return value is count of output with bytes
|
// compress interface to tdengine return value is count of output with bytes
|
||||||
|
|
|
@ -19,9 +19,9 @@ extern "C" {
|
||||||
|
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
int32_t BUILDIN_CLZ(uint32_t val);
|
int32_t BUILDIN_CLZ_EX(uint32_t val);
|
||||||
#else
|
#else
|
||||||
#define BUILDIN_CLZ(val) __builtin_clz(val)
|
#define BUILDIN_CLZ_EX(val) __builtin_clz(val)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,10 +60,10 @@ MEM_STATIC int Int2code(int factor)
|
||||||
24, 24, 24, 24, 24, 24, 24, 24,
|
24, 24, 24, 24, 24, 24, 24, 24,
|
||||||
24, 24, 24, 24, 24, 24, 24, 24 };
|
24, 24, 24, 24, 24, 24, 24, 24 };
|
||||||
if (factor >= 0)
|
if (factor >= 0)
|
||||||
return (factor > 63) ? 50 - BUILDIN_CLZ(factor) : Ft_Code[factor];
|
return (factor > 63) ? 50 - BUILDIN_CLZ_EX(factor) : Ft_Code[factor];
|
||||||
else {
|
else {
|
||||||
factor = -factor;
|
factor = -factor;
|
||||||
return (factor > 63) ? 17 + BUILDIN_CLZ(factor) : 67 - Ft_Code[factor];
|
return (factor > 63) ? 17 + BUILDIN_CLZ_EX(factor) : 67 - Ft_Code[factor];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
int32_t BUILDIN_CLZ(uint32_t val) {
|
int32_t BUILDIN_CLZ_EX(uint32_t val) {
|
||||||
unsigned long r = 0;
|
unsigned long r = 0;
|
||||||
_BitScanReverse(&r, val);
|
_BitScanReverse(&r, val);
|
||||||
return (int)(31 - r);
|
return (int)(31 - r);
|
||||||
|
|
Loading…
Reference in New Issue