← Back to team overview

kicad-developers team mailing list archive

Re: Converting KiCAD to metric units: The approach


On Mon, 27 Jun 2011, Vladimir Uryvaev wrote:

Wrapping short/int/longs in classes and typedefs is very popular in DSP world, as it very helps in terms of debuggability and portability, and it is already proven its potency.

All the MCU world does it... also DSPs tends to have.. curious datatypes,
like 16-bit chars. That's mean that sizeof char = 1 (by definition),
which means that the sizeof a 16-bit int is 1 too :D I've seen many
programmers stumbling upon this; just because most machines have 8-bit
words (externally at least) doesn't mean that Texas couldn't do
a 16-bit-word DSP. These same people go crazy on (s)harvard
architectures because pointers in data space are completely different
than pointer in code space (and DSP have 2 or more data spaces, too!).
But I digress :P

What *could* be useful is an ADA-like typedef where typedef something
int is *not* an int. This would need a cast to pass to everything which
uses int, which is the reason enums weren't used a lot in pascal:D

Lorenzo Marcantonio
Logos Srl