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

@@ -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;