mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-06-27 03:26:17 +02:00
stfu debian
This commit is contained in:
parent
c74c9d5560
commit
7488b8e115
1 changed files with 3 additions and 3 deletions
|
|
@ -19,19 +19,19 @@ namespace Common {
|
|||
template <typename T>
|
||||
requires std::is_integral_v<T>
|
||||
[[nodiscard]] constexpr std::size_t BitSize() {
|
||||
return sizeof(T) * CHAR_BIT;
|
||||
return std::size_t(sizeof(T) * CHAR_BIT);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
requires std::is_integral_v<T>
|
||||
[[nodiscard]] constexpr u32 MostSignificantBit(const T value) {
|
||||
return (sizeof(T) * CHAR_BIT - 1) - std::countl_zero(value);
|
||||
return u32(sizeof(T) * CHAR_BIT - 1 - std::countl_zero(value));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
requires std::is_integral_v<T>
|
||||
[[nodiscard]] constexpr T Log2Floor(const T value) {
|
||||
return MostSignificantBit<T>(value);
|
||||
return T(MostSignificantBit<T>(value));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue