mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Merge pull request #914 from yuriks/bitfield-mask
Common: Fix mask generation in BitField
This commit is contained in:
		
						commit
						b0d72e3de1
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -161,7 +161,7 @@ public: | |||
|         if (std::numeric_limits<T>::is_signed) | ||||
|         { | ||||
|             std::size_t shift = 8 * sizeof(T)-bits; | ||||
|             return (T)(((storage & GetMask()) << (shift - position)) >> shift); | ||||
|             return (T)((storage << (shift - position)) >> shift); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|  | @ -189,7 +189,7 @@ private: | |||
| 
 | ||||
|     __forceinline StorageType GetMask() const | ||||
|     { | ||||
|         return ((~(StorageTypeU)0) >> (8 * sizeof(T)-bits)) << position; | ||||
|         return (((StorageTypeU)~0) >> (8 * sizeof(T)-bits)) << position; | ||||
|     } | ||||
| 
 | ||||
|     StorageType storage; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue