From ddb0ff9d024f3334353fc4c5166925886f6da4f7 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 29 Jun 2012 19:26:01 +0300 Subject: [PATCH] xkbcomp: remove useless function XkbChooseMap compile_keymap can only be passes a single keymap file now, from all code paths leading to it. So this function doesn't do anything. The remaining check is performed inside CompileKeymap, so we can remove it as well; compile_keymap doesn't do much now. Signed-off-by: Ran Benita --- src/xkbcomp/xkbcomp.c | 52 ++------------------------------------------------- 1 file changed, 2 insertions(+), 50 deletions(-) diff --git a/src/xkbcomp/xkbcomp.c b/src/xkbcomp/xkbcomp.c index e7f5050..63d5fe3 100644 --- a/src/xkbcomp/xkbcomp.c +++ b/src/xkbcomp/xkbcomp.c @@ -96,61 +96,13 @@ xkb_map_new_from_names(struct xkb_context *ctx, return keymap; } -static XkbFile * -XkbChooseMap(XkbFile *file, const char *name) -{ - XkbFile *map = file; - - /* map specified? */ - if (name) { - while (map) { - if (map->name && strcmp(map->name, name) == 0) - break; - map = (XkbFile *) map->common.next; - } - - if (!map) - ERROR("no map named \"%s\" in input file\n", name); - } - else if (file->common.next) { - /* look for map with XkbLC_Default flag. */ - for (; map; map = (XkbFile *) map->common.next) { - if (map->flags & XkbLC_Default) - break; - } - - if (!map) { - map = file; - WARN("no map specified, but components have several\n"); - WARN("using the first defined map, \"%s\"\n", - map->name ? map->name : ""); - } - } - - return map; -} - static struct xkb_keymap * compile_keymap(struct xkb_context *ctx, XkbFile *file) { - XkbFile *mapToUse; - struct xkb_keymap *keymap = NULL; - - /* Find map to use */ - mapToUse = XkbChooseMap(file, NULL); - if (!mapToUse) - goto err; - - if (mapToUse->type != FILE_TYPE_KEYMAP) { - ERROR("file type %d not handled\n", mapToUse->type); - goto err; - } + struct xkb_keymap *keymap; - keymap = CompileKeymap(ctx, mapToUse); - if (!keymap) - goto err; + keymap = CompileKeymap(ctx, file); -err: FreeXKBFile(file); return keymap; } -- 2.7.4