Draft: ifo_types: use static asserts to ensure the compiler respects the expected packing
- Aug 22, 2022
-
-
Steve Lhomme authored
It will not be checked on compilers without static_assert() or not MSVC (ie non-C11 compilers).
5fd0514d -
Steve Lhomme authored
Since they are packed structures the size in memory of packed data should be the same no matter the compiler, compiler options or architecture.
ade77caa -
Steve Lhomme authored
LLVM ends up using the size of an unsigned int if it's used in the bitfield. In other places the bitfields are using unsigned char which always uses the proper size in the packed structures. /!\ btni_t fields are kept with unsigned int as unsigned char cannot hold 10 bits. btni_t is not actually read as a packed structure. So we keep the current format for backward compatibility.
007dd443 -
Steve Lhomme authored
LLVM ends up using the size of an unsigned int if it's used in the bitfield. In other places the bitfields are using unsigned char which always uses the proper size in the packed structures. * multichannel_ext_t would end up having a size of 27 instead of 24 * cell_playback_t would end up having a size of 26 instead of 24 * pgci_srp_t would end up having a size of 11 instead of 8 * playback_type_t would end up having a size of 4 instead of 1
ea2a60e7
-