aboutsummaryrefslogtreecommitdiffstats
path: root/src/mapi/glapi/gen/gl_gentable.py
diff options
context:
space:
mode:
authorMathieu Bridon <[email protected]>2018-07-06 12:22:18 +0200
committerDylan Baker <[email protected]>2018-07-24 11:07:04 -0700
commit9ebd8372b9d98b1ffa7e80666ee367c59e128af5 (patch)
tree13adc1d5c528c6f6a6ce6ca63acbad63ebce3bb1 /src/mapi/glapi/gen/gl_gentable.py
parent022d2a381d32d24aabe2c54704a5a5e2440a75e9 (diff)
python: Use range() instead of xrange()
Python 2 has a range() function which returns a list, and an xrange() one which returns an iterator. Python 3 lost the function returning a list, and renamed the function returning an iterator as range(). As a result, using range() makes the scripts compatible with both Python versions 2 and 3. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mapi/glapi/gen/gl_gentable.py')
-rw-r--r--src/mapi/glapi/gen/gl_gentable.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py
index 49206b11671..9d8923cf8db 100644
--- a/src/mapi/glapi/gen/gl_gentable.py
+++ b/src/mapi/glapi/gen/gl_gentable.py
@@ -216,13 +216,13 @@ class PrintCode(gl_XML.gl_print_base):
# Check that the table has no gaps. We expect a function at every offset,
# and the code which generates the table relies on this.
- for i in xrange(0, func_count):
+ for i in range(0, func_count):
if funcnames[i] is None:
raise Exception("Function table has no function at offset %d" % (i))
print("#define GLAPI_TABLE_COUNT %d" % func_count)
print("static const char * const _glapi_table_func_names[GLAPI_TABLE_COUNT] = {")
- for i in xrange(0, func_count):
+ for i in range(0, func_count):
print(" /* %5d */ \"%s\"," % (i, funcnames[i]))
print("};")