From 70dbbbf89af4c1d6d9b52cbbb79ee7f9ad654592 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 26 May 2005 16:59:47 +0000 Subject: Fix gl_enums.py so that enums that are listed with the same name in multiple places don't get generated multiple times. --- src/mesa/glapi/gl_enums.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/mesa/glapi') diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py index 615f79729cf..8520d9e33ea 100644 --- a/src/mesa/glapi/gl_enums.py +++ b/src/mesa/glapi/gl_enums.py @@ -31,10 +31,11 @@ import gl_XML import sys, getopt class PrintGlEnums(gl_XML.FilterGLAPISpecBase): - name = "gl_enums.py (from Mesa)" def __init__(self): gl_XML.FilterGLAPISpecBase.__init__(self) + + self.name = "gl_enums.py (from Mesa)" self.license = license.bsd_license_template % ( \ """Copyright (C) 1999-2005 Brian Paul All Rights Reserved.""", "BRIAN PAUL") self.enum_table = {} @@ -186,7 +187,13 @@ int _mesa_lookup_enum_by_name( const char *symbol ) # Prevent duplicate names in the enum table. - if obj.name not in self.enum_table[ obj.value ]: + found_it = 0 + for [n, junk] in self.enum_table[ obj.value ]: + if n == obj.name: + found_it = 1 + break + + if not found_it: # Calculate a "priority" for this enum name. # When we lookup an enum by number, there may -- cgit v1.2.3