Fixwarningon0816

Signed-off-by: worker0217 <linhao54@huawei.com>
Change-Id: Ifc8cb6e028e0887b5aee32e9b6c31e8c6f0fc6fa
This commit is contained in:
worker0217 2024-08-16 14:52:07 +08:00
parent faebed1afe
commit b514c8fe70

View File

@ -547,7 +547,7 @@ napi_value JSPromptCloseToast(napi_env env, napi_callback_info info)
NapiThrow(env, "The toastId is invalid.", ERROR_CODE_PARAM_INVALID);
return nullptr;
}
int32_t showModeVal = id & 0b111;
int32_t showModeVal = static_cast<int32_t>(static_cast<uint32_t>(id) & 0b111);
int32_t toastId =
static_cast<int32_t>(static_cast<uint32_t>(id) >>
3); // 3 : Move 3 bits to the right to get toastId, and the last 3 bits are the showMode