kernels/linux-2.4.0/drivers/isdn/eicon/kprintf.c
/*
 * convert a number to decimal ASCII
 */
convert a number to decimal ASCII
convert a number to decimal ASCII
static
void    do_decimal( char            *temp,
                    int             temp_len,
                    unsigned int    value,
                    char            *s)
{
    int     i;
    temp[0] = '\0';
    for (i = 1; i < temp_len; i++)
    {
        temp[i] = (char) ((value % 10) + (int) '0');
        value /= 10;
    }
    for (i = (temp_len - 1); temp[i] == '0'; i--)
    {
        ;
    }
    if (i == 0)
    {
        i++;
    }
    while (i >= 0)
    {
        *s++ = temp[i--];
    }
    return;
}
static void do_decimal ( char * temp , int temp_len , unsigned int value , char * s ) { int i ; temp [ 0 ] = ' \0 ' ; for ( i = 1 ; i < temp_len ; i ++ ) { temp [ i ] = ( char ) ( ( value % 10 ) + ( int ) ' ' ) ; value /= 10 ; } for ( i = ( temp_len - 1 ) ; temp [ i ] == ' ' ; i -- ) { ; } if ( i == 0 ) { i ++ ; } while ( i >= 0 ) { * s ++ = temp [ i -- ] ; } return ; }
convert a number to decimal ASCII
convert a number to decimal ASCII