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:
@@ -144,7 +144,7 @@ miTriStrip (CARD8 op,
|
||||
if (npoint < 3)
|
||||
return;
|
||||
ntri = npoint - 2;
|
||||
tris = xalloc (ntri * sizeof (xTriangle));
|
||||
tris = malloc(ntri * sizeof (xTriangle));
|
||||
if (!tris)
|
||||
return;
|
||||
for (tri = tris; npoint >= 3; npoint--, points++, tri++)
|
||||
@@ -154,7 +154,7 @@ miTriStrip (CARD8 op,
|
||||
tri->p3 = points[2];
|
||||
}
|
||||
(*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
|
||||
xfree (tris);
|
||||
free(tris);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -176,7 +176,7 @@ miTriFan (CARD8 op,
|
||||
if (npoint < 3)
|
||||
return;
|
||||
ntri = npoint - 2;
|
||||
tris = xalloc (ntri * sizeof (xTriangle));
|
||||
tris = malloc(ntri * sizeof (xTriangle));
|
||||
if (!tris)
|
||||
return;
|
||||
first = points++;
|
||||
@@ -187,5 +187,5 @@ miTriFan (CARD8 op,
|
||||
tri->p3 = points[1];
|
||||
}
|
||||
(*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
|
||||
xfree (tris);
|
||||
free(tris);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user