From: Jim Meyering Date: Mon, 3 Oct 2005 12:12:14 +0000 (+0000) Subject: (MAX_N_FACTORS): Define in terms of sizeof (uintmax_t) X-Git-Tag: COREUTILS-5_91~66 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7676c0b6b69d099c6880afb699593665d28fc96;p=platform%2Fupstream%2Fcoreutils.git (MAX_N_FACTORS): Define in terms of sizeof (uintmax_t) rather than hard-coding to 128. From Thomas M.Ott. --- diff --git a/src/factor.c b/src/factor.c index 6578a77..dc8f1cc 100644 --- a/src/factor.c +++ b/src/factor.c @@ -42,9 +42,8 @@ /* Token delimiters when reading from a file. */ #define DELIM "\n\t " -/* FIXME: if this program is ever modified to factor integers larger - than 2^128, this constant (and the algorithm :-) will have to change. */ -#define MAX_N_FACTORS 128 +/* The maximum number of factors, including -1, for negative numbers. */ +#define MAX_N_FACTORS (sizeof (uintmax_t) * CHAR_BIT) /* The trial divisor increment wheel. Use it to skip over divisors that are composites of 2, 3, 5, 7, or 11. The part from WHEEL_START up to