summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2016-03-30 15:31:58 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2016-03-31 15:52:22 -0700
commitbbf87d4fc993aca19050ed7e55d502664bdf5f7e (patch)
tree175224f929076996ec851be291aab34178bb77b1
parent7e283126690dd6b6fead3421a0e63d613eeace84 (diff)
glapi: have only one statement per line in python files.
One line if statements (if foo: break) are pretty uncommon, and are not nearly as readable as their counterparts in other languages. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
-rw-r--r--src/mapi/glapi/gen/glX_XML.py3
-rw-r--r--src/mapi/glapi/gen/glX_proto_send.py9
-rw-r--r--src/mapi/glapi/gen/glX_proto_size.py16
-rw-r--r--src/mapi/glapi/gen/gl_XML.py3
4 files changed, 20 insertions, 11 deletions
diff --git a/src/mapi/glapi/gen/glX_XML.py b/src/mapi/glapi/gen/glX_XML.py
index 580a2411c9..a36d6eaf88 100644
--- a/src/mapi/glapi/gen/glX_XML.py
+++ b/src/mapi/glapi/gen/glX_XML.py
@@ -267,7 +267,8 @@ class glx_function(gl_XML.gl_function):
temp = [[], [], []]
for param in self.parameters:
- if param.is_output: continue
+ if param.is_output:
+ continue
if param.is_variable_length():
temp[2].append(param)
diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py
index d2166d2d2e..5ca0130f0d 100644
--- a/src/mapi/glapi/gen/glX_proto_send.py
+++ b/src/mapi/glapi/gen/glX_proto_send.py
@@ -316,7 +316,8 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto):
generated_stubs = []
for func in api.functionIterateGlx():
- if func.client_handcode: continue
+ if func.client_handcode:
+ continue
# If the function is a pixel function with a certain
# GLX protocol signature, create a fake stub function
@@ -834,7 +835,8 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto):
print '}'
- if trailer: print trailer
+ if trailer:
+ print trailer
def printRenderFunction(self, f):
# There is a class of GL functions that take a single pointer
@@ -887,7 +889,8 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto):
print '__indirect_glFinish();'
print 'printf( "Exit %%s.\\n", "gl%s" );' % (f.name)
- if trailer: print trailer
+ if trailer:
+ print trailer
class PrintGlxProtoInit_c(gl_XML.gl_print_base):
diff --git a/src/mapi/glapi/gen/glX_proto_size.py b/src/mapi/glapi/gen/glX_proto_size.py
index 9ece1e1914..c73aaf4468 100644
--- a/src/mapi/glapi/gen/glX_proto_size.py
+++ b/src/mapi/glapi/gen/glX_proto_size.py
@@ -455,10 +455,12 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
enum_sigs = {}
for func in api.functionIterateGlx():
- if not func.has_variable_size_request(): continue
+ if not func.has_variable_size_request():
+ continue
ef = glx_server_enum_function(func, api.enums_by_name)
- if len(ef.enums) == 0: continue
+ if len(ef.enums) == 0:
+ continue
sig = ef.signature()
@@ -476,8 +478,8 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
# probably wouldn't need to be handcoded in the first
# place!
- if func.server_handcode: continue
- if not func.has_variable_size_request(): continue
+ if func.server_handcode or not func.has_variable_size_request():
+ continue
if enum_functions.has_key(func.name):
sig = enum_functions[func.name]
@@ -492,7 +494,8 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
self.printPixelFunction(func)
elif func.has_variable_size_request():
a = self.printCountedFunction(func)
- if a: aliases.append(a)
+ if a:
+ aliases.append(a)
for [alias_name, real_name] in aliases:
print 'ALIAS( %s, %s )' % (alias_name, real_name)
@@ -581,7 +584,8 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
params.append(p)
elif p.counter:
s = p.size()
- if s == 0: s = 1
+ if s == 0:
+ s = 1
sig += "(%u,%u)" % (f.offset_of(p.counter), s)
size += '%s%s' % (plus, p.size_string())
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index 74b5e5a31d..3a029cbc00 100644
--- a/src/mapi/glapi/gen/gl_XML.py
+++ b/src/mapi/glapi/gen/gl_XML.py
@@ -307,7 +307,8 @@ def create_parameter_string(parameters, include_names):
else:
list.append(p.type_string())
- if len(list) == 0: list = ["void"]
+ if not list:
+ list = ["void"]
return ', '.join(list)