Bob Ippolito <bob@...> writes:
> On Monday, Jul 28, 2003, at 17:38 America/New_York, Brad Clements wrote:
>
>> I expect this structure to be 22 bytes
>>
>> class DLGITEMTEMPLATEEXHeader(Structure):
>> packed = 2
>> _fields_ = [
>> ("helpID", c_ulong), # 4 + -- 4
>> ("exStyle", c_ulong), # 4 + -- 8
>> ("style", c_ulong), # 4 + -- 12
>> ("x", c_short), # 2 + -- 14
>> ("y", c_short), # 2 + -- 16
>> ("cx", c_short), # 2 + -- 18
>> ("cy", c_short), # 2 + -- 20
>> ("id", c_ushort) # 2 = -- 22
>> ]
>>
>>
>> byte sizeof() reports 24
>
> You're right, I ran a couple similar tests and it doesn't seem like
> ANY setting for packed makes this structure report a different sizeof.
>
> However, by looking at mr. source code, I see that "packed" is
> actually called "_pack_" .. give that a shot, it works ;)
Thanks. I've fixed the docs in cvs.
Thomas
|