diff options
| author | 2023-01-29 13:54:13 -0700 | |
|---|---|---|
| committer | 2023-01-29 17:49:42 -0700 | |
| commit | d5fc56db4bdebcf4f45e39e9c9d0f40229de8cea (patch) | |
| tree | 4bbcaee76bde35ddc6eff9a1c639866cf278b353 /src/common/bit_util.h | |
| parent | Merge pull request #9699 from ameerj/texture-pass-desc (diff) | |
| download | yuzu-d5fc56db4bdebcf4f45e39e9c9d0f40229de8cea.tar.gz yuzu-d5fc56db4bdebcf4f45e39e9c9d0f40229de8cea.tar.xz yuzu-d5fc56db4bdebcf4f45e39e9c9d0f40229de8cea.zip | |
Move to Clang Format 15
Depends on https://github.com/yuzu-emu/build-environments/pull/69
clang-15 primary run
Diffstat (limited to '')
| -rw-r--r-- | src/common/bit_util.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/bit_util.h b/src/common/bit_util.h index e4e6287f3..13368b439 100644 --- a/src/common/bit_util.h +++ b/src/common/bit_util.h | |||
| @@ -45,19 +45,19 @@ template <typename T> | |||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | template <typename T> | 47 | template <typename T> |
| 48 | requires std::is_unsigned_v<T> | 48 | requires std::is_unsigned_v<T> |
| 49 | [[nodiscard]] constexpr bool IsPow2(T value) { | 49 | [[nodiscard]] constexpr bool IsPow2(T value) { |
| 50 | return std::has_single_bit(value); | 50 | return std::has_single_bit(value); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | template <typename T> | 53 | template <typename T> |
| 54 | requires std::is_integral_v<T> | 54 | requires std::is_integral_v<T> |
| 55 | [[nodiscard]] T NextPow2(T value) { | 55 | [[nodiscard]] T NextPow2(T value) { |
| 56 | return static_cast<T>(1ULL << ((8U * sizeof(T)) - std::countl_zero(value - 1U))); | 56 | return static_cast<T>(1ULL << ((8U * sizeof(T)) - std::countl_zero(value - 1U))); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | template <size_t bit_index, typename T> | 59 | template <size_t bit_index, typename T> |
| 60 | requires std::is_integral_v<T> | 60 | requires std::is_integral_v<T> |
| 61 | [[nodiscard]] constexpr bool Bit(const T value) { | 61 | [[nodiscard]] constexpr bool Bit(const T value) { |
| 62 | static_assert(bit_index < BitSize<T>(), "bit_index must be smaller than size of T"); | 62 | static_assert(bit_index < BitSize<T>(), "bit_index must be smaller than size of T"); |
| 63 | return ((value >> bit_index) & T(1)) == T(1); | 63 | return ((value >> bit_index) & T(1)) == T(1); |