Robbepop / modular-bitfield

Macro to generate bitfields for structs that allow for modular use of enums.
Apache License 2.0
159 stars 41 forks source link

Fix issue with single byte manipulations #12

Closed crzysdrs closed 4 years ago

crzysdrs commented 4 years ago

Manipulations that targeted a single byte for both the MSB and LSB would not properly preserve any bits above the MSB.

crzysdrs commented 4 years ago

Fixes #11.

crzysdrs commented 4 years ago

I have added the requested additional value checks to verify correctness of the field settings.

The get<T> function is only selecting for bits that it needs and doesn't need to preserve potentially disjoint bit values within a single byte (which was the issue here).