summaryrefslogtreecommitdiffstats
path: root/src/glx/singlepix.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/singlepix.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/singlepix.c')
-rw-r--r--src/glx/singlepix.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/glx/singlepix.c b/src/glx/singlepix.c
index 3c06f8d2150..6348f828580 100644
--- a/src/glx/singlepix.c
+++ b/src/glx/singlepix.c
@@ -68,7 +68,7 @@ __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
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);
@@ -80,9 +80,9 @@ __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
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));
@@ -94,7 +94,7 @@ __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
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 {
@@ -155,8 +155,7 @@ void gl_dispatch_stub_GetSeparableFilterEXT (GLenum target, GLenum format,
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 */
@@ -186,7 +185,7 @@ void gl_dispatch_stub_GetSeparableFilterEXT (GLenum target, GLenum format,
__glEmptyImage(gc, 1, height, 1, 1, format, type, buf, column);
- Xfree((char *) buf);
+ free((char *) buf);
}
}
}