[gtk/matthiasc/for-master: 24/26] Help static analysis with an assertion
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 24/26] Help static analysis with an assertion
- Date: Tue, 26 May 2020 01:29:43 +0000 (UTC)
commit ec39ddee632a41ae243e7014992febf94258c5c4
Author: Matthias Clasen <mclasen redhat com>
Date: Mon May 25 20:38:16 2020 -0400
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.
gdk/wayland/gdkkeys-wayland.c | 1 +
1 file changed, 1 insertion(+)
---
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]