[Implemented] Structure Enhancement Request
Posted: Fri Sep 18, 2009 12:12 pm
Could structures please be enhanced to use a boundary-alignment type, with the new syntax:
Examples:
Structure.Q mystruct would start on at least a 64-bit boundary
Structure.L mystruct would start on at least a 32-bit boundary
Structure.I mystruct would start on at least a 64-bit boundary on 64-bit CPUs and at least a 32-bit boundary otherwise.
There would be an additional feature: the end of the structure would automatically be padded with nulls so that it also had [at least] the same boundary alignment as the start of the structure.
Thuswould start on [at least] a 64-bit boundary and be padded at the end with 24 bits to ensure that also lay on [at least] a 64-bit boundary.
The absence of a <type> would default to the current PB4.40 boundaries and if the Extends keyword was present, <type> would be ignored for the start of the structure, but honoured for the end of the structure.
Code: Select all
Structure[.type>] <name> [Extends <name>]
Structure.Q mystruct would start on at least a 64-bit boundary
Structure.L mystruct would start on at least a 32-bit boundary
Structure.I mystruct would start on at least a 64-bit boundary on 64-bit CPUs and at least a 32-bit boundary otherwise.
There would be an additional feature: the end of the structure would automatically be padded with nulls so that it also had [at least] the same boundary alignment as the start of the structure.
Thus
Code: Select all
Structure.q mystruct
length.w
height.w
depth.a
endStructure
The absence of a <type> would default to the current PB4.40 boundaries and if the Extends keyword was present, <type> would be ignored for the start of the structure, but honoured for the end of the structure.