From: Holger Schemel Date: Wed, 8 May 2024 22:58:14 +0000 (+0200) Subject: fixed some more compiler warnings X-Git-Tag: 4.4.0.0-test-1~1 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1f90d27f076aa0971ab263f1c6c7d387c6f9b9fd;p=rocksndiamonds.git fixed some more compiler warnings --- diff --git a/src/libgame/types.h b/src/libgame/types.h index f7d8ad46..7dc2a7d4 100644 --- a/src/libgame/types.h +++ b/src/libgame/types.h @@ -76,12 +76,24 @@ typedef unsigned char byte; #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) +#if defined(__x86_64__) + +#define PTR_TO_INT(p) ((int) (long long) (p)) +#define PTR_TO_UINT(p) ((unsigned int) (unsigned long long) (p)) + +#define INT_TO_PTR(i) ((void *) (long long) (i)) +#define UINT_TO_PTR(u) ((void *) (unsigned long long) (u)) + +#else + #define PTR_TO_INT(p) ((int) (long) (p)) #define PTR_TO_UINT(p) ((unsigned int) (unsigned long) (p)) #define INT_TO_PTR(i) ((void *) (long) (i)) #define UINT_TO_PTR(u) ((void *) (unsigned long) (u)) +#endif + #define STRUCT_OFFSET(s, m) (offsetof(s, m))