summaryrefslogtreecommitdiff
path: root/src/xkbcomp/keymap.c
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2013-07-21 17:01:20 +0300
committerRan Benita <ran234@gmail.com>2013-07-21 17:07:41 +0300
commit9e801ff782c592d89273939c1d84d8c62674f57e (patch)
tree94ada4502442fabfc8c07042dddae97e76132a58 /src/xkbcomp/keymap.c
parent7e0ae4b4d5bfcebd7bf4cefcefe681ea7ecc5f61 (diff)
downloadlibxkbcommon-9e801ff782c592d89273939c1d84d8c62674f57e.tar.gz
libxkbcommon-9e801ff782c592d89273939c1d84d8c62674f57e.tar.bz2
libxkbcommon-9e801ff782c592d89273939c1d84d8c62674f57e.zip
ctx: adapt to the len-aware atom functions
xkb_atom_intern now takes a len parameter. Turns out though that almost all of our xkb_atom_intern calls are called on string literals, the length of which we know statically. So we add a macro to micro-optimize this case. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/xkbcomp/keymap.c')
-rw-r--r--src/xkbcomp/keymap.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c
index 320216e..d9dd0f6 100644
--- a/src/xkbcomp/keymap.c
+++ b/src/xkbcomp/keymap.c
@@ -235,14 +235,14 @@ UpdateBuiltinKeymapFields(struct xkb_keymap *keymap)
* The order is important!
*/
darray_appends_t(keymap->mods, struct xkb_mod,
- { .name = xkb_atom_intern(ctx, "Shift"), .type = MOD_REAL },
- { .name = xkb_atom_intern(ctx, "Lock"), .type = MOD_REAL },
- { .name = xkb_atom_intern(ctx, "Control"), .type = MOD_REAL },
- { .name = xkb_atom_intern(ctx, "Mod1"), .type = MOD_REAL },
- { .name = xkb_atom_intern(ctx, "Mod2"), .type = MOD_REAL },
- { .name = xkb_atom_intern(ctx, "Mod3"), .type = MOD_REAL },
- { .name = xkb_atom_intern(ctx, "Mod4"), .type = MOD_REAL },
- { .name = xkb_atom_intern(ctx, "Mod5"), .type = MOD_REAL });
+ { .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 },
+ { .name = xkb_atom_intern_literal(ctx, "Mod1"), .type = MOD_REAL },
+ { .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 });
return true;
}