Replace dixLookupResource by dixLookupResourceBy{Type,Class}

dixLookupResource attempted to automatically detect whether the caller
wanted a lookup by-type or by-class, unfortunately, it guessed wrong for
RT_NONE. Instead of trying to make the guess better, this patch just reverts
the unification and creates separate functions for each operation.
This commit is contained in:
Keith Packard 2008-08-06 15:26:24 -07:00
commit f8dd80d13b
21 changed files with 161 additions and 94 deletions

View file

@ -216,7 +216,7 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client,
if (id == INVALID)
return BadDrawable;
rc = dixLookupResource((pointer *)&pTmp, id, RC_DRAWABLE, client, access);
rc = dixLookupResourceByClass((pointer *)&pTmp, id, RC_DRAWABLE, client, access);
if (rc == BadValue)
return BadDrawable;
@ -259,7 +259,7 @@ dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access)
if (!clientIndex || !clients[clientIndex] || (rid & SERVER_BIT))
goto bad;
rc = dixLookupResource(&pRes, rid, RC_ANY, client, DixGetAttrAccess);
rc = dixLookupResourceByClass(&pRes, rid, RC_ANY, client, DixGetAttrAccess);
if (rc != Success)
goto bad;