glave: Update replay to use code-gen version of xgl_enum_string_helper.h
authorTobin Ehlis <tobin@lunarg.com>
Fri, 5 Dec 2014 19:13:07 +0000 (12:13 -0700)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Thu, 11 Dec 2014 23:07:34 +0000 (16:07 -0700)
xgl-helper.py

index 298b30f91cfdf47b7ac00448f9957b8a9fab6b15..be7f71bea39320f575d3c327b2d2ab8eda7efd3a 100755 (executable)
@@ -172,8 +172,9 @@ class HeaderFileParser:
         # strip comma and comment, then extra split in case of no comma w/ comments
         enum_val = enum_val.strip().split(',', 1)[0]
         self.enum_val_dict[enum_name]['val'] = enum_val.split()[0]
-        # TODO : Make this more robust, to verify if enum value is unique
-        #  Currently just try to cast to int which works ok but missed -(HEX) values
+        # account for negative values surrounded by parens
+        self.enum_val_dict[enum_name]['val'] = self.enum_val_dict[enum_name]['val'].strip(')').replace('-(', '-')
+        # Try to cast to int to determine if enum value is unique
         try:
             #print("ENUM val:", self.enum_val_dict[enum_name]['val'])
             int(self.enum_val_dict[enum_name]['val'], 0)