glthread: sync in glFlush for multiple contexts
[mesa.git] / src / mapi / glapi / gen / typeexpr.py
index 6cc71cbf91f921483e2b2c82b970a2ac02cdc284..1f710ea9e7952b0425097998da0f203f3c632845 100644 (file)
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 
 # (C) Copyright IBM Corporation 2005
 # All Rights Reserved.
 # Authors:
 #    Ian Romanick <idr@us.ibm.com>
 
-import string, copy
+from __future__ import print_function
 
-class type_node:
+import copy
+
+class type_node(object):
     def __init__(self):
         self.pointer = 0  # bool
         self.const = 0    # bool
@@ -65,7 +66,7 @@ class type_node:
         return s
 
 
-class type_table:
+class type_table(object):
     def __init__(self):
         self.types_by_name = {}
         return
@@ -109,7 +110,7 @@ def create_initial_types():
     return
 
 
-class type_expression:
+class type_expression(object):
     built_in_types = None
 
     def __init__(self, type_string, extra_types = None):
@@ -125,7 +126,7 @@ class type_expression:
 
         # Replace '*' with ' * ' in type_string.  Then, split the string
         # into tokens, separated by spaces.
-        tokens = string.split( string.replace( type_string, "*", " * " ) )
+        tokens = type_string.replace("*", " * ").split()
 
         const = 0
         t = None
@@ -287,6 +288,6 @@ if __name__ == '__main__':
     create_initial_types()
 
     for t in types_to_try:
-        print 'Trying "%s"...' % (t)
+        print('Trying "%s"...' % (t))
         te = type_expression( t )
-        print 'Got "%s" (%u, %u).' % (te.string(), te.get_stack_size(), te.get_element_size())
+        print('Got "%s" (%u, %u).' % (te.string(), te.get_stack_size(), te.get_element_size()))