i'm reading into some structs from a file, so of course i need the structs aligned a certain way to guarantee that everything is read correctly. since i have gcc, i'm using __attribute__ ((packed)). however, all my structs work fine (afaik) except for this one, without the __attribute__ ((packed)), because i guess they are well aligned structs. but why does this one need __attribute__ ((packed)) to work well? or would you have to see more code to know?
PHP Code:// behaves differently (does not load data from file as expected)
// without __attribute__ ((packed))
typedef struct
{
short xoff, yoff;
short patchnum;
short one, zero;
} __attribute__ ((packed)) patchentry_t;



LinkBack URL
About LinkBacks


