[PATCH] unify itoa

Michael S. Zick mszick at morethan.org
Sat Jul 8 19:40:14 UTC 2006


On Sat July 8 2006 13:42, Denis Vlasenko wrote:
> On Saturday 08 July 2006 19:45, Rob Landley wrote:
> > On Saturday 08 July 2006 12:44 pm, Denis Vlasenko wrote:
> 
> > (What's max_unsigned_power10() doing,  
> > anyway, and is that really a sane way to do whatever it is?)
> 
> It calculates maximum power-of-10 which fits in unsigned int.
> It does that at compile time, portably. That's why it looks funny.
> 
> gcc optimizes it out to simple 1000000000 constant
> (if sizeof(unsigned)==4, that is).
> 

Unless you are supporting multiple brands of compilers, it
optimizes out to a simple constant before you write the code.

Mike



More information about the busybox mailing list