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:
@@ -95,7 +95,7 @@ load_cursor(CursorPtr src, int screen)
|
||||
const uint32_t *be_data=(uint32_t *) src->bits->argb;
|
||||
unsigned i;
|
||||
rowbytes = src->bits->width * sizeof (CARD32);
|
||||
data = xalloc(rowbytes * src->bits->height);
|
||||
data = malloc(rowbytes * src->bits->height);
|
||||
if(!data) {
|
||||
FatalError("Failed to allocate memory in %s\n", __func__);
|
||||
}
|
||||
@@ -121,7 +121,7 @@ load_cursor(CursorPtr src, int screen)
|
||||
|
||||
/* round up to 8 pixel boundary so we can convert whole bytes */
|
||||
rowbytes = ((src->bits->width * 4) + 31) & ~31;
|
||||
data = xalloc(rowbytes * src->bits->height);
|
||||
data = malloc(rowbytes * src->bits->height);
|
||||
if(!data) {
|
||||
FatalError("Failed to allocate memory in %s\n", __func__);
|
||||
}
|
||||
@@ -174,7 +174,7 @@ load_cursor(CursorPtr src, int screen)
|
||||
}
|
||||
|
||||
err = xp_set_cursor(width, height, hot_x, hot_y, data, rowbytes);
|
||||
xfree(data);
|
||||
free(data);
|
||||
return err == Success;
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ QuartzInitCursor(ScreenPtr pScreen)
|
||||
if (!miDCInitialize(pScreen, &quartzScreenFuncsRec))
|
||||
return FALSE;
|
||||
|
||||
ScreenPriv = xcalloc(1, sizeof(QuartzCursorScreenRec));
|
||||
ScreenPriv = calloc(1, sizeof(QuartzCursorScreenRec));
|
||||
if (ScreenPriv == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user