comparison src/fns.c @ 5934:e2fae7783046 cygwin

lots of use of EMACS_INT, a few others, to eliminate all pointer truncation warnings
author Henry Thompson <ht@markup.co.uk>
date Sat, 12 Dec 2015 19:08:46 +0000
parents 1a507c4c6c42
children d5eb0914ca1f
comparison
equal deleted inserted replaced
5933:c1e8f3294298 5934:e2fae7783046
96 are less random than the higher ones. We do this by using the 96 are less random than the higher ones. We do this by using the
97 quotient rather than the remainder. At the high end of the RNG 97 quotient rather than the remainder. At the high end of the RNG
98 it's possible to get a quotient larger than limit; discarding 98 it's possible to get a quotient larger than limit; discarding
99 these values eliminates the bias that would otherwise appear 99 these values eliminates the bias that would otherwise appear
100 when using a large limit. */ 100 when using a large limit. */
101 denominator = ((unsigned long)1 << FIXNUM_VALBITS) / XFIXNUM (limit); 101 denominator = ((EMACS_UINT)1 << FIXNUM_VALBITS) / XFIXNUM (limit);
102 do 102 do
103 val = get_random () / denominator; 103 val = get_random () / denominator;
104 while (val >= XFIXNUM (limit)); 104 while (val >= XFIXNUM (limit));
105 } 105 }
106 else 106 else