1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:07:45 +00:00

AK: Ensure unions with bitfield structs actually have correct sizes

The fun pattern of `union { struct { u32 a : 1; u64 b : 7; }; u8 x; }`
produces complete garbage on windows, this commit fixes the two
instances of those that exist in AK.
This commit also makes sure that the generated unions have the correct
size (whereas FloatExtractor<f32> previously did not!) by adding some
nice static_asserts.
This commit is contained in:
Ali Mohammad Pur 2023-11-01 01:59:31 +03:30 committed by Ali Mohammad Pur
parent 4676b288a2
commit 7976e1852c
2 changed files with 24 additions and 14 deletions

View file

@ -13,7 +13,7 @@ VALIDATE_IS_X86();
namespace AK {
enum class RoundingMode : u8 {
enum class RoundingMode : u16 {
NEAREST = 0b00,
DOWN = 0b01,
UP = 0b10,