From cee997dacb28aa9378b834b66a33c441145dceb7 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Mon, 31 Oct 2016 15:06:37 +0100 Subject: Drop glx_ansic.h wrapper and call malloc, realloc, free and str-funcs directly. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 2d2d38d17cc2558f8a41166a4a1578bc4c663c37 Author: Kristian Høgsberg Date: Fri Mar 17 01:47:25 2006 +0000 Check for glproto when building GLX and make sure we have at least 1.4.6. Drop glx_ansic.h wrapper and call xalloc, xrealloc, xfree and str-funcs directly. We don't check the glproto version as we know what it is (we have our own proto file). Furthermore, we skip the switch from --glX -> x and directly switch to (e.g. __glXMalloc() -> malloc()). Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c | 68 ++++++++++++++--------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'nx-X11/programs/Xserver/GL/mesa') diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c index 0d7496a0e..eae82f663 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c @@ -319,15 +319,15 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, /* Alloc space for the list of new GLX visuals */ pNewVisualConfigs = (__GLXvisualConfig *) - __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig)); + malloc(numNewConfigs * sizeof(__GLXvisualConfig)); if (!pNewVisualConfigs) { return FALSE; } /* Alloc space for the list of new GLX visual privates */ - pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *)); + pNewVisualPriv = (void **) malloc(numNewConfigs * sizeof(void *)); if (!pNewVisualPriv) { - __glXFree(pNewVisualConfigs); + free(pNewVisualConfigs); return FALSE; } @@ -371,40 +371,40 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, numConfigs = 0; /* Alloc temp space for the list of orig VisualIDs for each new visual */ - orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID)); + orig_vid = (VisualID *)malloc(numNewVisuals * sizeof(VisualID)); if (!orig_vid) { - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); + free(pNewVisualPriv); + free(pNewVisualConfigs); return FALSE; } /* Alloc space for the list of glXVisuals */ modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes)); if (modes == NULL) { - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); + free(orig_vid); + free(pNewVisualPriv); + free(pNewVisualConfigs); return FALSE; } /* Alloc space for the list of glXVisualPrivates */ - glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *)); + glXVisualPriv = (void **)malloc(numNewVisuals * sizeof(void *)); if (!glXVisualPriv) { _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); + free(orig_vid); + free(pNewVisualPriv); + free(pNewVisualConfigs); return FALSE; } /* Alloc space for the new list of the X server's visuals */ - pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec)); + pVisualNew = (VisualPtr)malloc(numNewVisuals * sizeof(VisualRec)); if (!pVisualNew) { - __glXFree(glXVisualPriv); + free(glXVisualPriv); _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); + free(orig_vid); + free(pNewVisualPriv); + free(pNewVisualConfigs); return FALSE; } @@ -487,7 +487,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, numVids++; /* Allocate a new list of VisualIDs for this depth */ - pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID)); + pVids = (VisualID *)malloc(numVids * sizeof(VisualID)); /* Initialize the new list of VisualIDs for this depth */ for (j = 0; j < pdepth[i].numVids; j++) @@ -496,7 +496,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, pVids[n++] = pVisualNew[k].vid; /* Update this depth's list of VisualIDs */ - __glXFree(pdepth[i].vids); + free(pdepth[i].vids); pdepth[i].vids = pVids; pdepth[i].numVids = numVids; } @@ -506,12 +506,12 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, *visualp = pVisualNew; /* Free the old list of the X server's visuals */ - __glXFree(pVisual); + free(pVisual); /* Clean up temporary allocations */ - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); + free(orig_vid); + free(pNewVisualPriv); + free(pNewVisualConfigs); /* Free the private list created by DDX HW driver */ if (visualPrivates) @@ -581,19 +581,19 @@ static void init_screen_visuals(int screen) int i, j; /* Alloc space for the list of XMesa visuals */ - pXMesaVisual = (XMesaVisual *)__glXMalloc(MESAScreens[screen].num_vis * + pXMesaVisual = (XMesaVisual *)malloc(MESAScreens[screen].num_vis * sizeof(XMesaVisual)); - __glXMemset(pXMesaVisual, 0, + memset(pXMesaVisual, 0, MESAScreens[screen].num_vis * sizeof(XMesaVisual)); /* FIXME: Change 'used' to be a array of bits (rather than of ints), * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less * FIXME: than 64 or 128 the stack array can be used instead of calling - * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to + * FIXME: malloc / free. If nothing else, convert 'used' to * FIXME: array of bytes instead of ints! */ - used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int)); - __glXMemset(used, 0, pScreen->numVisuals * sizeof(int)); + used = (int *)malloc(pScreen->numVisuals * sizeof(int)); + memset(used, 0, pScreen->numVisuals * sizeof(int)); i = 0; for ( modes = MESAScreens[screen].modes @@ -652,7 +652,7 @@ static void init_screen_visuals(int screen) i++; } - __glXFree(used); + free(used); MESAScreens[screen].xm_vis = pXMesaVisual; } @@ -703,9 +703,9 @@ extern void __MESA_resetExtension(void) } _gl_context_modes_destroy( MESAScreens[i].modes ); MESAScreens[i].modes = NULL; - __glXFree(MESAScreens[i].private); + free(MESAScreens[i].private); MESAScreens[i].private = NULL; - __glXFree(MESAScreens[i].xm_vis); + free(MESAScreens[i].xm_vis); MESAScreens[i].xm_vis = NULL; MESAScreens[i].num_vis = 0; } @@ -725,7 +725,7 @@ void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv) ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n", glxPriv->modes->visualID); } - buf = (__MESA_buffer)__glXMalloc(sizeof(struct __MESA_bufferRec)); + buf = (__MESA_buffer)malloc(sizeof(struct __MESA_bufferRec)); /* Create Mesa's buffers */ if (glxPriv->type == DRAWABLE_WINDOW) { @@ -793,7 +793,7 @@ void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv) glxPriv->swapBuffers = buf->fbswap; glPriv->frontBuffer.resize = buf->fbresize; - __glXFree(glPriv->private); + free(glPriv->private); glPriv->private = NULL; } -- cgit v1.2.3 From 4146d1aa71ba5a2a4951667624844b4d3bff5c0e Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Tue, 1 Nov 2016 21:30:22 +0100 Subject: Drop xf86glx.h, so we can finally drop Xserver/GL/include/ entirely. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Derived from X.org commit... commit 28b95fd9d1c2f078aaaac75c310a27b17c74a6fc Author: Kristian Høgsberg Date: Thu Jul 6 03:25:38 2006 -0400 Drop unused GL/include subtree. Woo, less Makefile's to generate. Backported-to-NX-by: Mike Gabriel --- .../extras/Mesa/src/mesa/drivers/x11/glxheader.h | 1 - nx-X11/extras/Mesa/src/mesa/drivers/x11/xmesaP.h | 1 - nx-X11/programs/Xserver/GL/include/GL/xf86glx.h | 38 ---------------------- nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c | 1 - nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c | 1 - 5 files changed, 42 deletions(-) delete mode 100644 nx-X11/programs/Xserver/GL/include/GL/xf86glx.h (limited to 'nx-X11/programs/Xserver/GL/mesa') diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxheader.h b/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxheader.h index 33d937f1c..6a1f2ed20 100644 --- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxheader.h +++ b/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxheader.h @@ -38,7 +38,6 @@ # include "resource.h" # include "windowstr.h" # include "gcstruct.h" -# include "GL/xf86glx.h" # include "xf86glx_util.h" #else diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/xmesaP.h b/nx-X11/extras/Mesa/src/mesa/drivers/x11/xmesaP.h index 26255ae56..c5037e619 100644 --- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/xmesaP.h +++ b/nx-X11/extras/Mesa/src/mesa/drivers/x11/xmesaP.h @@ -28,7 +28,6 @@ #ifdef XFree86Server -# include "GL/xf86glx.h" # include "xf86glx_util.h" #elif defined(USE_XSHM) # include diff --git a/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h b/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h deleted file mode 100644 index 9e69fac65..000000000 --- a/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h +++ /dev/null @@ -1,38 +0,0 @@ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "miscstruct.h" diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c index eae82f663..da0e77134 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c @@ -52,7 +52,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xf86glxint.h" #include "context.h" #include "xmesaP.h" -#include #include "context.h" /* diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c index d0d8eb239..fad84ec7e 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c @@ -41,7 +41,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "pixmapstr.h" #include "xf86glx_util.h" #include -#include "GL/xf86glx.h" #ifdef ROUNDUP #undef ROUNDUP -- cgit v1.2.3