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>
This commit is contained in:
Mikhail Gusarov
2010-05-06 01:44:06 +07:00
parent 96c7ab27c3
commit 3f3ff971ec
345 changed files with 3011 additions and 3011 deletions

View File

@@ -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);
}
/*