diff --git a/interface/core/i128.h b/interface/core/i128.h index ddbab21..b34b723 100644 --- a/interface/core/i128.h +++ b/interface/core/i128.h @@ -20,11 +20,10 @@ namespace hud class u128; class alignas(16) i128 - : protected details::i128::i128_impl + : public details::i128::i128_impl { private: - friend u128; using super = details::i128::i128_impl; public: @@ -165,10 +164,9 @@ namespace hud } class alignas(16) u128 - : protected details::i128::u128_impl + : public details::i128::u128_impl { private: - friend i128; using super = details::i128::u128_impl; public: diff --git a/interface/core/i128/i128_intrinsics.h b/interface/core/i128/i128_intrinsics.h index f8e33ba..f038e8e 100644 --- a/interface/core/i128/i128_intrinsics.h +++ b/interface/core/i128/i128_intrinsics.h @@ -109,13 +109,13 @@ namespace hud /** Retrieves the low part of the u64. */ [[nodiscard]] constexpr u64 low() const noexcept { - return bit_cast_to_signed_i64(static_cast(static_cast(value_) >> 64)); + return static_cast(value_ & ~u64 {0}); } /** Retrieves the high part of the i64. */ [[nodiscard]] constexpr i64 high() const noexcept { - return static_cast(value_ & ~u64 {0}); + return bit_cast_to_signed_i64(static_cast(static_cast(value_) >> 64)); } /** Cast to bool. */ @@ -293,13 +293,13 @@ namespace hud /** Retrieves the low part of the u64. */ [[nodiscard]] constexpr u64 low() const noexcept { - return static_cast(value_ >> 64); + return static_cast(value_ & ~u64 {0}); } /** Retrieves the high part of the i64. */ [[nodiscard]] constexpr u64 high() const noexcept { - return static_cast(value_ & ~u64 {0}); + return static_cast(value_ >> 64); } /** Cast to bool. */