Philip Van Hoof <[EMAIL PROTECTED]> writes: > On Sat, 2006-07-15 at 23:19 +0300, Tomi Ollila wrote: >> Philip Van Hoof <[EMAIL PROTECTED]> writes: >> >> > >> > If somebody feels brave, feel free to assist me in getting it 4 byte >> > aligned ;-). I don't have a lot experience here. >> >> (((char *)address + 3) & ~3) > > I simply use this on each char* pointer? That's it?
Something like it... you just have to ensure there is enough space at the end (i.e aligning requires that there is 1-3 bytes more space for the data). Also, maybe better (or worse!) is (char *)(((int)address + 3) & ~3), assumed that sizeof (char *) == sizeof (int). This latter version seems to compile... ... this too: (char *)((int)((char *)address + 3) & ~3));, but that is not any better (in sizeof comparisons...). > Philip Van Hoof, software developer at x-tend Tomi _______________________________________________ maemo-developers mailing list maemo-developers@maemo.org https://maemo.org/mailman/listinfo/maemo-developers