Defining the sample structure
Thiago Macieira
thiago at macieira.org
Wed Apr 23 12:06:09 PDT 2014
Em qua 23 abr 2014, às 19:43:58, Willem Ferguson escreveu:
> struct __attribute__((__packed__)) { //new structure definition
> uint16_t setpoint;
> uint16_t o2sensor[3];
> } o2ccr;
Don't pack this struct. It doesn't help unless you're making an array of o2ccr
and it could lead to worse code for the common case.
You're not saving any bytes with the packing since the size of this struct is
8 bytes anyway.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
More information about the subsurface
mailing list