[Prism54-devel] [PATCH] use platform-independent types in isl_oid.h
Herbert Valerio Riedel
hvr@hvrlab.org
Wed, 31 Dec 2003 06:37:36 +0100
On Tue, Dec 30, 2003 at 10:45:26PM +0100, Jens Maurer wrote:
> Hello!
>
> isl_oid.h defines the communication protocol with the firmware.
> Structure layouts are fixed, thus there are plenty of
> __attribute__((packed)) so that gcc doesn't add padding.
that was just paranoia, actually it makes the code less portable...
> That's great, except that there are a few places where
> isl_oid.h uses "short" or "char" in the definition of the structs.
> Those could be larger than 16 or 8 bits on a non-x86 platform.
thx, but:
1.) in theory yes, but I'm not aware of any linux platform, where gcc
maps char/short to anything different than 8/16 bit integers;
2.) I haven't used u16 and u8 on purpose: I wasn't sure about the
signedness of those field members, and I want to go through each
single instance and check whether it's sensible or not;
ps: about the if (..., cond) pattern; I'm not a big fan of it either
(but for different a reason) but I'd rather fix those in small
quantities, rather than doing a big commit over all instances, since I
fear introduction of bugs if changing many occurences at once;
--
Herbert Valerio Riedel / Phone: (EUROPE) +43-1-58801-18840
Email: hvr@hvrlab.org / Finger hvr@gnu.org for GnuPG Public Key
GnuPG Key Fingerprint: 7BB9 2D6C D485 CE64 4748 5F65 4981 E064 883F 4142