On 21 May 2012 11:08, Pauli Nieminen <span dir="ltr"><<a href="mailto:pauli.nieminen@linux.intel.com" target="_blank">pauli.nieminen@linux.intel.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Enums need to have complete name to allow mixing EGL and GL enums. Add<br>
GL_ prefix to spec enums.<br></blockquote><div><br>Can you update the documentation at the top of parse_glspec.py to reflect this change? This line needs to change:<br><br># <enum name, without "GL_" prefix>: {<br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Signed-off-by: Pauli Nieminen <<a href="mailto:pauli.nieminen@linux.intel.com">pauli.nieminen@linux.intel.com</a>><br>
---<br>
glapi/parse_glspec.py | 4 +++-<br>
tests/util/gen_dispatch.py | 2 +-<br>
2 files changed, 4 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/glapi/parse_glspec.py b/glapi/parse_glspec.py<br>
index 9d7d523..16842a6 100644<br>
--- a/glapi/parse_glspec.py<br>
+++ b/glapi/parse_glspec.py<br>
@@ -461,8 +461,10 @@ class Api(object):<br>
# 'value_str': "0xFFFFFFFF" }<br>
def parse_enum(self, m):<br>
name, value = m.groups()<br>
+ if not name.startswith('GL_'):<br>
+ name = 'GL_' + name<br>
if value.startswith('GL_'):<br>
- value_rhs = value[3:]<br>
+ value_rhs = value<br>
value_int = self.enums[value_rhs]['value_int']<br>
else:<br>
value_int = decode_enum_value(value)<br>
diff --git a/tests/util/gen_dispatch.py b/tests/util/gen_dispatch.py<br>
index 345260a..63649bc 100644<br>
--- a/tests/util/gen_dispatch.py<br>
+++ b/tests/util/gen_dispatch.py<br>
@@ -620,7 +620,7 @@ def generate_code(api):<br>
<br>
# Emit enum #defines<br>
for name, value in api.compute_unique_enums():<br>
- h_contents.append('#define GL_{0} {1}\n'.format(name, value))<br>
+ h_contents.append('#define {0} {1}\n'.format(name, value))<br>
<br>
# Emit extension #defines<br>
h_contents.append('\n')<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.5.4<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br>