From 2b9eca8724fe6c5e0f6a4438cd398b5978283131 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 11 May 2023 12:48:42 -0700 Subject: modules/*: remove use of static default setups There was a time when it made sense for context creates needing setups but not receiving them to still be functional with some sane defaults. But with recursive settings, we really shouldn't ever have orphaned nested module uses unreachable by a proper setup. So let's just get rid of this fallback, and exclusively rely on the baked setups provided by the .setup() methods. They still have preferred defaults, and the proper setup production machinery is what should be responsible for applying those at runtime where they may also be overridden or otherwise influenced. --- src/modules/moire/moire.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/modules/moire') diff --git a/src/modules/moire/moire.c b/src/modules/moire/moire.c index f7d0f3b..27d48d9 100644 --- a/src/modules/moire/moire.c +++ b/src/modules/moire/moire.c @@ -42,18 +42,10 @@ typedef struct moire_context_t { moire_center_t centers[]; } moire_context_t; -static moire_setup_t moire_default_setup = { - .n_centers = MOIRE_DEFAULT_CENTERS, -}; - - static til_module_context_t * moire_create_context(const til_module_t *module, til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup) { moire_context_t *ctxt; - if (!setup) - setup = &moire_default_setup.til_setup; - ctxt = til_module_context_new(module, sizeof(moire_context_t) + ((moire_setup_t *)setup)->n_centers * sizeof(moire_center_t), stream, seed, ticks, n_cpus, path); if (!ctxt) return NULL; -- cgit v1.2.3