_eglCleanupDisplay(disp);
if (GLX_dpy->visuals)
- XFree(GLX_dpy->visuals);
+ free(GLX_dpy->visuals);
if (GLX_dpy->fbconfigs)
- XFree(GLX_dpy->fbconfigs);
+ free(GLX_dpy->fbconfigs);
if (!disp->PlatformDisplay)
XCloseDisplay(GLX_dpy->dpy);
if (vinfo) {
GLX_surf->glx_drawable = GLX_drv->glXCreateGLXPixmap(GLX_dpy->dpy,
vinfo, GLX_surf->drawable);
- XFree(vinfo);
+ free(vinfo);
}
}
else {
while (modes != NULL) {
__GLcontextModes *const next = modes->next;
- Xfree(modes);
+ free(modes);
modes = next;
}
}
next = &base;
for (i = 0; i < count; i++) {
- *next = (__GLcontextModes *) Xmalloc(size);
+ *next = (__GLcontextModes *) malloc(size);
if (*next == NULL) {
_gl_context_modes_destroy(base);
base = NULL;
length = reply.length * 4;
numbytes = reply.size;
- buf = (char *) Xmalloc(numbytes);
+ buf = (char *) malloc(numbytes);
if (buf != NULL) {
_XRead(dpy, buf, numbytes);
length -= numbytes;
_gl_context_modes_destroy(psc->configs);
psc->configs = NULL; /* NOTE: just for paranoia */
}
- Xfree((char *) psc->serverGLXexts);
+ free((char *) psc->serverGLXexts);
}
- XFree((char *) priv->screenConfigs);
+ free((char *) priv->screenConfigs);
priv->screenConfigs = NULL;
}
priv = (__GLXdisplayPrivate *) extension->private_data;
FreeScreenConfigs(priv);
if (priv->serverGLXversion)
- Xfree((char *) priv->serverGLXversion);
+ free((char *) priv->serverGLXversion);
- Xfree((char *) priv);
+ free((char *) priv);
return 0;
}
if (prop_size <= sizeof(buf))
props = buf;
else
- props = Xmalloc(prop_size);
+ props = malloc(prop_size);
/* Read each config structure and convert it into our format */
m = modes;
}
if (props != buf)
- Xfree(props);
+ free(props);
return modes;
}
** First allocate memory for the array of per screen configs.
*/
screens = ScreenCount(dpy);
- priv->screenConfigs = Xmalloc(screens * sizeof *priv->screenConfigs);
+ priv->screenConfigs = malloc(screens * sizeof *priv->screenConfigs);
if (!priv->screenConfigs) {
return GL_FALSE;
}
}
for (i = 0; i < screens; i++) {
- psc = Xcalloc(1, sizeof *psc);
+ psc = calloc(1, sizeof *psc);
if (!psc)
return GL_FALSE;
getFBConfigs(psc, priv, i);
/*
** Allocate memory for all the pieces needed for this buffer.
*/
- private = (XExtData *) Xmalloc(sizeof(XExtData));
+ private = (XExtData *) malloc(sizeof(XExtData));
if (!private)
return NULL;
- dpyPriv = (__GLXdisplayPrivate *) Xcalloc(1, sizeof(__GLXdisplayPrivate));
+ dpyPriv = (__GLXdisplayPrivate *) calloc(1, sizeof(__GLXdisplayPrivate));
if (!dpyPriv) {
- Xfree(private);
+ free(private);
return NULL;
}
dpyPriv->dpy = dpy;
if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) {
- Xfree(dpyPriv);
- Xfree(private);
+ free(dpyPriv);
+ free(private);
return NULL;
}
if (xscr->dri_fd >= 0)
close(xscr->dri_fd);
if (xscr->dri_driver)
- Xfree(xscr->dri_driver);
+ free(xscr->dri_driver);
if (xscr->dri_device)
- Xfree(xscr->dri_device);
+ free(xscr->dri_device);
#ifdef GLX_DIRECT_RENDERING
/* xscr->glx_dpy will be destroyed with the X display */
#endif
if (xscr->visuals)
- XFree(xscr->visuals);
+ free(xscr->visuals);
FREE(xscr);
}
return vis;
}
else {
- XFree((void *) vis);
+ free((void *) vis);
return NULL;
}
}
*mc_type, *surface_flags, *subpic_max_w, *subpic_max_h);
}
- XFree(surface_info);
+ free(surface_info);
}
}
subpictures = XvMCListSubpictureTypes(dpy, port, surface_type_id, &num_subpics);
if (num_subpics < 1) {
if (subpictures)
- XFree(subpictures);
+ free(subpictures);
return BadMatch;
}
if (!subpictures)
}
}
- XFree(subpictures);
+ free(subpictures);
return i < num_subpics ? Success : BadMatch;
}
assert(XvMCDestroyContext(display, &context) == Success);
- XFree(subpics);
+ free(subpics);
XvUngrabPort(display, port_num, CurrentTime);
XCloseDisplay(display);
}
}
- XFree(surface_info);
+ free(surface_info);
}
}
}
if (screen == NULL)
goto fail;
- XFree(visinfo);
+ free(visinfo);
return screen;
fail:
FREE(xlib_handle);
if (visinfo)
- XFree(visinfo);
+ free(visinfo);
if (win)
XDestroyWindow(graw.display, win);
}
if (rep.length) {
- if (!(*busIdString = (char *) Xcalloc(rep.busIdStringLength + 1, 1))) {
+ if (!(*busIdString = (char *) calloc(rep.busIdStringLength + 1, 1))) {
_XEatData(dpy, ((rep.busIdStringLength + 3) & ~3));
UnlockDisplay(dpy);
SyncHandle();
if (rep.length) {
if (!
(*clientDriverName =
- (char *) Xcalloc(rep.clientDriverNameLength + 1, 1))) {
+ (char *) calloc(rep.clientDriverNameLength + 1, 1))) {
_XEatData(dpy, ((rep.clientDriverNameLength + 3) & ~3));
UnlockDisplay(dpy);
SyncHandle();
if (*numClipRects) {
int len = sizeof(drm_clip_rect_t) * (*numClipRects);
- *pClipRects = (drm_clip_rect_t *) Xcalloc(len, 1);
+ *pClipRects = (drm_clip_rect_t *) calloc(len, 1);
if (*pClipRects)
_XRead(dpy, (char *) *pClipRects, len);
}
if (*numBackClipRects) {
int len = sizeof(drm_clip_rect_t) * (*numBackClipRects);
- *pBackClipRects = (drm_clip_rect_t *) Xcalloc(len, 1);
+ *pBackClipRects = (drm_clip_rect_t *) calloc(len, 1);
if (*pBackClipRects)
_XRead(dpy, (char *) *pBackClipRects, len);
}
*devPrivateSize = rep.devPrivateSize;
if (rep.length) {
- if (!(*pDevPrivate = (void *) Xcalloc(rep.devPrivateSize, 1))) {
+ if (!(*pDevPrivate = (void *) calloc(rep.devPrivateSize, 1))) {
_XEatData(dpy, ((rep.devPrivateSize + 3) & ~3));
UnlockDisplay(dpy);
SyncHandle();
size = reply.length * 4;
if (size != 0) {
- void *buf = Xmalloc(size);
+ void *buf = malloc(size);
if (buf == NULL) {
_XEatData(dpy, size);
}
__glEmptyImage(gc, 3, width, height, depth, format, type, buf, dest);
- Xfree(buf);
+ free(buf);
}
}
}
/* TODO: Integrate this with apple_glx_create_context and make
* struct apple_glx_context inherit from struct glx_context. */
- gc = Xcalloc(1, sizeof (*gc));
+ gc = calloc(1, sizeof(*gc));
if (gc == NULL)
return NULL;
if (!glx_context_init(gc, psc, config)) {
- Xfree(gc);
+ free(gc);
return NULL;
}
{
struct glx_screen *psc;
- psc = Xmalloc(sizeof *psc);
+ psc = malloc(sizeof *psc);
if (psc == NULL)
return NULL;
if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) {
if (!(sp = *spp)) {
- sp = (__GLXattribute *) Xmalloc(sizeof(__GLXattribute));
+ sp = (__GLXattribute *) malloc(sizeof(__GLXattribute));
*spp = sp;
}
sp->mask = mask;
spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; spp++) {
sp = *spp;
if (sp) {
- XFree((char *) sp);
+ free((char *) sp);
}
else {
break;
gl_extension_string);
}
- Xfree(gl_extension_string);
+ free(gl_extension_string);
}
return False;
}
- *driverName = Xmalloc(rep.driverNameLength + 1);
+ *driverName = malloc(rep.driverNameLength + 1);
if (*driverName == NULL) {
_XEatData(dpy,
((rep.driverNameLength + 3) & ~3) +
_XReadPad(dpy, *driverName, rep.driverNameLength);
(*driverName)[rep.driverNameLength] = '\0';
- *deviceName = Xmalloc(rep.deviceNameLength + 1);
+ *deviceName = malloc(rep.deviceNameLength + 1);
if (*deviceName == NULL) {
- Xfree(*driverName);
+ free(*driverName);
_XEatData(dpy, ((rep.deviceNameLength + 3) & ~3));
UnlockDisplay(dpy);
SyncHandle();
*height = rep.height;
*outCount = rep.count;
- buffers = Xmalloc(rep.count * sizeof buffers[0]);
+ buffers = malloc(rep.count * sizeof buffers[0]);
if (buffers == NULL) {
_XEatData(dpy, rep.count * sizeof repBuffer);
UnlockDisplay(dpy);
*height = rep.height;
*outCount = rep.count;
- buffers = Xmalloc(rep.count * sizeof buffers[0]);
+ buffers = malloc(rep.count * sizeof buffers[0]);
if (buffers == NULL) {
_XEatData(dpy, rep.count * sizeof repBuffer);
UnlockDisplay(dpy);
driReleaseDrawables(&pcp->base);
if (context->extensions)
- XFree((char *) context->extensions);
+ free((char *) context->extensions);
(*psc->core->destroyContext) (pcp->driContext);
- Xfree(pcp);
+ free(pcp);
}
static Bool
shared = pcp_shared->driContext;
}
- pcp = Xmalloc(sizeof *pcp);
+ pcp = malloc(sizeof *pcp);
if (pcp == NULL)
return NULL;
memset(pcp, 0, sizeof *pcp);
if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
- Xfree(pcp);
+ free(pcp);
return NULL;
}
config->driConfig, shared, pcp);
if (pcp->driContext == NULL) {
- Xfree(pcp);
+ free(pcp);
return NULL;
}
shared = pcp_shared->driContext;
}
- pcp = Xmalloc(sizeof *pcp);
+ pcp = malloc(sizeof *pcp);
if (pcp == NULL) {
*error = __DRI_CTX_ERROR_NO_MEMORY;
goto error_exit;
error_exit:
if (pcp != NULL)
- Xfree(pcp);
+ free(pcp);
return NULL;
}
if (pdraw->base.xDrawable != pdraw->base.drawable)
DRI2DestroyDrawable(psc->base.dpy, pdraw->base.xDrawable);
- Xfree(pdraw);
+ free(pdraw);
}
static __GLXDRIdrawable *
struct dri2_display *pdp;
GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
- pdraw = Xmalloc(sizeof(*pdraw));
+ pdraw = malloc(sizeof(*pdraw));
if (!pdraw)
return NULL;
if (!pdraw->driDrawable) {
DRI2DestroyDrawable(psc->base.dpy, xDrawable);
- Xfree(pdraw);
+ free(pdraw);
return NULL;
}
if (__glxHashInsert(pdp->dri2Hash, xDrawable, pdraw)) {
(*psc->core->destroyDrawable) (pdraw->driDrawable);
DRI2DestroyDrawable(psc->base.dpy, xDrawable);
- Xfree(pdraw);
+ free(pdraw);
return None;
}
(*psc->core->destroyScreen) (psc->driScreen);
driDestroyConfigs(psc->driver_configs);
close(psc->fd);
- Xfree(psc);
+ free(psc);
}
/**
pdraw->height = *height;
process_buffers(pdraw, buffers, *out_count);
- Xfree(buffers);
+ free(buffers);
return pdraw->buffers;
}
pdraw->height = *height;
process_buffers(pdraw, buffers, *out_count);
- Xfree(buffers);
+ free(buffers);
return pdraw->buffers;
}
drm_magic_t magic;
int i;
- psc = Xmalloc(sizeof *psc);
+ psc = malloc(sizeof *psc);
if (psc == NULL)
return NULL;
psc->fd = -1;
if (!glx_screen_init(&psc->base, screen, priv)) {
- Xfree(psc);
+ free(psc);
return NULL;
}
if (!DRI2Connect(priv->dpy, RootWindow(priv->dpy, screen),
&driverName, &deviceName)) {
glx_screen_cleanup(&psc->base);
- XFree(psc);
+ free(psc);
InfoMessageF("screen %d does not appear to be DRI2 capable\n", screen);
return NULL;
}
psp->copySubBuffer = dri2CopySubBuffer;
__glXEnableDirectExtension(&psc->base, "GLX_MESA_copy_sub_buffer");
- Xfree(driverName);
- Xfree(deviceName);
+ free(driverName);
+ free(deviceName);
tmp = getenv("LIBGL_SHOW_FPS");
psc->show_fps = tmp && strcmp(tmp, "1") == 0;
if (psc->driver)
dlclose(psc->driver);
- Xfree(driverName);
- Xfree(deviceName);
+ free(driverName);
+ free(deviceName);
glx_screen_cleanup(&psc->base);
- XFree(psc);
+ free(psc);
return NULL;
}
struct dri2_display *pdp = (struct dri2_display *) dpy;
__glxHashDestroy(pdp->dri2Hash);
- Xfree(dpy);
+ free(dpy);
}
_X_HIDDEN __GLXDRIdrawable *
if (!DRI2QueryExtension(dpy, &eventBase, &errorBase))
return NULL;
- pdp = Xmalloc(sizeof *pdp);
+ pdp = malloc(sizeof *pdp);
if (pdp == NULL)
return NULL;
if (!DRI2QueryVersion(dpy, &pdp->driMajor, &pdp->driMinor)) {
- Xfree(pdp);
+ free(pdp);
return NULL;
}
pdp->dri2Hash = __glxHashCreate();
if (pdp->dri2Hash == NULL) {
- Xfree(pdp);
+ free(pdp);
return NULL;
}
if (driConfigs[i] == NULL)
return NULL;
- driConfig = Xmalloc(sizeof *driConfig);
+ driConfig = malloc(sizeof *driConfig);
if (driConfig == NULL)
return NULL;
Bool ret = DRI2Connect(dpy, RootWindow(dpy, scrNum), driverName, &dev);
if (ret)
- Xfree(dev);
+ free(dev);
return ret;
}
if (len >= 31)
return NULL;
memcpy(ret, driverName, len + 1);
- Xfree(driverName);
+ free(driverName);
return ret;
}
return NULL;
fd = drmOpenOnce(NULL, BusID, &newlyopened);
- Xfree(BusID); /* No longer needed */
+ free(BusID); /* No longer needed */
if (fd < 0) {
ErrorMessageF("drmOpenOnce failed (%s)\n", strerror(-fd));
goto handle_error;
}
- Xfree(driverName); /* No longer needed. */
+ free(driverName); /* No longer needed. */
/*
* Get device-specific info. pDevPriv will point to a struct
if (num_visuals > 0 && visuals->depth != DefaultDepth(dpy, scrn))
visual->visualRating = GLX_NON_CONFORMANT_CONFIG;
- XFree(visuals);
+ free(visuals);
}
}
drmUnmap((drmAddress) framebuffer.base, framebuffer.size);
if (framebuffer.dev_priv != NULL)
- Xfree(framebuffer.dev_priv);
+ free(framebuffer.dev_priv);
if (fd >= 0)
drmCloseOnce(fd);
driReleaseDrawables(&pcp->base);
if (context->extensions)
- XFree((char *) context->extensions);
+ free((char *) context->extensions);
(*psc->core->destroyContext) (pcp->driContext);
XF86DRIDestroyContext(psc->base.dpy, psc->base.scr, pcp->hwContextID);
- Xfree(pcp);
+ free(pcp);
}
static int
shared = pcp_shared->driContext;
}
- pcp = Xmalloc(sizeof *pcp);
+ pcp = malloc(sizeof *pcp);
if (pcp == NULL)
return NULL;
memset(pcp, 0, sizeof *pcp);
if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
- Xfree(pcp);
+ free(pcp);
return NULL;
}
if (!XF86DRICreateContextWithConfig(psc->base.dpy, psc->base.scr,
config->base.visualID,
&pcp->hwContextID, &hwContext)) {
- Xfree(pcp);
+ free(pcp);
return NULL;
}
renderType, shared, hwContext, pcp);
if (pcp->driContext == NULL) {
XF86DRIDestroyContext(psc->base.dpy, psc->base.scr, pcp->hwContextID);
- Xfree(pcp);
+ free(pcp);
return NULL;
}
(*psc->core->destroyDrawable) (pdp->driDrawable);
XF86DRIDestroyDrawable(psc->base.dpy, psc->base.scr, pdraw->drawable);
- Xfree(pdraw);
+ free(pdraw);
}
static __GLXDRIdrawable *
if (xDrawable != drawable)
return NULL;
- pdp = Xmalloc(sizeof *pdp);
+ pdp = malloc(sizeof *pdp);
if (!pdp)
return NULL;
if (!XF86DRICreateDrawable(psc->base.dpy, psc->base.scr,
drawable, &hwDrawable)) {
- Xfree(pdp);
+ free(pdp);
return NULL;
}
if (!pdp->driDrawable) {
XF86DRIDestroyDrawable(psc->base.dpy, psc->base.scr, drawable);
- Xfree(pdp);
+ free(pdp);
return NULL;
}
char *driverName;
int i;
- psc = Xcalloc(1, sizeof *psc);
+ psc = calloc(1, sizeof *psc);
if (psc == NULL)
return NULL;
memset(psc, 0, sizeof *psc);
if (!glx_screen_init(&psc->base, screen, priv)) {
- Xfree(psc);
+ free(psc);
return NULL;
}
}
psc->driver = driOpenDriver(driverName);
- Xfree(driverName);
+ free(driverName);
if (psc->driver == NULL)
goto cleanup;
if (psc->driver)
dlclose(psc->driver);
glx_screen_cleanup(&psc->base);
- Xfree(psc);
+ free(psc);
return NULL;
}
static void
driDestroyDisplay(__GLXDRIdisplay * dpy)
{
- Xfree(dpy);
+ free(dpy);
}
/*
return NULL;
}
- pdpyp = Xmalloc(sizeof *pdpyp);
+ pdpyp = malloc(sizeof *pdpyp);
if (!pdpyp) {
return NULL;
}
XDestroyDrawable(struct drisw_drawable * pdp, Display * dpy, XID drawable)
{
XDestroyImage(pdp->ximage);
- XFree(pdp->visinfo);
+ free(pdp->visinfo);
XFreeGC(dpy, pdp->gc);
XFreeGC(dpy, pdp->swapgc);
driReleaseDrawables(&pcp->base);
if (context->extensions)
- XFree((char *) context->extensions);
+ free((char *) context->extensions);
(*psc->core->destroyContext) (pcp->driContext);
- Xfree(pcp);
+ free(pcp);
}
static int
shared = pcp_shared->driContext;
}
- pcp = Xmalloc(sizeof *pcp);
+ pcp = malloc(sizeof *pcp);
if (pcp == NULL)
return NULL;
memset(pcp, 0, sizeof *pcp);
if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
- Xfree(pcp);
+ free(pcp);
return NULL;
}
(*psc->core->createNewContext) (psc->driScreen,
config->driConfig, shared, pcp);
if (pcp->driContext == NULL) {
- Xfree(pcp);
+ free(pcp);
return NULL;
}
shared = pcp_shared->driContext;
}
- pcp = Xmalloc(sizeof *pcp);
+ pcp = malloc(sizeof *pcp);
if (pcp == NULL)
return NULL;
memset(pcp, 0, sizeof *pcp);
if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
- Xfree(pcp);
+ free(pcp);
return NULL;
}
error,
pcp);
if (pcp->driContext == NULL) {
- Xfree(pcp);
+ free(pcp);
return NULL;
}
(*psc->core->destroyDrawable) (pdp->driDrawable);
XDestroyDrawable(pdp, pdraw->psc->dpy, pdraw->drawable);
- Xfree(pdp);
+ free(pdp);
}
static __GLXDRIdrawable *
Bool ret;
const __DRIswrastExtension *swrast = psc->swrast;
- pdp = Xmalloc(sizeof(*pdp));
+ pdp = malloc(sizeof(*pdp));
if (!pdp)
return NULL;
ret = XCreateDrawable(pdp, psc->base.dpy, xDrawable, modes->visualID);
if (!ret) {
- Xfree(pdp);
+ free(pdp);
return NULL;
}
if (!pdp->driDrawable) {
XDestroyDrawable(pdp, psc->base.dpy, xDrawable);
- Xfree(pdp);
+ free(pdp);
return NULL;
}
struct glx_config *configs = NULL, *visuals = NULL;
int i;
- psc = Xcalloc(1, sizeof *psc);
+ psc = calloc(1, sizeof *psc);
if (psc == NULL)
return NULL;
memset(psc, 0, sizeof *psc);
if (!glx_screen_init(&psc->base, screen, priv)) {
- Xfree(psc);
+ free(psc);
return NULL;
}
if (psc->driver)
dlclose(psc->driver);
glx_screen_cleanup(&psc->base);
- Xfree(psc);
+ free(psc);
CriticalErrorMessageF("failed to load driver: %s\n", SWRAST_DRIVER_NAME);
static void
driswDestroyDisplay(__GLXDRIdisplay * dpy)
{
- Xfree(dpy);
+ free(dpy);
}
/*
{
struct drisw_display *pdpyp;
- pdpyp = Xmalloc(sizeof *pdpyp);
+ pdpyp = malloc(sizeof *pdpyp);
if (pdpyp == NULL)
return NULL;
length = reply.length;
if (length) {
num_attributes = (use_glx_1_3) ? reply.numAttribs : length / 2;
- data = (CARD32 *) Xmalloc(length * sizeof(CARD32));
+ data = (CARD32 *) malloc(length * sizeof(CARD32));
if (data == NULL) {
/* Throw data on the floor */
_XEatData(dpy, length);
}
#endif
- Xfree(data);
+ free(data);
}
}
if (!opcode)
return None;
- glxDraw = Xmalloc(sizeof(*glxDraw));
+ glxDraw = malloc(sizeof(*glxDraw));
if (!glxDraw)
return None;
return None;
}
- XFree(visinfo);
+ free(visinfo);
return win;
#else
/* The spec doesn't mention this, but the Xorg server replies with
* a string already terminated with '\0'. */
uint32_t len = xcb_glx_query_server_string_string_length(reply);
- char *buf = Xmalloc(len);
+ char *buf = malloc(len);
memcpy(buf, xcb_glx_query_server_string_string(reply), len);
free(reply);
/* The spec doesn't mention this, but the Xorg server replies with
* a string already terminated with '\0'. */
uint32_t len = xcb_glx_get_string_string_length(reply);
- char *buf = Xmalloc(len);
+ char *buf = malloc(len);
memcpy(buf, xcb_glx_get_string_string(reply), len);
free(reply);
length = reply.length * 4;
numbytes = reply.size;
- buf = (char *) Xmalloc(numbytes);
+ buf = (char *) malloc(numbytes);
if (buf != NULL) {
_XRead(dpy, buf, numbytes);
length -= numbytes;
return None;
}
- glxDraw = Xmalloc(sizeof(*glxDraw));
+ glxDraw = malloc(sizeof(*glxDraw));
if (!glxDraw)
return None;
&visualTemplate, &i);
if (newList) {
- Xfree(visualList);
+ free(visualList);
visualList = newList;
best_config = config;
}
SyncHandle();
#endif /* USE_XCB */
- Xfree(ext_str);
+ free(ext_str);
}
if ((config_list != NULL) && (list_size > 0) && (attribList != NULL)) {
list_size = choose_visual(config_list, list_size, attribList, GL_TRUE);
if (list_size == 0) {
- XFree(config_list);
+ free(config_list);
config_list = NULL;
}
}
}
}
- config_list = Xmalloc(num_configs * sizeof *config_list);
+ config_list = malloc(num_configs * sizeof *config_list);
if (config_list != NULL) {
*nelements = num_configs;
i = 0;
__glXstrdup(const char *str)
{
char *copy;
- copy = (char *) Xmalloc(strlen(str) + 1);
+ copy = (char *) malloc(strlen(str) + 1);
if (!copy)
return NULL;
strcpy(copy, str);
if (psc->driScreen) {
psc->driScreen->destroyScreen(psc);
} else {
- Xfree(psc);
+ free(psc);
}
#else
- Xfree(psc);
+ free(psc);
#endif
}
- XFree((char *) priv->screens);
+ free((char *) priv->screens);
priv->screens = NULL;
}
FreeScreenConfigs(priv);
if (priv->serverGLXvendor)
- Xfree((char *) priv->serverGLXvendor);
+ free((char *) priv->serverGLXvendor);
if (priv->serverGLXversion)
- Xfree((char *) priv->serverGLXversion);
+ free((char *) priv->serverGLXversion);
__glxHashDestroy(priv->glXDrawHash);
priv->dri2Display = NULL;
#endif
- Xfree((char *) priv);
+ free((char *) priv);
}
static int
if (prop_size <= sizeof(buf))
props = buf;
else
- props = Xmalloc(prop_size);
+ props = malloc(prop_size);
/* Read each config structure and convert it into our format */
m = modes;
}
if (props != buf)
- Xfree(props);
+ free(props);
return modes;
}
if (psc->configs) {
glx_config_destroy_list(psc->configs);
if (psc->effectiveGLXexts)
- Xfree(psc->effectiveGLXexts);
+ free(psc->effectiveGLXexts);
psc->configs = NULL; /* NOTE: just for paranoia */
}
if (psc->visuals) {
glx_config_destroy_list(psc->visuals);
psc->visuals = NULL; /* NOTE: just for paranoia */
}
- Xfree((char *) psc->serverGLXexts);
+ free((char *) psc->serverGLXexts);
}
/*
** First allocate memory for the array of per screen configs.
*/
screens = ScreenCount(dpy);
- priv->screens = Xmalloc(screens * sizeof *priv->screens);
+ priv->screens = malloc(screens * sizeof *priv->screens);
if (!priv->screens)
return GL_FALSE;
/* Drop the lock while we create the display private. */
_XUnlockMutex(_Xglobal_lock);
- dpyPriv = Xcalloc(1, sizeof *dpyPriv);
+ dpyPriv = calloc(1, sizeof *dpyPriv);
if (!dpyPriv)
return NULL;
dpyPriv->codes = XInitExtension(dpy, __glXExtensionName);
if (!dpyPriv->codes) {
- Xfree(dpyPriv);
+ free(dpyPriv);
_XUnlockMutex(_Xglobal_lock);
return NULL;
}
if (!QueryVersion(dpy, dpyPriv->majorOpcode,
&dpyPriv->majorVersion, &dpyPriv->minorVersion)
|| (dpyPriv->majorVersion == 1 && dpyPriv->minorVersion < 1)) {
- Xfree(dpyPriv);
+ free(dpyPriv);
_XUnlockMutex(_Xglobal_lock);
return NULL;
}
#ifdef GLX_USE_APPLEGL
if (!applegl_create_display(dpyPriv)) {
- Xfree(dpyPriv);
+ free(dpyPriv);
return NULL;
}
#endif
if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) {
- Xfree(dpyPriv);
+ free(dpyPriv);
return NULL;
}
}
}
- ext_str = Xmalloc(ext_str_len + 1);
+ ext_str = malloc(ext_str_len + 1);
if (ext_str != NULL) {
point = ext_str;
__glXFreeVertexArrayState(gc);
if (gc->vendor)
- XFree((char *) gc->vendor);
+ free((char *) gc->vendor);
if (gc->renderer)
- XFree((char *) gc->renderer);
+ free((char *) gc->renderer);
if (gc->version)
- XFree((char *) gc->version);
+ free((char *) gc->version);
if (gc->extensions)
- XFree((char *) gc->extensions);
+ free((char *) gc->extensions);
__glFreeAttributeState(gc);
- XFree((char *) gc->buf);
- Xfree((char *) gc->client_state_private);
- XFree((char *) gc);
+ free((char *) gc->buf);
+ free((char *) gc->client_state_private);
+ free((char *) gc);
}
static Bool
}
/* Allocate our context record */
- gc = Xmalloc(sizeof *gc);
+ gc = malloc(sizeof *gc);
if (!gc) {
/* Out of memory */
return NULL;
glx_context_init(gc, psc, mode);
gc->isDirect = GL_FALSE;
gc->vtable = &indirect_context_vtable;
- state = Xmalloc(sizeof(struct __GLXattributeRec));
+ state = malloc(sizeof(struct __GLXattributeRec));
if (state == NULL) {
/* Out of memory */
- Xfree(gc);
+ free(gc);
return NULL;
}
gc->client_state_private = state;
*/
bufSize = (XMaxRequestSize(psc->dpy) * 4) - sz_xGLXRenderReq;
- gc->buf = (GLubyte *) Xmalloc(bufSize);
+ gc->buf = (GLubyte *) malloc(bufSize);
if (!gc->buf) {
- Xfree(gc->client_state_private);
- Xfree(gc);
+ free(gc->client_state_private);
+ free(gc);
return NULL;
}
gc->bufSize = bufSize;
{
struct glx_screen *psc;
- psc = Xmalloc(sizeof *psc);
+ psc = malloc(sizeof *psc);
if (psc == NULL)
return NULL;
if (stride != k) {
GLubyte *buf;
- buf = (GLubyte *) Xmalloc(compsize);
+ buf = (GLubyte *) malloc(compsize);
if (!buf) {
__glXSetError(gc, GL_OUT_OF_MEMORY);
return;
}
__glFillMap1d(k, order, stride, pnts, buf);
__glXSendLargeCommand(gc, pc, 32, buf, compsize);
- Xfree((char *) buf);
+ free((char *) buf);
}
else {
/* Data is already packed. Just send it out */
if (stride != k) {
GLubyte *buf;
- buf = (GLubyte *) Xmalloc(compsize);
+ buf = (GLubyte *) malloc(compsize);
if (!buf) {
__glXSetError(gc, GL_OUT_OF_MEMORY);
return;
}
__glFillMap1f(k, order, stride, pnts, buf);
__glXSendLargeCommand(gc, pc, 24, buf, compsize);
- Xfree((char *) buf);
+ free((char *) buf);
}
else {
/* Data is already packed. Just send it out */
if ((vstr != k) || (ustr != k * vord)) {
GLdouble *buf;
- buf = (GLdouble *) Xmalloc(compsize);
+ buf = (GLdouble *) malloc(compsize);
if (!buf) {
__glXSetError(gc, GL_OUT_OF_MEMORY);
return;
*/
__glFillMap2d(k, uord, vord, ustr, vstr, pnts, buf);
__glXSendLargeCommand(gc, pc, 52, buf, compsize);
- Xfree((char *) buf);
+ free((char *) buf);
}
else {
/* Data is already packed. Just send it out */
if ((vstr != k) || (ustr != k * vord)) {
GLfloat *buf;
- buf = (GLfloat *) Xmalloc(compsize);
+ buf = (GLfloat *) malloc(compsize);
if (!buf) {
__glXSetError(gc, GL_OUT_OF_MEMORY);
return;
*/
__glFillMap2f(k, uord, vord, ustr, vstr, pnts, buf);
__glXSendLargeCommand(gc, pc, 36, buf, compsize);
- Xfree((char *) buf);
+ free((char *) buf);
}
else {
/* Data is already packed. Just send it out */
GLubyte * pc, GLubyte * modes)
{
/* Allocate a temporary holding buffer */
- GLubyte *buf = (GLubyte *) Xmalloc(compsize);
+ GLubyte *buf = (GLubyte *) malloc(compsize);
if (!buf) {
__glXSetError(gc, GL_OUT_OF_MEMORY);
return;
__glXSendLargeCommand(gc, gc->pc, pc - gc->pc, buf, compsize);
/* Free buffer */
- Xfree((char *) buf);
+ free((char *) buf);
}
/************************************************************************/
pc += hdrlen;
/* Allocate a temporary holding buffer */
- buf = (GLubyte *) Xmalloc(bufsize);
+ buf = (GLubyte *) malloc(bufsize);
if (!buf) {
__glXSetError(gc, GL_OUT_OF_MEMORY);
return;
__glXSendLargeCommand(gc, gc->pc, (GLint) (pc - gc->pc), buf,
bufsize);
/* Free buffer */
- Xfree((char *) buf);
+ free((char *) buf);
}
}
*/
const size_t size = 7 + strlen((char *) s) + 4;
- gc->version = Xmalloc(size);
+ gc->version = malloc(size);
if (gc->version == NULL) {
/* If we couldn't allocate memory for the new string,
* make a best-effort and just copy the client-side version
else {
snprintf((char *) gc->version, size, "%u.%u (%s)",
client_major, client_minor, s);
- Xfree(s);
+ free(s);
s = gc->version;
}
}
#endif
__glXCalculateUsableGLExtensions(gc, (char *) s, major, minor);
- XFree(s);
+ free(s);
s = gc->extensions;
break;
}
heightsize = __glImageSize(height, 1, 1, format, type, 0);
/* Allocate a holding buffer to transform the data from */
- rowBuf = (GLubyte *) Xmalloc(widthsize);
+ rowBuf = (GLubyte *) malloc(widthsize);
if (!rowBuf) {
/* Throw data away */
_XEatData(dpy, compsize);
else {
__GLX_SINGLE_GET_CHAR_ARRAY(((char *) rowBuf), widthsize);
__glEmptyImage(gc, 1, width, 1, 1, format, type, rowBuf, row);
- Xfree((char *) rowBuf);
+ free((char *) rowBuf);
}
- colBuf = (GLubyte *) Xmalloc(heightsize);
+ colBuf = (GLubyte *) malloc(heightsize);
if (!colBuf) {
/* Throw data away */
_XEatData(dpy, compsize - __GLX_PAD(widthsize));
else {
__GLX_SINGLE_GET_CHAR_ARRAY(((char *) colBuf), heightsize);
__glEmptyImage(gc, 1, height, 1, 1, format, type, colBuf, column);
- Xfree((char *) colBuf);
+ free((char *) colBuf);
}
}
else {
const GLint heightsize =
__glImageSize(height, 1, 1, format, type, 0);
GLubyte *const buf =
- (GLubyte *) Xmalloc((widthsize > heightsize) ? widthsize :
- heightsize);
+ (GLubyte *) malloc((widthsize > heightsize) ? widthsize : heightsize);
if (buf == NULL) {
/* Throw data away */
__glEmptyImage(gc, 1, height, 1, 1, format, type, buf, column);
- Xfree((char *) buf);
+ free((char *) buf);
}
}
}
max_bm_width = (max_width + 7) / 8;
max_bm_height = max_height;
- bm = (GLubyte *) Xmalloc((max_bm_width * max_bm_height) * sizeof(GLubyte));
+ bm = (GLubyte *) malloc((max_bm_width * max_bm_height) * sizeof(GLubyte));
if (!bm) {
XFreeFontInfo(NULL, fs, 1);
__glXSetError(CC, GL_OUT_OF_MEMORY);
glEndList();
}
- Xfree(bm);
+ free(bm);
XFreeFontInfo(NULL, fs, 1);
XFreeGC(dpy, gc);
if (status != Success || actualType != overlayVisualsAtom ||
actualFormat != 32 || sizeData < 4) {
/* something went wrong */
- XFree((void *) ovInfo);
+ free((void *) ovInfo);
*numOverlays = 0;
return NULL;
}
/* found the visual */
if (/*ov->transparent_type==1 &&*/ ov->layer!=0) {
int level = ov->layer;
- XFree((void *) overlay_info);
+ free((void *) overlay_info);
return level;
}
else {
- XFree((void *) overlay_info);
+ free((void *) overlay_info);
return 0;
}
}
}
/* The visual ID was not found in the overlay list. */
- XFree((void *) overlay_info);
+ free((void *) overlay_info);
return 0;
}
/* found it! */
if (ov->transparent_type == 0) {
/* type 0 indicates no transparency */
- XFree((void *) overlay_info);
+ free((void *) overlay_info);
return -1;
}
else {
/* ov->value is the transparent pixel */
- XFree((void *) overlay_info);
+ free((void *) overlay_info);
return ov->value;
}
}
}
/* The visual ID was not found in the overlay list. */
- XFree((void *) overlay_info);
+ free((void *) overlay_info);
return -1;
}
return vis;
}
else {
- XFree((void *) vis);
+ free((void *) vis);
return NULL;
}
}
if (deepvis==NULL || vislist->depth > deepest) {
/* YES! found a satisfactory visual */
if (deepvis) {
- XFree( deepvis );
+ free(deepvis);
}
deepest = vislist->depth;
deepvis = vislist;