From 9792fcd1e46949eb006e209b013157c35179c275 Mon Sep 17 00:00:00 2001 From: liuyuxiu Date: Thu, 18 Apr 2024 14:23:25 +0800 Subject: [PATCH] qos_manager warnning bugfix Signed-off-by: liuyuxiu --- frameworks/native/qos_ndk.cpp | 10 ++++++---- interfaces/kits/c/qos.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/frameworks/native/qos_ndk.cpp b/frameworks/native/qos_ndk.cpp index 46b0abc..cb04b2f 100644 --- a/frameworks/native/qos_ndk.cpp +++ b/frameworks/native/qos_ndk.cpp @@ -23,6 +23,7 @@ static constexpr int ERROR_NUM = -1; using namespace OHOS::QOS; using namespace std; +namespace { const unordered_map qos_map = { {QoS_Level::QOS_BACKGROUND, QosLevel::QOS_BACKGROUND}, {QoS_Level::QOS_UTILITY, QosLevel::QOS_UTILITY}, @@ -42,7 +43,7 @@ const unordered_map qos_reverse_map = { }; -int OH_QoS_SetThreadQoS(QoS_Level level) +[[maybe_unused]] int OH_QoS_SetThreadQoS(QoS_Level level) { auto iter = qos_map.find(level); if (iter == qos_map.end()) { @@ -51,12 +52,12 @@ int OH_QoS_SetThreadQoS(QoS_Level level) return QosController::GetInstance().SetThreadQosForOtherThread(iter->second, gettid()); } -int OH_QoS_ResetThreadQoS(void) +[[maybe_unused]] int OH_QoS_ResetThreadQoS(void) { return QosController::GetInstance().ResetThreadQosForOtherThread(gettid()); } -int OH_QoS_GetThreadQoS(QoS_Level *level) +[[maybe_unused]] int OH_QoS_GetThreadQoS(QoS_Level *level) { if (level == nullptr) { return ERROR_NUM; @@ -72,4 +73,5 @@ int OH_QoS_GetThreadQoS(QoS_Level *level) } *level = iter->second; return 0; -} \ No newline at end of file +} +} // namespace \ No newline at end of file diff --git a/interfaces/kits/c/qos.h b/interfaces/kits/c/qos.h index c92ab5b..61887dd 100644 --- a/interfaces/kits/c/qos.h +++ b/interfaces/kits/c/qos.h @@ -96,7 +96,7 @@ int OH_QoS_SetThreadQoS(QoS_Level level); * @see QoS_Level * @since 12 */ -int OH_QoS_ResetThreadQoS(); +int OH_QoS_ResetThreadQoS(void); /** * @brief Obtains the QoS level of the current thread. -- Gitee