aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-01-08 09:08:24 +0000
committerRichard M. Stallman1993-01-08 09:08:24 +0000
commitce7385cb6092f7195515be8cd0d8a52e9d2534ee (patch)
tree3e14b8b7fa37489d13e1620d3a76a8c6841efab5 /src
parentf3bca33c572f2eaae370e958dc1fce7898791e39 (diff)
downloademacs-ce7385cb6092f7195515be8cd0d8a52e9d2534ee.tar.gz
emacs-ce7385cb6092f7195515be8cd0d8a52e9d2534ee.zip
(Frandom): Change arg name.
Diffstat (limited to 'src')
-rw-r--r--src/fns.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fns.c b/src/fns.c
index 6eb97d4683a..144d6ef345e 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -49,27 +49,27 @@ On most systems all integers representable in Lisp are equally likely.\n\
49 This is 24 bits' worth.\n\ 49 This is 24 bits' worth.\n\
50With argument N, return random number in interval [0,N).\n\ 50With argument N, return random number in interval [0,N).\n\
51With argument t, set the random number seed from the current time and pid.") 51With argument t, set the random number seed from the current time and pid.")
52 (arg) 52 (limit)
53 Lisp_Object arg; 53 Lisp_Object limit;
54{ 54{
55 int val; 55 int val;
56 extern long random (); 56 extern long random ();
57 extern srandom (); 57 extern srandom ();
58 extern long time (); 58 extern long time ();
59 59
60 if (EQ (arg, Qt)) 60 if (EQ (limit, Qt))
61 srandom (getpid () + time (0)); 61 srandom (getpid () + time (0));
62 val = random (); 62 val = random ();
63 if (XTYPE (arg) == Lisp_Int && XINT (arg) != 0) 63 if (XTYPE (limit) == Lisp_Int && XINT (limit) != 0)
64 { 64 {
65 /* Try to take our random number from the higher bits of VAL, 65 /* Try to take our random number from the higher bits of VAL,
66 not the lower, since (says Gentzel) the low bits of `random' 66 not the lower, since (says Gentzel) the low bits of `random'
67 are less random than the higher ones. */ 67 are less random than the higher ones. */
68 val &= 0xfffffff; /* Ensure positive. */ 68 val &= 0xfffffff; /* Ensure positive. */
69 val >>= 5; 69 val >>= 5;
70 if (XINT (arg) < 10000) 70 if (XINT (limit) < 10000)
71 val >>= 6; 71 val >>= 6;
72 val %= XINT (arg); 72 val %= XINT (limit);
73 } 73 }
74 return make_number (val); 74 return make_number (val);
75} 75}