[Bf-committers] Re: Coding (was Dithering)

john tuffen john at namke.com
Tue Nov 2 21:21:23 CET 2004


Quoting GSR - FR <famrom at infernal-iceberg.com>:

> john at namke.com (2004-11-02 at 1024.16 +0000):
> > Is it just me that finds some of this language discussion worrying?
> 
> There is another option, use clear types, as most apps I have seen
> latelly. uint32_t is 32 bit unsigned int, no discussion possible, and
> never "what the hell is int in this arch". Necessarily variable things
> can be done explicitly (pointers for 32 and 64 bit archs? bpointer or
> something).

Yes - absolutely. In my day job (software engineer in an embedded software
company) this is exactly the route we take. It is up to the guy porting the
software to a new platform to decide how to define uint32, uint16, etc. for an
architecture. The core software is then all written in terms of those basic
types. The only 'vague' type is usually a 'natural' value for the platform
(usually the register size) and that is used for loop indices etc. where
forcing a particular type may have a detrimental effect on code generation (for
example, writing a 'for' loop using a uint8 as the index may mean that the
compiler does lots of numerical manipulation to ensure the index does not
exceed 8 bits. Using a natural word means cleaner, smaller code)

... But even then, I'm not an expert - there are people I work with who know
*far* more about C than is healthy ;-)

john..

--
http://www.iwari.com/
http://www.minimism.com/
---


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the Bf-committers mailing list