python: Use explicit integer divisions
[mesa.git] / src / gallium / auxiliary / util / u_format_parse.py
index c0456f6d15966670056dd73a9cec955897dc986b..d3874cd895b8d3e55ca73be2c59bea74cee2be46 100644 (file)
@@ -29,6 +29,9 @@
 '''
 
 
+from __future__ import division
+
+
 VOID, UNSIGNED, SIGNED, FIXED, FLOAT = range(5)
 
 SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W, SWIZZLE_0, SWIZZLE_1, SWIZZLE_NONE, = range(7)
@@ -76,7 +79,7 @@ class Channel:
         if self.type == FLOAT:
             return VERY_LARGE
         if self.type == FIXED:
-            return (1 << (self.size/2)) - 1
+            return (1 << (self.size // 2)) - 1
         if self.norm:
             return 1
         if self.type == UNSIGNED:
@@ -90,7 +93,7 @@ class Channel:
         if self.type == FLOAT:
             return -VERY_LARGE
         if self.type == FIXED:
-            return -(1 << (self.size/2))
+            return -(1 << (self.size // 2))
         if self.type == UNSIGNED:
             return 0
         if self.norm: