Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset e535eeb in mainline for kernel/generic/src/lib/func.c


Ignore:
Timestamp:
2010-04-18T12:28:19Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
dec16a2
Parents:
e1b6742
Message:

rename order() to order_suffix(), make it a generic libc string function in user space

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/lib/func.c

    re1b6742 re535eeb  
    123123}
    124124
    125 
    126 void order(const uint64_t val, uint64_t *rv, char *suffix)
    127 {
    128         if (val > 10000000000000000000ULL) {
    129                 *rv = val / 1000000000000000000ULL;
    130                 *suffix = 'Z';
    131         } else if (val > 1000000000000000000ULL) {
    132                 *rv = val / 1000000000000000ULL;
    133                 *suffix = 'E';
    134         } else if (val > 1000000000000000ULL) {
    135                 *rv = val / 1000000000000ULL;
    136                 *suffix = 'T';
    137         } else if (val > 1000000000000ULL) {
    138                 *rv = val / 1000000000ULL;
    139                 *suffix = 'G';
    140         } else if (val > 1000000000ULL) {
    141                 *rv = val / 1000000ULL;
    142                 *suffix = 'M';
    143         } else if (val > 1000000ULL) {
    144                 *rv = val / 1000ULL;
    145                 *suffix = 'k';
    146         } else {
    147                 *rv = val;
    148                 *suffix = ' ';
    149         }
    150 }
    151 
    152125/** @}
    153126 */
Note: See TracChangeset for help on using the changeset viewer.