summaryrefslogtreecommitdiff
path: root/src/context.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/context.c
parent7e0ae4b4d5bfcebd7bf4cefcefe681ea7ecc5f61 (diff)
downloadxorg-lib-libxkbcommon-9e801ff782c592d89273939c1d84d8c62674f57e.tar.gz
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/context.c')
-rw-r--r--src/context.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/context.c b/src/context.c
index 923060e..25a727c 100644
--- a/src/context.c
+++ b/src/context.c
@@ -335,9 +335,9 @@ xkb_atom_lookup(struct xkb_context *ctx, const char *string)
}
xkb_atom_t
-xkb_atom_intern(struct xkb_context *ctx, const char *string)
+xkb_atom_intern(struct xkb_context *ctx, const char *string, size_t len)
{
- return atom_intern(ctx->atom_table, string, strlen(string), false);
+ return atom_intern(ctx->atom_table, string, len, false);
}
xkb_atom_t