From f0c01470bb714a5ed6225aada602a44a2e7d010d Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 2 Dec 2015 16:43:03 +0000 Subject: [PATCH] Use ULLONG_MAX instead of U_LONG_LONG_MAX. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6219 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/sfrsd2/sfrsd_paper/binomial_subs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sfrsd2/sfrsd_paper/binomial_subs.c b/lib/sfrsd2/sfrsd_paper/binomial_subs.c index 139488b2f..be4a0ae5f 100644 --- a/lib/sfrsd2/sfrsd_paper/binomial_subs.c +++ b/lib/sfrsd2/sfrsd_paper/binomial_subs.c @@ -23,11 +23,11 @@ unsigned long long binomial(unsigned long long n, unsigned long long k) { if (k >= n) return (k == n); if (k > n/2) k = n-k; for (d = 1; d <= k; d++) { - if (r >= ULONG_LONG_MAX/n) { /* Possible overflow */ + if (r >= ULLONG_MAX/n) { /* Possible overflow */ unsigned long long nr, dr; /* reduced numerator / denominator */ g = gcd_ui(n, d); nr = n/g; dr = d/g; g = gcd_ui(r, dr); r = r/g; dr = dr/g; - if (r >= ULONG_LONG_MAX/nr) return 0; /* Unavoidable overflow */ + if (r >= ULLONG_MAX/nr) return 0; /* Unavoidable overflow */ r *= nr; r /= dr; n--;