mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-08 20:10:04 -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);
|
||||
}
|
||||
|
||||
bit_field& operator=(T new_value){
|
||||
S mask = ((1ULL << Size) - 1) << Position;
|
||||
bit_field& operator=(T new_value_real){
|
||||
S new_value(new_value_real);
|
||||
|
||||
size_t mask = ((S(1) << Size) - 1) << Position;
|
||||
*value = (*value & ~mask) | ((new_value << Position) & mask);
|
||||
return *this;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user