diff options
author | Gatis Paeglis <gatis.paeglis@digia.com> | 2014-02-05 16:25:06 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-19 15:42:13 +0100 |
commit | b19b0808940c8c54b102012be134a370b26e348e (patch) | |
tree | 63d951814f771e87508be7b0f8d4346d0079dc05 /src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c | |
parent | c6b555dac389f9a599a9ad342de56dea329fff60 (diff) |
Update bundled libxkbcommon version to 0.4.0
This release comes with important bug fixes. Also we can now
remove the workaround code which was needed for libxkbcommon 0.2.0.
Task-number: QTBUG-31712
Task-number: QTBUG-33732
Task-number: QTBUG-34056
Change-Id: I57caf7f803b9a01a15541a5ad82e464de3b8abbb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c')
-rw-r--r-- | src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c b/src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c index b9a1b5ffa6..007e3f73e8 100644 --- a/src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c +++ b/src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c @@ -97,12 +97,13 @@ text_v1_keymap_new_from_names(struct xkb_keymap *keymap, } static bool -text_v1_keymap_new_from_string(struct xkb_keymap *keymap, const char *string) +text_v1_keymap_new_from_string(struct xkb_keymap *keymap, + const char *string, size_t len) { bool ok; XkbFile *xkb_file; - xkb_file = XkbParseString(keymap->ctx, string, "(input string)"); + xkb_file = XkbParseString(keymap->ctx, string, len, "(input string)", NULL); if (!xkb_file) { log_err(keymap->ctx, "Failed to parse input xkb string\n"); return NULL; @@ -114,38 +115,6 @@ text_v1_keymap_new_from_string(struct xkb_keymap *keymap, const char *string) } static bool -text_v1_keymap_new_from_buffer(struct xkb_keymap *keymap, - const char *buffer, size_t length) -{ - bool ok; - XkbFile *xkb_file; - char *buf; - - buf = malloc(length + 2); - if (!buf) { - log_err(keymap->ctx, "Cannot allocate memory for keymap\n"); - return NULL; - } - - /* yy_scan_buffer requires two terminating zero bytes */ - memcpy(buf, buffer, length); - buf[length] = 0; - buf[length + 1] = 0; - - xkb_file = XkbParseBuffer(keymap->ctx, buf, length + 2, "input"); - if (!xkb_file) { - log_err(keymap->ctx, "Failed to parse input xkb file\n"); - free(buf); - return NULL; - } - - ok = compile_keymap_file(keymap, xkb_file); - FreeXkbFile(xkb_file); - free(buf); - return ok; -} - -static bool text_v1_keymap_new_from_file(struct xkb_keymap *keymap, FILE *file) { bool ok; @@ -165,7 +134,6 @@ text_v1_keymap_new_from_file(struct xkb_keymap *keymap, FILE *file) const struct xkb_keymap_format_ops text_v1_keymap_format_ops = { .keymap_new_from_names = text_v1_keymap_new_from_names, .keymap_new_from_string = text_v1_keymap_new_from_string, - .keymap_new_from_buffer = text_v1_keymap_new_from_buffer, .keymap_new_from_file = text_v1_keymap_new_from_file, .keymap_get_as_string = text_v1_keymap_get_as_string, }; |