From 1d40b8eb04ec75d68a88a691bd49d3e24666d6b4 Mon Sep 17 00:00:00 2001 From: Yandong Lin Date: Tue, 24 Dec 2024 15:53:35 +0800 Subject: [PATCH] fix[mpp_sys_cfg]: Fix compile warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compile linux/aarch64 with toolchain: gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++ Compile message: mpp/base/mpp_sys_cfg.cpp: In constructor ‘MppSysCfgService::MppSysCfgService()’: mpp/base/mpp_sys_cfg.cpp:88:61: warning: enum constant in boolean context [-Wint-in-bool-context] 88 | ENTRY(dec_buf_chk, type, U32, MppCodingType, MPP_SYS_DEC_BUF_CHK_CFG_CHANGE_TYPE, dec_buf_chk, type) \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mpp/base/mpp_sys_cfg.cpp:77:13: note: in definition of macro ‘EXPAND_AS_TRIE’ 77 | flag ? 1 : 0, \ | ^~~~ mpp/base/mpp_sys_cfg.cpp:123:5: note: in expansion of macro ‘ENTRY_TABLE’ 123 | ENTRY_TABLE(EXPAND_AS_TRIE) Change-Id: Id60d66fdf0fd7be75d577ca8fc9b45eee3eeb2dd Signed-off-by: Yandong Lin --- mpp/base/mpp_sys_cfg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpp/base/mpp_sys_cfg.cpp b/mpp/base/mpp_sys_cfg.cpp index f1818d04..c9f8a055 100644 --- a/mpp/base/mpp_sys_cfg.cpp +++ b/mpp/base/mpp_sys_cfg.cpp @@ -74,7 +74,7 @@ public: do { \ MppCfgInfo tmp = { \ CFG_FUNC_TYPE_##cfg_type, \ - flag ? 1 : 0, \ + flag > 0 ? 1 : 0, \ (RK_U32)((long)&(((MppSysCfgSet *)0)->field_change.change)), \ flag, \ (RK_U32)((long)&(((MppSysCfgSet *)0)->field_change.field_data)), \