glapi: use an assertion in SET_by_offset instead of doing nothing

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33634>
This commit is contained in:
Marek Olšák
2025-01-25 16:48:47 -05:00
committed by Marge Bot
parent 49facd7d54
commit 6c39cc1cc3

View File

@@ -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('')