diff options
author | Matt Turner <[email protected]> | 2012-09-04 22:52:36 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2012-09-05 22:28:49 -0700 |
commit | 7c7b7b068b1d0dc8e14b87dab5dbd4108f874f74 (patch) | |
tree | 9a6901c4b12cd5b2dbe3c7fce29cfcc7771a84de /src/glx/XF86dri.c | |
parent | 17a574d7cd8c541c902cc0da40362a32d965e77b (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/XF86dri.c')
-rw-r--r-- | src/glx/XF86dri.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/glx/XF86dri.c b/src/glx/XF86dri.c index 5c181d6db9e..fe3a1551fa6 100644 --- a/src/glx/XF86dri.c +++ b/src/glx/XF86dri.c @@ -201,7 +201,7 @@ XF86DRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA, } 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(); @@ -302,7 +302,7 @@ XF86DRIGetClientDriverName(Display * dpy, int screen, 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(); @@ -521,7 +521,7 @@ XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable, 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); } @@ -532,7 +532,7 @@ XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable, 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); } @@ -582,7 +582,7 @@ XF86DRIGetDeviceInfo(Display * dpy, int screen, drm_handle_t * hFrameBuffer, *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(); |