summaryrefslogtreecommitdiffstats
path: root/src/glx/glxext.c
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2012-09-04 22:52:36 -0700
committerMatt Turner <[email protected]>2012-09-05 22:28:49 -0700
commit7c7b7b068b1d0dc8e14b87dab5dbd4108f874f74 (patch)
tree9a6901c4b12cd5b2dbe3c7fce29cfcc7771a84de /src/glx/glxext.c
parent17a574d7cd8c541c902cc0da40362a32d965e77b (diff)
Remove Xcalloc/Xmalloc/Xfree calls
These calls allowed Xlib to use a custom memory allocator, but Xlib has used the standard C library functions since at least its initial import into git in 2003. It seems unlikely that it will grow a custom memory allocator. The functions now just add extra overhead. Replacing them will make future Coccinelle patches simpler. This patch has been generated by the following Coccinelle semantic patch: // Remove Xcalloc/Xmalloc/Xfree calls @@ expression E1, E2; @@ - Xcalloc (E1, E2) + calloc (E1, E2) @@ expression E; @@ - Xmalloc (E) + malloc (E) @@ expression E; @@ - Xfree (E) + free (E) @@ expression E; @@ - XFree (E) + free (E) Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/glx/glxext.c')
-rw-r--r--src/glx/glxext.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index a4e76c1c398..3827b583b7a 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -208,13 +208,13 @@ FreeScreenConfigs(struct glx_display * priv)
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;
}
@@ -231,9 +231,9 @@ glx_display_free(struct glx_display *priv)
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);
@@ -254,7 +254,7 @@ glx_display_free(struct glx_display *priv)
priv->dri2Display = NULL;
#endif
- Xfree((char *) priv);
+ free((char *) priv);
}
static int
@@ -614,7 +614,7 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops,
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;
@@ -638,7 +638,7 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops,
}
if (props != buf)
- Xfree(props);
+ free(props);
return modes;
}
@@ -741,14 +741,14 @@ glx_screen_cleanup(struct glx_screen *psc)
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);
}
/*
@@ -765,7 +765,7 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv)
** 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;
@@ -823,13 +823,13 @@ __glXInitialize(Display * dpy)
/* 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;
}
@@ -845,7 +845,7 @@ __glXInitialize(Display * dpy)
if (!QueryVersion(dpy, dpyPriv->majorOpcode,
&dpyPriv->majorVersion, &dpyPriv->minorVersion)
|| (dpyPriv->majorVersion == 1 && dpyPriv->minorVersion < 1)) {
- Xfree(dpyPriv);
+ free(dpyPriv);
_XUnlockMutex(_Xglobal_lock);
return NULL;
}
@@ -881,12 +881,12 @@ __glXInitialize(Display * dpy)
#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;
}