From 5876693be9fbc36ec5e317272b01edccc094503d Mon Sep 17 00:00:00 2001 From: buzhenwang Date: Mon, 31 Oct 2022 15:09:39 +0800 Subject: [PATCH] fixed 8f3a8af from https://gitee.com/buzhenwang/hiviewdfx_hilog/pulls/338 fix codeCheck Signed-off-by: buzhenwang --- frameworks/libhilog/param/properties.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frameworks/libhilog/param/properties.cpp b/frameworks/libhilog/param/properties.cpp index faf6ce4..5272f96 100644 --- a/frameworks/libhilog/param/properties.cpp +++ b/frameworks/libhilog/param/properties.cpp @@ -65,7 +65,8 @@ enum class PropType { using ReadLock = shared_lock; using InsertLock = unique_lock; -static const int HILOG_PROP_VALUE_MAX = 92; +static constexpr int HILOG_PROP_VALUE_MAX = 92; +static constexpr int DEFAULT_QUOTA = 10240; static int LockByProp(PropType propType); static void UnlockByProp(PropType propType); @@ -455,26 +456,24 @@ bool IsTagStatsEnable() int GetProcessQuota(const string& proc) { - static constexpr int default_quota = 10240; char value[HILOG_PROP_VALUE_MAX] = {0}; string prop = GetPropertyName(PropType::PROP_PROC_QUOTA) + proc; int ret = PropertyGet(prop, value, HILOG_PROP_VALUE_MAX); if (ret == RET_FAIL || value[0] == 0) { - return default_quota; + return DEFAULT_QUOTA; } return std::stoi(value); } int GetDomainQuota(uint32_t domain) { - static constexpr int default_quota = 10240; char value[HILOG_PROP_VALUE_MAX] = {0}; string prop = GetPropertyName(PropType::PROP_DOMAIN_QUOTA) + Uint2HexStr(domain); int ret = PropertyGet(prop, value, HILOG_PROP_VALUE_MAX); if (ret == RET_FAIL || value[0] == 0) { - return default_quota; + return DEFAULT_QUOTA; } return std::stoi(value); } -- Gitee