Commit 74a5450b authored by Mike Gabriel's avatar Mike Gabriel

nx-X11/programs/Xserver: Drop {X,x}realloc() macros, use realloc() instead.

parent 2646fc25
......@@ -60,7 +60,6 @@ from The Open Group.
#else
#include <stdlib.h>
#define xcalloc(_num,_size) calloc(_num,_size)
#define xrealloc(_ptr,_size) realloc(_ptr,_size)
#endif
#include "Xtransint.h"
......
......@@ -94,7 +94,7 @@ void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize)
free(addr);
return NULL;
}
newAddr = xrealloc(addr, newSize);
newAddr = realloc(addr, newSize);
} else {
if (newSize == 0) {
return NULL;
......
......@@ -105,7 +105,7 @@ __glXRealloc(void *addr, size_t newSize)
free(addr);
return NULL;
} else {
newAddr = xrealloc(addr, newSize);
newAddr = realloc(addr, newSize);
}
} else {
if (newSize == 0) {
......
......@@ -93,7 +93,7 @@ extern xGLXSingleReply __glXReply;
else if ((size) > sizeof(answerBuffer)) { \
int bump; \
if ((cl)->returnBufSize < (size)+(align)) { \
(cl)->returnBuf = (GLbyte*)Xrealloc((cl)->returnBuf, \
(cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \
(size)+(align)); \
if (!(cl)->returnBuf) { \
return BadAlloc; \
......
......@@ -1217,7 +1217,7 @@ XineramaGetImageData(
if(sizeNeeded > size) {
char *tmpdata = ScratchMem;
ScratchMem = xrealloc(ScratchMem, sizeNeeded);
ScratchMem = realloc(ScratchMem, sizeNeeded);
if(ScratchMem)
size = sizeNeeded;
else {
......
......@@ -1720,7 +1720,7 @@ SecurityParseSitePolicy(
if (!copyPolicyStr)
return TRUE;
strcpy(copyPolicyStr, policyStr);
newStrings = (char **)Xrealloc(SecurityPolicyStrings,
newStrings = (char **)realloc(SecurityPolicyStrings,
sizeof (char *) * (nSecurityPolicyStrings + 1));
if (!newStrings)
{
......
......@@ -1058,7 +1058,7 @@ SyncCreateSystemCounter(name, initial, resolution, counterType,
{
SyncCounter *pCounter;
SysCounterList = (SyncCounter **)xrealloc(SysCounterList,
SysCounterList = (SyncCounter **)realloc(SysCounterList,
(SyncNumSystemCounters+1)*sizeof(SyncCounter *));
if (!SysCounterList)
return (void *)NULL;
......
......@@ -168,7 +168,7 @@ ProcXChangeKeyboardDevice (client)
if (df->traceSize != xf->traceSize)
{
Must_have_memory = TRUE; /* XXX */
df->trace = (WindowPtr *) xrealloc(df->trace,
df->trace = (WindowPtr *) realloc(df->trace,
xf->traceSize * sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
}
......
......@@ -230,7 +230,7 @@ compRegisterAlternateVisuals(CompScreenPtr cs, VisualID * vids, int nVisuals)
p = reallocarray(cs->alternateVisuals,
cs->numAlternateVisuals + nVisuals, sizeof(VisualID));
#else
p = xrealloc(cs->alternateVisuals,
p = realloc(cs->alternateVisuals,
sizeof(VisualID) * (cs->numAlternateVisuals + nVisuals));
#endif
if (p == NULL)
......@@ -265,7 +265,7 @@ CompositeRegisterImplicitRedirectionException(ScreenPtr pScreen,
p = reallocarray(cs->implicitRedirectExceptions,
cs->numImplicitRedirectExceptions + 1, sizeof(p[0]));
#else
p = xrealloc(cs->implicitRedirectExceptions,
p = realloc(cs->implicitRedirectExceptions,
sizeof(p[0]) * (cs->numImplicitRedirectExceptions + 1));
#endif
if (p == NULL)
......
......@@ -268,7 +268,7 @@ DbeAllocWinPrivPriv(pScreen, index, amount)
if (index >= pDbeScreenPriv->winPrivPrivLen)
{
unsigned *nsizes;
nsizes = (unsigned *)xrealloc(pDbeScreenPriv->winPrivPrivSizes,
nsizes = (unsigned *)realloc(pDbeScreenPriv->winPrivPrivSizes,
(index + 1) * sizeof(unsigned));
if (!nsizes)
{
......@@ -564,7 +564,7 @@ ProcDbeAllocateBackBufferName(client)
}
/* malloc/realloc a new array and initialize all elements to 0. */
pDbeWindowPriv->IDs = (XID *)xrealloc(pIDs,
pDbeWindowPriv->IDs = (XID *)realloc(pIDs,
(pDbeWindowPriv->maxAvailableIDs+DBE_INCR_MAX_IDS)*sizeof(XID));
if (!pDbeWindowPriv->IDs)
{
......
......@@ -129,7 +129,7 @@ MakeAtom(const char *string, unsigned len, Bool makeit)
if ((lastAtom + 1) >= tableLength) {
NodePtr *table;
table = (NodePtr *) xrealloc(nodeTable,
table = (NodePtr *) realloc(nodeTable,
tableLength * (2 * sizeof(NodePtr)));
if (!table) {
if (nd->string != string)
......
......@@ -841,7 +841,7 @@ AllocColor (ColormapPtr pmap,
*pgreen = pmap->red[pixR].co.local.green;
*pblue = pmap->red[pixR].co.local.blue;
npix = pmap->numPixelsRed[client];
ppix = (Pixel *) xrealloc(pmap->clientPixelsRed[client],
ppix = (Pixel *) realloc(pmap->clientPixelsRed[client],
(npix + 1) * sizeof(Pixel));
if (!ppix)
return (BadAlloc);
......@@ -864,21 +864,21 @@ AllocColor (ColormapPtr pmap,
*pgreen = pmap->green[pixG].co.local.green;
*pblue = pmap->blue[pixB].co.local.blue;
npix = pmap->numPixelsRed[client];
ppix = (Pixel *) xrealloc(pmap->clientPixelsRed[client],
ppix = (Pixel *) realloc(pmap->clientPixelsRed[client],
(npix + 1) * sizeof(Pixel));
if (!ppix)
return (BadAlloc);
ppix[npix] = pixR;
pmap->clientPixelsRed[client] = ppix;
npix = pmap->numPixelsGreen[client];
ppix = (Pixel *) xrealloc(pmap->clientPixelsGreen[client],
ppix = (Pixel *) realloc(pmap->clientPixelsGreen[client],
(npix + 1) * sizeof(Pixel));
if (!ppix)
return (BadAlloc);
ppix[npix] = pixG;
pmap->clientPixelsGreen[client] = ppix;
npix = pmap->numPixelsBlue[client];
ppix = (Pixel *) xrealloc(pmap->clientPixelsBlue[client],
ppix = (Pixel *) realloc(pmap->clientPixelsBlue[client],
(npix + 1) * sizeof(Pixel));
if (!ppix)
return (BadAlloc);
......@@ -1348,7 +1348,7 @@ gotit:
break;
}
npix = nump[client];
ppix = (Pixel *) xrealloc (pixp[client], (npix + 1) * sizeof(Pixel));
ppix = (Pixel *) realloc (pixp[client], (npix + 1) * sizeof(Pixel));
if (!ppix)
{
pent->refcnt--;
......@@ -1762,17 +1762,17 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont
if (okR && okG && okB)
{
rpix = (Pixel *) xrealloc(pmap->clientPixelsRed[client],
rpix = (Pixel *) realloc(pmap->clientPixelsRed[client],
(pmap->numPixelsRed[client] + (c << r)) *
sizeof(Pixel));
if (rpix)
pmap->clientPixelsRed[client] = rpix;
gpix = (Pixel *) xrealloc(pmap->clientPixelsGreen[client],
gpix = (Pixel *) realloc(pmap->clientPixelsGreen[client],
(pmap->numPixelsGreen[client] + (c << g)) *
sizeof(Pixel));
if (gpix)
pmap->clientPixelsGreen[client] = gpix;
bpix = (Pixel *) xrealloc(pmap->clientPixelsBlue[client],
bpix = (Pixel *) realloc(pmap->clientPixelsBlue[client],
(pmap->numPixelsBlue[client] + (c << b)) *
sizeof(Pixel));
if (bpix)
......@@ -1861,7 +1861,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig,
/* all the allocated pixels are added to the client pixel list,
* but only the unique ones are returned to the client */
ppix = (Pixel *)xrealloc(pmap->clientPixelsRed[client],
ppix = (Pixel *)realloc(pmap->clientPixelsRed[client],
(pmap->numPixelsRed[client] + npix) * sizeof(Pixel));
if (!ppix)
{
......@@ -2364,7 +2364,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe
npix++;
}
}
pptr = (Pixel *)xrealloc(ppixClient, npixNew * sizeof(Pixel));
pptr = (Pixel *)realloc(ppixClient, npixNew * sizeof(Pixel));
if (pptr)
ppixClient = pptr;
npixClient = npixNew;
......@@ -2729,7 +2729,7 @@ ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, DepthPtr depth)
vids = reallocarray(depth->vids, depth->numVids + new_visual_count,
sizeof(XID));
#else
vids = xrealloc(depth->vids, sizeof(XID) *
vids = realloc(depth->vids, sizeof(XID) *
(depth->numVids + new_visual_count));
#endif
if (!vids)
......@@ -2742,7 +2742,7 @@ ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, DepthPtr depth)
#if 0 /* !defined(NXAGENT_SERVER) */
visuals = reallocarray(pScreen->visuals, numVisuals, sizeof(VisualRec));
#else
visuals = xrealloc(pScreen->visuals, sizeof(VisualRec) * numVisuals);
visuals = realloc(pScreen->visuals, sizeof(VisualRec) * numVisuals);
#endif
if (!visuals) {
return FALSE;
......
......@@ -1023,7 +1023,7 @@ ProcSetSelectionOwner(register ClientPtr client)
if (i == 0)
newsels = (Selection *)malloc(sizeof(Selection));
else
newsels = (Selection *)xrealloc(CurrentSelections,
newsels = (Selection *)realloc(CurrentSelections,
(NumCurrentSelections + 1) * sizeof(Selection));
if (!newsels)
return BadAlloc;
......
......@@ -170,7 +170,7 @@ QueueFontWakeup(FontPathElementPtr fpe)
}
if (num_slept_fpes == size_slept_fpes) {
new = (FontPathElementPtr *)
xrealloc(slept_fpes,
realloc(slept_fpes,
sizeof(FontPathElementPtr) * (size_slept_fpes + 4));
if (!new)
return;
......@@ -302,7 +302,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
if (err == FontNameAlias && alias) {
newlen = strlen(alias);
newname = (char *) xrealloc(c->fontname, newlen);
newname = (char *) realloc(c->fontname, newlen);
if (!newname) {
err = AllocError;
break;
......@@ -1038,7 +1038,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
reply = c->reply;
if (c->length < length)
{
reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length);
reply = (xListFontsWithInfoReply *) realloc(c->reply, length);
if (!reply)
{
err = AllocError;
......@@ -1998,7 +1998,7 @@ RegisterFPEFunctions(NameCheckFunc name_func,
FPEFunctions *new;
/* grow the list */
new = (FPEFunctions *) xrealloc(fpe_functions,
new = (FPEFunctions *) realloc(fpe_functions,
(num_fpe_types + 1) * sizeof(FPEFunctions));
if (!new)
return -1;
......
......@@ -351,7 +351,7 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode,
if (j < numnow) /* duplicate */
return(Success);
numnow++;
pTmp = (SaveSetElt *)xrealloc(client->saveSet, sizeof(*pTmp) * numnow);
pTmp = (SaveSetElt *)realloc(client->saveSet, sizeof(*pTmp) * numnow);
if (!pTmp)
return(BadAlloc);
client->saveSet = pTmp;
......@@ -371,7 +371,7 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode,
numnow--;
if (numnow)
{
pTmp = (SaveSetElt *)xrealloc(client->saveSet, sizeof(*pTmp) * numnow);
pTmp = (SaveSetElt *)realloc(client->saveSet, sizeof(*pTmp) * numnow);
if (pTmp)
client->saveSet = pTmp;
}
......@@ -504,7 +504,7 @@ RegisterBlockAndWakeupHandlers (BlockHandlerProcPtr blockHandler,
if (numHandlers >= sizeHandlers)
{
new = (BlockHandlerPtr) xrealloc (handlers, (numHandlers + 1) *
new = (BlockHandlerPtr) realloc (handlers, (numHandlers + 1) *
sizeof (BlockHandlerRec));
if (!new)
return FALSE;
......
......@@ -1952,7 +1952,7 @@ XYToWindow(int x, int y)
{
spriteTraceSize += 10;
Must_have_memory = TRUE; /* XXX */
spriteTrace = (WindowPtr *)xrealloc(
spriteTrace = (WindowPtr *)realloc(
spriteTrace, spriteTraceSize*sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
}
......@@ -2467,7 +2467,7 @@ CheckPassiveGrabsOnWindow(
if (device->sync.evcount < count)
{
Must_have_memory = TRUE; /* XXX */
device->sync.event = (xEvent *)xrealloc(device->sync.event,
device->sync.event = (xEvent *)realloc(device->sync.event,
count*
sizeof(xEvent));
Must_have_memory = FALSE; /* XXX */
......@@ -2639,7 +2639,7 @@ DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev,
if (thisDev->sync.evcount < count)
{
Must_have_memory = TRUE; /* XXX */
thisDev->sync.event = (xEvent *)xrealloc(thisDev->sync.event,
thisDev->sync.event = (xEvent *)realloc(thisDev->sync.event,
count*sizeof(xEvent));
Must_have_memory = FALSE; /* XXX */
}
......@@ -3530,7 +3530,7 @@ SetInputFocus(
{
focus->traceSize = depth+1;
Must_have_memory = TRUE; /* XXX */
focus->trace = (WindowPtr *)xrealloc(focus->trace,
focus->trace = (WindowPtr *)realloc(focus->trace,
focus->traceSize *
sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
......
......@@ -108,7 +108,7 @@ AddExtension(char *name, int NumEvents, int NumErrors,
}
strcpy(ext->name, name);
i = NumExtensions;
newexts = (ExtensionEntry **) xrealloc(extensions,
newexts = (ExtensionEntry **) realloc(extensions,
(i + 1) * sizeof(ExtensionEntry *));
if (!newexts)
{
......@@ -159,7 +159,7 @@ Bool AddExtensionAlias(char *alias, ExtensionEntry *ext)
char *name;
char **aliases;
aliases = (char **)xrealloc(ext->aliases,
aliases = (char **)realloc(ext->aliases,
(ext->num_aliases + 1) * sizeof(char *));
if (!aliases)
return FALSE;
......@@ -442,7 +442,7 @@ RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc)
if (!newname)
return FALSE;
procEntry = (ProcEntryPtr)
xrealloc(spentry->procList,
realloc(spentry->procList,
sizeof(ProcEntryRec) * (spentry->num+1));
if (!procEntry)
{
......
......@@ -618,7 +618,7 @@ CreateConnectionBlock()
{
lenofblock += sizeof(xDepth) +
(pDepth->numVids * sizeof(xVisualType));
pBuf = (char *)xrealloc(ConnectionInfo, lenofblock);
pBuf = (char *)realloc(ConnectionInfo, lenofblock);
if (!pBuf)
{
free(ConnectionInfo);
......
......@@ -89,7 +89,7 @@ AllocateClientPrivate(int index2, unsigned amount)
if (index2 >= clientPrivateLen)
{
unsigned *nsizes;
nsizes = (unsigned *)xrealloc(clientPrivateSizes,
nsizes = (unsigned *)realloc(clientPrivateSizes,
(index2 + 1) * sizeof(unsigned));
if (!nsizes)
return FALSE;
......@@ -136,7 +136,7 @@ AllocateScreenPrivateIndex()
for (i = 0; i < screenInfo.numScreens; i++)
{
pScreen = screenInfo.screens[i];
nprivs = (DevUnion *)xrealloc(pScreen->devPrivates,
nprivs = (DevUnion *)realloc(pScreen->devPrivates,
screenPrivateCount * sizeof(DevUnion));
if (!nprivs)
{
......@@ -180,7 +180,7 @@ AllocateWindowPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
if (index2 >= pScreen->WindowPrivateLen)
{
unsigned *nsizes;
nsizes = (unsigned *)xrealloc(pScreen->WindowPrivateSizes,
nsizes = (unsigned *)realloc(pScreen->WindowPrivateSizes,
(index2 + 1) * sizeof(unsigned));
if (!nsizes)
return FALSE;
......@@ -230,7 +230,7 @@ AllocateGCPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
if (index2 >= pScreen->GCPrivateLen)
{
unsigned *nsizes;
nsizes = (unsigned *)xrealloc(pScreen->GCPrivateSizes,
nsizes = (unsigned *)realloc(pScreen->GCPrivateSizes,
(index2 + 1) * sizeof(unsigned));
if (!nsizes)
return FALSE;
......@@ -280,7 +280,7 @@ AllocatePixmapPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
if (index2 >= pScreen->PixmapPrivateLen)
{
unsigned *nsizes;
nsizes = (unsigned *)xrealloc(pScreen->PixmapPrivateSizes,
nsizes = (unsigned *)realloc(pScreen->PixmapPrivateSizes,
(index2 + 1) * sizeof(unsigned));
if (!nsizes)
return FALSE;
......@@ -345,7 +345,7 @@ AllocateColormapPrivateIndex (InitCmapPrivFunc initPrivFunc)
if (pColormap)
{
privs = (DevUnion *) xrealloc (pColormap->devPrivates,
privs = (DevUnion *) realloc (pColormap->devPrivates,
colormapPrivateCount * sizeof(DevUnion));
if (!privs) {
colormapPrivateCount--;
......@@ -380,7 +380,7 @@ Bool
AllocateDevicePrivate(DeviceIntPtr device, int index)
{
if (device->nPrivates < ++index) {
DevUnion *nprivs = (DevUnion *) xrealloc(device->devPrivates,
DevUnion *nprivs = (DevUnion *) realloc(device->devPrivates,
index * sizeof(DevUnion));
if (!nprivs)
return FALSE;
......
......@@ -318,7 +318,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
{
if (totalSize != pProp->size * (pProp->format >> 3))
{
data = (void *)xrealloc(pProp->data, totalSize);
data = (void *)realloc(pProp->data, totalSize);
if (!data && len)
return(BadAlloc);
pProp->data = data;
......@@ -335,7 +335,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
}
else if (mode == PropModeAppend)
{
data = (void *)xrealloc(pProp->data,
data = (void *)realloc(pProp->data,
sizeInBytes * (len + pProp->size));
if (!data)
return(BadAlloc);
......
......@@ -210,7 +210,7 @@ if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
{ \
size_t NewSize = RegionSizeof(numRects); \
RegDataPtr NewData = \
(NewSize > 0) ? (RegDataPtr)xrealloc((reg)->data, NewSize) : NULL; \
(NewSize > 0) ? (RegDataPtr)realloc((reg)->data, NewSize) : NULL; \
if (NewData) \
{ \
NewData->size = (numRects); \
......@@ -391,7 +391,7 @@ RegionRectAlloc(
}
n += pRgn->data->numRects;
rgnSize = RegionSizeof(n);
data = (rgnSize > 0) ? xrealloc(pRgn->data, rgnSize) : NULL;
data = (rgnSize > 0) ? realloc(pRgn->data, rgnSize) : NULL;
if (!data)
return RegionBreak (pRgn);
pRgn->data = data;
......@@ -1299,7 +1299,7 @@ RegionValidate(badreg, pOverlap)
{
/* Oops, allocate space for new region information */
sizeRI <<= 1;
rit = (RegionInfo *) xrealloc(ri, sizeRI * sizeof(RegionInfo));
rit = (RegionInfo *) realloc(ri, sizeRI * sizeof(RegionInfo));
if (!rit)
goto bail;
ri = rit;
......
......@@ -178,7 +178,7 @@ CreateNewResourceType(DeleteType deleteFunc)
if (next & lastResourceClass)
return 0;
funcs = (DeleteType *)xrealloc(DeleteFuncs,
funcs = (DeleteType *)realloc(DeleteFuncs,
(next + 1) * sizeof(DeleteType));
if (!funcs)
return 0;
......@@ -186,7 +186,7 @@ CreateNewResourceType(DeleteType deleteFunc)
#ifdef XResExtension
{
Atom *newnames;
newnames = xrealloc(ResourceNames, (next + 1) * sizeof(Atom));
newnames = realloc(ResourceNames, (next + 1) * sizeof(Atom));
if(!newnames)
return 0;
ResourceNames = newnames;
......
......@@ -2549,7 +2549,7 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentNumDefaultColormaps = nxagentNumVisuals;
nxagentDefaultColormaps = (Colormap *) xrealloc(nxagentDefaultColormaps,
nxagentDefaultColormaps = (Colormap *) realloc(nxagentDefaultColormaps,
nxagentNumDefaultColormaps * sizeof(Colormap));
if (nxagentDefaultColormaps == NULL)
......
......@@ -306,7 +306,7 @@ void nxagentListRemoteAddName(const char *name, int status)
if (nxagentRemoteFontList.length == nxagentRemoteFontList.listSize)
{
nxagentRemoteFontList.list = xrealloc(nxagentRemoteFontList.list, sizeof(nxagentFontRecPtr)
nxagentRemoteFontList.list = realloc(nxagentRemoteFontList.list, sizeof(nxagentFontRecPtr)
* (nxagentRemoteFontList.listSize + 1000));
if (nxagentRemoteFontList.list == NULL)
......@@ -569,7 +569,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
if (CACHE_INDEX == CACHE_SIZE)
{
CACHE_ENTRY_PTR = xrealloc(CACHE_ENTRY_PTR, sizeof(nxCacheFontEntryRecPtr) * (CACHE_SIZE + 100));
CACHE_ENTRY_PTR = realloc(CACHE_ENTRY_PTR, sizeof(nxCacheFontEntryRecPtr) * (CACHE_SIZE + 100));
if (CACHE_ENTRY_PTR == NULL)
{
......
......@@ -1613,7 +1613,7 @@ GCPtr nxagentCreateGraphicContext(int depth)
* to spread the list and add a new GC.
*/
nxagentGCs = xrealloc(nxagentGraphicContexts, (nxagentGraphicContextsSize + 1) * sizeof(nxagentGraphicContextsRec));
nxagentGCs = realloc(nxagentGraphicContexts, (nxagentGraphicContextsSize + 1) * sizeof(nxagentGraphicContextsRec));
if (nxagentGCs == NULL)
{
......
......@@ -752,7 +752,7 @@ ProcSetSelectionOwner(register ClientPtr client)
if (i == 0)
newsels = (Selection *)malloc(sizeof(Selection));
else
newsels = (Selection *)xrealloc(CurrentSelections,
newsels = (Selection *)realloc(CurrentSelections,
(NumCurrentSelections + 1) * sizeof(Selection));
if (!newsels)
return BadAlloc;
......
......@@ -227,7 +227,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
if (err == FontNameAlias && alias) {
newlen = strlen(alias);
newname = (char *) xrealloc(c->fontname, newlen);
newname = (char *) realloc(c->fontname, newlen);
if (!newname) {
err = AllocError;
break;
......@@ -846,7 +846,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
reply = c->reply;
if (c->length < length)
{
reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length);
reply = (xListFontsWithInfoReply *) realloc(c->reply, length);
if (!reply)
{
err = AllocError;
......
......@@ -363,7 +363,7 @@ XYToWindow(int x, int y)
{
spriteTraceSize += 10;
Must_have_memory = TRUE; /* XXX */
spriteTrace = (WindowPtr *)xrealloc(
spriteTrace = (WindowPtr *)realloc(
spriteTrace, spriteTraceSize*sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
}
......
......@@ -261,7 +261,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
{
if (totalSize != pProp->size * (pProp->format >> 3))
{
data = (void *)xrealloc(pProp->data, totalSize);
data = (void *)realloc(pProp->data, totalSize);
if (!data && len)
return(BadAlloc);
pProp->data = data;
......@@ -278,7 +278,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
}
else if (mode == PropModeAppend)
{
data = (void *)xrealloc(pProp->data,
data = (void *)realloc(pProp->data,
sizeInBytes * (len + pProp->size));
if (!data)
return(BadAlloc);
......
......@@ -1754,7 +1754,7 @@ addCap (
if (*ncapsp == *sizep)
{
newsize = *sizep + ADD_REALLOC_STEP;
cap = (miArcCapPtr) xrealloc (*capsp,
cap = (miArcCapPtr) realloc (*capsp,
newsize * sizeof (**capsp));
if (!cap)
return;
......@@ -1785,7 +1785,7 @@ addJoin (
if (*njoinsp == *sizep)
{
newsize = *sizep + ADD_REALLOC_STEP;
join = (miArcJoinPtr) xrealloc (*joinsp,
join = (miArcJoinPtr) realloc (*joinsp,
newsize * sizeof (**joinsp));
if (!join)
return;
......@@ -1815,7 +1815,7 @@ addArc (
if (*narcsp == *sizep)
{
newsize = *sizep + ADD_REALLOC_STEP;
arc = (miArcDataPtr) xrealloc (*arcsp,
arc = (miArcDataPtr) realloc (*arcsp,
newsize * sizeof (**arcsp));
if (!arc)
return (miArcDataPtr)NULL;
......
......@@ -265,7 +265,7 @@ CheckDashStorage(
miDashPtr newppseg;
*pnsegMax += NSEGDELTA;
newppseg = (miDashPtr)xrealloc(*ppseg,
newppseg = (miDashPtr)realloc(*ppseg,
(*pnsegMax)*sizeof(miDashRec));
if (!newppseg)
{
......
......@@ -155,12 +155,12 @@ void miSubtractSpans (spanGroup, sub)
int *newwid;
#define EXTRA 8
newPt = (DDXPointPtr) xrealloc (spans->points, (spans->count + EXTRA) * sizeof (DDXPointRec));
newPt = (DDXPointPtr) realloc (spans->points, (spans->count + EXTRA) * sizeof (DDXPointRec));
if (!newPt)
break;
spansPt = newPt + (spansPt - spans->points);
spans->points = newPt;
newwid = (int *) xrealloc (spans->widths, (spans->count + EXTRA) * sizeof (int));
newwid = (int *) realloc (spans->widths, (spans->count + EXTRA) * sizeof (int));
if (!newwid)
break;
spansWid = newwid + (spansWid - spans->widths);
......@@ -198,7 +198,7 @@ void miAppendSpans(spanGroup, otherGroup, spans)
if (spanGroup->size == spanGroup->count) {
spanGroup->size = (spanGroup->size + 8) * 2;
spanGroup->group = (Spans *)
xrealloc(spanGroup->group, sizeof(Spans) * spanGroup->size);
realloc(spanGroup->group, sizeof(Spans) * spanGroup->size);
}
spanGroup->group[spanGroup->count] = *spans;
......@@ -456,10 +456,10 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
DDXPointPtr newpoints;
int *newwidths;
ysizes[index] = (ysizes[index] + 8) * 2;
newpoints = (DDXPointPtr) xrealloc(
newpoints = (DDXPointPtr) realloc(
newspans->points,
ysizes[index] * sizeof(DDXPointRec));
newwidths = (int *) xrealloc(
newwidths = (int *) realloc(
newspans->widths,
ysizes[index] * sizeof(int));
if (!newpoints || !newwidths)
......
......@@ -321,7 +321,7 @@ ReadRequestFromClient(ClientPtr client)
/* make buffer bigger to accomodate request */
char *ibuf;
ibuf = (char *)xrealloc(oci->buffer, needed);
ibuf = (char *)realloc(oci->buffer, needed);
if (!ibuf)
{
YieldControlDeath();
......@@ -371,7 +371,7 @@ ReadRequestFromClient(ClientPtr client)
{
char *ibuf;
ibuf = (char *)xrealloc(oci->buffer, BUFSIZE);
ibuf = (char *)realloc(oci->buffer, BUFSIZE);
if (ibuf)
{
oci->size = BUFSIZE;
......@@ -531,7 +531,7 @@ InsertFakeRequest(ClientPtr client, char *data, int count)
{
char *ibuf;
ibuf = (char *)xrealloc(oci->buffer, gotnow + count);
ibuf = (char *)realloc(oci->buffer, gotnow + count);
if (!ibuf)
return(FALSE);
oci->size = gotnow + count;
......@@ -1097,7 +1097,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount)
{
unsigned char *obuf;
obuf = (unsigned char *)xrealloc(oco->buf,
obuf = (unsigned char *)realloc(oco->buf,
notWritten + BUFSIZE);
if (!obuf)
{
......
......@@ -1220,7 +1220,7 @@ InsertFileIntoCommandLine(
}
}
buf = (char *) xrealloc(buf, q - buf);
buf = (char *) realloc(buf, q - buf);
if (!buf)
FatalError("Out of memory reallocing option buf\n");
......
......@@ -86,7 +86,7 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate)
crtcs = reallocarray(pScrPriv->crtcs,
pScrPriv->numCrtcs + 1, sizeof(RRCrtcPtr));
#else /* !defined(NXAGENT_SERVER) */
crtcs = xrealloc(pScrPriv->crtcs,
crtcs = realloc(pScrPriv->crtcs,
(pScrPriv->numCrtcs + 1) * sizeof(RRCrtcPtr));
#endif /* !defined(NXAGENT_SERVER) */
else
......@@ -202,7 +202,7 @@ RRCrtcNotify(RRCrtcPtr crtc,
newoutputs = reallocarray(crtc->outputs,
numOutputs, sizeof(RROutputPtr));
#else /* !defined(NXAGENT_SERVER) */
newoutputs = xrealloc(crtc->outputs,
newoutputs = realloc(crtc->outputs,
numOutputs * sizeof(RROutputPtr));
#endif /* !defined(NXAGENT_SERVER) */
else
......
......@@ -59,7 +59,7 @@ RROldModeAdd(RROutputPtr output, RRScreenSizePtr size, int refresh)
modes = reallocarray(output->modes,
output->numModes + 1, sizeof(RRModePtr));
#else /* !defined(NXAGENT_SERVER) */
modes = xrealloc(output->modes,
modes = realloc(output->modes,
(output->numModes + 1) * sizeof(RRModePtr));
#endif /* !defined(NXAGENT_SERVER) */
else
......@@ -275,7 +275,7 @@ RRRegisterSize(ScreenPtr pScreen,
pNew = reallocarray(pScrPriv->pSizes,
pScrPriv->nSizes + 1, sizeof(RRScreenSize));
#else /* !defined(NXAGENT_SERVER) */
pNew = xrealloc(pScrPriv->pSizes,
pNew = realloc(pScrPriv->pSizes,
(pScrPriv->nSizes + 1) * sizeof(RRScreenSize));
#endif /* !defined(NXAGENT_SERVER) */
if (!pNew)
......@@ -302,7 +302,7 @@ RRRegisterRate(ScreenPtr pScreen, RRScreenSizePtr pSize, int rate)
#ifndef NXAGENT_SERVER
pNew = reallocarray(pSize->pRates, pSize->nRates + 1, sizeof(RRScreenRate));
#else /* !defined(NXAGENT_SERVER) */
pNew = xrealloc(pSize->pRates, (pSize->nRates + 1) * sizeof(RRScreenRate));
pNew = realloc(pSize->pRates, (pSize->nRates + 1) * sizeof(RRScreenRate));
#endif /* !defined(NXAGENT_SERVER) */
if (!pNew)
return FALSE;
......
......@@ -99,7 +99,7 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen)
#ifndef NXAGENT_SERVER
newModes = reallocarray(modes, num_modes + 1, sizeof(RRModePtr));
#else /* !defined(NXAGENT_SERVER) */
newModes = xrealloc(modes, (num_modes + 1) * sizeof(RRModePtr));
newModes = realloc(modes, (num_modes + 1) * sizeof(RRModePtr));
#endif /* !defined(NXAGENT_SERVER) */
else
......
......@@ -512,7 +512,7 @@ RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor)
pScrPriv->numMonitors + 1,
sizeof(RRMonitorPtr));
#else /* !defined(NXAGENT_SERVER) */
monitors = xrealloc(pScrPriv->monitors,
monitors = realloc(pScrPriv->monitors,
(pScrPriv->numMonitors + 1) * sizeof(RRMonitorPtr));
#endif /* !defined(NXAGENT_SERVER) */
else
......
......@@ -79,7 +79,7 @@ RROutputCreate(ScreenPtr pScreen,
outputs = reallocarray(pScrPriv->outputs,
pScrPriv->numOutputs + 1, sizeof(RROutputPtr));
#else /* !defined(NXAGENT_SERVER) */
outputs = xrealloc(pScrPriv->outputs,
outputs = realloc(pScrPriv->outputs,
(pScrPriv->numOutputs + 1) * sizeof(RROutputPtr));
#endif /* !defined(NXAGENT_SERVER) */
else
......@@ -232,7 +232,7 @@ RROutputAddUserMode(RROutputPtr output, RRModePtr mode)
newModes = reallocarray(output->userModes,
output->numUserModes + 1, sizeof(RRModePtr));
#else /* !defined(NXAGENT_SERVER) */
newModes = xrealloc(output->userModes,
newModes = realloc(output->userModes,
(output->numUserModes + 1) * sizeof(RRModePtr));
#endif /* !defined(NXAGENT_SERVER) */
else
......
......@@ -1228,7 +1228,7 @@ RecordAddClientToRCAP(pRCAP, clientspec)
{
if (pRCAP->clientIDsSeparatelyAllocated)
{
XID *pNewIDs = (XID *)xrealloc(pRCAP->pClientIDs,
XID *pNewIDs = (XID *)realloc(pRCAP->pClientIDs,
(pRCAP->sizeClients + CLIENT_ARRAY_GROWTH_INCREMENT) *
sizeof(XID));
if (!pNewIDs)
......@@ -2037,7 +2037,7 @@ ProcRecordCreateContext(client)
/* make sure there is room in ppAllContexts to store the new context */
ppNewAllContexts = (RecordContextPtr *)
xrealloc(ppAllContexts, sizeof(RecordContextPtr) * (numContexts + 1));
realloc(ppAllContexts, sizeof(RecordContextPtr) * (numContexts + 1));
if (!ppNewAllContexts)
goto bailout;
ppAllContexts = ppNewAllContexts;
......@@ -2162,7 +2162,7 @@ RecordAllocRanges(pri, nRanges)
#define SZINCR 8
newsize = max(pri->size + SZINCR, nRanges);
pNewRange = (xRecordRange *)xrealloc(pri->pRanges,
pNewRange = (xRecordRange *)realloc(pri->pRanges,
newsize * sizeof(xRecordRange));
if (!pNewRange)
return BadAlloc;
......
......@@ -68,7 +68,7 @@ PictureGetFilterId (char *filter, int len, Bool makeit)
memcpy (name, filter, len);
name[len] = '\0';
if (filterNames)
names = xrealloc (filterNames, (nfilterNames + 1) * sizeof (char *));
names = realloc (filterNames, (nfilterNames + 1) * sizeof (char *));
else
names = malloc (sizeof (char *));
if (!names)
......@@ -144,7 +144,7 @@ PictureAddFilter (ScreenPtr pScreen,
if (ps->filters[i].id == id)
return -1;
if (ps->filters)
filters = xrealloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec));
filters = realloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec));
else
filters = malloc (sizeof (PictFilterRec));
if (!filters)
......@@ -175,7 +175,7 @@ PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias)
PictFilterAliasPtr aliases;
if (ps->filterAliases)
aliases = xrealloc (ps->filterAliases,
aliases = realloc (ps->filterAliases,
(ps->nfilterAliases + 1) *
sizeof (PictFilterAliasRec));
else
......
......@@ -117,7 +117,7 @@ _GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr)
if (n > glyphSet->maxPrivate) {
if (glyphSet->devPrivates &&
glyphSet->devPrivates != (void *)(&glyphSet[1])) {
new = (void **) xrealloc (glyphSet->devPrivates,
new = (void **) realloc (glyphSet->devPrivates,
(n + 1) * sizeof (void *));
if (!new)
return FALSE;
......
......@@ -82,7 +82,7 @@ AllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount)
{
unsigned int *nsizes;
nsizes = (unsigned int *)xrealloc(ps->PicturePrivateSizes,
nsizes = (unsigned int *)realloc(ps->PicturePrivateSizes,
(index2 + 1) * sizeof(unsigned int));
if (!nsizes)
return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment