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

@@ -87,7 +87,7 @@ typedef struct {
static void
BitVectorDestroySet(RecordSetPtr pSet)
{
xfree(pSet);
free(pSet);
}
static unsigned long
@@ -199,7 +199,7 @@ BitVectorCreateSet(RecordSetInterval *pIntervals, int nIntervals,
}
else
{
pbvs = (BitVectorSetPtr)Xcalloc(memsize);
pbvs = (BitVectorSetPtr)calloc(1, memsize);
if (!pbvs) return NULL;
pbvs->baseSet.ops = &BitVectorSetOperations;
}
@@ -233,7 +233,7 @@ typedef struct {
static void
IntervalListDestroySet(RecordSetPtr pSet)
{
xfree(pSet);
free(pSet);
}
static unsigned long
@@ -302,7 +302,7 @@ IntervalListCreateSet(RecordSetInterval *pIntervals, int nIntervals,
if (nIntervals > 0)
{
stackIntervals = (RecordSetInterval *)xalloc(
stackIntervals = (RecordSetInterval *)malloc(
sizeof(RecordSetInterval) * nIntervals);
if (!stackIntervals) return NULL;
@@ -353,14 +353,14 @@ IntervalListCreateSet(RecordSetInterval *pIntervals, int nIntervals,
else
{
prls = (IntervalListSetPtr)
xalloc(sizeof(IntervalListSet) + nIntervals * sizeof(RecordSetInterval));
malloc(sizeof(IntervalListSet) + nIntervals * sizeof(RecordSetInterval));
if (!prls) goto bailout;
prls->baseSet.ops = &IntervalListSetOperations;
}
memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval));
prls->nIntervals = nIntervals;
bailout:
if (stackIntervals) xfree(stackIntervals);
if (stackIntervals) free(stackIntervals);
return (RecordSetPtr)prls;
}