summaryrefslogtreecommitdiffstats
path: root/src/glx/glx_query.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/glx_query.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/glx_query.c')
-rw-r--r--src/glx/glx_query.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glx/glx_query.c b/src/glx/glx_query.c
index efad13d376e..bbc2b79d83d 100644
--- a/src/glx/glx_query.c
+++ b/src/glx/glx_query.c
@@ -56,7 +56,7 @@ __glXQueryServerString(Display * dpy, int opcode, CARD32 screen, CARD32 name)
/* 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);
@@ -80,7 +80,7 @@ __glXGetString(Display * dpy, int opcode, CARD32 contextTag, CARD32 name)
/* 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);
@@ -146,7 +146,7 @@ __glXGetStringFromServer(Display * dpy, int opcode, CARD32 glxCode,
length = reply.length * 4;
numbytes = reply.size;
- buf = (char *) Xmalloc(numbytes);
+ buf = (char *) malloc(numbytes);
if (buf != NULL) {
_XRead(dpy, buf, numbytes);
length -= numbytes;