rules: reformat GetComponents Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
diff --git a/src/xkbcomp/rules.c b/src/xkbcomp/rules.c
index 46fd755..ce211f9 100644
--- a/src/xkbcomp/rules.c
+++ b/src/xkbcomp/rules.c
@@ -1021,35 +1021,34 @@ substitute_vars(char *name, struct multi_defs *mdefs)
/***====================================================================***/
static bool
-XkbcRF_GetComponents(struct rules *rules, struct var_defs *defs,
- struct xkb_component_names *names)
+get_components(struct rules *rules, struct var_defs *defs,
+ struct xkb_component_names *kccgst)
{
struct multi_defs mdefs;
make_multi_defs(&mdefs, defs);
- memset(names, 0, sizeof(struct xkb_component_names));
clear_partial_matches(rules);
- apply_matching_rules(rules, &mdefs, names, RULE_FLAG_NORMAL);
- apply_partial_matches(rules, names);
+ apply_matching_rules(rules, &mdefs, kccgst, RULE_FLAG_NORMAL);
+ apply_partial_matches(rules, kccgst);
- apply_matching_rules(rules, &mdefs, names, RULE_FLAG_APPEND);
- apply_partial_matches(rules, names);
+ apply_matching_rules(rules, &mdefs, kccgst, RULE_FLAG_APPEND);
+ apply_partial_matches(rules, kccgst);
- apply_matching_rules(rules, &mdefs, names, RULE_FLAG_OPTION);
- apply_partial_matches(rules, names);
+ apply_matching_rules(rules, &mdefs, kccgst, RULE_FLAG_OPTION);
+ apply_partial_matches(rules, kccgst);
- names->keycodes = substitute_vars(names->keycodes, &mdefs);
- names->symbols = substitute_vars(names->symbols, &mdefs);
- names->types = substitute_vars(names->types, &mdefs);
- names->compat = substitute_vars(names->compat, &mdefs);
- names->keymap = substitute_vars(names->keymap, &mdefs);
+ kccgst->keycodes = substitute_vars(kccgst->keycodes, &mdefs);
+ kccgst->symbols = substitute_vars(kccgst->symbols, &mdefs);
+ kccgst->types = substitute_vars(kccgst->types, &mdefs);
+ kccgst->compat = substitute_vars(kccgst->compat, &mdefs);
+ kccgst->keymap = substitute_vars(kccgst->keymap, &mdefs);
free_multi_defs(&mdefs);
- return (names->keycodes && names->symbols && names->types &&
- names->compat) || names->keymap;
+ return (kccgst->keycodes && kccgst->symbols && kccgst->types &&
+ kccgst->compat) || kccgst->keymap;
}
static struct rule *
@@ -1221,7 +1220,7 @@ xkb_components_from_rules(struct xkb_context *ctx,
goto unwind_file;
}
- if (!XkbcRF_GetComponents(loaded, &defs, names)) {
+ if (!get_components(loaded, &defs, names)) {
free(names->keymap);
free(names->keycodes);
free(names->types);