diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mapi/glapi/gen/gl_enums.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.py index a0c47f41f20..0214932b63a 100644 --- a/src/mapi/glapi/gen/gl_enums.py +++ b/src/mapi/glapi/gen/gl_enums.py @@ -78,12 +78,14 @@ static char token_tmp[20]; const char *_mesa_lookup_enum_by_nr( int nr ) { + enum_elt *elt; + STATIC_ASSERT(sizeof(enum_string_table) < (1 << 16)); - enum_elt *elt = _mesa_bsearch(& nr, enum_string_table_offsets, - Elements(enum_string_table_offsets), - sizeof(enum_string_table_offsets[0]), - (cfunc) compar_nr); + elt = _mesa_bsearch(& nr, enum_string_table_offsets, + Elements(enum_string_table_offsets), + sizeof(enum_string_table_offsets[0]), + (cfunc) compar_nr); if (elt != NULL) { return &enum_string_table[elt->offset]; |