From 4f2dea7fc6090533aba40acd9473bea0a2e55df1 Mon Sep 17 00:00:00 2001 From: fangyunzhong Date: Tue, 31 Jan 2023 03:21:32 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fangyunzhong --- frameworks/resmgr_lite/src/res_desc.cpp | 6 ++++-- frameworks/resmgr_lite/src/utils/hap_parser.cpp | 3 ++- frameworks/resmgr_lite/src/utils/utils.cpp | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frameworks/resmgr_lite/src/res_desc.cpp b/frameworks/resmgr_lite/src/res_desc.cpp index 81c7b1b..e1b416a 100644 --- a/frameworks/resmgr_lite/src/res_desc.cpp +++ b/frameworks/resmgr_lite/src/res_desc.cpp @@ -82,7 +82,8 @@ std::string KeyParam::GetDeviceTypeStr() const const std::string KeyParam::ConvertToStr() const { if ((type_ == KeyType::LANGUAGES) || (type_ == KeyType::REGION) || (type_ == KeyType::SCRIPT)) { - char tmp[4], tmp2[5]; + char tmp[4]; + char tmp2[5]; errno_t eret = memcpy_s(tmp, sizeof(tmp), &value_, 4); if (eret != EOK) { HILOG_ERROR("memcpy_s error : %d", eret); @@ -161,7 +162,8 @@ bool IdItem::IsRef(const std::string &value, ResType &resType, int &id) if (index == std::string::npos || index < 2) { return false; } - std::string typeStr, idStr; + std::string typeStr; + std::string idStr; typeStr.assign(it + 1, index - 1); idStr.assign(it + index + 1, value.size() - index); diff --git a/frameworks/resmgr_lite/src/utils/hap_parser.cpp b/frameworks/resmgr_lite/src/utils/hap_parser.cpp index 61fa19d..bb47574 100644 --- a/frameworks/resmgr_lite/src/utils/hap_parser.cpp +++ b/frameworks/resmgr_lite/src/utils/hap_parser.cpp @@ -534,7 +534,8 @@ std::string HapParser::ToFolderPath(const std::vector &keyParams) if (language.size() > 0) { path.append(language); } - std::string c1("_"), c2("-"); + std::string c1("_"); + std::string c2("-"); PathAppend(path, script, c1); PathAppend(path, region, c1); PathAppend(path, direction, c2); diff --git a/frameworks/resmgr_lite/src/utils/utils.cpp b/frameworks/resmgr_lite/src/utils/utils.cpp index 702de79..c83869a 100644 --- a/frameworks/resmgr_lite/src/utils/utils.cpp +++ b/frameworks/resmgr_lite/src/utils/utils.cpp @@ -213,7 +213,8 @@ bool Utils::StrCompare(const char *left, const char *right, size_t len, bool isC return false; } int rc; - unsigned char c1, c2; + unsigned char c1; + unsigned char c2; while (len--) { c1 = (unsigned char)*left; c2 = (unsigned char)*right; -- Gitee