Struct Member Alignment question

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

Izman
decaying skeleton
decaying skeleton
Posts: 2
Joined: Sat Oct 11, 2003 7:24 pm
Location: Florida

Struct Member Alignment question

Post by Izman » Sat Oct 11, 2003 7:29 pm

First of all let me say, I have been a silent lurker on these boards for some time now. I feel I need to say thank you to the dev team for this wonderful program and the efforts behind developing and support it.

And on to the question:

Just curious which parts of the program depend on the 1 byte struct member alignment setting in the project. I was attempting to add some additional features to the copy of MQ I use and the 1 byte alignment is causing me some problems.

Thanx in advance to anyone that responds

Izman

Izman
decaying skeleton
decaying skeleton
Posts: 2
Joined: Sat Oct 11, 2003 7:24 pm
Location: Florida

Post by Izman » Sun Oct 12, 2003 6:15 pm

Well... while waiting for a response I believe I found a solution to my problem. I just surrounded all of my new code with #pragma pack( 8 ) and #pragma pack( 1 ). This appears to have removed the issue with the code I implemented and still keeps the struct member alignment of the original code at 1. So... guess I don't need to have an answer now although it would be nice to know what depends on the 1 byte struct member alignment.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Sun Oct 12, 2003 7:50 pm

Uh, everything is dependent on one-byte alignment.

Because we reverse engineer the eq structs, we don't have the luxury of having the compiler do all the alignment work. We have to do everything by hand.