summaryrefslogtreecommitdiff
path: root/src/common/bit_field.h
diff options
context:
space:
mode:
authorGravatar archshift2015-08-11 19:45:15 -0700
committerGravatar archshift2015-08-11 19:45:15 -0700
commitd1ae413ffd4f6a1d36ab67ee8d85c770336e0af3 (patch)
treecb108d168ea296d798b99cac1faff36b9ecbe4e1 /src/common/bit_field.h
parentMerge pull request #893 from linkmauve/remove-uint._t-int._t (diff)
downloadyuzu-d1ae413ffd4f6a1d36ab67ee8d85c770336e0af3.tar.gz
yuzu-d1ae413ffd4f6a1d36ab67ee8d85c770336e0af3.tar.xz
yuzu-d1ae413ffd4f6a1d36ab67ee8d85c770336e0af3.zip
Stop defining GCC always_inline attributes as __forceinline
__forceinline is a MSVC extension, which may confuse some people working on the codebase. Furthermore, the C++ standard dictates that all names which contain adjacent underscores are reserved.
Diffstat (limited to '')
-rw-r--r--src/common/bit_field.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h
index f64ebdaf6..d306ce9a9 100644
--- a/src/common/bit_field.h
+++ b/src/common/bit_field.h
@@ -141,22 +141,22 @@ public:
141 BitField& operator=(const BitField&) = delete; 141 BitField& operator=(const BitField&) = delete;
142#endif 142#endif
143 143
144 __forceinline BitField& operator=(T val) 144 FORCE_INLINE BitField& operator=(T val)
145 { 145 {
146 Assign(val); 146 Assign(val);
147 return *this; 147 return *this;
148 } 148 }
149 149
150 __forceinline operator T() const 150 FORCE_INLINE operator T() const
151 { 151 {
152 return Value(); 152 return Value();
153 } 153 }
154 154
155 __forceinline void Assign(const T& value) { 155 FORCE_INLINE void Assign(const T& value) {
156 storage = (storage & ~GetMask()) | (((StorageType)value << position) & GetMask()); 156 storage = (storage & ~GetMask()) | (((StorageType)value << position) & GetMask());
157 } 157 }
158 158
159 __forceinline T Value() const 159 FORCE_INLINE T Value() const
160 { 160 {
161 if (std::numeric_limits<T>::is_signed) 161 if (std::numeric_limits<T>::is_signed)
162 { 162 {
@@ -170,7 +170,7 @@ public:
170 } 170 }
171 171
172 // TODO: we may want to change this to explicit operator bool() if it's bug-free in VS2015 172 // TODO: we may want to change this to explicit operator bool() if it's bug-free in VS2015
173 __forceinline bool ToBool() const 173 FORCE_INLINE bool ToBool() const
174 { 174 {
175 return Value() != 0; 175 return Value() != 0;
176 } 176 }
@@ -187,7 +187,7 @@ private:
187 // Unsigned version of StorageType 187 // Unsigned version of StorageType
188 typedef typename std::make_unsigned<StorageType>::type StorageTypeU; 188 typedef typename std::make_unsigned<StorageType>::type StorageTypeU;
189 189
190 __forceinline StorageType GetMask() const 190 FORCE_INLINE StorageType GetMask() const
191 { 191 {
192 return (((StorageTypeU)~0) >> (8 * sizeof(T)-bits)) << position; 192 return (((StorageTypeU)~0) >> (8 * sizeof(T)-bits)) << position;
193 } 193 }