Remove a few remaining uses of the KeySym type
authorRan Benita <ran234@gmail.com>
Sat, 24 Mar 2012 10:31:55 +0000 (12:31 +0200)
committerDaniel Stone <daniel@fooishbar.org>
Tue, 27 Mar 2012 12:59:22 +0000 (13:59 +0100)
Signed-off-by: Ran Benita <ran234@gmail.com>
makekeys/makekeys.c
test/xkey.c

index cf96f13..c731e40 100644 (file)
@@ -28,12 +28,13 @@ from The Open Group.
 
 /* Constructs hash tables for XStringToKeysym and XKeysymToString. */
 
-#include <X11/X.h>
-#include <X11/Xos.h>
+#include "xkbcommon/xkbcommon.h"
+
 #include <X11/keysymdef.h>
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 typedef uint32_t Signature;
 
@@ -41,7 +42,7 @@ typedef uint32_t Signature;
 
 static struct info {
     char        *name;
-    KeySym      val;
+    xkb_keysym_t val;
 } info[KTNUM];
 
 #define MIN_REHASH 15
@@ -50,11 +51,11 @@ static struct info {
 static char tab[KTNUM];
 static unsigned short offsets[KTNUM];
 static unsigned short indexes[KTNUM];
-static KeySym values[KTNUM];
+static xkb_keysym_t values[KTNUM];
 static int ksnum = 0;
 
 static int
-parse_line(const char *buf, char *key, KeySym *val, char *prefix)
+parse_line(const char *buf, char *key, xkb_keysym_t *val, char *prefix)
 {
     int i;
     char alias[128];
@@ -109,7 +110,7 @@ main(int argc, char *argv[])
     int best_max_rehash;
     int best_z = 0;
     int num_found;
-    KeySym val;
+    xkb_keysym_t val;
     char key[128], prefix[128];
     char buf[1024];
 
index 00e0929..52914a2 100644 (file)
@@ -3,17 +3,18 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <X11/X.h>
 
 static void print_keysym(const char *s)
 {
-    KeySym ks = xkb_string_to_keysym(s);
+    xkb_keysym_t ks = xkb_string_to_keysym(s);
     if (ks == NoSymbol)
         printf("NoSymbol\n");
     else
         printf("0x%lX\n", ks);
 }
 
-static void print_string(KeySym ks)
+static void print_string(xkb_keysym_t ks)
 {
     char s[16];
 
@@ -24,7 +25,7 @@ static void print_string(KeySym ks)
 int main(int argc, char *argv[])
 {
     int mode;
-    KeySym sym;
+    xkb_keysym_t sym;
 
     if (argc < 3) {
         fprintf(stderr, "error: not enough arguments\n");