From 6c39cc1cc3206f023b4995a0635ee8d63db36ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 25 Jan 2025 16:48:47 -0500 Subject: [PATCH] glapi: use an assertion in SET_by_offset instead of doing nothing Reviewed-by: Adam Jackson Part-of: --- src/mapi/glapi/gen/gl_table.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/mapi/glapi/gen/gl_table.py b/src/mapi/glapi/gen/gl_table.py index 38cae5794ce..e11921fec06 100644 --- a/src/mapi/glapi/gen/gl_table.py +++ b/src/mapi/glapi/gen/gl_table.py @@ -108,14 +108,8 @@ class PrintRemapTable(gl_XML.gl_print_base): print(' (offset >= 0) ? (((_glapi_proc *)(disp))[offset]) : NULL') print('#define SET_by_offset(disp, offset, fn) \\') print(' do { \\') - print(' if ( (offset) < 0 ) { \\') - print(' /* fprintf( stderr, "[%s:%u] SET_by_offset(%p, %d, %s)!\\n", */ \\') - print(' /* __func__, __LINE__, disp, offset, # fn); */ \\') - print(' /* abort(); */ \\') - print(' } \\') - print(' else { \\') - print(' ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \\') - print(' } \\') + print(' assert(offset >= 0 && offset < _gloffset_COUNT); \\') + print(' ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \\') print(' } while(0)') print('')