summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-05-25 20:38:16 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-05-25 20:56:09 -0400
commitec39ddee632a41ae243e7014992febf94258c5c4 (patch)
tree1b94c1ff0592d820eab75c7a69a38d21156dead4 /gdk
parent0f096d6ad99330b73c34370f15aff39190539a19 (diff)
downloadgtk+-ec39ddee632a41ae243e7014992febf94258c5c4.tar.gz
Help static analysis with an assertion
It is hard for clang to see that layouts will always be smaller than num_layouts, so just assert that.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/wayland/gdkkeys-wayland.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c
index 802463298e..ef41b287ef 100644
--- a/gdk/wayland/gdkkeys-wayland.c
+++ b/gdk/wayland/gdkkeys-wayland.c
@@ -412,6 +412,7 @@ update_direction (GdkWaylandKeymap *keymap)
gint layouts, layout;
layouts = xkb_keymap_num_layouts_for_key (keymap->xkb_keymap, key);
+ g_assert (layouts <= num_layouts);
for (layout = 0; layout < layouts; layout++)
{
const xkb_keysym_t *syms;