From 7c7b7b068b1d0dc8e14b87dab5dbd4108f874f74 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 4 Sep 2012 22:52:36 -0700 Subject: 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 --- src/mesa/drivers/x11/fakeglx.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/mesa/drivers/x11') diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index c30ba04a01c..d5a59b4566c 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -201,7 +201,7 @@ GetOverlayInfo(Display *dpy, int screen, int *numOverlays) if (status != Success || actualType != overlayVisualsAtom || actualFormat != 32 || sizeData < 4) { /* something went wrong */ - XFree((void *) ovInfo); + free((void *) ovInfo); *numOverlays = 0; return NULL; } @@ -239,18 +239,18 @@ level_of_visual( Display *dpy, XVisualInfo *vinfo ) /* found the visual */ if (/*ov->transparent_type==1 &&*/ ov->layer!=0) { int level = ov->layer; - XFree((void *) overlay_info); + free((void *) overlay_info); return level; } else { - XFree((void *) overlay_info); + free((void *) overlay_info); return 0; } } } /* The visual ID was not found in the overlay list. */ - XFree((void *) overlay_info); + free((void *) overlay_info); return 0; } @@ -497,19 +497,19 @@ transparent_pixel( XMesaVisual glxvis ) /* found it! */ if (ov->transparent_type == 0) { /* type 0 indicates no transparency */ - XFree((void *) overlay_info); + free((void *) overlay_info); return -1; } else { /* ov->value is the transparent pixel */ - XFree((void *) overlay_info); + free((void *) overlay_info); return ov->value; } } } /* The visual ID was not found in the overlay list. */ - XFree((void *) overlay_info); + free((void *) overlay_info); return -1; } @@ -554,7 +554,7 @@ get_visual( Display *dpy, int scr, unsigned int depth, int xclass ) return vis; } else { - XFree((void *) vis); + free((void *) vis); return NULL; } } @@ -780,7 +780,7 @@ choose_x_overlay_visual( Display *dpy, int scr, if (deepvis==NULL || vislist->depth > deepest) { /* YES! found a satisfactory visual */ if (deepvis) { - XFree( deepvis ); + free(deepvis); } deepest = vislist->depth; deepvis = vislist; -- cgit v1.2.3