From 73fbc4a4a7997b3ee1c779d8f394114270bcb20d Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Fri, 12 Nov 2010 12:04:11 +0100 Subject: [PATCH] Replace SecurityLookupIDByClass() with dixLookupResourceByClass(). This patch has been prepared with the following Coccinelle semantic patch: @@ expression a, b, c, d; identifier r; type t; @@ -r = (t) SecurityLookupIDByClass(a, b, c, d); +dixLookupResourceByClass((pointer*) &r, b, c, a, d); The only occurrence not matching directly was processed after separating declaration of pXinDraw and call to SecurityLookupIDByClass(). Reviewed-by: Jamey Sharp Signed-off-by: Cyril Brulebois --- hw/dmx/glxProxy/glxcmds.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c index 0f8e8d8d3..a58eb3554 100644 --- a/hw/dmx/glxProxy/glxcmds.c +++ b/hw/dmx/glxProxy/glxcmds.c @@ -1104,14 +1104,16 @@ static int MakeCurrent(__GLXclientState *cl, to_screen = screenInfo.numScreens - 1; if (pDraw && new_reply.writeType != GLX_PBUFFER_TYPE) { - pXinDraw = (PanoramiXRes *) - SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess); + dixLookupResourceByClass((pointer*) &pXinDraw, + pDraw->id, XRC_DRAWABLE, + client, DixReadAccess); } if (pReadDraw && pReadDraw != pDraw && new_reply.readType != GLX_PBUFFER_TYPE) { - pXinReadDraw = (PanoramiXRes *) - SecurityLookupIDByClass(client, pReadDraw->id, XRC_DRAWABLE, DixReadAccess); + dixLookupResourceByClass((pointer*) &pXinReadDraw, + pReadDraw->id, XRC_DRAWABLE, + client, DixReadAccess); } else { pXinReadDraw = pXinDraw; @@ -1765,8 +1767,9 @@ static int CreateGLXPixmap(__GLXclientState *cl, from_screen = 0; to_screen = screenInfo.numScreens - 1; - pXinDraw = (PanoramiXRes *) - SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess); + dixLookupResourceByClass((pointer*) &pXinDraw, + pDraw->id, XRC_DRAWABLE, + client, DixReadAccess); } #endif @@ -2013,8 +2016,9 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag) if (!noPanoramiXExtension) { from_screen = 0; to_screen = screenInfo.numScreens - 1; - pXinDraw = (PanoramiXRes *) - SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess); + dixLookupResourceByClass((pointer*) &pXinDraw, + pDraw->id, XRC_DRAWABLE, + client, DixReadAccess); } #endif @@ -3369,9 +3373,9 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) #ifdef PANORAMIX if (!noPanoramiXExtension) { - pXinDraw = (PanoramiXRes *) - SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess); - if (!pXinDraw) { + if (Success != dixLookupResourceByClass((pointer*) &pXinDraw, + pDraw->id, XRC_DRAWABLE, + client, DixReadAccess)) { client->errorValue = drawId; return __glXBadDrawable; } @@ -3533,9 +3537,10 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc) #ifdef PANORAMIX if (!noPanoramiXExtension) { - PanoramiXRes *pXinDraw = (PanoramiXRes *) - SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess); - if (!pXinDraw) { + PanoramiXRes *pXinDraw; + if (Success != dixLookupResourceByClass((pointer*) &pXinDraw, + pDraw->id, XRC_DRAWABLE, + client, DixReadAccess)) { client->errorValue = drawId; return __glXBadDrawable; }