Suppose you have a struct something like this:
How would you go about ensuring that these data structures are aligned on DWORD boundaries (other than using #pragma pack (n) or UNALIGNED since those simply don't help in my situation)? As you probably know, datatype misalignment is a major headache in ppc development, especially moving code from DOS to ppc. I've finally been bitten by this problem (why I'd not seen it until today is unexplainable), and am trying to find a solution by reordering my structures and possibly padding them to make them align properly.
- Code:
typedef struct _tagMyStruct {
int a;
char b;
short c;
char d[29];
short e;
} MyStruct;
typedef struct _tagMyStructTwo {
short a;
short b;
MyStruct c[100][150];
short d;
bool e;
char f;
} MyStructTwo;
How would you go about ensuring that these data structures are aligned on DWORD boundaries (other than using #pragma pack (n) or UNALIGNED since those simply don't help in my situation)? As you probably know, datatype misalignment is a major headache in ppc development, especially moving code from DOS to ppc. I've finally been bitten by this problem (why I'd not seen it until today is unexplainable), and am trying to find a solution by reordering my structures and possibly padding them to make them align properly.