This was exactly what was happening.  I used the #pragma pack(4) directive
and this fixed the problem.  I'm now able to receive all of the data
correctly.  I was also able to receive the correct data by moving the
variable declarations around as well, but this didn't allow for common
variables to be grouped.  I understand that there may be a performance hit
with the use of the "pragma pack" statement, but I don't know if it will
make any difference in my case.

I will post the affected files once I get them cleaned up for those

Thanks to all that helped.


-----Original Message-----
[mailto:[EMAIL PROTECTED] On Behalf Of Erik Hofman
Sent: Monday, November 29, 2004 1:41 PM
To: FlightGear developers discussions
Subject: Re: [Flightgear-devel] Getting data out of FlightGear

Chuck Cole wrote:

> Also, I uncommented out a line in the code in the process() method to
> out the size of the buffer that is being sent.  According to this
> 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.

632 bytes us called a packed structure. Unpacked structures are aligned 
to the platform (64-bit or 32-bit aligned, often leaving "holes" in the 
structure to align them properly.


We have offshored my rockband Void,
and we are highly popular in India.

Flightgear-devel mailing list

Flightgear-devel mailing list

Reply via email to