diff --git a/include/CKSDK/Util/Fixed.h b/include/CKSDK/Util/Fixed.h index 5d83050..e24f0ae 100644 --- a/include/CKSDK/Util/Fixed.h +++ b/include/CKSDK/Util/Fixed.h @@ -33,7 +33,7 @@ namespace CKSDK { /// @cond INTERNAL // Integer type extension for multiplication - template + template struct extend_integral_type { using type = T; }; template <> @@ -55,40 +55,32 @@ namespace CKSDK struct extend_integral_type { using type = unsigned long long; }; template <> - struct extend_integral_type { using type = long long; }; - template <> - struct extend_integral_type { using type = long; }; + struct extend_integral_type { using type = long long; }; template <> - struct extend_integral_type { using type = unsigned long long; }; - template <> - struct extend_integral_type { using type = unsigned long; }; + struct extend_integral_type { using type = unsigned long long; }; // No standard integral type larger than long long. template <> - struct extend_integral_type { using type = long long; }; - template <> - struct extend_integral_type { using type = long; }; + struct extend_integral_type { using type = long long; }; template <> - struct extend_integral_type { using type = unsigned long long; }; - template <> - struct extend_integral_type { using type = unsigned long; }; + struct extend_integral_type { using type = unsigned long long; }; - template - using extend_integral_t = typename extend_integral_type::type; + template + using extend_integral_t = typename extend_integral_type::type; // Integer type extension for two types, pick the larger one while keeping signedness - template + template struct extend_integral_2 { using larger_type = std::conditional_t<(sizeof(T1) > sizeof(T2)), T1, T2>; - using ext_larger_type = extend_integral_t; + using ext_larger_type = extend_integral_t; using type = std::conditional_t, std::make_signed_t, std::make_unsigned_t>; }; - template - using extend_integral_2_t = typename extend_integral_2::type; + template + using extend_integral_2_t = typename extend_integral_2::type; /// @endcond // Fixed point types @@ -337,7 +329,7 @@ namespace CKSDK template constexpr Fixed &operator/=(const Fixed &_x) { - this->x = ((extend_integral_2_t)this->x << FRAC2) / _x.x; + this->x = ((extend_integral_2_t)this->x << FRAC2) / _x.x; return *this; } // Fixed / Fixed