diff options
Diffstat (limited to 'hw')
166 files changed, 1055 insertions, 1055 deletions
diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c index a1afe76cf..95e7adca9 100644 --- a/hw/dmx/dmx.c +++ b/hw/dmx/dmx.c @@ -419,7 +419,7 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client) if (!_DMXXineramaActive()) goto noxinerama; - if (!(attribs = xalloc(stuff->screenCount * sizeof(*attribs)))) + if (!(attribs = malloc(stuff->screenCount * sizeof(*attribs)))) return BadAlloc; for (i = 0; i < stuff->screenCount; i++) { @@ -438,7 +438,7 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client) &errorScreen); #endif - xfree(attribs); + free(attribs); if (status == BadValue) return status; @@ -484,7 +484,7 @@ static int ProcDMXAddScreen(ClientPtr client) value_list = (CARD32 *)(stuff + 1); count = dmxFetchScreenAttributes(stuff->valueMask, &attr, value_list); - if (!(name = xalloc(stuff->displayNameLength + 1 + 4))) + if (!(name = malloc(stuff->displayNameLength + 1 + 4))) return BadAlloc; memcpy(name, &value_list[count], stuff->displayNameLength); name[stuff->displayNameLength] = '\0'; @@ -492,7 +492,7 @@ static int ProcDMXAddScreen(ClientPtr client) status = dmxAttachScreen(stuff->physicalScreen, &attr); - xfree(name); + free(name); rep.type = X_Reply; rep.sequenceNumber = client->sequence; @@ -612,30 +612,30 @@ static int ProcDMXGetWindowAttributes(ClientPtr client) REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq); - if (!(screens = xalloc(count * sizeof(*screens)))) + if (!(screens = malloc(count * sizeof(*screens)))) return BadAlloc; - if (!(windows = xalloc(count * sizeof(*windows)))) { - xfree(screens); + if (!(windows = malloc(count * sizeof(*windows)))) { + free(screens); return BadAlloc; } - if (!(pos = xalloc(count * sizeof(*pos)))) { - xfree(windows); - xfree(screens); + if (!(pos = malloc(count * sizeof(*pos)))) { + free(windows); + free(screens); return BadAlloc; } - if (!(vis = xalloc(count * sizeof(*vis)))) { - xfree(pos); - xfree(windows); - xfree(screens); + if (!(vis = malloc(count * sizeof(*vis)))) { + free(pos); + free(windows); + free(screens); return BadAlloc; } if ((count = dmxPopulate(client, stuff->window, screens, windows, pos, vis)) < 0) { - xfree(vis); - xfree(pos); - xfree(windows); - xfree(screens); + free(vis); + free(pos); + free(windows); + free(screens); return BadWindow; } @@ -673,10 +673,10 @@ static int ProcDMXGetWindowAttributes(ClientPtr client) WriteToClient(client, count * sizeof(*vis), (char *)vis); } - xfree(vis); - xfree(pos); - xfree(windows); - xfree(screens); + free(vis); + free(pos); + free(windows); + free(screens); return client->noClientException; } @@ -837,7 +837,7 @@ static int ProcDMXAddInput(ClientPtr client) value_list = (CARD32 *)(stuff + 1); count = dmxFetchInputAttributes(stuff->valueMask, &attr, value_list); - if (!(name = xalloc(stuff->displayNameLength + 1 + 4))) + if (!(name = malloc(stuff->displayNameLength + 1 + 4))) return BadAlloc; memcpy(name, &value_list[count], stuff->displayNameLength); name[stuff->displayNameLength] = '\0'; @@ -845,7 +845,7 @@ static int ProcDMXAddInput(ClientPtr client) status = dmxAddInput(&attr, &id); - xfree(name); + free(name); if (status) return status; diff --git a/hw/dmx/dmx_glxvisuals.c b/hw/dmx/dmx_glxvisuals.c index ec33468be..59173ca5f 100644 --- a/hw/dmx/dmx_glxvisuals.c +++ b/hw/dmx/dmx_glxvisuals.c @@ -94,7 +94,7 @@ __GLXvisualConfig *GetGLXVisualConfigs(Display *dpy, int screen, int *nconfigs) config = (__GLXvisualConfig*) Xmalloc(nvisuals * sizeof(__GLXvisualConfig)); if (!config) { - Xfree(props); + free(props); UnlockDisplay(dpy); SyncHandle(); return NULL; @@ -284,7 +284,7 @@ __GLXFBConfig *GetGLXFBConfigs(Display *dpy, int glxMajorOpcode, int *nconfigs) config = (__GLXFBConfig*) Xmalloc(numFBConfigs * sizeof(__GLXFBConfig)); if (!config) { - Xfree(attrs); + free(attrs); UnlockDisplay(dpy); SyncHandle(); return NULL; diff --git a/hw/dmx/dmxcmap.c b/hw/dmx/dmxcmap.c index 4aa586aff..e3d2fdcdc 100644 --- a/hw/dmx/dmxcmap.c +++ b/hw/dmx/dmxcmap.c @@ -50,7 +50,7 @@ static Bool dmxAllocateColormapPrivates(ColormapPtr pColormap) { dmxColormapPrivPtr pCmapPriv; - pCmapPriv = (dmxColormapPrivPtr)xalloc(sizeof(*pCmapPriv)); + pCmapPriv = (dmxColormapPrivPtr)malloc(sizeof(*pCmapPriv)); if (!pCmapPriv) return FALSE; pCmapPriv->cmap = (Colormap)0; @@ -133,7 +133,7 @@ void dmxDestroyColormap(ColormapPtr pColormap) if (dmxScreen->beDisplay) dmxBEFreeColormap(pColormap); - xfree(pCmapPriv); + free(pCmapPriv); DMX_SET_COLORMAP_PRIV(pColormap, NULL); DMX_UNWRAP(DestroyColormap, dmxScreen, pScreen); @@ -170,7 +170,7 @@ void dmxStoreColors(ColormapPtr pColormap, int ndef, xColorItem *pdef) dmxColormapPrivPtr pCmapPriv = DMX_GET_COLORMAP_PRIV(pColormap); if (dmxScreen->beDisplay && (pColormap->pVisual->class & DynamicClass)) { - XColor *color = xalloc(sizeof(*color) * ndef); + XColor *color = malloc(sizeof(*color) * ndef); int i; if (color) { @@ -183,7 +183,7 @@ void dmxStoreColors(ColormapPtr pColormap, int ndef, xColorItem *pdef) color[i].pad = pdef[i].pad; } XStoreColors(dmxScreen->beDisplay, pCmapPriv->cmap, color, ndef); - xfree(color); + free(color); } else { /* xalloc failed, so fallback */ XColor c; for (i = 0; i < ndef; i++) { diff --git a/hw/dmx/dmxcursor.c b/hw/dmx/dmxcursor.c index 37e66d758..bf5640db7 100644 --- a/hw/dmx/dmxcursor.c +++ b/hw/dmx/dmxcursor.c @@ -663,7 +663,7 @@ static Bool _dmxRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) DMXDBG2("_dmxRealizeCursor(%d,%p)\n", pScreen->myNum, pCursor); - DMX_SET_CURSOR_PRIV(pCursor, pScreen, xalloc(sizeof(*pCursorPriv))); + DMX_SET_CURSOR_PRIV(pCursor, pScreen, malloc(sizeof(*pCursorPriv))); if (!DMX_GET_CURSOR_PRIV(pCursor, pScreen)) return FALSE; @@ -701,7 +701,7 @@ static Bool _dmxUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) if (dmxScreen->beDisplay) { if (dmxBEFreeCursor(pScreen, pCursor)) - xfree(DMX_GET_CURSOR_PRIV(pCursor, pScreen)); + free(DMX_GET_CURSOR_PRIV(pCursor, pScreen)); } DMX_SET_CURSOR_PRIV(pCursor, pScreen, NULL); diff --git a/hw/dmx/dmxfont.c b/hw/dmx/dmxfont.c index c33aee79a..8e4a17e50 100644 --- a/hw/dmx/dmxfont.c +++ b/hw/dmx/dmxfont.c @@ -68,9 +68,9 @@ static char **dmxGetFontPath(int *npaths) GetFontPath(serverClient, npaths, &len, &paths); - newfp = xalloc(*npaths + len); + newfp = malloc(*npaths + len); c = (unsigned char *)newfp; - fp = xalloc(*npaths * sizeof(*fp)); + fp = malloc(*npaths * sizeof(*fp)); memmove(newfp, paths+1, *npaths + len - 1); l = *paths; @@ -91,8 +91,8 @@ static char **dmxGetFontPath(int *npaths) static void dmxFreeFontPath(char **fp) { - xfree(fp[0]); - xfree(fp); + free(fp[0]); + free(fp); } static Bool dmxCheckFontPathElement(DMXScreenInfo *dmxScreen, char *fp) @@ -195,7 +195,7 @@ static int dmxProcSetFontPath(ClientPtr client) return BadLength; GetFontPath(serverClient, &nOldPaths, &lenOldPaths, &tmpFontPath); - oldFontPath = xalloc(nOldPaths + lenOldPaths); + oldFontPath = malloc(nOldPaths + lenOldPaths); memmove(oldFontPath, tmpFontPath, nOldPaths + lenOldPaths); result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1], @@ -217,7 +217,7 @@ static int dmxProcSetFontPath(ClientPtr client) } } - xfree(oldFontPath); + free(oldFontPath); return result; } @@ -300,7 +300,7 @@ Bool dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont) if (!dmxFontPath) dmxLog(dmxWarning, "No default font path is set.\n"); - goodfps = xalloc(npaths * sizeof(*goodfps)); + goodfps = malloc(npaths * sizeof(*goodfps)); dmxLog(dmxError, "The DMX server failed to set the following font paths on " @@ -347,11 +347,11 @@ Bool dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont) "more information on font paths.\n"); dmxFreeFontPath(fp); XFreeFontPath(oldFontPath); - xfree(goodfps); + free(goodfps); return FALSE; } - newfp = xalloc(len * sizeof(*newfp)); + newfp = malloc(len * sizeof(*newfp)); for (i = 0; i < npaths; i++) { if (goodfps[i]) { int n = strlen(fp[i]); @@ -398,7 +398,7 @@ Bool dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont) /* We still have errors so return with error */ dmxFreeFontPath(fp); XFreeFontPath(oldFontPath); - xfree(goodfps); + free(goodfps); return FALSE; } } @@ -440,12 +440,12 @@ Bool dmxRealizeFont(ScreenPtr pScreen, FontPtr pFont) if (!(pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex))) { FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); - pFontPriv = xalloc(sizeof(dmxFontPrivRec)); + pFontPriv = malloc(sizeof(dmxFontPrivRec)); if (!pFontPriv) return FALSE; pFontPriv->font = NULL; MAXSCREENSALLOC(pFontPriv->font); if (!pFontPriv->font) { - xfree(pFontPriv); + free(pFontPriv); return FALSE; } pFontPriv->refcnt = 0; @@ -491,7 +491,7 @@ Bool dmxUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) /* In case the font failed to load properly */ if (!pFontPriv->refcnt) { MAXSCREENSFREE(pFontPriv->font); - xfree(pFontPriv); + free(pFontPriv); FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); } else if (pFontPriv->font[pScreen->myNum]) { if (dmxScreen->beDisplay) @@ -549,7 +549,7 @@ Bool dmxUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) #endif ) { MAXSCREENSFREE(pFontPriv->font); - xfree(pFontPriv); + free(pFontPriv); FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); } } diff --git a/hw/dmx/dmxgc.c b/hw/dmx/dmxgc.c index eb21d3c60..a761ea89a 100644 --- a/hw/dmx/dmxgc.c +++ b/hw/dmx/dmxgc.c @@ -364,7 +364,7 @@ void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) case CT_REGION: if (dmxScreen->beDisplay) { nRects = REGION_NUM_RECTS((RegionPtr)pGC->clientClip); - pRects = xalloc(nRects * sizeof(*pRects)); + pRects = malloc(nRects * sizeof(*pRects)); pBox = REGION_RECTS((RegionPtr)pGC->clientClip); for (i = 0; i < nRects; i++) { @@ -378,7 +378,7 @@ void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) pGC->clipOrg.x, pGC->clipOrg.y, pRects, nRects, Unsorted); - xfree(pRects); + free(pRects); } break; diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c index cc9ea0b97..8a03c65ce 100644 --- a/hw/dmx/dmxinit.c +++ b/hw/dmx/dmxinit.c @@ -412,7 +412,7 @@ void dmxGetColormaps(DMXScreenInfo *dmxScreen) int i; dmxScreen->beNumDefColormaps = dmxScreen->beNumVisuals; - dmxScreen->beDefColormaps = xalloc(dmxScreen->beNumDefColormaps * + dmxScreen->beDefColormaps = malloc(dmxScreen->beNumDefColormaps * sizeof(*dmxScreen->beDefColormaps)); for (i = 0; i < dmxScreen->beNumDefColormaps; i++) @@ -738,7 +738,7 @@ void InitOutput(ScreenInfo *pScreenInfo, int argc, char *argv[]) nconfigs = dmxScreen->numGlxVisuals; } - configprivs = xalloc(nconfigs * sizeof(dmxGlxVisualPrivate*)); + configprivs = malloc(nconfigs * sizeof(dmxGlxVisualPrivate*)); if (configs != NULL && configprivs != NULL) { @@ -748,7 +748,7 @@ void InitOutput(ScreenInfo *pScreenInfo, int argc, char *argv[]) for (i = 0; i < nconfigs; i++) { configprivs[i] = (dmxGlxVisualPrivate *) - xalloc(sizeof(dmxGlxVisualPrivate)); + malloc(sizeof(dmxGlxVisualPrivate)); configprivs[i]->x_visual_depth = 0; configprivs[i]->x_visual_class = 0; @@ -816,11 +816,11 @@ static void dmxSetDefaultFontPath(char *fp) int len; len = strlen(dmxFontPath); - dmxFontPath = xrealloc(dmxFontPath, len+fplen+1); + dmxFontPath = realloc(dmxFontPath, len+fplen+1); dmxFontPath[len] = ','; strncpy(&dmxFontPath[len+1], fp, fplen); } else { - dmxFontPath = xalloc(fplen); + dmxFontPath = malloc(fplen); strncpy(dmxFontPath, fp, fplen); } diff --git a/hw/dmx/dmxpict.c b/hw/dmx/dmxpict.c index 8398be79f..0544c88ba 100644 --- a/hw/dmx/dmxpict.c +++ b/hw/dmx/dmxpict.c @@ -274,7 +274,7 @@ static int dmxProcRenderCreateGlyphSet(ClientPtr client) glyphSet = SecurityLookupIDByType(client, stuff->gsid, GlyphSetType, DixDestroyAccess); - glyphPriv = xalloc(sizeof(dmxGlyphPrivRec)); + glyphPriv = malloc(sizeof(dmxGlyphPrivRec)); if (!glyphPriv) return BadAlloc; glyphPriv->glyphSets = NULL; MAXSCREENSALLOC_RETURN(glyphPriv->glyphSets, BadAlloc); @@ -331,7 +331,7 @@ static int dmxProcRenderFreeGlyphSet(ClientPtr client) } MAXSCREENSFREE(glyphPriv->glyphSets); - xfree(glyphPriv); + free(glyphPriv); DMX_SET_GLYPH_PRIV(glyphSet, NULL); } @@ -369,7 +369,7 @@ static int dmxProcRenderAddGlyphs(ClientPtr client) sizeof(xRenderAddGlyphsReq) - (sizeof(CARD32) + sizeof(xGlyphInfo)) * nglyphs); - gidsCopy = xalloc(sizeof(*gidsCopy) * nglyphs); + gidsCopy = malloc(sizeof(*gidsCopy) * nglyphs); for (i = 0; i < nglyphs; i++) gidsCopy[i] = gids[i]; /* FIXME: Will this ever fail? */ @@ -387,7 +387,7 @@ static int dmxProcRenderAddGlyphs(ClientPtr client) dmxSync(dmxScreen, FALSE); } } - xfree(gidsCopy); + free(gidsCopy); } return ret; @@ -411,7 +411,7 @@ static int dmxProcRenderFreeGlyphs(ClientPtr client) nglyphs = ((client->req_len << 2) - sizeof(xRenderFreeGlyphsReq)) >> 2; if (nglyphs) { - gids = xalloc(sizeof(*gids) * nglyphs); + gids = malloc(sizeof(*gids) * nglyphs); for (i = 0; i < nglyphs; i++) gids[i] = ((CARD32 *)(stuff + 1))[i]; @@ -424,7 +424,7 @@ static int dmxProcRenderFreeGlyphs(ClientPtr client) dmxSync(dmxScreen, FALSE); } } - xfree(gids); + free(gids); } } @@ -531,13 +531,13 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client) /* The following only works for Render version > 0.2 */ /* All of the XGlyphElt* structure sizes are identical */ - elts = xalloc(nelt * sizeof(XGlyphElt8)); + elts = malloc(nelt * sizeof(XGlyphElt8)); if (!elts) return BadAlloc; - glyphs = xalloc(nglyph * size); + glyphs = malloc(nglyph * size); if (!glyphs) { - xfree(elts); + free(elts); return BadAlloc; } @@ -605,8 +605,8 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client) dmxSync(dmxScreen, FALSE); - xfree(elts); - xfree(glyphs); + free(elts); + free(glyphs); } return ret; @@ -878,7 +878,7 @@ int dmxChangePictureClip(PicturePtr pPicture, int clipType, int nRects; nRects = nBox; - pRects = pRect = xalloc(nRects * sizeof(*pRect)); + pRects = pRect = malloc(nRects * sizeof(*pRect)); while (nBox--) { pRect->x = pBox->x1; @@ -894,7 +894,7 @@ int dmxChangePictureClip(PicturePtr pPicture, int clipType, 0, 0, pRects, nRects); - xfree(pRects); + free(pRects); } else { XRenderSetPictureClipRectangles(dmxScreen->beDisplay, pPictPriv->pict, diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c index 66224031a..c8b064b78 100644 --- a/hw/dmx/dmxpixmap.c +++ b/hw/dmx/dmxpixmap.c @@ -175,7 +175,7 @@ Bool dmxDestroyPixmap(PixmapPtr pPixmap) } } dixFreePrivates(pPixmap->devPrivates); - xfree(pPixmap); + free(pPixmap); #if 0 if (pScreen->DestroyPixmap) diff --git a/hw/dmx/dmxprop.c b/hw/dmx/dmxprop.c index 376313d8d..d4618e3fa 100644 --- a/hw/dmx/dmxprop.c +++ b/hw/dmx/dmxprop.c @@ -157,8 +157,8 @@ static int dmxPropertyCheckOtherServers(DMXScreenInfo *dmxScreen, Atom atom) dmxLogOutputWarning(dmxScreen, "%s also running on %s\n", tp.value, dmxScreen->name); - list = xrealloc(list, ++count * sizeof(*list)); - list[count-1] = xalloc(tp.nitems + 2); + list = realloc(list, ++count * sizeof(*list)); + list[count-1] = malloc(tp.nitems + 2); strncpy(list[count-1], (char *)tp.value, tp.nitems + 1); } XFree(tp.value); @@ -167,8 +167,8 @@ static int dmxPropertyCheckOtherServers(DMXScreenInfo *dmxScreen, Atom atom) } XSetErrorHandler(dmxOldHandler); - for (i = 0; i < count; i++) xfree(list[i]); - xfree(list); + for (i = 0; i < count; i++) free(list[i]); + free(list); XFree(tproot.value); if (!retcode) dmxLogOutput(dmxScreen, "No Xdmx server running on backend\n"); diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c index c1beb9ba5..068e80908 100644 --- a/hw/dmx/dmxscrinit.c +++ b/hw/dmx/dmxscrinit.c @@ -393,7 +393,7 @@ void dmxBECloseScreen(ScreenPtr pScreen) /* Free resources allocated during initialization (in dmxinit.c) */ for (i = 0; i < dmxScreen->beNumDefColormaps; i++) XFreeColormap(dmxScreen->beDisplay, dmxScreen->beDefColormaps[i]); - xfree(dmxScreen->beDefColormaps); + free(dmxScreen->beDefColormaps); dmxScreen->beDefColormaps = NULL; #if 0 @@ -435,7 +435,7 @@ Bool dmxCloseScreen(int idx, ScreenPtr pScreen) if (dmxShadowFB) { /* Free the shadow framebuffer */ - xfree(dmxScreen->shadow); + free(dmxScreen->shadow); } else { /* Unwrap Shape functions */ diff --git a/hw/dmx/dmxsync.c b/hw/dmx/dmxsync.c index 2cec1b97c..2c7ccb837 100644 --- a/hw/dmx/dmxsync.c +++ b/hw/dmx/dmxsync.c @@ -159,7 +159,7 @@ void dmxSync(DMXScreenInfo *dmxScreen, Bool now) * 2) freed, if it was on a queue (dmxSyncPending != 0), or * 3) allocated, if it wasn't on a queue (dmxSyncPending == 0) */ - if (dmxSyncTimer && !dmxSyncPending) xfree(dmxSyncTimer); + if (dmxSyncTimer && !dmxSyncPending) free(dmxSyncTimer); dmxSyncTimer = NULL; now = TRUE; dmxGeneration = serverGeneration; diff --git a/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c index ea2f2c579..39af51032 100644 --- a/hw/dmx/dmxwindow.c +++ b/hw/dmx/dmxwindow.c @@ -942,7 +942,7 @@ static void dmxDoSetShape(WindowPtr pWindow) if (wBoundingShape(pWindow)) { pBox = REGION_RECTS(wBoundingShape(pWindow)); nRect = nBox = REGION_NUM_RECTS(wBoundingShape(pWindow)); - pRectFirst = pRect = xalloc(nRect * sizeof(*pRect)); + pRectFirst = pRect = malloc(nRect * sizeof(*pRect)); while (nBox--) { pRect->x = pBox->x1; pRect->y = pBox->y1; @@ -955,7 +955,7 @@ static void dmxDoSetShape(WindowPtr pWindow) ShapeBounding, 0, 0, pRectFirst, nRect, ShapeSet, YXBanded); - xfree(pRectFirst); + free(pRectFirst); } else { XShapeCombineMask(dmxScreen->beDisplay, pWinPriv->window, ShapeBounding, 0, 0, None, ShapeSet); @@ -965,7 +965,7 @@ static void dmxDoSetShape(WindowPtr pWindow) if (wClipShape(pWindow)) { pBox = REGION_RECTS(wClipShape(pWindow)); nRect = nBox = REGION_NUM_RECTS(wClipShape(pWindow)); - pRectFirst = pRect = xalloc(nRect * sizeof(*pRect)); + pRectFirst = pRect = malloc(nRect * sizeof(*pRect)); while (nBox--) { pRect->x = pBox->x1; pRect->y = pBox->y1; @@ -978,7 +978,7 @@ static void dmxDoSetShape(WindowPtr pWindow) ShapeClip, 0, 0, pRectFirst, nRect, ShapeSet, YXBanded); - xfree(pRectFirst); + free(pRectFirst); } else { XShapeCombineMask(dmxScreen->beDisplay, pWinPriv->window, ShapeClip, 0, 0, None, ShapeSet); diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c index 31fd431e7..d9b884a8f 100644 --- a/hw/dmx/glxProxy/glxcmds.c +++ b/hw/dmx/glxProxy/glxcmds.c @@ -2448,7 +2448,7 @@ int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc) len = (int)be_reply.length; numbytes = (int)be_reply.n; slop = numbytes * __GLX_SIZE_INT8 & 3; - be_buf = (char *)Xalloc(numbytes); + be_buf = (char *)malloc(numbytes); if (!be_buf) { /* Throw data on the floor */ _XEatData(dpy, len); @@ -2526,7 +2526,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc) len = (int)be_reply.length; numbytes = (int)be_reply.n; slop = numbytes * __GLX_SIZE_INT8 & 3; - be_buf = (char *)Xalloc(numbytes); + be_buf = (char *)malloc(numbytes); if (!be_buf) { /* Throw data on the floor */ _XEatData(dpy, len); @@ -2947,7 +2947,7 @@ int __glXCreateWindow(__GLXclientState *cl, GLbyte *pc) return BadAlloc; } - pGlxWindow = (__glXWindow *) xalloc(sizeof(__glXWindow)); + pGlxWindow = (__glXWindow *) malloc(sizeof(__glXWindow)); if (!pGlxWindow) { return BadAlloc; } @@ -3016,7 +3016,7 @@ int __glXQueryContext(__GLXclientState *cl, GLbyte *pc) reply.n = nProps; nReplyBytes = reply.length << 2; - sendBuf = (int *)xalloc(nReplyBytes); + sendBuf = (int *)malloc(nReplyBytes); pSendBuf = sendBuf; *pSendBuf++ = GLX_FBCONFIG_ID; *pSendBuf++ = (int)(ctx->pFBConfig->id); @@ -3031,7 +3031,7 @@ int __glXQueryContext(__GLXclientState *cl, GLbyte *pc) WriteToClient(client, sz_xGLXQueryContextReply, (char *)&reply); WriteToClient(client, nReplyBytes, (char *)sendBuf); } - xfree((char *)sendBuf); + free((char *)sendBuf); return Success; } @@ -3061,7 +3061,7 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) reply.n = nProps; nReplyBytes = reply.length << 2; - sendBuf = (int *)xalloc(nReplyBytes); + sendBuf = (int *)malloc(nReplyBytes); pSendBuf = sendBuf; *pSendBuf++ = GLX_SHARE_CONTEXT_EXT; *pSendBuf++ = (int)(ctx->share_id); @@ -3078,7 +3078,7 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)&reply); WriteToClient(client, nReplyBytes, (char *)sendBuf); } - xfree((char *)sendBuf); + free((char *)sendBuf); return Success; } @@ -3124,14 +3124,14 @@ int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc) /* ** Create the GLX part of the Pbuffer. */ - pGlxPbuffer = (__glXPbuffer *) xalloc(sizeof(__glXPbuffer)); + pGlxPbuffer = (__glXPbuffer *) malloc(sizeof(__glXPbuffer)); if (!pGlxPbuffer) { return BadAlloc; } - pGlxPbuffer->be_xids = (XID *) xalloc( sizeof(XID) * screenInfo.numScreens ); + pGlxPbuffer->be_xids = (XID *) malloc( sizeof(XID) * screenInfo.numScreens ); if (!pGlxPbuffer->be_xids) { - xfree(pGlxPbuffer); + free(pGlxPbuffer); return BadAlloc; } @@ -3380,7 +3380,7 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) if (reply.numAttribs) { attribs_size = 2 * reply.numAttribs * __GLX_SIZE_CARD32; - attribs = (CARD32 *) Xalloc(attribs_size); + attribs = (CARD32 *) malloc(attribs_size); if (attribs == NULL) { UnlockDisplay(dpy); SyncHandle(); diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c index 6cd8bb41a..4adfbff88 100644 --- a/hw/dmx/glxProxy/glxext.c +++ b/hw/dmx/glxProxy/glxext.c @@ -191,7 +191,7 @@ void __glXFreeGLXWindow(__glXWindow *pGlxWindow) (*pGlxWindow->pScreen->DestroyWindow)(pWindow); } - xfree(pGlxWindow); + free(pGlxWindow); } } @@ -204,8 +204,8 @@ static void WindowGone(__glXWindow *pGlxWindow, XID id) void __glXFreeGLXPbuffer(__glXPbuffer *pGlxPbuffer) { if (!pGlxPbuffer->idExists && !pGlxPbuffer->refcnt) { - xfree(pGlxPbuffer->be_xids); - xfree(pGlxPbuffer); + free(pGlxPbuffer->be_xids); + free(pGlxPbuffer); } } diff --git a/hw/dmx/glxProxy/glxscreens.c b/hw/dmx/glxProxy/glxscreens.c index 39978a74d..7be7ac485 100644 --- a/hw/dmx/glxProxy/glxscreens.c +++ b/hw/dmx/glxProxy/glxscreens.c @@ -135,7 +135,7 @@ static void CalcServerVersionAndExtensions( void ) /* * read extensions strings of all back-end servers */ - be_extensions = (char **)Xalloc( __glXNumActiveScreens * sizeof(char *) ); + be_extensions = (char **)malloc( __glXNumActiveScreens * sizeof(char *) ); if (!be_extensions) return; @@ -158,7 +158,7 @@ static void CalcServerVersionAndExtensions( void ) length = (int)reply.length; numbytes = (int)reply.n; slop = numbytes * __GLX_SIZE_INT8 & 3; - be_extensions[s] = (char *)Xalloc(numbytes); + be_extensions[s] = (char *)malloc(numbytes); if (!be_extensions[s]) { /* Throw data on the floor */ _XEatData(dpy, length); @@ -244,7 +244,7 @@ void __glXScreenInit(GLint numscreens) // find the set of FBConfigs that are present on all back-end // servers - only those configs will be supported */ - __glXFBConfigs = (__GLXFBConfig **)Xalloc( dmxScreen0->numFBConfigs * + __glXFBConfigs = (__GLXFBConfig **)malloc( dmxScreen0->numFBConfigs * (numscreens+1) * sizeof(__GLXFBConfig *) ); __glXNumFBConfigs = 0; @@ -282,7 +282,7 @@ void __glXScreenInit(GLint numscreens) __glXFBConfigs[ __glXNumFBConfigs * (numscreens+1) + 1 ] = &dmxScreen0->fbconfigs[c]; - proxy_cfg = Xalloc( sizeof(__GLXFBConfig) ); + proxy_cfg = malloc( sizeof(__GLXFBConfig) ); memcpy( proxy_cfg, cfg, sizeof(__GLXFBConfig) ); proxy_cfg->id = FakeClientID(0); /* visual will be associated later in __glXGetFBConfigs */ diff --git a/hw/dmx/glxProxy/glxsingle.c b/hw/dmx/glxProxy/glxsingle.c index dcc604052..8c7fdfc0e 100644 --- a/hw/dmx/glxProxy/glxsingle.c +++ b/hw/dmx/glxProxy/glxsingle.c @@ -254,7 +254,7 @@ int __glXForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc ) _XReply(dpy, (xReply*) &be_reply, 0, False); be_buf_size = be_reply.length << 2; if (be_buf_size > 0) { - be_buf = (char *)Xalloc( be_buf_size ); + be_buf = (char *)malloc( be_buf_size ); if (be_buf) { _XRead(dpy, be_buf, be_buf_size); } @@ -349,7 +349,7 @@ int __glXForwardAllWithReply( __GLXclientState *cl, GLbyte *pc ) _XReply(dpy, (xReply*) &be_reply, 0, False); be_buf_size = be_reply.length << 2; if (be_buf_size > 0) { - be_buf = (char *)Xalloc( be_buf_size ); + be_buf = (char *)malloc( be_buf_size ); if (be_buf) { _XRead(dpy, be_buf, be_buf_size); } @@ -801,7 +801,7 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc) buf_size = __glReadPixels_size(format,type,width,height, &ebits, &rowsize); if (buf_size > 0) { - buf = (char *) Xalloc( buf_size ); + buf = (char *) malloc( buf_size ); if ( !buf ) { return( BadAlloc ); } @@ -880,7 +880,7 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc) char *be_buf; int be_buf_size = be_reply.length << 2; - be_buf = (char *) Xalloc( be_buf_size ); + be_buf = (char *) malloc( be_buf_size ); if (be_buf) { _XRead(dpy, be_buf, be_buf_size); diff --git a/hw/dmx/glxProxy/glxswap.c b/hw/dmx/glxProxy/glxswap.c index 1e184f914..6d9b4fc55 100644 --- a/hw/dmx/glxProxy/glxswap.c +++ b/hw/dmx/glxProxy/glxswap.c @@ -183,7 +183,7 @@ static SwapGroupPtr CreateSwapEntry(WindowPtr pWin) SwapGroupPtr pEntry; /* Allocate new swap group */ - pEntry = xalloc(sizeof(*pEntry)); + pEntry = malloc(sizeof(*pEntry)); if (!pEntry) return NULL; /* Initialize swap group */ @@ -223,7 +223,7 @@ static void FreeSwapEntry(SwapGroupPtr pEntry) /* We can free the pEntry entry since it has already been removed * from the swap group list and it won't be needed any longer */ - xfree(pEntry); + free(pEntry); } int JoinSwapGroupSGIX(DrawablePtr pDraw, DrawablePtr pMember) @@ -407,7 +407,7 @@ void SwapBarrierReset(void) pBarrier; pBarrier = pNextBarrier) { pNextBarrier = pBarrier->pNext; - xfree(pBarrier); + free(pBarrier); } SwapBarrierList[i] = NULL; } @@ -422,7 +422,7 @@ static Bool BindSwapGroupToBarrier(GLuint barrier, SwapGroupPtr pSwapGroup) { SwapBarrierPtr pBarrier; - pBarrier = xalloc(sizeof(*pBarrier)); + pBarrier = malloc(sizeof(*pBarrier)); if (!pBarrier) return FALSE; /* Add the swap group to barrier's list */ @@ -448,7 +448,7 @@ static Bool UnbindSwapGroupFromBarrier(GLuint barrier, SwapGroupPtr pSwapGroup) else SwapBarrierList[barrier] = pBarrier->pNext; /* Free memory */ - xfree(pBarrier); + free(pBarrier); return TRUE; } diff --git a/hw/dmx/glxProxy/glxutil.c b/hw/dmx/glxProxy/glxutil.c index d0ce50486..cfd026979 100644 --- a/hw/dmx/glxProxy/glxutil.c +++ b/hw/dmx/glxProxy/glxutil.c @@ -83,7 +83,7 @@ __glXRealloc(void *addr, size_t newSize) if (addr) { if (newSize == 0) { - xfree(addr); + free(addr); return NULL; } else { newAddr = realloc(addr, newSize); diff --git a/hw/dmx/glxProxy/glxvendor.c b/hw/dmx/glxProxy/glxvendor.c index 6b1f9a820..6af53e230 100644 --- a/hw/dmx/glxProxy/glxvendor.c +++ b/hw/dmx/glxProxy/glxvendor.c @@ -242,7 +242,7 @@ int __glXVForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc ) _XReply(dpy, (xReply*) &be_reply, 0, False); be_buf_size = be_reply.length << 2; if (be_buf_size > 0) { - be_buf = (char *)Xalloc( be_buf_size ); + be_buf = (char *)malloc( be_buf_size ); if (be_buf) { _XRead(dpy, be_buf, be_buf_size); } @@ -334,7 +334,7 @@ int __glXVForwardAllWithReply( __GLXclientState *cl, GLbyte *pc ) _XReply(dpy, (xReply*) &be_reply, 0, False); be_buf_size = be_reply.length << 2; if (be_buf_size > 0) { - be_buf = (char *)Xalloc( be_buf_size ); + be_buf = (char *)malloc( be_buf_size ); if (be_buf) { _XRead(dpy, be_buf, be_buf_size); } diff --git a/hw/dmx/glxProxy/glxvisuals.c b/hw/dmx/glxProxy/glxvisuals.c index 898c6be7b..58151b7f2 100644 --- a/hw/dmx/glxProxy/glxvisuals.c +++ b/hw/dmx/glxProxy/glxvisuals.c @@ -532,7 +532,7 @@ Bool glxInitVisuals(int *nvisualp, VisualPtr *visualp, /* Free the private list created by DDX HW driver */ if (visualPrivates) - xfree(visualPrivates); + free(visualPrivates); visualPrivates = NULL; return TRUE; diff --git a/hw/dmx/glxProxy/unpack.h b/hw/dmx/glxProxy/unpack.h index 98fa10ee7..880f9aead 100644 --- a/hw/dmx/glxProxy/unpack.h +++ b/hw/dmx/glxProxy/unpack.h @@ -82,7 +82,7 @@ extern xGLXSingleReply __glXReply; if ((size) > sizeof(answerBuffer)) { \ int bump; \ if ((cl)->returnBufSize < (size)+(align)) { \ - (cl)->returnBuf = (GLbyte*)Xrealloc((cl)->returnBuf, \ + (cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \ (size)+(align)); \ if (!(cl)->returnBuf) { \ return BadAlloc; \ diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c index 5a486a464..9da4aba8b 100644 --- a/hw/dmx/input/dmxinputinit.c +++ b/hw/dmx/input/dmxinputinit.c @@ -672,7 +672,7 @@ static char *dmxMakeUniqueDeviceName(DMXLocalInputInfoPtr dmxLocal) static int o = 0; static unsigned long dmxGeneration = 0; #define LEN 32 - char * buf = xalloc(LEN); + char * buf = malloc(LEN); if (dmxGeneration != serverGeneration) { k = m = o = 0; @@ -776,7 +776,7 @@ static DMXLocalInputInfoPtr dmxLookupLocal(const char *name) DMXLocalInputInfoPtr dmxInputCopyLocal(DMXInputInfo *dmxInput, DMXLocalInputInfoPtr s) { - DMXLocalInputInfoPtr dmxLocal = xalloc(sizeof(*dmxLocal)); + DMXLocalInputInfoPtr dmxLocal = malloc(sizeof(*dmxLocal)); if (!dmxLocal) dmxLog(dmxFatal, "DMXLocalInputInfoPtr: out of memory\n"); @@ -788,7 +788,7 @@ DMXLocalInputInfoPtr dmxInputCopyLocal(DMXInputInfo *dmxInput, dmxLocal->deviceId = -1; ++dmxInput->numDevs; - dmxInput->devs = xrealloc(dmxInput->devs, + dmxInput->devs = realloc(dmxInput->devs, dmxInput->numDevs * sizeof(*dmxInput->devs)); dmxInput->devs[dmxInput->numDevs-1] = dmxLocal; @@ -1085,13 +1085,13 @@ static void dmxInputFreeLocal(DMXLocalInputInfoRec *local) if (local->isCore && local->type == DMX_LOCAL_KEYBOARD) dmxLocalCoreKeyboard = NULL; if (local->destroy_private) local->destroy_private(local->private); - if (local->history) xfree(local->history); - if (local->valuators) xfree(local->valuators); - if (local->deviceName) xfree(local->deviceName); + if (local->history) free(local->history); + if (local->valuators) free(local->valuators); + if (local->deviceName) free(local->deviceName); local->private = NULL; local->history = NULL; local->deviceName = NULL; - xfree(local); + free(local); } /** Free all of the memory associated with \a dmxInput */ @@ -1101,18 +1101,18 @@ void dmxInputFree(DMXInputInfo *dmxInput) if (!dmxInput) return; - if (dmxInput->keycodes) xfree(dmxInput->keycodes); - if (dmxInput->symbols) xfree(dmxInput->symbols); - if (dmxInput->geometry) xfree(dmxInput->geometry); + if (dmxInput->keycodes) free(dmxInput->keycodes); + if (dmxInput->symbols) free(dmxInput->symbols); + if (dmxInput->geometry) free(dmxInput->geometry); for (i = 0; i < dmxInput->numDevs; i++) { dmxInputFreeLocal(dmxInput->devs[i]); dmxInput->devs[i] = NULL; } - xfree(dmxInput->devs); + free(dmxInput->devs); dmxInput->devs = NULL; dmxInput->numDevs = 0; - if (dmxInput->freename) xfree(dmxInput->name); + if (dmxInput->freename) free(dmxInput->name); dmxInput->name = NULL; } diff --git a/hw/dmx/input/dmxmotion.c b/hw/dmx/input/dmxmotion.c index 73580a215..a86b62e5c 100644 --- a/hw/dmx/input/dmxmotion.c +++ b/hw/dmx/input/dmxmotion.c @@ -108,7 +108,7 @@ void dmxPointerPutMotionEvent(DeviceIntPtr pDevice, int i; if (!dmxLocal->history) { - dmxLocal->history = xalloc(sizeof(*dmxLocal->history) + dmxLocal->history = malloc(sizeof(*dmxLocal->history) * (numAxes + 1) * DMX_MOTION_SIZE); dmxLocal->head = 0; diff --git a/hw/dmx/input/lnx-keyboard.c b/hw/dmx/input/lnx-keyboard.c index 939a32f07..050c80ebf 100644 --- a/hw/dmx/input/lnx-keyboard.c +++ b/hw/dmx/input/lnx-keyboard.c @@ -938,7 +938,7 @@ static void kbdLinuxGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap) int i; #if 00/*BP*/ - mapCopy = xalloc(sizeof(map)); + mapCopy = malloc(sizeof(map)); memcpy(mapCopy, map, sizeof(map)); #else ErrorF("kbdLinuxGetMap() is broken/no-op'd\n"); diff --git a/hw/dmx/input/usb-keyboard.c b/hw/dmx/input/usb-keyboard.c index c4667a3c3..dc575fef7 100644 --- a/hw/dmx/input/usb-keyboard.c +++ b/hw/dmx/input/usb-keyboard.c @@ -398,7 +398,7 @@ static void kbdUSBGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap) KeySym *k, *mapCopy; int i; - mapCopy = xalloc(sizeof(map)); + mapCopy = malloc(sizeof(map)); memcpy(mapCopy, map, sizeof(map)); /* compute the modifier map */ diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index b21559bba..b96851605 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -73,13 +73,13 @@ ephyrCardInit (KdCardInfo *card) { EphyrPriv *priv; - priv = (EphyrPriv *) xalloc (sizeof (EphyrPriv)); + priv = (EphyrPriv *) malloc(sizeof (EphyrPriv)); if (!priv) return FALSE; if (!ephyrInitialize (card, priv)) { - xfree (priv); + free(priv); return FALSE; } card->driver = priv; @@ -185,7 +185,7 @@ ephyrScreenInit (KdScreenInfo *screen) { EphyrScrPriv *scrpriv; - scrpriv = xcalloc (1, sizeof (EphyrScrPriv)); + scrpriv = calloc(1, sizeof (EphyrScrPriv)); if (!scrpriv) return FALSE; @@ -195,7 +195,7 @@ ephyrScreenInit (KdScreenInfo *screen) if (!ephyrScreenInitialize (screen, scrpriv)) { screen->driver = 0; - xfree (scrpriv); + free(scrpriv); return FALSE; } @@ -737,7 +737,7 @@ ephyrScreenFini (KdScreenInfo *screen) if (scrpriv->shadow) { KdShadowFbFree (screen); } - xfree(screen->driver); + free(screen->driver); screen->driver = NULL; } @@ -1023,7 +1023,7 @@ void ephyrCardFini (KdCardInfo *card) { EphyrPriv *priv = card->driver; - xfree (priv); + free(priv); } void @@ -1075,11 +1075,11 @@ static Status MouseInit (KdPointerInfo *pi) { pi->driverPrivate = (EphyrPointerPrivate *) - xcalloc(sizeof(EphyrPointerPrivate), 1); + calloc(sizeof(EphyrPointerPrivate), 1); ((EphyrPointerPrivate *)pi->driverPrivate)->enabled = FALSE; pi->nAxes = 3; pi->nButtons = 32; - xfree(pi->name); + free(pi->name); pi->name = strdup("Xephyr virtual mouse"); ephyrMouse = pi; return Success; @@ -1121,7 +1121,7 @@ static Status EphyrKeyboardInit (KdKeyboardInfo *ki) { ki->driverPrivate = (EphyrKbdPrivate *) - xcalloc(sizeof(EphyrKbdPrivate), 1); + calloc(sizeof(EphyrKbdPrivate), 1); hostx_load_keymap(); if (!ephyrKeySyms.map) { ErrorF("Couldn't load keymap from host\n"); @@ -1129,7 +1129,7 @@ EphyrKeyboardInit (KdKeyboardInfo *ki) } ki->minScanCode = ephyrKeySyms.minKeyCode; ki->maxScanCode = ephyrKeySyms.maxKeyCode; - xfree(ki->name); + free(ki->name); ki->name = strdup("Xephyr virtual keyboard"); ephyrKbd = ki; return Success; diff --git a/hw/kdrive/ephyr/ephyr_draw.c b/hw/kdrive/ephyr/ephyr_draw.c index f9fac8007..f25a9b43b 100644 --- a/hw/kdrive/ephyr/ephyr_draw.c +++ b/hw/kdrive/ephyr/ephyr_draw.c @@ -432,13 +432,13 @@ ephyrDrawInit(ScreenPtr pScreen) EphyrFakexaPriv *fakexa; Bool success; - fakexa = xcalloc(1, sizeof(*fakexa)); + fakexa = calloc(1, sizeof(*fakexa)); if (fakexa == NULL) return FALSE; fakexa->exa = exaDriverAlloc(); if (fakexa->exa == NULL) { - xfree(fakexa); + free(fakexa); return FALSE; } @@ -487,8 +487,8 @@ ephyrDrawInit(ScreenPtr pScreen) scrpriv->fakexa = fakexa; } else { ErrorF("Failed to initialize EXA\n"); - xfree(fakexa->exa); - xfree(fakexa); + free(fakexa->exa); + free(fakexa); } return success; diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c index 5f5fd3bff..07733381f 100644 --- a/hw/kdrive/ephyr/ephyrdriext.c +++ b/hw/kdrive/ephyr/ephyrdriext.c @@ -160,7 +160,7 @@ ephyrDRIExtensionInit (ScreenPtr a_screen) EPHYR_LOG_ERROR ("failed to register DRI extension\n") ; goto out ; } - screen_priv = xcalloc (1, sizeof (EphyrDRIScreenPrivRec)) ; + screen_priv = calloc(1, sizeof (EphyrDRIScreenPrivRec)) ; if (!screen_priv) { EPHYR_LOG_ERROR ("failed to allocate screen_priv\n") ; goto out ; @@ -258,7 +258,7 @@ ephyrDRIDestroyWindow (WindowPtr a_win) EphyrDRIWindowPrivPtr win_priv=GET_EPHYR_DRI_WINDOW_PRIV (a_win) ; if (win_priv) { destroyHostPeerWindow (a_win) ; - xfree (win_priv) ; + free(win_priv) ; dixSetPrivate(&a_win->devPrivates, ephyrDRIWindowKey, NULL); EPHYR_LOG ("destroyed the remote peer window\n") ; } @@ -418,7 +418,7 @@ ephyrDRIClipNotify (WindowPtr a_win, EPHYR_LOG_ERROR ("failed to get window pair\n") ; goto out ; } - rects = xcalloc (REGION_NUM_RECTS (&a_win->clipList), + rects = calloc(REGION_NUM_RECTS (&a_win->clipList), sizeof (EphyrRect)) ; for (i=0; i < REGION_NUM_RECTS (&a_win->clipList); i++) { memmove (&rects[i], @@ -440,7 +440,7 @@ ephyrDRIClipNotify (WindowPtr a_win, is_ok = TRUE ; out: - xfree (rects) ; + free(rects) ; rects = NULL ; EPHYR_LOG ("leave. is_ok:%d\n", is_ok) ; @@ -511,7 +511,7 @@ EphyrDuplicateVisual (unsigned int a_screen, /* * be prepare to extend screen->visuals to add new_visual to it */ - new_visuals = xcalloc (screen->numVisuals+1, sizeof (VisualRec)) ; + new_visuals = calloc(screen->numVisuals+1, sizeof (VisualRec)) ; memmove (new_visuals, screen->visuals, screen->numVisuals*sizeof (VisualRec)) ; @@ -535,7 +535,7 @@ EphyrDuplicateVisual (unsigned int a_screen, * extend the list of visual IDs in that entry, * so to add a_new_id in there. */ - vids = xrealloc (cur_depth->vids, + vids = realloc(cur_depth->vids, (cur_depth->numVids+1)*sizeof (VisualID)); if (!vids) { EPHYR_LOG_ERROR ("failed to realloc numids\n") ; @@ -558,14 +558,14 @@ EphyrDuplicateVisual (unsigned int a_screen, /* * Commit our change to screen->visuals */ - xfree (screen->visuals) ; + free(screen->visuals) ; screen->visuals = new_visuals ; screen->numVisuals++ ; new_visuals = NULL ; is_ok = TRUE ; out: - xfree (new_visuals) ; + free(new_visuals) ; new_visuals = NULL ; EPHYR_LOG ("leave\n") ; @@ -1067,7 +1067,7 @@ ProcXF86DRICreateDrawable (ClientPtr client) win_priv = GET_EPHYR_DRI_WINDOW_PRIV (window) ; if (!win_priv) { - win_priv = xcalloc (1, sizeof (EphyrDRIWindowPrivRec)) ; + win_priv = calloc(1, sizeof (EphyrDRIWindowPrivRec)) ; if (!win_priv) { EPHYR_LOG_ERROR ("failed to allocate window private\n") ; return BadAlloc ; @@ -1252,7 +1252,7 @@ ProcXF86DRIGetDrawableInfo (register ClientPtr client) sizeof(drm_clip_rect_t) * rep.numBackClipRects, (char *)backClipRects); } - xfree(clipRects); + free(clipRects); clipRects = NULL ; EPHYR_LOG ("leave\n") ; diff --git a/hw/kdrive/ephyr/ephyrglxext.c b/hw/kdrive/ephyr/ephyrglxext.c index a0278cc2b..dfc43e1d1 100644 --- a/hw/kdrive/ephyr/ephyrglxext.c +++ b/hw/kdrive/ephyr/ephyrglxext.c @@ -243,7 +243,7 @@ ephyrGLXGetVisualConfigsReal (__GLXclientState *a_cl, out: EPHYR_LOG ("leave\n") ; - xfree (props_buf) ; + free(props_buf) ; props_buf = NULL ; return res ; @@ -300,7 +300,7 @@ ephyrGLXGetFBConfigsSGIXReal (__GLXclientState *a_cl, out: EPHYR_LOG ("leave\n") ; - xfree (props_buf) ; + free(props_buf) ; props_buf = NULL ; return res ; @@ -375,7 +375,7 @@ ephyrGLXQueryServerString(__GLXclientState *a_cl, GLbyte *a_pc) reply.sequenceNumber = client->sequence ; reply.length = __GLX_PAD (length) >> 2 ; reply.n = length ; - buf = xcalloc (reply.length << 2, 1); + buf = calloc(reply.length << 2, 1); if (!buf) { EPHYR_LOG_ERROR ("failed to allocate string\n;"); return BadAlloc; @@ -389,10 +389,10 @@ ephyrGLXQueryServerString(__GLXclientState *a_cl, GLbyte *a_pc) out: EPHYR_LOG ("leave\n") ; - xfree (server_string) ; + free(server_string) ; server_string = NULL; - xfree (buf); + free(buf); buf = NULL; return res ; diff --git a/hw/kdrive/ephyr/ephyrhostvideo.c b/hw/kdrive/ephyr/ephyrhostvideo.c index f4a1b9d17..53cd12ec0 100644 --- a/hw/kdrive/ephyr/ephyrhostvideo.c +++ b/hw/kdrive/ephyr/ephyrhostvideo.c @@ -485,10 +485,10 @@ ephyrHostEncodingsDelete (EphyrHostEncoding *a_encodings, if (!a_encodings) return ; for (i=0; i < a_num_encodings; i++) { - xfree (a_encodings[i].name) ; + free(a_encodings[i].name) ; a_encodings[i].name = NULL ; } - xfree (a_encodings) ; + free(a_encodings) ; } void diff --git a/hw/kdrive/ephyr/ephyrvideo.c b/hw/kdrive/ephyr/ephyrvideo.c index 6624ab98a..65127ceb9 100644 --- a/hw/kdrive/ephyr/ephyrvideo.c +++ b/hw/kdrive/ephyr/ephyrvideo.c @@ -332,7 +332,7 @@ ephyrXVPrivNew (void) EPHYR_LOG ("enter\n") ; - xv_priv = xcalloc (1, sizeof (EphyrXVPriv)) ; + xv_priv = calloc(1, sizeof (EphyrXVPriv)) ; if (!xv_priv) { EPHYR_LOG_ERROR ("failed to create EphyrXVPriv\n") ; goto error ; @@ -371,9 +371,9 @@ ephyrXVPrivDelete (EphyrXVPriv *a_this) ephyrHostXVAdaptorArrayDelete (a_this->host_adaptors) ; a_this->host_adaptors = NULL ; } - xfree (a_this->adaptors) ; + free(a_this->adaptors) ; a_this->adaptors = NULL ; - xfree (a_this) ; + free(a_this) ; EPHYR_LOG ("leave\n") ; } @@ -386,7 +386,7 @@ videoEncodingDup (EphyrHostEncoding *a_encodings, EPHYR_RETURN_VAL_IF_FAIL (a_encodings && a_num_encodings, NULL) ; - result = xcalloc (a_num_encodings, sizeof (KdVideoEncodingRec)) ; + result = calloc(a_num_encodings, sizeof (KdVideoEncodingRec)) ; for (i=0 ; i < a_num_encodings; i++) { result[i].id = a_encodings[i].id ; result[i].name = strdup (a_encodings[i].name) ; @@ -407,7 +407,7 @@ portAttributesDup (EphyrHostAttribute *a_encodings, EPHYR_RETURN_VAL_IF_FAIL (a_encodings && a_num_encodings, NULL) ; - result = xcalloc (a_num_encodings, sizeof (KdAttributeRec)) ; + result = calloc(a_num_encodings, sizeof (KdAttributeRec)) ; if (!result) { EPHYR_LOG_ERROR ("failed to allocate attributes\n") ; return NULL ; @@ -455,7 +455,7 @@ ephyrXVPrivQueryHostAdaptors (EphyrXVPriv *a_this) * copy what we can from adaptors into a_this->adaptors */ if (a_this->num_adaptors) { - a_this->adaptors = xcalloc (a_this->num_adaptors, + a_this->adaptors = calloc(a_this->num_adaptors, sizeof (KdVideoAdaptorRec)) ; if (!a_this->adaptors) { EPHYR_LOG_ERROR ("failed to create internal adaptors\n") ; @@ -513,7 +513,7 @@ ephyrXVPrivQueryHostAdaptors (EphyrXVPriv *a_this) ephyrHostXVAdaptorGetNbPorts (cur_host_adaptor) ; */ a_this->adaptors[i].pPortPrivates = - xcalloc (a_this->adaptors[i].nPorts, + calloc(a_this->adaptors[i].nPorts, sizeof (DevUnion) + sizeof (EphyrPortPriv)) ; port_priv_offset = a_this->adaptors[i].nPorts; for (j=0; j < a_this->adaptors[i].nPorts; j++) { @@ -656,7 +656,7 @@ ephyrXVPrivRegisterAdaptors (EphyrXVPriv *a_this, KdXVListGenericAdaptors (screen, ®istered_adaptors); num_adaptors = num_registered_adaptors + a_this->num_adaptors ; - adaptors = xcalloc (num_adaptors, sizeof (KdVideoAdaptorPtr)) ; + adaptors = calloc(num_adaptors, sizeof (KdVideoAdaptorPtr)) ; if (!adaptors) { EPHYR_LOG_ERROR ("failed to allocate adaptors tab\n") ; goto out ; @@ -673,9 +673,9 @@ ephyrXVPrivRegisterAdaptors (EphyrXVPriv *a_this, is_ok = TRUE ; out: - xfree (registered_adaptors) ; + free(registered_adaptors) ; registered_adaptors = NULL ; - xfree (adaptors) ; + free(adaptors) ; adaptors = NULL ; EPHYR_LOG ("leave\n") ; diff --git a/hw/kdrive/fake/fake.c b/hw/kdrive/fake/fake.c index 809e309a6..1cf0f2e21 100644 --- a/hw/kdrive/fake/fake.c +++ b/hw/kdrive/fake/fake.c @@ -40,13 +40,13 @@ fakeCardInit (KdCardInfo *card) { FakePriv *priv; - priv = (FakePriv *) xalloc (sizeof (FakePriv)); + priv = (FakePriv *) malloc(sizeof (FakePriv)); if (!priv) return FALSE; if (!fakeInitialize (card, priv)) { - xfree (priv); + free(priv); return FALSE; } card->driver = priv; @@ -121,14 +121,14 @@ fakeScreenInit (KdScreenInfo *screen) { FakeScrPriv *scrpriv; - scrpriv = xcalloc (1, sizeof (FakeScrPriv)); + scrpriv = calloc(1, sizeof (FakeScrPriv)); if (!scrpriv) return FALSE; screen->driver = scrpriv; if (!fakeScreenInitialize (screen, scrpriv)) { screen->driver = 0; - xfree (scrpriv); + free(scrpriv); return FALSE; } return TRUE; @@ -455,7 +455,7 @@ fakeCardFini (KdCardInfo *card) FakePriv *priv = card->driver; free (priv->base); - xfree (priv); + free(priv); } void diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c index d4604ad29..2c7fa91ad 100644 --- a/hw/kdrive/fbdev/fbdev.c +++ b/hw/kdrive/fbdev/fbdev.c @@ -84,13 +84,13 @@ fbdevCardInit (KdCardInfo *card) { FbdevPriv *priv; - priv = (FbdevPriv *) xalloc (sizeof (FbdevPriv)); + priv = (FbdevPriv *) malloc(sizeof (FbdevPriv)); if (!priv) return FALSE; if (!fbdevInitialize (card, priv)) { - xfree (priv); + free(priv); return FALSE; } card->driver = priv; @@ -296,14 +296,14 @@ fbdevScreenInit (KdScreenInfo *screen) { FbdevScrPriv *scrpriv; - scrpriv = xcalloc (1, sizeof (FbdevScrPriv)); + scrpriv = calloc(1, sizeof (FbdevScrPriv)); if (!scrpriv) return FALSE; screen->driver = scrpriv; if (!fbdevScreenInitialize (screen, scrpriv)) { screen->driver = 0; - xfree (scrpriv); + free(scrpriv); return FALSE; } return TRUE; @@ -594,7 +594,7 @@ fbdevCreateColormap (ColormapPtr pmap) case FB_VISUAL_STATIC_PSEUDOCOLOR: pVisual = pmap->pVisual; nent = pVisual->ColormapEntries; - pdefs = xalloc (nent * sizeof (xColorItem)); + pdefs = malloc(nent * sizeof (xColorItem)); if (!pdefs) return FALSE; for (i = 0; i < nent; i++) @@ -606,7 +606,7 @@ fbdevCreateColormap (ColormapPtr pmap) pmap->red[i].co.local.green = pdefs[i].green; pmap->red[i].co.local.blue = pdefs[i].blue; } - xfree (pdefs); + free(pdefs); return TRUE; default: return fbInitializeColormap (pmap); @@ -749,7 +749,7 @@ fbdevCardFini (KdCardInfo *card) munmap (priv->fb_base, priv->fix.smem_len); close (priv->fd); - xfree (priv); + free(priv); } /* diff --git a/hw/kdrive/linux/evdev.c b/hw/kdrive/linux/evdev.c index 0e4c9f735..3797f0926 100644 --- a/hw/kdrive/linux/evdev.c +++ b/hw/kdrive/linux/evdev.c @@ -252,7 +252,7 @@ EvdevPtrEnable (KdPointerInfo *pi) close (fd); return BadMatch; } - ke = xcalloc (1, sizeof (Kevdev)); + ke = calloc(1, sizeof (Kevdev)); if (!ke) { close (fd); @@ -264,7 +264,7 @@ EvdevPtrEnable (KdPointerInfo *pi) ke->keybits) < 0) { perror ("EVIOCGBIT EV_KEY"); - xfree (ke); + free(ke); close (fd); return BadMatch; } @@ -275,7 +275,7 @@ EvdevPtrEnable (KdPointerInfo *pi) ke->relbits) < 0) { perror ("EVIOCGBIT EV_REL"); - xfree (ke); + free(ke); close (fd); return BadMatch; } @@ -291,7 +291,7 @@ EvdevPtrEnable (KdPointerInfo *pi) ke->absbits) < 0) { perror ("EVIOCGBIT EV_ABS"); - xfree (ke); + free(ke); close (fd); return BadMatch; } @@ -310,13 +310,13 @@ EvdevPtrEnable (KdPointerInfo *pi) } if (i <= ke->max_abs) { - xfree (ke); + free(ke); close (fd); return BadValue; } } if (!KdRegisterFd (fd, EvdevPtrRead, pi)) { - xfree (ke); + free(ke); close (fd); return BadAlloc; } @@ -341,7 +341,7 @@ EvdevPtrDisable (KdPointerInfo *pi) if (ioctl (ke->fd, EVIOCGRAB, 0) < 0) perror ("Ungrabbing evdev mouse device failed"); - xfree (ke); + free(ke); pi->driverPrivate = 0; } @@ -440,14 +440,14 @@ EvdevKbdEnable (KdKeyboardInfo *ki) return BadMatch; } - ke = xcalloc (1, sizeof (Kevdev)); + ke = calloc(1, sizeof (Kevdev)); if (!ke) { close (fd); return BadAlloc; } if (!KdRegisterFd (fd, EvdevKbdRead, ki)) { - xfree (ke); + free(ke); close (fd); return BadAlloc; } @@ -509,7 +509,7 @@ EvdevKbdDisable (KdKeyboardInfo *ki) if (ioctl (ke->fd, EVIOCGRAB, 0) < 0) perror ("Ungrabbing evdev keyboard device failed"); - xfree (ke); + free(ke); ki->driverPrivate = 0; } diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c index 6eed7aed3..e05c5abad 100644 --- a/hw/kdrive/linux/keyboard.c +++ b/hw/kdrive/linux/keyboard.c @@ -737,9 +737,9 @@ LinuxKeyboardInit (KdKeyboardInfo *ki) if (!ki) return !Success; - xfree(ki->path); + free(ki->path); ki->path = strdup("console"); - xfree(ki->name); + free(ki->name); ki->name = strdup("Linux console keyboard"); readKernelMapping (ki); diff --git a/hw/kdrive/linux/mouse.c b/hw/kdrive/linux/mouse.c index 007263e4b..1db534863 100644 --- a/hw/kdrive/linux/mouse.c +++ b/hw/kdrive/linux/mouse.c @@ -958,7 +958,7 @@ MouseInit (KdPointerInfo *pi) close(fd); - km = (Kmouse *) xalloc (sizeof (Kmouse)); + km = (Kmouse *) malloc(sizeof (Kmouse)); if (km) { km->iob.avail = km->iob.used = 0; MouseFirstProtocol(km, pi->protocol ? pi->protocol : "exps/2"); @@ -1016,7 +1016,7 @@ MouseDisable (KdPointerInfo *pi) static void MouseFini (KdPointerInfo *pi) { - xfree (pi->driverPrivate); + free(pi->driverPrivate); pi->driverPrivate = NULL; } diff --git a/hw/kdrive/linux/tslib.c b/hw/kdrive/linux/tslib.c index 322ccc7d5..48a084220 100644 --- a/hw/kdrive/linux/tslib.c +++ b/hw/kdrive/linux/tslib.c @@ -157,7 +157,7 @@ TslibInit (KdPointerInfo *pi) return !Success; pi->driverPrivate = (struct TslibPrivate *) - xcalloc(sizeof(struct TslibPrivate), 1); + calloc(sizeof(struct TslibPrivate), 1); if (!pi->driverPrivate) return !Success; @@ -175,7 +175,7 @@ TslibInit (KdPointerInfo *pi) static void TslibFini (KdPointerInfo *pi) { - xfree(pi->driverPrivate); + free(pi->driverPrivate); pi->driverPrivate = NULL; } diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index 765bd0ea7..9d1b38376 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -207,7 +207,7 @@ KdDoSwitchCmd (char *reason) { if (kdSwitchCmd) { - char *command = xalloc (strlen (kdSwitchCmd) + + char *command = malloc(strlen (kdSwitchCmd) + 1 + strlen (reason) + 1); @@ -217,7 +217,7 @@ KdDoSwitchCmd (char *reason) strcat (command, " "); strcat (command, reason); system (command); - xfree (command); + free(command); } } @@ -699,7 +699,7 @@ KdAllocatePrivates (ScreenPtr pScreen) if (kdGeneration != serverGeneration) kdGeneration = serverGeneration; - pScreenPriv = xcalloc(1, sizeof (*pScreenPriv)); + pScreenPriv = calloc(1, sizeof (*pScreenPriv)); if (!pScreenPriv) return FALSE; KdSetScreenPriv (pScreen, pScreenPriv); @@ -788,7 +788,7 @@ KdCloseScreen (int index, ScreenPtr pScreen) pScreenPriv->screen->pScreen = 0; - xfree ((pointer) pScreenPriv); + free((pointer) pScreenPriv); return ret; } diff --git a/hw/kdrive/src/kinfo.c b/hw/kdrive/src/kinfo.c index 0825ee24f..8193215ba 100644 --- a/hw/kdrive/src/kinfo.c +++ b/hw/kdrive/src/kinfo.c @@ -33,7 +33,7 @@ KdCardInfoAdd (KdCardFuncs *funcs, { KdCardInfo *ci, **prev; - ci = xcalloc (1, sizeof (KdCardInfo)); + ci = calloc(1, sizeof (KdCardInfo)); if (!ci) return 0; for (prev = &kdCardInfo; *prev; prev = &(*prev)->next); @@ -66,7 +66,7 @@ KdCardInfoDispose (KdCardInfo *ci) if (*prev == ci) { *prev = ci->next; - xfree (ci); + free(ci); break; } } @@ -77,7 +77,7 @@ KdScreenInfoAdd (KdCardInfo *ci) KdScreenInfo *si, **prev; int n; - si = xcalloc (1, sizeof (KdScreenInfo)); + si = calloc(1, sizeof (KdScreenInfo)); if (!si) return 0; for (prev = &ci->screenList, n = 0; *prev; prev = &(*prev)->next, n++); @@ -98,7 +98,7 @@ KdScreenInfoDispose (KdScreenInfo *si) if (*prev == si) { *prev = si->next; - xfree (si); + free(si); if (!ci->screenList) KdCardInfoDispose (ci); break; @@ -112,7 +112,7 @@ KdNewPointer (void) KdPointerInfo *pi; int i; - pi = (KdPointerInfo *)xcalloc(1, sizeof(KdPointerInfo)); + pi = (KdPointerInfo *)calloc(1, sizeof(KdPointerInfo)); if (!pi) return NULL; @@ -136,28 +136,28 @@ KdFreePointer(KdPointerInfo *pi) { InputOption *option, *prev = NULL; - xfree(pi->name); - xfree(pi->path); + free(pi->name); + free(pi->path); for (option = pi->options; option; option = option->next) { - xfree(prev); - xfree(option->key); - xfree(option->value); + free(prev); + free(option->key); + free(option->value); prev = option; } - xfree(prev); - xfree(pi); + free(prev); + free(pi); } void KdFreeKeyboard(KdKeyboardInfo *ki) { - xfree(ki->name); - xfree(ki->path); - xfree(ki->xkbRules); - xfree(ki->xkbModel); - xfree(ki->xkbLayout); + free(ki->name); + free(ki->path); + free(ki->xkbRules); + free(ki->xkbModel); + free(ki->xkbLayout); ki->next = NULL; - xfree(ki); + free(ki); } diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index a88f2dc61..402475884 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -420,7 +420,7 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff) "(unnamed)"); return !Success; } - xfree(pi->driverPrivate); + free(pi->driverPrivate); pi->driverPrivate = NULL; } @@ -433,12 +433,12 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff) return !Success; } - btn_labels = xcalloc(pi->nButtons, sizeof(Atom)); + btn_labels = calloc(pi->nButtons, sizeof(Atom)); if (!btn_labels) return BadAlloc; - axes_labels = xcalloc(pi->nAxes, sizeof(Atom)); + axes_labels = calloc(pi->nAxes, sizeof(Atom)); if (!axes_labels) { - xfree(btn_labels); + free(btn_labels); return BadAlloc; } @@ -472,8 +472,8 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff) (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), pi->nAxes, axes_labels); - xfree(btn_labels); - xfree(axes_labels); + free(btn_labels); + free(axes_labels); if (pi->inputClass == KD_TOUCHSCREEN) { InitAbsoluteClassDeviceStruct(pDevice); @@ -736,7 +736,7 @@ KdKeyboardProc(DeviceIntPtr pDevice, int onoff) "(unnamed)"); return !Success; } - xfree(ki->driverPrivate); + free(ki->driverPrivate); ki->driverPrivate = NULL; } @@ -887,7 +887,7 @@ KdRemoveKeyboardDriver (KdKeyboardDriver *driver) KdKeyboardInfo * KdNewKeyboard (void) { - KdKeyboardInfo *ki = xcalloc(sizeof(KdKeyboardInfo), 1); + KdKeyboardInfo *ki = calloc(sizeof(KdKeyboardInfo), 1); if (!ki) return NULL; @@ -915,7 +915,7 @@ KdAddConfigKeyboard (char *keyboard) if (!keyboard) return Success; - new = (struct KdConfigDevice *) xcalloc(sizeof(struct KdConfigDevice), 1); + new = (struct KdConfigDevice *) calloc(sizeof(struct KdConfigDevice), 1); if (!new) return BadAlloc; @@ -983,7 +983,7 @@ KdAddConfigPointer (char *pointer) if (!pointer) return Success; - new = (struct KdConfigDevice *) xcalloc(sizeof(struct KdConfigDevice), 1); + new = (struct KdConfigDevice *) calloc(sizeof(struct KdConfigDevice), 1); if (!new) return BadAlloc; @@ -1053,7 +1053,7 @@ KdGetOptions (InputOption **options, char *string) InputOption *newopt = NULL, **tmpo = NULL; int tam_key = 0; - newopt = xcalloc(1, sizeof (InputOption)); + newopt = calloc(1, sizeof (InputOption)); if (!newopt) return FALSE; @@ -1064,7 +1064,7 @@ KdGetOptions (InputOption **options, char *string) if (strchr(string, '=')) { tam_key = (strchr(string, '=') - string); - newopt->key = (char *)xalloc(tam_key); + newopt->key = (char *)malloc(tam_key); strncpy(newopt->key, string, tam_key); newopt->key[tam_key] = '\0'; newopt->value = xstrdup(strchr(string, '=') + 1); diff --git a/hw/kdrive/src/kshadow.c b/hw/kdrive/src/kshadow.c index cf3391dba..6f5a2f346 100644 --- a/hw/kdrive/src/kshadow.c +++ b/hw/kdrive/src/kshadow.c @@ -36,11 +36,11 @@ KdShadowFbAlloc (KdScreenInfo *screen, Bool rotate) /* use fb computation for width */ paddedWidth = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof (FbBits); - buf = xalloc (paddedWidth * height); + buf = malloc(paddedWidth * height); if (!buf) return FALSE; if (screen->fb.shadow) - xfree (screen->fb.frameBuffer); + free(screen->fb.frameBuffer); screen->fb.shadow = TRUE; screen->fb.frameBuffer = buf; screen->fb.byteStride = paddedWidth; @@ -53,7 +53,7 @@ KdShadowFbFree (KdScreenInfo *screen) { if (screen->fb.shadow) { - xfree (screen->fb.frameBuffer); + free(screen->fb.frameBuffer); screen->fb.frameBuffer = 0; screen->fb.shadow = FALSE; } diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c index 27ecc5d6c..56f101f65 100644 --- a/hw/kdrive/src/kxv.c +++ b/hw/kdrive/src/kxv.c @@ -134,7 +134,7 @@ KdXVRegisterGenericAdaptorDriver( /* fprintf(stderr,"KdXVRegisterGenericAdaptorDriver\n"); */ - newdrivers = xrealloc(GenDrivers, sizeof(KdXVInitGenericAdaptorPtr) * + newdrivers = realloc(GenDrivers, sizeof(KdXVInitGenericAdaptorPtr) * (1 + NumGenDrivers)); if (!newdrivers) return 0; @@ -159,7 +159,7 @@ KdXVListGenericAdaptors( n = GenDrivers[i](screen,&DrivAdap); if (0 == n) continue; - new = xrealloc(*adaptors, sizeof(KdVideoAdaptorPtr) * (num+n)); + new = realloc(*adaptors, sizeof(KdVideoAdaptorPtr) * (num+n)); if (NULL == new) continue; *adaptors = new; @@ -172,13 +172,13 @@ KdXVListGenericAdaptors( KdVideoAdaptorPtr KdXVAllocateVideoAdaptorRec(KdScreenInfo * screen) { - return xcalloc(1, sizeof(KdVideoAdaptorRec)); + return calloc(1, sizeof(KdVideoAdaptorRec)); } void KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr) { - xfree(ptr); + free(ptr); } @@ -218,7 +218,7 @@ KdXVScreenInit( a CloseScreen hook so that we don't have to wrap it. I'm not sure that I appreciate that. */ - ScreenPriv = xalloc(sizeof(KdXVScreenRec)); + ScreenPriv = malloc(sizeof(KdXVScreenRec)); pxvs->devPriv.ptr = (pointer)ScreenPriv; if(!ScreenPriv) return FALSE; @@ -247,18 +247,18 @@ KdXVFreeAdaptor(XvAdaptorPtr pAdaptor) { int i; - xfree(pAdaptor->name); + free(pAdaptor->name); if(pAdaptor->pEncodings) { XvEncodingPtr pEncode = pAdaptor->pEncodings; for(i = 0; i < pAdaptor->nEncodings; i++, pEncode++) { - xfree(pEncode->name); + free(pEncode->name); } - xfree(pAdaptor->pEncodings); + free(pAdaptor->pEncodings); } - xfree(pAdaptor->pFormats); + free(pAdaptor->pFormats); if(pAdaptor->pPorts) { XvPortPtr pPort = pAdaptor->pPorts; @@ -271,25 +271,25 @@ KdXVFreeAdaptor(XvAdaptorPtr pAdaptor) REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip); if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip); - xfree(pPriv); + free(pPriv); } } - xfree(pAdaptor->pPorts); + free(pAdaptor->pPorts); } if(pAdaptor->nAttributes) { XvAttributePtr pAttribute = pAdaptor->pAttributes; for(i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) { - xfree(pAttribute->name); + free(pAttribute->name); } - xfree(pAdaptor->pAttributes); + free(pAdaptor->pAttributes); } - xfree(pAdaptor->pImages); + free(pAdaptor->pImages); - xfree(pAdaptor->devPriv.ptr); + free(pAdaptor->devPriv.ptr); } static Bool @@ -325,7 +325,7 @@ KdXVInitAdaptors( pxvs->nAdaptors = 0; pxvs->pAdaptors = NULL; - if(!(pAdaptor = xcalloc(number, sizeof(XvAdaptorRec)))) + if(!(pAdaptor = calloc(number, sizeof(XvAdaptorRec)))) return FALSE; for(pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) { @@ -375,18 +375,18 @@ KdXVInitAdaptors( pa->ddGetPortAttribute = KdXVGetPortAttribute; pa->ddQueryBestSize = KdXVQueryBestSize; pa->ddQueryImageAttributes = KdXVQueryImageAttributes; - if((pa->name = xalloc(strlen(adaptorPtr->name) + 1))) + if((pa->name = malloc(strlen(adaptorPtr->name) + 1))) strcpy(pa->name, adaptorPtr->name); if(adaptorPtr->nEncodings && - (pEncode = xcalloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) { + (pEncode = calloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) { for(pe = pEncode, encodingPtr = adaptorPtr->pEncodings, i = 0; i < adaptorPtr->nEncodings; pe++, i++, encodingPtr++) { pe->id = encodingPtr->id; pe->pScreen = pScreen; - if((pe->name = xalloc(strlen(encodingPtr->name) + 1))) + if((pe->name = malloc(strlen(encodingPtr->name) + 1))) strcpy(pe->name, encodingPtr->name); pe->width = encodingPtr->width; pe->height = encodingPtr->height; @@ -398,7 +398,7 @@ KdXVInitAdaptors( } if(adaptorPtr->nImages && - (pImage = xcalloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { + (pImage = calloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { for(i = 0, pi = pImage, imagePtr = adaptorPtr->pImages; i < adaptorPtr->nImages; i++, pi++, imagePtr++) @@ -431,7 +431,7 @@ KdXVInitAdaptors( } if(adaptorPtr->nAttributes && - (pAttribute = xcalloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec)))) + (pAttribute = calloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec)))) { for(pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = 0; i < adaptorPtr->nAttributes; pat++, i++, attributePtr++) @@ -439,7 +439,7 @@ KdXVInitAdaptors( pat->flags = attributePtr->flags; pat->min_value = attributePtr->min_value; pat->max_value = attributePtr->max_value; - if((pat->name = xalloc(strlen(attributePtr->name) + 1))) + if((pat->name = malloc(strlen(attributePtr->name) + 1))) strcpy(pat->name, attributePtr->name); } pa->nAttributes = adaptorPtr->nAttributes; @@ -449,7 +449,7 @@ KdXVInitAdaptors( totFormat = adaptorPtr->nFormats; - if(!(pFormat = xcalloc(totFormat, sizeof(XvFormatRec)))) { + if(!(pFormat = calloc(totFormat, sizeof(XvFormatRec)))) { KdXVFreeAdaptor(pa); continue; } @@ -466,7 +466,7 @@ KdXVInitAdaptors( if(numFormat >= totFormat) { void *moreSpace; totFormat *= 2; - moreSpace = xrealloc(pFormat, + moreSpace = realloc(pFormat, totFormat * sizeof(XvFormatRec)); if(!moreSpace) break; pFormat = moreSpace; @@ -489,7 +489,7 @@ KdXVInitAdaptors( continue; } - if(!(adaptorPriv = xcalloc(1, sizeof(XvAdaptorRecPrivate)))) { + if(!(adaptorPriv = calloc(1, sizeof(XvAdaptorRecPrivate)))) { KdXVFreeAdaptor(pa); continue; } @@ -509,7 +509,7 @@ KdXVInitAdaptors( pa->devPriv.ptr = (pointer)adaptorPriv; - if(!(pPort = xcalloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) { + if(!(pPort = calloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) { KdXVFreeAdaptor(pa); continue; } @@ -519,11 +519,11 @@ KdXVInitAdaptors( if(!(pp->id = FakeClientID(0))) continue; - if(!(portPriv = xcalloc(1, sizeof(XvPortRecPrivate)))) + if(!(portPriv = calloc(1, sizeof(XvPortRecPrivate)))) continue; if(!AddResource(pp->id, PortResource, pp)) { - xfree(portPriv); + free(portPriv); continue; } @@ -559,7 +559,7 @@ KdXVInitAdaptors( pxvs->nAdaptors = numAdaptor; pxvs->pAdaptors = pAdaptor; } else { - xfree(pAdaptor); + free(pAdaptor); return FALSE; } @@ -925,7 +925,7 @@ KdXVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) } if(!winPriv) { - winPriv = xalloc(sizeof(KdXVWindowRec)); + winPriv = malloc(sizeof(KdXVWindowRec)); if(!winPriv) return BadAlloc; winPriv->PortRec = portPriv; winPriv->next = PrivRoot; @@ -948,7 +948,7 @@ KdXVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) prevPriv->next = winPriv->next; else dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, winPriv->next); - xfree(winPriv); + free(winPriv); break; } prevPriv = winPriv; @@ -998,7 +998,7 @@ KdXVDestroyWindow(WindowPtr pWin) pPriv->pDraw = NULL; tmp = WinPriv; WinPriv = WinPriv->next; - xfree(tmp); + free(tmp); } dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, NULL); @@ -1063,7 +1063,7 @@ KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) pPrev->next = WinPriv->next; tmp = WinPriv; WinPriv = WinPriv->next; - xfree(tmp); + free(tmp); continue; } break; @@ -1112,7 +1112,7 @@ KdXVClipNotify(WindowPtr pWin, int dx, int dy) pPrev->next = WinPriv->next; tmp = WinPriv; WinPriv = WinPriv->next; - xfree(tmp); + free(tmp); continue; } } @@ -1153,8 +1153,8 @@ KdXVCloseScreen(int i, ScreenPtr pScreen) KdXVFreeAdaptor(pa); } - xfree(pxvs->pAdaptors); - xfree(ScreenPriv); + free(pxvs->pAdaptors); + free(ScreenPriv); return TRUE; } @@ -1872,7 +1872,7 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg) BoxPtr pBox = REGION_RECTS (pRgn); int nBox = REGION_NUM_RECTS (pRgn); - rects = xalloc (nBox * sizeof (xRectangle)); + rects = malloc(nBox * sizeof (xRectangle)); if (!rects) goto bail0; r = rects; @@ -1901,7 +1901,7 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg) FreeScratchGC (pGC); bail1: - xfree (rects); + free(rects); bail0: ; } diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 29857877e..7af5f9335 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -194,7 +194,7 @@ ddxGiveUp(void) case NORMAL_MEMORY_FB: for (i = 0; i < vfbNumScreens; i++) { - Xfree(vfbScreens[i].pXWDHeader); + free(vfbScreens[i].pXWDHeader); } break; } @@ -290,7 +290,7 @@ ddxProcessArgument(int argc, char *argv[], int i) if (vfbNumScreens <= screenNum) { - vfbScreens = xrealloc(vfbScreens, sizeof(*vfbScreens) * (screenNum + 1)); + vfbScreens = realloc(vfbScreens, sizeof(*vfbScreens) * (screenNum + 1)); if (!vfbScreens) FatalError("Not enough memory for screen %d\n", screenNum); for (; vfbNumScreens <= screenNum; ++vfbNumScreens) @@ -439,9 +439,9 @@ vfbInstallColormap(ColormapPtr pmap) swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue); swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries); - ppix = (Pixel *)xalloc(entries * sizeof(Pixel)); - prgb = (xrgb *)xalloc(entries * sizeof(xrgb)); - defs = (xColorItem *)xalloc(entries * sizeof(xColorItem)); + ppix = (Pixel *)malloc(entries * sizeof(Pixel)); + prgb = (xrgb *)malloc(entries * sizeof(xrgb)); + defs = (xColorItem *)malloc(entries * sizeof(xColorItem)); for (i = 0; i < entries; i++) ppix[i] = i; /* XXX truecolor */ @@ -456,9 +456,9 @@ vfbInstallColormap(ColormapPtr pmap) } (*pmap->pScreen->StoreColors)(pmap, entries, defs); - xfree(ppix); - xfree(prgb); - xfree(defs); + free(ppix); + free(prgb); + free(defs); } } @@ -682,7 +682,7 @@ vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb) #endif case NORMAL_MEMORY_FB: - pvfb->pXWDHeader = (XWDFileHeader *)Xalloc(pvfb->sizeInBytes); + pvfb->pXWDHeader = (XWDFileHeader *)malloc(pvfb->sizeInBytes); break; } diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 7b836b00d..896f6950c 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -111,7 +111,7 @@ AppendToList(const char *s, const char ***list, int *lines) (*list)[*lines - 1] = newstr; (*list)[*lines] = NULL; } - xfree(str); + free(str); } static void @@ -121,9 +121,9 @@ FreeList(const char ***list, int *lines) for (i = 0; i < *lines; i++) { if ((*list)[i]) - xfree((*list)[i]); + free((*list)[i]); } - xfree(*list); + free(*list); *list = NULL; *lines = 0; } @@ -262,7 +262,7 @@ xf86AutoConfig(void) AppendToConfig(BUILTIN_LAYOUT_SECTION_POST); for (p = deviceList; *p; p++) { - xfree(*p); + free(*p); } xf86MsgVerb(X_DEFAULT, 0, @@ -374,7 +374,7 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip while (matches[i]) { i++; } - matches[i] = (char*)xalloc(sizeof(char) * strlen(direntry->d_name) - 3); + matches[i] = (char*)malloc(sizeof(char) * strlen(direntry->d_name) - 3); if (!matches[i]) { xf86Msg(X_ERROR, "Could not allocate space for the module name. Exiting.\n"); goto end; @@ -401,7 +401,7 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip direntry = readdir(idsdir); } end: - xfree(line); + free(line); closedir(idsdir); } #endif /* __linux__ */ @@ -534,7 +534,7 @@ copyScreen(confScreenPtr oscreen, GDevPtr odev, int i, char *driver) return FALSE; memcpy(xf86ConfigLayout.screens[i].screen, oscreen, sizeof(confScreenRec)); - cptr = xcalloc(1, sizeof(GDevRec)); + cptr = calloc(1, sizeof(GDevRec)); if (!cptr) return FALSE; memcpy(cptr, odev, sizeof(GDevRec)); @@ -565,7 +565,7 @@ autoConfigDevice(GDevPtr preconf_device) if (preconf_device) { ptr = preconf_device; } else { - ptr = xcalloc(1, sizeof(GDevRec)); + ptr = calloc(1, sizeof(GDevRec)); if (!ptr) { return NULL; } @@ -620,13 +620,13 @@ autoConfigDevice(GDevPtr preconf_device) xf86ConfigLayout.screens[i+num_matches] = slp[i]; } xf86ConfigLayout.screens[num_screens+num_matches-1].screen = NULL; - xfree(slp); + free(slp); } else { /* layout does not have any screens, not much to do */ ptr->driver = matches[0]; for (i = 1; matches[i] ; i++) { if (matches[i] != matches[0]) { - xfree(matches[i]); + free(matches[i]); } } } diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 9d243c172..39e531a59 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -98,7 +98,7 @@ StringToBusType(const char* busID, const char **retID) s = xstrdup(busID); p = strtok(s, ":"); if (p == NULL || *p == 0) { - xfree(s); + free(s); return BUS_NONE; } if (!xf86NameCmp(p, "pci") || !xf86NameCmp(p, "agp")) @@ -108,7 +108,7 @@ StringToBusType(const char* busID, const char **retID) if (ret != BUS_NONE) if (retID) *retID = busID + strlen(p) + 1; - xfree(s); + free(s); return ret; } @@ -295,8 +295,8 @@ xf86ClearEntityListForScreen(int scrnIndex) xf86Entities[entityIndex]->inUse = FALSE; /* disable resource: call the disable function */ } - xfree(pScrn->entityList); - xfree(pScrn->entityInstanceList); + free(pScrn->entityList); + free(pScrn->entityInstanceList); pScrn->entityList = NULL; pScrn->entityInstanceList = NULL; } diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 9a2837e7b..a4813683c 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -184,7 +184,7 @@ xf86ValidateFontPath(char *path) int flag; int dirlen; - tmp_path = xcalloc(1,strlen(path)+1); + tmp_path = calloc(1,strlen(path)+1); out_pnt = tmp_path; path_elem = NULL; next = path; @@ -205,7 +205,7 @@ xf86ValidateFontPath(char *path) if (flag != 0) { xf86Msg(X_WARNING, "The directory \"%s\" does not exist.\n", dir_elem); xf86ErrorF("\tEntry deleted from font path.\n"); - xfree(dir_elem); + free(dir_elem); continue; } else { @@ -216,18 +216,18 @@ xf86ValidateFontPath(char *path) if (flag == 0) if (!S_ISREG(stat_buf.st_mode)) flag = -1; - xfree(p1); + free(p1); if (flag != 0) { xf86Msg(X_WARNING, "`fonts.dir' not found (or not valid) in \"%s\".\n", dir_elem); xf86ErrorF("\tEntry deleted from font path.\n"); xf86ErrorF("\t(Run 'mkfontdir' on \"%s\").\n", dir_elem); - xfree(dir_elem); + free(dir_elem); continue; } } - xfree(dir_elem); + free(dir_elem); } /* @@ -363,7 +363,7 @@ xf86ModulelistFromConfig(pointer **optlist) if (optlist) *optlist = optarray; else - xfree(optarray); + free(optarray); return modulearray; } @@ -622,7 +622,7 @@ configFiles(XF86ConfFilesPtr fileconf) /* xf86ValidateFontPath modifies its argument, but returns a copy of it. */ temp_path = must_copy ? xnfstrdup(defaultFontPath) : defaultFontPath; defaultFontPath = xf86ValidateFontPath(temp_path); - xfree(temp_path); + free(temp_path); /* make fontpath more readable in the logfiles */ countDirs = 1; @@ -647,7 +647,7 @@ configFiles(XF86ConfFilesPtr fileconf) *(temp_path++) = '\t'; strcpy(temp_path, start); xf86Msg(pathFrom, "FontPath set to:\n%s\n", log_buf); - xfree(log_buf); + free(log_buf); /* ModulePath */ @@ -1199,7 +1199,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) for (devs = servlayoutp->inputs; devs && *devs; devs++) if (*devs == corePointer) { - xfree(*devs); + free(*devs); *devs = (IDevPtr)0x1; /* ensure we dont skip next loop*/ break; } @@ -1341,7 +1341,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) for (devs = servlayoutp->inputs; devs && *devs; devs++) if (*devs == coreKeyboard) { - xfree(*devs); + free(*devs); *devs = (IDevPtr)0x1; /* ensure we dont skip next loop */ break; } @@ -1503,8 +1503,8 @@ configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp) indp[count] = xnfalloc(sizeof(IDevRec)); if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) { while(count--) - xfree(indp[count]); - xfree(indp); + free(indp[count]); + free(indp); return FALSE; } indp[count]->extraOptions = irp->iref_option_lst; @@ -1595,7 +1595,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, scrnum = adjp->adj_scrnum; if (!configScreen(slp[count].screen, adjp->adj_screen, scrnum, X_CONFIG)) { - xfree(slp); + free(slp); return FALSE; } slp[count].x = adjp->adj_x; @@ -1640,8 +1640,8 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, slp[0].screen = xnfcalloc(1, sizeof(confScreenRec)); if (!configScreen(slp[0].screen, xf86configptr->conf_screen_lst, 0, X_CONFIG)) { - xfree(slp[0].screen); - xfree(slp); + free(slp[0].screen); + free(slp); return FALSE; } } @@ -1700,7 +1700,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, count = 0; while (idp) { if (!configDevice(&gdp[count], idp->inactive_device, FALSE)) { - xfree(gdp); + free(gdp); return FALSE; } count++; @@ -1760,7 +1760,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen, slp[0].screen = xnfcalloc(1, sizeof(confScreenRec)); slp[1].screen = NULL; if (!configScreen(slp[0].screen, conf_screen, 0, from)) { - xfree(slp); + free(slp); return FALSE; } servlayoutp->id = "(implicit)"; @@ -2306,7 +2306,7 @@ configExtensions(XF86ConfExtensionsPtr conf_ext) enable = !enable; } else { xf86Msg(X_WARNING, "Ignoring unrecognized value \"%s\"\n", val); - xfree(n); + free(n); continue; } @@ -2317,7 +2317,7 @@ configExtensions(XF86ConfExtensionsPtr conf_ext) xf86Msg(X_WARNING, "Ignoring unrecognized extension \"%s\"\n", name); } - xfree(n); + free(n); } } } @@ -2365,7 +2365,7 @@ addDefaultModes(MonPtr monitorp) monitorp->Modes = xf86ModesAdd(monitorp->Modes, mode); last = mode; } else { - xfree(mode); + free(mode); } } monitorp->Last = last; @@ -2402,7 +2402,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) { xf86Msg(X_WARNING, "Disabling %s\n", (*dev)->identifier); current = dev; - xfree(*dev); + free(*dev); do { *current = *(current + 1); diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index 67bf08bbf..ef61e4698 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -163,7 +163,7 @@ bus_sbus_newdev_configure(void *busData, int i) if (promPath) { DevToConfig[i].GDev.busID = xnfalloc(strlen(promPath) + 6); sprintf(DevToConfig[i].GDev.busID, "SBUS:%s", promPath); - xfree(promPath); + free(promPath); } else { DevToConfig[i].GDev.busID = xnfalloc(12); sprintf(DevToConfig[i].GDev.busID, "SBUS:fb%d", @@ -399,7 +399,7 @@ configureDeviceSection (int screennum) int len = strlen(ptr->dev_comment) + strlen(prefix) + strlen(middle) + strlen(suffix) + 1; - optname = xalloc(strlen(p->name) + 2 + 1); + optname = malloc(strlen(p->name) + 2 + 1); if (!optname) break; sprintf(optname, "\"%s\"", p->name); @@ -407,13 +407,13 @@ configureDeviceSection (int screennum) len += max(20, strlen(optname)); len += strlen(opttype); - ptr->dev_comment = xrealloc(ptr->dev_comment, len); + ptr->dev_comment = realloc(ptr->dev_comment, len); if (!ptr->dev_comment) break; p_e = ptr->dev_comment + strlen(ptr->dev_comment); sprintf(p_e, "%s%-20s%s%s%s", prefix, optname, middle, opttype, suffix); - xfree(optname); + free(optname); } } } @@ -512,7 +512,7 @@ configureModuleSection (void) ptr->mod_load_lst = (XF86LoadPtr)xf86addListItem( (glp)ptr->mod_load_lst, (glp)module); } - xfree(elist); + free(elist); } return ptr; @@ -658,7 +658,7 @@ DoConfigure(void) /* Load all the drivers that were found. */ xf86LoadModules(vlist, NULL); - xfree(vlist); + free(vlist); for (i = 0; i < xf86NumDrivers; i++) { xorgHWFlags flags; @@ -807,7 +807,7 @@ DoConfigure(void) } } } - xfree(driverProbed); + free(driverProbed); } diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c index 6740faf65..9cde0599d 100644 --- a/hw/xfree86/common/xf86Cursor.c +++ b/hw/xfree86/common/xf86Cursor.c @@ -502,7 +502,7 @@ AddEdge( } if(!pEdge) { - if(!(pNew = xalloc(sizeof(xf86EdgeRec)))) + if(!(pNew = malloc(sizeof(xf86EdgeRec)))) break; pNew->screen = screen; @@ -519,7 +519,7 @@ AddEdge( break; } else if (min < pEdge->start) { - if(!(pNew = xalloc(sizeof(xf86EdgeRec)))) + if(!(pNew = malloc(sizeof(xf86EdgeRec)))) break; pNew->screen = screen; @@ -850,10 +850,10 @@ xf86ReconfigureLayout(void) for (i = 0; i < MAXSCREENS; i++) { xf86ScreenLayoutPtr sl = &xf86ScreenLayout[i]; /* we don't have to zero these, xf86InitOrigins() takes care of that */ - if (sl->left) xfree(sl->left); - if (sl->right) xfree(sl->right); - if (sl->up) xfree(sl->up); - if (sl->down) xfree(sl->down); + if (sl->left) free(sl->left); + if (sl->right) free(sl->right); + if (sl->up) free(sl->up); + if (sl->down) free(sl->down); } xf86InitOrigins(); diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index 794a13171..a51a754e4 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -124,7 +124,7 @@ DGAInit( if (!pScreenPriv) { - if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec)))) + if(!(pScreenPriv = (DGAScreenPtr)malloc(sizeof(DGAScreenRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv); pScreenPriv->CloseScreen = pScreen->CloseScreen; @@ -235,8 +235,8 @@ FreeMarkedVisuals(ScreenPtr pScreen) prev->next = curr; else pScreenPriv->fakedVisuals = curr; - xfree(tmp->pVisual); - xfree(tmp); + free(tmp->pVisual); + free(tmp); } else { prev = curr; curr = curr->next; @@ -263,7 +263,7 @@ DGACloseScreen(int i, ScreenPtr pScreen) /* DGAShutdown() should have ensured that no DGA screen were active by here */ - xfree(pScreenPriv); + free(pScreenPriv); return((*pScreen->CloseScreen)(i, pScreen)); } @@ -363,7 +363,7 @@ xf86SetDGAMode( else (*pScreen->DestroyPixmap)(oldPix); } - xfree(pScreenPriv->current); + free(pScreenPriv->current); pScreenPriv->current = NULL; pScrn->vtSema = TRUE; (*pScreenPriv->funcs->SetMode)(pScrn, NULL); @@ -391,7 +391,7 @@ xf86SetDGAMode( else return BadValue; - if(!(device = (DGADevicePtr)xalloc(sizeof(DGADeviceRec)))) + if(!(device = (DGADevicePtr)malloc(sizeof(DGADeviceRec)))) return BadAlloc; if(!pScreenPriv->current) { @@ -403,7 +403,7 @@ xf86SetDGAMode( } if(!(*pScreenPriv->funcs->SetMode)(pScrn, pMode)) { - xfree(device); + free(device); return BadAlloc; } @@ -424,7 +424,7 @@ xf86SetDGAMode( else (*pScreen->DestroyPixmap)(oldPix); } - xfree(pScreenPriv->current); + free(pScreenPriv->current); pScreenPriv->current = NULL; } @@ -671,7 +671,7 @@ DGACreateColormap(int index, ClientPtr client, int id, int mode, int alloc) pMode = &(pScreenPriv->modes[mode - 1]); - if(!(pVisual = xalloc(sizeof(VisualRec)))) + if(!(pVisual = malloc(sizeof(VisualRec)))) return BadAlloc; pVisual->vid = FakeClientID(0); @@ -705,8 +705,8 @@ DGACreateColormap(int index, ClientPtr client, int id, int mode, int alloc) pVisual->offsetBlue = BitsClear(pVisual->blueMask); } - if(!(fvlp = xalloc(sizeof(FakedVisualList)))) { - xfree(pVisual); + if(!(fvlp = malloc(sizeof(FakedVisualList)))) { + free(pVisual); return BadAlloc; } diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c index 22174c74e..cd33e75e7 100644 --- a/hw/xfree86/common/xf86DPMS.c +++ b/hw/xfree86/common/xf86DPMS.c @@ -65,7 +65,7 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags) DPMSKey = &DPMSKeyIndex; if (!dixSetPrivate(&pScreen->devPrivates, DPMSKey, - xcalloc(sizeof(DPMSRec), 1))) + calloc(sizeof(DPMSRec), 1))) return FALSE; pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey); @@ -127,7 +127,7 @@ DPMSClose(int i, ScreenPtr pScreen) xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0); } - xfree(pDPMS); + free(pDPMS); dixSetPrivate(&pScreen->devPrivates, DPMSKey, NULL); if (--DPMSCount == 0) DPMSKey = NULL; diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index ebf03bfe7..2ff77c61d 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -567,7 +567,7 @@ addInputHandler(int fd, InputHandlerProc proc, pointer data) if (fd < 0 || !proc) return NULL; - ih = xcalloc(sizeof(*ih), 1); + ih = calloc(sizeof(*ih), 1); if (!ih) return NULL; @@ -616,7 +616,7 @@ removeInputHandler(IHPtr ih) if (ih) p->next = ih->next; } - xfree(ih); + free(ih); } int diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 1cc1526c9..9ec594144 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -105,7 +105,7 @@ xf86DeleteDriver(int drvIndex) && (!xf86DriverHasEntities(xf86DriverList[drvIndex]))) { if (xf86DriverList[drvIndex]->module) UnloadModule(xf86DriverList[drvIndex]->module); - xfree(xf86DriverList[drvIndex]); + free(xf86DriverList[drvIndex]); xf86DriverList[drvIndex] = NULL; } } @@ -137,7 +137,7 @@ xf86DeleteInputDriver(int drvIndex) { if (xf86InputDriverList[drvIndex] && xf86InputDriverList[drvIndex]->module) UnloadModule(xf86InputDriverList[drvIndex]->module); - xfree(xf86InputDriverList[drvIndex]); + free(xf86InputDriverList[drvIndex]); xf86InputDriverList[drvIndex] = NULL; } @@ -239,11 +239,11 @@ xf86DeleteScreen(int scrnIndex, int flags) pScrn->drv->refCount--; if (pScrn->privates) - xfree(pScrn->privates); + free(pScrn->privates); xf86ClearEntityListForScreen(scrnIndex); - xfree(pScrn); + free(pScrn); /* Move the other entries down, updating their scrnIndex fields */ @@ -285,7 +285,7 @@ xf86AllocateInput(InputDriverPtr drv, int flags) { InputInfoPtr new, *prev = NULL; - if (!(new = xcalloc(sizeof(InputInfoRec), 1))) + if (!(new = calloc(sizeof(InputInfoRec), 1))) return NULL; new->drv = drv; @@ -332,7 +332,7 @@ xf86DeleteInput(InputInfoPtr pInp, int flags) * if the driver forgets about it make sure we free it or at least crash * with flying colors */ if (pInp->private) - xfree(pInp->private); + free(pInp->private); /* Remove the entry from the list. */ if (pInp == xf86InputDevs) @@ -345,7 +345,7 @@ xf86DeleteInput(InputInfoPtr pInp, int flags) p->next = pInp->next; /* Else the entry wasn't in the xf86InputDevs list (ignore this). */ } - xfree(pInp); + free(pInp); } Bool @@ -1224,7 +1224,7 @@ xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, /* Prefix the scrnIndex name to the format string. */ if (scrnIndex >= 0 && scrnIndex < xf86NumScreens && xf86Screens[scrnIndex]->name) { - tmpFormat = xalloc(strlen(format) + + tmpFormat = malloc(strlen(format) + strlen(xf86Screens[scrnIndex]->name) + PREFIX_SIZE + 1); if (!tmpFormat) @@ -1235,7 +1235,7 @@ xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, strcat(tmpFormat, format); LogVMessageVerb(type, verb, tmpFormat, args); - xfree(tmpFormat); + free(tmpFormat); } else LogVMessageVerb(type, verb, format, args); } @@ -1502,7 +1502,7 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist) if (sectlist) *sectlist = pgdp; else - xfree(pgdp); + free(pgdp); return i; } @@ -1697,7 +1697,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID, * allow the config file to override this. */ if (allocatedInstances <= 0) { - xfree(instances); + free(instances); return 0; } @@ -1912,7 +1912,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID, } } } - xfree(instances); + free(instances); if (numFound > 0) { *foundEntities = retEntities; } @@ -2206,14 +2206,14 @@ xf86LoadOneModule(char *name, pointer opt) if (Name == NULL) return NULL; if (*Name == '\0') { - xfree(Name); + free(Name); return NULL; } mod = LoadModule(Name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin); if (!mod) LoaderErrorMsg(NULL, Name, errmaj, errmin); - xfree(Name); + free(Name); return mod; } @@ -2267,7 +2267,7 @@ xf86SetBackingStore(ScreenPtr pScreen) if (xf86GetOptValBool(options, OPTION_BACKING_STORE, &useBS)) from = X_CONFIG; } - xfree(options); + free(options); pScreen->backingStoreSupport = useBS ? Always : NotUseful; if (serverGeneration == 1) xf86DrvMsg(pScreen->myNum, from, "Backing store %s\n", @@ -2306,7 +2306,7 @@ xf86SetSilkenMouse (ScreenPtr pScreen) if (xf86GetOptValBool(options, OPTION_SILKEN_MOUSE, &useSM)) from = X_CONFIG; } - xfree(options); + free(options); /* * XXX quick hack to report correctly for OSs that can't do SilkenMouse * yet. Should handle this differently so that alternate async methods @@ -2392,13 +2392,13 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, if (!(pEnt->location.type == BUS_PCI) || !xf86GetPciInfoForEntity(entityIndex)) { - xfree(pEnt); + free(pEnt); return pScrn; } if (!pEnt->active) { xf86ConfigPciEntityInactive(pEnt, p_chip, init, enter, leave, private); - xfree(pEnt); + free(pEnt); return pScrn; } @@ -2411,7 +2411,7 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, if (xf86IsEntityShared(entityIndex)) { return pScrn; } - xfree(pEnt); + free(pEnt); xf86SetEntityFuncs(entityIndex,init,enter,leave,private); @@ -2427,13 +2427,13 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, if (!pEnt) return pScrn; if (!(pEnt->location.type == BUS_NONE)) { - xfree(pEnt); + free(pEnt); return pScrn; } if (!pEnt->active) { xf86ConfigFbEntityInactive(pEnt, init, enter, leave, private); - xfree(pEnt); + free(pEnt); return pScrn; } @@ -2461,12 +2461,12 @@ xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex, if (!pEnt) return FALSE; if (!pEnt->active || !(pEnt->location.type == BUS_PCI)) { - xfree(pEnt); + free(pEnt); return FALSE; } xf86AddEntityToScreen(pScrn,entityIndex); - xfree(pEnt); + free(pEnt); if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private)) return FALSE; @@ -2511,7 +2511,7 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, } if (!pNewProp) { - if ((pNewProp = (RootWinPropPtr)xalloc(sizeof(RootWinProp))) == NULL) { + if ((pNewProp = (RootWinPropPtr)malloc(sizeof(RootWinProp))) == NULL) { return(BadAlloc); } /* @@ -2521,7 +2521,7 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, pNewProp->next = NULL; } else { if (pNewProp->name) - xfree(pNewProp->name); + free(pNewProp->name); existing = TRUE; } diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 55d7a6209..39d229b9a 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -438,7 +438,7 @@ probe_devices_from_device_sections(DriverPtr drvp) } } } - xfree(devList); + free(devList); return foundScreen; } @@ -617,8 +617,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) /* Load all modules specified explicitly in the config file */ if ((modulelist = xf86ModulelistFromConfig(&optionlist))) { xf86LoadModules(modulelist, optionlist); - xfree(modulelist); - xfree(optionlist); + free(modulelist); + free(optionlist); } /* Load all driver modules specified in the config file */ @@ -634,13 +634,13 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } if ((modulelist = xf86DriverlistFromConfig())) { xf86LoadModules(modulelist, NULL); - xfree(modulelist); + free(modulelist); } /* Load all input driver modules specified in the config file. */ if ((modulelist = xf86InputDriverlistFromConfig())) { xf86LoadModules(modulelist, NULL); - xfree(modulelist); + free(modulelist); } /* @@ -940,7 +940,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) /* This memory needs to stay available until the screen has been initialized, and we can create the property for real. */ - if ( (VT = xalloc(sizeof(CARD32)))==NULL ) { + if ( (VT = malloc(sizeof(CARD32)))==NULL ) { FatalError("Unable to make VT property - out of memory. Exiting...\n"); } *VT = xf86Info.vtno; @@ -1756,7 +1756,7 @@ xf86LoadModules(char **list, pointer *optlist) LoaderErrorMsg(NULL, name, errmaj, errmin); failed = TRUE; } - xfree(name); + free(name); } return !failed; } diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index 5d30a782c..7bdf79a68 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -1918,8 +1918,8 @@ xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode) mode->next->prev = mode->prev; } - xfree(mode->name); - xfree(mode); + free(mode->name); + free(mode); } /* diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c index a2868bf21..699204ce5 100644 --- a/hw/xfree86/common/xf86Option.c +++ b/hw/xfree86/common/xf86Option.c @@ -601,8 +601,8 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p, if (strncmp(n, "no", 2) == 0) { newn = n + 2; } else { - xfree(n); - n = xalloc(strlen(p->name) + 2 + 1); + free(n); + n = malloc(strlen(p->name) + 2 + 1); if (!n) { p->found = FALSE; return FALSE; @@ -632,7 +632,7 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p, } xf86ErrorFVerb(2, "\n"); } - xfree(n); + free(n); } else { p->found = FALSE; } @@ -843,7 +843,7 @@ xf86NormalizeName(const char *s) if (s == NULL) return NULL; - ret = xalloc(strlen(s) + 1); + ret = malloc(strlen(s) + 1); for (p = s, q = ret; *p != 0; p++) { switch (*p) { case '_': diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index 86c7bde79..455a02cc2 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -359,7 +359,7 @@ xf86RandRCloseScreen (int index, ScreenPtr pScreen) scrp->virtualY = pScreen->height = randrp->virtualY; scrp->currentMode = scrp->modes; pScreen->CloseScreen = randrp->CloseScreen; - xfree (randrp); + free(randrp); dixSetPrivate(&pScreen->devPrivates, xf86RandRKey, NULL); return (*pScreen->CloseScreen) (index, pScreen); } @@ -426,13 +426,13 @@ xf86RandRInit (ScreenPtr pScreen) xf86RandRKey = &xf86RandRKeyIndex; - randrp = xalloc (sizeof (XF86RandRInfoRec)); + randrp = malloc(sizeof (XF86RandRInfoRec)); if (!randrp) return FALSE; if (!RRScreenInit (pScreen)) { - xfree (randrp); + free(randrp); return FALSE; } rp = rrGetScrPriv(pScreen); diff --git a/hw/xfree86/common/xf86ShowOpts.c b/hw/xfree86/common/xf86ShowOpts.c index 04a9a8b1c..ff4b651c1 100644 --- a/hw/xfree86/common/xf86ShowOpts.c +++ b/hw/xfree86/common/xf86ShowOpts.c @@ -85,7 +85,7 @@ void DoShowOptions (void) { goto bail; } xf86LoadModules (vlist,0); - xfree (vlist); + free(vlist); for (i = 0; i < xf86NumDrivers; i++) { if (xf86DriverList[i]->AvailableOptions) { OptionInfoPtr pOption = (OptionInfoPtr)(*xf86DriverList[i]->AvailableOptions)(0,0); @@ -95,7 +95,7 @@ void DoShowOptions (void) { ); continue; } - pSymbol = xalloc ( + pSymbol = malloc( strlen(xf86DriverList[i]->driverName) + strlen("ModuleData") + 1 ); strcpy (pSymbol, xf86DriverList[i]->driverName); @@ -109,7 +109,7 @@ void DoShowOptions (void) { ); for (p = pOption; p->name != NULL; p++) { const char *opttype = optionTypeToSting(p->type); - char *optname = xalloc(strlen(p->name) + 2 + 1); + char *optname = malloc(strlen(p->name) + 2 + 1); if (!optname) { continue; } diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c index 52a8b9a60..4a736fc7a 100644 --- a/hw/xfree86/common/xf86VGAarbiter.c +++ b/hw/xfree86/common/xf86VGAarbiter.c @@ -178,7 +178,7 @@ xf86VGAarbiterWrapFunctions(void) if (!dixRequestPrivate(VGAarbiterGCKey, sizeof(VGAarbiterGCRec))) return FALSE; - if (!(pScreenPriv = xalloc(sizeof(VGAarbiterScreenRec)))) + if (!(pScreenPriv = malloc(sizeof(VGAarbiterScreenRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, VGAarbiterScreenKey, pScreenPriv); @@ -250,7 +250,7 @@ VGAarbiterCloseScreen (int i, ScreenPtr pScreen) UNWRAP_SCREEN_INFO(FreeScreen); UNWRAP_SPRITE; - xfree ((pointer) pScreenPriv); + free((pointer) pScreenPriv); xf86VGAarbiterLock(xf86Screens[i]); val = (*pScreen->CloseScreen) (i, pScreen); xf86VGAarbiterUnlock(xf86Screens[i]); diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c index 49b86e73a..e704f5a46 100644 --- a/hw/xfree86/common/xf86VidMode.c +++ b/hw/xfree86/common/xf86VidMode.c @@ -70,7 +70,7 @@ VidModeExtensionInit(ScreenPtr pScreen) VidModeKey = &VidModeKeyIndex; if (!dixSetPrivate(&pScreen->devPrivates, VidModeKey, - xcalloc(sizeof(VidModeRec), 1))) { + calloc(sizeof(VidModeRec), 1))) { DebugF("xcalloc failed\n"); return FALSE; } @@ -103,7 +103,7 @@ VidModeClose(int i, ScreenPtr pScreen) pScreen->CloseScreen = pVidMode->CloseScreen; if (--VidModeCount == 0) { - xfree(dixLookupPrivate(&pScreen->devPrivates, VidModeKey)); + free(dixLookupPrivate(&pScreen->devPrivates, VidModeKey)); dixSetPrivate(&pScreen->devPrivates, VidModeKey, NULL); VidModeKey = NULL; } @@ -527,7 +527,7 @@ VidModeCreateMode(void) { DisplayModePtr mode; - mode = xalloc(sizeof(DisplayModeRec)); + mode = malloc(sizeof(DisplayModeRec)); if (mode != NULL) { mode->name = ""; mode->VScan = 1; /* divides refresh rate. default = 1 */ diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index a1a5527f4..ac287aa61 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -235,7 +235,7 @@ ApplyAccelerationSettings(DeviceIntPtr dev){ local->name, scheme); } - xfree(schemeStr); + free(schemeStr); /* process special configuration */ switch (scheme) { @@ -612,7 +612,7 @@ MergeInputClasses(IDevPtr idev, InputAttributes *attrs) /* Apply options to device with InputClass settings preferred. */ if (classdriver) { - xfree(idev->driver); + free(idev->driver); idev->driver = xstrdup(classdriver); if (!idev->driver) { xf86Msg(X_ERROR, "Failed to allocate memory while merging " @@ -762,7 +762,7 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, int rval = Success; int is_auto = 0; - idev = xcalloc(sizeof(*idev), 1); + idev = calloc(sizeof(*idev), 1); if (!idev) return BadAlloc; @@ -844,11 +844,11 @@ unwind: if (is_auto && !xf86Info.autoAddDevices) xf86Msg(X_INFO, "AutoAddDevices is off - not adding device.\n"); if(idev->driver) - xfree(idev->driver); + free(idev->driver); if(idev->identifier) - xfree(idev->identifier); + free(idev->identifier); xf86optionListFree(idev->commonOptions); - xfree(idev); + free(idev); return rval; } @@ -884,10 +884,10 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) if (!(*it)) /* end of list, not in the layout */ { - xfree(idev->driver); - xfree(idev->identifier); + free(idev->driver); + free(idev->identifier); xf86optionListFree(idev->commonOptions); - xfree(idev); + free(idev); } } OsReleaseSignals(); diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c index e266ffb6d..f59ffcb70 100644 --- a/hw/xfree86/common/xf86cmap.c +++ b/hw/xfree86/common/xf86cmap.c @@ -155,17 +155,17 @@ Bool xf86HandleColormaps( elements = 1 << sigRGBbits; - if(!(gamma = xalloc(elements * sizeof(LOCO)))) + if(!(gamma = malloc(elements * sizeof(LOCO)))) return FALSE; - if(!(indices = xalloc(maxColors * sizeof(int)))) { - xfree(gamma); + if(!(indices = malloc(maxColors * sizeof(int)))) { + free(gamma); return FALSE; } - if(!(pScreenPriv = xalloc(sizeof(CMapScreenRec)))) { - xfree(gamma); - xfree(indices); + if(!(pScreenPriv = malloc(sizeof(CMapScreenRec)))) { + free(gamma); + free(indices); return FALSE; } @@ -261,11 +261,11 @@ CMapAllocateColormapPrivate(ColormapPtr pmap) else numColors = 1 << pmap->pVisual->nplanes; - if(!(colors = xalloc(numColors * sizeof(LOCO)))) + if(!(colors = malloc(numColors * sizeof(LOCO)))) return FALSE; - if(!(pColPriv = xalloc(sizeof(CMapColormapRec)))) { - xfree(colors); + if(!(pColPriv = malloc(sizeof(CMapColormapRec)))) { + free(colors); return FALSE; } @@ -277,7 +277,7 @@ CMapAllocateColormapPrivate(ColormapPtr pmap) pColPriv->overscan = -1; /* add map to list */ - pLink = xalloc(sizeof(CMapLink)); + pLink = malloc(sizeof(CMapLink)); if(pLink) { pLink->cmap = pmap; pLink->next = pScreenPriv->maps; @@ -316,8 +316,8 @@ CMapDestroyColormap (ColormapPtr cmap) CMapLinkPtr prevLink = NULL, pLink = pScreenPriv->maps; if(pColPriv) { - if(pColPriv->colors) xfree(pColPriv->colors); - xfree(pColPriv); + if(pColPriv->colors) free(pColPriv->colors); + free(pColPriv); } /* remove map from list */ @@ -327,7 +327,7 @@ CMapDestroyColormap (ColormapPtr cmap) prevLink->next = pLink->next; else pScreenPriv->maps = pLink->next; - xfree(pLink); + free(pLink); break; } prevLink = pLink; @@ -828,9 +828,9 @@ CMapUnwrapScreen(ScreenPtr pScreen) pScrn->SetDGAMode = pScreenPriv->SetDGAMode; pScrn->ChangeGamma = pScreenPriv->ChangeGamma; - xfree(pScreenPriv->gamma); - xfree(pScreenPriv->PreAllocIndices); - xfree(pScreenPriv); + free(pScreenPriv->gamma); + free(pScreenPriv->PreAllocIndices); + free(pScreenPriv); } diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c index 5b8871723..a142abebc 100644 --- a/hw/xfree86/common/xf86fbman.c +++ b/hw/xfree86/common/xf86fbman.c @@ -323,10 +323,10 @@ localRegisterFreeBoxCallback( offman = (FBManagerPtr)dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); - newCallbacks = xrealloc( offman->FreeBoxesUpdateCallback, + newCallbacks = realloc( offman->FreeBoxesUpdateCallback, sizeof(FreeBoxCallbackProcPtr) * (offman->NumCallbacks + 1)); - newPrivates = xrealloc(offman->devPrivates, + newPrivates = realloc(offman->devPrivates, sizeof(DevUnion) * (offman->NumCallbacks + 1)); if(!newCallbacks || !newPrivates) @@ -375,7 +375,7 @@ AllocateArea( if(((boxp->y2 - boxp->y1) < h) || ((boxp->x2 - x) < w)) continue; - link = xalloc(sizeof(FBLink)); + link = malloc(sizeof(FBLink)); if(!link) return NULL; area = &(link->area); @@ -485,7 +485,7 @@ localFreeOffscreenArea(FBAreaPtr area) pLinkPrev->next = pLink->next; else offman->UsedAreas = pLink->next; - xfree(pLink); + free(pLink); offman->NumUsedAreas--; SendCallFreeBoxCallbacks(offman); @@ -583,7 +583,7 @@ localResizeOffscreenArea( pLink->next = offman->UsedAreas; offman->UsedAreas = pLink; - xfree(newLink); + free(newLink); /* AllocateArea added one but we really only exchanged one */ offman->NumUsedAreas--; @@ -751,7 +751,7 @@ localPurgeUnlockedOffscreenAreas(ScreenPtr pScreen) tmp = pLink; pLink = pLink->next; - xfree(tmp); + free(tmp); offman->NumUsedAreas--; anyUsed = TRUE; } else { @@ -799,7 +799,7 @@ LinearRemoveCBWrapper(FBAreaPtr area) pLinkPrev->next = pLink->next; else offman->LinearAreas = pLink->next; - xfree(pLink); + free(pLink); } static void @@ -854,7 +854,7 @@ AllocateLinear( /* break left */ if (offset > linear->linear.offset) { - newlink = xalloc(sizeof(FBLinearLink)); + newlink = malloc(sizeof(FBLinearLink)); if (!newlink) return NULL; newlink->area = NULL; @@ -869,7 +869,7 @@ AllocateLinear( /* break right */ if (size < linear->linear.size) { - newlink = xalloc(sizeof(FBLinearLink)); + newlink = malloc(sizeof(FBLinearLink)); if (!newlink) return NULL; newlink->area = NULL; @@ -920,7 +920,7 @@ localAllocateOffscreenLinear( DebugF("NOPE, ALLOCATING AREA\n"); - if(!(link = xalloc(sizeof(FBLinearLink)))) + if(!(link = malloc(sizeof(FBLinearLink)))) return NULL; /* No linear available, so try and pinch some from the XY areas */ @@ -930,7 +930,7 @@ localAllocateOffscreenLinear( if (gran > 1) { if (gran > pitch) { /* we can't match the specified alignment with XY allocations */ - xfree(link); + free(link); return NULL; } @@ -970,7 +970,7 @@ localAllocateOffscreenLinear( linear->RemoveLinearCallback = removeCB; linear->devPrivate.ptr = privData; } else - xfree(link); + free(link); DumpDebug(offman->LinearAreas); @@ -1002,7 +1002,7 @@ localFreeOffscreenLinear(FBLinearPtr linear) if(pLinkPrev) pLinkPrev->next = pLink->next; else offman->LinearAreas = pLink->next; - xfree(pLink); + free(pLink); DumpDebug(offman->LinearAreas); return; } @@ -1161,22 +1161,22 @@ xf86FBCloseScreen (int i, ScreenPtr pScreen) while(pLink) { tmp = pLink; pLink = pLink->next; - xfree(tmp); + free(tmp); } pLinearLink = offman->LinearAreas; while(pLinearLink) { tmp2 = pLinearLink; pLinearLink = pLinearLink->next; - xfree(tmp2); + free(tmp2); } REGION_DESTROY(pScreen, offman->InitialBoxes); REGION_DESTROY(pScreen, offman->FreeBoxes); - xfree(offman->FreeBoxesUpdateCallback); - xfree(offman->devPrivates); - xfree(offman); + free(offman->FreeBoxesUpdateCallback); + free(offman->devPrivates); + free(offman); dixSetPrivate(&pScreen->devPrivates, xf86FBScreenKey, NULL); return (*pScreen->CloseScreen) (i, pScreen); @@ -1324,7 +1324,7 @@ xf86InitFBManagerRegion( if(!xf86RegisterOffscreenManager(pScreen, &xf86FBManFuncs)) return FALSE; - offman = xalloc(sizeof(FBManager)); + offman = malloc(sizeof(FBManager)); if(!offman) return FALSE; dixSetPrivate(&pScreen->devPrivates, xf86FBScreenKey, offman); @@ -1368,7 +1368,7 @@ xf86InitFBManagerLinear( offman = (FBManagerPtr)dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); - offman->LinearAreas = xalloc(sizeof(FBLinearLink)); + offman->LinearAreas = malloc(sizeof(FBLinearLink)); if (!offman->LinearAreas) return FALSE; diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index ac018e739..3b30d720e 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -212,7 +212,7 @@ xf86PciProbe(void) xf86ErrorF("\n"); } - xfree(xf86PciVideoInfo); + free(xf86PciVideoInfo); } /* @@ -293,7 +293,7 @@ xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func) s = xstrdup(id); p = strtok(s, ":"); if (p == NULL || *p == 0) { - xfree(s); + free(s); return FALSE; } d = strpbrk(p, "@"); @@ -301,14 +301,14 @@ xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func) *(d++) = 0; for (i = 0; d[i] != 0; i++) { if (!isdigit(d[i])) { - xfree(s); + free(s); return FALSE; } } } for (i = 0; p[i] != 0; i++) { if (!isdigit(p[i])) { - xfree(s); + free(s); return FALSE; } } @@ -317,12 +317,12 @@ xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func) *bus += atoi(d) << 8; p = strtok(NULL, ":"); if (p == NULL || *p == 0) { - xfree(s); + free(s); return FALSE; } for (i = 0; p[i] != 0; i++) { if (!isdigit(p[i])) { - xfree(s); + free(s); return FALSE; } } @@ -330,17 +330,17 @@ xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func) *func = 0; p = strtok(NULL, ":"); if (p == NULL || *p == 0) { - xfree(s); + free(s); return TRUE; } for (i = 0; p[i] != 0; i++) { if (!isdigit(p[i])) { - xfree(s); + free(s); return FALSE; } } *func = atoi(p); - xfree(s); + free(s); return TRUE; } diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c index 7b23233aa..ea8c3e154 100644 --- a/hw/xfree86/common/xf86sbusBus.c +++ b/hw/xfree86/common/xf86sbusBus.c @@ -85,7 +85,7 @@ xf86SbusProbe(void) char fbDevName[32]; sbusDevicePtr psdp, *psdpp; - xf86SbusInfo = xalloc(sizeof(psdp)); + xf86SbusInfo = malloc(sizeof(psdp)); *xf86SbusInfo = NULL; for (i = 0; i < 32; i++) { sprintf(fbDevName, "/dev/fb%d", i); @@ -210,7 +210,7 @@ xf86SbusProbe(void) promPath = sparcPromNode2Pathname (&psdp->node); if (promPath) { xf86ErrorF(" at %s", promPath); - xfree(promPath); + free(promPath); } } else xf86Msg(X_PROBED, "SBUS: %s", psdp->descr); @@ -397,7 +397,7 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId, * allow the config file to override this. */ if (allocatedInstances <= 0) { - xfree(instances); + free(instances); return 0; } @@ -419,7 +419,7 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId, pGDev->chipID = pGDev->chipRev = -1; } } - xfree(instances); + free(instances); if (useProm) sparcPromClose(); return actualcards; @@ -479,7 +479,7 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId, instances[i].dev = dev; } if (promPath) - xfree(promPath); + free(promPath); } DebugF("%s instances found: %d\n", driverName, numClaimedInstances); @@ -506,7 +506,7 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId, = xf86ClaimSbusSlot(psdp, drvp, instances[i].dev,instances[i].dev->active ? TRUE : FALSE); } - xfree(instances); + free(instances); if (numFound > 0) { *foundEntities = retEntities; } @@ -607,7 +607,7 @@ xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, int i, index; sbusCmapPtr cmap; struct fbcmap fbcmap; - unsigned char *data = xalloc(numColors*3); + unsigned char *data = malloc(numColors*3); cmap = SBUSCMAPPTR(pScrn->pScreen); if (!cmap) return; @@ -628,7 +628,7 @@ xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, fbcmap.blue[fbcmap.count++] = colors[index].blue; } ioctl (cmap->psdp->fd, FBIOPUTCMAP, &fbcmap); - xfree(data); + free(data); } static Bool @@ -647,7 +647,7 @@ xf86SbusCmapCloseScreen(int i, ScreenPtr pScreen) ioctl (cmap->psdp->fd, FBIOPUTCMAP, &fbcmap); } pScreen->CloseScreen = cmap->CloseScreen; - xfree (cmap); + free(cmap); return (*pScreen->CloseScreen) (i, pScreen); } diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index 2cc2f6093..99d1fdf73 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -138,7 +138,7 @@ xf86XVRegisterGenericAdaptorDriver( ){ xf86XVInitGenericAdaptorPtr *newdrivers; - newdrivers = xrealloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) * + newdrivers = realloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) * (1 + NumGenDrivers)); if (!newdrivers) return 0; @@ -168,7 +168,7 @@ xf86XVListGenericAdaptors( n = (*GenDrivers[i])(pScrn, &DrivAdap); if (0 == n) continue; - new = xrealloc(*adaptors, sizeof(XF86VideoAdaptorPtr) * (num+n)); + new = realloc(*adaptors, sizeof(XF86VideoAdaptorPtr) * (num+n)); if (NULL == new) continue; *adaptors = new; @@ -225,13 +225,13 @@ xf86XVQueryOffscreenImages( XF86VideoAdaptorPtr xf86XVAllocateVideoAdaptorRec(ScrnInfoPtr pScrn) { - return xcalloc(1, sizeof(XF86VideoAdaptorRec)); + return calloc(1, sizeof(XF86VideoAdaptorRec)); } void xf86XVFreeVideoAdaptorRec(XF86VideoAdaptorPtr ptr) { - xfree(ptr); + free(ptr); } @@ -267,7 +267,7 @@ xf86XVScreenInit( a CloseScreen hook so that we don't have to wrap it. I'm not sure that I appreciate that. */ - ScreenPriv = xalloc(sizeof(XF86XVScreenRec)); + ScreenPriv = malloc(sizeof(XF86XVScreenRec)); pxvs->devPriv.ptr = (pointer)ScreenPriv; if(!ScreenPriv) return FALSE; @@ -302,17 +302,17 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) { int i; - xfree(pAdaptor->name); + free(pAdaptor->name); if(pAdaptor->pEncodings) { XvEncodingPtr pEncode = pAdaptor->pEncodings; for(i = 0; i < pAdaptor->nEncodings; i++, pEncode++) - xfree(pEncode->name); - xfree(pAdaptor->pEncodings); + free(pEncode->name); + free(pAdaptor->pEncodings); } - xfree(pAdaptor->pFormats); + free(pAdaptor->pFormats); if(pAdaptor->pPorts) { XvPortPtr pPort = pAdaptor->pPorts; @@ -325,22 +325,22 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip); if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip); - xfree(pPriv); + free(pPriv); } } - xfree(pAdaptor->pPorts); + free(pAdaptor->pPorts); } if(pAdaptor->nAttributes) { XvAttributePtr pAttribute = pAdaptor->pAttributes; for(i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) - xfree(pAttribute->name); - xfree(pAdaptor->pAttributes); + free(pAttribute->name); + free(pAdaptor->pAttributes); } - xfree(pAdaptor->pImages); - xfree(pAdaptor->devPriv.ptr); + free(pAdaptor->pImages); + free(pAdaptor->devPriv.ptr); } static Bool @@ -374,7 +374,7 @@ xf86XVInitAdaptors( pxvs->nAdaptors = 0; pxvs->pAdaptors = NULL; - if(!(pAdaptor = xcalloc(number, sizeof(XvAdaptorRec)))) + if(!(pAdaptor = calloc(number, sizeof(XvAdaptorRec)))) return FALSE; for(pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) { @@ -424,18 +424,18 @@ xf86XVInitAdaptors( pa->ddGetPortAttribute = xf86XVGetPortAttribute; pa->ddQueryBestSize = xf86XVQueryBestSize; pa->ddQueryImageAttributes = xf86XVQueryImageAttributes; - if((pa->name = xalloc(strlen(adaptorPtr->name) + 1))) + if((pa->name = malloc(strlen(adaptorPtr->name) + 1))) strcpy(pa->name, adaptorPtr->name); if(adaptorPtr->nEncodings && - (pEncode = xcalloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) { + (pEncode = calloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) { for(pe = pEncode, encodingPtr = adaptorPtr->pEncodings, i = 0; i < adaptorPtr->nEncodings; pe++, i++, encodingPtr++) { pe->id = encodingPtr->id; pe->pScreen = pScreen; - if((pe->name = xalloc(strlen(encodingPtr->name) + 1))) + if((pe->name = malloc(strlen(encodingPtr->name) + 1))) strcpy(pe->name, encodingPtr->name); pe->width = encodingPtr->width; pe->height = encodingPtr->height; @@ -447,7 +447,7 @@ xf86XVInitAdaptors( } if(adaptorPtr->nImages && - (pImage = xcalloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { + (pImage = calloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { for(i = 0, pi = pImage, imagePtr = adaptorPtr->pImages; i < adaptorPtr->nImages; i++, pi++, imagePtr++) @@ -480,7 +480,7 @@ xf86XVInitAdaptors( } if(adaptorPtr->nAttributes && - (pAttribute = xcalloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec)))) + (pAttribute = calloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec)))) { for(pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = 0; i < adaptorPtr->nAttributes; pat++, i++, attributePtr++) @@ -488,7 +488,7 @@ xf86XVInitAdaptors( pat->flags = attributePtr->flags; pat->min_value = attributePtr->min_value; pat->max_value = attributePtr->max_value; - if((pat->name = xalloc(strlen(attributePtr->name) + 1))) + if((pat->name = malloc(strlen(attributePtr->name) + 1))) strcpy(pat->name, attributePtr->name); } pa->nAttributes = adaptorPtr->nAttributes; @@ -498,7 +498,7 @@ xf86XVInitAdaptors( totFormat = adaptorPtr->nFormats; - if(!(pFormat = xcalloc(totFormat, sizeof(XvFormatRec)))) { + if(!(pFormat = calloc(totFormat, sizeof(XvFormatRec)))) { xf86XVFreeAdaptor(pa); continue; } @@ -515,7 +515,7 @@ xf86XVInitAdaptors( if(numFormat >= totFormat) { void *moreSpace; totFormat *= 2; - moreSpace = xrealloc(pFormat, + moreSpace = realloc(pFormat, totFormat * sizeof(XvFormatRec)); if(!moreSpace) break; pFormat = moreSpace; @@ -538,7 +538,7 @@ xf86XVInitAdaptors( continue; } - if(!(adaptorPriv = xcalloc(1, sizeof(XvAdaptorRecPrivate)))) { + if(!(adaptorPriv = calloc(1, sizeof(XvAdaptorRecPrivate)))) { xf86XVFreeAdaptor(pa); continue; } @@ -558,7 +558,7 @@ xf86XVInitAdaptors( pa->devPriv.ptr = (pointer)adaptorPriv; - if(!(pPort = xcalloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) { + if(!(pPort = calloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) { xf86XVFreeAdaptor(pa); continue; } @@ -568,11 +568,11 @@ xf86XVInitAdaptors( if(!(pp->id = FakeClientID(0))) continue; - if(!(portPriv = xcalloc(1, sizeof(XvPortRecPrivate)))) + if(!(portPriv = calloc(1, sizeof(XvPortRecPrivate)))) continue; if(!AddResource(pp->id, PortResource, pp)) { - xfree(portPriv); + free(portPriv); continue; } @@ -608,7 +608,7 @@ xf86XVInitAdaptors( pxvs->nAdaptors = numAdaptor; pxvs->pAdaptors = pAdaptor; } else { - xfree(pAdaptor); + free(pAdaptor); return FALSE; } @@ -976,7 +976,7 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) } if(!winPriv) { - winPriv = xcalloc(1, sizeof(XF86XVWindowRec)); + winPriv = calloc(1, sizeof(XF86XVWindowRec)); if(!winPriv) return BadAlloc; winPriv->PortRec = portPriv; winPriv->next = PrivRoot; @@ -1003,7 +1003,7 @@ xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) else dixSetPrivate(&pWin->devPrivates, XF86XVWindowKey, winPriv->next); - xfree(winPriv); + free(winPriv); break; } prevPriv = winPriv; @@ -1037,7 +1037,7 @@ xf86XVDestroyWindow(WindowPtr pWin) FreeGC(WinPriv->pGC, 0); } WinPriv = WinPriv->next; - xfree(tmp); + free(tmp); } dixSetPrivate(&pWin->devPrivates, XF86XVWindowKey, NULL); @@ -1103,7 +1103,7 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) pPrev->next = WinPriv->next; tmp = WinPriv; WinPriv = WinPriv->next; - xfree(tmp); + free(tmp); continue; } break; @@ -1159,7 +1159,7 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) pPrev->next = WinPriv->next; tmp = WinPriv; WinPriv = WinPriv->next; - xfree(tmp); + free(tmp); continue; } } @@ -1208,8 +1208,8 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen) xf86XVFreeAdaptor(pa); } - xfree(pxvs->pAdaptors); - xfree(ScreenPriv); + free(pxvs->pAdaptors); + free(ScreenPriv); return TRUE; } @@ -1861,7 +1861,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) REGION_TRANSLATE(pDraw->pScreen, clipboxes, -pDraw->x, -pDraw->y); - rects = xalloc(nbox * sizeof(xRectangle)); + rects = malloc(nbox * sizeof(xRectangle)); for(i = 0; i < nbox; i++, pbox++) { rects[i].x = pbox->x1; @@ -1874,7 +1874,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) if (!pPriv) FreeGC(pGC, 0); - xfree(rects); + free(rects); } void @@ -1895,7 +1895,7 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) (void) ChangeGC(gc, GCForeground|GCSubwindowMode, pval); ValidateGC(root, gc); - rects = xalloc (nbox * sizeof(xRectangle)); + rects = malloc(nbox * sizeof(xRectangle)); for(i = 0; i < nbox; i++, pbox++) { @@ -1907,7 +1907,7 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) (*gc->ops->PolyFillRect)(root, gc, nbox, rects); - xfree (rects); + free(rects); FreeScratchGC (gc); } diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c index 39d33da08..99d6695b8 100644 --- a/hw/xfree86/common/xf86xvmc.c +++ b/hw/xfree86/common/xf86xvmc.c @@ -149,8 +149,8 @@ xf86XvMCCloseScreen (int i, ScreenPtr pScreen) pScreen->CloseScreen = pScreenPriv->CloseScreen; - xfree(pScreenPriv->dixinfo); - xfree(pScreenPriv); + free(pScreenPriv->dixinfo); + free(pScreenPriv); return (*pScreen->CloseScreen)(i, pScreen); } @@ -169,11 +169,11 @@ Bool xf86XvMCScreenInit( if(!XvMCScreenInitProc) return FALSE; - if(!(pAdapt = xalloc(sizeof(XvMCAdaptorRec) * num_adaptors))) + if(!(pAdapt = malloc(sizeof(XvMCAdaptorRec) * num_adaptors))) return FALSE; - if(!(pScreenPriv = xalloc(sizeof(xf86XvMCScreenRec)))) { - xfree(pAdapt); + if(!(pScreenPriv = malloc(sizeof(xf86XvMCScreenRec)))) { + free(pAdapt); return FALSE; } @@ -196,7 +196,7 @@ Bool xf86XvMCScreenInit( } if(!pAdapt[i].xv_adaptor) { /* no adaptor by that name */ - xfree(pAdapt); + free(pAdapt); return FALSE; } pAdapt[i].num_surfaces = (*adaptors)->num_surfaces; @@ -220,10 +220,10 @@ Bool xf86XvMCScreenInit( XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec (void) { - return xcalloc(1, sizeof(XF86MCAdaptorRec)); + return calloc(1, sizeof(XF86MCAdaptorRec)); } void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor) { - xfree(adaptor); + free(adaptor); } diff --git a/hw/xfree86/common/xisb.c b/hw/xfree86/common/xisb.c index 1cb9e4854..4455efd1d 100644 --- a/hw/xfree86/common/xisb.c +++ b/hw/xfree86/common/xisb.c @@ -67,13 +67,13 @@ XisbNew (int fd, ssize_t size) { XISBuffer *b; - b = xalloc (sizeof (XISBuffer)); + b = malloc(sizeof (XISBuffer)); if (!b) return (NULL); - b->buf = xalloc ((sizeof (unsigned char) * size)); + b->buf = malloc((sizeof (unsigned char) * size)); if (!b->buf) { - xfree (b); + free(b); return (NULL); } @@ -89,8 +89,8 @@ XisbNew (int fd, ssize_t size) void XisbFree (XISBuffer *b) { - xfree (b->buf); - xfree (b); + free(b->buf); + free(b); } int diff --git a/hw/xfree86/ddc/ddc.c b/hw/xfree86/ddc/ddc.c index 6fad9fbbc..e64e2f369 100644 --- a/hw/xfree86/ddc/ddc.c +++ b/hw/xfree86/ddc/ddc.c @@ -86,7 +86,7 @@ resort(unsigned char *s_block) unsigned char tmp; s_end = s_block + EDID1_LEN; - d_new = xalloc(EDID1_LEN); + d_new = malloc(EDID1_LEN); if (!d_new) return NULL; d_end = d_new + EDID1_LEN; @@ -97,7 +97,7 @@ resort(unsigned char *s_block) *d_ptr = tmp; if (s_ptr == s_end) s_ptr = s_block; } - xfree(s_block); + free(s_block); return (d_new); } @@ -134,7 +134,7 @@ GetEDID_DDC1(unsigned int *s_ptr) if (s_start==-1) return NULL; s_end = s_ptr + NUM; s_pos = s_ptr + s_start; - d_block=xalloc(EDID1_LEN); + d_block=malloc(EDID1_LEN); if (!d_block) return NULL; d_pos = d_block; for (i=0;i<EDID1_LEN;i++) { @@ -148,7 +148,7 @@ GetEDID_DDC1(unsigned int *s_ptr) s_pos++; if (s_pos == s_end) s_pos=s_ptr; d_pos++; } - xfree(s_ptr); + free(s_ptr); if (d_block && DDC_checksum(d_block,EDID1_LEN)) return NULL; return (resort(d_block)); } @@ -161,7 +161,7 @@ FetchEDID_DDC1(register ScrnInfoPtr pScrn, int count = NUM; unsigned int *ptr, *xp; - ptr=xp=xalloc(sizeof(int)*NUM); + ptr=xp=malloc(sizeof(int)*NUM); if (!ptr) return NULL; do { @@ -251,7 +251,7 @@ xf86DoEDID_DDC1( xf86GetOptValBool(options, DDCOPT_NODDC, &noddc); xf86GetOptValBool(options, DDCOPT_NODDC1, &noddc1); - xfree(options); + free(options); if (noddc || noddc1) return NULL; @@ -392,7 +392,7 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) Bool noddc = FALSE, noddc2 = FALSE; OptionInfoPtr options; - options = xalloc(sizeof(DDCOptions)); + options = malloc(sizeof(DDCOptions)); if (!options) return NULL; memcpy(options, DDCOptions, sizeof(DDCOptions)); @@ -400,7 +400,7 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) xf86GetOptValBool(options, DDCOPT_NODDC, &noddc); xf86GetOptValBool(options, DDCOPT_NODDC2, &noddc2); - xfree(options); + free(options); if (noddc || noddc2) return NULL; @@ -408,7 +408,7 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) if (!(dev = DDC2Init(scrnIndex, pBus))) return NULL; - EDID_block = xcalloc(1, EDID1_LEN); + EDID_block = calloc(1, EDID1_LEN); if (!EDID_block) return NULL; @@ -416,7 +416,7 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) int i, n = EDID_block[0x7e]; if (complete && n) { - EDID_block = xrealloc(EDID_block, EDID1_LEN * (1+n)); + EDID_block = realloc(EDID_block, EDID1_LEN * (1+n)); for (i = 0; i < n; i++) DDC2Read(dev, i+1, EDID_block + (EDID1_LEN * (1+i))); @@ -477,7 +477,7 @@ xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus) Bool noddc = FALSE, noddc2 = FALSE; OptionInfoPtr options; - options = xalloc(sizeof(DDCOptions)); + options = malloc(sizeof(DDCOptions)); if (!options) return NULL; memcpy(options, DDCOptions, sizeof(DDCOptions)); @@ -485,7 +485,7 @@ xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus) xf86GetOptValBool(options, DDCOPT_NODDC, &noddc); xf86GetOptValBool(options, DDCOPT_NODDC2, &noddc2); - xfree(options); + free(options); if (noddc || noddc2) return NULL; @@ -494,7 +494,7 @@ xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus) return NULL; if ((did = DDC2ReadDisplayID())) { - tmp = xcalloc(1, sizeof(*tmp)); + tmp = calloc(1, sizeof(*tmp)); if (!tmp) return NULL; diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c index 329a63964..d2d90ba2d 100644 --- a/hw/xfree86/ddc/ddcProperty.c +++ b/hw/xfree86/ddc/ddcProperty.c @@ -42,7 +42,7 @@ edidMakeAtom(int i, const char *name, CARD8 *data, int size) Atom atom; unsigned char *atom_data; - if (!(atom_data = xalloc(size*sizeof(CARD8)))) + if (!(atom_data = malloc(size*sizeof(CARD8)))) return; atom = MakeAtom(name, strlen(name), TRUE); diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c index f3e593aec..d63e25d23 100644 --- a/hw/xfree86/ddc/interpret_edid.c +++ b/hw/xfree86/ddc/interpret_edid.c @@ -186,7 +186,7 @@ xf86InterpretEDID(int scrnIndex, Uchar *block) return (m); error: - xfree(m); + free(m); return NULL; } diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c index 7d2086802..f4e922cd0 100644 --- a/hw/xfree86/dixmods/extmod/modinit.c +++ b/hw/xfree86/dixmods/extmod/modinit.c @@ -146,13 +146,13 @@ extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin) for (i = 0; extensionModules[i].name != NULL; i++) { if (opts) { char *s; - s = (char *)xalloc(strlen(extensionModules[i].name) + 5); + s = (char *)malloc(strlen(extensionModules[i].name) + 5); if (s) { pointer o; strcpy(s, "omit"); strcat(s, extensionModules[i].name); o = xf86FindOption(opts, s); - xfree(s); + free(s); if (o) { xf86MarkOptionUsed(o); continue; diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c index 038551467..711a9cb75 100644 --- a/hw/xfree86/dixmods/extmod/xf86dga2.c +++ b/hw/xfree86/dixmods/extmod/xf86dga2.c @@ -218,7 +218,7 @@ ProcXDGAQueryModes(ClientPtr client) return (client->noClientException); } - if(!(mode = (XDGAModePtr)xalloc(num * sizeof(XDGAModeRec)))) + if(!(mode = (XDGAModePtr)malloc(num * sizeof(XDGAModeRec)))) return BadAlloc; for(i = 0; i < num; i++) @@ -267,7 +267,7 @@ ProcXDGAQueryModes(ClientPtr client) WriteToClient(client, size, mode[i].name); } - xfree(mode); + free(mode); return (client->noClientException); } @@ -583,7 +583,7 @@ ProcXDGASetClientVersion(ClientPtr client) REQUEST_SIZE_MATCH(xXDGASetClientVersionReq); if ((pPriv = DGA_GETPRIV(client)) == NULL) { - pPriv = xalloc(sizeof(DGAPrivRec)); + pPriv = malloc(sizeof(DGAPrivRec)); /* XXX Need to look into freeing this */ if (!pPriv) return BadAlloc; diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index a304a42d4..5bdd88c0a 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -150,7 +150,7 @@ static DevPrivateKey ScreenPrivateKey = &ScreenPrivateKeyIndex; dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v) #define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = GetScreenPrivate(s) -#define New(t) (xalloc (sizeof (t))) +#define New(t) (malloc(sizeof (t))) #endif #ifdef DEBUG @@ -229,7 +229,7 @@ CheckScreenPrivate (pScreen) if (!pPriv) return; if (!pPriv->events && !pPriv->hasWindow) { - xfree (pPriv); + free(pPriv); SetScreenPrivate (pScreen, NULL); } } @@ -283,7 +283,7 @@ setEventMask (ScreenPtr pScreen, ClientPtr client, unsigned long mask) break; if (mask == 0) { *pPrev = pEv->next; - xfree (pEv); + free(pEv); CheckScreenPrivate (pScreen); } else { if (!pEv) { @@ -319,7 +319,7 @@ XF86VidModeFreeEvents(pointer value, XID id) if (!pEv) return TRUE; *pPrev = pEv->next; - xfree (pEv); + free(pEv); CheckScreenPrivate (pScreen); return TRUE; } @@ -738,20 +738,20 @@ ProcXF86VidModeAddModeLine(ClientPtr client) break; case MODE_HSYNC: case MODE_H_ILLEGAL: - xfree(mode); + free(mode); return VidModeErrorBase + XF86VidModeBadHTimings; case MODE_VSYNC: case MODE_V_ILLEGAL: - xfree(mode); + free(mode); return VidModeErrorBase + XF86VidModeBadVTimings; default: - xfree(mode); + free(mode); return VidModeErrorBase + XF86VidModeModeUnsuitable; } /* Check that the driver is happy with the mode */ if (VidModeCheckModeForDriver(stuff->screen, mode) != MODE_OK) { - xfree(mode); + free(mode); return VidModeErrorBase + XF86VidModeModeUnsuitable; } @@ -968,23 +968,23 @@ ProcXF86VidModeModModeLine(ClientPtr client) break; case MODE_HSYNC: case MODE_H_ILLEGAL: - xfree(modetmp); + free(modetmp); return VidModeErrorBase + XF86VidModeBadHTimings; case MODE_VSYNC: case MODE_V_ILLEGAL: - xfree(modetmp); + free(modetmp); return VidModeErrorBase + XF86VidModeBadVTimings; default: - xfree(modetmp); + free(modetmp); return VidModeErrorBase + XF86VidModeModeUnsuitable; } /* Check that the driver is happy with the mode */ if (VidModeCheckModeForDriver(stuff->screen, modetmp) != MODE_OK) { - xfree(modetmp); + free(modetmp); return VidModeErrorBase + XF86VidModeModeUnsuitable; } - xfree(modetmp); + free(modetmp); VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay); VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart); @@ -1104,7 +1104,7 @@ ProcXF86VidModeValidateModeLine(ClientPtr client) status_reply: if(modetmp) - xfree(modetmp); + free(modetmp); rep.type = X_Reply; rep.length = bytes_to_int32(SIZEOF(xXF86VidModeValidateModeLineReply) @@ -1296,14 +1296,14 @@ ProcXF86VidModeGetMonitor(ClientPtr client) rep.sequenceNumber = client->sequence; rep.nhsync = nHsync; rep.nvsync = nVrefresh; - hsyncdata = xalloc(nHsync * sizeof(CARD32)); + hsyncdata = malloc(nHsync * sizeof(CARD32)); if (!hsyncdata) { return BadAlloc; } - vsyncdata = xalloc(nVrefresh * sizeof(CARD32)); + vsyncdata = malloc(nVrefresh * sizeof(CARD32)); if (!vsyncdata) { - xfree(hsyncdata); + free(hsyncdata); return BadAlloc; } @@ -1336,8 +1336,8 @@ ProcXF86VidModeGetMonitor(ClientPtr client) if (rep.modelLength) WriteToClient(client, rep.modelLength, (char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr); - xfree(hsyncdata); - xfree(vsyncdata); + free(hsyncdata); + free(vsyncdata); return (client->noClientException); } @@ -1421,11 +1421,11 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) rep.flags = 0; if (!ClockProg) { - Clocks = xalloc(numClocks * sizeof(int)); + Clocks = malloc(numClocks * sizeof(int)); if (!Clocks) return BadValue; if (!VidModeGetClocks(stuff->screen, Clocks)) { - xfree(Clocks); + free(Clocks); return BadValue; } } @@ -1452,7 +1452,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) } } - xfree(Clocks); + free(Clocks); return (client->noClientException); } @@ -1557,12 +1557,12 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) if(stuff->size) { ramplen = length * 3 * sizeof(CARD16); - if (!(ramp = xalloc(ramplen))) + if (!(ramp = malloc(ramplen))) return BadAlloc; if (!VidModeGetGammaRamp(stuff->screen, stuff->size, ramp, ramp + length, ramp + (length * 2))) { - xfree(ramp); + free(ramp); return BadValue; } } @@ -1581,7 +1581,7 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) if(stuff->size) { WriteToClient(client, ramplen, (char*)ramp); - xfree(ramp); + free(ramp); } return (client->noClientException); @@ -1657,7 +1657,7 @@ ProcXF86VidModeSetClientVersion(ClientPtr client) REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq); if ((pPriv = VM_GETPRIV(client)) == NULL) { - pPriv = xalloc(sizeof(VidModePrivRec)); + pPriv = malloc(sizeof(VidModePrivRec)); if (!pPriv) return BadAlloc; VM_SETPRIV(client, pPriv); diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 836967c73..77f7fe295 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -357,7 +357,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) if (DRIGeneration != serverGeneration) DRIGeneration = serverGeneration; - pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec)); + pDRIPriv = (DRIScreenPrivPtr) calloc(1, sizeof(DRIScreenPrivRec)); if (!pDRIPriv) { dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, NULL); return FALSE; @@ -534,7 +534,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) /* allocate memory for hidden context store */ pDRIPriv->hiddenContextStore - = (void *)xcalloc(1, pDRIInfo->contextSize); + = (void *)calloc(1, pDRIInfo->contextSize); if (!pDRIPriv->hiddenContextStore) { DRIDrvMsg(pScreen->myNum, X_ERROR, "failed to allocate hidden context\n"); @@ -544,11 +544,11 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) /* allocate memory for partial 3D context store */ pDRIPriv->partial3DContextStore - = (void *)xcalloc(1, pDRIInfo->contextSize); + = (void *)calloc(1, pDRIInfo->contextSize); if (!pDRIPriv->partial3DContextStore) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[DRI] failed to allocate partial 3D context\n"); - xfree(pDRIPriv->hiddenContextStore); + free(pDRIPriv->hiddenContextStore); DRIDestroyContextPriv(pDRIContextPriv); return FALSE; } @@ -574,9 +574,9 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) DRIDrvMsg(pScreen->myNum, X_ERROR, "[drm] failed to setup DRM signal handler\n"); if (pDRIPriv->hiddenContextStore) - xfree(pDRIPriv->hiddenContextStore); + free(pDRIPriv->hiddenContextStore); if (pDRIPriv->partial3DContextStore) - xfree(pDRIPriv->partial3DContextStore); + free(pDRIPriv->partial3DContextStore); DRIDestroyContextPriv(pDRIContextPriv); return FALSE; } else { @@ -757,7 +757,7 @@ DRICloseScreen(ScreenPtr pScreen) } } - xfree(pDRIPriv); + free(pDRIPriv); dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, NULL); } } @@ -907,7 +907,7 @@ DRICreateContextPrivFromHandle(ScreenPtr pScreen, contextPrivSize = sizeof(DRIContextPrivRec) + pDRIPriv->pDriverInfo->contextSize; - if (!(pDRIContextPriv = xcalloc(1, contextPrivSize))) { + if (!(pDRIContextPriv = calloc(1, contextPrivSize))) { return NULL; } pDRIContextPriv->pContextStore = (void *)(pDRIContextPriv + 1); @@ -965,7 +965,7 @@ DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv) while in this thread, but buffers can be dispatched asynchronously. */ drmDelContextTag(pDRIPriv->drmFD, pDRIContextPriv->hwContext); - xfree(pDRIContextPriv); + free(pDRIContextPriv); return TRUE; } @@ -1182,7 +1182,7 @@ DRIDriverClipNotify(ScreenPtr pScreen) DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv->pDriverInfo->ClipNotify) { - WindowPtr *pDRIWindows = xcalloc(sizeof(WindowPtr), pDRIPriv->nrWindows); + WindowPtr *pDRIWindows = calloc(sizeof(WindowPtr), pDRIPriv->nrWindows); DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; if (pDRIPriv->nrWindows > 0) { @@ -1193,7 +1193,7 @@ DRIDriverClipNotify(ScreenPtr pScreen) pDRIInfo->ClipNotify(pScreen, pDRIWindows, pDRIPriv->nrWindows); - xfree(pDRIWindows); + free(pDRIWindows); } } @@ -1254,14 +1254,14 @@ DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable, } else { /* allocate a DRI Window Private record */ - if (!(pDRIDrawablePriv = xalloc(sizeof(DRIDrawablePrivRec)))) { + if (!(pDRIDrawablePriv = malloc(sizeof(DRIDrawablePrivRec)))) { return FALSE; } /* Only create a drm_drawable_t once */ if (drmCreateDrawable(pDRIPriv->drmFD, &pDRIDrawablePriv->hwDrawable)) { - xfree(pDRIDrawablePriv); + free(pDRIDrawablePriv); return FALSE; } @@ -1330,7 +1330,7 @@ DRIDrawablePrivDestroy(WindowPtr pWin) drmDestroyDrawable(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable); - xfree(pDRIDrawablePriv); + free(pDRIDrawablePriv); dixSetPrivate(&pWin->devPrivates, DRIWindowPrivKey, NULL); } @@ -1587,7 +1587,7 @@ DRIGetDeviceInfo(ScreenPtr pScreen, DRIInfoPtr DRICreateInfoRec(void) { - DRIInfoPtr inforec = (DRIInfoPtr)xcalloc(1, sizeof(DRIInfoRec)); + DRIInfoPtr inforec = (DRIInfoPtr)calloc(1, sizeof(DRIInfoRec)); if (!inforec) return NULL; /* Initialize defaults */ @@ -1613,8 +1613,8 @@ DRICreateInfoRec(void) void DRIDestroyInfoRec(DRIInfoPtr DRIInfo) { - if (DRIInfo->busIdString) xfree(DRIInfo->busIdString); - xfree((char*)DRIInfo); + if (DRIInfo->busIdString) free(DRIInfo->busIdString); + free((char*)DRIInfo); } @@ -2425,7 +2425,7 @@ DRICreatePCIBusID(const struct pci_device * dev) { char *busID; - busID = xalloc(20); + busID = malloc(20); if (busID == NULL) return NULL; diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index 78003991b..4e5a15fca 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -490,7 +490,7 @@ ProcXF86DRIGetDrawableInfo( if (rep.numClipRects) { /* Clip cliprects to screen dimensions (redirected windows) */ - pClippedRects = xalloc(rep.numClipRects * sizeof(drm_clip_rect_t)); + pClippedRects = malloc(rep.numClipRects * sizeof(drm_clip_rect_t)); if (pClippedRects) { ScreenPtr pScreen = screenInfo.screens[stuff->screen]; @@ -524,7 +524,7 @@ ProcXF86DRIGetDrawableInfo( WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numClipRects, (char *)pClippedRects); - xfree(pClippedRects); + free(pClippedRects); } if (rep.numBackClipRects) { diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 143163d8f..21f811862 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -128,7 +128,7 @@ DRI2AllocateDrawable(DrawablePtr pDraw) WindowPtr pWin; PixmapPtr pPixmap; - pPriv = xalloc(sizeof *pPriv); + pPriv = malloc(sizeof *pPriv); if (pPriv == NULL) return NULL; @@ -270,10 +270,10 @@ static int DRI2DrawableGone(pointer p, XID id) for (i = 0; i < pPriv->bufferCount; i++) (*ds->DestroyBuffer)(pDraw, pPriv->buffers[i]); - xfree(pPriv->buffers); + free(pPriv->buffers); } - xfree(pPriv); + free(pPriv); return Success; } @@ -344,7 +344,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, dimensions_match = (pDraw->width == pPriv->width) && (pDraw->height == pPriv->height); - buffers = xalloc((count + 1) * sizeof(buffers[0])); + buffers = malloc((count + 1) * sizeof(buffers[0])); for (i = 0; i < count; i++) { const unsigned attachment = *(attachments++); @@ -408,7 +408,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, } } - xfree(pPriv->buffers); + free(pPriv->buffers); } pPriv->buffers = buffers; @@ -936,7 +936,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) return FALSE; } - ds = xcalloc(1, sizeof *ds); + ds = calloc(1, sizeof *ds); if (!ds) return FALSE; @@ -965,17 +965,17 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) if (info->version == 3 || info->numDrivers == 0) { /* Driver too old: use the old-style driverName field */ ds->numDrivers = 1; - ds->driverNames = xalloc(sizeof(*ds->driverNames)); + ds->driverNames = malloc(sizeof(*ds->driverNames)); if (!ds->driverNames) { - xfree(ds); + free(ds); return FALSE; } ds->driverNames[0] = info->driverName; } else { ds->numDrivers = info->numDrivers; - ds->driverNames = xalloc(info->numDrivers * sizeof(*ds->driverNames)); + ds->driverNames = malloc(info->numDrivers * sizeof(*ds->driverNames)); if (!ds->driverNames) { - xfree(ds); + free(ds); return FALSE; } memcpy(ds->driverNames, info->driverNames, @@ -1000,8 +1000,8 @@ DRI2CloseScreen(ScreenPtr pScreen) { DRI2ScreenPtr ds = DRI2GetScreen(pScreen); - xfree(ds->driverNames); - xfree(ds); + free(ds->driverNames); + free(ds); dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, NULL); } diff --git a/hw/xfree86/exa/examodule.c b/hw/xfree86/exa/examodule.c index bcb6a405c..315ba4af9 100644 --- a/hw/xfree86/exa/examodule.c +++ b/hw/xfree86/exa/examodule.c @@ -79,8 +79,8 @@ exaXorgCloseScreen (int i, ScreenPtr pScreen) pScrn->EnableDisableFBAccess = pScreenPriv->SavedEnableDisableFBAccess; - xfree (pScreenPriv->options); - xfree (pScreenPriv); + free(pScreenPriv->options); + free(pScreenPriv); return pScreen->CloseScreen (i, pScreen); } @@ -114,7 +114,7 @@ exaDDXDriverInit(ScreenPtr pScreen) ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; ExaXorgScreenPrivPtr pScreenPriv; - pScreenPriv = xcalloc (1, sizeof(ExaXorgScreenPrivRec)); + pScreenPriv = calloc(1, sizeof(ExaXorgScreenPrivRec)); if (pScreenPriv == NULL) return; diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index 880f0a20e..f1609083e 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c @@ -129,7 +129,7 @@ fbdevHWFreeRec(ScrnInfoPtr pScrn) return; if (FBDEVHWPTR(pScrn) == NULL) return; - xfree(FBDEVHWPTR(pScrn)); + free(FBDEVHWPTR(pScrn)); FBDEVHWPTRLVAL(pScrn) = NULL; } diff --git a/hw/xfree86/i2c/bt829.c b/hw/xfree86/i2c/bt829.c index 3963ecf47..024e76fce 100644 --- a/hw/xfree86/i2c/bt829.c +++ b/hw/xfree86/i2c/bt829.c @@ -461,7 +461,7 @@ BT829Ptr bt829_Detect(I2CBusPtr b, I2CSlaveAddr addr) BT829Ptr bt; I2CByte a; - bt = xcalloc(1, sizeof(BT829Rec)); + bt = calloc(1, sizeof(BT829Rec)); if(bt == NULL) return NULL; bt->d.DevName = strdup("BT829 video decoder"); bt->d.SlaveAddr = addr; @@ -482,7 +482,7 @@ BT829Ptr bt829_Detect(I2CBusPtr b, I2CSlaveAddr addr) bt->id = btread(bt,IDCODE); free(bt->d.DevName); - bt->d.DevName = xcalloc(200, sizeof(char)); + bt->d.DevName = calloc(200, sizeof(char)); switch(BTVERSION){ case BT815: sprintf(bt->d.DevName, "bt815a video decoder, revision %d",bt->id & 0xf); diff --git a/hw/xfree86/i2c/fi1236.c b/hw/xfree86/i2c/fi1236.c index 61224eaa5..8337c900e 100644 --- a/hw/xfree86/i2c/fi1236.c +++ b/hw/xfree86/i2c/fi1236.c @@ -46,7 +46,7 @@ FI1236Ptr Detect_FI1236(I2CBusPtr b, I2CSlaveAddr addr) FI1236Ptr f; I2CByte a; - f = xcalloc(1,sizeof(FI1236Rec)); + f = calloc(1,sizeof(FI1236Rec)); if(f == NULL) return NULL; f->d.DevName = strdup("FI12xx Tuner"); f->d.SlaveAddr = addr; diff --git a/hw/xfree86/i2c/msp3430.c b/hw/xfree86/i2c/msp3430.c index 4bd3a7187..2f244e4c2 100644 --- a/hw/xfree86/i2c/msp3430.c +++ b/hw/xfree86/i2c/msp3430.c @@ -136,7 +136,7 @@ MSP3430Ptr DetectMSP3430(I2CBusPtr b, I2CSlaveAddr addr) CARD8 hardware_version, major_revision, product_code, rom_version; Bool supported; - m = xcalloc(1,sizeof(MSP3430Rec)); + m = calloc(1,sizeof(MSP3430Rec)); if(m == NULL)return NULL; m->d.DevName = strdup("MSP34xx"); m->d.SlaveAddr = addr; @@ -149,8 +149,8 @@ MSP3430Ptr DetectMSP3430(I2CBusPtr b, I2CSlaveAddr addr) if(!I2C_WriteRead(&(m->d), NULL, 0, &a, 1)) { - xfree(m->d.DevName); - xfree(m); + free(m->d.DevName); + free(m); return NULL; } @@ -235,14 +235,14 @@ MSP3430Ptr DetectMSP3430(I2CBusPtr b, I2CSlaveAddr addr) MSP_getProductName(m->chip_id), supported?"":" (unsupported)", rom_version, m->chip_id); if (!supported) { - xfree(m->d.DevName); - xfree(m); - return NULL; - } + free(m->d.DevName); + free(m); + return NULL; + } if(!I2CDevInit(&(m->d))) { - xfree(m->d.DevName); - xfree(m); + free(m->d.DevName); + free(m); return NULL; } diff --git a/hw/xfree86/i2c/tda8425.c b/hw/xfree86/i2c/tda8425.c index 7631a0863..598f88b59 100644 --- a/hw/xfree86/i2c/tda8425.c +++ b/hw/xfree86/i2c/tda8425.c @@ -17,7 +17,7 @@ TDA8425Ptr Detect_tda8425(I2CBusPtr b, I2CSlaveAddr addr, Bool force) { TDA8425Ptr t; - t = xcalloc(1, sizeof(TDA8425Rec)); + t = calloc(1, sizeof(TDA8425Rec)); if(t == NULL) return NULL; t->d.DevName = "TDA8425 BTSC Stereo Audio Processor"; t->d.SlaveAddr = addr; @@ -30,14 +30,14 @@ TDA8425Ptr Detect_tda8425(I2CBusPtr b, I2CSlaveAddr addr, Bool force) if(!force && !I2CProbeAddress(b, addr)) { - xfree(t); + free(t); return NULL; } /* set default parameters */ if(!I2CDevInit(&(t->d))) { - xfree(t); + free(t); return NULL; } diff --git a/hw/xfree86/i2c/tda9850.c b/hw/xfree86/i2c/tda9850.c index 5b0c581ed..24323cb38 100644 --- a/hw/xfree86/i2c/tda9850.c +++ b/hw/xfree86/i2c/tda9850.c @@ -18,7 +18,7 @@ TDA9850Ptr Detect_tda9850(I2CBusPtr b, I2CSlaveAddr addr) TDA9850Ptr t; I2CByte a; - t = xcalloc(1, sizeof(TDA9850Rec)); + t = calloc(1, sizeof(TDA9850Rec)); if(t == NULL) return NULL; switch(addr) { @@ -39,14 +39,14 @@ TDA9850Ptr Detect_tda9850(I2CBusPtr b, I2CSlaveAddr addr) if(!I2C_WriteRead(&(t->d), NULL, 0, &a, 1)) { - xfree(t); + free(t); return NULL; } /* set default parameters */ if(!I2CDevInit(&(t->d))) { - xfree(t); + free(t); return NULL; } diff --git a/hw/xfree86/i2c/tda9885.c b/hw/xfree86/i2c/tda9885.c index 4147dfdd7..9c303b42b 100644 --- a/hw/xfree86/i2c/tda9885.c +++ b/hw/xfree86/i2c/tda9885.c @@ -13,7 +13,7 @@ TDA9885Ptr Detect_tda9885(I2CBusPtr b, I2CSlaveAddr addr) TDA9885Ptr t; I2CByte a; - t = xcalloc(1, sizeof(TDA9885Rec)); + t = calloc(1, sizeof(TDA9885Rec)); if(t == NULL) return NULL; switch(addr) { @@ -37,14 +37,14 @@ TDA9885Ptr Detect_tda9885(I2CBusPtr b, I2CSlaveAddr addr) if(!I2C_WriteRead(&(t->d), NULL, 0, &a, 1)) { - xfree(t); + free(t); return NULL; } /* set default parameters */ if(!I2CDevInit(&(t->d))) { - xfree(t); + free(t); return NULL; } diff --git a/hw/xfree86/i2c/uda1380.c b/hw/xfree86/i2c/uda1380.c index defda3cdc..c7b1cda66 100644 --- a/hw/xfree86/i2c/uda1380.c +++ b/hw/xfree86/i2c/uda1380.c @@ -36,7 +36,7 @@ UDA1380Ptr Detect_uda1380(I2CBusPtr b, I2CSlaveAddr addr) UDA1380Ptr t; I2CByte a; - t = xcalloc(1, sizeof(UDA1380Rec)); + t = calloc(1, sizeof(UDA1380Rec)); if(t == NULL) return NULL; switch(addr) { @@ -58,14 +58,14 @@ UDA1380Ptr Detect_uda1380(I2CBusPtr b, I2CSlaveAddr addr) if(!I2C_WriteRead(&(t->d), NULL, 0, &a, 1)) { - xfree(t); + free(t); return NULL; } /* set default parameters */ if(!I2CDevInit(&(t->d))) { - xfree(t); + free(t); return NULL; } diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c index 59832d6f9..e0223f661 100644 --- a/hw/xfree86/i2c/xf86i2c.c +++ b/hw/xfree86/i2c/xf86i2c.c @@ -598,7 +598,7 @@ xf86I2CWriteVec(I2CDevPtr d, I2CByte *vec, int nValues) I2CDevPtr xf86CreateI2CDevRec(void) { - return xcalloc(1, sizeof(I2CDevRec)); + return calloc(1, sizeof(I2CDevRec)); } /* Unlink an I2C device. If you got the I2CDevRec from xf86CreateI2CDevRec @@ -623,7 +623,7 @@ xf86DestroyI2CDevRec(I2CDevPtr d, Bool unalloc) "I2C device \"%s:%s\" removed.\n", d->pI2CBus->BusName, d->DevName); - if (unalloc) xfree(d); + if (unalloc) free(d); } } @@ -695,7 +695,7 @@ xf86CreateI2CBusRec(void) { I2CBusPtr b; - b = (I2CBusPtr) xcalloc(1, sizeof(I2CBusRec)); + b = (I2CBusPtr) calloc(1, sizeof(I2CBusRec)); if (b != NULL) { b->scrnIndex = -1; @@ -751,7 +751,7 @@ xf86DestroyI2CBusRec(I2CBusPtr b, Bool unalloc, Bool devs_too) xf86DrvMsg(b->scrnIndex, X_INFO, "I2C bus \"%s\" removed.\n", b->BusName); - if (unalloc) xfree(b); + if (unalloc) free(b); } } diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c index 9d39e99b0..fe8bb69ac 100644 --- a/hw/xfree86/int10/generic.c +++ b/hw/xfree86/int10/generic.c @@ -137,7 +137,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) options = xf86HandleInt10Options(xf86Screens[screen],entityIndex); if (int10skip(options)) { - xfree(options); + free(options); return NULL; } @@ -285,17 +285,17 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) xf86ExecX86int10(pInt); UnlockLegacyVGA(pInt, &vga); #endif - xfree(options); + free(options); return pInt; error1: - xfree(base); + free(base); UnmapVRam(pInt); - xfree(INTPriv(pInt)->alloc); - xfree(pInt->private); + free(INTPriv(pInt)->alloc); + free(pInt->private); error0: - xfree(pInt); - xfree(options); + free(pInt); + free(options); return NULL; } @@ -339,11 +339,11 @@ xf86FreeInt10(xf86Int10InfoPtr pInt) #endif if (Int10Current == pInt) Int10Current = NULL; - xfree(INTPriv(pInt)->base); + free(INTPriv(pInt)->base); UnmapVRam(pInt); - xfree(INTPriv(pInt)->alloc); - xfree(pInt->private); - xfree(pInt); + free(INTPriv(pInt)->alloc); + free(pInt->private); + free(pInt); } void * diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c index 6ba647f89..8f47afe2b 100644 --- a/hw/xfree86/int10/helper_exec.c +++ b/hw/xfree86/int10/helper_exec.c @@ -711,7 +711,7 @@ xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save) if (pInt->BIOSScratch) { for (i = 0; i < BIOS_SCRATCH_LEN; i++) *(base + i) = *(pInt->BIOSScratch + i); - xfree(pInt->BIOSScratch); + free(pInt->BIOSScratch); pInt->BIOSScratch = NULL; } } diff --git a/hw/xfree86/int10/helper_mem.c b/hw/xfree86/int10/helper_mem.c index 6f6ecc2b3..3f206c2e3 100644 --- a/hw/xfree86/int10/helper_mem.c +++ b/hw/xfree86/int10/helper_mem.c @@ -208,14 +208,14 @@ xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex) configOptions = pEnt->device->options; if (configOptions) { - if (!(options = (OptionInfoPtr) xalloc(sizeof(INT10Options)))) + if (!(options = (OptionInfoPtr) malloc(sizeof(INT10Options)))) return NULL; (void)memcpy(options, INT10Options, sizeof(INT10Options)); xf86ProcessOptions(pScrn->scrnIndex, configOptions, options); } } - xfree(pEnt); + free(pEnt); return options; } @@ -276,7 +276,7 @@ xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt) EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex); location_type = pEnt->location.type; - xfree(pEnt); + free(pEnt); return location_type; } diff --git a/hw/xfree86/loader/loadext.c b/hw/xfree86/loader/loadext.c index 29cdaf1ac..39a92c8bc 100644 --- a/hw/xfree86/loader/loadext.c +++ b/hw/xfree86/loader/loadext.c @@ -54,7 +54,7 @@ NewExtensionModule(void) numExtensionModules = 0; n = numExtensionModules + 1; - ExtensionModuleList = xrealloc(ExtensionModuleList, + ExtensionModuleList = realloc(ExtensionModuleList, (n + 1) * sizeof(ExtensionModule)); if (ExtensionModuleList == NULL) { ExtensionModuleList = save; @@ -268,7 +268,7 @@ free_nodes(NODE * nodelist) for (n = nodelist; n;) { nextnode = n->n_next; - xfree(n); + free(n); n = nextnode; } } @@ -379,9 +379,9 @@ tsort(void) ErrorF("tsort: internal error -- could not find cycle"); } if (cycle_buf) - xfree(cycle_buf); + free(cycle_buf); if (longest_cycle) - xfree(longest_cycle); + free(longest_cycle); if (graph) free_nodes(graph); } @@ -433,7 +433,7 @@ LoaderSortExtensions(void) if (graph) free_nodes(graph); newList[i].name = NULL; - xfree(ExtensionModuleList); + free(ExtensionModuleList); ExtensionModuleList = newList; #ifdef DEBUG for (i = 0; ExtensionModuleList[i].name; i++) diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index 5b175a546..871bfdac5 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -104,9 +104,9 @@ FreeStringList(char **paths) return; for (p = paths; *p; p++) - xfree(*p); + free(*p); - xfree(paths); + free(paths); } static char **defaultPathList = NULL; @@ -147,19 +147,19 @@ InitPathList(const char *path) if (addslash) len++; save = list; - list = xrealloc(list, (n + 2) * sizeof(char *)); + list = realloc(list, (n + 2) * sizeof(char *)); if (!list) { if (save) { save[n] = NULL; FreeStringList(save); } - xfree(fullpath); + free(fullpath); return NULL; } - list[n] = xalloc(len + 1); + list[n] = malloc(len + 1); if (!list[n]) { FreeStringList(list); - xfree(fullpath); + free(fullpath); return NULL; } strcpy(list[n], elem); @@ -173,7 +173,7 @@ InitPathList(const char *path) } if (list) list[n] = NULL; - xfree(fullpath); + free(fullpath); return list; } @@ -244,7 +244,7 @@ InitPatterns(const char **patternlist) for (i = 0, s = patternlist; *s; i++, s++) if (*s == DEFAULT_LIST) i += sizeof(stdPatterns) / sizeof(stdPatterns[0]) - 1 - 1; - patterns = xalloc((i + 1) * sizeof(PatternRec)); + patterns = malloc((i + 1) * sizeof(PatternRec)); if (!patterns) { return NULL; } @@ -274,7 +274,7 @@ static void FreePatterns(PatternPtr patterns) { if (patterns && patterns != stdPatterns) - xfree(patterns); + free(patterns); } static const char ** @@ -290,7 +290,7 @@ InitSubdirs(const char **subdirlist) Bool indefault; if (subdirlist == NULL) { - subdirlist = tmp_subdirlist = xalloc(2 * sizeof(char *)); + subdirlist = tmp_subdirlist = malloc(2 * sizeof(char *)); if (subdirlist == NULL) return NULL; subdirlist[0] = DEFAULT_LIST; @@ -316,15 +316,15 @@ InitSubdirs(const char **subdirlist) strstr(*s, "..")) { xf86Msg(X_ERROR, "InitSubdirs: Bad subdir: \"%s\"\n", *s); if (tmp_subdirlist) - xfree(tmp_subdirlist); + free(tmp_subdirlist); return NULL; } } } - subdirs = xalloc((i * 2 + 1) * sizeof(char *)); + subdirs = malloc((i * 2 + 1) * sizeof(char *)); if (!subdirs) { if (tmp_subdirlist) - xfree(tmp_subdirlist); + free(tmp_subdirlist); return NULL; } i = 0; @@ -344,12 +344,12 @@ InitSubdirs(const char **subdirlist) } else slash = ""; len += oslen + 2; - if (!(subdirs[i] = xalloc(len))) { + if (!(subdirs[i] = malloc(len))) { while (--i >= 0) - xfree(subdirs[i]); - xfree(subdirs); + free(subdirs[i]); + free(subdirs); if (tmp_subdirlist) - xfree(tmp_subdirlist); + free(tmp_subdirlist); return NULL; } /* tack on the OS name */ @@ -368,7 +368,7 @@ InitSubdirs(const char **subdirlist) subdirs[i] = NULL; } if (tmp_subdirlist) - xfree(tmp_subdirlist); + free(tmp_subdirlist); return (const char **)subdirs; } @@ -379,8 +379,8 @@ FreeSubdirs(const char **subdirs) if (subdirs) { for (s = subdirs; *s; s++) - xfree(*s); - xfree(subdirs); + free(*s); + free(subdirs); } } @@ -465,7 +465,7 @@ FindModule(const char *module, const char *dirname, const char **subdirlist, FreeSubdirs(subdirs); if (dirpath != dirname) - xfree(dirpath); + free(dirpath); return name; } @@ -527,7 +527,7 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) match[1].rm_so != -1) { len = match[1].rm_eo - match[1].rm_so; save = listing; - listing = xrealloc(listing, + listing = realloc(listing, (n + 2) * sizeof(char *)); if (!listing) { if (save) { @@ -539,7 +539,7 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) FreePatterns(patterns); return NULL; } - listing[n] = xalloc(len + 1); + listing[n] = malloc(len + 1); if (!listing[n]) { FreeStringList(listing); FreePathList(pathlist); @@ -780,7 +780,7 @@ LoadSubModule(pointer _parent, const char *module, static ModuleDescPtr NewModuleDesc(const char *name) { - ModuleDescPtr mdp = xalloc(sizeof(ModuleDesc)); + ModuleDescPtr mdp = malloc(sizeof(ModuleDesc)); if (mdp) { mdp->child = NULL; @@ -944,7 +944,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, * now check if the special data object <modulename>ModuleData is * present. */ - p = xalloc(strlen(name) + strlen("ModuleData") + 1); + p = malloc(strlen(name) + strlen("ModuleData") + 1); if (!p) { if (errmaj) *errmaj = LDR_NOMEM; @@ -1021,9 +1021,9 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, LoadModule_exit: FreePathList(pathlist); FreePatterns(patterns); - xfree(found); - xfree(name); - xfree(p); + free(found); + free(name); + free(p); return ret; } @@ -1099,8 +1099,8 @@ UnloadModuleOrDriver(ModuleDescPtr mod) UnloadModuleOrDriver(mod->child); if (mod->sib) UnloadModuleOrDriver(mod->sib); - xfree(mod->name); - xfree(mod); + free(mod->name); + free(mod); } void @@ -1122,8 +1122,8 @@ UnloadSubModule(pointer _mod) if (mod->child) UnloadModuleOrDriver(mod->child); - xfree(mod->name); - xfree(mod); + free(mod->name); + free(mod); } static void @@ -1241,7 +1241,7 @@ LoaderGetCanonicalName(const char *modname, PatternPtr patterns) for (p = patterns; p->pattern; p++) if (regexec(&p->rex, s, 2, match, 0) == 0 && match[1].rm_so != -1) { len = match[1].rm_eo - match[1].rm_so; - str = xalloc(len + 1); + str = malloc(len + 1); if (!str) return NULL; strncpy(str, s + match[1].rm_so, len); diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 1ccaffc10..ef7ed58b9 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -90,7 +90,7 @@ xf86CrtcCreate (ScrnInfoPtr scrn, xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CrtcPtr crtc, *crtcs; - crtc = xcalloc (sizeof (xf86CrtcRec), 1); + crtc = calloc(sizeof (xf86CrtcRec), 1); if (!crtc) return NULL; crtc->version = XF86_CRTC_VERSION; @@ -118,20 +118,20 @@ xf86CrtcCreate (ScrnInfoPtr scrn, crtc->gamma_size = 256; crtc->gamma_red = malloc(3 * crtc->gamma_size * sizeof (CARD16)); if (!crtc->gamma_red) { - xfree (crtc); + free(crtc); return NULL; } crtc->gamma_green = crtc->gamma_red + crtc->gamma_size; crtc->gamma_blue = crtc->gamma_green + crtc->gamma_size; if (xf86_config->crtc) - crtcs = xrealloc (xf86_config->crtc, + crtcs = realloc(xf86_config->crtc, (xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr)); else - crtcs = xalloc ((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr)); + crtcs = malloc((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr)); if (!crtcs) { - xfree (crtc); + free(crtc); return NULL; } xf86_config->crtc = crtcs; @@ -156,9 +156,9 @@ xf86CrtcDestroy (xf86CrtcPtr crtc) break; } if (crtc->params) - xfree (crtc->params); + free(crtc->params); free(crtc->gamma_red); - xfree (crtc); + free(crtc); } @@ -381,8 +381,8 @@ done: } if (adjusted_mode->name) - xfree(adjusted_mode->name); - xfree(adjusted_mode); + free(adjusted_mode->name); + free(adjusted_mode); if (didLock) crtc->funcs->unlock (crtc); @@ -479,7 +479,7 @@ xf86OutputSetMonitor (xf86OutputPtr output) return; if (output->options) - xfree (output->options); + free(output->options); output->options = xnfalloc (sizeof (xf86OutputOptions)); memcpy (output->options, xf86OutputOptions, sizeof (xf86OutputOptions)); @@ -493,7 +493,7 @@ xf86OutputSetMonitor (xf86OutputPtr output) monitor = output->name; else xf86MarkOptionUsedByName (output->scrn->options, option_name); - xfree (option_name); + free(option_name); output->conf_monitor = xf86findMonitor (monitor, xf86configptr->conf_monitor_lst); /* @@ -595,7 +595,7 @@ xf86OutputCreate (ScrnInfoPtr scrn, else len = 0; - output = xcalloc (sizeof (xf86OutputRec) + len, 1); + output = calloc(sizeof (xf86OutputRec) + len, 1); if (!output) return NULL; output->scrn = scrn; @@ -618,20 +618,20 @@ xf86OutputCreate (ScrnInfoPtr scrn, xf86OutputSetMonitor (output); if (xf86OutputIgnored (output)) { - xfree (output); + free(output); return FALSE; } } if (xf86_config->output) - outputs = xrealloc (xf86_config->output, + outputs = realloc(xf86_config->output, (xf86_config->num_output + 1) * sizeof (xf86OutputPtr)); else - outputs = xalloc ((xf86_config->num_output + 1) * sizeof (xf86OutputPtr)); + outputs = malloc((xf86_config->num_output + 1) * sizeof (xf86OutputPtr)); if (!outputs) { - xfree (output); + free(output); return NULL; } @@ -657,14 +657,14 @@ Bool xf86OutputRename (xf86OutputPtr output, const char *name) { int len = strlen(name) + 1; - char *newname = xalloc (len); + char *newname = malloc(len); if (!newname) return FALSE; /* so sorry... */ strcpy (newname, name); if (output->name && output->name != (char *) (output + 1)) - xfree (output->name); + free(output->name); output->name = newname; xf86OutputSetMonitor (output); if (xf86OutputIgnored (output)) @@ -702,8 +702,8 @@ xf86OutputDestroy (xf86OutputPtr output) break; } if (output->name && output->name != (char *) (output + 1)) - xfree (output->name); - xfree (output); + free(output->name); + free(output); } /* @@ -950,7 +950,7 @@ xf86PickCrtcs (ScrnInfoPtr scrn, if (modes[n] == NULL) return best_score; - crtcs = xalloc (config->num_output * sizeof (xf86CrtcPtr)); + crtcs = malloc(config->num_output * sizeof (xf86CrtcPtr)); if (!crtcs) return best_score; @@ -1006,7 +1006,7 @@ xf86PickCrtcs (ScrnInfoPtr scrn, memcpy (best_crtcs, crtcs, config->num_output * sizeof (xf86CrtcPtr)); } } - xfree (crtcs); + free(crtcs); return best_score; } @@ -1415,8 +1415,8 @@ xf86SortModes (DisplayModePtr input) if (!strcmp (o->name, n->name) && xf86ModesEqual (o, n)) { o->next = n->next; - xfree (n->name); - xfree (n); + free(n->name); + free(n); n = o; } } @@ -2101,8 +2101,8 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, config->num_output * sizeof(DisplayModePtr)); } - xfree(preferred); - xfree(preferred_match); + free(preferred); + free(preferred_match); return ret; } @@ -2157,7 +2157,7 @@ no_aspect_match: ret = TRUE; out: - xfree(aspects); + free(aspects); return ret; } @@ -2391,8 +2391,8 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) */ if (!xf86InitialOutputPositions (scrn, modes)) { - xfree (crtcs); - xfree (modes); + free(crtcs); + free(modes); return FALSE; } @@ -2406,8 +2406,8 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) */ if (!xf86PickCrtcs (scrn, crtcs, modes, 0, width, height)) { - xfree (crtcs); - xfree (modes); + free(crtcs); + free(modes); return FALSE; } @@ -2494,8 +2494,8 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) /* Mirror output modes to scrn mode list */ xf86SetScrnInfoModes (scrn); - xfree (crtcs); - xfree (modes); + free(crtcs); + free(modes); return TRUE; } @@ -2934,7 +2934,7 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) #endif if (output->MonInfo != NULL) - xfree(output->MonInfo); + free(output->MonInfo); output->MonInfo = edid_mon; diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index cfbe7785a..5842a613c 100644 --- a/hw/xfree86/modes/xf86Cursors.c +++ b/hw/xfree86/modes/xf86Cursors.c @@ -551,7 +551,7 @@ xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags) if (!cursor_info) return FALSE; - xf86_config->cursor_image = xalloc (max_width * max_height * 4); + xf86_config->cursor_image = malloc(max_width * max_height * 4); if (!xf86_config->cursor_image) { @@ -661,7 +661,7 @@ xf86_cursors_fini (ScreenPtr screen) } if (xf86_config->cursor_image) { - xfree (xf86_config->cursor_image); + free(xf86_config->cursor_image); xf86_config->cursor_image = NULL; } if (xf86_config->cursor) diff --git a/hw/xfree86/modes/xf86DiDGA.c b/hw/xfree86/modes/xf86DiDGA.c index 60fbdbf05..a4cf4f08c 100644 --- a/hw/xfree86/modes/xf86DiDGA.c +++ b/hw/xfree86/modes/xf86DiDGA.c @@ -61,7 +61,7 @@ xf86_dga_get_modes (ScreenPtr pScreen) if (!num) return FALSE; - modes = xalloc(num * sizeof(DGAModeRec)); + modes = malloc(num * sizeof(DGAModeRec)); if (!modes) return FALSE; @@ -104,7 +104,7 @@ xf86_dga_get_modes (ScreenPtr pScreen) break; } if (xf86_config->dga_modes) - xfree (xf86_config->dga_modes); + free(xf86_config->dga_modes); xf86_config->dga_nmode = num; xf86_config->dga_modes = modes; return TRUE; diff --git a/hw/xfree86/modes/xf86DisplayIDModes.c b/hw/xfree86/modes/xf86DisplayIDModes.c index 182d43e0e..f18f18c60 100644 --- a/hw/xfree86/modes/xf86DisplayIDModes.c +++ b/hw/xfree86/modes/xf86DisplayIDModes.c @@ -56,7 +56,7 @@ typedef void (*did_proc)(int scrnIndex, unsigned char *data, void *closure); static DisplayModePtr modeCalloc(void) { - return xcalloc(1, sizeof(DisplayModeRec)); + return calloc(1, sizeof(DisplayModeRec)); } /* diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index ec6540841..8f4d04f93 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -608,7 +608,7 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing, /* perform basic check on the detail timing */ if (Mode->HSyncEnd > Mode->HTotal || Mode->VSyncEnd > Mode->VTotal) { - xfree(Mode); + free(Mode); return NULL; } diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c index 75aedaa99..05f4319c9 100644 --- a/hw/xfree86/modes/xf86Modes.c +++ b/hw/xfree86/modes/xf86Modes.c @@ -138,7 +138,7 @@ xf86SetModeDefaultName(DisplayModePtr mode) { Bool interlaced = !!(mode->Flags & V_INTERLACE); - xfree(mode->name); + free(mode->name); mode->name = XNFprintf("%dx%d%s", mode->HDisplay, mode->VDisplay, interlaced ? "i" : ""); @@ -324,7 +324,7 @@ xf86PrintModeline(int scrnIndex,DisplayModePtr mode) mode->HSyncStart, mode->HSyncEnd, mode->HTotal, mode->VDisplay, mode->VSyncStart, mode->VSyncEnd, mode->VTotal, flags, xf86ModeHSync(mode)); - xfree(flags); + free(flags); } #endif /* XORG_VERSION_CURRENT <= 7.2.99.2 */ @@ -607,13 +607,13 @@ xf86GetConfigModes (XF86ConfModeLinePtr conf_mode) for (; conf_mode; conf_mode = (XF86ConfModeLinePtr) conf_mode->list.next) { - mode = xcalloc(1, sizeof(DisplayModeRec)); + mode = calloc(1, sizeof(DisplayModeRec)); if (!mode) continue; mode->name = xstrdup(conf_mode->ml_identifier); if (!mode->name) { - xfree (mode); + free(mode); continue; } mode->type = 0; diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 8898f4dad..9dfce3fed 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -888,13 +888,13 @@ xf86RandR12Init (ScreenPtr pScreen) xf86RandR12Index = AllocateScreenPrivateIndex(); #endif - randrp = xalloc (sizeof (XF86RandRInfoRec)); + randrp = malloc(sizeof (XF86RandRInfoRec)); if (!randrp) return FALSE; if (!RRScreenInit(pScreen)) { - xfree (randrp); + free(randrp); return FALSE; } rp = rrGetScrPriv(pScreen); @@ -1064,7 +1064,7 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc) DisplayModePtr mode = &crtc->mode; Bool ret; - randr_outputs = xalloc(config->num_output * sizeof (RROutputPtr)); + randr_outputs = malloc(config->num_output * sizeof (RROutputPtr)); if (!randr_outputs) return FALSE; x = crtc->x; @@ -1101,7 +1101,7 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc) rotation, crtc->transformPresent ? &crtc->transform : NULL, numOutputs, randr_outputs); - xfree(randr_outputs); + free(randr_outputs); return ret; } @@ -1158,7 +1158,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, if (!crtc->scrn->vtSema) return FALSE; - save_crtcs = xalloc(config->num_output * sizeof (xf86CrtcPtr)); + save_crtcs = malloc(config->num_output * sizeof (xf86CrtcPtr)); if ((randr_mode != NULL) != crtc->enabled) changed = TRUE; else if (randr_mode && !xf86RandRModeMatches (randr_mode, &crtc->mode)) @@ -1222,7 +1222,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, xf86OutputPtr output = config->output[o]; output->crtc = save_crtcs[o]; } - xfree(save_crtcs); + free(save_crtcs); return FALSE; } xf86RandR13VerifyPanningArea (crtc, pScreen->width, pScreen->height); @@ -1243,7 +1243,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, } xf86DisableUnusedFunctions (pScrn); } - xfree(save_crtcs); + free(save_crtcs); return xf86RandR12CrtcNotify (randr_crtc); } @@ -1394,7 +1394,7 @@ xf86RROutputSetModes (RROutputPtr randr_output, DisplayModePtr modes) nmode++; if (nmode) { - rrmodes = xalloc (nmode * sizeof (RRModePtr)); + rrmodes = malloc(nmode * sizeof (RRModePtr)); if (!rrmodes) return FALSE; @@ -1431,7 +1431,7 @@ xf86RROutputSetModes (RROutputPtr randr_output, DisplayModePtr modes) } ret = RROutputSetModes (randr_output, rrmodes, nmode, npreferred); - xfree (rrmodes); + free(rrmodes); return ret; } @@ -1450,8 +1450,8 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) RRCrtcPtr randr_crtc; int nclone; - clones = xalloc(config->num_output * sizeof (RROutputPtr)); - crtcs = xalloc (config->num_crtc * sizeof (RRCrtcPtr)); + clones = malloc(config->num_output * sizeof (RROutputPtr)); + crtcs = malloc(config->num_crtc * sizeof (RRCrtcPtr)); for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; @@ -1468,8 +1468,8 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) if (!RROutputSetCrtcs (output->randr_output, crtcs, ncrtc)) { - xfree (crtcs); - xfree (clones); + free(crtcs); + free(clones); return FALSE; } @@ -1505,13 +1505,13 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) } if (!RROutputSetClones (output->randr_output, clones, nclone)) { - xfree (crtcs); - xfree (clones); + free(crtcs); + free(clones); return FALSE; } } - xfree (crtcs); - xfree (clones); + free(crtcs); + free(clones); return TRUE; } @@ -1729,7 +1729,7 @@ xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma) if (!size) return Success; - points = xcalloc(size, 3 * sizeof(CARD16)); + points = calloc(size, 3 * sizeof(CARD16)); if (!points) return BadAlloc; @@ -1742,7 +1742,7 @@ xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma) gamma_to_ramp(gamma.blue, blue, size); RRCrtcGammaSet(crtc, red, green, blue); - xfree(points); + free(points); pScrn->gamma = gamma; diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 5de6b0c00..2714fee51 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -406,7 +406,7 @@ xf86CrtcRotate (xf86CrtcPtr crtc) xf86RotateDestroy (crtc); crtc->transform_in_use = FALSE; if (new_params) - xfree (new_params); + free(new_params); new_params = NULL; new_nparams = 0; new_filter = NULL; @@ -467,7 +467,7 @@ xf86CrtcRotate (xf86CrtcPtr crtc) if (transform) { if (transform->nparams) { - new_params = xalloc (transform->nparams * sizeof (xFixed)); + new_params = malloc(transform->nparams * sizeof (xFixed)); if (new_params) { memcpy (new_params, transform->params, transform->nparams * sizeof (xFixed)); @@ -507,7 +507,7 @@ xf86CrtcRotate (xf86CrtcPtr crtc) crtc->f_crtc_to_framebuffer = f_crtc_to_fb; crtc->f_framebuffer_to_crtc = f_fb_to_crtc; if (crtc->params) - xfree (crtc->params); + free(crtc->params); crtc->params = new_params; crtc->nparams = new_nparams; crtc->filter = new_filter; diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c index 10db9c7b8..44abb9d55 100644 --- a/hw/xfree86/os-support/bsd/i386_video.c +++ b/hw/xfree86/os-support/bsd/i386_video.c @@ -529,7 +529,7 @@ getAllRanges(int *nmr) mro.mo_arg[0] = *nmr; mro.mo_desc = mrd; if (ioctl(devMemFd, MEMRANGE_GET, &mro)) { - xfree(mrd); + free(mrd); return NULL; } return mrd; @@ -576,7 +576,7 @@ cleanMTRR() #ifdef DEBUG sleep(10); #endif - xfree(mrd); + free(mrd); return TRUE; } @@ -594,7 +594,7 @@ freeRangeList(RangePtr range) while (range) { rp = range; range = rp->next; - xfree(rp); + free(rp); } } @@ -679,7 +679,7 @@ findRanges(unsigned long base, unsigned long size, RangePtr *ucp, RangePtr *wcp) *p = rp; } } - xfree(mrd); + free(mrd); } /* @@ -886,7 +886,7 @@ NetBSDsetWC(int screenNum, unsigned long base, unsigned long size, Bool enable, n = 1; if (i386_set_mtrr(mtrrp, &n) < 0) { - xfree(mtrrp); + free(mtrrp); return NULL; } return mtrrp; @@ -903,6 +903,6 @@ NetBSDundoWC(int screenNum, pointer list) n = 1; mtrrp->flags &= ~MTRR_VALID; i386_set_mtrr(mtrrp, &n); - xfree(mtrrp); + free(mtrrp); } #endif diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c index 0b6205f0b..9ccc2898f 100644 --- a/hw/xfree86/os-support/bus/Sbus.c +++ b/hw/xfree86/os-support/bus/Sbus.c @@ -192,7 +192,7 @@ sparcPromClose(void) promFd = -1; } if (promOpio) { - xfree(promOpio); + free(promOpio); promOpio = NULL; } promOpenCount = 0; @@ -208,7 +208,7 @@ sparcPromInit(void) promFd = open("/dev/openprom", O_RDONLY, 0); if (promFd == -1) return -1; - promOpio = (struct openpromio *)xalloc(4096); + promOpio = (struct openpromio *)malloc(4096); if (!promOpio) { sparcPromClose(); return -1; @@ -515,11 +515,11 @@ sparcPromNode2Pathname(sbusPromNodePtr pnode) char *ret; if (!pnode->node) return NULL; - ret = xalloc(4096); + ret = malloc(4096); if (!ret) return NULL; if (promWalkNode2Pathname(ret, promRootNode, promGetChild(promRootNode), pnode->node, 0)) return ret; - xfree(ret); + free(ret); return NULL; } @@ -585,7 +585,7 @@ sparcPromPathname2Node(const char *pathName) char *name, *regstr, *p; i = strlen(pathName); - name = xalloc(i + 2); + name = malloc(i + 2); if (! name) return 0; strcpy (name, pathName); name [i + 1] = 0; @@ -605,7 +605,7 @@ sparcPromPathname2Node(const char *pathName) return 0; promGetSibling(0); i = promWalkPathname2Node(name + 1, regstr, promRootNode, 0); - xfree(name); + free(name); return i; } diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c index 0cf3507c3..2965b3756 100644 --- a/hw/xfree86/os-support/linux/int10/linux.c +++ b/hw/xfree86/os-support/linux/int10/linux.c @@ -100,7 +100,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) options = xf86HandleInt10Options(xf86Screens[screen],entityIndex); if (int10skip(options)) { - xfree(options); + free(options); return NULL; } @@ -290,7 +290,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) dprint(0xc0000, 0x20); #endif - xfree(options); + free(options); return pInt; error3: @@ -308,11 +308,11 @@ error2: error1: if (vMem) munmap(vMem, SYS_BIOS - V_BIOS); - xfree(((linuxInt10Priv*)pInt->private)->alloc); - xfree(pInt->private); + free(((linuxInt10Priv*)pInt->private)->alloc); + free(pInt->private); error0: - xfree(options); - xfree(pInt); + free(options); + free(pInt); return NULL; } @@ -399,9 +399,9 @@ xf86FreeInt10(xf86Int10InfoPtr pInt) shmctl(((linuxInt10Priv*)pInt->private)->lowMem, IPC_RMID, NULL); if (((linuxInt10Priv*)pInt->private)->highMem >= 0) shmctl(((linuxInt10Priv*)pInt->private)->highMem, IPC_RMID, NULL); - xfree(((linuxInt10Priv*)pInt->private)->alloc); - xfree(pInt->private); - xfree(pInt); + free(((linuxInt10Priv*)pInt->private)->alloc); + free(pInt->private); + free(pInt); } void * diff --git a/hw/xfree86/os-support/linux/lnx_agp.c b/hw/xfree86/os-support/linux/lnx_agp.c index 61437406d..44db8662d 100644 --- a/hw/xfree86/os-support/linux/lnx_agp.c +++ b/hw/xfree86/os-support/linux/lnx_agp.c @@ -132,7 +132,7 @@ xf86GetAGPInfo(int screenNum) return NULL; - if ((info = xcalloc(sizeof(AgpInfo), 1)) == NULL) { + if ((info = calloc(sizeof(AgpInfo), 1)) == NULL) { xf86DrvMsg(screenNum, X_ERROR, "xf86GetAGPInfo: Failed to allocate AgpInfo\n"); return NULL; diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c index 26a17425a..bdd2639ba 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -182,7 +182,7 @@ mtrr_cull_wc_region(int screenNum, unsigned long base, unsigned long size, /* Found an overlapping region. Delete it. */ - wcr = xalloc(sizeof(*wcr)); + wcr = malloc(sizeof(*wcr)); if (!wcr) return NULL; wcr->sentry.base = gent.base; @@ -203,7 +203,7 @@ mtrr_cull_wc_region(int screenNum, unsigned long base, unsigned long size, wcreturn = wcr; gent.regnum--; } else { - xfree(wcr); + free(wcr); xf86DrvMsgVerb(screenNum, X_WARNING, 0, "Failed to remove MMIO " "write-combining range (0x%lx,0x%lx)\n", @@ -263,7 +263,7 @@ mtrr_add_wc_region(int screenNum, unsigned long base, unsigned long size, if (!mtrr_open(from == X_CONFIG ? 0 : 2)) return wcreturn; - *wcr = curwcr = xalloc(sizeof(**wcr)); + *wcr = curwcr = malloc(sizeof(**wcr)); if (!curwcr) return wcreturn; @@ -313,7 +313,7 @@ mtrr_add_wc_region(int screenNum, unsigned long base, unsigned long size, } else { *wcr = curwcr->next; - xfree(curwcr); + free(curwcr); /* Don't complain about the VGA region: MTRR fixed regions aren't currently supported, but might be in @@ -339,7 +339,7 @@ mtrr_undo_wc_region(int screenNum, struct mtrr_wc_region *wcr) ioctl(mtrr_fd, MTRRIOC_DEL_ENTRY, &p->sentry); prev = p; p = p->next; - xfree(prev); + free(prev); } } } diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c index da57939cf..2e22bc3ff 100644 --- a/hw/xfree86/os-support/shared/posix_tty.c +++ b/hw/xfree86/os-support/shared/posix_tty.c @@ -131,14 +131,14 @@ xf86OpenSerial (pointer options) xf86Msg (X_ERROR, "xf86OpenSerial: Cannot open device %s\n\t%s.\n", dev, strerror (errno)); - xfree(dev); + free(dev); return (-1); } if (!isatty (fd)) { /* Allow non-tty devices to be opened. */ - xfree(dev); + free(dev); return (fd); } @@ -161,7 +161,7 @@ xf86OpenSerial (pointer options) if (xf86SetSerial (fd, options) == -1) { SYSCALL (close (fd)); - xfree(dev); + free(dev); return (-1); } @@ -169,7 +169,7 @@ xf86OpenSerial (pointer options) if (i == -1) { SYSCALL (close (fd)); - xfree(dev); + free(dev); return (-1); } i &= ~O_NONBLOCK; @@ -177,10 +177,10 @@ xf86OpenSerial (pointer options) if (i == -1) { SYSCALL (close (fd)); - xfree(dev); + free(dev); return (-1); } - xfree(dev); + free(dev); return (fd); } diff --git a/hw/xfree86/os-support/shared/vidmem.c b/hw/xfree86/os-support/shared/vidmem.c index 803ce09bd..89db4cc9d 100644 --- a/hw/xfree86/os-support/shared/vidmem.c +++ b/hw/xfree86/os-support/shared/vidmem.c @@ -128,7 +128,7 @@ removeMapping(VidMapPtr vp, MappingPtr mp) for (i = 0; i < vp->numMappings; i++) { if (vp->mappings[i] == mp) { found = 1; - xfree(vp->mappings[i]); + free(vp->mappings[i]); } else if (found) { vp->mappings[i - 1] = vp->mappings[i]; } @@ -156,7 +156,7 @@ checkMtrrOption(VidMapPtr vp) options); if (xf86GetOptValBool(options, OPTION_MTRR, &vp->mtrrEnabled)) vp->mtrrFrom = X_CONFIG; - xfree(options); + free(options); vp->mtrrOptChecked = TRUE; } } diff --git a/hw/xfree86/os-support/solaris/sun_agp.c b/hw/xfree86/os-support/solaris/sun_agp.c index e6a55a48b..ccecd112d 100644 --- a/hw/xfree86/os-support/solaris/sun_agp.c +++ b/hw/xfree86/os-support/solaris/sun_agp.c @@ -115,7 +115,7 @@ xf86GetAGPInfo(int screenNum) if (!GARTInit(screenNum)) return NULL; - if ((info = xcalloc(sizeof(AgpInfo), 1)) == NULL) { + if ((info = calloc(sizeof(AgpInfo), 1)) == NULL) { xf86DrvMsg(screenNum, X_ERROR, "xf86GetAGPInfo: Failed to allocate AgpInfo\n"); return NULL; diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c index 346e99490..2bbcb9cb1 100644 --- a/hw/xfree86/ramdac/xf86Cursor.c +++ b/hw/xfree86/ramdac/xf86Cursor.c @@ -65,7 +65,7 @@ xf86InitCursor( if (!xf86InitHardwareCursor(pScreen, infoPtr)) return FALSE; - ScreenPriv = xcalloc(1, sizeof(xf86CursorScreenRec)); + ScreenPriv = calloc(1, sizeof(xf86CursorScreenRec)); if (!ScreenPriv) return FALSE; @@ -144,8 +144,8 @@ xf86CursorCloseScreen(int i, ScreenPtr pScreen) pScrn->EnableDisableFBAccess = ScreenPriv->EnableDisableFBAccess; pScrn->SwitchMode = ScreenPriv->SwitchMode; - xfree(ScreenPriv->transparentData); - xfree(ScreenPriv); + free(ScreenPriv->transparentData); + free(ScreenPriv); return (*pScreen->CloseScreen)(i, pScreen); } @@ -286,7 +286,7 @@ xf86CursorUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, &pScreen->devPrivates, xf86CursorScreenKey); if (pCurs->refcnt <= 1) { - xfree(dixLookupPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen))); + free(dixLookupPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen))); dixSetPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen), NULL); } @@ -439,13 +439,13 @@ xf86ForceHWCursor (ScreenPtr pScreen, Bool on) xf86CursorInfoPtr xf86CreateCursorInfoRec(void) { - return xcalloc(1, sizeof(xf86CursorInfoRec)); + return calloc(1, sizeof(xf86CursorInfoRec)); } void xf86DestroyCursorInfoRec(xf86CursorInfoPtr infoPtr) { - xfree(infoPtr); + free(infoPtr); } /** diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c index 4374e51d4..dd2b78f98 100644 --- a/hw/xfree86/ramdac/xf86HWCurs.c +++ b/hw/xfree86/ramdac/xf86HWCurs.c @@ -247,7 +247,7 @@ RealizeCursorInterleave0(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) int words = size / (CUR_BITMAP_SCANLINE_PAD / 4); - if (!(mem = xcalloc(1, size))) + if (!(mem = calloc(1, size))) return NULL; if (pCurs == NullCursor) { @@ -354,8 +354,8 @@ RealizeCursorInterleave1(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs))) return NULL; - if (!(mem = xcalloc(1, size))) { - xfree(mem2); + if (!(mem = calloc(1, size))) { + free(mem2); return NULL; } @@ -379,7 +379,7 @@ RealizeCursorInterleave1(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) } /* Free the uninterleaved cursor */ - xfree(mem2); + free(mem2); return mem; } @@ -397,8 +397,8 @@ RealizeCursorInterleave8(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs))) return NULL; - if (!(mem = xcalloc(1, size))) { - xfree(mem2); + if (!(mem = calloc(1, size))) { + free(mem2); return NULL; } @@ -414,7 +414,7 @@ RealizeCursorInterleave8(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) } /* Free the uninterleaved cursor */ - xfree(mem2); + free(mem2); return mem; } @@ -432,8 +432,8 @@ RealizeCursorInterleave16(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs))) return NULL; - if (!(mem = xcalloc(1, size))) { - xfree(mem2); + if (!(mem = calloc(1, size))) { + free(mem2); return NULL; } @@ -449,7 +449,7 @@ RealizeCursorInterleave16(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) } /* Free the uninterleaved cursor */ - xfree(mem2); + free(mem2); return mem; } @@ -467,8 +467,8 @@ RealizeCursorInterleave32(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs))) return NULL; - if (!(mem = xcalloc(1, size))) { - xfree(mem2); + if (!(mem = calloc(1, size))) { + free(mem2); return NULL; } @@ -484,7 +484,7 @@ RealizeCursorInterleave32(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) } /* Free the uninterleaved cursor */ - xfree(mem2); + free(mem2); return mem; } @@ -502,8 +502,8 @@ RealizeCursorInterleave64(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs))) return NULL; - if (!(mem = xcalloc(1, size))) { - xfree(mem2); + if (!(mem = calloc(1, size))) { + free(mem2); return NULL; } @@ -521,7 +521,7 @@ RealizeCursorInterleave64(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) } /* Free the uninterleaved cursor */ - xfree(mem2); + free(mem2); return mem; } diff --git a/hw/xfree86/ramdac/xf86RamDac.c b/hw/xfree86/ramdac/xf86RamDac.c index bd4f3466a..0015b76b8 100644 --- a/hw/xfree86/ramdac/xf86RamDac.c +++ b/hw/xfree86/ramdac/xf86RamDac.c @@ -41,7 +41,7 @@ RamDacCreateInfoRec(void) { RamDacRecPtr infoRec; - infoRec = xcalloc(1, sizeof(RamDacRec)); + infoRec = calloc(1, sizeof(RamDacRec)); return infoRec; } @@ -51,7 +51,7 @@ RamDacHelperCreateInfoRec(void) { RamDacHelperRecPtr infoRec; - infoRec = xcalloc(1, sizeof(RamDacHelperRec)); + infoRec = calloc(1, sizeof(RamDacHelperRec)); return infoRec; } @@ -59,13 +59,13 @@ RamDacHelperCreateInfoRec(void) void RamDacDestroyInfoRec(RamDacRecPtr infoRec) { - xfree(infoRec); + free(infoRec); } void RamDacHelperDestroyInfoRec(RamDacHelperRecPtr infoRec) { - xfree(infoRec); + free(infoRec); } Bool @@ -133,11 +133,11 @@ RamDacFreeRec(ScrnInfoPtr pScrn) (pScrn)->privates[RamDacGetScreenIndex()].ptr); if (ramdacHWPtr) - xfree(ramdacHWPtr); + free(ramdacHWPtr); ramdacHWPtr = NULL; if (ramdacScrPtr) - xfree(ramdacScrPtr); + free(ramdacScrPtr); ramdacScrPtr = NULL; } diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c index 1c8170104..fd5f26c0e 100644 --- a/hw/xfree86/shadowfb/shadow.c +++ b/hw/xfree86/shadowfb/shadow.c @@ -165,7 +165,7 @@ ShadowFBInit2 ( if(!dixRequestPrivate(ShadowGCKey, sizeof(ShadowGCRec))) return FALSE; - if(!(pPriv = (ShadowScreenPtr)xalloc(sizeof(ShadowScreenRec)))) + if(!(pPriv = (ShadowScreenPtr)malloc(sizeof(ShadowScreenRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, ShadowScreenKey, pPriv); @@ -255,7 +255,7 @@ ShadowCloseScreen (int i, ScreenPtr pScreen) ps->Composite = pPriv->Composite; } - xfree((pointer)pPriv); + free((pointer)pPriv); return (*pScreen->CloseScreen) (i, pScreen); } @@ -1010,7 +1010,7 @@ ShadowPolyRectangle( offset1 = offset2 >> 1; offset3 = offset2 - offset1; - pBoxInit = (BoxPtr)xalloc(nRects * 4 * sizeof(BoxRec)); + pBoxInit = (BoxPtr)malloc(nRects * 4 * sizeof(BoxRec)); pbox = pBoxInit; while(nRects--) { @@ -1061,7 +1061,7 @@ ShadowPolyRectangle( if(pPriv->preRefresh) (*pPriv->preRefresh)(pPriv->pScrn, num, pBoxInit); } else { - xfree(pBoxInit); + free(pBoxInit); } } } @@ -1073,7 +1073,7 @@ ShadowPolyRectangle( } else if(num) { if(pPriv->postRefresh) (*pPriv->postRefresh)(pPriv->pScrn, num, pBoxInit); - xfree(pBoxInit); + free(pBoxInit); } SHADOW_GC_OP_EPILOGUE(pGC); diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c index 26f5911d5..9f9b74355 100644 --- a/hw/xfree86/vbe/vbe.c +++ b/hw/xfree86/vbe/vbe.c @@ -164,7 +164,7 @@ vbeFree(vbeInfoPtr pVbe) /* If we have initalized int10 we ought to free it, too */ if (pVbe->init_int10) xf86FreeInt10(pVbe->pInt10); - xfree(pVbe); + free(pVbe); return; } @@ -264,7 +264,7 @@ vbeReadEDID(vbeInfoPtr pVbe) xf86ProcessOptions(screen, xf86Screens[screen]->options, options); xf86GetOptValBool(options, VBEOPT_NOVBE, &novbe); xf86GetOptValBool(options, VBEOPT_NODDC, &noddc); - xfree(options); + free(options); if (novbe || noddc) return NULL; if (!vbeProbeDDC(pVbe)) goto error; @@ -373,7 +373,7 @@ VBEGetVBEInfo(vbeInfoPtr pVbe) if (R16(pVbe->pInt10->ax) != 0x4f) return (NULL); - block = xcalloc(sizeof(VbeInfoBlock), 1); + block = calloc(sizeof(VbeInfoBlock), 1); block->VESASignature[0] = ((char*)pVbe->memory)[0]; block->VESASignature[1] = ((char*)pVbe->memory)[1]; block->VESASignature[2] = ((char*)pVbe->memory)[2]; @@ -396,7 +396,7 @@ VBEGetVBEInfo(vbeInfoPtr pVbe) i = 0; while (modes[i] != 0xffff) i++; - block->VideoModePtr = xalloc(sizeof(CARD16) * i + 1); + block->VideoModePtr = malloc(sizeof(CARD16) * i + 1); memcpy(block->VideoModePtr, modes, sizeof(CARD16) * i); block->VideoModePtr[i] = 0xffff; @@ -425,14 +425,14 @@ VBEGetVBEInfo(vbeInfoPtr pVbe) void VBEFreeVBEInfo(VbeInfoBlock *block) { - xfree(block->OEMStringPtr); - xfree(block->VideoModePtr); + free(block->OEMStringPtr); + free(block->VideoModePtr); if (((unsigned)block->VESAVersion >> 8) >= 2) { - xfree(block->OemVendorNamePtr); - xfree(block->OemProductNamePtr); - xfree(block->OemProductRevPtr); + free(block->OemVendorNamePtr); + free(block->OemProductNamePtr); + free(block->OemProductRevPtr); } - xfree(block); + free(block); } Bool @@ -528,7 +528,7 @@ VBEGetModeInfo(vbeInfoPtr pVbe, int mode) if (R16(pVbe->pInt10->ax) != 0x4f) return (NULL); - block = xcalloc(sizeof(VbeModeInfoBlock), 1); + block = calloc(sizeof(VbeModeInfoBlock), 1); block->ModeAttributes = *(CARD16*)pVbe->memory; block->WinAAttributes = ((char*)pVbe->memory)[2]; @@ -598,7 +598,7 @@ VBEGetModeInfo(vbeInfoPtr pVbe, int mode) void VBEFreeModeInfo(VbeModeInfoBlock *block) { - xfree(block); + free(block); } Bool @@ -884,7 +884,7 @@ VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set, int first, int num, if (set) return (data); - data = xalloc(num * sizeof(CARD32)); + data = malloc(num * sizeof(CARD32)); memcpy(data, pVbe->memory, num * sizeof(CARD32)); return (data); @@ -918,7 +918,7 @@ VBEGetVBEpmi(vbeInfoPtr pVbe) if (R16(pVbe->pInt10->ax) != 0x4f) return (NULL); - pmi = xalloc(sizeof(VBEpmi)); + pmi = malloc(sizeof(VBEpmi)); pmi->seg_tbl = R16(pVbe->pInt10->es); pmi->tbl_off = R16(pVbe->pInt10->di); pmi->tbl_len = R16(pVbe->pInt10->cx); @@ -995,7 +995,7 @@ VBEVesaSaveRestore(vbeInfoPtr pVbe, vbeSaveRestorePtr vbe_sr, vbe_sr->stateMode = -1; /* invalidate */ /* don't rely on the memory not being touched */ if (vbe_sr->pstate == NULL) - vbe_sr->pstate = xalloc(vbe_sr->stateSize); + vbe_sr->pstate = malloc(vbe_sr->stateSize); memcpy(vbe_sr->pstate, vbe_sr->state, vbe_sr->stateSize); } ErrorF("VBESaveRestore done with success\n"); @@ -1099,7 +1099,7 @@ VBEInterpretPanelID(int scrnIndex, struct vbePanelID *data) pScrn->monitor->vrefresh[0].hi = (float)mode->Clock*1000.0 / (float)mode->HTotal / (float)mode->VTotal; - xfree(mode); + free(mode); } struct vbePanelID * diff --git a/hw/xfree86/vbe/vbe.h b/hw/xfree86/vbe/vbe.h index b1ec5a9fb..3ebd440a8 100644 --- a/hw/xfree86/vbe/vbe.h +++ b/hw/xfree86/vbe/vbe.h @@ -282,7 +282,7 @@ extern _X_EXPORT int VBESetGetDACPaletteFormat(vbeInfoPtr pVbe, int bits); */ extern _X_EXPORT CARD32 *VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set, int first, int num, CARD32 *data, Bool secondary, Bool wait_retrace); -#define VBEFreePaletteData(data) xfree(data) +#define VBEFreePaletteData(data) free(data) /* * INT A @@ -295,7 +295,7 @@ typedef struct _VBEpmi { } VBEpmi; extern _X_EXPORT VBEpmi *VBEGetVBEpmi(vbeInfoPtr pVbe); -#define VESAFreeVBEpmi(pmi) xfree(pmi) +#define VESAFreeVBEpmi(pmi) free(pmi) /* high level helper functions */ diff --git a/hw/xfree86/vbe/vbeModes.c b/hw/xfree86/vbe/vbeModes.c index 1a4d2407c..3f2cae5bf 100644 --- a/hw/xfree86/vbe/vbeModes.c +++ b/hw/xfree86/vbe/vbeModes.c @@ -402,7 +402,7 @@ VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Attempting to use %dHz refresh for mode \"%s\" (%x)\n", (int)pMode->VRefresh, pMode->name, data->mode); - data->block = xcalloc(sizeof(VbeCRTCInfoBlock), 1); + data->block = calloc(sizeof(VbeCRTCInfoBlock), 1); data->block->HorizontalTotal = best->HTotal; data->block->HorizontalSyncStart = best->HSyncStart; data->block->HorizontalSyncEnd = best->HSyncEnd; diff --git a/hw/xfree86/vgahw/vgaCmap.c b/hw/xfree86/vgahw/vgaCmap.c index 06eeb4ce1..dad71b93e 100644 --- a/hw/xfree86/vgahw/vgaCmap.c +++ b/hw/xfree86/vgahw/vgaCmap.c @@ -235,9 +235,9 @@ vgaInstallColormap(pmap) else entries = pmap->pVisual->ColormapEntries; - ppix = (Pixel *)xalloc( entries * sizeof(Pixel)); - prgb = (xrgb *)xalloc( entries * sizeof(xrgb)); - defs = (xColorItem *)xalloc(entries * sizeof(xColorItem)); + ppix = (Pixel *)malloc( entries * sizeof(Pixel)); + prgb = (xrgb *)malloc( entries * sizeof(xrgb)); + defs = (xColorItem *)malloc(entries * sizeof(xColorItem)); if ( oldmap != NOMAPYET) WalkTree( pmap->pScreen, TellLostMap, &oldmap->mid); @@ -260,9 +260,9 @@ vgaInstallColormap(pmap) WalkTree(pmap->pScreen, TellGainedMap, &pmap->mid); - xfree(ppix); - xfree(prgb); - xfree(defs); + free(ppix); + free(prgb); + free(defs); } diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c index 004376b75..3ae2dfa5a 100644 --- a/hw/xfree86/vgahw/vgaHW.c +++ b/hw/xfree86/vgahw/vgaHW.c @@ -968,21 +968,21 @@ vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save) hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */ #if SAVE_FONT1 - if (hwp->FontInfo1 || (hwp->FontInfo1 = xalloc(FONT_AMOUNT))) { + if (hwp->FontInfo1 || (hwp->FontInfo1 = malloc(FONT_AMOUNT))) { hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */ hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */ slowbcopy_frombus(hwp->Base, hwp->FontInfo1, FONT_AMOUNT); } #endif /* SAVE_FONT1 */ #if SAVE_FONT2 - if (hwp->FontInfo2 || (hwp->FontInfo2 = xalloc(FONT_AMOUNT))) { + if (hwp->FontInfo2 || (hwp->FontInfo2 = malloc(FONT_AMOUNT))) { hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */ hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */ slowbcopy_frombus(hwp->Base, hwp->FontInfo2, FONT_AMOUNT); } #endif /* SAVE_FONT2 */ #if SAVE_TEXT - if (hwp->TextInfo || (hwp->TextInfo = xalloc(2 * TEXT_AMOUNT))) { + if (hwp->TextInfo || (hwp->TextInfo = malloc(2 * TEXT_AMOUNT))) { hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */ hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */ slowbcopy_frombus(hwp->Base, hwp->TextInfo, TEXT_AMOUNT); @@ -1480,7 +1480,7 @@ static void vgaHWFreeRegs(vgaRegPtr regp) { if (regp->CRTC) - xfree (regp->CRTC); + free(regp->CRTC); regp->CRTC = regp->Sequencer = @@ -1504,7 +1504,7 @@ vgaHWAllocRegs(vgaRegPtr regp) regp->numAttribute) == 0) return FALSE; - buf = xcalloc(regp->numCRTC + + buf = calloc(regp->numCRTC + regp->numSequencer + regp->numGraphics + regp->numAttribute, 1); @@ -1643,7 +1643,7 @@ vgaHWGetHWRec(ScrnInfoPtr scrp) if ((!vgaHWAllocDefaultRegs(&VGAHWPTR(scrp)->SavedReg)) || (!vgaHWAllocDefaultRegs(&VGAHWPTR(scrp)->ModeReg))) { - xfree(hwp); + free(hwp); return FALSE; } @@ -1726,14 +1726,14 @@ vgaHWFreeHWRec(ScrnInfoPtr scrp) if (!hwp) return; - xfree(hwp->FontInfo1); - xfree(hwp->FontInfo2); - xfree(hwp->TextInfo); + free(hwp->FontInfo1); + free(hwp->FontInfo2); + free(hwp->TextInfo); vgaHWFreeRegs (&hwp->ModeReg); vgaHWFreeRegs (&hwp->SavedReg); - xfree(hwp); + free(hwp); VGAHWPTRLVAL(scrp) = NULL; } } @@ -1975,7 +1975,7 @@ vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed) hwp->writeCrtc(hwp,0x15,save->cr15); hwp->writeCrtc(hwp,0x12,save->cr12); hwp->writeCrtc(hwp,0x03,save->cr03); - xfree(save); + free(save); hwp->ddc = NULL; break; default: diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c index ebba74e55..75033bcca 100644 --- a/hw/xfree86/xaa/xaaBitBlt.c +++ b/hw/xfree86/xaa/xaaBitBlt.c @@ -186,7 +186,7 @@ XAABitBlt( /* Do bit blitting */ numRects = REGION_NUM_RECTS(&rgnDst); if (numRects && width && height) { - if(!(pptSrc = (DDXPointPtr)xalloc(numRects * + if(!(pptSrc = (DDXPointPtr)malloc(numRects * sizeof(DDXPointRec)))) { REGION_UNINIT(pGC->pScreen, &rgnDst); if (freeSrcClip) @@ -201,7 +201,7 @@ XAABitBlt( } (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC, &rgnDst, pptSrc); - xfree(pptSrc); + free(pptSrc); } prgnExposed = NULL; diff --git a/hw/xfree86/xaa/xaaCpyArea.c b/hw/xfree86/xaa/xaaCpyArea.c index 6a898cd5f..1a03bfdb2 100644 --- a/hw/xfree86/xaa/xaaCpyArea.c +++ b/hw/xfree86/xaa/xaaCpyArea.c @@ -108,12 +108,12 @@ XAADoBitBlt( 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; - pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); + pptNew1 = (DDXPointPtr)malloc(sizeof(DDXPointRec) * nbox); if(!pptNew1) { - xfree(pboxNew1); + free(pboxNew1); return; } pboxBase = pboxNext = pbox+nbox-1; @@ -145,14 +145,14 @@ XAADoBitBlt( if (nbox > 1) { /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); + pboxNew2 = (BoxPtr)malloc(sizeof(BoxRec) * nbox); + pptNew2 = (DDXPointPtr)malloc(sizeof(DDXPointRec) * nbox); if(!pboxNew2 || !pptNew2) { - if (pptNew2) xfree(pptNew2); - if (pboxNew2) xfree(pboxNew2); + if (pptNew2) free(pptNew2); + if (pboxNew2) free(pboxNew2); if (pboxNew1) { - xfree(pptNew1); - xfree(pboxNew1); + free(pptNew1); + free(pboxNew1); } return; } @@ -183,12 +183,12 @@ XAADoBitBlt( xdir, ydir, pGC->alu, pGC->planemask); if (pboxNew2) { - xfree(pptNew2); - xfree(pboxNew2); + free(pptNew2); + free(pboxNew2); } if (pboxNew1) { - xfree(pptNew1); - xfree(pboxNew1); + free(pptNew1); + free(pboxNew1); } } diff --git a/hw/xfree86/xaa/xaaCpyPlane.c b/hw/xfree86/xaa/xaaCpyPlane.c index aa4c0407c..e3010eafb 100644 --- a/hw/xfree86/xaa/xaaCpyPlane.c +++ b/hw/xfree86/xaa/xaaCpyPlane.c @@ -131,7 +131,7 @@ XAACopyPlaneNtoNColorExpand( h = height = pbox->y2 - pbox->y1; pitch = BitmapBytePad(width); - if(!(data = xcalloc(height, pitch))) + if(!(data = calloc(height, pitch))) goto ALLOC_FAILED; dataPtr = data; @@ -151,7 +151,7 @@ XAACopyPlaneNtoNColorExpand( pbox->x1, pbox->y1, width, height, data, pitch, 0, pGC->fgPixel, pGC->bgPixel, pGC->alu, pGC->planemask); - xfree(data); + free(data); ALLOC_FAILED: @@ -184,7 +184,7 @@ XAAPushPixelsSolidColorExpansion( TheRect.height = dy; if(MaxBoxes > (infoRec->PreAllocSize/sizeof(BoxRec))) { - pClipBoxes = xalloc(MaxBoxes * sizeof(BoxRec)); + pClipBoxes = malloc(MaxBoxes * sizeof(BoxRec)); if(!pClipBoxes) return; } else pClipBoxes = (BoxPtr)infoRec->PreAllocMem; @@ -203,6 +203,6 @@ XAAPushPixelsSolidColorExpansion( } if(pClipBoxes != (BoxPtr)infoRec->PreAllocMem) - xfree(pClipBoxes); + free(pClipBoxes); } diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c index 31c421e65..d37c8ec1e 100644 --- a/hw/xfree86/xaa/xaaCpyWin.c +++ b/hw/xfree86/xaa/xaaCpyWin.c @@ -59,7 +59,7 @@ XAACopyWindow( pbox = REGION_RECTS(&rgnDst); nbox = REGION_NUM_RECTS(&rgnDst); if(!nbox || - !(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) { + !(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) { REGION_UNINIT(pScreen, &rgnDst); return; } @@ -77,6 +77,6 @@ XAACopyWindow( XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, &(infoRec->ScratchGC), &rgnDst, pptSrc); - xfree(pptSrc); + free(pptSrc); REGION_UNINIT(pScreen, &rgnDst); } diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c index e6083d529..8c9d0ede7 100644 --- a/hw/xfree86/xaa/xaaGC.c +++ b/hw/xfree86/xaa/xaaGC.c @@ -158,7 +158,7 @@ XAAValidateGC( /* If our Ops are still the default ones we need to allocate new ones */ if(pGC->ops == &XAAFallbackOps) { - if(!(pGCPriv->XAAOps = xalloc(sizeof(GCOps)))) { + if(!(pGCPriv->XAAOps = malloc(sizeof(GCOps)))) { pGCPriv->XAAOps = &XAAFallbackOps; return; } @@ -241,10 +241,10 @@ XAADestroyGC(GCPtr pGC) XAA_GC_FUNC_PROLOGUE (pGC); if(pGCPriv->XAAOps != &XAAFallbackOps) - xfree(pGCPriv->XAAOps); + free(pGCPriv->XAAOps); if(pGCPriv->DashPattern) - xfree(pGCPriv->DashPattern); + free(pGCPriv->DashPattern); (*pGC->funcs->DestroyGC)(pGC); XAA_GC_FUNC_EPILOGUE (pGC); diff --git a/hw/xfree86/xaa/xaaImage.c b/hw/xfree86/xaa/xaaImage.c index 4933beea3..30caa2a9a 100644 --- a/hw/xfree86/xaa/xaaImage.c +++ b/hw/xfree86/xaa/xaaImage.c @@ -442,7 +442,7 @@ XAAPutImage( TheRect.height = h; if(MaxBoxes > (infoRec->PreAllocSize/sizeof(BoxRec))) { - pClipBoxes = xalloc(MaxBoxes * sizeof(BoxRec)); + pClipBoxes = malloc(MaxBoxes * sizeof(BoxRec)); if(!pClipBoxes) return; } else pClipBoxes = (BoxPtr)infoRec->PreAllocMem; @@ -514,7 +514,7 @@ XAAPutImage( } if(pClipBoxes != (BoxPtr)infoRec->PreAllocMem) - xfree(pClipBoxes); + free(pClipBoxes); } else XAAFallbackOps.PutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage); diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c index 7d4583dc2..0ccdae59d 100644 --- a/hw/xfree86/xaa/xaaInit.c +++ b/hw/xfree86/xaa/xaaInit.c @@ -69,7 +69,7 @@ XAACreateInfoRec(void) { XAAInfoRecPtr infoRec; - infoRec = xcalloc(1, sizeof(XAAInfoRec)); + infoRec = calloc(1, sizeof(XAAInfoRec)); if(infoRec) infoRec->CachePixelGranularity = -1; @@ -85,12 +85,12 @@ XAADestroyInfoRec(XAAInfoRecPtr infoRec) (*infoRec->ClosePixmapCache)(infoRec->pScrn->pScreen); if(infoRec->PreAllocMem) - xfree(infoRec->PreAllocMem); + free(infoRec->PreAllocMem); if(infoRec->PixmapCachePrivate) - xfree(infoRec->PixmapCachePrivate); + free(infoRec->PixmapCachePrivate); - xfree(infoRec); + free(infoRec); } @@ -112,7 +112,7 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec) if (!dixRequestPrivate(XAAPixmapKey, sizeof(XAAPixmapRec))) return FALSE; - if (!(pScreenPriv = xalloc(sizeof(XAAScreenRec)))) + if (!(pScreenPriv = malloc(sizeof(XAAScreenRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, XAAScreenKey, pScreenPriv); @@ -181,7 +181,7 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec) if(pScrn->overlayFlags & OVERLAY_8_32_PLANAR) XAASetupOverlay8_32Planar(pScreen); - infoRec->PreAllocMem = xalloc(MAX_PREALLOC_MEM); + infoRec->PreAllocMem = malloc(MAX_PREALLOC_MEM); if(infoRec->PreAllocMem) infoRec->PreAllocSize = MAX_PREALLOC_MEM; @@ -228,7 +228,7 @@ XAACloseScreen (int i, ScreenPtr pScreen) /* We leave it up to the client to free the XAAInfoRec */ - xfree ((pointer) pScreenPriv); + free((pointer) pScreenPriv); return (*pScreen->CloseScreen) (i, pScreen); } @@ -372,7 +372,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) goto BAILOUT; } - if(!(pLink = xalloc(sizeof(PixmapLink)))) { + if(!(pLink = malloc(sizeof(PixmapLink)))) { xf86FreeOffscreenArea(area); goto BAILOUT; } @@ -382,7 +382,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap); if (!pPix) { - xfree (pLink); + free(pLink); xf86FreeOffscreenArea(area); goto BAILOUT; } @@ -436,7 +436,7 @@ XAADestroyPixmap(PixmapPtr pPix) if(pPix->refcnt == 1) { if(pPriv->flags & OFFSCREEN) { if(pPriv->flags & DGA_PIXMAP) - xfree(pPriv->offscreenArea); + free(pPriv->offscreenArea); else { FBAreaPtr area = pPriv->offscreenArea; PixmapLinkPtr pLink = infoRec->OffscreenPixmaps; @@ -454,12 +454,12 @@ XAADestroyPixmap(PixmapPtr pPix) xf86FreeOffscreenArea(area); pPriv->offscreenArea = NULL; - xfree(pLink); + free(pLink); } } if(pPriv->freeData) { /* pixmaps that were once in video ram */ - xfree(pPix->devPrivate.ptr); + free(pPix->devPrivate.ptr); pPix->devPrivate.ptr = NULL; } } @@ -551,7 +551,7 @@ XAASetDGAMode(int index, int num, DGADevicePtr devRet) infoRec->UsingPixmapCache = state->UsingPixmapCache; infoRec->CanDoColor8x8 = state->CanDoColor8x8; infoRec->CanDoMono8x8 = state->CanDoMono8x8; - xfree(infoRec->dgaSaves); + free(infoRec->dgaSaves); infoRec->dgaSaves = NULL; } @@ -562,7 +562,7 @@ XAASetDGAMode(int index, int num, DGADevicePtr devRet) XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(devRet->pPix); FBAreaPtr area; - if((area = xalloc(sizeof(FBArea)))) { + if((area = malloc(sizeof(FBArea)))) { area->pScreen = pScreen; area->box.x1 = 0; area->box.x2 = 0; @@ -577,7 +577,7 @@ XAASetDGAMode(int index, int num, DGADevicePtr devRet) pixPriv->offscreenArea = area; if(!infoRec->dgaSaves) { /* save pixmap cache state */ - SavedCacheStatePtr state = xalloc(sizeof(SavedCacheState)); + SavedCacheStatePtr state = malloc(sizeof(SavedCacheState)); state->UsingPixmapCache = infoRec->UsingPixmapCache; state->CanDoColor8x8 = infoRec->CanDoColor8x8; diff --git a/hw/xfree86/xaa/xaaInitAccel.c b/hw/xfree86/xaa/xaaInitAccel.c index 6f3d622e1..2f40c81a2 100644 --- a/hw/xfree86/xaa/xaaInitAccel.c +++ b/hw/xfree86/xaa/xaaInitAccel.c @@ -1476,7 +1476,7 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec) infoRec->CachePixelGranularity *= 2; } - xfree(options); + free(options); if(!infoRec->CacheTile && infoRec->WritePixmapToCache) infoRec->CacheTile = XAACacheTile; diff --git a/hw/xfree86/xaa/xaaLineMisc.c b/hw/xfree86/xaa/xaaLineMisc.c index 6cef4bcd5..e017c22f8 100644 --- a/hw/xfree86/xaa/xaaLineMisc.c +++ b/hw/xfree86/xaa/xaaLineMisc.c @@ -75,7 +75,7 @@ XAAComputeDash(GCPtr pGC) Bool set; if(pGCPriv->DashPattern) - xfree(pGCPriv->DashPattern); + free(pGCPriv->DashPattern); pGCPriv->DashPattern = NULL; pGCPriv->DashLength = 0; @@ -93,7 +93,7 @@ XAAComputeDash(GCPtr pGC) (PatternLength & (PatternLength - 1))) return; - pGCPriv->DashPattern = xcalloc((PatternLength + 31) >> 5, 4); + pGCPriv->DashPattern = calloc((PatternLength + 31) >> 5, 4); if(!pGCPriv->DashPattern) return; pGCPriv->DashLength = PatternLength; diff --git a/hw/xfree86/xaa/xaaNonTEText.c b/hw/xfree86/xaa/xaaNonTEText.c index d32c0bbc5..072fe1925 100644 --- a/hw/xfree86/xaa/xaaNonTEText.c +++ b/hw/xfree86/xaa/xaaNonTEText.c @@ -291,7 +291,7 @@ PolyGlyphBltAsSingleBitmap ( pitch = (Right - Left + 31) >> 5; size = (pitch << 2) * (Bottom - Top); - block = xcalloc(1, size); + block = calloc(1, size); topLine = 10000; botLine = -10000; @@ -349,7 +349,7 @@ PolyGlyphBltAsSingleBitmap ( nbox--; pbox++; } - xfree(block); + free(block); } static void diff --git a/hw/xfree86/xaa/xaaOffscreen.c b/hw/xfree86/xaa/xaaOffscreen.c index 7c9d53270..cd0d9a900 100644 --- a/hw/xfree86/xaa/xaaOffscreen.c +++ b/hw/xfree86/xaa/xaaOffscreen.c @@ -79,7 +79,7 @@ XAAMoveInOffscreenPixmaps(ScreenPtr pScreen) if(!tmpPix) { pPriv->offscreenArea = area; - xfree(data); + free(data); pLink = pLink->next; continue; } @@ -90,7 +90,7 @@ XAAMoveInOffscreenPixmaps(ScreenPtr pScreen) (*pGC->ops->CopyArea)((DrawablePtr)tmpPix, (DrawablePtr)pPix, pGC, 0, 0, pPix->drawable.width, pPix->drawable.height, 0, 0); - xfree(data); + free(data); tmpPix->devPrivate.ptr = NULL; FreeScratchGC(pGC); @@ -132,13 +132,13 @@ XAAMoveOutOffscreenPixmap(PixmapPtr pPix) bitsPerPixel = pPix->drawable.bitsPerPixel; devKind = BitmapBytePad(width * bitsPerPixel); - if(!(data = xalloc(devKind * height))) + if(!(data = malloc(devKind * height))) FatalError("Out of memory\n"); tmpPix = GetScratchPixmapHeader(pScreen, width, height, pPix->drawable.depth, bitsPerPixel, devKind, data); if(!tmpPix) { - xfree(data); + free(data); FatalError("Out of memory\n"); } diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c index 2956a3dbf..2af808396 100644 --- a/hw/xfree86/xaa/xaaOverlay.c +++ b/hw/xfree86/xaa/xaaOverlay.c @@ -69,7 +69,7 @@ XAACopyWindow8_32( pbox = REGION_RECTS(&rgnDst); nbox = REGION_NUM_RECTS(&rgnDst); if(!nbox || - !(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) { + !(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) { REGION_UNINIT(pScreen, &rgnDst); return; } @@ -87,7 +87,7 @@ XAACopyWindow8_32( XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, &(infoRec->ScratchGC), &rgnDst, pptSrc); - xfree(pptSrc); + free(pptSrc); REGION_UNINIT(pScreen, &rgnDst); if(freeReg) REGION_DESTROY(pScreen, borderClip); diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c index 8db816e1e..3b848ac84 100644 --- a/hw/xfree86/xaa/xaaOverlayDF.c +++ b/hw/xfree86/xaa/xaaOverlayDF.c @@ -173,7 +173,7 @@ XAAInitDualFramebufferOverlay( XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); XAAOverlayPtr pOverPriv; - if(!(pOverPriv = xalloc(sizeof(XAAOverlayRec)))) + if(!(pOverPriv = malloc(sizeof(XAAOverlayRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, XAAOverlayKey, pOverPriv); @@ -350,7 +350,7 @@ XAAOverCopyWindow( nbox = REGION_NUM_RECTS(&rgnDst); if(nbox && - (pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) { + (pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) { pbox = REGION_RECTS(&rgnDst); for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) { @@ -368,7 +368,7 @@ XAAOverCopyWindow( &(infoRec->ScratchGC), &rgnDst, pptSrc); } - xfree(pptSrc); + free(pptSrc); } REGION_UNINIT(pScreen, &rgnDst); @@ -380,7 +380,7 @@ XAAOverCopyWindow( REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc); nbox = REGION_NUM_RECTS(&rgnDst); if(nbox && - (pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))){ + (pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))){ pbox = REGION_RECTS(&rgnDst); for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) { @@ -391,7 +391,7 @@ XAAOverCopyWindow( SWITCH_DEPTH(pScrn->depth); XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot, &(infoRec->ScratchGC), &rgnDst, pptSrc); - xfree(pptSrc); + free(pptSrc); } } REGION_UNINIT(pScreen, &rgnDst); diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c index 7e3011bd5..e78a6f82f 100644 --- a/hw/xfree86/xaa/xaaPCache.c +++ b/hw/xfree86/xaa/xaaPCache.c @@ -65,7 +65,7 @@ Enlist(CacheLinkPtr link, int x, int y, int w, int h) { CacheLinkPtr newLink; - newLink = xalloc(sizeof(CacheLink)); + newLink = malloc(sizeof(CacheLink)); newLink->next = link; newLink->x = x; newLink->y = y; newLink->w = w; newLink->h = h; @@ -80,7 +80,7 @@ Delist(CacheLinkPtr link) { if(link) { ret = link->next; - xfree(link); + free(link); } return ret; } @@ -94,7 +94,7 @@ FreeList(CacheLinkPtr link) { while(link) { tmp = link; link = link->next; - xfree(tmp); + free(tmp); } } @@ -145,19 +145,19 @@ FreePixmapCachePrivate(XAAPixmapCachePrivatePtr pPriv) if(!pPriv) return; if(pPriv->Info512) - xfree(pPriv->Info512); + free(pPriv->Info512); if(pPriv->Info256) - xfree(pPriv->Info256); + free(pPriv->Info256); if(pPriv->Info128) - xfree(pPriv->Info128); + free(pPriv->Info128); if(pPriv->InfoColor) - xfree(pPriv->InfoColor); + free(pPriv->InfoColor); if(pPriv->InfoMono) - xfree(pPriv->InfoMono); + free(pPriv->InfoMono); if(pPriv->InfoPartial) - xfree(pPriv->InfoPartial); + free(pPriv->InfoPartial); - xfree(pPriv); + free(pPriv); } void @@ -212,7 +212,7 @@ ThinOutPartials( pCur->next = List8; List8 = pCur; Num8++; } else { - xfree(pCur); + free(pCur); } pCur = next; @@ -477,7 +477,7 @@ ConvertSomePartialsTo8x8( } } } - xfree(pCur); + free(pCur); } pCur = next; @@ -955,7 +955,7 @@ XAAInitPixmapCache( } - pCachePriv = xcalloc(1,sizeof(XAAPixmapCachePrivate)); + pCachePriv = calloc(1,sizeof(XAAPixmapCachePrivate)); if(!pCachePriv) { if(Num512) FreeList(List512); if(Num256) FreeList(List256); @@ -969,21 +969,21 @@ XAAInitPixmapCache( infoRec->PixmapCachePrivate = (char*)pCachePriv; if(Num512) { - pCachePriv->Info512 = xcalloc(Num512,sizeof(XAACacheInfoRec)); + pCachePriv->Info512 = calloc(Num512,sizeof(XAACacheInfoRec)); if(!pCachePriv->Info512) Num512 = 0; if(Num512) TransferList(List512, pCachePriv->Info512, Num512); FreeList(List512); pCachePriv->Num512x512 = Num512; } if(Num256) { - pCachePriv->Info256 = xcalloc(Num256, sizeof(XAACacheInfoRec)); + pCachePriv->Info256 = calloc(Num256, sizeof(XAACacheInfoRec)); if(!pCachePriv->Info256) Num256 = 0; if(Num256) TransferList(List256, pCachePriv->Info256, Num256); FreeList(List256); pCachePriv->Num256x256 = Num256; } if(Num128) { - pCachePriv->Info128 = xcalloc(Num128, sizeof(XAACacheInfoRec)); + pCachePriv->Info128 = calloc(Num128, sizeof(XAACacheInfoRec)); if(!pCachePriv->Info128) Num128 = 0; if(Num128) TransferList(List128, pCachePriv->Info128, Num128); FreeList(List128); @@ -991,7 +991,7 @@ XAAInitPixmapCache( } if(NumPartial) { - pCachePriv->InfoPartial = xcalloc(NumPartial, sizeof(XAACacheInfoRec)); + pCachePriv->InfoPartial = calloc(NumPartial, sizeof(XAACacheInfoRec)); if(!pCachePriv->InfoPartial) NumPartial = 0; if(NumPartial) TransferList(ListPartial, pCachePriv->InfoPartial, NumPartial); @@ -1000,7 +1000,7 @@ XAAInitPixmapCache( } if(NumColor) { - pCachePriv->InfoColor = xcalloc(NumColor, sizeof(XAACacheInfoRec)); + pCachePriv->InfoColor = calloc(NumColor, sizeof(XAACacheInfoRec)); if(!pCachePriv->InfoColor) NumColor = 0; if(NumColor) TransferList(ListColor, pCachePriv->InfoColor, NumColor); FreeList(ListColor); @@ -1008,7 +1008,7 @@ XAAInitPixmapCache( } if(NumMono) { - pCachePriv->InfoMono = xcalloc(NumMono, sizeof(XAACacheInfoRec)); + pCachePriv->InfoMono = calloc(NumMono, sizeof(XAACacheInfoRec)); if(!pCachePriv->InfoMono) NumMono = 0; if(NumMono) TransferList(ListMono, pCachePriv->InfoMono, NumMono); FreeList(ListMono); @@ -1557,7 +1557,7 @@ XAACacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix) pad = BitmapBytePad(pCache->w * bpp); dwords = bytes_to_int32(pad); - dstPtr = data = (unsigned char*)xalloc(pad * pCache->h); + dstPtr = data = (unsigned char*)malloc(pad * pCache->h); srcPtr = (unsigned char*)pPix->devPrivate.ptr; if(infoRec->ScreenToScreenColorExpandFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST) @@ -1588,7 +1588,7 @@ XAACacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix) pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data, pad, bpp, pScrn->depth); - xfree(data); + free(data); return pCache; } @@ -1970,7 +1970,7 @@ XAAWriteMono8x8PatternToCache( pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel); - data = (unsigned char*)xalloc(pad * pCache->h); + data = (unsigned char*)malloc(pad * pCache->h); if(!data) return; if(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_ORIGIN) { @@ -1994,7 +1994,7 @@ XAAWriteMono8x8PatternToCache( (*infoRec->WritePixmapToCache)(pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data, pad, pScrn->bitsPerPixel, pScrn->depth); - xfree(data); + free(data); } void @@ -2015,7 +2015,7 @@ XAAWriteColor8x8PatternToCache( if(pixPriv->flags & REDUCIBLE_TO_2_COLOR) { CARD32* ptr; pad = BitmapBytePad(pCache->w); - data = (unsigned char*)xalloc(pad * pCache->h); + data = (unsigned char*)malloc(pad * pCache->h); if(!data) return; if(infoRec->Color8x8PatternFillFlags & @@ -2040,7 +2040,7 @@ XAAWriteColor8x8PatternToCache( (*infoRec->WriteBitmapToCache)(pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data, pad, pCache->fg, pCache->bg); - xfree(data); + free(data); return; } @@ -2049,7 +2049,7 @@ XAAWriteColor8x8PatternToCache( w = min(8,pPix->drawable.width); pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel); - data = (unsigned char*)xalloc(pad * pCache->h); + data = (unsigned char*)malloc(pad * pCache->h); if(!data) return; /* Write and expand horizontally. */ @@ -2088,7 +2088,7 @@ XAAWriteColor8x8PatternToCache( (*infoRec->WritePixmapToCache)(pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data, pad, pScrn->bitsPerPixel, pScrn->depth); - xfree(data); + free(data); } diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c index e059d3d65..38ef21e85 100644 --- a/hw/xfree86/xaa/xaaPict.c +++ b/hw/xfree86/xaa/xaaPict.c @@ -483,7 +483,7 @@ XAACompositeSrcCopy (PicturePtr pSrc, REGION_UNINIT(pScreen, ®ion); return; } - pptSrc = xalloc(sizeof(DDXPointRec) * nbox); + pptSrc = malloc(sizeof(DDXPointRec) * nbox); if (!pptSrc) { REGION_UNINIT(pScreen, ®ion); return; @@ -501,7 +501,7 @@ XAACompositeSrcCopy (PicturePtr pSrc, XAADoBitBlt(pSrc->pDrawable, pDst->pDrawable, &infoRec->ScratchGC, ®ion, pptSrc); - xfree(pptSrc); + free(pptSrc); REGION_UNINIT(pScreen, ®ion); return; } diff --git a/hw/xfree86/xaa/xaaStateChange.c b/hw/xfree86/xaa/xaaStateChange.c index f33261453..0e86e67e4 100644 --- a/hw/xfree86/xaa/xaaStateChange.c +++ b/hw/xfree86/xaa/xaaStateChange.c @@ -1500,7 +1500,7 @@ XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec) XAAStateWrapPtr pStatePriv; int i = 0; - if(!(pStatePriv = xalloc(sizeof(XAAStateWrapRec)))) return FALSE; + if(!(pStatePriv = malloc(sizeof(XAAStateWrapRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, XAAStateKey, pStatePriv); pStatePriv->RestoreAccelState = infoRec->RestoreAccelState; pStatePriv->pScrn = pScrn; diff --git a/hw/xfree86/xaa/xaaTEGlyph.c b/hw/xfree86/xaa/xaaTEGlyph.c index 41e638e5c..510c387b7 100644 --- a/hw/xfree86/xaa/xaaTEGlyph.c +++ b/hw/xfree86/xaa/xaaTEGlyph.c @@ -301,7 +301,7 @@ EXPNAME(XAATEGlyphRenderer3)( } dwords = ((3 * w + 31) >> 5) * h; - mem = (CARD32*)xalloc(((w + 31) >> 3) * sizeof(char)); + mem = (CARD32*)malloc(((w + 31) >> 3) * sizeof(char)); if (!mem) return; (*infoRec->SubsequentCPUToScreenColorExpandFill)(pScrn, x, y, w, h, 0); @@ -321,7 +321,7 @@ EXPNAME(XAATEGlyphRenderer3)( DrawTextScanline3(base, mem, w); } - xfree(mem); + free(mem); if((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) && (dwords & 1)) { @@ -478,7 +478,7 @@ EXPNAME(XAATEGlyphRendererScanline3)( w += skipleft; x -= skipleft; - mem = (CARD32*)xalloc(((w + 31) >> 3) * sizeof(char)); + mem = (CARD32*)malloc(((w + 31) >> 3) * sizeof(char)); if (!mem) return; (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)( @@ -495,7 +495,7 @@ EXPNAME(XAATEGlyphRendererScanline3)( bufferNo = 0; } - xfree(mem); + free(mem); THE_END: diff --git a/hw/xfree86/xaa/xaaTEText.c b/hw/xfree86/xaa/xaaTEText.c index fc445726f..b18228310 100644 --- a/hw/xfree86/xaa/xaaTEText.c +++ b/hw/xfree86/xaa/xaaTEText.c @@ -273,7 +273,7 @@ XAAGlyphBltTEColorExpansion( if (!fallbackBits) { int fontHeight = Bottom - Top + 1; - fallbackBits = xcalloc (glyphWidth * fontHeight, 1); + fallbackBits = calloc(glyphWidth * fontHeight, 1); if (!fallbackBits) return; } @@ -300,7 +300,7 @@ XAAGlyphBltTEColorExpansion( fg, bg, rop, planemask); if (fallbackBits) - xfree (fallbackBits); + free(fallbackBits); } nbox--; pbox++; diff --git a/hw/xfree86/xaa/xaaWrapper.c b/hw/xfree86/xaa/xaaWrapper.c index d6409887c..2491492f5 100644 --- a/hw/xfree86/xaa/xaaWrapper.c +++ b/hw/xfree86/xaa/xaaWrapper.c @@ -271,7 +271,7 @@ xaaSetupWrapper(ScreenPtr pScreen, XAAInfoRecPtr infoPtr, int depth, SyncFunc *f if (!dixRequestPrivate(xaaWrapperGCPrivateKey, sizeof(xaaWrapperGCPrivRec))) return FALSE; - pScrPriv = (xaaWrapperScrPrivPtr) xalloc (sizeof (xaaWrapperScrPrivRec)); + pScrPriv = (xaaWrapperScrPrivPtr) malloc(sizeof (xaaWrapperScrPrivRec)); if (!pScrPriv) return FALSE; diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h index 129c1d6c4..a9a70da08 100644 --- a/hw/xfree86/xaa/xaalocal.h +++ b/hw/xfree86/xaa/xaalocal.h @@ -1709,7 +1709,7 @@ extern _X_EXPORT CARD32 XAAReverseBitOrder(CARD32 data); if(_pLink->pPix == pPix) { \ if(_prev) _prev->next = _pLink->next; \ else infoRec->OffscreenPixmaps = _pLink->next; \ - xfree(_pLink); \ + free(_pLink); \ break; \ } \ _prev = _pLink; \ diff --git a/hw/xnest/Color.c b/hw/xnest/Color.c index 2e6de15e4..b3f0fc488 100644 --- a/hw/xnest/Color.c +++ b/hw/xnest/Color.c @@ -52,7 +52,7 @@ xnestCreateColormap(ColormapPtr pCmap) pVisual = pCmap->pVisual; ncolors = pVisual->ColormapEntries; - pCmap->devPriv = (pointer)xalloc(sizeof(xnestPrivColormap)); + pCmap->devPriv = (pointer)malloc(sizeof(xnestPrivColormap)); xnestColormapPriv(pCmap)->colormap = XCreateColormap(xnestDisplay, @@ -64,7 +64,7 @@ xnestCreateColormap(ColormapPtr pCmap) switch (pVisual->class) { case StaticGray: /* read only */ - colors = (XColor *)xalloc(ncolors * sizeof(XColor)); + colors = (XColor *)malloc(ncolors * sizeof(XColor)); for (i = 0; i < ncolors; i++) colors[i].pixel = i; XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors); @@ -73,11 +73,11 @@ xnestCreateColormap(ColormapPtr pCmap) pCmap->red[i].co.local.green = colors[i].red; pCmap->red[i].co.local.blue = colors[i].red; } - xfree(colors); + free(colors); break; case StaticColor: /* read only */ - colors = (XColor *)xalloc(ncolors * sizeof(XColor)); + colors = (XColor *)malloc(ncolors * sizeof(XColor)); for (i = 0; i < ncolors; i++) colors[i].pixel = i; XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors); @@ -86,11 +86,11 @@ xnestCreateColormap(ColormapPtr pCmap) pCmap->red[i].co.local.green = colors[i].green; pCmap->red[i].co.local.blue = colors[i].blue; } - xfree(colors); + free(colors); break; case TrueColor: /* read only */ - colors = (XColor *)xalloc(ncolors * sizeof(XColor)); + colors = (XColor *)malloc(ncolors * sizeof(XColor)); red = green = blue = 0L; redInc = lowbit(pVisual->redMask); greenInc = lowbit(pVisual->greenMask); @@ -110,7 +110,7 @@ xnestCreateColormap(ColormapPtr pCmap) pCmap->green[i].co.local.green = colors[i].green; pCmap->blue[i].co.local.blue = colors[i].blue; } - xfree(colors); + free(colors); break; case GrayScale: /* read and write */ @@ -130,7 +130,7 @@ void xnestDestroyColormap(ColormapPtr pCmap) { XFreeColormap(xnestDisplay, xnestColormap(pCmap)); - xfree(pCmap->devPriv); + free(pCmap->devPriv); } #define SEARCH_PREDICATE \ @@ -194,13 +194,13 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen) xnestInstalledColormapWindows icws; int numWindows; - icws.cmapIDs = (Colormap *)xalloc(pScreen->maxInstalledCmaps * + icws.cmapIDs = (Colormap *)malloc(pScreen->maxInstalledCmaps * sizeof(Colormap)); icws.numCmapIDs = xnestListInstalledColormaps(pScreen, icws.cmapIDs); icws.numWindows = 0; WalkTree(pScreen, xnestCountInstalledColormapWindows, (pointer)&icws); if (icws.numWindows) { - icws.windows = (Window *)xalloc((icws.numWindows + 1) * sizeof(Window)); + icws.windows = (Window *)malloc((icws.numWindows + 1) * sizeof(Window)); icws.index = 0; WalkTree(pScreen, xnestGetInstalledColormapWindows, (pointer)&icws); icws.windows[icws.numWindows] = xnestDefaultWindows[pScreen->myNum]; @@ -211,22 +211,22 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen) numWindows = 0; } - xfree(icws.cmapIDs); + free(icws.cmapIDs); if (!xnestSameInstalledColormapWindows(icws.windows, icws.numWindows)) { if (xnestOldInstalledColormapWindows) - xfree(xnestOldInstalledColormapWindows); + free(xnestOldInstalledColormapWindows); #ifdef _XSERVER64 { int i; - Window64 *windows = (Window64 *)xalloc(numWindows * sizeof(Window64)); + Window64 *windows = (Window64 *)malloc(numWindows * sizeof(Window64)); for(i = 0; i < numWindows; ++i) windows[i] = icws.windows[i]; XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum], windows, numWindows); - xfree(windows); + free(windows); } #else XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum], @@ -264,14 +264,14 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen) #endif /* DUMB_WINDOW_MANAGERS */ } else - if (icws.windows) xfree(icws.windows); + if (icws.windows) free(icws.windows); } void xnestSetScreenSaverColormapWindow(ScreenPtr pScreen) { if (xnestOldInstalledColormapWindows) - xfree(xnestOldInstalledColormapWindows); + free(xnestOldInstalledColormapWindows); #ifdef _XSERVER64 { @@ -392,7 +392,7 @@ xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors) #ifdef _XSERVER64 { int i; - XColor *pColors64 = (XColor *)xalloc(nColors * sizeof(XColor) ); + XColor *pColors64 = (XColor *)malloc(nColors * sizeof(XColor) ); for(i = 0; i < nColors; ++i) { @@ -403,7 +403,7 @@ xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors) pColors64[i].flags = pColors[i].flags; } XStoreColors(xnestDisplay, xnestColormap(pCmap), pColors64, nColors); - xfree(pColors64); + free(pColors64); } #else XStoreColors(xnestDisplay, xnestColormap(pCmap), diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c index 12f47e725..9ae210228 100644 --- a/hw/xnest/Cursor.c +++ b/hw/xnest/Cursor.c @@ -107,7 +107,7 @@ xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) bg_color.green = pCursor->backGreen; bg_color.blue = pCursor->backBlue; - xnestSetCursorPriv(pCursor, pScreen, xalloc(sizeof(xnestPrivCursor))); + xnestSetCursorPriv(pCursor, pScreen, malloc(sizeof(xnestPrivCursor))); xnestCursor(pCursor, pScreen) = XCreatePixmapCursor(xnestDisplay, source, mask, &fg_color, &bg_color, pCursor->bits->xhot, pCursor->bits->yhot); @@ -122,7 +122,7 @@ Bool xnestUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { XFreeCursor(xnestDisplay, xnestCursor(pCursor, pScreen)); - xfree(xnestGetCursorPriv(pCursor, pScreen)); + free(xnestGetCursorPriv(pCursor, pScreen)); return True; } diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c index 01290417c..b78aff597 100644 --- a/hw/xnest/Display.c +++ b/hw/xnest/Display.c @@ -101,7 +101,7 @@ xnestOpenDisplay(int argc, char *argv[]) } xnestNumDefaultColormaps = xnestNumVisuals; - xnestDefaultColormaps = (Colormap *)xalloc(xnestNumDefaultColormaps * + xnestDefaultColormaps = (Colormap *)malloc(xnestNumDefaultColormaps * sizeof(Colormap)); for (i = 0; i < xnestNumDefaultColormaps; i++) xnestDefaultColormaps[i] = XCreateColormap(xnestDisplay, @@ -185,7 +185,7 @@ xnestCloseDisplay(void) the display connection. There is no need to generate extra protocol. */ - xfree(xnestDefaultColormaps); + free(xnestDefaultColormaps); XFree(xnestVisuals); XFree(xnestDepths); XFree(xnestPixmapFormats); diff --git a/hw/xnest/Font.c b/hw/xnest/Font.c index 7b388f0f4..f1ccd7e73 100644 --- a/hw/xnest/Font.c +++ b/hw/xnest/Font.c @@ -62,7 +62,7 @@ xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont) if (!name) return False; - priv = (pointer)xalloc(sizeof(xnestPrivFont)); + priv = (pointer)malloc(sizeof(xnestPrivFont)); FontSetPrivate(pFont, xnestFontPrivateIndex, priv); xnestFontPriv(pFont)->font_struct = XLoadQueryFont(xnestDisplay, name); @@ -79,7 +79,7 @@ xnestUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) if (xnestFontPriv(pFont)) { if (xnestFontStruct(pFont)) XFreeFont(xnestDisplay, xnestFontStruct(pFont)); - xfree(xnestFontPriv(pFont)); + free(xnestFontPriv(pFont)); FontSetPrivate(pFont, xnestFontPrivateIndex, NULL); } return True; diff --git a/hw/xnest/GC.c b/hw/xnest/GC.c index 65425e98f..4082bfc57 100644 --- a/hw/xnest/GC.c +++ b/hw/xnest/GC.c @@ -212,7 +212,7 @@ xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects) case CT_REGION: nRects = REGION_NUM_RECTS((RegionPtr)pValue); size = nRects * sizeof(*pRects); - pRects = (XRectangle *) xalloc(size); + pRects = (XRectangle *) malloc(size); pBox = REGION_RECTS((RegionPtr)pValue); for (i = nRects; i-- > 0; ) { pRects[i].x = pBox[i].x1; @@ -222,7 +222,7 @@ xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects) } XSetClipRectangles(xnestDisplay, xnestGC(pGC), 0, 0, pRects, nRects, Unsorted); - xfree((char *) pRects); + free((char *) pRects); break; case CT_PIXMAP: @@ -279,7 +279,7 @@ xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects) */ pGC->clientClip = (pointer) RECTS_TO_REGION(pGC->pScreen, nRects, (xRectangle *)pValue, type); - xfree(pValue); + free(pValue); pValue = pGC->clientClip; type = CT_REGION; diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c index 1835c7071..570866bc4 100644 --- a/hw/xnest/Keyboard.c +++ b/hw/xnest/Keyboard.c @@ -136,7 +136,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) max_keycode - min_keycode + 1, &mapWidth); len = (max_keycode - min_keycode + 1) * mapWidth; - keymap = (KeySym *)xalloc(len * sizeof(KeySym)); + keymap = (KeySym *)malloc(len * sizeof(KeySym)); for(i = 0; i < len; ++i) keymap[i] = keymap64[i]; XFree(keymap64); @@ -168,7 +168,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) xnestBell, xnestChangeKeyboardControl); XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); XkbFreeKeyboard(xkb, 0, False); - xfree(keymap); + free(keymap); break; case DEVICE_ON: xnestEventMask |= XNEST_KEYBOARD_EVENT_MASK; @@ -193,7 +193,7 @@ XkbError: InitKeyboardDeviceStruct(pDev, NULL, xnestBell, xnestChangeKeyboardControl); - xfree(keymap); + free(keymap); return Success; } diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c index 676a2ba95..583f877f3 100644 --- a/hw/xnest/Pixmap.c +++ b/hw/xnest/Pixmap.c @@ -79,7 +79,7 @@ xnestDestroyPixmap(PixmapPtr pPixmap) return TRUE; XFreePixmap(xnestDisplay, xnestPixmap(pPixmap)); dixFreePrivates(pPixmap->devPrivates); - xfree(pPixmap); + free(pPixmap); return TRUE; } diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index ca903d7ac..8c1c2449d 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -151,13 +151,13 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) if (!dixRequestPrivate(xnestGCPrivateKey, sizeof(xnestPrivGC))) return False; - visuals = (VisualPtr)xalloc(xnestNumVisuals * sizeof(VisualRec)); + visuals = (VisualPtr)malloc(xnestNumVisuals * sizeof(VisualRec)); numVisuals = 0; - depths = (DepthPtr)xalloc(MAXDEPTH * sizeof(DepthRec)); + depths = (DepthPtr)malloc(MAXDEPTH * sizeof(DepthRec)); depths[0].depth = 1; depths[0].numVids = 0; - depths[0].vids = (VisualID *)xalloc(MAXVISUALSPERDEPTH * sizeof(VisualID)); + depths[0].vids = (VisualID *)malloc(MAXVISUALSPERDEPTH * sizeof(VisualID)); numDepths = 1; for (i = 0; i < xnestNumVisuals; i++) { @@ -203,7 +203,7 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) depths[depthIndex].depth = xnestVisuals[i].depth; depths[depthIndex].numVids = 0; depths[depthIndex].vids = - (VisualID *)xalloc(MAXVISUALSPERDEPTH * sizeof(VisualID)); + (VisualID *)malloc(MAXVISUALSPERDEPTH * sizeof(VisualID)); numDepths++; } if (depths[depthIndex].numVids >= MAXVISUALSPERDEPTH) { @@ -215,7 +215,7 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) numVisuals++; } - visuals = (VisualPtr)xrealloc(visuals, numVisuals * sizeof(VisualRec)); + visuals = (VisualPtr)realloc(visuals, numVisuals * sizeof(VisualRec)); defaultVisual = visuals[xnestDefaultVisualIndex].vid; rootDepth = visuals[xnestDefaultVisualIndex].nplanes; @@ -407,10 +407,10 @@ xnestCloseScreen(int index, ScreenPtr pScreen) int i; for (i = 0; i < pScreen->numDepths; i++) - xfree(pScreen->allowedDepths[i].vids); - xfree(pScreen->allowedDepths); - xfree(pScreen->visuals); - xfree(pScreen->devPrivate); + free(pScreen->allowedDepths[i].vids); + free(pScreen->allowedDepths); + free(pScreen->visuals); + free(pScreen->devPrivate); /* If xnestDoFullGeneration all x resources will be destroyed upon closing diff --git a/hw/xquartz/GL/glcontextmodes.c b/hw/xquartz/GL/glcontextmodes.c index 326c8b235..eee7103ae 100644 --- a/hw/xquartz/GL/glcontextmodes.c +++ b/hw/xquartz/GL/glcontextmodes.c @@ -53,14 +53,14 @@ # ifdef XFree86Server # include <os.h> # include <string.h> -# define _mesa_malloc(b) xalloc(b) -# define _mesa_free(m) xfree(m) +# define _mesa_malloc(b) malloc(b) +# define _mesa_free(m) free(m) # define _mesa_memset memset # else # include <X11/Xlibint.h> # define _mesa_memset memset # define _mesa_malloc(b) Xmalloc(b) -# define _mesa_free(m) Xfree(m) +# define _mesa_free(m) free(m) # endif /* XFree86Server */ #endif /* !defined(IN_MINI_GLX) */ diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c index 8092cfa4f..f769ff2ec 100644 --- a/hw/xquartz/GL/indirect.c +++ b/hw/xquartz/GL/indirect.c @@ -222,7 +222,7 @@ __glXAquaScreenCreateContext(__GLXscreen *screen, GLAQUA_DEBUG_MSG("glXAquaScreenCreateContext\n"); - context = xcalloc(1, sizeof (__GLXAquaContext)); + context = calloc(1, sizeof (__GLXAquaContext)); if (context == NULL) return NULL; @@ -241,7 +241,7 @@ __glXAquaScreenCreateContext(__GLXscreen *screen, context->pixelFormat = makeFormat(conf); if (!context->pixelFormat) { - xfree(context); + free(context); return NULL; } @@ -253,7 +253,7 @@ __glXAquaScreenCreateContext(__GLXscreen *screen, if (gl_err != 0) { ErrorF("CGLCreateContext error: %s\n", CGLErrorString(gl_err)); CGLDestroyPixelFormat(context->pixelFormat); - xfree(context); + free(context); return NULL; } @@ -286,7 +286,7 @@ static void __glXAquaContextDestroy(__GLXcontext *baseContext) { if (context->pixelFormat != NULL) CGLDestroyPixelFormat(context->pixelFormat); - xfree(context); + free(context); } } @@ -566,7 +566,7 @@ static void __glXAquaScreenDestroy(__GLXscreen *screen) { GLAQUA_DEBUG_MSG("glXAquaScreenDestroy(%p)\n", screen); __glXScreenDestroy(screen); - xfree(screen); + free(screen); } /* This is called by __glXInitScreens(). */ @@ -578,7 +578,7 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { if (pScreen == NULL) return NULL; - screen = xcalloc(1, sizeof *screen); + screen = calloc(1, sizeof *screen); if(NULL == screen) return NULL; @@ -635,7 +635,7 @@ static void __glXAquaDrawableDestroy(__GLXdrawable *base) { *to validate the test, beyond using gdb with print. */ - xfree(glxPriv); + free(glxPriv); } static __GLXdrawable * @@ -648,7 +648,7 @@ __glXAquaScreenCreateDrawable(ClientPtr client, __GLXconfig *conf) { __GLXAquaDrawable *glxPriv; - glxPriv = xalloc(sizeof *glxPriv); + glxPriv = malloc(sizeof *glxPriv); if(glxPriv == NULL) return NULL; @@ -656,7 +656,7 @@ __glXAquaScreenCreateDrawable(ClientPtr client, memset(glxPriv, 0, sizeof *glxPriv); if(!__glXDrawableInit(&glxPriv->base, screen, pDraw, type, glxDrawId, conf)) { - xfree(glxPriv); + free(glxPriv); return NULL; } diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c index cecc90265..b209b7656 100644 --- a/hw/xquartz/GL/visualConfigs.c +++ b/hw/xquartz/GL/visualConfigs.c @@ -115,7 +115,7 @@ __GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) if(numConfigsPtr) *numConfigsPtr = numConfigs; - visualConfigs = xcalloc(sizeof(*visualConfigs), numConfigs); + visualConfigs = calloc(sizeof(*visualConfigs), numConfigs); if(NULL == visualConfigs) { ErrorF("xcalloc failure when allocating visualConfigs\n"); diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c index 15c86de00..8750f5d00 100644 --- a/hw/xquartz/applewm.c +++ b/hw/xquartz/applewm.c @@ -229,7 +229,7 @@ WMFreeClient (pointer data, XID id) { } updateEventMask (pHead); } - xfree ((pointer) pEvent); + free((pointer) pEvent); return 1; } @@ -242,9 +242,9 @@ WMFreeEvents (pointer data, XID id) { for (pCur = *pHead; pCur; pCur = pNext) { pNext = pCur->next; FreeResource (pCur->clientResource, ClientType); - xfree ((pointer) pCur); + free((pointer) pCur); } - xfree ((pointer) pHead); + free((pointer) pHead); eventMask = 0; return 1; } @@ -274,7 +274,7 @@ ProcAppleWMSelectInput (register ClientPtr client) } /* build the entry */ - pNewEvent = (WMEventPtr) xalloc (sizeof (WMEventRec)); + pNewEvent = (WMEventPtr) malloc(sizeof (WMEventRec)); if (!pNewEvent) return BadAlloc; pNewEvent->next = 0; @@ -296,7 +296,7 @@ ProcAppleWMSelectInput (register ClientPtr client) */ if (i != Success || !pHead) { - pHead = (WMEventPtr *) xalloc (sizeof (WMEventPtr)); + pHead = (WMEventPtr *) malloc(sizeof (WMEventPtr)); if (!pHead || !AddResource (eventResource, EventType, (pointer)pHead)) { @@ -323,7 +323,7 @@ ProcAppleWMSelectInput (register ClientPtr client) pNewEvent->next = pEvent->next; else *pHead = pEvent->next; - xfree (pEvent); + free(pEvent); updateEventMask (pHead); } } @@ -414,8 +414,8 @@ ProcAppleWMSetWindowMenu( REQUEST_AT_LEAST_SIZE(xAppleWMSetWindowMenuReq); nitems = stuff->nitems; - items = xalloc (sizeof (char *) * nitems); - shortcuts = xalloc (sizeof (char) * nitems); + items = malloc(sizeof (char *) * nitems); + shortcuts = malloc(sizeof (char) * nitems); max_len = (stuff->length << 2) - sizeof(xAppleWMSetWindowMenuReq); bytes = (char *) &stuff[1]; diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index 1fb158b26..580fe4ae0 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -194,7 +194,7 @@ static Bool DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv } // allocate space for private per screen storage - dfb = xalloc(sizeof(DarwinFramebufferRec)); + dfb = malloc(sizeof(DarwinFramebufferRec)); // SCREEN_PRIV(pScreen) = dfb; dixSetPrivate(&pScreen->devPrivates, darwinScreenKey, dfb); diff --git a/hw/xquartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c index 1de7af6dc..c3154b948 100644 --- a/hw/xquartz/pseudoramiX.c +++ b/hw/xquartz/pseudoramiX.c @@ -94,7 +94,7 @@ PseudoramiXAddScreen(int x, int y, int w, int h) if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) { pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1; - pseudoramiXScreens = xrealloc(pseudoramiXScreens, + pseudoramiXScreens = realloc(pseudoramiXScreens, pseudoramiXScreensAllocated * sizeof(PseudoramiXScreenRec)); } diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index a8c0d4b47..462be8794 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -122,7 +122,7 @@ Bool QuartzAddScreen( ScreenPtr pScreen) { // allocate space for private per screen Quartz specific storage - QuartzScreenPtr displayInfo = xcalloc(sizeof(QuartzScreenRec), 1); + QuartzScreenPtr displayInfo = calloc(sizeof(QuartzScreenRec), 1); // QUARTZ_PRIV(pScreen) = displayInfo; dixSetPrivate(&pScreen->devPrivates, quartzScreenKey, displayInfo); diff --git a/hw/xquartz/xpr/dri.c b/hw/xquartz/xpr/dri.c index 0a58b29f3..3b14581d0 100644 --- a/hw/xquartz/xpr/dri.c +++ b/hw/xquartz/xpr/dri.c @@ -205,7 +205,7 @@ DRIScreenInit(ScreenPtr pScreen) DRIScreenPrivPtr pDRIPriv; int i; - pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec)); + pDRIPriv = (DRIScreenPrivPtr) calloc(1, sizeof(DRIScreenPrivRec)); if (!pDRIPriv) { dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, NULL); return FALSE; @@ -269,7 +269,7 @@ DRICloseScreen(ScreenPtr pScreen) DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv && pDRIPriv->directRenderingSupport) { - xfree(pDRIPriv); + free(pDRIPriv); dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, NULL); } } @@ -381,7 +381,7 @@ CreateSurfaceForWindow(ScreenPtr pScreen, WindowPtr pWin, xp_window_id *widPtr) xp_window_changes wc; /* allocate a DRI Window Private record */ - if (!(pDRIDrawablePriv = xalloc(sizeof(*pDRIDrawablePriv)))) { + if (!(pDRIDrawablePriv = malloc(sizeof(*pDRIDrawablePriv)))) { return NULL; } @@ -395,7 +395,7 @@ CreateSurfaceForWindow(ScreenPtr pScreen, WindowPtr pWin, xp_window_id *widPtr) wid = x_cvt_vptr_to_uint(RootlessFrameForWindow(pWin, TRUE)); if (wid == 0) { - xfree(pDRIDrawablePriv); + free(pDRIDrawablePriv); return NULL; } @@ -403,7 +403,7 @@ CreateSurfaceForWindow(ScreenPtr pScreen, WindowPtr pWin, xp_window_id *widPtr) err = xp_create_surface(wid, &pDRIDrawablePriv->sid); if (err != Success) { - xfree(pDRIDrawablePriv); + free(pDRIDrawablePriv); return NULL; } @@ -414,7 +414,7 @@ CreateSurfaceForWindow(ScreenPtr pScreen, WindowPtr pWin, xp_window_id *widPtr) if (err != Success) { xp_destroy_surface(pDRIDrawablePriv->sid); - xfree(pDRIDrawablePriv); + free(pDRIDrawablePriv); return NULL; } @@ -439,7 +439,7 @@ CreateSurfaceForPixmap(ScreenPtr pScreen, PixmapPtr pPix) { xp_error err; /* allocate a DRI Window Private record */ - if (!(pDRIDrawablePriv = xcalloc(1, sizeof(*pDRIDrawablePriv)))) { + if (!(pDRIDrawablePriv = calloc(1, sizeof(*pDRIDrawablePriv)))) { return NULL; } @@ -454,7 +454,7 @@ CreateSurfaceForPixmap(ScreenPtr pScreen, PixmapPtr pPix) { err = xp_create_surface(0, &pDRIDrawablePriv->sid); if (err != Success) { - xfree(pDRIDrawablePriv); + free(pDRIDrawablePriv); return NULL; } @@ -519,7 +519,7 @@ DRICreateSurface(ScreenPtr pScreen, Drawable id, client_id, key); if (err != Success) { xp_destroy_surface(pDRIDrawablePriv->sid); - xfree(pDRIDrawablePriv); + free(pDRIDrawablePriv); /* * Now set the dix privates to NULL that were previously set. @@ -637,7 +637,7 @@ DRIDrawablePrivDelete(pointer pResource, XID id) if (pDRIDrawablePriv->notifiers != NULL) x_hook_free(pDRIDrawablePriv->notifiers); - xfree(pDRIDrawablePriv); + free(pDRIDrawablePriv); if (pDrawable->type == DRAWABLE_WINDOW) { dixSetPrivate(&pWin->devPrivates, DRIWindowPrivKey, NULL); @@ -828,7 +828,7 @@ Bool DRICreatePixmap(ScreenPtr pScreen, Drawable id, pPix = (PixmapPtr)pDrawable; - shared = xalloc(sizeof(*shared)); + shared = malloc(sizeof(*shared)); if(NULL == shared) { FatalError("failed to allocate DRIPixmapBuffer in %s\n", __func__); } @@ -856,7 +856,7 @@ Bool DRICreatePixmap(ScreenPtr pScreen, Drawable id, S_IRUSR | S_IWUSR | S_IROTH | S_IWOTH); if(-1 == shared->fd) { - xfree(shared); + free(shared); return FALSE; } @@ -866,7 +866,7 @@ Bool DRICreatePixmap(ScreenPtr pScreen, Drawable id, ErrorF("failed to ftruncate (extend) file."); shm_unlink(shared->shmPath); close(shared->fd); - xfree(shared); + free(shared); return FALSE; } @@ -878,7 +878,7 @@ Bool DRICreatePixmap(ScreenPtr pScreen, Drawable id, ErrorF("failed to mmap shared memory."); shm_unlink(shared->shmPath); close(shared->fd); - xfree(shared); + free(shared); return FALSE; } @@ -938,7 +938,7 @@ DRIFreePixmapImp(DrawablePtr pDrawable) { close(shared->fd); munmap(shared->buffer, shared->length); shm_unlink(shared->shmPath); - xfree(shared); + free(shared); dixSetPrivate(&pPix->devPrivates, DRIPixmapBufferPrivKey, (pointer)NULL); diff --git a/hw/xquartz/xpr/driWrap.c b/hw/xquartz/xpr/driWrap.c index 8c57fd4bd..f1a5c83f5 100644 --- a/hw/xquartz/xpr/driWrap.c +++ b/hw/xquartz/xpr/driWrap.c @@ -533,7 +533,7 @@ DRIWrapInit(ScreenPtr pScreen) { if(!dixRequestPrivate(driWrapScreenKey, sizeof(DRIWrapScreenRec))) return FALSE; - pScreenPriv = xalloc(sizeof(*pScreenPriv)); + pScreenPriv = malloc(sizeof(*pScreenPriv)); if(NULL == pScreenPriv) return FALSE; diff --git a/hw/xquartz/xpr/x-hook.c b/hw/xquartz/xpr/x-hook.c index 5b850fe88..d9f011553 100644 --- a/hw/xquartz/xpr/x-hook.c +++ b/hw/xquartz/xpr/x-hook.c @@ -83,8 +83,8 @@ X_PFX (hook_run) (x_list *lst, void *arg) return; length = X_PFX (list_length) (lst); - fun = xalloc (sizeof (x_hook_function *) * length); - data = xalloc (sizeof (void *) * length); + fun = malloc(sizeof (x_hook_function *) * length); + data = malloc(sizeof (void *) * length); if(!fun || !data) { FatalError("Failed to allocate memory in %s\n", __func__); @@ -102,8 +102,8 @@ X_PFX (hook_run) (x_list *lst, void *arg) (*fun[i]) (arg, data[i]); } - xfree(fun); - xfree(data); + free(fun); + free(data); } X_EXTERN void diff --git a/hw/xquartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c index fbaf825de..c1c8b2005 100644 --- a/hw/xquartz/xpr/xprCursor.c +++ b/hw/xquartz/xpr/xprCursor.c @@ -95,7 +95,7 @@ load_cursor(CursorPtr src, int screen) const uint32_t *be_data=(uint32_t *) src->bits->argb; unsigned i; rowbytes = src->bits->width * sizeof (CARD32); - data = xalloc(rowbytes * src->bits->height); + data = malloc(rowbytes * src->bits->height); if(!data) { FatalError("Failed to allocate memory in %s\n", __func__); } @@ -121,7 +121,7 @@ load_cursor(CursorPtr src, int screen) /* round up to 8 pixel boundary so we can convert whole bytes */ rowbytes = ((src->bits->width * 4) + 31) & ~31; - data = xalloc(rowbytes * src->bits->height); + data = malloc(rowbytes * src->bits->height); if(!data) { FatalError("Failed to allocate memory in %s\n", __func__); } @@ -174,7 +174,7 @@ load_cursor(CursorPtr src, int screen) } err = xp_set_cursor(width, height, hot_x, hot_y, data, rowbytes); - xfree(data); + free(data); return err == Success; } @@ -360,7 +360,7 @@ QuartzInitCursor(ScreenPtr pScreen) if (!miDCInitialize(pScreen, &quartzScreenFuncsRec)) return FALSE; - ScreenPriv = xcalloc(1, sizeof(QuartzCursorScreenRec)); + ScreenPriv = calloc(1, sizeof(QuartzCursorScreenRec)); if (ScreenPriv == NULL) return FALSE; diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c index 735b2ba67..d574721b3 100644 --- a/hw/xquartz/xpr/xprScreen.c +++ b/hw/xquartz/xpr/xprScreen.c @@ -195,7 +195,7 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height) return; } - displayList = xalloc(displayCount * sizeof(CGDirectDisplayID)); + displayList = malloc(displayCount * sizeof(CGDirectDisplayID)); if(!displayList) FatalError("Unable to allocate memory for list of displays.\n"); CGGetActiveDisplayList(displayCount, displayList, &displayCount); @@ -232,7 +232,7 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height) frame.size.width, frame.size.height); } - xfree(displayList); + free(displayList); } /* diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index c12cd1fbf..5e0e917bc 100755 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -420,7 +420,7 @@ glxWinScreenDestroy(__GLXscreen *screen) { GLWIN_DEBUG_MSG("glxWinScreenDestroy(%p)", screen); __glXScreenDestroy(screen); - xfree(screen); + free(screen); } static int @@ -442,7 +442,7 @@ glxLogExtensions(const char *prefix, const char *extensions) { int length = 0; char *strl; - char *str = xalloc(strlen(extensions) + 1); + char *str = malloc(strlen(extensions) + 1); if (str == NULL) { @@ -480,7 +480,7 @@ glxLogExtensions(const char *prefix, const char *extensions) ErrorF("\n"); - xfree(str); + free(str); } /* This is called by GlxExtensionInit() asking the GLX provider if it can handle the screen... */ @@ -507,7 +507,7 @@ glxWinScreenProbe(ScreenPtr pScreen) return NULL; } - screen = xcalloc(1, sizeof(glxWinScreen)); + screen = calloc(1, sizeof(glxWinScreen)); if (NULL == screen) return NULL; @@ -685,7 +685,7 @@ glxWinScreenProbe(ScreenPtr pScreen) { if (screen->base.GLXextensions != NULL) { - xfree(screen->base.GLXextensions); + free(screen->base.GLXextensions); } screen->base.GLXextensions = xnfalloc(buffer_size); @@ -702,7 +702,7 @@ glxWinScreenProbe(ScreenPtr pScreen) // if (screen->has_WGL_ARB_pbuffer && glx_sgi_make_current_read) { - xfree(screen->base.GLXversion); + free(screen->base.GLXversion); if (screen->has_WGL_ARB_multisample) { @@ -897,7 +897,7 @@ glxWinDrawableDestroy(__GLXdrawable *base) } GLWIN_DEBUG_MSG("glxWinDestroyDrawable"); - xfree(glxPriv); + free(glxPriv); } static __GLXdrawable * @@ -909,7 +909,7 @@ glxWinCreateDrawable(__GLXscreen *screen, { __GLXWinDrawable *glxPriv; - glxPriv = xalloc(sizeof *glxPriv); + glxPriv = malloc(sizeof *glxPriv); if (glxPriv == NULL) return NULL; @@ -917,7 +917,7 @@ glxWinCreateDrawable(__GLXscreen *screen, memset(glxPriv, 0, sizeof *glxPriv); if(!__glXDrawableInit(&glxPriv->base, screen, pDraw, type, drawId, conf)) { - xfree(glxPriv); + free(glxPriv); return NULL; } @@ -1517,7 +1517,7 @@ glxWinContextDestroy(__GLXcontext *base) gc->ctx = NULL; } - xfree(gc); + free(gc); } } @@ -1535,7 +1535,7 @@ glxWinCreateContext(__GLXscreen *screen, glxWinReleaseTexImage }; - context = (__GLXWinContext *)xcalloc(1, sizeof(__GLXWinContext)); + context = (__GLXWinContext *)calloc(1, sizeof(__GLXWinContext)); if (!context) return NULL; @@ -1749,7 +1749,7 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen *screen) GLWIN_DEBUG_MSG("DescribePixelFormat says %d possible pixel formats", numConfigs); /* alloc */ - result = xalloc(sizeof(GLXWinConfig) * numConfigs); + result = malloc(sizeof(GLXWinConfig) * numConfigs); if (NULL == result) { @@ -1992,7 +1992,7 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen *screen) GLWIN_DEBUG_MSG("wglGetPixelFormatAttribivARB says %d possible pixel formats", numConfigs); /* alloc */ - result = xalloc(sizeof(GLXWinConfig) * numConfigs); + result = malloc(sizeof(GLXWinConfig) * numConfigs); if (NULL == result) { diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 5abaa031c..26bb856e9 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -223,7 +223,7 @@ if (fDebugProcMsg) \ int iLength; \ pszTemp = Xprintf (str, ##__VA_ARGS__); \ MessageBox (NULL, pszTemp, szFunctionName, MB_OK); \ - xfree (pszTemp); \ + free(pszTemp); \ } #else #define DEBUG_MSG(str,...) diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c index f4c400582..f0eec0446 100644 --- a/hw/xwin/winauth.c +++ b/hw/xwin/winauth.c @@ -150,7 +150,7 @@ winGenerateAuthorization (void) #ifdef XCSECURITY /* Allocate structure for additional auth information */ pAuth = (SecurityAuthorizationPtr) - xalloc (sizeof (SecurityAuthorizationRec)); + malloc(sizeof (SecurityAuthorizationRec)); if (!(pAuth)) { ErrorF ("winGenerateAuthorization - Failed allocating " @@ -186,7 +186,7 @@ winGenerateAuthorization (void) auth_bailout: if (fFreeAuth) - xfree (pAuth); + free(pAuth); return FALSE; } diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c index b05867ba9..971d381a3 100644 --- a/hw/xwin/winconfig.c +++ b/hw/xwin/winconfig.c @@ -393,10 +393,10 @@ winConfigKeyboard (DeviceIntPtr pDevice) (1000 / g_winInfo.keyboard.rate) < 1) { winErrorFVerb (2, "\"%s\" is not a valid AutoRepeat value", s); - xfree(s); + free(s); return FALSE; } - xfree(s); + free(s); winMsg (X_CONFIG, "AutoRepeat: %ld %ld\n", g_winInfo.keyboard.delay, g_winInfo.keyboard.rate); } diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c index a8153535f..3ec9b78ff 100755 --- a/hw/xwin/windialogs.c +++ b/hw/xwin/windialogs.c @@ -365,7 +365,7 @@ winExitDlgProc (HWND hDialog, UINT message, /* Set the number of connected clients */ SetWindowText (GetDlgItem (hDialog, IDC_CLIENTS_CONNECTED), pszConnectedClients); - xfree (pszConnectedClients); + free(pszConnectedClients); } return TRUE; diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c index 191b9a921..2ff65bc9d 100644 --- a/hw/xwin/winerror.c +++ b/hw/xwin/winerror.c @@ -145,8 +145,8 @@ winMessageBoxF (const char *pszError, UINT uType, ...) winMessageBoxF_Cleanup: if (pszErrorF) - xfree (pszErrorF); + free(pszErrorF); if (pszMsgBox) - xfree (pszMsgBox); + free(pszMsgBox); #undef MESSAGEBOXF } diff --git a/hw/xwin/winvideo.c b/hw/xwin/winvideo.c index 529ca76d3..4cdb3c485 100755 --- a/hw/xwin/winvideo.c +++ b/hw/xwin/winvideo.c @@ -143,7 +143,7 @@ winSetupImageVideo (ScreenPtr pScreen) #endif XF86VideoAdaptorPtr adapt; - if (!(adapt = xcalloc (1, sizeof(XF86VideoAdaptorRec)))) + if (!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec)))) return NULL; adapt->type = XvWindowMask | XvInputMask | XvImageMask; diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c index 0e75a2c6a..30b672941 100644 --- a/hw/xwin/winwindow.c +++ b/hw/xwin/winwindow.c @@ -165,7 +165,7 @@ winCopyWindowNativeGDI (WindowPtr pWin, nbox = REGION_NUM_RECTS(prgnDst); /* Allocate source points for each box */ - if(!(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) + if(!(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) return; /* Set an iterator pointer */ @@ -204,7 +204,7 @@ winCopyWindowNativeGDI (WindowPtr pWin, } /* Cleanup the regions, etc. */ - xfree(pptSrc); + free(pptSrc); REGION_DESTROY(pWin->drawable.pScreen, prgnDst); } diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c index 7dce7e379..a996bc4ec 100755 --- a/hw/xwin/winwindowswm.c +++ b/hw/xwin/winwindowswm.c @@ -164,7 +164,7 @@ WMFreeClient (pointer data, XID id) } updateEventMask (pHead); } - xfree ((pointer) pEvent); + free((pointer) pEvent); return 1; } @@ -179,9 +179,9 @@ WMFreeEvents (pointer data, XID id) { pNext = pCur->next; FreeResource (pCur->clientResource, ClientType); - xfree ((pointer) pCur); + free((pointer) pCur); } - xfree ((pointer) pHead); + free((pointer) pHead); eventMask = 0; return 1; } @@ -212,7 +212,7 @@ ProcWindowsWMSelectInput (register ClientPtr client) } /* build the entry */ - pNewEvent = (WMEventPtr) xalloc (sizeof (WMEventRec)); + pNewEvent = (WMEventPtr) malloc(sizeof (WMEventRec)); if (!pNewEvent) return BadAlloc; pNewEvent->next = 0; @@ -234,7 +234,7 @@ ProcWindowsWMSelectInput (register ClientPtr client) */ if (!pHead) { - pHead = (WMEventPtr *) xalloc (sizeof (WMEventPtr)); + pHead = (WMEventPtr *) malloc(sizeof (WMEventPtr)); if (!pHead || !AddResource (eventResource, eventResourceType, (pointer)pHead)) { @@ -266,7 +266,7 @@ ProcWindowsWMSelectInput (register ClientPtr client) pNewEvent->next = pEvent->next; else *pHead = pEvent->next; - xfree (pEvent); + free(pEvent); updateEventMask (pHead); } } |