Hi,
adamfc2000 wrote:
Maybe an error in the wiki?
No, not necessarily. The members of the structure are aligned per their size. For example, in 64-bit mode, the 8-byte member:
Code:
EFI_PHYSICAL_ADDRESS PhysicalStart
will be aligned on the next 8-byte alignment, which is four bytes past where the "Type" member left off.
The first block of code is just accounting for this. The second block of code is assuming that the compiler was told to self align each member.
In my opinion, the first block of code is best, not only because it accounts for this, but is much more "self documenting" along with the comments given.
Ben