On 07/02/2012 06:53 PM, Sean Conner wrote:
> have
none of that uncivilized "uint32_t" bullshit that these kids have
> dreamed up...and, surprise, my code is VERY portable)
Well, that "uint32_t" crap is *very* useful for networking protocols or
binary file parsing.
-spc (I use uint32_t at work, but then again, I have to deal with network
protocols and binary file formats ... )
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.
Well, at work, we develop code that has to run on both 32 and 64 bit
systems (Pentium and SPARC, so I get the fun of byte swapping too!). I
don't even know what the size of a 'long' is on the 64 bit system (but I
don't really have to care when I can select uint32_t or uint64_t as needed).
I learned C during the large 16-bit/32-bit switch (MS-DOS) and there, the
sizes of nearly *everything* changed on what memory model was used ...
-spc (If I recall correctly, there were several different compilers for
68k based systems where an 'int' could be 16 bits or 32 bits ... )