bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (random t) always returns the same number under HP-UX 10.20


From: Andreas Schwab
Subject: Re: (random t) always returns the same number under HP-UX 10.20
Date: 03 Dec 2001 16:32:59 +0100
User-agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.1.30

Klaus Zeitler <kzeitler@lucent.com> writes:

|> (random t) always returns the same number when I call it
|> right after starting emacs -q. According to the docu this call should set a
|> random seed from the current time and pid.
|> It works fine on my Linux PC, but under HP-UX 10.20 I always get the same
|> number.

Could you please try this patch if it helps:

2001-12-03  Andreas Schwab  <schwab@suse.de>

        * fns.c (Frandom): Cast argument of seed_random to the expected
        type.

--- src/fns.c.~1.303.~  Wed Nov 14 09:47:07 2001
+++ src/fns.c   Mon Dec  3 16:26:41 2001
@@ -95,7 +95,7 @@
   unsigned long denominator;
 
   if (EQ (n, Qt))
-    seed_random (getpid () + time (NULL));
+    seed_random ((long) (getpid () + time (NULL)));
   if (NATNUMP (n) && XFASTINT (n) != 0)
     {
       /* Try to take our random number from the higher bits of VAL,

Andreas.

-- 
Andreas Schwab                                  "And now for something
Andreas.Schwab@suse.de                          completely different."
SuSE Labs, SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5



reply via email to

[Prev in Thread] Current Thread [Next in Thread]