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 interested. Thanks to all that helped. chuck -----Original Message----- From: [EMAIL PROTECTED] [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 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. 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. Erik -- We have offshored my rockband Void, and we are highly popular in India. _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
