Quoting Chuck Cole :

> Also, I uncommented out a line in the code in the process() method to print
> out the size of the buffer that is being sent.  According to this statement,
> the size of the buffer (or the class structure in this case) is 640 bytes.
> However, when I do the same thing on my side to print out the size of the
> structure I should be receiving, I get 632 bytes.  If I manually calculate
> what the size should be, giving 4 bytes for longs, 8 bytes for doubles, I
> get 632.  I don't know where the extra 8 bytes come from.

Padding. Usually, structure fields are put at multiple of there size. If there
is a multiple of 4 bytes that is not a multiple of 8 before your double, it is
shifted. But it is architecture and compiler dependant. You can used #pragma
pack with a performance loss or rearrange the fields in your structure.

-Fred

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to