Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 1 | From 592c915df252932961a4151c891da58c48a8db90 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 2 Mar 2023 18:47:40 -0800 |
| 4 | Subject: [PATCH] Define CARD32 as uint as it is 32-bit |
| 5 | |
| 6 | long can be 64bit on LP64 systems and none of systems we support need int < 32-bits |
| 7 | therefore use NUM32 to be int always if the system is linux |
| 8 | |
| 9 | Fixes build with clang-16 |
| 10 | thunk.c:147:3: error: incompatible function pointer types initializing 'x86emuu32 (*)(X86EMU_pioAddr)' (aka 'unsigned int (*)(unsigned short)') with an expression of type 'unsigned long (*)(unsigned short)' [-Wincompatible-function-pointer-types] |
| 11 | (&x_inl), |
| 12 | ^~~~~~~~ |
| 13 | |
| 14 | Upstream-Status: Pending |
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 16 | --- |
| 17 | x86emu/include/xf86int10.h | 2 +- |
| 18 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 19 | |
| 20 | --- a/x86emu/include/xf86int10.h |
| 21 | +++ b/x86emu/include/xf86int10.h |
| 22 | @@ -18,7 +18,7 @@ |
| 23 | |
| 24 | #define CARD8 unsigned char |
| 25 | #define CARD16 unsigned short |
| 26 | -#define CARD32 unsigned long |
| 27 | +#define CARD32 unsigned int |
| 28 | #define pointer void * |
| 29 | #define IOADDRESS void * |
| 30 | #define Bool int |
| 31 | --- a/x86emu/include/types.h |
| 32 | +++ b/x86emu/include/types.h |
| 33 | @@ -77,7 +77,8 @@ |
| 34 | defined(__s390x__) || \ |
| 35 | (defined(__hppa__) && defined(__LP64)) || \ |
| 36 | defined(__amd64__) || defined(amd64) || \ |
| 37 | - (defined(__sgi) && (_MIPS_SZLONG == 64)) |
| 38 | + (defined(__sgi) && (_MIPS_SZLONG == 64)) || \ |
| 39 | + defined(__linux__) |
| 40 | #define NUM32 int |
| 41 | #else |
| 42 | #define NUM32 long |