-----Original Message-----
From: cctalk-bounces at
classiccmp.org
[mailto:cctalk-bounces at
classiccmp.org] On Behalf Of Dave McGuire
Sent: 04 July 2012 23:01
To: General Discussion: On-Topic and Off-Topic Posts
Subject: Re: SPI and I2C, was Re: Raspberry Pi and America,
On 07/04/2012 05:50 PM, arcarlini at
iee.org wrote:
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.
Very true; and if K&R had originally specified C's native
data types to explicitly include their size, I'd have no
problem with it. My issue is that I started with C long
before these typedefs came into being, and I just don't like 'em. ;)
Yes, but they started with "B" where the only types was a machine word and
you had to do subroutine calls to unpack characters, perform floating point
arithmetic, etc. then you probably don't want to be to rigid on your types.