From 2646fc254e75c4a7fc10d03d1139d0bd708ceae9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 26 Jun 2016 01:51:18 +0200 Subject: nx-X11/programs/Xserver: Drop {X,x}alloc() macros, use malloc() instead. --- nx-X11/programs/Xserver/render/animcur.c | 4 ++-- nx-X11/programs/Xserver/render/filter.c | 10 +++++----- nx-X11/programs/Xserver/render/glyph.c | 8 ++++---- nx-X11/programs/Xserver/render/miindex.c | 4 ++-- nx-X11/programs/Xserver/render/picture.c | 20 ++++++++++---------- nx-X11/programs/Xserver/render/render.c | 18 +++++++++--------- 6 files changed, 32 insertions(+), 32 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c index 993800c7e..c5535050e 100644 --- a/nx-X11/programs/Xserver/render/animcur.c +++ b/nx-X11/programs/Xserver/render/animcur.c @@ -334,7 +334,7 @@ AnimCurInit (ScreenPtr pScreen) animCurState.elt = 0; animCurState.time = 0; } - as = (AnimCurScreenPtr) xalloc (sizeof (AnimCurScreenRec)); + as = (AnimCurScreenPtr) malloc (sizeof (AnimCurScreenRec)); if (!as) return FALSE; Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); @@ -366,7 +366,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) diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c index 31d5481c9..065ffa682 100644 --- a/nx-X11/programs/Xserver/render/filter.c +++ b/nx-X11/programs/Xserver/render/filter.c @@ -62,7 +62,7 @@ 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); @@ -70,7 +70,7 @@ PictureGetFilterId (char *filter, int len, Bool makeit) if (filterNames) names = xrealloc (filterNames, (nfilterNames + 1) * sizeof (char *)); else - names = xalloc (sizeof (char *)); + names = malloc (sizeof (char *)); if (!names) { free (name); @@ -146,7 +146,7 @@ PictureAddFilter (ScreenPtr pScreen, if (ps->filters) filters = xrealloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec)); else - filters = xalloc (sizeof (PictFilterRec)); + filters = malloc (sizeof (PictFilterRec)); if (!filters) return -1; ps->filters = filters; @@ -179,7 +179,7 @@ PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias) (ps->nfilterAliases + 1) * sizeof (PictFilterAliasRec)); else - aliases = xalloc (sizeof (PictFilterAliasRec)); + aliases = malloc (sizeof (PictFilterAliasRec)); if (!aliases) return FALSE; ps->filterAliases = aliases; @@ -336,7 +336,7 @@ 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; diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index f956c44b2..4cba50d0f 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -122,7 +122,7 @@ _GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr) if (!new) return FALSE; } else { - new = (void **) xalloc ((n + 1) * sizeof (void *)); + new = (void **) malloc ((n + 1) * sizeof (void *)); if (!new) return FALSE; if (glyphSet->devPrivates) @@ -346,7 +346,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth) if (gi->height && padded_width > (UINT32_MAX - sizeof(GlyphRec))/gi->height) return 0; size = gi->height * padded_width; - glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec)); + glyph = (GlyphPtr) malloc (size + sizeof (GlyphRec)); if (!glyph) return 0; glyph->refcnt = 0; @@ -358,7 +358,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth) Bool AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet) { - hash->table = (GlyphRefPtr) xalloc (hashSet->size * sizeof (GlyphRefRec)); + hash->table = (GlyphRefPtr) malloc (hashSet->size * sizeof (GlyphRefRec)); if (!hash->table) return FALSE; memset (hash->table, 0, hashSet->size * sizeof (GlyphRefRec)); @@ -434,7 +434,7 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) size = (sizeof (GlyphSetRec) + (sizeof (void *) * _GlyphSetPrivateAllocateIndex)); - glyphSet = xalloc (size); + glyphSet = malloc (size); if (!glyphSet) return FALSE; bzero((char *)glyphSet, size); diff --git a/nx-X11/programs/Xserver/render/miindex.c b/nx-X11/programs/Xserver/render/miindex.c index ad2653c14..ce31c00fb 100644 --- a/nx-X11/programs/Xserver/render/miindex.c +++ b/nx-X11/programs/Xserver/render/miindex.c @@ -259,12 +259,12 @@ 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) { free (pIndexed); diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 1e653b0c3..1131696d5 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -365,7 +365,7 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) } - pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec)); + pFormats = (PictFormatPtr) malloc (nformats * sizeof (PictFormatRec)); if (!pFormats) return 0; memset (pFormats, '\0', nformats * sizeof (PictFormatRec)); @@ -689,7 +689,7 @@ 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) { free (formats); @@ -784,7 +784,7 @@ AllocatePicture (ScreenPtr pScreen) unsigned int size; int i; - pPicture = (PicturePtr) xalloc (ps->totalPictureSize); + pPicture = (PicturePtr) malloc (ps->totalPictureSize); if (!pPicture) return 0; ppriv = (DevUnion *)(pPicture + 1); @@ -961,7 +961,7 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, dpos = stopPoints[i]; } - pGradient->linear.stops = xalloc(stopCount*sizeof(PictGradientStop)); + pGradient->linear.stops = malloc(stopCount*sizeof(PictGradientStop)); if (!pGradient->linear.stops) { *error = BadAlloc; return; @@ -980,7 +980,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; @@ -1000,7 +1000,7 @@ 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; free(pPicture); @@ -1034,7 +1034,7 @@ 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; free(pPicture); @@ -1083,7 +1083,7 @@ 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; free(pPicture); @@ -1134,7 +1134,7 @@ 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; free(pPicture); @@ -1477,7 +1477,7 @@ SetPictureTransform (PicturePtr pPicture, { if (!pPicture->transform) { - pPicture->transform = (PictTransform *) xalloc (sizeof (PictTransform)); + pPicture->transform = (PictTransform *) malloc (sizeof (PictTransform)); if (!pPicture->transform) return BadAlloc; } diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 58b3dbc88..c6cb7bce7 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -413,7 +413,7 @@ ProcRenderQueryPictFormats (ClientPtr client) ndepth * sizeof (xPictDepth) + nvisual * sizeof (xPictVisual) + numSubpixel * sizeof (CARD32)); - reply = (xRenderQueryPictFormatsReply *) xalloc (rlength); + reply = (xRenderQueryPictFormatsReply *) malloc (rlength); if (!reply) return BadAlloc; memset(reply, 0, rlength); @@ -588,7 +588,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; @@ -1139,7 +1139,7 @@ ProcRenderAddGlyphs (ClientPtr client) glyphsBase = glyphsLocal; else { - glyphsBase = (GlyphNewPtr) Xalloc (nglyphs * sizeof (GlyphNewRec)); + glyphsBase = (GlyphNewPtr) malloc (nglyphs * sizeof (GlyphNewRec)); if (!glyphsBase) return BadAlloc; } @@ -1533,19 +1533,19 @@ 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 = (unsigned char *)xalloc(nbytes_mono); + srcbits = (unsigned char *)malloc(nbytes_mono); if (!srcbits) { free (argbbits); return (BadAlloc); } - mskbits = (unsigned char *)xalloc(nbytes_mono); + mskbits = (unsigned char *)malloc(nbytes_mono); if (!mskbits) { free(argbbits); @@ -1748,7 +1748,7 @@ ProcRenderQueryFilters (ClientPtr client) } len = ((nnames + 1) >> 1) + ((nbytesName + 3) >> 2); total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2); - reply = (xRenderQueryFiltersReply *) xalloc (total_bytes); + reply = (xRenderQueryFiltersReply *) malloc (total_bytes); if (!reply) return BadAlloc; aliases = (INT16 *) (reply + 1); @@ -1862,7 +1862,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) if (client->req_len & 1) return BadLength; ncursor = (client->req_len - (SIZEOF(xRenderCreateAnimCursorReq) >> 2)) >> 1; - cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); + cursors = malloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); if (!cursors) return BadAlloc; deltas = (CARD32 *) (cursors + ncursor); @@ -2681,7 +2681,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) return BadDrawable; - if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) + if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPict->type = XRT_PICTURE; newPict->info[0].id = stuff->pid; -- cgit v1.2.3