This matches commit 24283d40b1e4314c6647dda49d2a159833341a8b from
libX11:
Since makekeys is built using build environment's gcc and
runs natively, we have to make sure that the size of the
Signature type is the same on both the native environment
and the target, otherwise we get mismatches upon running X,
and some LSB test failures (xts5).
Use an unsigned 32-bit integer on all platforms. Also,
eliminate the redundant multiple typedefs for the
Signature type.
Signed-off-by: Derek Buitenhuis <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Signed-off-by: Ran Benita <[email protected]>
---
makekeys/makekeys.c | 5 +++--
src/keysym.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/makekeys/makekeys.c b/makekeys/makekeys.c
index 567843b..a25a4a6 100644
--- a/makekeys/makekeys.c
+++ b/makekeys/makekeys.c
@@ -31,10 +31,11 @@ from The Open Group.
#include <X11/X.h>
#include <X11/Xos.h>
#include <X11/keysymdef.h>
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
-typedef unsigned long Signature;
+typedef uint32_t Signature;
#define KTNUM 4000
@@ -287,7 +288,7 @@ next1: ;
offsets[j] = k;
indexes[i] = k;
val = info[i].val;
- printf("0x%.2lx, 0x%.2lx, 0x%.2lx, 0x%.2lx, 0x%.2lx, 0x%.2lx, ",
+ printf("0x%.2"PRIx32", 0x%.2"PRIx32", 0x%.2lx, 0x%.2lx, 0x%.2lx,
0x%.2lx, ",
(sig >> 8) & 0xff, sig & 0xff,
(val >> 24) & 0xff, (val >> 16) & 0xff,
(val >> 8) & 0xff, val & 0xff);
diff --git a/src/keysym.c b/src/keysym.c
index 7580cdd..bd0a67b 100644
--- a/src/keysym.c
+++ b/src/keysym.c
@@ -95,7 +95,7 @@ uint32_t
xkb_string_to_keysym(const char *s)
{
int i, n, h, c, idx;
- unsigned long sig = 0;
+ uint32_t sig = 0;
const char *p = s;
const unsigned char *entry;
unsigned char sig1, sig2;
--
1.7.9.2
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel