move MT19937 random generator to ddsrt

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-04-03 17:03:17 +02:00 committed by eboasson
parent dd9aceb713
commit 6e87841ea5
13 changed files with 345 additions and 264 deletions

View file

@ -1261,7 +1261,7 @@ static ssize_t nn_xpack_send1 (const nn_locator_t *loc, void * varg)
{
/* We drop APPROXIMATELY a fraction of xmit_lossiness * 10**(-3)
of all packets to be sent */
if ((ddsrt_random () % 1000) < config.xmit_lossiness)
if ((ddsrt_random () % 1000) < (uint32_t) config.xmit_lossiness)
{
DDS_TRACE("(dropped)");
xp->call_flags = 0;