!17 Fix code static checking warnings

Merge pull request !17 from 胡晓炜/master
This commit is contained in:
openharmony_ci
2021-09-24 09:42:00 +00:00
committed by Gitee
6 changed files with 55 additions and 11 deletions
+44
View File
@@ -60,8 +60,52 @@ Note:If the text contains special characters, please escape them according to th
<filefilter name="binaryFileTypePolicyFilter" desc="二进制文件校验策略的过滤条件" >
</filefilter>
<filefilter name="copyrightPolicyFilter" desc="copyright文件头校验策略的过滤条件" >
<filteritem type="filepath" name="AUTHORS" desc="开发者名单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-arm-dev" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-build" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-ci" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-cross-arm-all" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-cross-windows" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-cross-x86" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-dev" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-fuzzing" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-build" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-ci" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-cross-arm-all" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-cross-windows" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-cross-x86" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-dev" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-fuzzing" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-build" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-cross-arm-all" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-cross-windows" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-cross-x86" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-dev" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-fuzzing" desc="ubuntu构建依赖软件清单"/>
</filefilter>
<filefilter name="defaultPolicyFilter" desc="根目录LICENSE文件校验策略的过滤条件xxx" >
<filteritem type="filepath" name="AUTHORS" desc="开发者名单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-arm-dev" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-build" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-ci" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-cross-arm-all" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-cross-windows" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-cross-x86" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-dev" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-18-04-fuzzing" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-build" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-ci" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-cross-arm-all" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-cross-windows" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-cross-x86" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-dev" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-20-04-fuzzing" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-build" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-cross-arm-all" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-cross-windows" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-cross-x86" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-dev" desc="ubuntu构建依赖软件清单"/>
<filteritem type="filepath" name="scripts/dep-lists/ubuntu-fuzzing" desc="ubuntu构建依赖软件清单"/>
</filefilter>
</filefilterlist>
</oatconfig>
+1 -1
View File
@@ -15,12 +15,12 @@
#include "utils/string_helpers.h"
#include <cerrno>
#include <cstdarg>
#include <sstream>
#include <gtest/gtest.h>
#include <errno.h>
namespace panda::helpers::string::test {
+5 -5
View File
@@ -40,12 +40,12 @@ TEST(PandaCache, TestMethodCache)
EntityId id1(100);
ASSERT_EQ(cache.GetMethodFromCache(id1), nullptr);
Method *method1 = reinterpret_cast<Method *>(GetNewMockPointer());
auto *method1 = reinterpret_cast<Method *>(GetNewMockPointer());
cache.SetMethodCache(id1, method1);
ASSERT_EQ(cache.GetMethodFromCache(id1), method1);
EntityId id2(10000);
Method *method2 = reinterpret_cast<Method *>(GetNewMockPointer());
auto *method2 = reinterpret_cast<Method *>(GetNewMockPointer());
cache.SetMethodCache(id2, method2);
ASSERT_EQ(cache.GetMethodFromCache(id2), method2);
}
@@ -57,13 +57,13 @@ TEST(PandaCache, TestFieldCache)
EntityId new_id1(id1.GetOffset() << 2U);
ASSERT_EQ(cache.GetFieldFromCache(new_id1), nullptr);
Field *field1 = reinterpret_cast<Field *>(GetNewMockPointer());
auto *field1 = reinterpret_cast<Field *>(GetNewMockPointer());
cache.SetFieldCache(new_id1, field1);
ASSERT_EQ(cache.GetFieldFromCache(new_id1), field1);
EntityId id2(10000);
EntityId new_id2(id2.GetOffset() << 2U);
Field *field2 = reinterpret_cast<Field *>(GetNewMockPointer());
auto *field2 = reinterpret_cast<Field *>(GetNewMockPointer());
cache.SetFieldCache(new_id2, field2);
ASSERT_EQ(cache.GetFieldFromCache(new_id2), field2);
}
@@ -90,7 +90,7 @@ struct ElementMock {
static ElementMock *GetNewMockElement(int i)
{
ElementMock *m = new ElementMock();
auto *m = new ElementMock();
m->data = i;
return m;
}
+2 -2
View File
@@ -21,11 +21,11 @@
#include "assembly-emitter.h"
#include "assembly-parser.h"
#include <stdio.h>
#include <cstddef>
#include <cstdio>
#include <cstdint>
#include <vector>
#include <gtest/gtest.h>
#include <stddef.h>
#include <memory>
#include <securec.h>
+1 -1
View File
@@ -50,7 +50,7 @@ protected:
void PrintMemory(void *dst, size_t size)
{
std::cout << "Print at memory: ";
uint8_t *mem = static_cast<uint8_t *>(dst);
auto *mem = static_cast<uint8_t *>(dst);
for (size_t i = 0; i < size; i++) {
std::cout << *mem++;
}
+2 -2
View File
@@ -1261,8 +1261,8 @@ public:
LOG_INST();
DBGBRK();
Sync();
// TODO(vdyadov): take into consideration possible exception generation
// context is of good precision here
// take into consideration possible exception generation
// context is of good precision here
return CheckBinaryOp2<format>(F32, F32, F32);
}