Use a generic function typedef instead of void * to avoid gcc 3.4 warnings.

This commit is contained in:
Brian Paul
2004-11-25 23:26:16 +00:00
parent be2de8b299
commit c5f9aa7750

View File

@@ -1,6 +1,6 @@
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
* Version: 6.1 * Version: 6.3
* *
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
* *
@@ -1141,7 +1141,8 @@ OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type,
GLAPI OSMesaContext GLAPIENTRY OSMesaGetCurrentContext( void ) GLAPI OSMesaContext GLAPIENTRY
OSMesaGetCurrentContext( void )
{ {
GLcontext *ctx = _mesa_get_current_context(); GLcontext *ctx = _mesa_get_current_context();
if (ctx) if (ctx)
@@ -1152,7 +1153,8 @@ GLAPI OSMesaContext GLAPIENTRY OSMesaGetCurrentContext( void )
GLAPI void GLAPIENTRY OSMesaPixelStore( GLint pname, GLint value ) GLAPI void GLAPIENTRY
OSMesaPixelStore( GLint pname, GLint value )
{ {
OSMesaContext osmesa = OSMesaGetCurrentContext(); OSMesaContext osmesa = OSMesaGetCurrentContext();
@@ -1178,7 +1180,8 @@ GLAPI void GLAPIENTRY OSMesaPixelStore( GLint pname, GLint value )
} }
GLAPI void GLAPIENTRY OSMesaGetIntegerv( GLint pname, GLint *value ) GLAPI void GLAPIENTRY
OSMesaGetIntegerv( GLint pname, GLint *value )
{ {
OSMesaContext osmesa = OSMesaGetCurrentContext(); OSMesaContext osmesa = OSMesaGetCurrentContext();
@@ -1273,23 +1276,25 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width,
} }
typedef void (*generic_function)();
struct name_address { struct name_function
{
const char *Name; const char *Name;
GLvoid *Address; generic_function Function;
}; };
static struct name_address functions[] = { static struct name_function functions[] = {
{ "OSMesaCreateContext", (void *) OSMesaCreateContext }, { "OSMesaCreateContext", (generic_function) OSMesaCreateContext },
{ "OSMesaCreateContextExt", (void *) OSMesaCreateContextExt }, { "OSMesaCreateContextExt", (generic_function) OSMesaCreateContextExt },
{ "OSMesaDestroyContext", (void *) OSMesaDestroyContext }, { "OSMesaDestroyContext", (generic_function) OSMesaDestroyContext },
{ "OSMesaMakeCurrent", (void *) OSMesaMakeCurrent }, { "OSMesaMakeCurrent", (generic_function) OSMesaMakeCurrent },
{ "OSMesaGetCurrentContext", (void *) OSMesaGetCurrentContext }, { "OSMesaGetCurrentContext", (generic_function) OSMesaGetCurrentContext },
{ "OSMesaPixelsStore", (void *) OSMesaPixelStore }, { "OSMesaPixelsStore", (generic_function) OSMesaPixelStore },
{ "OSMesaGetIntegerv", (void *) OSMesaGetIntegerv }, { "OSMesaGetIntegerv", (generic_function) OSMesaGetIntegerv },
{ "OSMesaGetDepthBuffer", (void *) OSMesaGetDepthBuffer }, { "OSMesaGetDepthBuffer", (generic_function) OSMesaGetDepthBuffer },
{ "OSMesaGetColorBuffer", (void *) OSMesaGetColorBuffer }, { "OSMesaGetColorBuffer", (generic_function) OSMesaGetColorBuffer },
{ "OSMesaGetProcAddress", (void *) OSMesaGetProcAddress }, { "OSMesaGetProcAddress", (generic_function) OSMesaGetProcAddress },
{ NULL, NULL } { NULL, NULL }
}; };
@@ -1299,7 +1304,7 @@ OSMesaGetProcAddress( const char *funcName )
int i; int i;
for (i = 0; functions[i].Name; i++) { for (i = 0; functions[i].Name; i++) {
if (_mesa_strcmp(functions[i].Name, funcName) == 0) if (_mesa_strcmp(functions[i].Name, funcName) == 0)
return (void *) functions[i].Address; return (void *) functions[i].Function;
} }
return (void *) _glapi_get_proc_address(funcName); return (void *) _glapi_get_proc_address(funcName);
} }