Changeset 547fa39 in mainline


Ignore:
Timestamp:
2007-04-06T10:22:27Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c0cf640
Parents:
31d8e10
Message:

add zetta (sextillion) prefix
make constants explicitly unsigned

File:
1 edited

Legend:

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

    r31d8e10 r547fa39  
    224224void order(const uint64_t val, uint64_t *rv, char *suffix)
    225225{
    226         if (val > 1000000000000000000LL) {
    227                 *rv = val / 1000000000000000LL;
     226        if (val > 10000000000000000000ULL) {
     227                *rv = val / 1000000000000000000ULL;
     228                *suffix = 'Z';
     229        } else if (val > 1000000000000000000ULL) {
     230                *rv = val / 1000000000000000ULL;
    228231                *suffix = 'E';
    229         } else if (val > 1000000000000000LL) {
    230                 *rv = val / 1000000000000LL;
     232        } else if (val > 1000000000000000ULL) {
     233                *rv = val / 1000000000000ULL;
    231234                *suffix = 'T';
    232         } else if (val > 1000000000000LL) {
    233                 *rv = val / 1000000000LL;
     235        } else if (val > 1000000000000ULL) {
     236                *rv = val / 1000000000ULL;
    234237                *suffix = 'G';
    235         } else if (val > 1000000000LL) {
    236                 *rv = val / 1000000LL;
     238        } else if (val > 1000000000ULL) {
     239                *rv = val / 1000000ULL;
    237240                *suffix = 'M';
    238         } else if (val > 1000000LL) {
    239                 *rv = val / 1000LL;
     241        } else if (val > 1000000ULL) {
     242                *rv = val / 1000ULL;
    240243                *suffix = 'k';
    241244        } else {
Note: See TracChangeset for help on using the changeset viewer.