From fa87cdb8bdbfd24a7eed476253a9c6acf13452cd Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 7 Feb 2014 19:39:42 +0200 Subject: darray: cleanup We have quite diverged from the upstream file, so let's make it at least easier to look at. Remove some unused macros and rename some for consistency. Signed-off-by: Ran Benita --- src/keymap-priv.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/keymap-priv.c') diff --git a/src/keymap-priv.c b/src/keymap-priv.c index 9f42040..2b3f8cd 100644 --- a/src/keymap-priv.c +++ b/src/keymap-priv.c @@ -30,12 +30,7 @@ static void update_builtin_keymap_fields(struct xkb_keymap *keymap) { struct xkb_context *ctx = keymap->ctx; - - /* - * Add predefined (AKA real, core, X11) modifiers. - * The order is important! - */ - darray_appends_t(keymap->mods, struct xkb_mod, + const struct xkb_mod builtin_mods[] = { { .name = xkb_atom_intern_literal(ctx, "Shift"), .type = MOD_REAL }, { .name = xkb_atom_intern_literal(ctx, "Lock"), .type = MOD_REAL }, { .name = xkb_atom_intern_literal(ctx, "Control"), .type = MOD_REAL }, @@ -43,7 +38,14 @@ update_builtin_keymap_fields(struct xkb_keymap *keymap) { .name = xkb_atom_intern_literal(ctx, "Mod2"), .type = MOD_REAL }, { .name = xkb_atom_intern_literal(ctx, "Mod3"), .type = MOD_REAL }, { .name = xkb_atom_intern_literal(ctx, "Mod4"), .type = MOD_REAL }, - { .name = xkb_atom_intern_literal(ctx, "Mod5"), .type = MOD_REAL }); + { .name = xkb_atom_intern_literal(ctx, "Mod5"), .type = MOD_REAL }, + }; + + /* + * Add predefined (AKA real, core, X11) modifiers. + * The order is important! + */ + darray_append_items(keymap->mods, builtin_mods, ARRAY_SIZE(builtin_mods)); } struct xkb_keymap * -- cgit v1.2.1