提交 80a2ad37 编写于 作者: C chengjinsong2

修改编译告警

Signed-off-by: Nchengjinsong2 <chengjinsong2@huawei.com>
上级 ee1420e4
......@@ -16,7 +16,6 @@
#include <errno.h>
#include "le_epoll.h"
#include "le_utils.h"
static int IsValid_(const EventEpoll *loop)
{
......@@ -139,4 +138,4 @@ LE_STATUS CreateEpollLoop(EventLoop **loop, uint32_t maxevents, uint32_t timeout
epoll->loop.addEvent = AddEvent_;
epoll->loop.modEvent = ModEvent_;
return LE_SUCCESS;
}
\ No newline at end of file
}
......@@ -72,7 +72,6 @@ ENG_STATIC void BuildMountCmd(char *buffer, size_t len, const char *mp, const ch
{
int ret = snprintf_s(buffer, len, len - 1, "%s %s %s ro barrier=1",
fstype, dev, mp);
if (ret == -1) {
*buffer = '\0';
}
......
......@@ -206,6 +206,7 @@ int IterateNameValuePairs(const char *src, void (*iterator)(const NAME_VALUE_PAI
{
int cnt = 0;
const char *seperator;
const char *tmp = src;
NAME_VALUE_PAIR nv;
if ((src == NULL) || (iterator == NULL)) {
return -1;
......@@ -213,15 +214,15 @@ int IterateNameValuePairs(const char *src, void (*iterator)(const NAME_VALUE_PAI
do {
// Find space seperator
nv.name = src;
seperator = strchr(src, ' ');
nv.name = tmp;
seperator = strchr(tmp, ' ');
if (seperator == NULL) {
// Last nv
nv.valueEnd = src + strlen(src);
src = NULL;
nv.valueEnd = tmp + strlen(tmp);
tmp = NULL;
} else {
nv.valueEnd = seperator;
src = seperator + 1;
tmp = seperator + 1;
}
// Find equal seperator
......@@ -239,7 +240,7 @@ int IterateNameValuePairs(const char *src, void (*iterator)(const NAME_VALUE_PAI
iterator(&nv, context);
cnt += 1;
} while (src != NULL);
} while (tmp != NULL);
return cnt;
}
......
......@@ -13,8 +13,6 @@
* limitations under the License.
*/
#include "DoFormat_fuzzer.h"
#include <iostream>
#include <string>
#include "fs_manager/fs_manager.h"
......
......@@ -14,7 +14,6 @@
*/
#include "GetMountStatusForMountPoint_fuzzer.h"
#include <iostream>
#include <string>
#include "fs_manager/fs_manager.h"
......
......@@ -14,7 +14,6 @@
*/
#include "IsSupportedFilesystem_fuzzer.h"
#include <iostream>
#include <string>
#include "fs_manager/fs_manager.h"
......
......@@ -14,7 +14,6 @@
*/
#include "LoadFscryptPolicy_fuzzer.h"
#include <iostream>
#include "fs_manager/fs_manager.h"
namespace OHOS {
......
......@@ -36,7 +36,7 @@ using namespace testing::ext;
using namespace std;
using namespace OHOS;
int g_tokenType = OHOS::Security::AccessToken::TOKEN_HAP;
static int g_tokenType = OHOS::Security::AccessToken::TOKEN_HAP;
int g_tokenVerifyResult = 0;
namespace OHOS {
namespace Security {
......
......@@ -16,6 +16,7 @@
#include <gtest/gtest.h>
#include <thread>
#include <sys/eventfd.h>
#include <cstdarg>
#include "begetctl.h"
#include "cJSON.h"
......@@ -62,7 +63,8 @@ static void DecodeMessage(const char *buffer, size_t nread, uint32_t &cmd)
return;
}
static void SendMessage(const LoopHandle loopHandle, const TaskHandle taskHandle, const char *message, ...)
template<typename... Args>
static void SendMessage(const LoopHandle loopHandle, const TaskHandle taskHandle, const char *message, Args... args)
{
uint32_t bufferSize = 1024; // 1024 buffer size
BufferHandle handle = LE_CreateBuffer(loopHandle, bufferSize);
......@@ -96,21 +98,21 @@ static void TestOnReceiveRequest(const TaskHandle task, const uint8_t *buffer, u
if (buffer == nullptr) {
return;
}
printf("Server receive message %s \n", reinterpret_cast<const char *>(buffer));
printf("Server receive message %s \n", static_cast<const char *>(buffer));
uint32_t cmd = 0;
DecodeMessage(reinterpret_cast<const char *>(buffer), nread, cmd);
SendMessage(g_loopServer_, task, reinterpret_cast<const char *>(buffer));
DecodeMessage(static_cast<const char *>(buffer), nread, cmd);
SendMessage(g_loopServer_, task, static_cast<const char *>(buffer));
}
static void TestClientOnReceiveRequest(const TaskHandle task, const uint8_t *buffer, uint32_t nread)
{
printf("Client receive message %s \n", reinterpret_cast<const char *>(buffer));
printf("Client receive message %s \n", static_cast<const char *>(buffer));
EXPECT_NE(buffer, nullptr);
if (buffer == nullptr) {
return;
}
uint32_t cmd = 0;
DecodeMessage(reinterpret_cast<const char *>(buffer), nread, cmd);
DecodeMessage(static_cast<const char *>(buffer), nread, cmd);
if (cmd == 5 || cmd == 2) { // 2 5 close server
LE_StopLoop(g_loopClient_);
}
......@@ -130,7 +132,7 @@ static void TestSendMessageComplete(const TaskHandle taskHandle, BufferHandle ha
uint32_t bufferSize = 1024; // 1024 buffer size
char *buffer = (char *)LE_GetBufferInfo(handle, nullptr, &bufferSize);
uint32_t cmd = 0;
DecodeMessage(reinterpret_cast<const char *>(buffer), bufferSize, cmd);
DecodeMessage(static_cast<const char *>(buffer), bufferSize, cmd);
if (cmd == 5) { // 5 close server
LE_StopLoop(g_loopServer_);
}
......
......@@ -213,6 +213,5 @@ HWTEST_F(ParamShellUnitTest, TestParamShellcmd2, TestSize.Level1)
BShellEnvLoop(nullptr);
BShellEnvErrString(GetShellHandle(), 1);
BShellEnvOutputResult(GetShellHandle(), 1);
}
} // namespace init_ut
......@@ -76,4 +76,4 @@ ParamLabelIndex *TestGetParamLabelIndex(const char *name);
}
#endif
#endif
#endif // PARAM_TEST_STUB_
\ No newline at end of file
#endif // PARAM_TEST_STUB_
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册