summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-05-06 01:44:06 +0700
committerMikhail Gusarov <dottedmag@dottedmag.net>2010-05-13 00:22:37 +0700
commit3f3ff971ecff9936cebafc813af9193b97bba89c (patch)
treefdbbad794a42488b7ffe41eed7aba4e498335f55 /mi
parent96c7ab27c383ec767f62a7a11e5fd76f86363fbc (diff)
Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'mi')
-rw-r--r--mi/miarc.c66
-rw-r--r--mi/mibitblt.c50
-rw-r--r--mi/micmap.c24
-rw-r--r--mi/micopy.c10
-rw-r--r--mi/midispcur.c26
-rw-r--r--mi/mieq.c4
-rw-r--r--mi/miexpose.c16
-rw-r--r--mi/mifillarc.c40
-rw-r--r--mi/mifillrct.c12
-rw-r--r--mi/mifpolycon.c18
-rw-r--r--mi/migc.c2
-rw-r--r--mi/miglblt.c4
-rw-r--r--mi/mioverlay.c14
-rw-r--r--mi/mipointer.c10
-rw-r--r--mi/mipolycon.c16
-rw-r--r--mi/mipolygen.c6
-rw-r--r--mi/mipolypnt.c2
-rw-r--r--mi/mipolyrect.c4
-rw-r--r--mi/mipolyutil.c4
-rw-r--r--mi/mipushpxl.c4
-rw-r--r--mi/miregion.c24
-rw-r--r--mi/miscrinit.c4
-rw-r--r--mi/mispans.c72
-rw-r--r--mi/misprite.c10
-rw-r--r--mi/miwideline.c38
-rw-r--r--mi/miwindow.c2
-rw-r--r--mi/mizerarc.c10
-rw-r--r--mi/mizerline.c8
28 files changed, 250 insertions, 250 deletions
diff --git a/mi/miarc.c b/mi/miarc.c
index 106143655..36b71bf80 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -800,7 +800,7 @@ miComputeWideEllipse(int lw, xArc *parc)
if (!lw)
lw = 1;
k = (parc->height >> 1) + ((lw - 1) >> 1);
- spdata = xalloc(sizeof(miArcSpanData) + sizeof(miArcSpan) * (k + 2));
+ spdata = malloc(sizeof(miArcSpanData) + sizeof(miArcSpan) * (k + 2));
if (!spdata)
return NULL;
spdata->spans = (miArcSpan *)(spdata + 1);
@@ -831,14 +831,14 @@ miFillWideEllipse(
yorgu = parc->height + pGC->lineWidth;
n = (sizeof(int) * 2) * yorgu;
- widths = xalloc(n + (sizeof(DDXPointRec) * 2) * yorgu);
+ widths = malloc(n + (sizeof(DDXPointRec) * 2) * yorgu);
if (!widths)
return;
points = (DDXPointPtr)((char *)widths + n);
spdata = miComputeWideEllipse((int)pGC->lineWidth, parc);
if (!spdata)
{
- xfree(widths);
+ free(widths);
return;
}
pts = points;
@@ -927,10 +927,10 @@ miFillWideEllipse(
wids += 2;
}
}
- xfree(spdata);
+ free(spdata);
(*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
- xfree(widths);
+ free(widths);
}
/*
@@ -1266,7 +1266,7 @@ miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
arc.height = width;
arc.angle1 = -miDatan2 (corner.y - center.y, corner.x - center.x);
arc.angle2 = a;
- pArcPts = xalloc (3 * sizeof (SppPointRec));
+ pArcPts = malloc(3 * sizeof (SppPointRec));
if (!pArcPts)
return;
pArcPts[0].x = otherCorner.x;
@@ -1282,7 +1282,7 @@ miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
* rest of the line */
miFillSppPoly(pDraw, pGC, cpt, pArcPts, xOrg, yOrg, xFtrans, yFtrans);
}
- xfree(pArcPts);
+ free(pArcPts);
return;
case JoinMiter:
/*
@@ -1413,7 +1413,7 @@ miRoundCap(
* rest of the line */
miFillSppPoly(pDraw, pGC, cpt, pArcPts, -xOrg, -yOrg, xFtrans, yFtrans);
}
- xfree(pArcPts);
+ free(pArcPts);
}
/*
@@ -1511,10 +1511,10 @@ miDatan2 (double dy, double dx)
* This procedure allocates the space necessary to fit the arc points.
* Sometimes it's convenient for those points to be at the end of an existing
* array. (For example, if we want to leave a spare point to make sectors
- * instead of segments.) So we pass in the xalloc()ed chunk that contains the
+ * instead of segments.) So we pass in the malloc()ed chunk that contains the
* array and an index saying where we should start stashing the points.
* If there isn't an array already, we just pass in a null pointer and
- * count on xrealloc() to handle the null pointer correctly.
+ * count on realloc() to handle the null pointer correctly.
*/
static int
miGetArcPts(
@@ -1561,7 +1561,7 @@ miGetArcPts(
count++;
cdt = 2 * miDcos(dt);
- if (!(poly = (SppPointPtr) xrealloc((pointer)*ppPts,
+ if (!(poly = (SppPointPtr) realloc((pointer)*ppPts,
(cpt + count) * sizeof(SppPointRec))))
return(0);
*ppPts = poly;
@@ -1624,7 +1624,7 @@ addCap (
if (*ncapsp == *sizep)
{
newsize = *sizep + ADD_REALLOC_STEP;
- cap = (miArcCapPtr) xrealloc (*capsp,
+ cap = (miArcCapPtr) realloc(*capsp,
newsize * sizeof (**capsp));
if (!cap)
return;
@@ -1655,7 +1655,7 @@ addJoin (
if (*njoinsp == *sizep)
{
newsize = *sizep + ADD_REALLOC_STEP;
- join = (miArcJoinPtr) xrealloc (*joinsp,
+ join = (miArcJoinPtr) realloc(*joinsp,
newsize * sizeof (**joinsp));
if (!join)
return;
@@ -1685,7 +1685,7 @@ addArc (
if (*narcsp == *sizep)
{
newsize = *sizep + ADD_REALLOC_STEP;
- arc = (miArcDataPtr) xrealloc (*arcsp,
+ arc = (miArcDataPtr) realloc(*arcsp,
newsize * sizeof (**arcsp));
if (!arc)
return NULL;
@@ -1710,13 +1710,13 @@ miFreeArcs(
iphase--)
{
if (arcs[iphase].narcs > 0)
- xfree(arcs[iphase].arcs);
+ free(arcs[iphase].arcs);
if (arcs[iphase].njoins > 0)
- xfree(arcs[iphase].joins);
+ free(arcs[iphase].joins);
if (arcs[iphase].ncaps > 0)
- xfree(arcs[iphase].caps);
+ free(arcs[iphase].caps);
}
- xfree(arcs);
+ free(arcs);
}
/*
@@ -1800,13 +1800,13 @@ miComputeArcs (
isDoubleDash = (pGC->lineStyle == LineDoubleDash);
dashOffset = pGC->dashOffset;
- data = xalloc (narcs * sizeof (struct arcData));
+ data = malloc(narcs * sizeof (struct arcData));
if (!data)
return NULL;
- arcs = xalloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1));
+ arcs = malloc(sizeof (*arcs) * (isDoubleDash ? 2 : 1));
if (!arcs)
{
- xfree(data);
+ free(data);
return NULL;
}
for (i = 0; i < narcs; i++) {
@@ -2155,11 +2155,11 @@ miComputeArcs (
arcs[iphase].arcs[arcs[iphase].narcs-1].cap =
arcs[iphase].ncaps;
}
- xfree(data);
+ free(data);
return arcs;
arcfail:
miFreeArcs(arcs, pGC);
- xfree(data);
+ free(data);
return NULL;
}
@@ -3016,7 +3016,7 @@ realAllocSpan (void)
struct finalSpan *span;
int i;
- newChunk = xalloc (sizeof (struct finalSpanChunk));
+ newChunk = malloc(sizeof (struct finalSpanChunk));
if (!newChunk)
return (struct finalSpan *) NULL;
newChunk->next = chunks;
@@ -3039,11 +3039,11 @@ disposeFinalSpans (void)
for (chunk = chunks; chunk; chunk = next) {
next = chunk->next;
- xfree (chunk);
+ free(chunk);
}
chunks = 0;
freeFinalSpans = 0;
- xfree(finalSpans);
+ free(finalSpans);
finalSpans = 0;
}
@@ -3063,8 +3063,8 @@ fillSpans (
if (nspans == 0)
return;
- xSpan = xSpans = xalloc (nspans * sizeof (DDXPointRec));
- xWidth = xWidths = xalloc (nspans * sizeof (int));
+ xSpan = xSpans = malloc(nspans * sizeof (DDXPointRec));
+ xWidth = xWidths = malloc(nspans * sizeof (int));
if (xSpans && xWidths)
{
i = 0;
@@ -3084,9 +3084,9 @@ fillSpans (
}
disposeFinalSpans ();
if (xSpans)
- xfree (xSpans);
+ free(xSpans);
if (xWidths)
- xfree (xWidths);
+ free(xWidths);
finalMiny = 0;
finalMaxy = -1;
finalSize = 0;
@@ -3121,7 +3121,7 @@ realFindSpan (int y)
else
change = SPAN_REALLOC;
newSize = finalSize + change;
- newSpans = xalloc(newSize * sizeof (struct finalSpan *));
+ newSpans = malloc(newSize * sizeof (struct finalSpan *));
if (!newSpans)
return NULL;
newMiny = finalMiny;
@@ -3134,7 +3134,7 @@ realFindSpan (int y)
memmove(((char *) newSpans) + (finalMiny-newMiny) * sizeof (struct finalSpan *),
(char *) finalSpans,
finalSize * sizeof (struct finalSpan *));
- xfree (finalSpans);
+ free(finalSpans);
}
if ((i = finalMiny - newMiny) > 0)
bzero ((char *)newSpans, i * sizeof (struct finalSpan *));
@@ -3477,7 +3477,7 @@ drawArc (
left->counterClock = temp;
}
}
- xfree(spdata);
+ free(spdata);
}
static void
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index cc8b11d9c..2ac6ce0e2 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -143,19 +143,19 @@ miCopyArea(DrawablePtr pSrcDrawable,
dsty += pDstDrawable->y;
}
- pptFirst = ppt = xalloc(heightSrc * sizeof(DDXPointRec));
- pwidthFirst = pwidth = xalloc(heightSrc * sizeof(unsigned int));
+ pptFirst = ppt = malloc(heightSrc * sizeof(DDXPointRec));
+ pwidthFirst = pwidth = malloc(heightSrc * sizeof(unsigned int));
numRects = REGION_NUM_RECTS(prgnSrcClip);
boxes = REGION_RECTS(prgnSrcClip);
- ordering = xalloc(numRects * sizeof(unsigned int));
+ ordering = malloc(numRects * sizeof(unsigned int));
if(!pptFirst || !pwidthFirst || !ordering)
{
if (ordering)
- xfree(ordering);
+ free(ordering);
if (pwidthFirst)
- xfree(pwidthFirst);
+ free(pwidthFirst);
if (pptFirst)
- xfree(pptFirst);
+ free(pptFirst);
return NULL;
}
@@ -235,7 +235,7 @@ miCopyArea(DrawablePtr pSrcDrawable,
ppt++->y = y++;
*pwidth++ = width;
}
- pbits = xalloc(height * PixmapBytePad(width, pSrcDrawable->depth));
+ pbits = malloc(height * PixmapBytePad(width, pSrcDrawable->depth));
if (pbits)
{
(*pSrcDrawable->pScreen->GetSpans)(pSrcDrawable, width, pptFirst,
@@ -253,7 +253,7 @@ miCopyArea(DrawablePtr pSrcDrawable,
(*pGC->ops->SetSpans)(pDstDrawable, pGC, (char *)pbits, pptFirst,
(int *)pwidthFirst, height, TRUE);
- xfree(pbits);
+ free(pbits);
}
}
prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
@@ -261,9 +261,9 @@ miCopyArea(DrawablePtr pSrcDrawable,
if(realSrcClip)
REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- xfree(ordering);
- xfree(pwidthFirst);
- xfree(pptFirst);
+ free(ordering);
+ free(pwidthFirst);
+ free(pptFirst);
return prgnExposed;
}
@@ -313,7 +313,7 @@ miGetPlane(
sy += pDraw->y;
widthInBytes = BitmapBytePad(w);
if(!result)
- result = xcalloc(h, widthInBytes);
+ result = calloc(h, widthInBytes);
if (!result)
return NULL;
bitsPerPixel = pDraw->bitsPerPixel;
@@ -429,12 +429,12 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
dixChangeGC(NullClient, pGCT, GCBackground, NULL, gcv);
ValidateGC((DrawablePtr)pPixmap, pGCT);
miClearDrawable((DrawablePtr)pPixmap, pGCT);
- ppt = pptFirst = xalloc(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = xalloc(h * sizeof(int));
+ ppt = pptFirst = malloc(h * sizeof(DDXPointRec));
+ pwidth = pwidthFirst = malloc(h * sizeof(int));
if(!pptFirst || !pwidthFirst)
{
- if (pwidthFirst) xfree(pwidthFirst);
- if (pptFirst) xfree(pptFirst);
+ if (pwidthFirst) free(pwidthFirst);
+ if (pptFirst) free(pptFirst);
FreeScratchGC(pGCT);
return;
}
@@ -460,8 +460,8 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
(*pGCT->ops->SetSpans)((DrawablePtr)pPixmap, pGCT, (char *)pbits,
pptFirst, pwidthFirst, h, TRUE);
- xfree(pwidthFirst);
- xfree(pptFirst);
+ free(pwidthFirst);
+ free(pptFirst);
/* Save current values from the client GC */
@@ -614,7 +614,7 @@ miCopyPlane( DrawablePtr pSrcDrawable,
miOpqStipDrawable(pDstDrawable, pGC, prgnSrc, ptile, 0,
box.x2 - box.x1, box.y2 - box.y1,
dstx + box.x1 - srcx, dsty + box.y1 - srcy);
- xfree(ptile);
+ free(ptile);
}
}
prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
@@ -798,14 +798,14 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
break;
case ZPixmap:
- ppt = pptFirst = xalloc(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = xalloc(h * sizeof(int));
+ ppt = pptFirst = malloc(h * sizeof(DDXPointRec));
+ pwidth = pwidthFirst = malloc(h * sizeof(int));
if(!pptFirst || !pwidthFirst)
{
if (pwidthFirst)
- xfree(pwidthFirst);
+ free(pwidthFirst);
if (pptFirst)
- xfree(pptFirst);
+ free(pptFirst);
return;
}
if (pGC->miTranslate)
@@ -824,8 +824,8 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
(*pGC->ops->SetSpans)(pDraw, pGC, (char *)pImage, pptFirst,
pwidthFirst, h, TRUE);
- xfree(pwidthFirst);
- xfree(pptFirst);
+ free(pwidthFirst);
+ free(pptFirst);
break;
}
}
diff --git a/mi/micmap.c b/mi/micmap.c
index cc829fc10..dac700dc5 100644
--- a/mi/micmap.c
+++ b/mi/micmap.c
@@ -380,7 +380,7 @@ miClearVisualTypes(void)
while ((v = miVisuals)) {
miVisuals = v->next;
- xfree(v);
+ free(v);
}
}
@@ -393,7 +393,7 @@ miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB,
miVisualsPtr new, *prev, v;
int count;
- new = xalloc (sizeof *new);
+ new = malloc(sizeof *new);
if (!new)
return FALSE;
if (!redMask || !greenMask || !blueMask)
@@ -534,14 +534,14 @@ miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
ndepth++;
nvisual += visuals->count;
}
- depth = xalloc (ndepth * sizeof (DepthRec));
- visual = xalloc (nvisual * sizeof (VisualRec));
- preferredCVCs = xalloc(ndepth * sizeof(int));
+ depth = malloc(ndepth * sizeof (DepthRec));
+ visual = malloc(nvisual * sizeof (VisualRec));
+ preferredCVCs = malloc(ndepth * sizeof(int));
if (!depth || !visual || !preferredCVCs)
{
- xfree (depth);
- xfree (visual);
- xfree (preferredCVCs);
+ free(depth);
+ free(visual);
+ free(preferredCVCs);
return FALSE;
}
*depthp = depth;
@@ -560,9 +560,9 @@ miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
vid = NULL;
if (nvtype)
{
- vid = xalloc (nvtype * sizeof (VisualID));
+ vid = malloc(nvtype * sizeof (VisualID));
if (!vid) {
- xfree(preferredCVCs);
+ free(preferredCVCs);
return FALSE;
}
}
@@ -604,7 +604,7 @@ miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
vid++;
visual++;
}
- xfree (visuals);
+ free(visuals);
}
miVisuals = NULL;
visual = *visualp;
@@ -660,7 +660,7 @@ miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
}
*rootDepthp = depth[i].depth;
*defaultVisp = depth[i].vids[j];
- xfree(preferredCVCs);
+ free(preferredCVCs);
return TRUE;
}
diff --git a/mi/micopy.c b/mi/micopy.c
index 3719f4646..6df9d88d9 100644
--- a/mi/micopy.c
+++ b/mi/micopy.c
@@ -68,7 +68,7 @@ miCopyRegion (DrawablePtr pSrcDrawable,
if (nbox > 1)
{
/* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
+ pboxNew1 = (BoxPtr)malloc(sizeof(BoxRec) * nbox);
if(!pboxNew1)
return;
pboxBase = pboxNext = pbox+nbox-1;
@@ -105,11 +105,11 @@ miCopyRegion (DrawablePtr pSrcDrawable,
if (nbox > 1)
{
/* reverse order of rects in each band */
- pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
+ pboxNew2 = (BoxPtr)malloc(sizeof(BoxRec) * nbox);
if(!pboxNew2)
{
if (pboxNew1)
- xfree(pboxNew1);
+ free(pboxNew1);
return;
}
pboxBase = pboxNext = pbox;
@@ -144,9 +144,9 @@ miCopyRegion (DrawablePtr pSrcDrawable,
reverse, upsidedown, bitPlane, closure);
if (pboxNew1)
- xfree (pboxNew1);
+ free(pboxNew1);
if (pboxNew2)
- xfree (pboxNew2);
+ free(pboxNew2);
}
RegionPtr
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 904163091..06bddec8d 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -140,7 +140,7 @@ miDCInitialize (ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
{
miDCScreenPtr pScreenPriv;
- pScreenPriv = xalloc (sizeof (miDCScreenRec));
+ pScreenPriv = malloc(sizeof (miDCScreenRec));
if (!pScreenPriv)
return FALSE;
@@ -152,7 +152,7 @@ miDCInitialize (ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
if (!miSpriteInitialize (pScreen, &miDCFuncs, screenFuncs))
{
- xfree ((pointer) pScreenPriv);
+ free((pointer) pScreenPriv);
return FALSE;
}
return TRUE;
@@ -166,7 +166,7 @@ miDCCloseScreen (int index, ScreenPtr pScreen)
pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
miDCScreenKey);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
- xfree ((pointer) pScreenPriv);
+ free((pointer) pScreenPriv);
return (*pScreen->CloseScreen) (index, pScreen);
}
@@ -224,7 +224,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
GCPtr pGC;
XID gcvals[3];
- pPriv = xalloc (sizeof (miDCCursorRec));
+ pPriv = malloc(sizeof (miDCCursorRec));
if (!pPriv)
return NULL;
#ifdef ARGB_CURSOR
@@ -237,7 +237,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
if (!pFormat)
{
- xfree ((pointer) pPriv);
+ free((pointer) pPriv);
return NULL;
}
@@ -248,14 +248,14 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap)
{
- xfree ((pointer) pPriv);
+ free((pointer) pPriv);
return NULL;
}
pGC = GetScratchGC (32, pScreen);
if (!pGC)
{
(*pScreen->DestroyPixmap) (pPixmap);
- xfree ((pointer) pPriv);
+ free((pointer) pPriv);
return NULL;
}
ValidateGC (&pPixmap->drawable, pGC);
@@ -269,7 +269,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
(*pScreen->DestroyPixmap) (pPixmap);
if (!pPriv->pPicture)
{
- xfree ((pointer) pPriv);
+ free((pointer) pPriv);
return NULL;
}
dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), pPriv);
@@ -280,14 +280,14 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
pPriv->sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1, 0);
if (!pPriv->sourceBits)
{
- xfree ((pointer) pPriv);
+ free((pointer) pPriv);
return NULL;
}
pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1, 0);
if (!pPriv->maskBits)
{
(*pScreen->DestroyPixmap) (pPriv->sourceBits);
- xfree ((pointer) pPriv);
+ free((pointer) pPriv);
return NULL;
}
dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), pPriv);
@@ -346,7 +346,7 @@ miDCUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
if (pPriv->pPicture)
FreePicture (pPriv->pPicture, 0);
#endif
- xfree ((pointer) pPriv);
+ free((pointer) pPriv);
dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), NULL);
}
return TRUE;
@@ -780,7 +780,7 @@ miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
{
pScreen = screenInfo.screens[i];
- pBuffer = xalloc(sizeof(miDCBufferRec));
+ pBuffer = malloc(sizeof(miDCBufferRec));
if (!pBuffer)
goto failure;
@@ -866,7 +866,7 @@ miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
if (pBuffer->pSave) (*pScreen->DestroyPixmap)(pBuffer->pSave);
if (pBuffer->pTemp) (*pScreen->DestroyPixmap)(pBuffer->pTemp);
- xfree(pBuffer);
+ free(pBuffer);
dixSetPrivate(&pDev->devPrivates, miDCSpriteKey + pScreen->myNum, NULL);
}
}
diff --git a/mi/mieq.c b/mi/mieq.c
index 9b6d0c901..fa60b405b 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -191,7 +191,7 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e)
if (evt->evlen < evlen)
{
evt->evlen = evlen;
- evt->event = xrealloc(evt->event, evt->evlen);
+ evt->event = realloc(evt->event, evt->evlen);
if (!evt->event)
{
ErrorF("[mi] Running out of memory. Tossing event.\n");
@@ -439,7 +439,7 @@ mieqProcessInputEvents(void)
evlen = e->events->evlen;
if(evlen > event_size)
- event = xrealloc(event, evlen);
+ event = realloc(event, evlen);
if (!event)
FatalError("[mi] No memory left for event processing.\n");
diff --git a/mi/miexpose.c b/mi/miexpose.c
index f52b49211..2072e6a0a 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -358,7 +358,7 @@ miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable,
numRects = REGION_NUM_RECTS(pRgn);
pBox = REGION_RECTS(pRgn);
- if(!(pEvent = xalloc(numRects * sizeof(xEvent))))
+ if(!(pEvent = malloc(numRects * sizeof(xEvent))))
return;
pe = pEvent;
@@ -376,7 +376,7 @@ miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable,
}
TryClientEvents(client, NULL, pEvent, numRects,
(Mask)0, NoEventMask, NullGrab);
- xfree(pEvent);
+ free(pEvent);
}
else
{
@@ -402,7 +402,7 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
pBox = REGION_RECTS(pRgn);
numRects = REGION_NUM_RECTS(pRgn);
- if(!(pEvent = xcalloc(1, numRects * sizeof(xEvent))))
+ if(!(pEvent = calloc(1, numRects * sizeof(xEvent))))
return;
for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++)
@@ -432,7 +432,7 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
win = PanoramiXFindIDByScrnum(XRT_WINDOW,
pWin->drawable.id, scrnum);
if(!win) {
- xfree(pEvent);
+ free(pEvent);
return;
}
realWin = win->info[0].id;
@@ -449,7 +449,7 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
DeliverEvents(pWin, pEvent, numRects, NullWindow);
- xfree(pEvent);
+ free(pEvent);
}
void
@@ -646,14 +646,14 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin;
}
- prect = xalloc(REGION_NUM_RECTS(prgn) * sizeof(xRectangle));
+ prect = malloc(REGION_NUM_RECTS(prgn) * sizeof(xRectangle));
if (!prect)
return;
pGC = GetScratchGC(drawable->depth, drawable->pScreen);
if (!pGC)
{
- xfree(prect);
+ free(prect);
return;
}
@@ -671,7 +671,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
}
prect -= numRects;
(*pGC->ops->PolyFillRect)(drawable, pGC, numRects, prect);
- xfree(prect);
+ free(prect);
FreeScratchGC(pGC);
}
diff --git a/mi/mifillarc.c b/mi/mifillarc.c
index c22baf54c..6e13e681f 100644
--- a/mi/mifillarc.c
+++ b/mi/mifillarc.c
@@ -546,13 +546,13 @@ miFillEllipseI(
int *widths;
int *wids;
- points = xalloc(sizeof(DDXPointRec) * arc->height);
+ points = malloc(sizeof(DDXPointRec) * arc->height);
if (!points)
return;
- widths = xalloc(sizeof(int) * arc->height);
+ widths = malloc(sizeof(int) * arc->height);
if (!widths)
{
- xfree(points);
+ free(points);
return;
}
miFillArcSetup(arc, &info);
@@ -570,8 +570,8 @@ miFillEllipseI(
ADDSPANS();
}
(*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
- xfree(widths);
- xfree(points);
+ free(widths);
+ free(points);
}
static void
@@ -589,13 +589,13 @@ miFillEllipseD(
int *widths;
int *wids;
- points = xalloc(sizeof(DDXPointRec) * arc->height);
+ points = malloc(sizeof(DDXPointRec) * arc->height);
if (!points)
return;
- widths = xalloc(sizeof(int) * arc->height);
+ widths = malloc(sizeof(int) * arc->height);
if (!widths)
{
- xfree(points);
+ free(points);
return;
}
miFillArcDSetup(arc, &info);
@@ -613,8 +613,8 @@ miFillEllipseD(
ADDSPANS();
}
(*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
- xfree(widths);
- xfree(points);
+ free(widths);
+ free(points);
}
#define ADDSPAN(l,r) \
@@ -661,13 +661,13 @@ miFillArcSliceI(
slw = arc->height;
if (slice.flip_top || slice.flip_bot)
slw += (arc->height >> 1) + 1;
- points = xalloc(sizeof(DDXPointRec) * slw);
+ points = malloc(sizeof(DDXPointRec) * slw);
if (!points)
return;
- widths = xalloc(sizeof(int) * slw);
+ widths = malloc(sizeof(int) * slw);
if (!widths)
{
- xfree(points);
+ free(points);
return;
}
if (pGC->miTranslate)
@@ -698,8 +698,8 @@ miFillArcSliceI(
}
}
(*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
- xfree(widths);
- xfree(points);
+ free(widths);
+ free(points);
}
static void
@@ -725,13 +725,13 @@ miFillArcSliceD(
slw = arc->height;
if (slice.flip_top || slice.flip_bot)
slw += (arc->height >> 1) + 1;
- points = xalloc(sizeof(DDXPointRec) * slw);
+ points = malloc(sizeof(DDXPointRec) * slw);
if (!points)
return;
- widths = xalloc(sizeof(int) * slw);
+ widths = malloc(sizeof(int) * slw);
if (!widths)
{
- xfree(points);
+ free(points);
return;
}
if (pGC->miTranslate)
@@ -762,8 +762,8 @@ miFillArcSliceD(
}
}
(*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
- xfree(widths);
- xfree(points);
+ free(widths);
+ free(points);
}
/* MIPOLYFILLARC -- The public entry for the PolyFillArc request.
diff --git a/mi/mifillrct.c b/mi/mifillrct.c
index 6e9979099..e2bd7c913 100644
--- a/mi/mifillrct.c
+++ b/mi/mifillrct.c
@@ -107,12 +107,12 @@ miPolyFillRect(
maxheight = max(maxheight, prect->height);
}
- pptFirst = xalloc(maxheight * sizeof(DDXPointRec));
- pwFirst = xalloc(maxheight * sizeof(int));
+ pptFirst = malloc(maxheight * sizeof(DDXPointRec));
+ pwFirst = malloc(maxheight * sizeof(int));
if(!pptFirst || !pwFirst)
{
- if (pwFirst) xfree(pwFirst);
- if (pptFirst) xfree(pptFirst);
+ if (pwFirst) free(pwFirst);
+ if (pptFirst) free(pptFirst);
return;
}
@@ -138,6 +138,6 @@ miPolyFillRect(
1);
prect++;
}
- xfree(pwFirst);
- xfree(pptFirst);
+ free(pwFirst);
+ free(pptFirst);
}
diff --git a/mi/mifpolycon.c b/mi/mifpolycon.c
index 383502f64..13b5a4872 100644
--- a/mi/mifpolycon.c
+++ b/mi/mifpolycon.c
@@ -116,15 +116,15 @@ miFillSppPoly(
y = ymax - ymin + 1;
if ((count < 3) || (y <= 0))
return;
- ptsOut = FirstPoint = xalloc(sizeof(DDXPointRec) * y);
- width = FirstWidth = xalloc(sizeof(int) * y);
- Marked = xalloc(sizeof(int) * count);
+ ptsOut = FirstPoint = malloc(sizeof(DDXPointRec) * y);
+ width = FirstWidth = malloc(sizeof(int) * y);
+ Marked = malloc(sizeof(int) * count);
if(!ptsOut || !width || !Marked)
{
- if (Marked) xfree(Marked);
- if (width) xfree(width);
- if (ptsOut) xfree(ptsOut);
+ if (Marked) free(Marked);
+ if (width) free(width);
+ if (ptsOut) free(ptsOut);
return;
}
@@ -238,9 +238,9 @@ miFillSppPoly(
/* Finally, fill the spans we've collected */
(*pgc->ops->FillSpans)(dst, pgc,
ptsOut-FirstPoint, FirstPoint, FirstWidth, 1);
- xfree(Marked);
- xfree(FirstWidth);
- xfree(FirstPoint);
+ free(Marked);
+ free(FirstWidth);
+ free(FirstPoint);
}
diff --git a/mi/migc.c b/mi/migc.c
index a797099cd..7b2b1c350 100644
--- a/mi/migc.c
+++ b/mi/migc.c
@@ -95,7 +95,7 @@ miChangeClip( GCPtr pGC, int type, pointer pvalue, int nrects)
pGC->clientClip = (pointer) RECTS_TO_REGION(pGC->pScreen, nrects,
(xRectangle *) pvalue,
type);
- xfree(pvalue);
+ free(pvalue);
}
pGC->clientClipType = (type != CT_NONE && pGC->clientClip) ? CT_REGION : CT_NONE;
pGC->stateChanges |= GCClipMask;
diff --git a/mi/miglblt.c b/mi/miglblt.c
index bc715aee9..ea199dc8c 100644
--- a/mi/miglblt.c
+++ b/mi/miglblt.c
@@ -141,7 +141,7 @@ miPolyGlyphBlt(
DoChangeGC(pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, 0);
nbyLine = BitmapBytePad(width);
- pbits = xalloc(height*nbyLine);
+ pbits = malloc(height*nbyLine);
if (!pbits)
{
(*pDrawable->pScreen->DestroyPixmap)(pPixmap);
@@ -192,7 +192,7 @@ miPolyGlyphBlt(
x += pci->metrics.characterWidth;
}
(*pDrawable->pScreen->DestroyPixmap)(pPixmap);
- xfree(pbits);
+ free(pbits);
FreeScratchGC(pGCtmp);
}
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index e0aa88017..2de768215 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -115,7 +115,7 @@ miInitOverlay(
if(!dixRequestPrivate(miOverlayWindowKey, sizeof(miOverlayWindowRec)))
return FALSE;
- if(!(pScreenPriv = xalloc(sizeof(miOverlayScreenRec))))
+ if(!(pScreenPriv = malloc(sizeof(miOverlayScreenRec))))
return FALSE;
dixSetPrivate(&pScreen->devPrivates, miOverlayScreenKey, pScreenPriv);
@@ -166,7 +166,7 @@ miOverlayCloseScreen(int i, ScreenPtr pScreen)
pScreen->UnrealizeWindow = pScreenPriv->UnrealizeWindow;
pScreen->RealizeWindow = pScreenPriv->RealizeWindow;
- xfree(pScreenPriv);
+ free(pScreenPriv);
return (*pScreen->CloseScreen)(i, pScreen);
}
@@ -184,7 +184,7 @@ miOverlayCreateWindow(WindowPtr pWin)
pWinPriv->tree = NULL;
if(!pWin->parent || !((*pScreenPriv->InOverlay)(pWin))) {
- if(!(pTree = (miOverlayTreePtr)xcalloc(1, sizeof(miOverlayTreeRec))))
+ if(!(pTree = (miOverlayTreePtr)calloc(1, sizeof(miOverlayTreeRec))))
return FALSE;
}
@@ -212,7 +212,7 @@ miOverlayCreateWindow(WindowPtr pWin)
REGION_INIT(pScreen, &(pTree->borderClip), &fullBox, 1);
REGION_INIT(pScreen, &(pTree->clipList), &fullBox, 1);
}
- } else xfree(pTree);
+ } else free(pTree);
}
return TRUE;
@@ -240,7 +240,7 @@ miOverlayDestroyWindow(WindowPtr pWin)
REGION_UNINIT(pScreen, &(pTree->borderClip));
REGION_UNINIT(pScreen, &(pTree->clipList));
- xfree(pTree);
+ free(pTree);
}
if(pScreenPriv->DestroyWindow) {
@@ -861,7 +861,7 @@ miOverlayHandleExposures(WindowPtr pWin)
(*WindowExposures)(pTree->pWin,&mival->exposed,NullRegion);
REGION_UNINIT(pScreen, &mival->exposed);
}
- xfree(mival);
+ free(mival);
pTree->valdata = NULL;
if (pTree->firstChild) {
pTree = pTree->firstChild;
@@ -899,7 +899,7 @@ miOverlayHandleExposures(WindowPtr pWin)
}
REGION_UNINIT(pScreen, &val->after.borderExposed);
REGION_UNINIT(pScreen, &val->after.exposed);
- xfree(val);
+ free(val);
pChild->valdata = NULL;
if (pChild->firstChild)
{
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 1b33f82d5..ad7b3db0c 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -88,7 +88,7 @@ miPointerInitialize (ScreenPtr pScreen,
{
miPointerScreenPtr pScreenPriv;
- pScreenPriv = xalloc (sizeof (miPointerScreenRec));
+ pScreenPriv = malloc(sizeof (miPointerScreenRec));
if (!pScreenPriv)
return FALSE;
pScreenPriv->spriteFuncs = spriteFuncs;
@@ -154,7 +154,7 @@ miPointerCloseScreen (int index, ScreenPtr pScreen)
#endif
pScreen->CloseScreen = pScreenPriv->CloseScreen;
- xfree ((pointer) pScreenPriv);
+ free((pointer) pScreenPriv);
FreeEventList(events, GetMaximumEventsNum());
events = NULL;
return (*pScreen->CloseScreen) (index, pScreen);
@@ -252,7 +252,7 @@ miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
miPointerPtr pPointer;
SetupScreen (pScreen);
- pPointer = xalloc(sizeof(miPointerRec));
+ pPointer = malloc(sizeof(miPointerRec));
if (!pPointer)
return FALSE;
@@ -270,7 +270,7 @@ miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
if (!((*pScreenPriv->spriteFuncs->DeviceCursorInitialize)(pDev, pScreen)))
{
- xfree(pPointer);
+ free(pPointer);
return FALSE;
}
@@ -290,7 +290,7 @@ miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
return;
(*pScreenPriv->spriteFuncs->DeviceCursorCleanup)(pDev, pScreen);
- xfree(dixLookupPrivate(&pDev->devPrivates, miPointerPrivKey));
+ free(dixLookupPrivate(&pDev->devPrivates, miPointerPrivKey));
dixSetPrivate(&pDev->devPrivates, miPointerPrivKey, NULL);
}
diff --git a/mi/mipolycon.c b/mi/mipolycon.c
index 79384881d..40671df16 100644
--- a/mi/mipolycon.c
+++ b/mi/mipolycon.c
@@ -105,12 +105,12 @@ miFillConvexPoly(
dy = ymax - ymin + 1;
if ((count < 3) || (dy < 0))
return(TRUE);
- ptsOut = FirstPoint = xalloc(sizeof(DDXPointRec)*dy);
- width = FirstWidth = xalloc(sizeof(int) * dy);
+ ptsOut = FirstPoint = malloc(sizeof(DDXPointRec)*dy);
+ width = FirstWidth = malloc(sizeof(int) * dy);
if(!FirstPoint || !FirstWidth)
{
- if (FirstWidth) xfree(FirstWidth);
- if (FirstPoint) xfree(FirstPoint);
+ if (FirstWidth) free(FirstWidth);
+ if (FirstPoint) free(FirstPoint);
return(FALSE);
}
@@ -175,8 +175,8 @@ miFillConvexPoly(
/* in case we're called with non-convex polygon */
if(i < 0)
{
- xfree(FirstWidth);
- xfree(FirstPoint);
+ free(FirstWidth);
+ free(FirstPoint);
return(TRUE);
}
while (i-- > 0)
@@ -210,8 +210,8 @@ miFillConvexPoly(
(*pgc->ops->FillSpans)(dst, pgc,
ptsOut-FirstPoint,FirstPoint,FirstWidth,
1);
- xfree(FirstWidth);
- xfree(FirstPoint);
+ free(FirstWidth);
+ free(FirstPoint);
return(TRUE);
}
diff --git a/mi/mipolygen.c b/mi/mipolygen.c
index 4744583c3..d975165da 100644
--- a/mi/mipolygen.c
+++ b/mi/mipolygen.c
@@ -92,13 +92,13 @@ miFillGeneralPoly(
if (count < 3)
return(TRUE);
- if(!(pETEs = xalloc(sizeof(EdgeTableEntry) * count)))
+ if(!(pETEs = malloc(sizeof(EdgeTableEntry) * count)))
return(FALSE);
ptsOut = FirstPoint;
width = FirstWidth;
if (!miCreateETandAET(count, ptsIn, &ET, &AET, pETEs, &SLLBlock))
{
- xfree(pETEs);
+ free(pETEs);
return(FALSE);
}
pSLL = ET.scanlines.next;
@@ -224,7 +224,7 @@ miFillGeneralPoly(
* Get any spans that we missed by buffering
*/
(*pgc->ops->FillSpans)(dst, pgc, nPts, FirstPoint, FirstWidth, 1);
- xfree(pETEs);
+ free(pETEs);
miFreeStorage(SLLBlock.next);
return(TRUE);
}
diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c
index 12771ee4e..3c6ed4eb8 100644
--- a/mi/mipolypnt.c
+++ b/mi/mipolypnt.c
@@ -120,6 +120,6 @@ miPolyPoint(
DoChangeGC(pGC, GCFillStyle, &fsOld, 0);
ValidateGC(pDrawable, pGC);
}
- xfree(pwidthInit);
+ free(pwidthInit);
}
diff --git a/mi/mipolyrect.c b/mi/mipolyrect.c
index 033c7a7c8..9b0edc176 100644
--- a/mi/mipolyrect.c
+++ b/mi/mipolyrect.c
@@ -90,7 +90,7 @@ miPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nrects, xRectangle *pRects)
offset2 = pGC->lineWidth;
offset1 = offset2 >> 1;
offset3 = offset2 - offset1;
- tmp = xalloc(ntmp * sizeof (xRectangle));
+ tmp = malloc(ntmp * sizeof (xRectangle));
if (!tmp)
return;
t = tmp;
@@ -158,7 +158,7 @@ miPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nrects, xRectangle *pRects)
}
}
(*pGC->ops->PolyFillRect) (pDraw, pGC, t - tmp, tmp);
- xfree ((pointer) tmp);
+ free((pointer) tmp);
}
else
{
diff --git a/mi/mipolyutil.c b/mi/mipolyutil.c
index 15561b73d..c4ce882b1 100644
--- a/mi/mipolyutil.c
+++ b/mi/mipolyutil.c
@@ -99,7 +99,7 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
{
if (*iSLLBlock > SLLSPERBLOCK-1)
{
- tmpSLLBlock = xalloc(sizeof(ScanLineListBlock));
+ tmpSLLBlock = malloc(sizeof(ScanLineListBlock));
if (!tmpSLLBlock)
return FALSE;
(*SLLBlock)->next = tmpSLLBlock;
@@ -379,7 +379,7 @@ miFreeStorage(ScanLineListBlock *pSLLBlock)
while (pSLLBlock)
{
tmpSLLBlock = pSLLBlock->next;
- xfree(pSLLBlock);
+ free(pSLLBlock);
pSLLBlock = tmpSLLBlock;
}
}
diff --git a/mi/mipushpxl.c b/mi/mipushpxl.c
index 3844519d8..9f0429867 100644
--- a/mi/mipushpxl.c
+++ b/mi/mipushpxl.c
@@ -123,7 +123,7 @@ miPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable,
LONG2CHARSDIFFORDER((MiBits)(-1) >> 1);
#endif
- pwLineStart = xalloc(BitmapBytePad(dx));
+ pwLineStart = malloc(BitmapBytePad(dx));
if (!pwLineStart)
return;
ipt = 0;
@@ -262,7 +262,7 @@ miPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable,
}
}
}
- xfree(pwLineStart);
+ free(pwLineStart);
/* Flush any remaining spans */
if (ipt)
{
diff --git a/mi/miregion.c b/mi/miregion.c
index c48befc6f..59aaa85b8 100644
--- a/mi/miregion.c
+++ b/mi/miregion.c
@@ -171,8 +171,8 @@ Equipment Corporation.
((r1)->y1 <= (r2)->y1) && \
((r1)->y2 >= (r2)->y2) )
-#define xallocData(n) xalloc(REGION_SZOF(n))
-#define xfreeData(reg) if ((reg)->data && (reg)->data->size) xfree((reg)->data)
+#define xallocData(n) malloc(REGION_SZOF(n))
+#define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data)
#define RECTALLOC_BAIL(pReg,n,bail) \
if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
@@ -209,7 +209,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
{ \
RegDataPtr NewData; \
- NewData = (RegDataPtr)xrealloc((reg)->data, REGION_SZOF(numRects)); \
+ NewData = (RegDataPtr)realloc((reg)->data, REGION_SZOF(numRects)); \
if (NewData) \
{ \
NewData->size = (numRects); \
@@ -241,7 +241,7 @@ miRegionCreate(BoxPtr rect, int size)
{
RegionPtr pReg;
- pReg = (RegionPtr)xalloc(sizeof(RegionRec));
+ pReg = (RegionPtr)malloc(sizeof(RegionRec));
if (!pReg)
return &miBrokenRegion;
@@ -255,7 +255,7 @@ miRegionDestroy(RegionPtr pReg)
{
pixman_region_fini (pReg);
if (pReg != &miBrokenRegion)
- xfree(pReg);
+ free(pReg);
}
void
@@ -389,7 +389,7 @@ miRectAlloc(RegionPtr pRgn, int n)
n = 250;
}
n += pRgn->data->numRects;
- data = (RegDataPtr)xrealloc(pRgn->data, REGION_SZOF(n));
+ data = (RegDataPtr)realloc(pRgn->data, REGION_SZOF(n));
if (!data)
return miRegionBreak (pRgn);
pRgn->data = data;
@@ -797,7 +797,7 @@ miRegionOp(
}
if (oldData)
- xfree(oldData);
+ free(oldData);
if (!(numRects = newReg->data->numRects))
{
@@ -1269,7 +1269,7 @@ miRegionValidate(RegionPtr badreg, Bool *pOverlap)
/* Set up the first region to be the first rectangle in badreg */
/* Note that step 2 code will never overflow the ri[0].reg rects array */
- ri = (RegionInfo *) xalloc(4 * sizeof(RegionInfo));
+ ri = (RegionInfo *) malloc(4 * sizeof(RegionInfo));
if (!ri)
return miRegionBreak (badreg);
sizeRI = 4;
@@ -1333,7 +1333,7 @@ miRegionValidate(RegionPtr badreg, Bool *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;
@@ -1389,13 +1389,13 @@ NextRect: ;
numRI -= half;
}
*badreg = ri[0].reg;
- xfree(ri);
+ free(ri);
good(badreg);
return ret;
bail:
for (i = 0; i < numRI; i++)
xfreeData(&ri[i].reg);
- xfree (ri);
+ free(ri);
return miRegionBreak (badreg);
}
@@ -1473,7 +1473,7 @@ miRectsToRegion(int nrects, xRectangle *prect, int ctype)
}
else
{
- xfree (pData);
+ free(pData);
}
return pRgn;
}
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index 96113d65d..d46b9f555 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -166,7 +166,7 @@ miCreateScreenResources(ScreenPtr pScreen)
{
value = pScrInitParms->pbits;
}
- xfree(pScreen->devPrivate); /* freeing miScreenInitParmsRec */
+ free(pScreen->devPrivate); /* freeing miScreenInitParmsRec */
pScreen->devPrivate = value; /* pPixmap or pbits */
return TRUE;
}
@@ -180,7 +180,7 @@ miScreenDevPrivateInit(ScreenPtr pScreen, int width, pointer pbits)
* to the screen, until CreateScreenResources can put them in the
* screen pixmap.
*/
- pScrInitParms = xalloc(sizeof(miScreenInitParmsRec));
+ pScrInitParms = malloc(sizeof(miScreenInitParmsRec));
if (!pScrInitParms)
return FALSE;
pScrInitParms->pbits = pbits;
diff --git a/mi/mispans.c b/mi/mispans.c
index 5504341c4..8ac66cc77 100644
--- a/mi/mispans.c
+++ b/mi/mispans.c
@@ -150,12 +150,12 @@ static void miSubtractSpans (SpanGroup *spanGroup, Spans *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);
@@ -190,7 +190,7 @@ void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup, Spans *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;
@@ -208,14 +208,14 @@ void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup, Spans *spans)
}
else
{
- xfree (spans->points);
- xfree (spans->widths);
+ free(spans->points);
+ free(spans->widths);
}
} /* AppendSpans */
void miFreeSpanGroup(SpanGroup *spanGroup)
{
- if (spanGroup->group != NULL) xfree(spanGroup->group);
+ if (spanGroup->group != NULL) free(spanGroup->group);
}
static void QuickSortSpansX(
@@ -366,8 +366,8 @@ miDisposeSpanGroup (SpanGroup *spanGroup)
for (i = 0; i < spanGroup->count; i++)
{
spans = spanGroup->group + i;
- xfree (spans->points);
- xfree (spans->widths);
+ free(spans->points);
+ free(spans->widths);
}
}
@@ -391,8 +391,8 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup)
spans = spanGroup->group;
(*pGC->ops->FillSpans)
(pDraw, pGC, spans->count, spans->points, spans->widths, TRUE);
- xfree(spans->points);
- xfree(spans->widths);
+ free(spans->points);
+ free(spans->widths);
}
else
{
@@ -405,15 +405,15 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup)
ylength = spanGroup->ymax - ymin + 1;
/* Allocate Spans for y buckets */
- yspans = xalloc(ylength * sizeof(Spans));
- ysizes = xalloc(ylength * sizeof (int));
+ yspans = malloc(ylength * sizeof(Spans));
+ ysizes = malloc(ylength * sizeof (int));
if (!yspans || !ysizes)
{
if (yspans)
- xfree (yspans);
+ free(yspans);
if (ysizes)
- xfree (ysizes);
+ free(ysizes);
miDisposeSpanGroup (spanGroup);
return;
}
@@ -443,10 +443,10 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *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)
@@ -455,11 +455,11 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup)
for (i = 0; i < ylength; i++)
{
- xfree (yspans[i].points);
- xfree (yspans[i].widths);
+ free(yspans[i].points);
+ free(yspans[i].widths);
}
- xfree (yspans);
- xfree (ysizes);
+ free(yspans);
+ free(ysizes);
miDisposeSpanGroup (spanGroup);
return;
}
@@ -472,30 +472,30 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup)
} /* if y value of span in range */
} /* for j through spans */
count += spans->count;
- xfree(spans->points);
+ free(spans->points);
spans->points = NULL;
- xfree(spans->widths);
+ free(spans->widths);
spans->widths = NULL;
} /* for i thorough Spans */
/* Now sort by x and uniquify each bucket into the final array */
- points = xalloc(count * sizeof(DDXPointRec));
- widths = xalloc(count * sizeof(int));
+ points = malloc(count * sizeof(DDXPointRec));
+ widths = malloc(count * sizeof(int));
if (!points || !widths)
{
int i;
for (i = 0; i < ylength; i++)
{
- xfree (yspans[i].points);
- xfree (yspans[i].widths);
+ free(yspans[i].points);
+ free(yspans[i].widths);
}
- xfree (yspans);
- xfree (ysizes);
+ free(yspans);
+ free(ysizes);
if (points)
- xfree (points);
+ free(points);
if (widths)
- xfree (widths);
+ free(widths);
return;
}
count = 0;
@@ -511,16 +511,16 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup)
widths[count] = yspans[i].widths[0];
count++;
}
- xfree(yspans[i].points);
- xfree(yspans[i].widths);
+ free(yspans[i].points);
+ free(yspans[i].widths);
}
}
(*pGC->ops->FillSpans) (pDraw, pGC, count, points, widths, TRUE);
- xfree(points);
- xfree(widths);
- xfree(yspans);
- xfree(ysizes); /* use (DE)xalloc for these? */
+ free(points);
+ free(widths);
+ free(yspans);
+ free(ysizes); /* use (DE)xalloc for these? */
}
spanGroup->count = 0;
diff --git a/mi/misprite.c b/mi/misprite.c
index ac025e1ff..9f10a2b0d 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -298,7 +298,7 @@ miSpriteInitialize (ScreenPtr pScreen,
if (!DamageSetup (pScreen))
return FALSE;
- pScreenPriv = xalloc (sizeof (miSpriteScreenRec));
+ pScreenPriv = malloc(sizeof (miSpriteScreenRec));
if (!pScreenPriv)
return FALSE;
@@ -311,7 +311,7 @@ miSpriteInitialize (ScreenPtr pScreen,
if (!miPointerInitialize (pScreen, &miSpritePointerFuncs, screenFuncs,TRUE))
{
- xfree (pScreenPriv);
+ free(pScreenPriv);
return FALSE;
}
for (pVisual = pScreen->visuals;
@@ -386,7 +386,7 @@ miSpriteCloseScreen (int i, ScreenPtr pScreen)
DamageDestroy (pScreenPriv->pDamage);
- xfree (pScreenPriv);
+ free(pScreenPriv);
return (*pScreen->CloseScreen) (i, pScreen);
}
@@ -926,7 +926,7 @@ miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
- pCursorInfo = xalloc(sizeof(miCursorInfoRec));
+ pCursorInfo = malloc(sizeof(miCursorInfoRec));
if (!pCursorInfo)
return FALSE;
@@ -943,7 +943,7 @@ miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
ret = (*pScreenPriv->funcs->DeviceCursorInitialize)(pDev, pScreen);
if (!ret)
{
- xfree(pCursorInfo);
+ free(pCursorInfo);
pCursorInfo = NULL;
}
dixSetPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey, pCursorInfo);
diff --git a/mi/miwideline.c b/mi/miwideline.c
index 181b12e48..57dda2202 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -122,13 +122,13 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
if (!spanData)
{
- pptInit = xalloc (overall_height * sizeof(*ppt));
+ pptInit = malloc(overall_height * sizeof(*ppt));
if (!pptInit)
return;
- pwidthInit = xalloc (overall_height * sizeof(*pwidth));
+ pwidthInit = malloc(overall_height * sizeof(*pwidth));
if (!pwidthInit)
{
- xfree (pptInit);
+ free(pptInit);
return;
}
ppt = pptInit;
@@ -143,13 +143,13 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
}
else
{
- spanRec.points = xalloc (overall_height * sizeof (*ppt));
+ spanRec.points = malloc(overall_height * sizeof (*ppt));
if (!spanRec.points)
return;
- spanRec.widths = xalloc (overall_height * sizeof (int));
+ spanRec.widths = malloc(overall_height * sizeof (int));
if (!spanRec.widths)
{
- xfree (spanRec.points);
+ free(spanRec.points);
return;
}
ppt = spanRec.points;
@@ -229,8 +229,8 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
if (!spanData)
{
(*pGC->ops->FillSpans) (pDrawable, pGC, ppt - pptInit, pptInit, pwidthInit, TRUE);
- xfree (pwidthInit);
- xfree (pptInit);
+ free(pwidthInit);
+ free(pptInit);
if (pixel != oldPixel)
{
DoChangeGC (pGC, GCForeground, &oldPixel, FALSE);
@@ -283,13 +283,13 @@ miFillRectPolyHelper (
}
else
{
- spanRec.points = xalloc (h * sizeof (*ppt));
+ spanRec.points = malloc(h * sizeof (*ppt));
if (!spanRec.points)
return;
- spanRec.widths = xalloc (h * sizeof (int));
+ spanRec.widths = malloc(h * sizeof (int));
if (!spanRec.widths)
{
- xfree (spanRec.points);
+ free(spanRec.points);
return;
}
ppt = spanRec.points;
@@ -1107,13 +1107,13 @@ miLineArc (
}
if (!spanData)
{
- points = xalloc(sizeof(DDXPointRec) * pGC->lineWidth);
+ points = malloc(sizeof(DDXPointRec) * pGC->lineWidth);
if (!points)
return;
- widths = xalloc(sizeof(int) * pGC->lineWidth);
+ widths = malloc(sizeof(int) * pGC->lineWidth);
if (!widths)
{
- xfree(points);
+ free(points);
return;
}
oldPixel = pGC->fgPixel;
@@ -1126,13 +1126,13 @@ miLineArc (
}
else
{
- points = xalloc (pGC->lineWidth * sizeof (DDXPointRec));
+ points = malloc(pGC->lineWidth * sizeof (DDXPointRec));
if (!points)
return;
- widths = xalloc (pGC->lineWidth * sizeof (int));
+ widths = malloc(pGC->lineWidth * sizeof (int));
if (!widths)
{
- xfree (points);
+ free(points);
return;
}
spanRec.points = points;
@@ -1148,8 +1148,8 @@ miLineArc (
if (!spanData)
{
(*pGC->ops->FillSpans)(pDraw, pGC, n, points, widths, TRUE);
- xfree(widths);
- xfree(points);
+ free(widths);
+ free(points);
if (pixel != oldPixel)
{
DoChangeGC(pGC, GCForeground, &oldPixel, FALSE);
diff --git a/mi/miwindow.c b/mi/miwindow.c
index c2333938e..2550ca209 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -245,7 +245,7 @@ miHandleValidateExposures(WindowPtr pWin)
REGION_UNINIT(pScreen, &val->after.borderExposed);
(*WindowExposures)(pChild, &val->after.exposed, NullRegion);
REGION_UNINIT(pScreen, &val->after.exposed);
- xfree(val);
+ free(val);
pChild->valdata = NULL;
if (pChild->firstChild)
{
diff --git a/mi/mizerarc.c b/mi/mizerarc.c
index ad84c0123..1175bc1dd 100644
--- a/mi/mizerarc.c
+++ b/mi/mizerarc.c
@@ -737,7 +737,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
dospans = (pGC->fillStyle != FillSolid);
if (dospans)
{
- widths = xalloc(sizeof(int) * numPts);
+ widths = malloc(sizeof(int) * numPts);
if (!widths)
return;
maxw = 0;
@@ -754,12 +754,12 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
(unsigned char *) pGC->dash, (int)pGC->numInDashList,
&dinfo.dashOffsetInit);
}
- points = xalloc(sizeof(DDXPointRec) * numPts);
+ points = malloc(sizeof(DDXPointRec) * numPts);
if (!points)
{
if (dospans)
{
- xfree(widths);
+ free(widths);
}
return;
}
@@ -836,9 +836,9 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
}
}
}
- xfree(points);
+ free(points);
if (dospans)
{
- xfree(widths);
+ free(widths);
}
}
diff --git a/mi/mizerline.c b/mi/mizerline.c
index 46e2e2adc..07cfbe113 100644
--- a/mi/mizerline.c
+++ b/mi/mizerline.c
@@ -155,8 +155,8 @@ miZeroLine(
width = xright - xleft + 1;
height = ybottom - ytop + 1;
list_len = (height >= width) ? height : width;
- pspanInit = xalloc(list_len * sizeof(DDXPointRec));
- pwidthInit = xalloc(list_len * sizeof(int));
+ pspanInit = malloc(list_len * sizeof(DDXPointRec));
+ pwidthInit = malloc(list_len * sizeof(int));
if (!pspanInit || !pwidthInit)
return;
@@ -359,8 +359,8 @@ miZeroLine(
(*pGC->ops->FillSpans)(pDraw, pGC, Nspans, pspanInit,
pwidthInit, FALSE);
- xfree(pwidthInit);
- xfree(pspanInit);
+ free(pwidthInit);
+ free(pspanInit);
}
void