From aa7c576c66f34dbf2ae08dd2025ef3f1a4eb63fd Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Thu, 6 Oct 2016 13:52:04 -0700 Subject: [PATCH] Don't use 'xrange' because Python 3 doesn't have it. Apparently 'xrange' isn't a thing in Python 3. 'range' does the same thing and works for both, so use that. --- src/generate/genCommon.py | 2 +- src/generate/gen_gldispatch_mapi.py | 6 +++--- src/generate/gl_inittable.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/generate/genCommon.py b/src/generate/genCommon.py index 57812754..b486ad04 100644 --- a/src/generate/genCommon.py +++ b/src/generate/genCommon.py @@ -71,7 +71,7 @@ def getFunctionsFromRoots(roots): # Assign a slot number to each function. This isn't strictly necessary, # since you can just look at the index in the list, but it makes it easier # to include the slot when formatting output. - for i in xrange(len(functions)): + for i in range(len(functions)): functions[i] = functions[i]._replace(slot=i) return functions diff --git a/src/generate/gen_gldispatch_mapi.py b/src/generate/gen_gldispatch_mapi.py index a2fad384..f23fc0cb 100755 --- a/src/generate/gen_gldispatch_mapi.py +++ b/src/generate/gen_gldispatch_mapi.py @@ -49,7 +49,7 @@ def _main(): if (target in ("gl", "gldispatch")): assert(len(functions) == len(allFunctions)) - assert(all(functions[i] == allFunctions[i] for i in xrange(len(functions)))) + assert(all(functions[i] == allFunctions[i] for i in range(len(functions)))) print(r""" /* This file is automatically generated by mapi_abi.py. Do not modify. */ @@ -110,13 +110,13 @@ def generate_noop_array(functions): text += "const mapi_func table_noop_array[] = {\n" for func in functions: text += " (mapi_func) noop{f.basename},\n".format(f=func) - for i in xrange(genCommon.MAPI_TABLE_NUM_DYNAMIC - 1): + for i in range(genCommon.MAPI_TABLE_NUM_DYNAMIC - 1): text += " (mapi_func) noop_generic,\n" text += " (mapi_func) noop_generic\n" text += "};\n\n" text += "#else /* DEBUG */\n\n" text += "const mapi_func table_noop_array[] = {\n" - for i in xrange(len(functions) + genCommon.MAPI_TABLE_NUM_DYNAMIC - 1): + for i in range(len(functions) + genCommon.MAPI_TABLE_NUM_DYNAMIC - 1): text += " (mapi_func) noop_generic,\n" text += " (mapi_func) noop_generic\n" diff --git a/src/generate/gl_inittable.py b/src/generate/gl_inittable.py index 18481814..bdbcbea8 100755 --- a/src/generate/gl_inittable.py +++ b/src/generate/gl_inittable.py @@ -152,7 +152,7 @@ def _main(): { """.lstrip("\n")) - for i in xrange(functionCount): + for i in range(functionCount): print(" _glapi_init_table_from_callback_%d(table, entries, get_proc_addr, param);" % (i,)) print("")