From b38db01c835fa222aa11ace3a2d84095fe2c3f83 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 20 Jul 2022 21:06:31 -0700 Subject: modules/sparkler: s/rand/rand_r/ and wire up seed This is a little contorted but not too bad. The input to particles_new() is just a const conf struct, so instead of passing in the seed value for particles_t to contain, a pointer to where the seed lives is passed in via the conf. This requires the caller to persist a seed somewhere outside the particles instance, but at least in rototiller we already have that conveniently in til_module_context_t. --- src/modules/sparkler/particles.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/modules/sparkler/particles.h') diff --git a/src/modules/sparkler/particles.h b/src/modules/sparkler/particles.h index 1cb737f..a419e2c 100644 --- a/src/modules/sparkler/particles.h +++ b/src/modules/sparkler/particles.h @@ -12,6 +12,7 @@ typedef struct particles_conf_t { unsigned show_bsp_matches:1; unsigned show_bsp_matches_affected_only:1; unsigned show_bsp_leafs_min_depth; + unsigned *seedp; } particles_conf_t; typedef struct particles_t particles_t; -- cgit v1.2.1