Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
39c800da
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
39c800da
编写于
10月 22, 2022
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(all): fixed coverity scan problems for second submiting
上级
840dcdce
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
31 addition
and
19 deletion
+31
-19
source/os/src/osFile.c
source/os/src/osFile.c
+1
-1
source/util/src/tcompression.c
source/util/src/tcompression.c
+3
-0
source/util/src/tdigest.c
source/util/src/tdigest.c
+1
-1
source/util/src/tencode.c
source/util/src/tencode.c
+3
-1
source/util/src/tenv.c
source/util/src/tenv.c
+1
-1
source/util/src/thash.c
source/util/src/thash.c
+1
-1
source/util/src/tlog.c
source/util/src/tlog.c
+4
-1
source/util/src/tlrucache.c
source/util/src/tlrucache.c
+2
-0
source/util/src/tpagedbuf.c
source/util/src/tpagedbuf.c
+3
-1
tools/shell/src/shellAuto.c
tools/shell/src/shellAuto.c
+5
-2
tools/shell/src/shellTire.c
tools/shell/src/shellTire.c
+7
-10
未找到文件。
source/os/src/osFile.c
浏览文件 @
39c800da
...
...
@@ -191,7 +191,7 @@ int32_t taosRenameFile(const char *oldName, const char *newName) {
printf
(
"failed to rename file %s to %s, reason:%s
\n
"
,
oldName
,
newName
,
strerror
(
errno
));
}
return
!
code
;
return
code
?
0
:
1
;
#else
int32_t
code
=
rename
(
oldName
,
newName
);
if
(
code
<
0
)
{
...
...
source/util/src/tcompression.c
浏览文件 @
39c800da
...
...
@@ -2274,6 +2274,9 @@ int32_t tsCompressBool(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int32_t
return
tsCompressBoolImp
(
pIn
,
nEle
,
pOut
);
}
else
if
(
cmprAlg
==
TWO_STAGE_COMP
)
{
int32_t
len
=
tsCompressBoolImp
(
pIn
,
nEle
,
pBuf
);
if
(
len
<
0
)
{
return
-
1
;
}
return
tsCompressStringImp
(
pBuf
,
len
,
pOut
,
nOut
);
}
else
{
assert
(
0
);
...
...
source/util/src/tdigest.c
浏览文件 @
39c800da
...
...
@@ -263,7 +263,7 @@ double tdigestQuantile(TDigest *t, double q) {
b
=
c
;
right
=
(
b
->
weight
*
a
->
mean
+
a
->
weight
*
b
->
mean
)
/
(
a
->
weight
+
b
->
weight
);
if
(
idx
<
weight_so_far
+
a
->
weight
)
{
double
p
=
(
idx
-
weight_so_far
)
/
a
->
weight
;
double
p
=
(
idx
-
weight_so_far
)
/
(
a
->
weight
==
0
)
?
1
:
a
->
weight
;
return
left
*
(
1
-
p
)
+
right
*
p
;
}
weight_so_far
+=
a
->
weight
;
...
...
source/util/src/tencode.c
浏览文件 @
39c800da
...
...
@@ -109,7 +109,9 @@ void tEndEncode(SEncoder* pCoder) {
pCoder
->
size
=
pNode
->
size
;
pCoder
->
pos
=
pNode
->
pos
;
tEncodeI32
(
pCoder
,
len
);
if
(
tEncodeI32
(
pCoder
,
len
)
<
0
)
{
return
;
}
TD_CODER_MOVE_POS
(
pCoder
,
len
);
}
...
...
source/util/src/tenv.c
浏览文件 @
39c800da
...
...
@@ -54,7 +54,7 @@ int32_t taosEnvNameToCfgName(const char *envNameStr, char *cfgNameStr, int32_t c
}
int32_t
taosEnvToCfg
(
const
char
*
envStr
,
char
*
cfgStr
)
{
if
(
envStr
==
NULL
&&
cfgStr
==
NULL
)
{
if
(
envStr
==
NULL
||
cfgStr
==
NULL
)
{
return
-
1
;
}
if
(
cfgStr
!=
envStr
)
strcpy
(
cfgStr
,
envStr
);
...
...
source/util/src/thash.c
浏览文件 @
39c800da
...
...
@@ -639,7 +639,7 @@ void taosHashTableResize(SHashObj *pHashObj) {
}
int64_t
st
=
taosGetTimestampUs
();
void
*
pNewEntryList
=
taosMemoryRealloc
(
pHashObj
->
hashList
,
sizeof
(
void
*
)
*
newCapacity
);
SHashEntry
**
pNewEntryList
=
taosMemoryRealloc
(
pHashObj
->
hashList
,
sizeof
(
SHashEntry
*
)
*
newCapacity
);
if
(
pNewEntryList
==
NULL
)
{
// uDebug("cache resize failed due to out of memory, capacity remain:%zu", pHashObj->capacity);
return
;
...
...
source/util/src/tlog.c
浏览文件 @
39c800da
...
...
@@ -207,7 +207,10 @@ static void taosKeepOldLog(char *oldName) {
char
fileName
[
LOG_FILE_NAME_LEN
+
20
];
snprintf
(
fileName
,
LOG_FILE_NAME_LEN
+
20
,
"%s.%"
PRId64
,
tsLogObj
.
logName
,
fileSec
);
taosRenameFile
(
oldName
,
fileName
);
if
(
taosRenameFile
(
oldName
,
fileName
)
!=
0
)
{
return
;
}
if
(
tsLogKeepDays
<
0
)
{
char
compressFileName
[
LOG_FILE_NAME_LEN
+
20
];
snprintf
(
compressFileName
,
LOG_FILE_NAME_LEN
+
20
,
"%s.%"
PRId64
".gz"
,
tsLogObj
.
logName
,
fileSec
);
...
...
source/util/src/tlrucache.c
浏览文件 @
39c800da
...
...
@@ -337,6 +337,7 @@ static int taosLRUCacheShardInit(SLRUCacheShard *shard, size_t capacity, bool st
taosThreadMutexInit
(
&
shard
->
mutex
,
NULL
);
taosThreadMutexLock
(
&
shard
->
mutex
);
shard
->
capacity
=
0
;
shard
->
highPriPoolUsage
=
0
;
shard
->
strictCapacity
=
strict
;
...
...
@@ -349,6 +350,7 @@ static int taosLRUCacheShardInit(SLRUCacheShard *shard, size_t capacity, bool st
shard
->
lru
.
next
=
&
shard
->
lru
;
shard
->
lru
.
prev
=
&
shard
->
lru
;
shard
->
lruLowPri
=
&
shard
->
lru
;
taosThreadMutexUnlock
(
&
shard
->
mutex
);
taosLRUCacheShardSetCapacity
(
shard
,
capacity
);
...
...
source/util/src/tpagedbuf.c
浏览文件 @
39c800da
...
...
@@ -534,7 +534,9 @@ void destroyDiskbasedBuf(SDiskbasedBuf* pBuf) {
}
}
taosRemoveFile
(
pBuf
->
path
);
if
(
taosRemoveFile
(
pBuf
->
path
)
<
0
)
{
uDebug
(
"WARNING tPage remove file failed. path=%s"
,
pBuf
->
path
);
}
taosMemoryFreeClear
(
pBuf
->
path
);
size_t
n
=
taosArrayGetSize
(
pBuf
->
pIdList
);
...
...
tools/shell/src/shellAuto.c
浏览文件 @
39c800da
...
...
@@ -564,6 +564,7 @@ void parseCommand(SWords* command, bool pattern) {
// free SShellCmd
void
freeCommand
(
SWords
*
command
)
{
SWord
*
item
=
command
->
head
;
command
->
head
=
NULL
;
// loop
while
(
item
)
{
SWord
*
tmp
=
item
;
...
...
@@ -815,7 +816,9 @@ char* matchNextPrefix(STire* tire, char* pre) {
match
=
enumAll
(
tire
);
}
else
{
// NOT EMPTY
match
=
matchPrefix
(
tire
,
pre
,
NULL
);
match
=
(
SMatch
*
)
taosMemoryMalloc
(
sizeof
(
SMatch
));
memset
(
match
,
0
,
sizeof
(
SMatch
));
matchPrefix
(
tire
,
pre
,
match
);
}
// save to lastMatch
...
...
@@ -828,7 +831,7 @@ char* matchNextPrefix(STire* tire, char* pre) {
// check valid
if
(
match
==
NULL
||
match
->
head
==
NULL
)
{
// no one matched
return
false
;
return
NULL
;
}
if
(
cursorVar
==
-
1
)
{
...
...
tools/shell/src/shellTire.c
浏览文件 @
39c800da
...
...
@@ -308,25 +308,21 @@ void matchPrefixFromTree(STire* tire, char* prefix, SMatch* match) {
}
}
SMatch
*
matchPrefix
(
STire
*
tire
,
char
*
prefix
,
SMatch
*
match
)
{
SMatch
*
rMatch
=
match
;
// define return match
if
(
rMatch
==
NULL
)
{
rMatch
=
(
SMatch
*
)
taosMemoryMalloc
(
sizeof
(
SMatch
));
memset
(
rMatch
,
0
,
sizeof
(
SMatch
));
void
matchPrefix
(
STire
*
tire
,
char
*
prefix
,
SMatch
*
match
)
{
if
(
match
==
NULL
)
{
return
;
}
switch
(
tire
->
type
)
{
case
TIRE_TREE
:
matchPrefixFromTree
(
tire
,
prefix
,
rM
atch
);
matchPrefixFromTree
(
tire
,
prefix
,
m
atch
);
break
;
case
TIRE_LIST
:
matchPrefixFromList
(
tire
,
prefix
,
rM
atch
);
matchPrefixFromList
(
tire
,
prefix
,
m
atch
);
break
;
default:
break
;
}
return
rMatch
;
}
// get all items from tires tree
...
...
@@ -362,8 +358,9 @@ void enumFromTree(STire* tire, SMatch* match) {
// this branch have data
if
(
c
->
end
)
addWordToMatch
(
match
,
pre
);
else
else
{
matchPrefix
(
tire
,
pre
,
match
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录