Mercurial > emacs
changeset 8901:ab65a3dae221
(Frandom): Fix Lisp_Object vs. int problems.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Mon, 19 Sep 1994 00:15:08 +0000 |
parents | 3c6b5ba4d559 |
children | 80ac0db9a77a |
files | src/fns.c |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fns.c Mon Sep 19 00:14:49 1994 +0000 +++ b/src/fns.c Mon Sep 19 00:15:08 1994 +0000 @@ -32,6 +32,8 @@ #include "keyboard.h" #include "intervals.h" +extern Lisp_Object Flookup_key (); + Lisp_Object Qstring_lessp, Qprovide, Qrequire; Lisp_Object Qyes_or_no_p_history; @@ -64,9 +66,9 @@ srandom (getpid () + time (0)); if (XTYPE (limit) == Lisp_Int && XINT (limit) > 0) { - if (XINT (limit) >= 0x40000000) + if (XFASTINT (limit) >= 0x40000000) /* This case may occur on 64-bit machines. */ - val = random () % XINT (limit); + val = random () % XFASTINT (limit); else { /* Try to take our random number from the higher bits of VAL, @@ -79,7 +81,7 @@ denominator = (unsigned long)0x40000000 / XFASTINT (limit); do val = (random () & 0x3fffffff) / denominator; - while (val >= limit); + while (val >= XFASTINT (limit)); } } else