summaryrefslogtreecommitdiff
path: root/src/keymap-priv.c
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2014-02-07 19:39:42 +0200
committerRan Benita <ran234@gmail.com>2014-02-08 00:10:56 +0200
commitfa87cdb8bdbfd24a7eed476253a9c6acf13452cd (patch)
tree9b24e8f2ba954a9f49ca46ba48efe300401c91fd /src/keymap-priv.c
parent6f2df7df8c5db6271d11df0b72457bad350b4fa3 (diff)
downloadxorg-lib-libxkbcommon-fa87cdb8bdbfd24a7eed476253a9c6acf13452cd.tar.gz
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 <ran234@gmail.com>
Diffstat (limited to 'src/keymap-priv.c')
-rw-r--r--src/keymap-priv.c16
1 files changed, 9 insertions, 7 deletions
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 *