EGL has enums with type cast. We could try to parse the type cats to
real integer value but those are very few so it makes more sense to
short them first with int value zero.

Signed-off-by: Pauli Nieminen <[email protected]>
---
 glapi/parse_glspec.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/glapi/parse_glspec.py b/glapi/parse_glspec.py
index 16842a6..d2be059 100644
--- a/glapi/parse_glspec.py
+++ b/glapi/parse_glspec.py
@@ -153,7 +153,10 @@ def decode_enum_value(value_str):
         if value_str.endswith(suffix):
             value_str = value_str[:-len(suffix)]
             break
-    return int(value_str, 0)
+    try:
+       return int(value_str, 0)
+    except:
+       return 0
 
 
 # Convert an object to a form that can be serialized to JSON.  Python
-- 
1.7.5.4

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to