Commit a5712c7d authored by Dylan Baker's avatar Dylan Baker Replace use of Long type

Python3 doesn't have long types (ints will now grow until you run out of
memory). Use bit shifting instead.

This produces the same output before and after

Thanks to Jason Ekstrand for help with this.
Signed-off-by: default avatarDylan Baker <>
Reviewed-by: Jordan Justen's avatarJordan Justen <>
parent b1bce973
......@@ -114,7 +114,7 @@ def pow(val, pow):
def rotate_right(x, n, bits):
# Find all bits that will wrap
mask = (2L**n) - 1
mask = (1 << n) - 1
wrapped_bits = x & mask
# sign extension needs to be masked out
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment