[maemo-developers] DSP vs. ARM endianness and struct packing
From: Bob Lees bob at diamond.demon.co.ukDate: Fri Sep 14 14:40:05 EEST 2007
- Previous message: DSP vs. ARM endianness and struct packing
- Next message: DSP vs. ARM endianness and struct packing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Simon What happens if you pack the structure as in typedef struct __attribute__ ((packed)) endian_test_struct { Bob On Friday 14 September 2007 12:08, Simon Pickering wrote: > > Using the following struct on the DSP-side: > > > > typedef struct endian_test_struct { > > unsigned long iamulong1; > > unsigned int iamuint1; > > unsigned int iamuint2; > > unsigned long iamulong2; > > unsigned int iamuint3; > > unsigned long iamulong3; > > } endian_test_struct; > > I should qualify this: > > On the DSP the types have the following sizes: > > Char = short = int = 16bit > Long = 32bit > > > For comparison here's the same struct filled and viewed on > > the ARM (with no > > optimisation flags): > > Ah, my mistake, I thought I'd altered the types of the struct members on > the ARM side to be the same sizes as on the DSP side; I was going to email > and give the correct struct for the ARM side, but it looks like I copied > the wrong one (i.e. the same member types which are all 32bit on the ARM). > So ignore the ARM results for now, I'll re-do those. > > /me slopes away slightly embarrassed > > > Simon > > _______________________________________________ > maemo-developers mailing list > maemo-developers at maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers -- V +44 (0) 1296 747667 F +44 (0) 1296 747557 C +44 (0) 7860 406093 Diamond Consulting Services Ltd Dinton Aylesbury Bucks, HP17 8UG England
- Previous message: DSP vs. ARM endianness and struct packing
- Next message: DSP vs. ARM endianness and struct packing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]