summaryrefslogtreecommitdiff
path: root/fb
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 /fb
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 'fb')
-rw-r--r--fb/fballpriv.c2
-rw-r--r--fb/fbcmap.c14
-rw-r--r--fb/fbcopy.c4
-rw-r--r--fb/fboverlay.c2
-rw-r--r--fb/fbpixmap.c4
-rw-r--r--fb/fbscreen.c14
6 files changed, 20 insertions, 20 deletions
diff --git a/fb/fballpriv.c b/fb/fballpriv.c
index c40796c11..569391b93 100644
--- a/fb/fballpriv.c
+++ b/fb/fballpriv.c
@@ -61,7 +61,7 @@ fbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCKey)
{
FbScreenPrivPtr pScreenPriv;
- pScreenPriv = (FbScreenPrivPtr) xalloc (sizeof (FbScreenPrivRec));
+ pScreenPriv = (FbScreenPrivPtr) malloc(sizeof (FbScreenPrivRec));
if (!pScreenPriv)
return FALSE;
dixSetPrivate(&pScreen->devPrivates, fbScreenPrivateKey, pScreenPriv);
diff --git a/fb/fbcmap.c b/fb/fbcmap.c
index b775bc335..ce6fcd53d 100644
--- a/fb/fbcmap.c
+++ b/fb/fbcmap.c
@@ -388,7 +388,7 @@ fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB,
{
fbVisualsPtr new, *prev, v;
- new = (fbVisualsPtr) xalloc (sizeof *new);
+ new = (fbVisualsPtr) malloc(sizeof *new);
if (!new)
return FALSE;
if (!redMask || !greenMask || !blueMask)
@@ -485,12 +485,12 @@ fbInitVisuals (VisualPtr *visualp,
ndepth++;
nvisual += visuals->count;
}
- depth = (DepthPtr) xalloc (ndepth * sizeof (DepthRec));
- visual = (VisualPtr) xalloc (nvisual * sizeof (VisualRec));
+ depth = (DepthPtr) malloc(ndepth * sizeof (DepthRec));
+ visual = (VisualPtr) malloc(nvisual * sizeof (VisualRec));
if (!depth || !visual)
{
- xfree (depth);
- xfree (visual);
+ free(depth);
+ free(visual);
return FALSE;
}
*depthp = depth;
@@ -506,7 +506,7 @@ fbInitVisuals (VisualPtr *visualp,
vid = NULL;
if (nvtype)
{
- vid = (VisualID *) xalloc (nvtype * sizeof (VisualID));
+ vid = (VisualID *) malloc(nvtype * sizeof (VisualID));
if (!vid)
return FALSE;
}
@@ -547,7 +547,7 @@ fbInitVisuals (VisualPtr *visualp,
vid++;
visual++;
}
- xfree (visuals);
+ free(visuals);
}
fbVisuals = NULL;
visual = *visualp;
diff --git a/fb/fbcopy.c b/fb/fbcopy.c
index 07eb663c6..9a7c49ac3 100644
--- a/fb/fbcopy.c
+++ b/fb/fbcopy.c
@@ -275,7 +275,7 @@ fbCopyNto1 (DrawablePtr pSrcDrawable,
height = pbox->y2 - pbox->y1;
tmpStride = ((width + FB_STIP_MASK) >> FB_STIP_SHIFT);
- tmp = xalloc (tmpStride * height * sizeof (FbStip));
+ tmp = malloc(tmpStride * height * sizeof (FbStip));
if (!tmp)
return;
@@ -313,7 +313,7 @@ fbCopyNto1 (DrawablePtr pSrcDrawable,
pPriv->and, pPriv->xor,
pPriv->bgand, pPriv->bgxor);
- xfree (tmp);
+ free(tmp);
fbFinishAccess (pDstDrawable);
fbFinishAccess (pSrcDrawable);
diff --git a/fb/fboverlay.c b/fb/fboverlay.c
index 99939e8bf..3eb1b032d 100644
--- a/fb/fboverlay.c
+++ b/fb/fboverlay.c
@@ -348,7 +348,7 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
VisualID defaultVisual;
FbOverlayScrPrivPtr pScrPriv;
- pScrPriv = xalloc (sizeof (FbOverlayScrPrivRec));
+ pScrPriv = malloc(sizeof (FbOverlayScrPrivRec));
if (!pScrPriv)
return FALSE;
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
index 311da9e62..c73f9f42c 100644
--- a/fb/fbpixmap.c
+++ b/fb/fbpixmap.c
@@ -101,7 +101,7 @@ fbDestroyPixmap (PixmapPtr pPixmap)
if(--pPixmap->refcnt)
return TRUE;
dixFreePrivates(pPixmap->devPrivates);
- xfree(pPixmap);
+ free(pPixmap);
return TRUE;
}
@@ -308,7 +308,7 @@ fbPixmapToRegion(PixmapPtr pPix)
pReg->extents.y2 = REGION_END(pReg)->y2;
if (pReg->data->numRects == 1)
{
- xfree(pReg->data);
+ free(pReg->data);
pReg->data = (RegDataPtr)NULL;
}
}
diff --git a/fb/fbscreen.c b/fb/fbscreen.c
index 53e2ada9f..9b789b0a8 100644
--- a/fb/fbscreen.c
+++ b/fb/fbscreen.c
@@ -33,12 +33,12 @@ fbCloseScreen (int index, ScreenPtr pScreen)
DepthPtr depths = pScreen->allowedDepths;
for (d = 0; d < pScreen->numDepths; d++)
- xfree (depths[d].vids);
- xfree (depths);
- xfree (pScreen->visuals);
- xfree (pScreen->devPrivate);
+ free(depths[d].vids);
+ free(depths);
+ free(pScreen->visuals);
+ free(pScreen->devPrivate);
#ifdef FB_SCREEN_PRIVATE
- xfree (dixLookupPrivate(&pScreen->devPrivates, fbGetScreenPrivateKey()));
+ free(dixLookupPrivate(&pScreen->devPrivates, fbGetScreenPrivateKey()));
#endif
return TRUE;
}
@@ -229,8 +229,8 @@ fbFinishScreenInit(ScreenPtr pScreen,
if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
&defaultVisual,((unsigned long)1<<(imagebpp-1)), 8))
{
- xfree (visuals);
- xfree (depths);
+ free(visuals);
+ free(depths);
return FALSE;
}
if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,