Convert remaining GLX LookupIDByType() calls

This commit is contained in:
Kristian Høgsberg 2009-04-07 16:28:08 -04:00
parent 92562747a0
commit df27b870a8
2 changed files with 15 additions and 7 deletions

View File

@ -254,6 +254,7 @@ AddScreenVisuals(ScreenPtr pScreen, int count, int d)
VisualPtr visuals; VisualPtr visuals;
ColormapPtr installedCmap; ColormapPtr installedCmap;
DepthPtr depth; DepthPtr depth;
int rc;
depth = NULL; depth = NULL;
for (i = 0; i < pScreen->numDepths; i++) { for (i = 0; i < pScreen->numDepths; i++) {
@ -294,8 +295,10 @@ AddScreenVisuals(ScreenPtr pScreen, int count, int d)
* for all colormaps. * for all colormaps.
*/ */
for (i = 0; i < numInstalledCmaps; i++) { for (i = 0; i < numInstalledCmaps; i++) {
installedCmap = LookupIDByType (installedCmaps[i], RT_COLORMAP); rc = dixLookupResourceByType((pointer *)&installedCmap,
if (!installedCmap) installedCmaps[i], RT_COLORMAP,
serverClient, DixReadAccess);
if (rc != Success)
continue; continue;
j = installedCmap->pVisual - pScreen->visuals; j = installedCmap->pVisual - pScreen->visuals;
installedCmap->pVisual = &visuals[j]; installedCmap->pVisual = &visuals[j];

View File

@ -180,12 +180,17 @@ int __glXDisp_UseXFont(__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);
if (!pFont) { error = dixLookupResourceByType((pointer *)&pFont,
pGC = (GC *)LookupIDByType(req->font, RT_GC); req->font, RT_FONT,
if (!pGC) { client, DixReadAccess);
if (error != Success) {
error = dixLookupResourceByType((pointer *)&pGC,
req->font, RT_GC,
client, DixReadAccess);
if (error != Success) {
client->errorValue = req->font; client->errorValue = req->font;
return BadFont; return error == BadGC ? BadFont : error;
} }
pFont = pGC->font; pFont = pGC->font;
} }