Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
98898dc5
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
98898dc5
编写于
7月 08, 2021
作者:
T
tickduan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
inline define not found
上级
22fc4b90
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
21 addition
and
19 deletion
+21
-19
deps/SZ/sz/include/sz.h
deps/SZ/sz/include/sz.h
+3
-0
deps/SZ/sz/src/ByteToolkit.c
deps/SZ/sz/src/ByteToolkit.c
+18
-19
未找到文件。
deps/SZ/sz/include/sz.h
浏览文件 @
98898dc5
...
...
@@ -32,10 +32,13 @@
#ifdef _WIN32
#define PATH_SEPARATOR ';'
#define INLINE
#else
#define PATH_SEPARATOR ':'
#define INLINE inline
#endif
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
deps/SZ/sz/src/ByteToolkit.c
浏览文件 @
98898dc5
...
...
@@ -12,8 +12,7 @@
#include "sz.h"
#include "zlib.h"
inline
int
bytesToInt_bigEndian
(
unsigned
char
*
bytes
)
INLINE
int
bytesToInt_bigEndian
(
unsigned
char
*
bytes
)
{
int
temp
=
0
;
int
res
=
0
;
...
...
@@ -41,7 +40,7 @@ inline int bytesToInt_bigEndian(unsigned char* bytes)
* @unsigned char *b the variable to store the converted bytes (length=4)
* @unsigned int num
* */
inline
void
intToBytes_bigEndian
(
unsigned
char
*
b
,
unsigned
int
num
)
INLINE
void
intToBytes_bigEndian
(
unsigned
char
*
b
,
unsigned
int
num
)
{
b
[
0
]
=
(
unsigned
char
)(
num
>>
24
);
b
[
1
]
=
(
unsigned
char
)(
num
>>
16
);
...
...
@@ -56,7 +55,7 @@ inline void intToBytes_bigEndian(unsigned char *b, unsigned int num)
/**
* @endianType: refers to the endian_type of unsigned char* b.
* */
inline
long
bytesToLong_bigEndian
(
unsigned
char
*
b
)
{
INLINE
long
bytesToLong_bigEndian
(
unsigned
char
*
b
)
{
long
temp
=
0
;
long
res
=
0
;
...
...
@@ -95,7 +94,7 @@ inline long bytesToLong_bigEndian(unsigned char* b) {
return
res
;
}
inline
void
longToBytes_bigEndian
(
unsigned
char
*
b
,
unsigned
long
num
)
INLINE
void
longToBytes_bigEndian
(
unsigned
char
*
b
,
unsigned
long
num
)
{
// arm32
#if defined(_TD_LINUX_64) || defined(_TD_ARM_64) || defined(_TD_DARWIN_64)
...
...
@@ -115,7 +114,7 @@ inline void longToBytes_bigEndian(unsigned char *b, unsigned long num)
}
//TODO: debug: lfBuf.lvalue could be actually little_endian....
inline
short
getExponent_float
(
float
value
)
INLINE
short
getExponent_float
(
float
value
)
{
//int ivalue = floatToBigEndianInt(value);
...
...
@@ -128,7 +127,7 @@ inline short getExponent_float(float value)
return
(
short
)
expValue
;
}
inline
short
getPrecisionReqLength_float
(
float
precision
)
INLINE
short
getPrecisionReqLength_float
(
float
precision
)
{
lfloat
lbuf
;
lbuf
.
value
=
precision
;
...
...
@@ -142,7 +141,7 @@ inline short getPrecisionReqLength_float(float precision)
return
(
short
)
expValue
;
}
inline
short
getExponent_double
(
double
value
)
INLINE
short
getExponent_double
(
double
value
)
{
//long lvalue = doubleToBigEndianLong(value);
...
...
@@ -155,7 +154,7 @@ inline short getExponent_double(double value)
return
(
short
)
expValue
;
}
inline
short
getPrecisionReqLength_double
(
double
precision
)
INLINE
short
getPrecisionReqLength_double
(
double
precision
)
{
ldouble
lbuf
;
lbuf
.
value
=
precision
;
...
...
@@ -171,7 +170,7 @@ inline short getPrecisionReqLength_double(double precision)
//the byte to input is in the big-endian format
inline
float
bytesToFloat
(
unsigned
char
*
bytes
)
INLINE
float
bytesToFloat
(
unsigned
char
*
bytes
)
{
lfloat
buf
;
memcpy
(
buf
.
byte
,
bytes
,
4
);
...
...
@@ -180,7 +179,7 @@ inline float bytesToFloat(unsigned char* bytes)
return
buf
.
value
;
}
inline
void
floatToBytes
(
unsigned
char
*
b
,
float
num
)
INLINE
void
floatToBytes
(
unsigned
char
*
b
,
float
num
)
{
lfloat
buf
;
buf
.
value
=
num
;
...
...
@@ -190,7 +189,7 @@ inline void floatToBytes(unsigned char *b, float num)
}
//the byte to input is in the big-endian format
inline
double
bytesToDouble
(
unsigned
char
*
bytes
)
INLINE
double
bytesToDouble
(
unsigned
char
*
bytes
)
{
ldouble
buf
;
memcpy
(
buf
.
byte
,
bytes
,
8
);
...
...
@@ -199,7 +198,7 @@ inline double bytesToDouble(unsigned char* bytes)
return
buf
.
value
;
}
inline
void
doubleToBytes
(
unsigned
char
*
b
,
double
num
)
INLINE
void
doubleToBytes
(
unsigned
char
*
b
,
double
num
)
{
ldouble
buf
;
buf
.
value
=
num
;
...
...
@@ -209,7 +208,7 @@ inline void doubleToBytes(unsigned char *b, double num)
}
inline
int
getMaskRightCode
(
int
m
)
{
INLINE
int
getMaskRightCode
(
int
m
)
{
switch
(
m
)
{
case
1
:
return
0x01
;
...
...
@@ -232,16 +231,16 @@ inline int getMaskRightCode(int m) {
}
}
inline
int
getLeftMovingCode
(
int
kMod8
)
INLINE
int
getLeftMovingCode
(
int
kMod8
)
{
return
getMaskRightCode
(
8
-
kMod8
);
}
inline
int
getRightMovingSteps
(
int
kMod8
,
int
resiBitLength
)
{
INLINE
int
getRightMovingSteps
(
int
kMod8
,
int
resiBitLength
)
{
return
8
-
kMod8
-
resiBitLength
;
}
inline
int
getRightMovingCode
(
int
kMod8
,
int
resiBitLength
)
INLINE
int
getRightMovingCode
(
int
kMod8
,
int
resiBitLength
)
{
int
rightMovingSteps
=
8
-
kMod8
-
resiBitLength
;
if
(
rightMovingSteps
<
0
)
...
...
@@ -275,7 +274,7 @@ inline int getRightMovingCode(int kMod8, int resiBitLength)
}
}
inline
size_t
bytesToSize
(
unsigned
char
*
bytes
)
INLINE
size_t
bytesToSize
(
unsigned
char
*
bytes
)
{
size_t
result
=
0
;
if
(
exe_params
->
SZ_SIZE_TYPE
==
4
)
...
...
@@ -285,7 +284,7 @@ inline size_t bytesToSize(unsigned char* bytes)
return
result
;
}
inline
void
sizeToBytes
(
unsigned
char
*
outBytes
,
size_t
size
)
INLINE
void
sizeToBytes
(
unsigned
char
*
outBytes
,
size_t
size
)
{
if
(
exe_params
->
SZ_SIZE_TYPE
==
4
)
intToBytes_bigEndian
(
outBytes
,
(
unsigned
int
)
size
);
//4
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录