diff options
| author | Karl Heuer | 1995-05-30 03:15:27 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-05-30 03:15:27 +0000 |
| commit | e2d6972aefdd044e150173a3d32ac2904252db8d (patch) | |
| tree | 70203e8cdf280ba6d547094d20f4dade2c4427bc /src/fns.c | |
| parent | 6c6a9be863aafe0507b199e375c0e04208693573 (diff) | |
| download | emacs-e2d6972aefdd044e150173a3d32ac2904252db8d.tar.gz emacs-e2d6972aefdd044e150173a3d32ac2904252db8d.zip | |
(Frandom): Use EMACS_INT, not int.
Use NULL, not 0, as arg of `time'.
Diffstat (limited to 'src/fns.c')
| -rw-r--r-- | src/fns.c | 8 |
1 files changed, 5 insertions, 3 deletions
| @@ -60,11 +60,12 @@ With argument t, set the random number seed from the current time and pid.") | |||
| 60 | (limit) | 60 | (limit) |
| 61 | Lisp_Object limit; | 61 | Lisp_Object limit; |
| 62 | { | 62 | { |
| 63 | int val; | 63 | EMACS_INT val; |
| 64 | Lisp_Object lispy_val; | ||
| 64 | unsigned long denominator; | 65 | unsigned long denominator; |
| 65 | 66 | ||
| 66 | if (EQ (limit, Qt)) | 67 | if (EQ (limit, Qt)) |
| 67 | seed_random (getpid () + time (0)); | 68 | seed_random (getpid () + time (NULL)); |
| 68 | if (NATNUMP (limit) && XFASTINT (limit) != 0) | 69 | if (NATNUMP (limit) && XFASTINT (limit) != 0) |
| 69 | { | 70 | { |
| 70 | /* Try to take our random number from the higher bits of VAL, | 71 | /* Try to take our random number from the higher bits of VAL, |
| @@ -81,7 +82,8 @@ With argument t, set the random number seed from the current time and pid.") | |||
| 81 | } | 82 | } |
| 82 | else | 83 | else |
| 83 | val = get_random (); | 84 | val = get_random (); |
| 84 | return make_number (val); | 85 | XSETINT (lispy_val, val); |
| 86 | return lispy_val; | ||
| 85 | } | 87 | } |
| 86 | 88 | ||
| 87 | /* Random data-structure functions */ | 89 | /* Random data-structure functions */ |