Dave McGuire [mcguire at
neurotica.com] wrote:
I work all day, every day, with network protocols
and
binary file formats. On every platform I work on, and indeed every
platform I've *ever* worked on, unsigned short has been 16 bits, and
unsigned int has been 32. That includes the 8-bitters as
well. The idea is good, but the syntactic sugar of excessive
typedefs where they just aren't needed (and portability to
95% of architectures isn't impacted) is just pointless
overcomplexification.
I expect that every platform I've been on "unsigned int" has been
32-bits too,
but uint32_t is pretty intention-revealing: it's not just a random
integer, it's
unsigned and intended to be 32 bits (not just "it happens to be").
Similarly
uint16_t and uint8_t.
(Did gcc ever make it to the PDP-10? Anyone know what unsigned int and
unsigned
short might be there?)
Antonio