diff options
author | Jim Meyering <jim@meyering.net> | 2005-03-25 20:58:57 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-03-25 20:58:57 +0000 |
commit | c7f57f17503aa5d54c4a5023b390cabbe45a07bd (patch) | |
tree | df0347f3b9929ef71c4f63242240856130cc7c79 /src/system.h | |
parent | 65118a92261941185dbefd5f1377bb1e53f45f6e (diff) | |
download | coreutils-c7f57f17503aa5d54c4a5023b390cabbe45a07bd.tar.xz |
(DECIMAL_DIGIT_ACCUMULATE): Reverse the sense of
the return value, and update callers:
Diffstat (limited to 'src/system.h')
-rw-r--r-- | src/system.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/system.h b/src/system.h index 863c7b8ff..27122e0ac 100644 --- a/src/system.h +++ b/src/system.h @@ -827,17 +827,15 @@ ptr_align (void *ptr, size_t alignment) #endif /* If 10*Accum+Digit_val is larger than Type_max, then don't update Accum - and return nonzero. Otherwise, set Accum to that new value and - return zero. With a compiler that provides the __typeof__ operator, - perform a compile-time check to verify that the specified Type_max - value is the same as the constant derived from the type of Accum. */ + and return zero to indicate it would overflow. Otherwise, set Accum to + that new value and return nonzero. With a compiler that provides the + __typeof__ operator, perform a compile-time check to verify that the + specified Type_max value is the same as the constant derived from the + type of Accum. */ #define DECIMAL_DIGIT_ACCUMULATE(Accum, Digit_val, Type_max) \ ( \ /* Ensure that Type_max is the maximum value of Accum. */ \ VERIFY_W_TYPEOF (TYPE_MAXIMUM (__typeof__ (Accum)) == (Type_max)), \ - /* If the result would overflow, return 1. \ - Otherwise update Accum and return 0. */ \ ((Type_max) / 10 < Accum || Accum * 10 + (Digit_val) < Accum \ - ? 1 \ - : ((Accum = Accum * 10 + (Digit_val)), 0)) \ + ? 0 : ((Accum = Accum * 10 + (Digit_val)), 1)) \ ) |