]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg/DriverSampleDxe: Make bit fields aligned in C structure
authorBi, Dandan <dandan.bi@intel.com>
Thu, 8 Feb 2018 14:28:39 +0000 (22:28 +0800)
committerLiming Gao <liming.gao@intel.com>
Fri, 9 Feb 2018 09:04:15 +0000 (17:04 +0800)
commit6b86f6f336b9ccfdc27b718100c31b2aed5d7bb1
treef2b3b8eec76bad1d46398085cc3505de0b9bf443
parentce2697abeb37cf9fabab15327385415599e8fb0c
MdeModulePkg/DriverSampleDxe: Make bit fields aligned in C structure

For a structure with a series of bit fields and used as a storage
in vfr file, and if the bit fields do not add up to the size of
the defined type.In the C code use sizeof() to get size of the
structure, the results may vary form the compiler(VS,GCC...).
But the size of the storage calculated by VfrCompiler is fixed
(calculate with alignment).To avoid the issue cased by above case,
we need to make the total width of the bit fields in the structure
aligned with the size of the defined type for these bit fields.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h