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