From 5229ad37ef98734dd0505250f8c368a400f302b1 Mon Sep 17 00:00:00 2001 From: hhj Date: Tue, 4 Jan 2022 21:50:23 +0800 Subject: [PATCH] fix compile warning Signed-off-by: hhj --- os_dump/dump_syspara.c | 7 ++++--- os_dump/dump_syspara.h | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/os_dump/dump_syspara.c b/os_dump/dump_syspara.c index 488e696..aa04d26 100644 --- a/os_dump/dump_syspara.c +++ b/os_dump/dump_syspara.c @@ -16,6 +16,7 @@ #include "dump_syspara.h" #include #include +#include "securec.h" #include "parameter.h" #if defined(__LITEOS_RISCV__) #include "wifiiot_at.h" @@ -28,7 +29,7 @@ static const char* GetSdkApiLevel() static char sdkApiVersion[API_VERSION_LEN] = {0}; int sdkApi = GetSdkApiVersion(); sprintf_s(sdkApiVersion, API_VERSION_LEN, "%d", sdkApi); - return sdkApiVersion; + return (const char*)sdkApiVersion; } static const char* GetFirstApiLevel() @@ -36,7 +37,7 @@ static const char* GetFirstApiLevel() static char firstApiVersion[API_VERSION_LEN] = {0}; int firstApi = GetFirstApiVersion(); sprintf_s(firstApiVersion, API_VERSION_LEN, "%d", firstApi); - return firstApiVersion; + return (const char*)firstApiVersion; } static const SysParaInfoItem SYSPARA_LIST[] = { @@ -69,7 +70,7 @@ int QuerySysparaCmd() { int index = 0; int dumpInfoItemNum = (sizeof(SYSPARA_LIST) / sizeof(SysParaInfoItem)); - char *temp = NULL; + const char *temp = NULL; int (*pfnPrintf)(const char *format, ...) = NULL; #if defined(__LITEOS_RISCV__) pfnPrintf = &AtPrintf; diff --git a/os_dump/dump_syspara.h b/os_dump/dump_syspara.h index 571f483..0eba991 100644 --- a/os_dump/dump_syspara.h +++ b/os_dump/dump_syspara.h @@ -18,9 +18,9 @@ typedef struct { char *infoName; - char *(*getInfoValue)(); + const char *(*getInfoValue)(void); } SysParaInfoItem; int QuerySysparaCmd(); -#endif \ No newline at end of file +#endif -- GitLab