fix: 修复shell 模块存在大量的编译告警及codeCheck。

【背景】
代码中存在规范问题和编译告警。
如:error: unused variable 'taskID2' [-Werror=unused-variable]
应该去掉不用的变量。

【修改方案】
1. 修改变量类型宏的使用。
2. 根据告警信息修复问题代码。

【影响】
 对现有的产品编译不会有影响。

re #I48V2J

Change-Id: I7f364fcf974d2a439639f35ba428e04f7de7338a
Signed-off-by: pef <cyd1997@126.com>
This commit is contained in:
pef
2021-10-18 03:51:07 +00:00
parent badf1e9557
commit e0d8b5328f
9 changed files with 179 additions and 174 deletions

View File

@@ -330,14 +330,14 @@ ShellCB *OsGetShellCb(VOID)
return g_shellCB;
}
char *OsShellGetWorkingDirtectory(VOID)
CHAR *OsShellGetWorkingDirtectory(VOID)
{
return OsGetShellCb()->shellWorkingDirectory;
}
VOID OsShellCBInit(VOID)
{
int ret;
INT32 ret;
ShellCB *shellCB = NULL;
shellCB = (ShellCB *)malloc(sizeof(ShellCB));
@@ -349,17 +349,17 @@ VOID OsShellCBInit(VOID)
goto ERR_OUT1;
}
ret = (int)OsShellKeyInit(shellCB);
ret = (INT32)OsShellKeyInit(shellCB);
if (ret != SH_OK) {
goto ERR_OUT1;
}
(void)strncpy_s(shellCB->shellWorkingDirectory, PATH_MAX, "/", 2); /* 2:space for "/" */
(VOID)strncpy_s(shellCB->shellWorkingDirectory, PATH_MAX, "/", 2); /* 2:space for "/" */
g_shellCB = shellCB;
return;
ERR_OUT1:
(void)free(shellCB);
(VOID)free(shellCB);
return;
}

View File

@@ -163,7 +163,7 @@ END:
return ret;
}
static VOID ParseAndExecCmdline(CmdParsed *cmdParsed, const CHAR *cmdline, UINT32 len)
STATIC VOID ParseAndExecCmdline(CmdParsed *cmdParsed, const CHAR *cmdline, UINT32 len)
{
INT32 i;
UINT32 ret;
@@ -259,7 +259,7 @@ VOID ShellTaskEntry(VOID)
LITE_OS_SEC_TEXT_MINOR UINT32 LosShellInit(VOID)
{
UINT32 ret;
UINT32 taskID1, taskID2;
UINT32 taskID1;
TSK_INIT_PARAM_S task1 = { 0 };
ret = LOS_EventInit(&g_shellInputEvent);