summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-07-18 01:05:01 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-07-18 01:06:05 -0700
commitcbeb9d829b025428d910956f3d6208e7886582cd (patch)
tree303d6784dcb058f03c7d1bb339c21c1c62a393cc /src/modules
parentaf21b876efde47274a36d8a13d2c7503034227d0 (diff)
modules/rtv: s/rand/rand_r/
just fixing up some vestigial rand() invocations to use the seed
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/rtv/rtv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c
index 9714368..c90a824 100644
--- a/src/modules/rtv/rtv.c
+++ b/src/modules/rtv/rtv.c
@@ -106,7 +106,7 @@ static int cmp_channels(const void *p1, const void *p2)
static void randomize_channels(rtv_context_t *ctxt)
{
for (size_t i = 0; i < ctxt->n_channels; i++)
- ctxt->channels[i].order = rand();
+ ctxt->channels[i].order = rand_r(&ctxt->til_module_context.seed);
qsort(ctxt->channels, ctxt->n_channels, sizeof(rtv_channel_t), cmp_channels);
}
@@ -188,7 +188,7 @@ static void setup_next_channel(rtv_context_t *ctxt, unsigned ticks)
}
if (!ctxt->channel->module_ctxt)
- (void) til_module_create_context(ctxt->channel->module, rand(), ticks, 0, ctxt->channel->module_setup, &ctxt->channel->module_ctxt);
+ (void) til_module_create_context(ctxt->channel->module, rand_r(&ctxt->til_module_context.seed), ticks, 0, ctxt->channel->module_setup, &ctxt->channel->module_ctxt);
ctxt->channel->last_on_time = now;
}
© All Rights Reserved