Commit 62e5b0ff authored by Derek Buitenhuis's avatar Derek Buitenhuis Committed by Ulrich Sibiller

makekeys: Fix build/target word size mismatch when cross-compiling

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: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com> Reviewed-by: 's avatarDaniel Stone <daniel@fooishbar.org>
parent 0bcb4bba
......@@ -31,11 +31,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
#include <nx-X11/Xresource.h>
#include <nx-X11/keysymdef.h>
#include "Xresinternal.h"
#include <stdio.h> /* sprintf */
typedef unsigned long Signature;
#define NEEDVTABLE
#include "ks_tables.h"
#include "Key.h"
......
......@@ -2,8 +2,10 @@
#ifndef _XRESINTERNAL_H_
#define _XRESINTERNAL_H_
#include <inttypes.h>
/* type defines */
typedef unsigned long Signature;
typedef uint32_t Signature;
/* prototypes */
extern XrmQuark _XrmInternalStringToQuark(
......
......@@ -30,11 +30,12 @@ from The Open Group.
#include <nx-X11/X.h>
#include <nx-X11/Xos.h>
#include <nx-X11/Xresource.h>
#include <nx-X11/keysymdef.h>
#include <stdio.h>
#include <stdlib.h>
typedef unsigned long Signature;
#include "../Xresinternal.h"
#define KTNUM 4000
......@@ -212,7 +213,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment