summaryrefslogtreecommitdiff
path: root/render
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 /render
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 'render')
-rw-r--r--render/animcur.c8
-rw-r--r--render/filter.c28
-rw-r--r--render/glyph.c22
-rw-r--r--render/miindex.c10
-rw-r--r--render/mipict.c2
-rw-r--r--render/mitri.c8
-rw-r--r--render/picture.c56
-rw-r--r--render/render.c114
8 files changed, 124 insertions, 124 deletions
diff --git a/render/animcur.c b/render/animcur.c
index 276e5e4af..d207bcc76 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -123,7 +123,7 @@ AnimCurCloseScreen (int index, ScreenPtr pScreen)
Unwrap(as, pScreen, RecolorCursor);
SetAnimCurScreen(pScreen,0);
ret = (*pScreen->CloseScreen) (index, pScreen);
- xfree (as);
+ free(as);
return ret;
}
@@ -350,7 +350,7 @@ AnimCurInit (ScreenPtr pScreen)
animCurState[i].time = 0;
}
}
- as = (AnimCurScreenPtr) xalloc (sizeof (AnimCurScreenRec));
+ as = (AnimCurScreenPtr) malloc(sizeof (AnimCurScreenRec));
if (!as)
return FALSE;
Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen);
@@ -382,7 +382,7 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp
if (IsAnimCur (cursors[i]))
return BadMatch;
- pCursor = (CursorPtr) xalloc (sizeof (CursorRec) +
+ pCursor = (CursorPtr) malloc(sizeof (CursorRec) +
sizeof (AnimCurRec) +
ncursor * sizeof (AnimCurElt));
if (!pCursor)
@@ -406,7 +406,7 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp
RT_NONE, NULL, DixCreateAccess);
if (rc != Success) {
dixFreePrivates(pCursor->devPrivates);
- xfree(pCursor);
+ free(pCursor);
return rc;
}
diff --git a/render/filter.c b/render/filter.c
index 89cc0646a..8bb6d5ec2 100644
--- a/render/filter.c
+++ b/render/filter.c
@@ -60,18 +60,18 @@ PictureGetFilterId (char *filter, int len, Bool makeit)
return i;
if (!makeit)
return -1;
- name = xalloc (len + 1);
+ name = malloc(len + 1);
if (!name)
return -1;
memcpy (name, filter, len);
name[len] = '\0';
if (filterNames)
- names = xrealloc (filterNames, (nfilterNames + 1) * sizeof (char *));
+ names = realloc(filterNames, (nfilterNames + 1) * sizeof (char *));
else
- names = xalloc (sizeof (char *));
+ names = malloc(sizeof (char *));
if (!names)
{
- xfree (name);
+ free(name);
return -1;
}
filterNames = names;
@@ -117,8 +117,8 @@ PictureFreeFilterIds (void)
int i;
for (i = 0; i < nfilterNames; i++)
- xfree (filterNames[i]);
- xfree (filterNames);
+ free(filterNames[i]);
+ free(filterNames);
nfilterNames = 0;
filterNames = 0;
}
@@ -144,9 +144,9 @@ PictureAddFilter (ScreenPtr pScreen,
if (ps->filters[i].id == id)
return -1;
if (ps->filters)
- filters = xrealloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec));
+ filters = realloc(ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec));
else
- filters = xalloc (sizeof (PictFilterRec));
+ filters = malloc(sizeof (PictFilterRec));
if (!filters)
return -1;
ps->filters = filters;
@@ -177,11 +177,11 @@ PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias)
PictFilterAliasPtr aliases;
if (ps->filterAliases)
- aliases = xrealloc (ps->filterAliases,
+ aliases = realloc(ps->filterAliases,
(ps->nfilterAliases + 1) *
sizeof (PictFilterAliasRec));
else
- aliases = xalloc (sizeof (PictFilterAliasRec));
+ aliases = malloc(sizeof (PictFilterAliasRec));
if (!aliases)
return FALSE;
ps->filterAliases = aliases;
@@ -273,8 +273,8 @@ PictureResetFilters (ScreenPtr pScreen)
{
PictureScreenPtr ps = GetPictureScreen(pScreen);
- xfree (ps->filters);
- xfree (ps->filterAliases);
+ free(ps->filters);
+ free(ps->filterAliases);
PictureFreeFilterIds ();
}
@@ -335,10 +335,10 @@ SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter,
if (nparams != pPicture->filter_nparams)
{
- xFixed *new_params = xalloc (nparams * sizeof (xFixed));
+ xFixed *new_params = malloc(nparams * sizeof (xFixed));
if (!new_params && nparams)
return BadAlloc;
- xfree (pPicture->filter_params);
+ free(pPicture->filter_params);
pPicture->filter_params = new_params;
pPicture->filter_nparams = nparams;
}
diff --git a/render/glyph.c b/render/glyph.c
index 6b81118ec..e5b8f8633 100644
--- a/render/glyph.c
+++ b/render/glyph.c
@@ -302,7 +302,7 @@ FreeGlyph (GlyphPtr glyph, int format)
FreeGlyphPicture(glyph);
FreeGlyphPrivates(glyph);
- xfree (glyph);
+ free(glyph);
}
}
@@ -321,7 +321,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id)
{
FreeGlyphPicture(glyph);
FreeGlyphPrivates(glyph);
- xfree (glyph);
+ free(glyph);
glyph = gr->glyph;
}
else if (gr->glyph != glyph)
@@ -381,7 +381,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth)
int i;
size = screenInfo.numScreens * sizeof (PicturePtr);
- glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec));
+ glyph = (GlyphPtr) malloc(size + sizeof (GlyphRec));
if (!glyph)
return 0;
glyph->refcnt = 0;
@@ -412,14 +412,14 @@ bail:
}
FreeGlyphPrivates(glyph);
- xfree (glyph);
+ free(glyph);
return 0;
}
Bool
AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet)
{
- hash->table = xcalloc (hashSet->size, sizeof (GlyphRefRec));
+ hash->table = calloc(hashSet->size, sizeof (GlyphRefRec));
if (!hash->table)
return FALSE;
hash->hashSet = hashSet;
@@ -462,7 +462,7 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global)
++newHash.tableEntries;
}
}
- xfree (hash->table);
+ free(hash->table);
}
*hash = newHash;
if (global)
@@ -490,13 +490,13 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format)
}
size = sizeof (GlyphSetRec);
- glyphSet = xcalloc (1, size);
+ glyphSet = calloc(1, size);
if (!glyphSet)
return FALSE;
if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0]))
{
- xfree (glyphSet);
+ free(glyphSet);
return FALSE;
}
glyphSet->refcnt = 1;
@@ -525,15 +525,15 @@ FreeGlyphSet (pointer value,
}
if (!globalGlyphs[glyphSet->fdepth].tableEntries)
{
- xfree (globalGlyphs[glyphSet->fdepth].table);
+ free(globalGlyphs[glyphSet->fdepth].table);
globalGlyphs[glyphSet->fdepth].table = 0;
globalGlyphs[glyphSet->fdepth].hashSet = 0;
}
else
ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], 0, TRUE);
- xfree (table);
+ free(table);
dixFreePrivates(glyphSet->devPrivates);
- xfree (glyphSet);
+ free(glyphSet);
}
return Success;
}
diff --git a/render/miindex.c b/render/miindex.c
index 4e0cf0084..c42a15b5e 100644
--- a/render/miindex.c
+++ b/render/miindex.c
@@ -260,15 +260,15 @@ miInitIndexed (ScreenPtr pScreen,
pixels[p] = p;
}
- pIndexed = xalloc (sizeof (miIndexedRec));
+ pIndexed = malloc(sizeof (miIndexedRec));
if (!pIndexed)
return FALSE;
pFormat->index.nvalues = num;
- pFormat->index.pValues = xalloc (num * sizeof (xIndexValue));
+ pFormat->index.pValues = malloc(num * sizeof (xIndexValue));
if (!pFormat->index.pValues)
{
- xfree (pIndexed);
+ free(pIndexed);
return FALSE;
}
@@ -324,12 +324,12 @@ miCloseIndexed (ScreenPtr pScreen,
{
if (pFormat->index.devPrivate)
{
- xfree (pFormat->index.devPrivate);
+ free(pFormat->index.devPrivate);
pFormat->index.devPrivate = 0;
}
if (pFormat->index.pValues)
{
- xfree (pFormat->index.pValues);
+ free(pFormat->index.pValues);
pFormat->index.pValues = 0;
}
}
diff --git a/render/mipict.c b/render/mipict.c
index b5dfcb2ba..1dad88eba 100644
--- a/render/mipict.c
+++ b/render/mipict.c
@@ -106,7 +106,7 @@ miChangePictureClip (PicturePtr pPicture,
if (!clientClip)
return BadAlloc;
clientClipType = CT_REGION;
- xfree(value);
+ free(value);
break;
}
(*ps->DestroyPictureClip) (pPicture);
diff --git a/render/mitri.c b/render/mitri.c
index a92c19b7e..a805a717c 100644
--- a/render/mitri.c
+++ b/render/mitri.c
@@ -144,7 +144,7 @@ miTriStrip (CARD8 op,
if (npoint < 3)
return;
ntri = npoint - 2;
- tris = xalloc (ntri * sizeof (xTriangle));
+ tris = malloc(ntri * sizeof (xTriangle));
if (!tris)
return;
for (tri = tris; npoint >= 3; npoint--, points++, tri++)
@@ -154,7 +154,7 @@ miTriStrip (CARD8 op,
tri->p3 = points[2];
}
(*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
- xfree (tris);
+ free(tris);
}
void
@@ -176,7 +176,7 @@ miTriFan (CARD8 op,
if (npoint < 3)
return;
ntri = npoint - 2;
- tris = xalloc (ntri * sizeof (xTriangle));
+ tris = malloc(ntri * sizeof (xTriangle));
if (!tris)
return;
first = points++;
@@ -187,5 +187,5 @@ miTriFan (CARD8 op,
tri->p3 = points[1];
}
(*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
- xfree (tris);
+ free(tris);
}
diff --git a/render/picture.c b/render/picture.c
index 48693b8ef..aab939100 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -89,8 +89,8 @@ PictureCloseScreen (int index, ScreenPtr pScreen)
(*ps->CloseIndexed) (pScreen, &ps->formats[n]);
GlyphUninit (pScreen);
SetPictureScreen(pScreen, 0);
- xfree (ps->formats);
- xfree (ps);
+ free(ps->formats);
+ free(ps);
return ret;
}
@@ -337,7 +337,7 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp)
}
- pFormats = xcalloc (nformats, sizeof (PictFormatRec));
+ pFormats = calloc(nformats, sizeof (PictFormatRec));
if (!pFormats)
return 0;
for (f = 0; f < nformats; f++)
@@ -638,7 +638,7 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
if (!AddResource (formats[n].id, PictFormatType, (pointer) (formats+n)))
{
- xfree (formats);
+ free(formats);
return FALSE;
}
if (formats[n].type == PictTypeIndexed)
@@ -669,10 +669,10 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
}
formats[n].format = PICT_FORMAT(0,type,a,r,g,b);
}
- ps = (PictureScreenPtr) xalloc (sizeof (PictureScreenRec));
+ ps = (PictureScreenPtr) malloc(sizeof (PictureScreenRec));
if (!ps)
{
- xfree (formats);
+ free(formats);
return FALSE;
}
SetPictureScreen(pScreen, ps);
@@ -699,8 +699,8 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
PictureResetFilters (pScreen);
SetPictureScreen(pScreen, 0);
- xfree (formats);
- xfree (ps);
+ free(formats);
+ free(ps);
return FALSE;
}
@@ -753,7 +753,7 @@ CreatePicture (Picture pid,
PicturePtr pPicture;
PictureScreenPtr ps = GetPictureScreen(pDrawable->pScreen);
- pPicture = (PicturePtr)xalloc(sizeof(PictureRec));
+ pPicture = (PicturePtr)malloc(sizeof(PictureRec));
if (!pPicture)
{
*error = BadAlloc;
@@ -874,7 +874,7 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
dpos = stopPoints[i];
}
- pGradient->gradient.stops = xalloc(stopCount*sizeof(PictGradientStop));
+ pGradient->gradient.stops = malloc(stopCount*sizeof(PictGradientStop));
if (!pGradient->gradient.stops) {
*error = BadAlloc;
return;
@@ -896,7 +896,7 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
static PicturePtr createSourcePicture(void)
{
PicturePtr pPicture;
- pPicture = (PicturePtr) xalloc(sizeof(PictureRec));
+ pPicture = (PicturePtr) malloc(sizeof(PictureRec));
pPicture->pDrawable = 0;
pPicture->pFormat = 0;
pPicture->pNext = 0;
@@ -918,10 +918,10 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error)
}
pPicture->id = pid;
- pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill));
+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill));
if (!pPicture->pSourcePict) {
*error = BadAlloc;
- xfree(pPicture);
+ free(pPicture);
return 0;
}
pPicture->pSourcePict->type = SourcePictTypeSolidFill;
@@ -947,10 +947,10 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2,
}
pPicture->id = pid;
- pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictLinearGradient));
+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient));
if (!pPicture->pSourcePict) {
*error = BadAlloc;
- xfree(pPicture);
+ free(pPicture);
return 0;
}
@@ -960,7 +960,7 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2,
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
if (*error) {
- xfree(pPicture);
+ free(pPicture);
return 0;
}
return pPicture;
@@ -988,10 +988,10 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer
}
pPicture->id = pid;
- pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictRadialGradient));
+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictRadialGradient));
if (!pPicture->pSourcePict) {
*error = BadAlloc;
- xfree(pPicture);
+ free(pPicture);
return 0;
}
radial = &pPicture->pSourcePict->radial;
@@ -1012,7 +1012,7 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
if (*error) {
- xfree(pPicture);
+ free(pPicture);
return 0;
}
return pPicture;
@@ -1036,10 +1036,10 @@ CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle,
}
pPicture->id = pid;
- pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictConicalGradient));
+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient));
if (!pPicture->pSourcePict) {
*error = BadAlloc;
- xfree(pPicture);
+ free(pPicture);
return 0;
}
@@ -1049,7 +1049,7 @@ CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle,
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
if (*error) {
- xfree(pPicture);
+ free(pPicture);
return 0;
}
return pPicture;
@@ -1385,7 +1385,7 @@ SetPictureTransform (PicturePtr pPicture,
{
if (!pPicture->transform)
{
- pPicture->transform = (PictTransform *) xalloc (sizeof (PictTransform));
+ pPicture->transform = (PictTransform *) malloc(sizeof (PictTransform));
if (!pPicture->transform)
return BadAlloc;
}
@@ -1395,7 +1395,7 @@ SetPictureTransform (PicturePtr pPicture,
{
if (pPicture->transform)
{
- xfree (pPicture->transform);
+ free(pPicture->transform);
pPicture->transform = 0;
}
}
@@ -1527,14 +1527,14 @@ FreePicture (pointer value,
if (--pPicture->refcnt == 0)
{
if (pPicture->transform)
- xfree (pPicture->transform);
+ free(pPicture->transform);
if (pPicture->pSourcePict)
{
if (pPicture->pSourcePict->type != SourcePictTypeSolidFill)
- xfree(pPicture->pSourcePict->linear.stops);
+ free(pPicture->pSourcePict->linear.stops);
- xfree(pPicture->pSourcePict);
+ free(pPicture->pSourcePict);
}
if (pPicture->pDrawable)
@@ -1569,7 +1569,7 @@ FreePicture (pointer value,
}
}
dixFreePrivates(pPicture->devPrivates);
- xfree (pPicture);
+ free(pPicture);
}
return Success;
}
diff --git a/render/render.c b/render/render.c
index 3c505d672..c9d3e8e8c 100644
--- a/render/render.c
+++ b/render/render.c
@@ -375,7 +375,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
ndepth * sizeof (xPictDepth) +
nvisual * sizeof (xPictVisual) +
numSubpixel * sizeof (CARD32));
- reply = (xRenderQueryPictFormatsReply *) xcalloc (1, rlength);
+ reply = (xRenderQueryPictFormatsReply *) calloc(1, rlength);
if (!reply)
return BadAlloc;
reply->type = X_Reply;
@@ -512,7 +512,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
swapl (&reply->numSubpixel, n);
}
WriteToClient(client, rlength, (char *) reply);
- xfree (reply);
+ free(reply);
return client->noClientException;
}
@@ -542,7 +542,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
num = pFormat->index.nvalues;
rlength = (sizeof (xRenderQueryPictIndexValuesReply) +
num * sizeof(xIndexValue));
- reply = (xRenderQueryPictIndexValuesReply *) xalloc (rlength);
+ reply = (xRenderQueryPictIndexValuesReply *) malloc(rlength);
if (!reply)
return BadAlloc;
@@ -571,7 +571,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
}
WriteToClient(client, rlength, (char *) reply);
- xfree(reply);
+ free(reply);
return (client->noClientException);
}
@@ -1058,7 +1058,7 @@ ProcRenderAddGlyphs (ClientPtr client)
}
else
{
- glyphsBase = (GlyphNewPtr) Xcalloc (nglyphs * sizeof (GlyphNewRec));
+ glyphsBase = (GlyphNewPtr)calloc(nglyphs, sizeof (GlyphNewRec));
if (!glyphsBase)
return BadAlloc;
}
@@ -1200,7 +1200,7 @@ ProcRenderAddGlyphs (ClientPtr client)
AddGlyph (glyphSet, glyphs[i].glyph, glyphs[i].id);
if (glyphsBase != glyphsLocal)
- Xfree (glyphsBase);
+ free(glyphsBase);
return client->noClientException;
bail:
if (pSrc)
@@ -1209,9 +1209,9 @@ bail:
FreeScratchPixmapHeader (pSrcPix);
for (i = 0; i < nglyphs; i++)
if (glyphs[i].glyph && ! glyphs[i].found)
- xfree (glyphs[i].glyph);
+ free(glyphs[i].glyph);
if (glyphsBase != glyphsLocal)
- Xfree (glyphsBase);
+ free(glyphsBase);
return err;
}
@@ -1335,7 +1335,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
glyphsBase = glyphsLocal;
else
{
- glyphsBase = (GlyphPtr *) xalloc (nglyph * sizeof (GlyphPtr));
+ glyphsBase = (GlyphPtr *) malloc(nglyph * sizeof (GlyphPtr));
if (!glyphsBase)
return BadAlloc;
}
@@ -1343,7 +1343,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
listsBase = listsLocal;
else
{
- listsBase = (GlyphListPtr) xalloc (nlist * sizeof (GlyphListRec));
+ listsBase = (GlyphListPtr) malloc(nlist * sizeof (GlyphListRec));
if (!listsBase)
return BadAlloc;
}
@@ -1366,9 +1366,9 @@ ProcRenderCompositeGlyphs (ClientPtr client)
if (rc != Success)
{
if (glyphsBase != glyphsLocal)
- xfree (glyphsBase);
+ free(glyphsBase);
if (listsBase != listsLocal)
- xfree (listsBase);
+ free(listsBase);
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
}
}
@@ -1422,9 +1422,9 @@ ProcRenderCompositeGlyphs (ClientPtr client)
glyphsBase);
if (glyphsBase != glyphsLocal)
- xfree (glyphsBase);
+ free(glyphsBase);
if (listsBase != listsLocal)
- xfree (listsBase);
+ free(listsBase);
return client->noClientException;
}
@@ -1518,23 +1518,23 @@ ProcRenderCreateCursor (ClientPtr client)
if ( stuff->x > width
|| stuff->y > height )
return (BadMatch);
- argbbits = xalloc (width * height * sizeof (CARD32));
+ argbbits = malloc(width * height * sizeof (CARD32));
if (!argbbits)
return (BadAlloc);
stride = BitmapBytePad(width);
nbytes_mono = stride*height;
- srcbits = xcalloc(1, nbytes_mono);
+ srcbits = calloc(1, nbytes_mono);
if (!srcbits)
{
- xfree (argbbits);
+ free(argbbits);
return (BadAlloc);
}
- mskbits = xcalloc(1, nbytes_mono);
+ mskbits = calloc(1, nbytes_mono);
if (!mskbits)
{
- xfree(argbbits);
- xfree(srcbits);
+ free(argbbits);
+ free(srcbits);
return (BadAlloc);
}
@@ -1554,27 +1554,27 @@ ProcRenderCreateCursor (ClientPtr client)
pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
if (!pFormat)
{
- xfree (argbbits);
- xfree (srcbits);
- xfree (mskbits);
+ free(argbbits);
+ free(srcbits);
+ free(mskbits);
return (BadImplementation);
}
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap)
{
- xfree (argbbits);
- xfree (srcbits);
- xfree (mskbits);
+ free(argbbits);
+ free(srcbits);
+ free(mskbits);
return (BadAlloc);
}
pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0,
client, &error);
if (!pPicture)
{
- xfree (argbbits);
- xfree (srcbits);
- xfree (mskbits);
+ free(argbbits);
+ free(srcbits);
+ free(mskbits);
return error;
}
(*pScreen->DestroyPixmap) (pPixmap);
@@ -1658,7 +1658,7 @@ ProcRenderCreateCursor (ClientPtr client)
}
else
{
- xfree (argbbits);
+ free(argbbits);
argbbits = 0;
}
@@ -1735,7 +1735,7 @@ ProcRenderQueryFilters (ClientPtr client)
}
len = ((nnames + 1) >> 1) + bytes_to_int32(nbytesName);
total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2);
- reply = (xRenderQueryFiltersReply *) xalloc (total_bytes);
+ reply = (xRenderQueryFiltersReply *) malloc(total_bytes);
if (!reply)
return BadAlloc;
aliases = (INT16 *) (reply + 1);
@@ -1806,7 +1806,7 @@ ProcRenderQueryFilters (ClientPtr client)
swapl(&reply->numFilters, n);
}
WriteToClient(client, total_bytes, (char *) reply);
- xfree (reply);
+ free(reply);
return(client->noClientException);
}
@@ -1847,7 +1847,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
if (client->req_len & 1)
return BadLength;
ncursor = (client->req_len - (bytes_to_int32(sizeof(xRenderCreateAnimCursorReq)))) >> 1;
- cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32)));
+ cursors = malloc(ncursor * (sizeof (CursorPtr) + sizeof (CARD32)));
if (!cursors)
return BadAlloc;
deltas = (CARD32 *) (cursors + ncursor);
@@ -1858,7 +1858,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
RT_CURSOR, client, DixReadAccess);
if (ret != Success)
{
- xfree (cursors);
+ free(cursors);
return (ret == BadValue) ? BadCursor : ret;
}
deltas[i] = elt->delay;
@@ -1866,7 +1866,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
}
ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor, client,
stuff->cid);
- xfree (cursors);
+ free(cursors);
if (ret != Success)
return ret;
@@ -2669,7 +2669,7 @@ PanoramiXRenderCreatePicture (ClientPtr client)
XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
return (result == BadValue) ? BadDrawable : result;
- if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newPict->type = XRT_PICTURE;
newPict->info[0].id = stuff->pid;
@@ -2695,7 +2695,7 @@ PanoramiXRenderCreatePicture (ClientPtr client)
if (result == Success)
AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
else
- xfree(newPict);
+ free(newPict);
return (result);
}
@@ -2905,7 +2905,7 @@ PanoramiXRenderFillRectangles (ClientPtr client)
VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess);
extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq);
if (extra_len &&
- (extra = (char *) xalloc (extra_len)))
+ (extra = (char *) malloc(extra_len)))
{
memcpy (extra, stuff + 1, extra_len);
FOR_NSCREENS_FORWARD(j) {
@@ -2931,7 +2931,7 @@ PanoramiXRenderFillRectangles (ClientPtr client)
result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client);
if(result != Success) break;
}
- xfree(extra);
+ free(extra);
}
return result;
@@ -2954,7 +2954,7 @@ PanoramiXRenderTrapezoids(ClientPtr client)
extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq);
if (extra_len &&
- (extra = (char *) xalloc (extra_len))) {
+ (extra = (char *) malloc(extra_len))) {
memcpy (extra, stuff + 1, extra_len);
FOR_NSCREENS_FORWARD(j) {
@@ -2991,7 +2991,7 @@ PanoramiXRenderTrapezoids(ClientPtr client)
if(result != Success) break;
}
- xfree(extra);
+ free(extra);
}
return result;
@@ -3014,7 +3014,7 @@ PanoramiXRenderTriangles(ClientPtr client)
extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq);
if (extra_len &&
- (extra = (char *) xalloc (extra_len))) {
+ (extra = (char *) malloc(extra_len))) {
memcpy (extra, stuff + 1, extra_len);
FOR_NSCREENS_FORWARD(j) {
@@ -3047,7 +3047,7 @@ PanoramiXRenderTriangles(ClientPtr client)
if(result != Success) break;
}
- xfree(extra);
+ free(extra);
}
return result;
@@ -3070,7 +3070,7 @@ PanoramiXRenderTriStrip(ClientPtr client)
extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq);
if (extra_len &&
- (extra = (char *) xalloc (extra_len))) {
+ (extra = (char *) malloc(extra_len))) {
memcpy (extra, stuff + 1, extra_len);
FOR_NSCREENS_FORWARD(j) {
@@ -3099,7 +3099,7 @@ PanoramiXRenderTriStrip(ClientPtr client)
if(result != Success) break;
}
- xfree(extra);
+ free(extra);
}
return result;
@@ -3122,7 +3122,7 @@ PanoramiXRenderTriFan(ClientPtr client)
extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq);
if (extra_len &&
- (extra = (char *) xalloc (extra_len))) {
+ (extra = (char *) malloc(extra_len))) {
memcpy (extra, stuff + 1, extra_len);
FOR_NSCREENS_FORWARD(j) {
@@ -3151,7 +3151,7 @@ PanoramiXRenderTriFan(ClientPtr client)
if(result != Success) break;
}
- xfree(extra);
+ free(extra);
}
return result;
@@ -3171,7 +3171,7 @@ PanoramiXRenderAddTraps (ClientPtr client)
VERIFY_XIN_PICTURE (picture, stuff->picture, client, DixWriteAccess);
extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq);
if (extra_len &&
- (extra = (char *) xalloc (extra_len)))
+ (extra = (char *) malloc(extra_len)))
{
memcpy (extra, stuff + 1, extra_len);
x_off = stuff->xOff;
@@ -3188,7 +3188,7 @@ PanoramiXRenderAddTraps (ClientPtr client)
result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client);
if(result != Success) break;
}
- xfree(extra);
+ free(extra);
}
return result;
@@ -3203,7 +3203,7 @@ PanoramiXRenderCreateSolidFill (ClientPtr client)
REQUEST_AT_LEAST_SIZE(xRenderCreateSolidFillReq);
- if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newPict->type = XRT_PICTURE;
@@ -3222,7 +3222,7 @@ PanoramiXRenderCreateSolidFill (ClientPtr client)
if (result == Success)
AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
else
- xfree(newPict);
+ free(newPict);
return result;
}
@@ -3236,7 +3236,7 @@ PanoramiXRenderCreateLinearGradient (ClientPtr client)
REQUEST_AT_LEAST_SIZE(xRenderCreateLinearGradientReq);
- if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newPict->type = XRT_PICTURE;
@@ -3255,7 +3255,7 @@ PanoramiXRenderCreateLinearGradient (ClientPtr client)
if (result == Success)
AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
else
- xfree(newPict);
+ free(newPict);
return result;
}
@@ -3269,7 +3269,7 @@ PanoramiXRenderCreateRadialGradient (ClientPtr client)
REQUEST_AT_LEAST_SIZE(xRenderCreateRadialGradientReq);
- if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newPict->type = XRT_PICTURE;
@@ -3288,7 +3288,7 @@ PanoramiXRenderCreateRadialGradient (ClientPtr client)
if (result == Success)
AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
else
- xfree(newPict);
+ free(newPict);
return result;
}
@@ -3302,7 +3302,7 @@ PanoramiXRenderCreateConicalGradient (ClientPtr client)
REQUEST_AT_LEAST_SIZE(xRenderCreateConicalGradientReq);
- if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newPict->type = XRT_PICTURE;
@@ -3321,7 +3321,7 @@ PanoramiXRenderCreateConicalGradient (ClientPtr client)
if (result == Success)
AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
else
- xfree(newPict);
+ free(newPict);
return result;
}