diff options
| author | Paul Eggert | 2011-07-04 19:51:15 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-07-04 19:51:15 -0700 |
| commit | d8ed26bd07abb23acc9c1879776f5afc44ed4874 (patch) | |
| tree | ab5b8c578e2d209e3d1984a45260f38aa388fada /lib-src | |
| parent | b768cdcd31e941af9a1ddce45da7e1482b494e77 (diff) | |
| download | emacs-d8ed26bd07abb23acc9c1879776f5afc44ed4874.tar.gz emacs-d8ed26bd07abb23acc9c1879776f5afc44ed4874.zip | |
Random fixes. E.g., (random) never returned negative values.
* fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
subseconds part to the entropy, as that's a bit more random.
Prefer signed to unsigned, since the signedness doesn't matter and
in general we prefer signed. When given a limit, use a
denominator equal to INTMASK + 1, not to VALMASK + 1, because the
latter isn't right if USE_2_TAGS_FOR_INTS.
* sysdep.c (get_random): Return a value in the range 0..INTMASK,
not 0..VALMASK. Don't discard "excess" bits that random () returns.
Diffstat (limited to 'lib-src')
0 files changed, 0 insertions, 0 deletions