From b68ec04f86f83ba3d7926ffafc1d8a6456e72c05 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 20 Jul 2022 18:01:21 -0700 Subject: modules/drizzle: switch to rand_r w/local seed More obvious migrations to using the supplied seed --- src/modules/drizzle/drizzle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/drizzle/drizzle.c b/src/modules/drizzle/drizzle.c index 76531e8..ec97d16 100644 --- a/src/modules/drizzle/drizzle.c +++ b/src/modules/drizzle/drizzle.c @@ -113,8 +113,8 @@ static void drizzle_prepare_frame(til_module_context_t *context, unsigned ticks, *res_frame_plan = (til_frame_plan_t){ .fragmenter = til_fragmenter_slice_per_cpu }; for (int i = 0; i < DRIZZLE_CNT; i++) { - int x = rand() % (PUDDLE_SIZE - 1); - int y = rand() % (PUDDLE_SIZE - 1); + int x = rand_r(&ctxt->til_module_context.seed) % (PUDDLE_SIZE - 1); + int y = rand_r(&ctxt->til_module_context.seed) % (PUDDLE_SIZE - 1); /* TODO: puddle should probably offer a normalized way of setting an * area to a value, so if PUDDLE_SIZE changes this automatically -- cgit v1.2.1