[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & cowith bas
From: |
Joerg Wunsch |
Subject: |
Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & cowith base != {2, 8, 10, 16}? |
Date: |
Sat, 19 Nov 2005 20:19:39 +0100 |
User-agent: |
Mutt/1.4.2.1i |
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-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, (continued)
- Message not available
- [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Joerg Wunsch, 2005/11/19
- Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Russell Shaw, 2005/11/19
- Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Daniel O'Connor, 2005/11/19
- Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Russell Shaw, 2005/11/19
- Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Daniel O'Connor, 2005/11/19
- Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Russell Shaw, 2005/11/19
- Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Joerg Wunsch, 2005/11/19
- Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Rolf Ebert, 2005/11/19
- Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Joerg Wunsch, 2005/11/19
- Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & cowith base != {2, 8, 10, 16}?, Jörgen Birkler, 2005/11/19
- Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & cowith base != {2, 8, 10, 16}?,
Joerg Wunsch <=
- [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Anton Erasmus, 2005/11/19
[avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Rolf Ebert, 2005/11/19
[avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Bernard Fouché, 2005/11/22
- Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Colin O'Flynn, 2005/11/22
- [avr-libc-dev] RE: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Nigel Winterbottom, 2005/11/22
- Re: [avr-libc-dev] RE: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Dmitry K., 2005/11/22
- Re: [avr-libc-dev] RE: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Derric Tubbs, 2005/11/23
- Re: [avr-libc-dev] RE: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Alexei Chetroi, 2005/11/23
- Re: [avr-libc-dev] RE: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Joerg Wunsch, 2005/11/23
- Re: [avr-libc-dev] RE: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?, Bjarne Laursen, 2005/11/23
- Prev by Date:
Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?
- Next by Date:
Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?
- Previous by thread:
Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & cowith base != {2, 8, 10, 16}?
- Next by thread:
[avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & co with base != {2, 8, 10, 16}?
- Index(es):