Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
058c8912
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看板
提交
058c8912
编写于
4月 27, 2020
作者:
weixin_48148422
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix compile errors
上级
c24f7ea7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
35 addition
and
33 deletion
+35
-33
src/util/inc/exception.h
src/util/inc/exception.h
+2
-1
src/util/src/exception.c
src/util/src/exception.c
+33
-32
未找到文件。
src/util/inc/exception.h
浏览文件 @
058c8912
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#include <setjmp.h>
#include <setjmp.h>
#include <stdint.h>
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#include <assert.h>
#ifdef __cplusplus
#ifdef __cplusplus
...
@@ -58,7 +59,7 @@ void cleanupPush_int_int ( bool failOnly, void* func, int arg );
...
@@ -58,7 +59,7 @@ void cleanupPush_int_int ( bool failOnly, void* func, int arg );
void
cleanupPush_void
(
bool
failOnly
,
void
*
func
);
void
cleanupPush_void
(
bool
failOnly
,
void
*
func
);
int32_t
cleanupGetActionCount
();
int32_t
cleanupGetActionCount
();
void
cleanupExecute
(
bool
failed
,
int32_t
toIndex
);
void
cleanupExecute
(
int32_t
anchor
,
bool
failed
);
#define CLEANUP_PUSH_VOID_PTR_PTR( failOnly, func, arg1, arg2 ) cleanupPush_void_ptr_ptr( (failOnly), (void*)(func), (void*)(arg1), (void*)(arg2) )
#define CLEANUP_PUSH_VOID_PTR_PTR( failOnly, func, arg1, arg2 ) cleanupPush_void_ptr_ptr( (failOnly), (void*)(func), (void*)(arg1), (void*)(arg2) )
#define CLEANUP_PUSH_VOID_PTR_BOOL( failOnly, func, arg1, arg2 ) cleanupPush_void_ptr_bool( (failOnly), (void*)(func), (void*)(arg1), (bool)(arg2) )
#define CLEANUP_PUSH_VOID_PTR_BOOL( failOnly, func, arg1, arg2 ) cleanupPush_void_ptr_bool( (failOnly), (void*)(func), (void*)(arg1), (bool)(arg2) )
...
...
src/util/src/exception.c
浏览文件 @
058c8912
...
@@ -22,7 +22,7 @@ void exceptionThrow( int code ) {
...
@@ -22,7 +22,7 @@ void exceptionThrow( int code ) {
static
void
cleanupWrapper_void_ptr_ptr
(
SCleanupAction
*
ca
)
{
static
void
cleanupWrapper_void_ptr_ptr
(
SCleanupAction
*
ca
)
{
void
(
*
func
)(
void
*
,
void
*
)
=
ac
->
func
;
void
(
*
func
)(
void
*
,
void
*
)
=
ca
->
func
;
func
(
ca
->
arg1
.
Ptr
,
ca
->
arg2
.
Ptr
);
func
(
ca
->
arg1
.
Ptr
,
ca
->
arg2
.
Ptr
);
}
}
...
@@ -46,7 +46,8 @@ static void cleanupWrapper_void_void( SCleanupAction* ca ) {
...
@@ -46,7 +46,8 @@ static void cleanupWrapper_void_void( SCleanupAction* ca ) {
func
();
func
();
}
}
static
void
(
*
wrappers
)(
SCleanupAction
*
)[]
=
{
typedef
void
(
*
wrapper
)(
SCleanupAction
*
);
static
wrapper
wrappers
[]
=
{
cleanupWrapper_void_ptr_ptr
,
cleanupWrapper_void_ptr_ptr
,
cleanupWrapper_void_ptr_bool
,
cleanupWrapper_void_ptr_bool
,
cleanupWrapper_void_ptr
,
cleanupWrapper_void_ptr
,
...
@@ -58,57 +59,57 @@ static void (*wrappers)(SCleanupAction*)[] = {
...
@@ -58,57 +59,57 @@ static void (*wrappers)(SCleanupAction*)[] = {
void
cleanupPush_void_ptr_ptr
(
bool
failOnly
,
void
*
func
,
void
*
arg1
,
void
*
arg2
)
{
void
cleanupPush_void_ptr_ptr
(
bool
failOnly
,
void
*
func
,
void
*
arg1
,
void
*
arg2
)
{
assert
(
expList
->
numCleanupAction
<
expList
->
maxCleanupAction
);
assert
(
expList
->
numCleanupAction
<
expList
->
maxCleanupAction
);
SCleanupAction
*
ac
=
expList
->
cleanupActions
+
expList
->
numCleanupAction
++
;
SCleanupAction
*
ca
=
expList
->
cleanupActions
+
expList
->
numCleanupAction
++
;
ac
->
wrapper
=
0
;
ca
->
wrapper
=
0
;
ac
->
failOnly
=
failOnly
;
ca
->
failOnly
=
failOnly
;
ac
->
func
=
func
;
ca
->
func
=
func
;
ac
->
arg1
.
Ptr
=
arg1
;
ca
->
arg1
.
Ptr
=
arg1
;
ac
->
arg2
.
Ptr
=
arg2
;
ca
->
arg2
.
Ptr
=
arg2
;
}
}
void
cleanupPush_void_ptr_bool
(
bool
failOnly
,
void
*
func
,
void
*
arg1
,
bool
arg2
)
{
void
cleanupPush_void_ptr_bool
(
bool
failOnly
,
void
*
func
,
void
*
arg1
,
bool
arg2
)
{
assert
(
expList
->
numCleanupAction
<
expList
->
maxCleanupAction
);
assert
(
expList
->
numCleanupAction
<
expList
->
maxCleanupAction
);
SCleanupAction
*
ac
=
expList
->
cleanupActions
+
expList
->
numCleanupAction
++
;
SCleanupAction
*
ca
=
expList
->
cleanupActions
+
expList
->
numCleanupAction
++
;
ac
->
wrapper
=
1
;
ca
->
wrapper
=
1
;
ac
->
failOnly
=
failOnly
;
ca
->
failOnly
=
failOnly
;
ac
->
func
=
func
;
ca
->
func
=
func
;
ac
->
arg1
.
Ptr
=
arg1
;
ca
->
arg1
.
Ptr
=
arg1
;
ac
->
arg2
.
Bool
=
arg2
;
ca
->
arg2
.
Bool
=
arg2
;
}
}
void
cleanupPush_void_ptr
(
bool
failOnly
,
void
*
func
,
void
*
arg
)
{
void
cleanupPush_void_ptr
(
bool
failOnly
,
void
*
func
,
void
*
arg
)
{
assert
(
expList
->
numCleanupAction
<
expList
->
maxCleanupAction
);
assert
(
expList
->
numCleanupAction
<
expList
->
maxCleanupAction
);
SCleanupAction
*
ac
=
expList
->
cleanupActions
+
expList
->
numCleanupAction
++
;
SCleanupAction
*
ca
=
expList
->
cleanupActions
+
expList
->
numCleanupAction
++
;
ac
->
wrapper
=
2
;
ca
->
wrapper
=
2
;
ac
->
failOnly
=
failOnly
;
ca
->
failOnly
=
failOnly
;
ac
->
func
=
func
;
ca
->
func
=
func
;
ac
->
arg1
.
Ptr
=
arg1
;
ca
->
arg1
.
Ptr
=
arg
;
}
}
void
cleanupPush_int_int
(
bool
failOnly
,
void
*
func
,
int
arg
)
{
void
cleanupPush_int_int
(
bool
failOnly
,
void
*
func
,
int
arg
)
{
assert
(
expList
->
numCleanupAction
<
expList
->
maxCleanupAction
);
assert
(
expList
->
numCleanupAction
<
expList
->
maxCleanupAction
);
SCleanupAction
*
ac
=
expList
->
cleanupActions
+
expList
->
numCleanupAction
++
;
SCleanupAction
*
ca
=
expList
->
cleanupActions
+
expList
->
numCleanupAction
++
;
ac
->
wrapper
=
3
;
ca
->
wrapper
=
3
;
ac
->
failOnly
=
failOnly
;
ca
->
failOnly
=
failOnly
;
ac
->
func
=
func
;
ca
->
func
=
func
;
ac
->
arg1
.
Int
=
arg
;
ca
->
arg1
.
Int
=
arg
;
}
}
void
cleanupPush_void
(
bool
failOnly
,
void
*
func
)
{
void
cleanupPush_void
(
bool
failOnly
,
void
*
func
)
{
assert
(
expList
->
numCleanupAction
<
expList
->
maxCleanupAction
);
assert
(
expList
->
numCleanupAction
<
expList
->
maxCleanupAction
);
SCleanupAction
*
ac
=
expList
->
cleanupActions
+
expList
->
numCleanupAction
++
;
SCleanupAction
*
ca
=
expList
->
cleanupActions
+
expList
->
numCleanupAction
++
;
ac
->
wrapper
=
4
;
ca
->
wrapper
=
4
;
ac
->
failOnly
=
failOnly
;
ca
->
failOnly
=
failOnly
;
ac
->
func
=
func
;
ca
->
func
=
func
;
}
}
int32
cleanupGetActionCount
()
{
int32
_t
cleanupGetActionCount
()
{
return
expList
->
numCleanupAction
;
return
expList
->
numCleanupAction
;
}
}
...
@@ -116,8 +117,8 @@ int32 cleanupGetActionCount() {
...
@@ -116,8 +117,8 @@ int32 cleanupGetActionCount() {
void
cleanupExecute
(
int32_t
anchor
,
bool
failed
)
{
void
cleanupExecute
(
int32_t
anchor
,
bool
failed
)
{
while
(
expList
->
numCleanupAction
>
anchor
)
{
while
(
expList
->
numCleanupAction
>
anchor
)
{
--
expList
->
numCleanupAction
;
--
expList
->
numCleanupAction
;
SCleanupAction
*
ac
=
expList
->
cleanupActions
+
expList
->
numCleanupAction
;
SCleanupAction
*
ca
=
expList
->
cleanupActions
+
expList
->
numCleanupAction
;
if
(
failed
||
!
(
ac
->
failOnly
)
)
if
(
failed
||
!
(
ca
->
failOnly
)
)
ac
->
wrapper
(
ac
);
wrappers
[
ca
->
wrapper
](
ca
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录