summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-05-26 17:21:35 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-05-26 18:09:39 -0700
commitb9123bbb0b09cb0b30dd0a08f48caecfbb15f9c2 (patch)
treefdab316fa99edfae3007b5fb9d1388c90502f896
parent12a4ecfbf413777c3ef98719e6b41993a9618903 (diff)
til: more setup desc handling fixups
7ff8ef94 switched things to always describe relevant settings, but left some loose ends. Obvious fixups for those
-rw-r--r--src/til.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/til.c b/src/til.c
index fad9383..3b51e24 100644
--- a/src/til.c
+++ b/src/til.c
@@ -272,7 +272,7 @@ int til_module_setup(const til_settings_t *settings, til_setting_t **res_setting
const char *name;
name = til_settings_get_value_by_idx(settings, 0, &setting);
- if (!name) {
+ if (!name || !setting->desc) {
const char *values[nelems(modules) + 1] = {};
const char *annotations[nelems(modules) + 1] = {};
til_setting_desc_t *desc;
@@ -331,13 +331,13 @@ int til_module_randomize_setup(const til_module_t *module, unsigned seed, til_se
return 0;
/* FIXME TODO:
- * This seems wrong for two reasons:
- * 1. There's no parent settings to attach this to, and there really shouldn't be such
+ * this seems wrong for two reasons:
+ * 1. there's no parent settings to attach this to, and there really shouldn't be such
* orphaned settings instances as we're supposed ot be able to influence their values
* externally via settings. At the very least this seems like it should be part of a
* heirarchy somewhere... which leads to #2
*
- * 2. Not only does lacking a parent suggest a problem, but there should be an incoming
+ * 2. not only does lacking a parent suggests a problem, but there should be an incoming
* settings instance to randomize which may contain some values already set which we
* would skip randomizing. The settings don't currently have any kind of attributes or
* other state to indicate which ones should always be randomized vs. ones which were
@@ -388,6 +388,8 @@ int til_module_randomize_setup(const til_module_t *module, unsigned seed, til_se
if (!setting->value_as_nested_settings)
return -ENOMEM;
}
+
+ setting->desc = desc;
}
if (res_arg) {
© All Rights Reserved