From 92e2dcc35cb63df93526bb441a19e250f4eae014 Mon Sep 17 00:00:00 2001 From: wangyantian Date: Tue, 15 Feb 2022 15:47:31 +0800 Subject: [PATCH] fix codex warnings(2022_02_15 runtime_core) Signed-off-by: wangyantian --- libpandabase/utils/bit_utils.h | 2 +- libpandabase/utils/type_converter.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libpandabase/utils/bit_utils.h b/libpandabase/utils/bit_utils.h index 1272104d6f..86b87f5580 100644 --- a/libpandabase/utils/bit_utils.h +++ b/libpandabase/utils/bit_utils.h @@ -172,7 +172,7 @@ inline uint8_t GetByteFrom(T value, uint64_t index) inline uint16_t ReverseBytes(uint16_t value) { constexpr uint32_t OFFSET_0 = 8; - return (value << OFFSET_0) | (value >> OFFSET_0); // NOLINT(hicpp-signed-bitwise) + return static_cast(value << OFFSET_0) | static_cast(value >> OFFSET_0); } inline uint32_t ReverseBytes(uint32_t value) diff --git a/libpandabase/utils/type_converter.cpp b/libpandabase/utils/type_converter.cpp index a6208bf13f..addce3f605 100644 --- a/libpandabase/utils/type_converter.cpp +++ b/libpandabase/utils/type_converter.cpp @@ -84,7 +84,7 @@ bool operator!=(const ValueUnit &lhs, const ValueUnit &rhs) std::ostream &operator<<(std::ostream &os, const ValueUnit &element) { if (element.GetValue().index() == 0U) { - os << std::fixed << std::setprecision(element.GetPrecision()) << element.GetDoubleValue() + os << std::fixed << std::setprecision(static_cast(element.GetPrecision())) << element.GetDoubleValue() << std::setprecision(-1); } else { os << element.GetUint64Value(); -- Gitee