x11/keymap,test/interactive-evdev: fix a couple of clang-analyzer warnings

From my analysis these values cannot be null, but the analyzer cannot
see this. So assert it.

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2017-07-31 10:18:54 +03:00
parent 2d9640651a
commit daebdb5e08
2 changed files with 2 additions and 0 deletions

View File

@ -448,6 +448,7 @@ get_sym_maps(struct xkb_keymap *keymap, xcb_connection_t *conn,
const xkb_layout_index_t group = j / wire_sym_map->width;
const xkb_level_index_t level = j % wire_sym_map->width;
assert(key->groups[group].type != NULL);
if (level < key->groups[group].type->num_levels &&
wire_keysym != XKB_KEY_NoSymbol) {
key->groups[group].levels[level].num_syms = 1;

View File

@ -203,6 +203,7 @@ get_keyboards(struct xkb_keymap *keymap,
continue;
}
assert(kbd != NULL);
kbd->next = kbds;
kbds = kbd;
}