mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-13 14:36:37 -04:00
Cleanup
This commit is contained in:
parent
7dddb8d2d2
commit
223f40820a
@ -22,8 +22,10 @@ struct bit_field {
|
|||||||
return (*value >> Position) & ((1ULL << Size) - 1);
|
return (*value >> Position) & ((1ULL << Size) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bit_field& operator=(T new_value){
|
bit_field& operator=(T new_value_real){
|
||||||
S mask = ((1ULL << Size) - 1) << Position;
|
S new_value(new_value_real);
|
||||||
|
|
||||||
|
size_t mask = ((S(1) << Size) - 1) << Position;
|
||||||
*value = (*value & ~mask) | ((new_value << Position) & mask);
|
*value = (*value & ~mask) | ((new_value << Position) & mask);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user