summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-10-03 12:12:14 +0000
committerJim Meyering <jim@meyering.net>2005-10-03 12:12:14 +0000
commitc7676c0b6b69d099c6880afb699593665d28fc96 (patch)
tree80d2dace8d1a99c6c90bac6c049dbc75ff0759ed
parent314397e7c506711e56615ae9a9d3c50d2e070197 (diff)
downloadcoreutils-c7676c0b6b69d099c6880afb699593665d28fc96.tar.xz
(MAX_N_FACTORS): Define in terms of sizeof (uintmax_t)
rather than hard-coding to 128. From Thomas M.Ott.
-rw-r--r--src/factor.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/factor.c b/src/factor.c
index 6578a7782..dc8f1cc87 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