Replace LookupIDByType() with dixLookupResourceByType(), take 1.

This patch has been prepared with the following Coccinelle semantic patch:

@@
expression x, y;
type t;
identifier r;
@@
-r = (t) LookupIDByType(x, y);
+dixLookupResourceByType((pointer*)&r, x, y, NullClient, DixUnknownAccess);

@@
expression x, y;
type t;
identifier r;
@@
-t r = (t) LookupIDByType(x, y);
+t r;
+dixLookupResourceByType((pointer*)&r, x, y, NullClient, DixUnknownAccess);

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Cyril Brulebois <kibi@debian.org>
This commit is contained in:
Cyril Brulebois 2010-11-11 15:30:15 +01:00
parent d1b45b0fd5
commit ffb93533fd
4 changed files with 104 additions and 58 deletions

View File

@ -699,7 +699,8 @@ static void dmxBERestorePixmapImage(pointer value, XID id, RESTYPE type,
PixmapPtr pPix; PixmapPtr pPix;
int i; int i;
pPix = (PixmapPtr)LookupIDByType(pXinPix->info[idx].id, RT_PIXMAP); dixLookupResourceByType((pointer*) &pPix, pXinPix->info[idx].id,
RT_PIXMAP, NullClient, DixUnknownAccess);
if (pPix != pDst) return; /* Not a match.... Next! */ if (pPix != pDst) return; /* Not a match.... Next! */
for (i = 0; i < PanoramiXNumScreens; i++) { for (i = 0; i < PanoramiXNumScreens; i++) {
@ -708,8 +709,8 @@ static void dmxBERestorePixmapImage(pointer value, XID id, RESTYPE type,
if (i == idx) continue; /* Self replication is bad */ if (i == idx) continue; /* Self replication is bad */
pSrc = dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id,
(PixmapPtr)LookupIDByType(pXinPix->info[i].id, RT_PIXMAP); RT_PIXMAP, NullClient, DixUnknownAccess);
pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc); pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
if (pSrcPriv->pixmap) { if (pSrcPriv->pixmap) {
DMXScreenInfo *dmxSrcScreen = &dmxScreens[i]; DMXScreenInfo *dmxSrcScreen = &dmxScreens[i];
@ -1365,7 +1366,8 @@ static void dmxBEFindPixmapImage(pointer value, XID id, RESTYPE type,
PixmapPtr pPix; PixmapPtr pPix;
int i; int i;
pPix = (PixmapPtr)LookupIDByType(pXinPix->info[idx].id, RT_PIXMAP); dixLookupResourceByType((pointer*) &pPix, pXinPix->info[idx].id,
RT_PIXMAP, NullClient, DixUnknownAccess);
if (pPix != pDst) return; /* Not a match.... Next! */ if (pPix != pDst) return; /* Not a match.... Next! */
for (i = 0; i < PanoramiXNumScreens; i++) { for (i = 0; i < PanoramiXNumScreens; i++) {
@ -1374,8 +1376,8 @@ static void dmxBEFindPixmapImage(pointer value, XID id, RESTYPE type,
if (i == idx) continue; /* Self replication is bad */ if (i == idx) continue; /* Self replication is bad */
pSrc = dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id,
(PixmapPtr)LookupIDByType(pXinPix->info[i].id, RT_PIXMAP); RT_PIXMAP, NullClient, DixUnknownAccess);
pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc); pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
if (pSrcPriv->pixmap) { if (pSrcPriv->pixmap) {
FoundPixImage = True; FoundPixImage = True;

View File

@ -533,8 +533,8 @@ static DMXScreenInfo *dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw)
PixmapPtr pSrc; PixmapPtr pSrc;
dmxPixPrivPtr pSrcPriv; dmxPixPrivPtr pSrcPriv;
pSrc = (PixmapPtr)LookupIDByType(pXinPix->info[i].id, dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id,
RT_PIXMAP); RT_PIXMAP, NullClient, DixUnknownAccess);
pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc); pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
if (pSrcPriv->pixmap) { if (pSrcPriv->pixmap) {
*draw = pSrcPriv->pixmap; *draw = pSrcPriv->pixmap;

View File

@ -84,7 +84,8 @@ Window dmxCreateRootWindow(WindowPtr pWindow)
parent = dmxScreen->scrnWin; /* This is our "Screen" window */ parent = dmxScreen->scrnWin; /* This is our "Screen" window */
visual = dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual; visual = dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual;
pCmap = (ColormapPtr)LookupIDByType(wColormap(pWindow), RT_COLORMAP); dixLookupResourceByType((pointer*) &pCmap, wColormap(pWindow),
RT_COLORMAP, NullClient, DixUnknownAccess);
pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap); pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap);
mask = CWEventMask | CWBackingStore | CWColormap | CWBorderPixel; mask = CWEventMask | CWBackingStore | CWColormap | CWBorderPixel;
@ -191,8 +192,8 @@ void dmxGetDefaultWindowAttributes(WindowPtr pWindow,
ColormapPtr pCmap; ColormapPtr pCmap;
dmxColormapPrivPtr pCmapPriv; dmxColormapPrivPtr pCmapPriv;
pCmap = (ColormapPtr)LookupIDByType(wColormap(pWindow), dixLookupResourceByType((pointer*) &pCmap, wColormap(pWindow),
RT_COLORMAP); RT_COLORMAP, NullClient, DixUnknownAccess);
pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap); pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap);
*cmap = pCmapPriv->cmap; *cmap = pCmapPriv->cmap;
} else { } else {
@ -545,7 +546,8 @@ static void dmxDoChangeWindowAttributes(WindowPtr pWindow,
ColormapPtr pCmap; ColormapPtr pCmap;
dmxColormapPrivPtr pCmapPriv; dmxColormapPrivPtr pCmapPriv;
pCmap = (ColormapPtr)LookupIDByType(wColormap(pWindow), RT_COLORMAP); dixLookupResourceByType((pointer*) &pCmap, wColormap(pWindow),
RT_COLORMAP, NullClient, DixUnknownAccess);
pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap); pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap);
attribs->colormap = pCmapPriv->cmap; attribs->colormap = pCmapPriv->cmap;
} }

View File

@ -129,7 +129,8 @@ static int CreateContext(__GLXclientState *cl,
if (shareList == None) { if (shareList == None) {
shareglxc = NULL; shareglxc = NULL;
} else { } else {
shareglxc = (__GLXcontext *) LookupIDByType(shareList, __glXContextRes); dixLookupResourceByType((pointer*) &shareglxc, shareList,
__glXContextRes, NullClient, DixUnknownAccess);
if (!shareglxc) { if (!shareglxc) {
client->errorValue = shareList; client->errorValue = shareList;
return __glXBadContext; return __glXBadContext;
@ -420,14 +421,14 @@ int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixGetAttrAccess); rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixGetAttrAccess);
if (rc != Success) { if (rc != Success) {
pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->drawable, dixLookupResourceByType((pointer*) &pGlxPixmap, req->drawable,
__glXPixmapRes); __glXPixmapRes, NullClient, DixUnknownAccess);
if (pGlxPixmap) pDraw = pGlxPixmap->pDraw; if (pGlxPixmap) pDraw = pGlxPixmap->pDraw;
} }
if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
pGlxWindow = (__glXWindow *) LookupIDByType(req->drawable, dixLookupResourceByType((pointer*) &pGlxWindow, req->drawable,
__glXWindowRes); __glXWindowRes, NullClient, DixUnknownAccess);
if (pGlxWindow) pDraw = pGlxWindow->pDraw; if (pGlxWindow) pDraw = pGlxWindow->pDraw;
} }
@ -450,14 +451,14 @@ int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc)
rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixManageAccess); rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixManageAccess);
if (rc != Success) { if (rc != Success) {
pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->drawable, dixLookupResourceByType((pointer*) &pGlxPixmap, req->drawable,
__glXPixmapRes); __glXPixmapRes, NullClient, DixUnknownAccess);
if (pGlxPixmap) pDraw = pGlxPixmap->pDraw; if (pGlxPixmap) pDraw = pGlxPixmap->pDraw;
} }
if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
pGlxWindow = (__glXWindow *) LookupIDByType(req->drawable, dixLookupResourceByType((pointer*) &pGlxWindow, req->drawable,
__glXWindowRes); __glXWindowRes, NullClient, DixUnknownAccess);
if (pGlxWindow) pDraw = pGlxWindow->pDraw; if (pGlxWindow) pDraw = pGlxWindow->pDraw;
} }
@ -470,14 +471,16 @@ int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc)
rc = dixLookupDrawable(&pMember, req->member, client, 0, rc = dixLookupDrawable(&pMember, req->member, client, 0,
DixGetAttrAccess); DixGetAttrAccess);
if (rc != Success) { if (rc != Success) {
pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->member, dixLookupResourceByType((pointer*) &pGlxPixmap, req->member,
__glXPixmapRes); __glXPixmapRes, NullClient,
DixUnknownAccess);
if (pGlxPixmap) pMember = pGlxPixmap->pDraw; if (pGlxPixmap) pMember = pGlxPixmap->pDraw;
} }
if (!pMember && __GLX_IS_VERSION_SUPPORTED(1,3) ) { if (!pMember && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
pGlxWindow = (__glXWindow *) LookupIDByType(req->member, dixLookupResourceByType((pointer*) &pGlxWindow, req->member,
__glXWindowRes); __glXWindowRes, NullClient,
DixUnknownAccess);
if (pGlxWindow) pMember = pGlxWindow->pDraw; if (pGlxWindow) pMember = pGlxWindow->pDraw;
} }
@ -505,7 +508,8 @@ int __glXDestroyContext(__GLXclientState *cl, GLbyte *pc)
int to_screen = 0; int to_screen = 0;
int s; int s;
glxc = (__GLXcontext *) LookupIDByType(gcId, __glXContextRes); dixLookupResourceByType((pointer*) &glxc, gcId, __glXContextRes,
NullClient, DixUnknownAccess);
if (glxc) { if (glxc) {
/* /*
** Just free the resource; don't actually destroy the context, ** Just free the resource; don't actually destroy the context,
@ -752,7 +756,8 @@ static int MakeCurrent(__GLXclientState *cl,
** Lookup new context. It must not be current for someone else. ** Lookup new context. It must not be current for someone else.
*/ */
if (contextId != None) { if (contextId != None) {
glxc = (__GLXcontext *) LookupIDByType(contextId, __glXContextRes); dixLookupResourceByType((pointer*) &glxc, contextId, __glXContextRes,
NullClient, DixUnknownAccess);
if (!glxc) { if (!glxc) {
client->errorValue = contextId; client->errorValue = contextId;
return __glXBadContext; return __glXBadContext;
@ -802,8 +807,9 @@ static int MakeCurrent(__GLXclientState *cl,
} }
if (!pDraw) { if (!pDraw) {
pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId, dixLookupResourceByType((pointer*) &pGlxPixmap, drawId,
__glXPixmapRes); __glXPixmapRes, NullClient,
DixUnknownAccess);
if (pGlxPixmap) { if (pGlxPixmap) {
/* /*
** Check if pixmap and context are similar. ** Check if pixmap and context are similar.
@ -826,7 +832,9 @@ static int MakeCurrent(__GLXclientState *cl,
} }
if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes); dixLookupResourceByType((pointer*) &pGlxWindow, drawId,
__glXWindowRes, NullClient,
DixUnknownAccess);
if (pGlxWindow) { if (pGlxWindow) {
/* /*
** Drawable is a GLXWindow. ** Drawable is a GLXWindow.
@ -847,7 +855,9 @@ static int MakeCurrent(__GLXclientState *cl,
} }
if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
pGlxPbuffer = (__glXPbuffer *)LookupIDByType(drawId, __glXPbufferRes); dixLookupResourceByType((pointer*) &pGlxPbuffer, drawId,
__glXPbufferRes, NullClient,
DixUnknownAccess);
if (pGlxPbuffer) { if (pGlxPbuffer) {
if (pGlxPbuffer->pScreen != glxc->pScreen || if (pGlxPbuffer->pScreen != glxc->pScreen ||
pGlxPbuffer->pFBConfig != glxc->pFBConfig) { pGlxPbuffer->pFBConfig != glxc->pFBConfig) {
@ -908,8 +918,9 @@ static int MakeCurrent(__GLXclientState *cl,
} }
if (!pReadDraw) { if (!pReadDraw) {
pReadGlxPixmap = (__GLXpixmap *) LookupIDByType(readId, dixLookupResourceByType((pointer*) &pReadGlxPixmap, readId,
__glXPixmapRes); __glXPixmapRes, NullClient,
DixUnknownAccess);
if (pReadGlxPixmap) { if (pReadGlxPixmap) {
/* /*
** Check if pixmap and context are similar. ** Check if pixmap and context are similar.
@ -929,8 +940,9 @@ static int MakeCurrent(__GLXclientState *cl,
} }
if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
pGlxReadWindow = (__glXWindow *) dixLookupResourceByType((pointer*) &pGlxReadWindow, readId,
LookupIDByType(readId, __glXWindowRes); __glXWindowRes, NullClient,
DixUnknownAccess);
if (pGlxReadWindow) { if (pGlxReadWindow) {
/* /*
** Drawable is a GLXWindow. ** Drawable is a GLXWindow.
@ -950,7 +962,9 @@ static int MakeCurrent(__GLXclientState *cl,
} }
if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
pGlxReadPbuffer = (__glXPbuffer *)LookupIDByType(readId, __glXPbufferRes); dixLookupResourceByType((pointer*) &pGlxReadPbuffer, readId,
__glXPbufferRes, NullClient,
DixUnknownAccess);
if (pGlxReadPbuffer) { if (pGlxReadPbuffer) {
if (pGlxReadPbuffer->pScreen != glxc->pScreen || if (pGlxReadPbuffer->pScreen != glxc->pScreen ||
pGlxReadPbuffer->pFBConfig != glxc->pFBConfig) { pGlxReadPbuffer->pFBConfig != glxc->pFBConfig) {
@ -1303,7 +1317,8 @@ int __glXIsDirect(__GLXclientState *cl, GLbyte *pc)
/* /*
** Find the GL context. ** Find the GL context.
*/ */
glxc = (__GLXcontext *) LookupIDByType(req->context, __glXContextRes); dixLookupResourceByType((pointer*) &glxc, req->context, __glXContextRes,
NullClient, DixUnknownAccess);
if (!glxc) { if (!glxc) {
client->errorValue = req->context; client->errorValue = req->context;
return __glXBadContext; return __glXBadContext;
@ -1449,12 +1464,14 @@ int __glXCopyContext(__GLXclientState *cl, GLbyte *pc)
/* /*
** Check that each context exists. ** Check that each context exists.
*/ */
src = (__GLXcontext *) LookupIDByType(source, __glXContextRes); dixLookupResourceByType((pointer*) &src, source, __glXContextRes,
NullClient, DixUnknownAccess);
if (!src) { if (!src) {
client->errorValue = source; client->errorValue = source;
return __glXBadContext; return __glXBadContext;
} }
dst = (__GLXcontext *) LookupIDByType(dest, __glXContextRes); dixLookupResourceByType((pointer*) &dst, dest, __glXContextRes,
NullClient, DixUnknownAccess);
if (!dst) { if (!dst) {
client->errorValue = dest; client->errorValue = dest;
return __glXBadContext; return __glXBadContext;
@ -1870,7 +1887,8 @@ int __glXDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
/* /*
** Check if it's a valid GLX pixmap. ** Check if it's a valid GLX pixmap.
*/ */
pGlxPixmap = (__GLXpixmap *)LookupIDByType(glxpixmap, __glXPixmapRes); dixLookupResourceByType((pointer*) &pGlxPixmap, glxpixmap,
__glXPixmapRes, NullClient, DixUnknownAccess);
if (!pGlxPixmap) { if (!pGlxPixmap) {
client->errorValue = glxpixmap; client->errorValue = glxpixmap;
return __glXBadPixmap; return __glXBadPixmap;
@ -1953,8 +1971,8 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
} }
if (!pDraw) { if (!pDraw) {
pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId, dixLookupResourceByType((pointer*) &pGlxPixmap, drawId,
__glXPixmapRes); __glXPixmapRes, NullClient, DixUnknownAccess);
if (pGlxPixmap) { if (pGlxPixmap) {
/* /*
** Drawable is a GLX pixmap. ** Drawable is a GLX pixmap.
@ -1965,7 +1983,8 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
} }
if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes); dixLookupResourceByType((pointer*) &pGlxWindow, drawId,
__glXWindowRes, NullClient, DixUnknownAccess);
if (pGlxWindow) { if (pGlxWindow) {
/* /*
** Drawable is a GLXWindow. ** Drawable is a GLXWindow.
@ -2100,8 +2119,8 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
} }
if (!pDraw) { if (!pDraw) {
pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId, dixLookupResourceByType((pointer*) &pGlxPixmap, drawId,
__glXPixmapRes); __glXPixmapRes, NullClient, DixUnknownAccess);
if (pGlxPixmap) { if (pGlxPixmap) {
/* /*
** Drawable is a GLX pixmap. ** Drawable is a GLX pixmap.
@ -2111,7 +2130,8 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
} }
if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes); dixLookupResourceByType((pointer*) &pGlxWindow, drawId,
__glXWindowRes, NullClient, DixUnknownAccess);
if (pGlxWindow) { if (pGlxWindow) {
/* /*
** Drawable is a GLXWindow. ** Drawable is a GLXWindow.
@ -2620,9 +2640,13 @@ int __glXUseXFont(__GLXclientState *cl, GLbyte *pc)
** Font can actually be either the ID of a font or the ID of a GC ** Font can actually be either the ID of a font or the ID of a GC
** containing a font. ** containing a font.
*/ */
pFont = (FontPtr)LookupIDByType(req->font, RT_FONT); dixLookupResourceByType((pointer*) &pFont, req->font, RT_FONT,
NullClient, DixUnknownAccess);
if (!pFont) { if (!pFont) {
GC *pGC = (GC *)LookupIDByType(req->font, RT_GC); GC *pGC;
dixLookupResourceByType((pointer*) &pGC, req->font,
RT_GC, NullClient,
DixUnknownAccess);
if (!pGC) { if (!pGC) {
client->errorValue = req->font; client->errorValue = req->font;
return BadFont; return BadFont;
@ -2998,7 +3022,8 @@ int __glXQueryContext(__GLXclientState *cl, GLbyte *pc)
int nReplyBytes; int nReplyBytes;
req = (xGLXQueryContextReq *)pc; req = (xGLXQueryContextReq *)pc;
ctx = (__GLXcontext *) LookupIDByType(req->context, __glXContextRes); dixLookupResourceByType((pointer*) &ctx, req->context, __glXContextRes,
NullClient, DixUnknownAccess);
if (!ctx) { if (!ctx) {
client->errorValue = req->context; client->errorValue = req->context;
return __glXBadContext; return __glXBadContext;
@ -3208,7 +3233,8 @@ int __glXDestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
/* /*
** Check if it's a valid Pbuffer ** Check if it's a valid Pbuffer
*/ */
pGlxPbuffer = (__glXPbuffer *)LookupIDByType(pbuffer, __glXPbufferRes); dixLookupResourceByType((pointer*) &pGlxPbuffer, pbuffer,
__glXPbufferRes, NullClient, DixUnknownAccess);
if (!pGlxPbuffer) { if (!pGlxPbuffer) {
client->errorValue = pbuffer; client->errorValue = pbuffer;
return __glXBadPbuffer; return __glXBadPbuffer;
@ -3280,8 +3306,10 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
} }
if (!pDraw) { if (!pDraw) {
__GLXpixmap *pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId, __GLXpixmap *pGlxPixmap;
__glXPixmapRes); dixLookupResourceByType((pointer*) &pGlxPixmap,
drawId, __glXPixmapRes,
NullClient, DixUnknownAccess);
if (pGlxPixmap) { if (pGlxPixmap) {
pDraw = pGlxPixmap->pDraw; pDraw = pGlxPixmap->pDraw;
screen = pGlxPixmap->pScreen->myNum; screen = pGlxPixmap->pScreen->myNum;
@ -3290,7 +3318,10 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
} }
if (!pDraw) { if (!pDraw) {
__glXWindow *pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes); __glXWindow *pGlxWindow;
dixLookupResourceByType((pointer*) &pGlxWindow,
drawId, __glXWindowRes,
NullClient, DixUnknownAccess);
if (pGlxWindow) { if (pGlxWindow) {
pDraw = pGlxWindow->pDraw; pDraw = pGlxWindow->pDraw;
screen = pGlxWindow->pScreen->myNum; screen = pGlxWindow->pScreen->myNum;
@ -3299,7 +3330,10 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
} }
if (!pDraw) { if (!pDraw) {
__glXPbuffer *pGlxPbuffer = (__glXPbuffer *)LookupIDByType(drawId, __glXPbufferRes); __glXPbuffer *pGlxPbuffer;
dixLookupResourceByType((pointer*) &pGlxPbuffer,
drawId, __glXPbufferRes,
NullClient, DixUnknownAccess);
if (pGlxPbuffer) { if (pGlxPbuffer) {
pDraw = (DrawablePtr)pGlxPbuffer; pDraw = (DrawablePtr)pGlxPbuffer;
screen = pGlxPbuffer->pScreen->myNum; screen = pGlxPbuffer->pScreen->myNum;
@ -3436,8 +3470,10 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
} }
if (!pDraw) { if (!pDraw) {
__GLXpixmap *pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId, __GLXpixmap *pGlxPixmap;
__glXPixmapRes); dixLookupResourceByType((pointer*) &pGlxPixmap,
drawId, __glXPixmapRes,
NullClient, DixUnknownAccess);
if (pGlxPixmap) { if (pGlxPixmap) {
pDraw = pGlxPixmap->pDraw; pDraw = pGlxPixmap->pDraw;
screen = pGlxPixmap->pScreen->myNum; screen = pGlxPixmap->pScreen->myNum;
@ -3446,7 +3482,10 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
} }
if (!pDraw) { if (!pDraw) {
__glXWindow *pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes); __glXWindow *pGlxWindow;
dixLookupResourceByType((pointer*) &pGlxWindow,
drawId, __glXWindowRes,
NullClient, DixUnknownAccess);
if (pGlxWindow) { if (pGlxWindow) {
pDraw = pGlxWindow->pDraw; pDraw = pGlxWindow->pDraw;
screen = pGlxWindow->pScreen->myNum; screen = pGlxWindow->pScreen->myNum;
@ -3455,7 +3494,10 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
} }
if (!pDraw) { if (!pDraw) {
__glXPbuffer *pGlxPbuffer = (__glXPbuffer *)LookupIDByType(drawId, __glXPbufferRes); __glXPbuffer *pGlxPbuffer;
dixLookupResourceByType((pointer*) &pGlxPbuffer,
drawId, __glXPbufferRes,
NullClient, DixUnknownAccess);
if (pGlxPbuffer) { if (pGlxPbuffer) {
pDraw = (DrawablePtr)pGlxPbuffer; pDraw = (DrawablePtr)pGlxPbuffer;
screen = pGlxPbuffer->pScreen->myNum; screen = pGlxPbuffer->pScreen->myNum;