[Mesa-dev] [PATCH 04/41] glapi: remove unnecessary semi-colons in python

Dylan Baker baker.dylan.c at gmail.com
Fri Apr 1 00:04:21 UTC 2016


They don't do anything, they're not required, and they look weird. The
only use for semi-colons in python is to put two statements in a single
line, which is quite frowned upon by the python community.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 src/mapi/glapi/gen/glX_proto_size.py   | 24 ++++++++++++------------
 src/mapi/glapi/gen/glX_server_table.py |  8 ++++----
 src/mapi/glapi/gen/gl_XML.py           | 10 +++++-----
 src/mapi/glapi/gen/gl_apitemp.py       |  2 +-
 src/mapi/glapi/gen/gl_enums.py         |  2 +-
 src/mapi/glapi/gen/remap_helper.py     |  2 +-
 6 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/mapi/glapi/gen/glX_proto_size.py b/src/mapi/glapi/gen/glX_proto_size.py
index bc64f0c..cdae554 100644
--- a/src/mapi/glapi/gen/glX_proto_size.py
+++ b/src/mapi/glapi/gen/glX_proto_size.py
@@ -142,15 +142,15 @@ class glx_enum_function(object):
         for i in [1, 2, 3, 4, 5, 6, 7, 8]:
             mask = (1 << i) - 1
 
-            fail = 0;
+            fail = 0
             for a in self.enums:
                 for b in self.enums:
                     if a != b:
                         if (a & mask) == (b & mask):
-                            fail = 1;
+                            fail = 1
 
             if not fail:
-                break;
+                break
             else:
                 mask = 0
 
@@ -159,8 +159,8 @@ class glx_enum_function(object):
             masked_count = {}
 
             for i in range(0, mask + 1):
-                masked_enums[i] = "0";
-                masked_count[i] = 0;
+                masked_enums[i] = "0"
+                masked_count[i] = 0
 
             for c in self.count:
                 for e in self.count[c]:
@@ -183,9 +183,9 @@ class glx_enum_function(object):
             print '    const unsigned idx = (e & 0x%02xU);' % (mask)
             print ''
             print '    return (e == a[idx]) ? (GLint) b[idx] : 0;'
-            return 1;
+            return 1
         else:
-            return 0;
+            return 0
 
 
     def PrintUsingSwitch(self, name):
@@ -258,7 +258,7 @@ class glx_server_enum_function(glx_enum_function):
 
             self.sig = sig
 
-        return self.sig;
+        return self.sig
 
 
     def Print(self, name, printer):
@@ -384,9 +384,9 @@ class PrintGlxSizeStubs_h(PrintGlxSizeStubs_common):
 """
         print '#include <X11/Xfuncproto.h>'
         print ''
-        self.printPure();
+        self.printPure()
         print ''
-        self.printFastcall();
+        self.printFastcall()
         print ''
 
 
@@ -543,7 +543,7 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
         offset = p.offset
         dst = p.string()
         src = '(%s *)' % (p.type_string())
-        print '%-18s = *%11s(%s + %u);' % (dst, src, pc, offset + adjust);
+        print '%-18s = *%11s(%s + %u);' % (dst, src, pc, offset + adjust)
         return
 
 
@@ -631,7 +631,7 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
         # it to the list of function aliases.
 
         if self.counter_sigs.has_key(sig):
-            n = self.counter_sigs[sig];
+            n = self.counter_sigs[sig]
             alias = [f.name, n]
         else:
             alias = None
diff --git a/src/mapi/glapi/gen/glX_server_table.py b/src/mapi/glapi/gen/glX_server_table.py
index 0d0c2bc..a9db87f 100644
--- a/src/mapi/glapi/gen/glX_server_table.py
+++ b/src/mapi/glapi/gen/glX_server_table.py
@@ -101,8 +101,8 @@ class function_table:
         empty_children = 0
 
         for M in range(0, remaining_bits):
-            op_count = 1 << (remaining_bits - M);
-            child_count = 1 << M;
+            op_count = 1 << (remaining_bits - M)
+            child_count = 1 << M
 
             empty_children = 0
             full_children = 0
@@ -112,9 +112,9 @@ class function_table:
 
                 for j in range(i, i + op_count):
                     if self.functions.has_key(j):
-                        used += 1;
+                        used += 1
                     else:
-                        empty += 1;
+                        empty += 1
 
 
                 if empty == op_count:
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index 3a0c992..b4487cb 100644
--- a/src/mapi/glapi/gen/gl_XML.py
+++ b/src/mapi/glapi/gen/gl_XML.py
@@ -53,7 +53,7 @@ def parse_GL_API( file_name, factory = None ):
 
     for func in api.functionIterateByCategory():
         if func.assign_offset:
-            func.offset = api.next_offset;
+            func.offset = api.next_offset
             api.next_offset += 1
 
     return api
@@ -142,7 +142,7 @@ class gl_print_base(object):
             print '#if !defined( %s )' % (self.header_tag)
             print '#  define %s' % (self.header_tag)
             print ''
-        self.printRealHeader();
+        self.printRealHeader()
         return
 
 
@@ -779,9 +779,9 @@ class gl_function( gl_item ):
 
     def parameterIterator(self, name = None):
         if name is not None:
-            return self.entry_point_parameters[name].__iter__();
+            return self.entry_point_parameters[name].__iter__()
         else:
-            return self.parameters.__iter__();
+            return self.parameters.__iter__()
 
 
     def get_parameter_string(self, entrypoint = None):
@@ -1016,7 +1016,7 @@ class gl_api(object):
             if temp[i]:
                 list.append(temp[i])
 
-        return list.__iter__();
+        return list.__iter__()
 
 
     def functionIterateAll(self):
diff --git a/src/mapi/glapi/gen/gl_apitemp.py b/src/mapi/glapi/gen/gl_apitemp.py
index 9147fea..e80b5b3 100644
--- a/src/mapi/glapi/gen/gl_apitemp.py
+++ b/src/mapi/glapi/gen/gl_apitemp.py
@@ -83,7 +83,7 @@ class PrintGlOffsets(gl_XML.gl_print_base):
             o_string = o_string + comma + cast + p.name
             comma = ", "
 
-            silence += "%s(void) %s;" % (space, p.name);
+            silence += "%s(void) %s;" % (space, p.name)
             space = ' '
 
 
diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.py
index 3fbf0b0..d23e783 100644
--- a/src/mapi/glapi/gen/gl_enums.py
+++ b/src/mapi/glapi/gen/gl_enums.py
@@ -149,7 +149,7 @@ _mesa_lookup_prim_by_nr(GLuint nr)
 
         sorted_enum_values = sorted(self.enum_table.keys())
         string_offsets = {}
-        i = 0;
+        i = 0
         print '#if defined(__GNUC__)'
         print '# define LONGSTRING __extension__'
         print '#else'
diff --git a/src/mapi/glapi/gen/remap_helper.py b/src/mapi/glapi/gen/remap_helper.py
index 287d583..688ac62 100644
--- a/src/mapi/glapi/gen/remap_helper.py
+++ b/src/mapi/glapi/gen/remap_helper.py
@@ -87,7 +87,7 @@ class PrintGlRemap(gl_XML.gl_print_base):
         print 'static const char _mesa_function_pool[] ='
 
         # output string pool
-        index = 0;
+        index = 0
         for f in api.functionIterateAll():
             pool_indices[f] = index
 
-- 
2.8.0



More information about the mesa-dev mailing list