rbug: clean up cast-warnings
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 24 Mar 2020 10:03:03 +0000 (11:03 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 25 Mar 2020 14:19:37 +0000 (14:19 +0000)
Similarly to the previous cast; on 64-bit Windows, unsigned long is
32-bit, and casting a pointer to a non-matchin bit-width integer produce
warnings. So let's use uintpre_t for this purpose instead.

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4297>

src/gallium/auxiliary/driver_rbug/rbug_core.c

index d8dda8af2271c2826a14f2a0672f83806ff429c4..53cc941c2caf541f3ede7c3a933b5e9564279357 100644 (file)
@@ -44,8 +44,8 @@
 
 #include <errno.h>
 
-#define U642VOID(x) ((void *)(unsigned long)(x))
-#define VOID2U64(x) ((uint64_t)(unsigned long)(x))
+#define U642VOID(x) ((void *)(uintptr_t)(x))
+#define VOID2U64(x) ((uint64_t)(uintptr_t)(x))
 
 #define container_of(ptr, type, field) \
    (type*)((char*)ptr - offsetof(type, field))