mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-25 21:02:21 +00:00
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:
parent
96c7ab27c3
commit
3f3ff971ec
345 changed files with 3011 additions and 3011 deletions
|
|
@ -107,7 +107,7 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
|
|||
|
||||
__glXDrawableRelease(drawable);
|
||||
|
||||
xfree(private);
|
||||
free(private);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -248,7 +248,7 @@ __glXDRIcontextDestroy(__GLXcontext *baseContext)
|
|||
|
||||
(*screen->core->destroyContext)(context->driContext);
|
||||
__glXContextDestroy(&context->base);
|
||||
xfree(context);
|
||||
free(context);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -386,7 +386,7 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
|
|||
|
||||
__glXScreenDestroy(baseScreen);
|
||||
|
||||
xfree(screen);
|
||||
free(screen);
|
||||
}
|
||||
|
||||
static __GLXcontext *
|
||||
|
|
@ -405,7 +405,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
|
|||
else
|
||||
driShare = NULL;
|
||||
|
||||
context = xcalloc(1, sizeof *context);
|
||||
context = calloc(1, sizeof *context);
|
||||
if (context == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -422,7 +422,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
|
|||
config->driConfig,
|
||||
driShare, context);
|
||||
if (context->driContext == NULL) {
|
||||
xfree(context);
|
||||
free(context);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -442,14 +442,14 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
|
|||
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
|
||||
__GLXDRIdrawable *private;
|
||||
|
||||
private = xcalloc(1, sizeof *private);
|
||||
private = calloc(1, sizeof *private);
|
||||
if (private == NULL)
|
||||
return NULL;
|
||||
|
||||
private->screen = driScreen;
|
||||
if (!__glXDrawableInit(&private->base, screen,
|
||||
pDraw, type, glxDrawId, glxConfig)) {
|
||||
xfree(private);
|
||||
free(private);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -460,7 +460,7 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
|
|||
private->base.waitX = __glXDRIdrawableWaitX;
|
||||
|
||||
if (DRI2CreateDrawable(client, pDraw, drawId)) {
|
||||
xfree(private);
|
||||
free(private);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -676,7 +676,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
|
|||
const __DRIconfig **driConfigs;
|
||||
int i;
|
||||
|
||||
screen = xcalloc(1, sizeof *screen);
|
||||
screen = calloc(1, sizeof *screen);
|
||||
if (screen == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -759,7 +759,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
|
|||
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
|
||||
if (buffer_size > 0) {
|
||||
if (screen->base.GLXextensions != NULL) {
|
||||
xfree(screen->base.GLXextensions);
|
||||
free(screen->base.GLXextensions);
|
||||
}
|
||||
|
||||
screen->base.GLXextensions = xnfalloc(buffer_size);
|
||||
|
|
@ -793,7 +793,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
|
|||
if (screen->driver)
|
||||
dlclose(screen->driver);
|
||||
|
||||
xfree(screen);
|
||||
free(screen);
|
||||
|
||||
LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue