Commit 073a21076c44aecb5439ce3cf884b3c04079d14c

Ran Benita 2012-04-08T15:40:12

Constify the syms_out argument to xkb_key_get_syms() The caller should not mess around with these as they come directly from our internal structs. Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/include/xkbcommon/xkbcommon.h b/include/xkbcommon/xkbcommon.h
index 1391437..ebdefb0 100644
--- a/include/xkbcommon/xkbcommon.h
+++ b/include/xkbcommon/xkbcommon.h
@@ -447,7 +447,7 @@ xkb_state_update_key(struct xkb_state *state, xkb_keycode_t key,
  */
 _X_EXPORT unsigned int
 xkb_key_get_syms(struct xkb_state *state, xkb_keycode_t key,
-                 xkb_keysym_t **syms_out);
+                 const xkb_keysym_t **syms_out);
 
 /**
  * Modifier and group types for state objects.  This enum is bitmaskable,
diff --git a/src/map.c b/src/map.c
index 8bb115e..cde9a6f 100644
--- a/src/map.c
+++ b/src/map.c
@@ -302,7 +302,7 @@ xkb_key_get_group(struct xkb_state *state, xkb_keycode_t key)
  */
 unsigned int
 xkb_key_get_syms_by_level(struct xkb_keymap *xkb, xkb_keycode_t key, unsigned int group,
-                          unsigned int level, xkb_keysym_t **syms_out)
+                          unsigned int level, const xkb_keysym_t **syms_out)
 {
     int num_syms;
 
@@ -329,7 +329,7 @@ err:
  */
 unsigned int
 xkb_key_get_syms(struct xkb_state *state, xkb_keycode_t key,
-                 xkb_keysym_t **syms_out)
+                 const xkb_keysym_t **syms_out)
 {
     struct xkb_keymap *xkb = state->xkb;
     int group;
diff --git a/src/xkballoc.h b/src/xkballoc.h
index 3d445b4..ec25d21 100644
--- a/src/xkballoc.h
+++ b/src/xkballoc.h
@@ -75,6 +75,6 @@ XkbcFreeServerMap(struct xkb_keymap * xkb);
 extern unsigned int
 xkb_key_get_syms_by_level(struct xkb_keymap *xkb, xkb_keycode_t key,
                           unsigned int group, unsigned int level,
-                          xkb_keysym_t **syms_out);
+                          const xkb_keysym_t **syms_out);
 
 #endif /* _XKBALLOC_H_ */
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index 9157981..a38d29e 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -903,7 +903,7 @@ static struct xkb_sym_interpret *
 FindInterpForKey(struct xkb_keymap *xkb, xkb_keycode_t key, uint32_t group, uint32_t level)
 {
     struct xkb_sym_interpret *ret = NULL;
-    xkb_keysym_t *syms;
+    const xkb_keysym_t *syms;
     int num_syms;
     int i;