As Jörgen Birkler wrote:
> Can it be automated by the compiler?
>
> I'm thinking something like:
>
> inline itoa(int i,char* p,int base)
> {
> if (some_magic_gcc_macro_is_constant_parameter(base))
> {
> if (base==2)
> {
> itoa_base2(i,p);
> }
> else if (base == 10)
> {
> itoa_base10(i,p);
> }
> }
> else {
> itoa_full(i,p);
> }
> }
I'll keep that idea in mind. It might really be possible to do it,
but of course, this will all fail (and then pull in the full and slow
version) if the base value is not a compile-time constant even in
situations where base is one out of {2, 8, 10, 16}, so the fast
version would be sufficient.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list