summaryrefslogtreecommitdiffstats
path: root/src/mapi/glapi/gen/gl_enums.py
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2013-09-23 14:07:15 -0700
committerVinson Lee <[email protected]>2013-09-23 14:14:32 -0700
commitf036d55515bc2b3821d52d16f2211d6c2e21b9a2 (patch)
tree591ee2e8bf9c5aa100470066366c12b720fb1759 /src/mapi/glapi/gen/gl_enums.py
parent11e494a572ce81a57c05fbe4214dd36b1c8ac4cf (diff)
glapi: Move declaration before code.
This patch fixes the MSVC build error introduced by commit 673129e0b936b1c748e988d3f74f3efaab9e5693. enums.c mesa\main\enums.c(3776) : error C2143: syntax error : missing ';' before 'type' mesa\main\enums.c(3781) : error C2065: 'elt' : undeclared identifier mesa\main\enums.c(3781) : warning C4047: '!=' : 'int' differs in levels of indirection from 'void *' mesa\main\enums.c(3782) : error C2065: 'elt' : undeclared identifier mesa\main\enums.c(3782) : error C2223: left of '->offset' must point to struct/union mesa\main\enums.c(3782) : warning C4033: '_mesa_lookup_enum_by_nr' must return a value Signed-off-by: Vinson Lee <[email protected]>
Diffstat (limited to 'src/mapi/glapi/gen/gl_enums.py')
-rw-r--r--src/mapi/glapi/gen/gl_enums.py10
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];