]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r309650:
authored <ed@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 20 Dec 2016 07:50:49 +0000 (07:50 +0000)
committered <ed@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 20 Dec 2016 07:50:49 +0000 (07:50 +0000)
commit8f9d51785dd83b93aa917517850013c9db1362b1
treeed964320fc996e4a42ac14fd762f2c7a7d90b299
parentb964854066864ec6abca556eb5c3b5ad70e85ab6
MFC r309650:

  Properly sign extend the result of jrand48() and mrand48().

  These functions are supposed to return a value between [-2^31, 2^31).
  This doesn't seem to work on 64-bit systems, where we return a value
  between [0, 3^32). Patch up the function to use proper casts to int32_t.
  While there, fix some other style bugs.

git-svn-id: svn://svn.freebsd.org/base/stable/10@310320 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/gen/jrand48.c
lib/libc/gen/mrand48.c