summaryrefslogtreecommitdiff
path: root/src/glx/glxcmds.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2012-09-04 22:52:36 -0700
committerMatt Turner <mattst88@gmail.com>2012-09-05 22:28:49 -0700
commit7c7b7b068b1d0dc8e14b87dab5dbd4108f874f74 (patch)
tree9a6901c4b12cd5b2dbe3c7fce29cfcc7771a84de /src/glx/glxcmds.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 <brianp@vmware.com>
Diffstat (limited to 'src/glx/glxcmds.c')
-rw-r--r--src/glx/glxcmds.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 37c09336749..0b90b4255f9 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -669,7 +669,7 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap)
return None;
}
- glxDraw = Xmalloc(sizeof(*glxDraw));
+ glxDraw = malloc(sizeof(*glxDraw));
if (!glxDraw)
return None;
@@ -1267,7 +1267,7 @@ glXChooseVisual(Display * dpy, int screen, int *attribList)
&visualTemplate, &i);
if (newList) {
- Xfree(visualList);
+ free(visualList);
visualList = newList;
best_config = config;
}
@@ -1392,7 +1392,7 @@ __glXClientInfo(Display * dpy, int opcode)
SyncHandle();
#endif /* USE_XCB */
- Xfree(ext_str);
+ free(ext_str);
}
@@ -1628,7 +1628,7 @@ glXChooseFBConfig(Display * dpy, int screen,
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;
}
}
@@ -1682,7 +1682,7 @@ glXGetFBConfigs(Display * dpy, int screen, int *nelements)
}
}
- 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;
@@ -2454,7 +2454,7 @@ _X_HIDDEN char *
__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);