diff --git a/libpandabase/utils/bit_utils.h b/libpandabase/utils/bit_utils.h index fa5489d..e36451d 100644 --- a/libpandabase/utils/bit_utils.h +++ b/libpandabase/utils/bit_utils.h @@ -26,8 +26,6 @@ #include #include -#include - #define panda_bit_utils_ctz __builtin_ctz // NOLINT(cppcoreguidelines-macro-usage) #define panda_bit_utils_ctzll __builtin_ctzll // NOLINT(cppcoreguidelines-macro-usage) @@ -294,9 +292,7 @@ inline To bit_cast(const From &src) noexcept // NOLINT(readability-identifier-n { static_assert(sizeof(To) == sizeof(From), "size of the types must be equal"); To dst; - if (memcpy_s(&dst, sizeof(To), &src, sizeof(To)) != EOK) { - UNREACHABLE(); - } + memcpy(&dst, &src, sizeof(To)); return dst; } @@ -305,9 +301,7 @@ inline To down_cast(const From &src) noexcept // NOLINT(readability-identifier- { static_assert(sizeof(To) <= sizeof(From), "size of the types must be lesser"); To dst; - if (memcpy_s(&dst, sizeof(To), &src, sizeof(To)) != EOK) { - UNREACHABLE(); - } + memcpy(&dst, &src, sizeof(To)); return dst; }