From 8bb1579f40bb74b9dad302e79c124541694b3265 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Thu, 14 Dec 2017 08:05:54 +0100 Subject: Xserver/GL/glx/glxcmds.c: Cast small-int values through intptr_t when passed as pointers Picked from this X.org commit: commit b0dd6be2c8703f7062d45ac9fd646550c7d54e3b Author: Jamey Sharp Date: Thu Oct 8 13:38:44 2009 +1100 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 Backported-to-NX-by: Mike Gabriel (Only appropriate location for backporting: Xserver/GL/glx/glxcmds.c). --- nx-X11/programs/Xserver/GL/glx/glxcmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index efe5b25e9..602b79099 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -1762,7 +1762,7 @@ static int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc) if (ret == Success) { if (barrier) /* add source for cleanup when drawable is gone */ - AddResource(drawable, __glXSwapBarrierRes, (void *)screen); + AddResource(drawable, __glXSwapBarrierRes, (void *)(intptr_t)screen); else /* delete source */ FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE); -- cgit v1.2.3