summaryrefslogtreecommitdiffstats
path: root/src/common/fixed_point.h
diff options
context:
space:
mode:
authorarades79 <scravers@protonmail.com>2023-02-11 19:57:59 +0100
committerarades79 <scravers@protonmail.com>2023-02-14 18:33:11 +0100
commit392a029ef4d162eb14bc3f32f86e422d9bf5d232 (patch)
tree3a6f93d6a421daaf25144a2070d39fbe3d2145b3 /src/common/fixed_point.h
parentadd static lifetime to constexpr values to force compile time evaluation where possible (diff)
downloadyuzu-392a029ef4d162eb14bc3f32f86e422d9bf5d232.tar
yuzu-392a029ef4d162eb14bc3f32f86e422d9bf5d232.tar.gz
yuzu-392a029ef4d162eb14bc3f32f86e422d9bf5d232.tar.bz2
yuzu-392a029ef4d162eb14bc3f32f86e422d9bf5d232.tar.lz
yuzu-392a029ef4d162eb14bc3f32f86e422d9bf5d232.tar.xz
yuzu-392a029ef4d162eb14bc3f32f86e422d9bf5d232.tar.zst
yuzu-392a029ef4d162eb14bc3f32f86e422d9bf5d232.zip
Diffstat (limited to 'src/common/fixed_point.h')
-rw-r--r--src/common/fixed_point.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/fixed_point.h b/src/common/fixed_point.h
index 29b80c328..f899b0d54 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 static size_t fractional_bits = FixedPoint<I, F>::fractional_bits;
+ constexpr 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 static int bits = FixedPoint<I, F>::total_bits;
+ constexpr 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 static size_t fractional_bits = FixedPoint<I, F>::fractional_bits;
+ constexpr 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 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;
+ 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;
// more costly but doesn't need a larger type
const base_type a_hi = (lhs.to_raw() & integer_mask) >> fractional_bits;