summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Tony Wasserka2014-05-29 22:54:34 +0200
committerGravatar Tony Wasserka2014-07-16 09:05:29 +0200
commit47a001722d7ada681e333e991373e19d159c380b (patch)
treecb8871d30e4cb67e4224ff9e59d34acc38774378 /src
parentMerge pull request #29 from bunnei/address-arbiters (diff)
downloadyuzu-47a001722d7ada681e333e991373e19d159c380b.tar.gz
yuzu-47a001722d7ada681e333e991373e19d159c380b.tar.xz
yuzu-47a001722d7ada681e333e991373e19d159c380b.zip
BitField: Add an explicit evaluation method.
Sometimes it can be beneficial to use this in places where an explicit cast needs to happen otherwise. By using the evaluation method, it's not necessary anymore to explicitly write the underlying type in this case.
Diffstat (limited to 'src')
-rw-r--r--src/common/bit_field.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h
index dfd00d198..a39bb9886 100644
--- a/src/common/bit_field.h
+++ b/src/common/bit_field.h
@@ -132,6 +132,11 @@ public:
132 132
133 __forceinline operator T() const 133 __forceinline operator T() const
134 { 134 {
135 return Value();
136 }
137
138 __forceinline T Value() const
139 {
135 if (std::numeric_limits<T>::is_signed) 140 if (std::numeric_limits<T>::is_signed)
136 { 141 {
137 std::size_t shift = 8 * sizeof(T)-bits; 142 std::size_t shift = 8 * sizeof(T)-bits;