[PATCH libxkbcommon 1/2] Move XKB_KEY_NoSymbol to xkbcommon-keysyms.h

Ran Benita ran234 at gmail.com
Sun May 20 11:10:53 PDT 2012


This avoids a couple of special cases in the code, and is more
consistent. Since anyone who includes xkbcommon.h also gets
xkbcommon-keysyms.h, and anyone who include xkbcommon-keysyms.h would
want NoSymbol anyway, there's no down side.

Signed-off-by: Ran Benita <ran234 at gmail.com>
---
Note: this probably should only be commited if the sed script is
updated as well. I tried to add some i\ stuff, but the quoting got me.
If any one knows how to do it... (maybe in a separate file?)

 include/xkbcommon/xkbcommon-keysyms.h |    1 +
 include/xkbcommon/xkbcommon.h         |    2 --
 makekeys/makekeys.c                   |    5 -----
 src/keysym.c                          |    6 ------
 4 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/include/xkbcommon/xkbcommon-keysyms.h b/include/xkbcommon/xkbcommon-keysyms.h
index 26c1e3a..2c1ab95 100644
--- a/include/xkbcommon/xkbcommon-keysyms.h
+++ b/include/xkbcommon/xkbcommon-keysyms.h
@@ -112,6 +112,7 @@ SOFTWARE.
  *
  */
 
+#define XKB_KEY_NoSymbol                    0x000000  /* Special KeySym */
 #define XKB_KEY_VoidSymbol                  0xffffff  /* Void symbol */
 
 /*
diff --git a/include/xkbcommon/xkbcommon.h b/include/xkbcommon/xkbcommon.h
index 2b1eb96..59c24c5 100644
--- a/include/xkbcommon/xkbcommon.h
+++ b/include/xkbcommon/xkbcommon.h
@@ -86,8 +86,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include <xkbcommon/xkbcommon-names.h>
 #include <xkbcommon/xkbcommon-keysyms.h>
 
-#define XKB_KEY_NoSymbol	     0L	/* special KeySym */
-
 typedef uint32_t xkb_keycode_t;
 typedef uint32_t xkb_keysym_t;
 typedef uint32_t xkb_mod_index_t;
diff --git a/makekeys/makekeys.c b/makekeys/makekeys.c
index 751777f..6ac3799 100644
--- a/makekeys/makekeys.c
+++ b/makekeys/makekeys.c
@@ -132,11 +132,6 @@ main(int argc, char *argv[])
         fclose(fptr);
     }
 
-    /* Special case XKB_KEY_NoSymbol. */
-    info[ksnum].name = strdup("NoSymbol");
-    info[ksnum].val = XKB_KEY_NoSymbol;
-    ksnum++;
-
     printf("/* This file is generated from keysymdef.h. */\n");
     printf("/* Do not edit. */\n");
     printf("\n");
diff --git a/src/keysym.c b/src/keysym.c
index 1b32f0b..6004aad 100644
--- a/src/keysym.c
+++ b/src/keysym.c
@@ -44,12 +44,6 @@ xkb_keysym_get_name(xkb_keysym_t ks, char *buffer, size_t size)
         return;
     }
 
-    /* Not listed in keysymdef.h for hysterical raisins. */
-    if (ks == XKB_KEY_NoSymbol) {
-        snprintf(buffer, size, "NoSymbol");
-        return;
-    }
-
     /* Try to find it in our hash table. */
     if (ks <= 0x1fffffff) {
         val1 = ks >> 24;
-- 
1.7.10.2



More information about the xorg-devel mailing list