diff options
author | Ran Benita <ran234@gmail.com> | 2013-07-21 17:01:20 +0300 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2013-07-21 17:07:41 +0300 |
commit | 9e801ff782c592d89273939c1d84d8c62674f57e (patch) | |
tree | 94ada4502442fabfc8c07042dddae97e76132a58 /src/xkbcomp/scanner.c | |
parent | 7e0ae4b4d5bfcebd7bf4cefcefe681ea7ecc5f61 (diff) | |
download | libxkbcommon-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/scanner.c')
-rw-r--r-- | src/xkbcomp/scanner.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xkbcomp/scanner.c b/src/xkbcomp/scanner.c index 4be2c40..0296c58 100644 --- a/src/xkbcomp/scanner.c +++ b/src/xkbcomp/scanner.c @@ -125,7 +125,7 @@ skip_more_whitespace_and_comments: return scanner_error(yylloc, s, "empty key name literal"); if (!buf_append(s, '\0') || !chr(s, '>')) return scanner_error(yylloc, s, "unterminated key name literal"); - yylval->sval = xkb_atom_intern(s->ctx, s->buf); + yylval->sval = xkb_atom_intern(s->ctx, s->buf, s->buf_pos - 1); return KEYNAME; } |