Commit 8bb1579f authored by Mike Gabriel's avatar Mike Gabriel

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 <jamey@minilop.net> 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: 's avatarJamey Sharp <jamey@minilop.net> Signed-off-by: 's avatarDaniel Stone <daniel@fooishbar.org> Backported-to-NX-by: 's avatarMike Gabriel <mike.gabriel@das-netzwerkteam.de> (Only appropriate location for backporting: Xserver/GL/glx/glxcmds.c).
parent ac6a216c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment