mirror of
https://github.com/minetest/minetest.git
synced 2024-09-12 08:28:36 +02:00
Fix set_bits
This commit is contained in:
parent
337e79c656
commit
699e066bea
@ -258,7 +258,7 @@ inline u32 get_bits(u32 x, u32 pos, u32 len)
|
||||
inline void set_bits(u32 *x, u32 pos, u32 len, u32 val)
|
||||
{
|
||||
u32 mask = (1 << len) - 1;
|
||||
*x &= ~(mask << len);
|
||||
*x &= ~(mask << pos);
|
||||
*x |= (val & mask) << pos;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user