Xext: switch mbuf.c to dixLookupResourceByType

Resolves a linker error caused by LookupIDByType.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-09-22 11:13:58 +10:00
parent 493d2f9c2f
commit 693d4fdb1c

View File

@ -741,6 +741,7 @@ ProcDisplayImageBuffers (client)
int i, j; int i, j;
CARD32 minDelay; CARD32 minDelay;
TimeStamp activateTime, bufferTime; TimeStamp activateTime, bufferTime;
int rc;
REQUEST_AT_LEAST_SIZE (xMbufDisplayImageBuffersReq); REQUEST_AT_LEAST_SIZE (xMbufDisplayImageBuffersReq);
@ -762,9 +763,9 @@ ProcDisplayImageBuffers (client)
activateTime.milliseconds = 0; activateTime.milliseconds = 0;
for (i = 0; i < nbuf; i++) for (i = 0; i < nbuf; i++)
{ {
pMultibuffer[i] = (MultibufferPtr) LookupIDByType (ids[i], rc = dixLookupResourceByType(&pMultibuffer[i], ids[i],
MultibufferResType); MultibufferResType, client, DixUseAccess);
if (!pMultibuffer[i]) if (rc != Success)
{ {
xfree(ppMultibuffers); xfree(ppMultibuffers);
xfree(pMultibuffer); xfree(pMultibuffer);
@ -835,8 +836,9 @@ ProcSetMBufferAttributes (client)
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;
pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType); rc = dixLookupResourceByType(&pMultibuffers, pWin->drawable.id,
if (!pMultibuffers) MultibufferResType, client, DixSetAttrAccess);
if (rc != Success)
return BadMatch; return BadMatch;
len = stuff->length - bytes_to_int32(sizeof (xMbufSetMBufferAttributesReq)); len = stuff->length - bytes_to_int32(sizeof (xMbufSetMBufferAttributesReq));
vmask = stuff->valueMask; vmask = stuff->valueMask;
@ -887,8 +889,9 @@ ProcGetMBufferAttributes (client)
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess); rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;
pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType); rc = dixLookupResourceByType(&pMultibuffers, pWin->drawable.id,
if (!pMultibuffers) MultibufferResType, client, DixGetAttrAccess);
if (rc != Success)
return BadAccess; return BadAccess;
ids = xalloc (pMultibuffers->numMultibuffer * sizeof (XID)); ids = xalloc (pMultibuffers->numMultibuffer * sizeof (XID));
if (!ids) if (!ids)
@ -928,10 +931,13 @@ ProcSetBufferAttributes (client)
XID *vlist; XID *vlist;
Mask eventMask; Mask eventMask;
int result; int result;
int rc;
REQUEST_AT_LEAST_SIZE (xMbufSetBufferAttributesReq); REQUEST_AT_LEAST_SIZE (xMbufSetBufferAttributesReq);
pMultibuffer = (MultibufferPtr) LookupIDByType (stuff->buffer, MultibufferResType);
if (!pMultibuffer) rc = dixLookupResourceByType(&pMultibuffer, stuff->buffer,
MultibufferResType, client, DixSetAttrAccess);
if (rc != Success)
return MultibufferErrorBase + MultibufferBadBuffer; return MultibufferErrorBase + MultibufferBadBuffer;
len = stuff->length - bytes_to_int32(sizeof (xMbufSetBufferAttributesReq)); len = stuff->length - bytes_to_int32(sizeof (xMbufSetBufferAttributesReq));
vmask = stuff->valueMask; vmask = stuff->valueMask;
@ -968,10 +974,12 @@ ProcGetBufferAttributes (client)
xMbufGetBufferAttributesReply rep; xMbufGetBufferAttributesReply rep;
OtherClientsPtr other; OtherClientsPtr other;
int n; int n;
int rc;
REQUEST_SIZE_MATCH (xMbufGetBufferAttributesReq); REQUEST_SIZE_MATCH (xMbufGetBufferAttributesReq);
pMultibuffer = (MultibufferPtr) LookupIDByType (stuff->buffer, MultibufferResType); rc = dixLookupResourceByType(&pMultibuffer, stuff->buffer,
if (!pMultibuffer) MultibufferResType, client, DixGetAttrAccess);
if (rc != Success)
return MultibufferErrorBase + MultibufferBadBuffer; return MultibufferErrorBase + MultibufferBadBuffer;
rep.type = X_Reply; rep.type = X_Reply;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
@ -1078,10 +1086,12 @@ ProcClearImageBufferArea (client)
int width, height; int width, height;
DrawablePtr pDrawable; DrawablePtr pDrawable;
ScreenPtr pScreen; ScreenPtr pScreen;
int rc;
REQUEST_SIZE_MATCH (xMbufClearImageBufferAreaReq); REQUEST_SIZE_MATCH (xMbufClearImageBufferAreaReq);
pMultibuffer = (MultibufferPtr) LookupIDByType (stuff->buffer, MultibufferResType); rc = dixLookupResourceByType(&pMultibuffer, stuff->buffer,
if (!pMultibuffer) MultibufferResType, client, DixWriteAccess);
if (rc != Success)
return MultibufferErrorBase + MultibufferBadBuffer; return MultibufferErrorBase + MultibufferBadBuffer;
if ((stuff->exposures != xTrue) && (stuff->exposures != xFalse)) if ((stuff->exposures != xTrue) && (stuff->exposures != xFalse))
{ {