diff options
author | José Fonseca <[email protected]> | 2011-05-19 17:44:06 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2011-05-20 12:59:23 +0100 |
commit | 075d2bfb72916bf59caae98dccdc211b929bb5e8 (patch) | |
tree | 3004db88f3b900a5884288501fd788f52dbb7eb9 /src/mapi | |
parent | a436b3b2d4524447c59d8f4003895d626cab309c (diff) |
glapi: More type-checking in Get_xxx too.
Diffstat (limited to 'src/mapi')
-rw-r--r-- | src/mapi/glapi/gen/gl_table.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mapi/glapi/gen/gl_table.py b/src/mapi/glapi/gen/gl_table.py index f590c76c3b2..7183052f193 100644 --- a/src/mapi/glapi/gen/gl_table.py +++ b/src/mapi/glapi/gen/gl_table.py @@ -167,11 +167,15 @@ class PrintRemapTable(gl_XML.gl_print_base): for f, index in abi_functions + functions: arg_string = gl_XML.create_parameter_string( f.parameters, 0 ) - cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string) - print '#define CALL_%s(disp, parameters) CALL_by_offset(disp, (%s), _gloffset_%s, parameters)' % (f.name, cast, f.name) - print '#define GET_%s(disp) GET_by_offset(disp, _gloffset_%s)' % (f.name, f.name) - print 'static void INLINE SET_%s(struct _glapi_table *disp, %s (GLAPIENTRYP fn)(%s)) {' % (f.name, f.return_type, arg_string) + print 'typedef %s (GLAPIENTRYP _glptr_%s)(%s);' % (f.return_type, f.name, arg_string) + print '#define CALL_%s(disp, parameters) \\' % (f.name) + print ' (* GET_%s(disp)) parameters' % (f.name) + print 'static INLINE _glptr_%s GET_%s(struct _glapi_table *disp) {' % (f.name, f.name) + print ' return (_glptr_%s) (GET_by_offset(disp, _gloffset_%s));' % (f.name, f.name) + print '}' + print + print 'static INLINE void SET_%s(struct _glapi_table *disp, %s (GLAPIENTRYP fn)(%s)) {' % (f.name, f.return_type, arg_string) print ' SET_by_offset(disp, _gloffset_%s, fn);' % (f.name) print '}' print |