mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-04-27 13:00:46 +02:00
DIX: Remove remaining alloca calls
This commit is contained in:
parent
e63667390d
commit
96c113724a
1 changed files with 15 additions and 15 deletions
|
|
@ -368,7 +368,7 @@ Dispatch(void)
|
|||
InitSelections();
|
||||
nClients = 0;
|
||||
|
||||
clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients);
|
||||
clientReady = (int *) xalloc(sizeof(int) * MaxClients);
|
||||
if (!clientReady)
|
||||
return;
|
||||
|
||||
|
|
@ -489,7 +489,7 @@ Dispatch(void)
|
|||
ddxBeforeReset ();
|
||||
#endif
|
||||
KillAllClients();
|
||||
DEALLOCATE_LOCAL(clientReady);
|
||||
xfree(clientReady);
|
||||
dispatchException &= ~DE_RESET;
|
||||
}
|
||||
|
||||
|
|
@ -873,7 +873,7 @@ ProcQueryTree(register ClientPtr client)
|
|||
{
|
||||
int curChild = 0;
|
||||
|
||||
childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window));
|
||||
childIDs = (Window *) xalloc(numChildren * sizeof(Window));
|
||||
if (!childIDs)
|
||||
return BadAlloc;
|
||||
for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
|
||||
|
|
@ -888,7 +888,7 @@ ProcQueryTree(register ClientPtr client)
|
|||
{
|
||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||
WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs);
|
||||
DEALLOCATE_LOCAL(childIDs);
|
||||
xfree(childIDs);
|
||||
}
|
||||
|
||||
return(client->noClientException);
|
||||
|
|
@ -2572,7 +2572,7 @@ ProcListInstalledColormaps(register ClientPtr client)
|
|||
return(BadWindow);
|
||||
|
||||
preply = (xListInstalledColormapsReply *)
|
||||
ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) +
|
||||
xalloc(sizeof(xListInstalledColormapsReply) +
|
||||
pWin->drawable.pScreen->maxInstalledCmaps *
|
||||
sizeof(Colormap));
|
||||
if(!preply)
|
||||
|
|
@ -2587,7 +2587,7 @@ ProcListInstalledColormaps(register ClientPtr client)
|
|||
WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply);
|
||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||
WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]);
|
||||
DEALLOCATE_LOCAL(preply);
|
||||
xfree(preply);
|
||||
return(client->noClientException);
|
||||
}
|
||||
|
||||
|
|
@ -2714,7 +2714,7 @@ ProcAllocColorCells (register ClientPtr client)
|
|||
}
|
||||
nmasks = stuff->planes;
|
||||
length = ((long)npixels + (long)nmasks) * sizeof(Pixel);
|
||||
ppixels = (Pixel *)ALLOCATE_LOCAL(length);
|
||||
ppixels = (Pixel *)xalloc(length);
|
||||
if(!ppixels)
|
||||
return(BadAlloc);
|
||||
pmasks = ppixels + npixels;
|
||||
|
|
@ -2722,7 +2722,7 @@ ProcAllocColorCells (register ClientPtr client)
|
|||
if( (retval = AllocColorCells(client->index, pcmp, npixels, nmasks,
|
||||
(Bool)stuff->contiguous, ppixels, pmasks)) )
|
||||
{
|
||||
DEALLOCATE_LOCAL(ppixels);
|
||||
xfree(ppixels);
|
||||
if (client->noClientException != Success)
|
||||
return(client->noClientException);
|
||||
else
|
||||
|
|
@ -2741,7 +2741,7 @@ ProcAllocColorCells (register ClientPtr client)
|
|||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||
WriteSwappedDataToClient(client, length, ppixels);
|
||||
}
|
||||
DEALLOCATE_LOCAL(ppixels);
|
||||
xfree(ppixels);
|
||||
return (client->noClientException);
|
||||
}
|
||||
else
|
||||
|
|
@ -2782,7 +2782,7 @@ ProcAllocColorPlanes(register ClientPtr client)
|
|||
acpr.sequenceNumber = client->sequence;
|
||||
acpr.nPixels = npixels;
|
||||
length = (long)npixels * sizeof(Pixel);
|
||||
ppixels = (Pixel *)ALLOCATE_LOCAL(length);
|
||||
ppixels = (Pixel *)xalloc(length);
|
||||
if(!ppixels)
|
||||
return(BadAlloc);
|
||||
if( (retval = AllocColorPlanes(client->index, pcmp, npixels,
|
||||
|
|
@ -2790,7 +2790,7 @@ ProcAllocColorPlanes(register ClientPtr client)
|
|||
(Bool)stuff->contiguous, ppixels,
|
||||
&acpr.redMask, &acpr.greenMask, &acpr.blueMask)) )
|
||||
{
|
||||
DEALLOCATE_LOCAL(ppixels);
|
||||
xfree(ppixels);
|
||||
if (client->noClientException != Success)
|
||||
return(client->noClientException);
|
||||
else
|
||||
|
|
@ -2805,7 +2805,7 @@ ProcAllocColorPlanes(register ClientPtr client)
|
|||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||
WriteSwappedDataToClient(client, length, ppixels);
|
||||
}
|
||||
DEALLOCATE_LOCAL(ppixels);
|
||||
xfree(ppixels);
|
||||
return (client->noClientException);
|
||||
}
|
||||
else
|
||||
|
|
@ -2934,12 +2934,12 @@ ProcQueryColors(register ClientPtr client)
|
|||
xQueryColorsReply qcr;
|
||||
|
||||
count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2;
|
||||
prgbs = (xrgb *)ALLOCATE_LOCAL(count * sizeof(xrgb));
|
||||
prgbs = (xrgb *)xalloc(count * sizeof(xrgb));
|
||||
if(!prgbs && count)
|
||||
return(BadAlloc);
|
||||
if( (retval = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) )
|
||||
{
|
||||
if (prgbs) DEALLOCATE_LOCAL(prgbs);
|
||||
if (prgbs) xfree(prgbs);
|
||||
if (client->noClientException != Success)
|
||||
return(client->noClientException);
|
||||
else
|
||||
|
|
@ -2958,7 +2958,7 @@ ProcQueryColors(register ClientPtr client)
|
|||
client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend;
|
||||
WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs);
|
||||
}
|
||||
if (prgbs) DEALLOCATE_LOCAL(prgbs);
|
||||
if (prgbs) xfree(prgbs);
|
||||
return(client->noClientException);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue