From b0dd6be2c8703f7062d45ac9fd646550c7d54e3b Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Thu, 8 Oct 2009 13:38:44 +1100 Subject: Cast small-int values through intptr_t when passed as pointers On 64-bit systems, int and pointers don't have the same size, so GCC gives warnings about casts between int and pointer types. However, in the cases covered by this patch, it's always a value that fits in int being stored temporarily as a pointer and then converted back later, which is safe. Casting through the pointer-sized integer type intptr_t convinces the compiler that this is OK. Signed-off-by: Jamey Sharp Signed-off-by: Daniel Stone --- glx/glxcmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'glx/glxcmds.c') diff --git a/glx/glxcmds.c b/glx/glxcmds.c index ba4c12398..eedab652f 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -2057,7 +2057,7 @@ int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc) if (ret == Success) { if (barrier) /* add source for cleanup when drawable is gone */ - AddResource(drawable, __glXSwapBarrierRes, (pointer)screen); + AddResource(drawable, __glXSwapBarrierRes, (pointer)(intptr_t)screen); else /* delete source */ FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE); -- cgit v1.2.3