summaryrefslogtreecommitdiff
path: root/src/modules/rkt
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-06-01 13:12:10 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-06-01 14:21:23 -0700
commit794dffe1c0bfadbc8fdaa802899829341741fc7c (patch)
treed9795cb666d993228eaad323a39311ec84de200f /src/modules/rkt
parentb0eeeb5fc5785852ecbcbf7a87e33f30d99ad8b8 (diff)
modules/rkt: use local variable for rkt_setup_t*
Mechanical change removing some rkt_setup_t* casting verbosity in rkt_create_context()
Diffstat (limited to 'src/modules/rkt')
-rw-r--r--src/modules/rkt/rkt.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modules/rkt/rkt.c b/src/modules/rkt/rkt.c
index 23e2e71..1022119 100644
--- a/src/modules/rkt/rkt.c
+++ b/src/modules/rkt/rkt.c
@@ -71,10 +71,11 @@ static const struct sync_track * sync_get_trackf(struct sync_device *device, con
static til_module_context_t * rkt_create_context(const til_module_t *module, til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
{
- rkt_context_t *ctxt;
+ rkt_setup_t *s = (rkt_setup_t *)setup;
const til_module_t *seq_module;
+ rkt_context_t *ctxt;
- seq_module = til_lookup_module(((rkt_setup_t *)setup)->seq_module_name);
+ seq_module = til_lookup_module(s->seq_module_name);
if (!seq_module)
return NULL;
@@ -82,13 +83,13 @@ static til_module_context_t * rkt_create_context(const til_module_t *module, til
if (!ctxt)
return NULL;
- ctxt->sync_device = sync_create_device(((rkt_setup_t *)setup)->base);
+ ctxt->sync_device = sync_create_device(s->base);
if (!ctxt->sync_device)
return til_module_context_free(&ctxt->til_module_context);
- if (((rkt_setup_t *)setup)->connect) {
+ if (s->connect) {
/* XXX: it'd be better if we just reconnected periodically instead of hard failing */
- if (sync_tcp_connect(ctxt->sync_device, ((rkt_setup_t *)setup)->host, ((rkt_setup_t *)setup)->port))
+ if (sync_tcp_connect(ctxt->sync_device, s->host, s->port))
return til_module_context_free(&ctxt->til_module_context);
}
@@ -103,7 +104,7 @@ static til_module_context_t * rkt_create_context(const til_module_t *module, til
til_setup_free(module_setup);
}
- ctxt->rows_per_ms = ((rkt_setup_t *)setup)->rows_per_ms;
+ ctxt->rows_per_ms = s->rows_per_ms;
ctxt->last_ticks = ticks;
return &ctxt->til_module_context;
© All Rights Reserved