From c5f9aa7750633e2989a6a139c283419d536ee3f7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Nov 2004 23:26:16 +0000 Subject: Use a generic function typedef instead of void * to avoid gcc 3.4 warnings. --- src/mesa/drivers/osmesa/osmesa.c | 41 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 7932b90f59..b25f7dca55 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.3 * * 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(); 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(); @@ -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(); @@ -1273,23 +1276,25 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width, } +typedef void (*generic_function)(); -struct name_address { +struct name_function +{ const char *Name; - GLvoid *Address; + generic_function Function; }; -static struct name_address functions[] = { - { "OSMesaCreateContext", (void *) OSMesaCreateContext }, - { "OSMesaCreateContextExt", (void *) OSMesaCreateContextExt }, - { "OSMesaDestroyContext", (void *) OSMesaDestroyContext }, - { "OSMesaMakeCurrent", (void *) OSMesaMakeCurrent }, - { "OSMesaGetCurrentContext", (void *) OSMesaGetCurrentContext }, - { "OSMesaPixelsStore", (void *) OSMesaPixelStore }, - { "OSMesaGetIntegerv", (void *) OSMesaGetIntegerv }, - { "OSMesaGetDepthBuffer", (void *) OSMesaGetDepthBuffer }, - { "OSMesaGetColorBuffer", (void *) OSMesaGetColorBuffer }, - { "OSMesaGetProcAddress", (void *) OSMesaGetProcAddress }, +static struct name_function functions[] = { + { "OSMesaCreateContext", (generic_function) OSMesaCreateContext }, + { "OSMesaCreateContextExt", (generic_function) OSMesaCreateContextExt }, + { "OSMesaDestroyContext", (generic_function) OSMesaDestroyContext }, + { "OSMesaMakeCurrent", (generic_function) OSMesaMakeCurrent }, + { "OSMesaGetCurrentContext", (generic_function) OSMesaGetCurrentContext }, + { "OSMesaPixelsStore", (generic_function) OSMesaPixelStore }, + { "OSMesaGetIntegerv", (generic_function) OSMesaGetIntegerv }, + { "OSMesaGetDepthBuffer", (generic_function) OSMesaGetDepthBuffer }, + { "OSMesaGetColorBuffer", (generic_function) OSMesaGetColorBuffer }, + { "OSMesaGetProcAddress", (generic_function) OSMesaGetProcAddress }, { NULL, NULL } }; @@ -1299,7 +1304,7 @@ OSMesaGetProcAddress( const char *funcName ) int i; for (i = 0; functions[i].Name; i++) { 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); } -- cgit v1.2.3