diff options
| author | 2023-02-14 11:13:47 -0500 | |
|---|---|---|
| committer | 2023-02-14 12:35:39 -0500 | |
| commit | 683019878fc939b418a65e1c5d84b066596d7655 (patch) | |
| tree | 6b2a2e8ea34cb00a3fccf3613a52475550997035 /src/common | |
| parent | apply clang-format (diff) | |
| download | yuzu-683019878fc939b418a65e1c5d84b066596d7655.tar.gz yuzu-683019878fc939b418a65e1c5d84b066596d7655.tar.xz yuzu-683019878fc939b418a65e1c5d84b066596d7655.zip | |
remove static from pointer sized or smaller types for aesthetics, change constexpr static to static constexpr for consistency
Signed-off-by: arades79 <scravers@protonmail.com>
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/hex_util.h | 2 | ||||
| -rw-r--r-- | src/common/tiny_mt.h | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/common/hex_util.h b/src/common/hex_util.h index 6b024588b..a00904939 100644 --- a/src/common/hex_util.h +++ b/src/common/hex_util.h | |||
| @@ -47,7 +47,7 @@ template <typename ContiguousContainer> | |||
| 47 | static_assert(std::is_same_v<typename ContiguousContainer::value_type, u8>, | 47 | static_assert(std::is_same_v<typename ContiguousContainer::value_type, u8>, |
| 48 | "Underlying type within the contiguous container must be u8."); | 48 | "Underlying type within the contiguous container must be u8."); |
| 49 | 49 | ||
| 50 | constexpr static std::size_t pad_width = 2; | 50 | constexpr std::size_t pad_width = 2; |
| 51 | 51 | ||
| 52 | std::string out; | 52 | std::string out; |
| 53 | out.reserve(std::size(data) * pad_width); | 53 | out.reserve(std::size(data) * pad_width); |
diff --git a/src/common/tiny_mt.h b/src/common/tiny_mt.h index 4689fd55b..5d5ebf158 100644 --- a/src/common/tiny_mt.h +++ b/src/common/tiny_mt.h | |||
| @@ -223,7 +223,7 @@ public: | |||
| 223 | 223 | ||
| 224 | float GenerateRandomF32() { | 224 | float GenerateRandomF32() { |
| 225 | // Floats have 24 bits of mantissa. | 225 | // Floats have 24 bits of mantissa. |
| 226 | constexpr static u32 MantissaBits = 24; | 226 | constexpr u32 MantissaBits = 24; |
| 227 | return static_cast<float>(GenerateRandomU24()) * (1.0f / (1U << MantissaBits)); | 227 | return static_cast<float>(GenerateRandomU24()) * (1.0f / (1U << MantissaBits)); |
| 228 | } | 228 | } |
| 229 | 229 | ||
| @@ -234,9 +234,9 @@ public: | |||
| 234 | // Nintendo does not. They use (32 - 5) = 27 bits from the first rnd32() | 234 | // Nintendo does not. They use (32 - 5) = 27 bits from the first rnd32() |
| 235 | // call, and (32 - 6) bits from the second. We'll do what they do, but | 235 | // call, and (32 - 6) bits from the second. We'll do what they do, but |
| 236 | // There's not a clear reason why. | 236 | // There's not a clear reason why. |
| 237 | constexpr static u32 MantissaBits = 53; | 237 | constexpr u32 MantissaBits = 53; |
| 238 | constexpr static u32 Shift1st = (64 - MantissaBits) / 2; | 238 | constexpr u32 Shift1st = (64 - MantissaBits) / 2; |
| 239 | constexpr static u32 Shift2nd = (64 - MantissaBits) - Shift1st; | 239 | constexpr u32 Shift2nd = (64 - MantissaBits) - Shift1st; |
| 240 | 240 | ||
| 241 | const u32 first = (this->GenerateRandomU32() >> Shift1st); | 241 | const u32 first = (this->GenerateRandomU32() >> Shift1st); |
| 242 | const u32 second = (this->GenerateRandomU32() >> Shift2nd); | 242 | const u32 second = (this->GenerateRandomU32() >> Shift2nd); |