summaryrefslogtreecommitdiff
path: root/hw/dmx
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-05-06 01:44:06 +0700
committerMikhail Gusarov <dottedmag@dottedmag.net>2010-05-13 00:22:37 +0700
commit3f3ff971ecff9936cebafc813af9193b97bba89c (patch)
treefdbbad794a42488b7ffe41eed7aba4e498335f55 /hw/dmx
parent96c7ab27c383ec767f62a7a11e5fd76f86363fbc (diff)
Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw/dmx')
-rw-r--r--hw/dmx/dmx.c48
-rw-r--r--hw/dmx/dmx_glxvisuals.c4
-rw-r--r--hw/dmx/dmxcmap.c8
-rw-r--r--hw/dmx/dmxcursor.c4
-rw-r--r--hw/dmx/dmxfont.c28
-rw-r--r--hw/dmx/dmxgc.c4
-rw-r--r--hw/dmx/dmxinit.c10
-rw-r--r--hw/dmx/dmxpict.c26
-rw-r--r--hw/dmx/dmxpixmap.c2
-rw-r--r--hw/dmx/dmxprop.c8
-rw-r--r--hw/dmx/dmxscrinit.c4
-rw-r--r--hw/dmx/dmxsync.c2
-rw-r--r--hw/dmx/dmxwindow.c8
-rw-r--r--hw/dmx/glxProxy/glxcmds.c22
-rw-r--r--hw/dmx/glxProxy/glxext.c6
-rw-r--r--hw/dmx/glxProxy/glxscreens.c8
-rw-r--r--hw/dmx/glxProxy/glxsingle.c8
-rw-r--r--hw/dmx/glxProxy/glxswap.c10
-rw-r--r--hw/dmx/glxProxy/glxutil.c2
-rw-r--r--hw/dmx/glxProxy/glxvendor.c4
-rw-r--r--hw/dmx/glxProxy/glxvisuals.c2
-rw-r--r--hw/dmx/glxProxy/unpack.h2
-rw-r--r--hw/dmx/input/dmxinputinit.c24
-rw-r--r--hw/dmx/input/dmxmotion.c2
-rw-r--r--hw/dmx/input/lnx-keyboard.c2
-rw-r--r--hw/dmx/input/usb-keyboard.c2
26 files changed, 125 insertions, 125 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 */