diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-08-30 22:21:28 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-08-30 22:21:28 -0700 |
commit | bd40a232bb3d7279b70e8ebfa118053964211a83 (patch) | |
tree | 17946cffe362eb1f9c90fa72ffefcab60ee6986f | |
parent | 1edd1423f5f1cc690562b0f280c61f1a92a357ac (diff) |
modules/compose: switch to til_settings_get_and_describe_setting()
compose_setup() doesn't have any res_setup baking -EINVAL error
paths, but still transition over to enable potentially
deprecating the value-oriented variant.
What error paths it does have during res_setup baking is nested
in the underlying tile's module setup, and that should be
propagating up any -EINVAL failures with the res_setting already
populated.
-rw-r--r-- | src/modules/compose/compose.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/compose/compose.c b/src/modules/compose/compose.c index 9eb46e4..d4835cc 100644 --- a/src/modules/compose/compose.c +++ b/src/modules/compose/compose.c @@ -266,8 +266,8 @@ static int compose_texture_module_setup(const til_settings_t *settings, til_sett static int compose_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup) { const til_settings_t *layers_settings, *texture_settings; - const char *layers; - const char *texture; + til_setting_t *layers; + til_setting_t *texture; const char *texture_values[] = { "none", "blinds", @@ -285,7 +285,7 @@ static int compose_setup(const til_settings_t *settings, til_setting_t **res_set }; int r; - r = til_settings_get_and_describe_value(settings, + r = til_settings_get_and_describe_setting(settings, &(til_setting_spec_t){ .name = "Comma-separated list of module layers, in draw-order", .key = "layers", @@ -301,8 +301,8 @@ static int compose_setup(const til_settings_t *settings, til_setting_t **res_set if (r) return r; - assert(res_setting && *res_setting && (*res_setting)->value_as_nested_settings); - layers_settings = (*res_setting)->value_as_nested_settings; + layers_settings = layers->value_as_nested_settings; + assert(layers_settings); { til_setting_t *layer_setting; @@ -339,7 +339,7 @@ static int compose_setup(const til_settings_t *settings, til_setting_t **res_set } } - r = til_settings_get_and_describe_value(settings, + r = til_settings_get_and_describe_setting(settings, &(til_setting_spec_t){ .name = "Module to use for source texture, \"none\" to disable", .key = "texture", @@ -366,9 +366,9 @@ static int compose_setup(const til_settings_t *settings, til_setting_t **res_set return r; if (res_setup) { /* turn layers settings into an array of compose_setup_layer_t's {name,til_setup_t} */ - size_t n_layers = til_settings_get_count(layers_settings); - til_setting_t *layer_setting; - compose_setup_t *setup; + size_t n_layers = til_settings_get_count(layers_settings); + til_setting_t *layer_setting; + compose_setup_t *setup; setup = til_setup_new(settings, sizeof(*setup) + n_layers * sizeof(*setup->layers), compose_setup_free, &compose_module); if (!setup) |