From 3c63452e64df7e10aa073c6c3b9492b1d7dabbb8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Oct 2002 23:57:19 +0000 Subject: Header file clean-up: 1. Remove all.h and PC_HEADER junk. 2. Rolled mem.c and mem.h into imports.c and imports.h 3. Include imports.h instead of mem.h Restore _mesa_create/initialize_context() to be like they were in 4.0.4 New wrappers for a few std C functions: _mesa_atoi(), _mesa_strstr(), etc. --- src/mesa/drivers/allegro/amesa.c | 4 +--- src/mesa/drivers/dos/dmesa.c | 4 ---- src/mesa/drivers/ggi/ggimesa.c | 4 +--- src/mesa/drivers/glide/fxapi.c | 6 ++---- src/mesa/drivers/glide/fxdrv.h | 3 +-- src/mesa/drivers/glide/fxtris.c | 10 ++-------- src/mesa/drivers/glide/fxvb.c | 4 ++-- src/mesa/drivers/glide/fxwgl.c | 6 +++--- src/mesa/drivers/osmesa/osmesa.c | 8 +++----- src/mesa/drivers/svga/svgamesa.c | 11 ++--------- src/mesa/drivers/windows/wmesa.c | 8 ++------ src/mesa/drivers/windows/wmesa_stereo.c | 4 +--- src/mesa/drivers/x11/fakeglx.c | 8 ++++---- src/mesa/drivers/x11/xfonts.c | 16 +++------------- src/mesa/drivers/x11/xm_api.c | 11 +++-------- src/mesa/drivers/x11/xm_dd.c | 4 ++-- src/mesa/drivers/x11/xm_span.c | 4 ++-- src/mesa/drivers/x11/xm_tri.c | 4 ++-- 18 files changed, 36 insertions(+), 83 deletions(-) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/allegro/amesa.c b/src/mesa/drivers/allegro/amesa.c index 0728c34273..1462161781 100644 --- a/src/mesa/drivers/allegro/amesa.c +++ b/src/mesa/drivers/allegro/amesa.c @@ -329,7 +329,6 @@ AMesaContext AMesaCreateContext(AMesaVisual visual, { AMesaContext context; GLboolean direct = GL_FALSE; - __GLimports imports; context = (AMesaContext)calloc(1, sizeof(struct amesa_context)); if (!context) @@ -339,10 +338,9 @@ AMesaContext AMesaCreateContext(AMesaVisual visual, context->Buffer = NULL; context->ClearColor = 0; context->CurrentColor = 0; - _mesa_init_default_imports( &imports, (void *) context); context->GLContext = _mesa_create_context(visual->GLVisual, share ? share->GLContext : NULL, - &imports ); + (void *) context, GL_FALSE ); if (!context->GLContext) { free(context); diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 65c82da19a..474d1336e3 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -31,9 +31,6 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "context.h" #include "GL/dmesa.h" @@ -54,7 +51,6 @@ #include "tnl/tnl.h" #include "tnl/t_context.h" #include "tnl/t_pipeline.h" -#endif #include "video.h" diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c index 73f6f95b66..c7be61f070 100644 --- a/src/mesa/drivers/ggi/ggimesa.c +++ b/src/mesa/drivers/ggi/ggimesa.c @@ -457,7 +457,6 @@ ggi_mesa_context_t ggiMesaCreateContext(ggi_visual_t vis) int err; ggi_color pal[256]; int i; - __GLimports imports; GGIMESADPRINT_CORE("ggiMesaCreateContext() called\n"); @@ -468,10 +467,9 @@ ggi_mesa_context_t ggiMesaCreateContext(ggi_visual_t vis) ctx->ggi_visual = vis; ctx->color = 0; - _mesa_init_default_imports( &imports, (void *) ctx); ctx->gl_ctx = _mesa_create_context(&(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual), - NULL, &imports); + NULL, (void *) ctx, GL_FALSE); if (!ctx->gl_ctx) goto free_context; diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index eb87837c9b..a1fdf1dc87 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -1,4 +1,4 @@ -/* $Id: fxapi.c,v 1.34 2002/10/14 17:08:25 brianp Exp $ */ +/* $Id: fxapi.c,v 1.35 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -283,7 +283,6 @@ fxMesaCreateContext(GLuint win, char *errorstr; GLboolean useBGR; char *system = NULL; - __GLimports imports; if (MESA_VERBOSE & VERBOSE_DRIVER) { fprintf(stderr, "fxmesa: fxMesaCreateContext() Start\n"); @@ -509,10 +508,9 @@ fxMesaCreateContext(GLuint win, goto errorhandler; } - _mesa_init_default_imports( &imports, (void *) fxMesa); ctx = fxMesa->glCtx = _mesa_create_context(fxMesa->glVis, shareCtx, - &imports); + (void *) fxMesa, GL_TRUE); if (!ctx) { errorstr = "_mesa_create_context"; goto errorhandler; diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h index 27e4f146b9..d6d3be5b70 100644 --- a/src/mesa/drivers/glide/fxdrv.h +++ b/src/mesa/drivers/glide/fxdrv.h @@ -1,4 +1,4 @@ -/* $Id: fxdrv.h,v 1.53 2002/06/13 04:28:30 brianp Exp $ */ +/* $Id: fxdrv.h,v 1.54 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -52,7 +52,6 @@ #include "imports.h" #include "macros.h" #include "matrix.h" -#include "mem.h" #include "mtypes.h" #include "GL/fxmesa.h" diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c index dbe9d3d5c8..bca894c8ec 100644 --- a/src/mesa/drivers/glide/fxtris.c +++ b/src/mesa/drivers/glide/fxtris.c @@ -1,4 +1,4 @@ -/* $Id: fxtris.c,v 1.19 2002/08/21 02:56:58 brianp Exp $ */ +/* $Id: fxtris.c,v 1.20 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -28,16 +28,10 @@ * Keith Whitwell */ -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif +#include "glheader.h" #ifdef FX -#include -#include - -#include "glheader.h" #include "mtypes.h" #include "macros.h" #include "colormac.h" diff --git a/src/mesa/drivers/glide/fxvb.c b/src/mesa/drivers/glide/fxvb.c index 24e01af096..00203f17fb 100644 --- a/src/mesa/drivers/glide/fxvb.c +++ b/src/mesa/drivers/glide/fxvb.c @@ -1,4 +1,4 @@ -/* $Id: fxvb.c,v 1.14 2002/06/15 03:03:10 brianp Exp $ */ +/* $Id: fxvb.c,v 1.15 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -37,7 +37,7 @@ #include "glheader.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "macros.h" #include "colormac.h" #include "mmath.h" diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c index 11df093366..ab6b1a1fe8 100644 --- a/src/mesa/drivers/glide/fxwgl.c +++ b/src/mesa/drivers/glide/fxwgl.c @@ -1,4 +1,4 @@ -/* $Id: fxwgl.c,v 1.15 2002/09/04 14:14:36 brianp Exp $ */ +/* $Id: fxwgl.c,v 1.16 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -42,9 +42,9 @@ extern "C" { #endif -#include "fxdrv.h" #include -#include "GL/gl.h" +#include "glheader.h" +#include "fxdrv.h" #include "glapi.h" #ifdef __cplusplus diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index cc2081129d..5efb52391b 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $Id: osmesa.c,v 1.92 2002/10/17 15:26:38 brianp Exp $ */ +/* $Id: osmesa.c,v 1.93 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -45,7 +45,6 @@ #include "imports.h" #include "macros.h" #include "matrix.h" -#include "mem.h" #include "mmath.h" #include "mtypes.h" #include "texformat.h" @@ -139,7 +138,6 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, const GLuint i4 = 1; const GLubyte *i1 = (GLubyte *) &i4; const GLint little_endian = *i1; - __GLimports imports; rind = gind = bind = aind = 0; if (format==OSMESA_COLOR_INDEX) { @@ -292,12 +290,12 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, return NULL; } - _mesa_init_default_imports( &imports, (void *) osmesa ); if (!_mesa_initialize_context(&osmesa->gl_ctx, osmesa->gl_visual, sharelist ? &sharelist->gl_ctx : (GLcontext *) NULL, - &imports)) { + (void *) osmesa, + GL_FALSE)) { _mesa_destroy_visual( osmesa->gl_visual ); FREE(osmesa); return NULL; diff --git a/src/mesa/drivers/svga/svgamesa.c b/src/mesa/drivers/svga/svgamesa.c index 4581517678..9f5e75199f 100644 --- a/src/mesa/drivers/svga/svgamesa.c +++ b/src/mesa/drivers/svga/svgamesa.c @@ -1,4 +1,4 @@ -/* $Id: svgamesa.c,v 1.21 2002/10/14 17:08:27 brianp Exp $ */ +/* $Id: svgamesa.c,v 1.22 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -34,9 +34,6 @@ #ifdef SVGA -#ifdef PC_HEADER -#include "all.h" -#else #include #include #include @@ -48,8 +45,6 @@ #include "matrix.h" #include "mtypes.h" #include "swrast/swrast.h" -#endif - #include "svgapix.h" #include "svgamesa8.h" #include "svgamesa15.h" @@ -355,7 +350,6 @@ SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ) GLfloat redscale, greenscale, bluescale, alphascale; GLint index_bits; GLint redbits, greenbits, bluebits, alphabits; - __GLimports imports; /* determine if we're in RGB or color index mode */ if ((SVGABuffer.Depth==32) || (SVGABuffer.Depth==24)) { @@ -405,10 +399,9 @@ SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ) 1 /* samples */ ); - _mesa_init_default_imports( &imports, (void *) ctx); ctx->gl_ctx = _mesa_create_context( ctx->gl_vis, NULL, /* share list context */ - &imports ); + (void *) ctx, GL_FALSE ); _mesa_enable_sw_extensions(ctx->gl_ctx); _mesa_enable_1_3_extensions(ctx->gl_ctx); diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c index b18fe548ba..3df9ae1aec 100644 --- a/src/mesa/drivers/windows/wmesa.c +++ b/src/mesa/drivers/windows/wmesa.c @@ -1,4 +1,4 @@ -/* $Id: wmesa.c,v 1.40 2002/10/14 17:08:28 brianp Exp $ */ +/* $Id: wmesa.c,v 1.41 2002/10/24 23:57:23 brianp Exp $ */ /* * Windows (Win32) device driver for Mesa 3.4 @@ -39,7 +39,6 @@ #include "imports.h" #include "macros.h" #include "matrix.h" -#include "mem.h" #include "mmath.h" #include "mtypes.h" #include "texformat.h" @@ -1255,7 +1254,6 @@ WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, RECT CR; WMesaContext c; GLboolean true_color_flag; - __GLimports imports; c = (struct wmesa_context * ) calloc(1,sizeof(struct wmesa_context)); if (!c) @@ -1343,10 +1341,8 @@ WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, return NULL; } - _mesa_init_default_imports( &imports, (void *) c ); - /* allocate a new Mesa context */ - c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, &imports ); + c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, (void *) c, GL_FALSE ); if (!c->gl_ctx) { _mesa_destroy_visual( c->gl_visual ); diff --git a/src/mesa/drivers/windows/wmesa_stereo.c b/src/mesa/drivers/windows/wmesa_stereo.c index 1781b0e439..adae152f76 100644 --- a/src/mesa/drivers/windows/wmesa_stereo.c +++ b/src/mesa/drivers/windows/wmesa_stereo.c @@ -1115,7 +1115,6 @@ WMesaContext /*APIENTRY*/ WMesaCreateContext( HWND hWnd, HPALETTE Pal, //HDC DC; RECT CR; WMesaContext c; - __GLimports imports; c = (struct wmesa_context * ) calloc(1,sizeof(struct wmesa_context)); if (!c) @@ -1202,8 +1201,7 @@ WMesaContext /*APIENTRY*/ WMesaCreateContext( HWND hWnd, HPALETTE Pal, } /* allocate a new Mesa context */ - _mesa_init_default_imports( &imports, (void *) c ); - c->gl_ctx = _mesa_create_context( c->gl_visual, &imports ); + c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, (void *) g, GL_FALSE ); if (!c->gl_ctx) { _mesa_destroy_visual( c->gl_visual ); diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index e58fd268d9..99361b4d1a 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $Id: fakeglx.c,v 1.69 2002/10/05 18:27:41 brianp Exp $ */ +/* $Id: fakeglx.c,v 1.70 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -48,7 +48,7 @@ #include "context.h" #include "config.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" #include "xfonts.h" @@ -1823,7 +1823,7 @@ Fake_glXChooseFBConfig( Display *dpy, int screen, { XMesaVisual xmvis = choose_visual(dpy, screen, attribList); if (xmvis) { - GLXFBConfig *config = malloc(sizeof(XMesaVisual)); + GLXFBConfig *config = _mesa_malloc(sizeof(XMesaVisual)); if (!config) { *nitems = 0; return NULL; @@ -1866,7 +1866,7 @@ Fake_glXGetFBConfigs( Display *dpy, int screen, int *nelements ) visuals = XGetVisualInfo(dpy, visMask, &visTemplate, nelements); if (*nelements > 0) { XMesaVisual *results; - results = malloc(*nelements * sizeof(XMesaVisual)); + results = _mesa_malloc(*nelements * sizeof(XMesaVisual)); if (!results) { *nelements = 0; return NULL; diff --git a/src/mesa/drivers/x11/xfonts.c b/src/mesa/drivers/x11/xfonts.c index 3aa17fec84..0f2dbbe183 100644 --- a/src/mesa/drivers/x11/xfonts.c +++ b/src/mesa/drivers/x11/xfonts.c @@ -1,4 +1,4 @@ -/* $Id: xfonts.c,v 1.14 2001/04/26 19:28:02 brianp Exp $ */ +/* $Id: xfonts.c,v 1.15 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -33,19 +33,9 @@ #include #endif -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#include -#include -#include -#include -#include -#include "GL/gl.h" -#include "GL/glx.h" +#include "glxheader.h" #include "context.h" -#include "mem.h" +#include "imports.h" #include "xfonts.h" diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index c4463af690..9ea50fb8bc 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1,4 +1,4 @@ -/* $Id: xm_api.c,v 1.45 2002/10/14 17:08:34 brianp Exp $ */ +/* $Id: xm_api.c,v 1.46 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -71,12 +71,8 @@ #include "glthread.h" #include "imports.h" #include "matrix.h" -#include "mem.h" #include "mmath.h" #include "mtypes.h" -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif #include "macros.h" #include "texformat.h" #include "texstore.h" @@ -1619,7 +1615,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) static GLboolean firstTime = GL_TRUE; XMesaContext c; GLcontext *ctx; - __GLimports imports; + GLboolean direct = GL_TRUE; /* not really */ if (firstTime) { _glthread_INIT_MUTEX(_xmesa_lock); @@ -1631,10 +1627,9 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) return NULL; } - _mesa_init_default_imports( &imports, (void *) c ); ctx = c->gl_ctx = _mesa_create_context( &v->mesa_visual, share_list ? share_list->gl_ctx : (GLcontext *) NULL, - &imports ); + (void *) c, direct); if (!c->gl_ctx) { FREE(c); return NULL; diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index e0bc2be1d4..67c7c44153 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -1,4 +1,4 @@ -/* $Id: xm_dd.c,v 1.39 2002/10/14 17:08:38 brianp Exp $ */ +/* $Id: xm_dd.c,v 1.40 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,7 +32,7 @@ #include "drawpix.h" #include "extensions.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mtypes.h" #include "state.h" #include "texstore.h" diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index ec51de0d2e..f891fa8403 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -1,4 +1,4 @@ -/* $Id: xm_span.c,v 1.16 2002/10/04 19:10:12 brianp Exp $ */ +/* $Id: xm_span.c,v 1.17 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,7 +32,7 @@ #include "drawpix.h" #include "extensions.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mtypes.h" #include "state.h" #include "xmesaP.h" diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c index 9184f0c085..b83b750279 100644 --- a/src/mesa/drivers/x11/xm_tri.c +++ b/src/mesa/drivers/x11/xm_tri.c @@ -1,4 +1,4 @@ -/* $Id: xm_tri.c,v 1.27 2002/08/07 00:45:07 brianp Exp $ */ +/* $Id: xm_tri.c,v 1.28 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -35,7 +35,7 @@ #include "glxheader.h" #include "depth.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" #include "xmesaP.h" -- cgit v1.2.3