History log of /seL4-refos-master/libs/libmuslc/src/prng/__rand48_step.c
Revision Date Author Comments
# 05cef96d 22-Sep-2014 Rich Felker <dalias@aerifal.cx>

fix incorrect sequence generation in *rand48 prng functions

patch by Jens Gustedt. this fixes a bug reported by Nadav Har'El. the
underlying issue was that a left-shift by 16 bits after promotion of
unsigned short to int caused integer overflow. while some compilers
define this overflow case as "shifting into the sign bit", doing so
doesn't help; the sign bit then gets extended through the upper bits
in subsequent arithmetic as unsigned long long. this patch imposes a
promotion to unsigned prior to the shift, so that the result is
well-defined and matches the specified behavior.


# 57174444 11-Dec-2013 Szabolcs Nagy <nsz@port70.net>

include cleanups: remove unused headers and add feature test macros


# 0996faa3 08-Jun-2013 Szabolcs Nagy <nsz@port70.net>

prng: make rand_r have 2^32 period instead of 2^31

this is a minor fix to increase the period of the obsolete rand_r a bit.
an include header in __rand48_step.c is fixed as well.


# 0b44a031 11-Feb-2011 Rich Felker <dalias@aerifal.cx>

initial check-in, version 0.5.0