未验证 提交 a279c004 编写于 作者: O openharmony_ci 提交者: Gitee

!63 fix compiler warning

Merge pull request !63 from hhj/warning
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "dump_syspara.h" #include "dump_syspara.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "securec.h"
#include "parameter.h" #include "parameter.h"
#if defined(__LITEOS_RISCV__) #if defined(__LITEOS_RISCV__)
#include "wifiiot_at.h" #include "wifiiot_at.h"
...@@ -28,7 +29,7 @@ static const char* GetSdkApiLevel() ...@@ -28,7 +29,7 @@ static const char* GetSdkApiLevel()
static char sdkApiVersion[API_VERSION_LEN] = {0}; static char sdkApiVersion[API_VERSION_LEN] = {0};
int sdkApi = GetSdkApiVersion(); int sdkApi = GetSdkApiVersion();
sprintf_s(sdkApiVersion, API_VERSION_LEN, "%d", sdkApi); sprintf_s(sdkApiVersion, API_VERSION_LEN, "%d", sdkApi);
return sdkApiVersion; return (const char*)sdkApiVersion;
} }
static const char* GetFirstApiLevel() static const char* GetFirstApiLevel()
...@@ -36,7 +37,7 @@ static const char* GetFirstApiLevel() ...@@ -36,7 +37,7 @@ static const char* GetFirstApiLevel()
static char firstApiVersion[API_VERSION_LEN] = {0}; static char firstApiVersion[API_VERSION_LEN] = {0};
int firstApi = GetFirstApiVersion(); int firstApi = GetFirstApiVersion();
sprintf_s(firstApiVersion, API_VERSION_LEN, "%d", firstApi); sprintf_s(firstApiVersion, API_VERSION_LEN, "%d", firstApi);
return firstApiVersion; return (const char*)firstApiVersion;
} }
static const SysParaInfoItem SYSPARA_LIST[] = { static const SysParaInfoItem SYSPARA_LIST[] = {
...@@ -69,7 +70,7 @@ int QuerySysparaCmd() ...@@ -69,7 +70,7 @@ int QuerySysparaCmd()
{ {
int index = 0; int index = 0;
int dumpInfoItemNum = (sizeof(SYSPARA_LIST) / sizeof(SysParaInfoItem)); int dumpInfoItemNum = (sizeof(SYSPARA_LIST) / sizeof(SysParaInfoItem));
char *temp = NULL; const char *temp = NULL;
int (*pfnPrintf)(const char *format, ...) = NULL; int (*pfnPrintf)(const char *format, ...) = NULL;
#if defined(__LITEOS_RISCV__) #if defined(__LITEOS_RISCV__)
pfnPrintf = &AtPrintf; pfnPrintf = &AtPrintf;
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
typedef struct { typedef struct {
char *infoName; char *infoName;
char *(*getInfoValue)(); const char *(*getInfoValue)(void);
} SysParaInfoItem; } SysParaInfoItem;
int QuerySysparaCmd(); int QuerySysparaCmd();
#endif #endif
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册