From 236705ed65003b717e8ec0d4cb2d2ea1e51783ff Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Mon, 26 Dec 2022 12:18:33 +0800 Subject: [PATCH] modify codecheeck Signed-off-by: yangwei_814916 --- common/include/dscreen_constants.h | 4 ++-- common/src/dscreen_json_util.cpp | 2 +- common/src/dscreen_log.cpp | 2 +- services/common/utils/src/dscreen_maprelation.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/include/dscreen_constants.h b/common/include/dscreen_constants.h index 7f2100e8..480d5762 100644 --- a/common/include/dscreen_constants.h +++ b/common/include/dscreen_constants.h @@ -84,7 +84,7 @@ constexpr uint32_t DSCREEN_MAX_SCREEN_DATA_HEIGHT = 2772; /* YUV420 buffer size max size */ constexpr int64_t MAX_YUV420_BUFFER_SIZE = 2560 * 1600 * (3 / 2) * 2; -constexpr int32_t LOG_MAX_LEN = 4096; +constexpr int32_t DSCREEN_MAX_LEN = 4096; constexpr int32_t INVALID_WINDOW_ID = -1; @@ -130,7 +130,7 @@ const std::string SINK_PROJ_SHOW_HEIGHT = "sinkProjShowHeight"; const std::string SINK_WIN_SHOW_X = "sinkWinShowX"; const std::string SINK_WIN_SHOW_Y = "sinkWinShowY"; -constexpr uint32_t MAX_MESSAGE_LEN = 40 * 1024 * 1024; +constexpr uint32_t MAX_MESSAGES_LEN = 40 * 1024 * 1024; constexpr float DEFAULT_DENSITY = 2.0; constexpr int32_t DEFAULT_SCREEN_FLAGS = 0; constexpr uint32_t DEFAULT_FPS = 30; diff --git a/common/src/dscreen_json_util.cpp b/common/src/dscreen_json_util.cpp index 408270e9..12bb5a8d 100644 --- a/common/src/dscreen_json_util.cpp +++ b/common/src/dscreen_json_util.cpp @@ -22,7 +22,7 @@ namespace OHOS { namespace DistributedHardware { bool IsString(const nlohmann::json &jsonObj, const std::string &key) { - bool res = jsonObj.contains(key) && jsonObj[key].is_string() && jsonObj[key].size() <= MAX_MESSAGE_LEN; + bool res = jsonObj.contains(key) && jsonObj[key].is_string() && jsonObj[key].size() <= MAX_MESSAGES_LEN; if (!res) { DHLOGE("the key %s in jsonObj is invalid.", key.c_str()); } diff --git a/common/src/dscreen_log.cpp b/common/src/dscreen_log.cpp index ec34b603..edbb85b3 100644 --- a/common/src/dscreen_log.cpp +++ b/common/src/dscreen_log.cpp @@ -70,7 +70,7 @@ static void DHLogOut(DHLogLevel logLevel, const char *logBuf) void DHLog(DHLogLevel logLevel, const char *fmt, ...) { - char logBuf[LOG_MAX_LEN] = {0}; + char logBuf[DSCREEN_MAX_LEN] = {0}; va_list arg; (void)memset_s(&arg, sizeof(va_list), 0, sizeof(va_list)); diff --git a/services/common/utils/src/dscreen_maprelation.cpp b/services/common/utils/src/dscreen_maprelation.cpp index d8f89652..57d3db3e 100644 --- a/services/common/utils/src/dscreen_maprelation.cpp +++ b/services/common/utils/src/dscreen_maprelation.cpp @@ -129,8 +129,8 @@ void from_json(const json &j, ScreenRect &rect) } rect.startX = j[KEY_POINT_START_X].get(); rect.startY = j[KEY_POINT_START_Y].get(); - rect.width = j[KEY_WIDTH].get(); - rect.height = j[KEY_HEIGHT].get(); + rect.width = j[KEY_WIDTH].get(); + rect.height = j[KEY_HEIGHT].get(); } } // namespace DistributedHardware } // namespace OHOS \ No newline at end of file -- Gitee