diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2016-03-30 15:28:44 -0700 |
---|---|---|
committer | Dylan Baker <baker.dylan.c@gmail.com> | 2016-03-31 15:52:22 -0700 |
commit | 7e283126690dd6b6fead3421a0e63d613eeace84 (patch) | |
tree | 40e4ce038cba8a56cb18d79f410bc4b05291e5e1 | |
parent | 899993b02336a863bb7a8686d1b1ee148aefc407 (diff) |
glapi: remove superflous parens in python
Remove parens that don't do anything. Mostly these are extra grouping
parens in if statements, that aren't needed. Unlike C python doesn't
require parens around the conditions of if statements, except to group
them when using logical operators.
It also removes them around the assert keyword. assert is a keyword in
python, it doesn't take parens, and accidentally (or purposefully to
group) will make the assert not behave in the expected way.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
-rw-r--r-- | src/mapi/glapi/gen/gl_XML.py | 2 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_apitemp.py | 2 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_gentable.py | 2 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_procs.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py index d37ebddbd9..74b5e5a31d 100644 --- a/src/mapi/glapi/gen/gl_XML.py +++ b/src/mapi/glapi/gen/gl_XML.py @@ -758,7 +758,7 @@ class gl_function(gl_item): return p_string def is_abi(self): - return (self.offset >= 0 and not self.assign_offset) + return self.offset >= 0 and not self.assign_offset def is_static_entry_point(self, name): return name in self.static_entry_points diff --git a/src/mapi/glapi/gen/gl_apitemp.py b/src/mapi/glapi/gen/gl_apitemp.py index 4b0a37ed11..feb5f8ed61 100644 --- a/src/mapi/glapi/gen/gl_apitemp.py +++ b/src/mapi/glapi/gen/gl_apitemp.py @@ -99,7 +99,7 @@ class PrintGlOffsets(gl_XML.gl_print_base): need_proto = True elif self.es: cat, num = api.get_category_for_name(name) - if (cat.startswith("es") or cat.startswith("GL_OES")): + if cat.startswith("es") or cat.startswith("GL_OES"): need_proto = True if need_proto: print '%s %s KEYWORD2 NAME(%s)(%s);' % (keyword, f.return_type, n, f.get_parameter_string(name)) diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py index e8d45fbfe1..40da8161c6 100644 --- a/src/mapi/glapi/gen/gl_gentable.py +++ b/src/mapi/glapi/gen/gl_gentable.py @@ -191,7 +191,7 @@ class PrintCode(gl_XML.gl_print_base): funcnames = [None] * func_count for f in api.functions_by_name.itervalues(): if f.offset != -1: - if not (funcnames[f.offset] is None): + if funcnames[f.offset] is not None: raise Exception("Function table has more than one function with same offset (offset %d, func %s)" % (f.offset, f.name)) funcnames[f.offset] = f.name diff --git a/src/mapi/glapi/gen/gl_procs.py b/src/mapi/glapi/gen/gl_procs.py index 6c85bb88fa..163a8d7612 100644 --- a/src/mapi/glapi/gen/gl_procs.py +++ b/src/mapi/glapi/gen/gl_procs.py @@ -132,7 +132,7 @@ class PrintGlProcs(gl_XML.gl_print_base): for func in api.functionIterateByOffset(): for n in func.entry_points: cat, num = api.get_category_for_name(n) - if (cat.startswith("es") or cat.startswith("GL_OES")): + if cat.startswith("es") or cat.startswith("GL_OES"): if not categories.has_key(cat): categories[cat] = [] proto = 'GLAPI %s GLAPIENTRY %s(%s);' \ |