openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/libnl/1_3.4.0-r0/libnl-3.4.0/lib/utils.c
double nl_cancel_down_bytes(unsigned long long l, char** unit)
{
    if (l >= 1099511627776LL)
    {
        *unit = "TiB";
        return ((double)l) / 1099511627776LL;
    }
    else if (l >= 1073741824)
    {
        *unit = "GiB";
        return ((double)l) / 1073741824;
    }
    else if (l >= 1048576)
    {
        *unit = "MiB";
        return ((double)l) / 1048576;
    }
    else if (l >= 1024)
    {
        *unit = "KiB";
        return ((double)l) / 1024;
    }
    else
    {
        *unit = "B";
        return (double)l;
    }
}
/**
 * Cancel down a byte counter
 * @arg	l		byte counter
 * @arg	unit		destination unit pointer
 *
 * Cancels down a byte counter until it reaches a reasonable
 * unit. The chosen unit is assigned to \a unit.
 * This function assume 1024 bytes in one kilobyte
 *
 * @return The cancelled down byte counter in the new unit.
 */
Cancel down a byte counter
@arg l               byte counter
@arg unit            destination unit pointer

Cancels down a byte counter until it reaches a reasonable
unit. The chosen unit is assigned to \a unit.
This function assume 1024 bytes in one kilobyte

@return The cancelled down byte counter in the new unit.
Cancel down a byte counter @arg l byte counter @arg unit destination unit pointer Cancels down a byte counter until it reaches a reasonable unit . The chosen unit is assigned to \ a unit . This function assume 1024 bytes in one kilobyte @return The cancelled down byte counter in the new unit .
double nl_cancel_down_bytes(unsigned long long l, char** unit)
{
    if (l >= 1099511627776LL)
    {
        *unit = "TiB";
        return ((double)l) / 1099511627776LL;
    }
    else if (l >= 1073741824)
    {
        *unit = "GiB";
        return ((double)l) / 1073741824;
    }
    else if (l >= 1048576)
    {
        *unit = "MiB";
        return ((double)l) / 1048576;
    }
    else if (l >= 1024)
    {
        *unit = "KiB";
        return ((double)l) / 1024;
    }
    else
    {
        *unit = "B";
        return (double)l;
    }
}
double nl_cancel_down_bytes ( unsigned long long l , char * * unit ) { if ( l >= 1099511627776LL ) { * unit = " " ; return ( ( double ) l ) / 1099511627776LL ; } else if ( l >= 1073741824 ) { * unit = " " ; return ( ( double ) l ) / 1073741824 ; } else if ( l >= 1048576 ) { * unit = " " ; return ( ( double ) l ) / 1048576 ; } else if ( l >= 1024 ) { * unit = " " ; return ( ( double ) l ) / 1024 ; } else { * unit = " " ; return ( double ) l ; } }
Cancel down a byte counter
 @arg l               byte counter
 @arg unit            destination unit pointer
Cancel down a byte counter @arg l byte counter @arg unit destination unit pointer