diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/fixed_point.h | 12 | ||||
| -rw-r--r-- | src/common/hex_util.h | 2 | ||||
| -rw-r--r-- | src/common/tiny_mt.h | 8 | 
3 files changed, 11 insertions, 11 deletions
| diff --git a/src/common/fixed_point.h b/src/common/fixed_point.h index f899b0d54..29b80c328 100644 --- a/src/common/fixed_point.h +++ b/src/common/fixed_point.h @@ -107,7 +107,7 @@ constexpr FixedPoint<I, F> divide(      using next_type = typename FixedPoint<I, F>::next_type;      using base_type = typename FixedPoint<I, F>::base_type; -    constexpr size_t fractional_bits = FixedPoint<I, F>::fractional_bits; +    constexpr static size_t fractional_bits = FixedPoint<I, F>::fractional_bits;      next_type t(numerator.to_raw());      t <<= fractional_bits; @@ -127,7 +127,7 @@ constexpr FixedPoint<I, F> divide(      using unsigned_type = typename FixedPoint<I, F>::unsigned_type; -    constexpr int bits = FixedPoint<I, F>::total_bits; +    constexpr static int bits = FixedPoint<I, F>::total_bits;      if (denominator == 0) {          throw divide_by_zero(); @@ -198,7 +198,7 @@ constexpr FixedPoint<I, F> multiply(      using next_type = typename FixedPoint<I, F>::next_type;      using base_type = typename FixedPoint<I, F>::base_type; -    constexpr size_t fractional_bits = FixedPoint<I, F>::fractional_bits; +    constexpr static size_t fractional_bits = FixedPoint<I, F>::fractional_bits;      next_type t(static_cast<next_type>(lhs.to_raw()) * static_cast<next_type>(rhs.to_raw()));      t >>= fractional_bits; @@ -216,9 +216,9 @@ constexpr FixedPoint<I, F> multiply(      using base_type = typename FixedPoint<I, F>::base_type; -    constexpr size_t fractional_bits = FixedPoint<I, F>::fractional_bits; -    constexpr base_type integer_mask = FixedPoint<I, F>::integer_mask; -    constexpr base_type fractional_mask = FixedPoint<I, F>::fractional_mask; +    constexpr static size_t fractional_bits = FixedPoint<I, F>::fractional_bits; +    constexpr static base_type integer_mask = FixedPoint<I, F>::integer_mask; +    constexpr static base_type fractional_mask = FixedPoint<I, F>::fractional_mask;      // more costly but doesn't need a larger type      const base_type a_hi = (lhs.to_raw() & integer_mask) >> fractional_bits; diff --git a/src/common/hex_util.h b/src/common/hex_util.h index a00904939..6b024588b 100644 --- a/src/common/hex_util.h +++ b/src/common/hex_util.h @@ -47,7 +47,7 @@ template <typename ContiguousContainer>      static_assert(std::is_same_v<typename ContiguousContainer::value_type, u8>,                    "Underlying type within the contiguous container must be u8."); -    constexpr std::size_t pad_width = 2; +    constexpr static std::size_t pad_width = 2;      std::string out;      out.reserve(std::size(data) * pad_width); diff --git a/src/common/tiny_mt.h b/src/common/tiny_mt.h index 5d5ebf158..4689fd55b 100644 --- a/src/common/tiny_mt.h +++ b/src/common/tiny_mt.h @@ -223,7 +223,7 @@ public:      float GenerateRandomF32() {          // Floats have 24 bits of mantissa. -        constexpr u32 MantissaBits = 24; +        constexpr static u32 MantissaBits = 24;          return static_cast<float>(GenerateRandomU24()) * (1.0f / (1U << MantissaBits));      } @@ -234,9 +234,9 @@ public:          // Nintendo does not. They use (32 - 5) = 27 bits from the first rnd32()          // call, and (32 - 6) bits from the second. We'll do what they do, but          // There's not a clear reason why. -        constexpr u32 MantissaBits = 53; -        constexpr u32 Shift1st = (64 - MantissaBits) / 2; -        constexpr u32 Shift2nd = (64 - MantissaBits) - Shift1st; +        constexpr static u32 MantissaBits = 53; +        constexpr static u32 Shift1st = (64 - MantissaBits) / 2; +        constexpr static u32 Shift2nd = (64 - MantissaBits) - Shift1st;          const u32 first = (this->GenerateRandomU32() >> Shift1st);          const u32 second = (this->GenerateRandomU32() >> Shift2nd); | 
